/* Fredoka, served from this site (not Google's servers, so visitors' addresses aren't sent to Google).
   SIL Open Font License, see fonts/OFL.txt. One variable file covers weights 400 to 700. */
@font-face {
  font-family: Fredoka;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/fredoka-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Fredoka;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/fredoka-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}


:root {
  --ink: #2c1f14;
  --ink-soft: #6a5240;
  --paper: #fbf3e4;
  --panel: rgba(251, 243, 228, 0.96);
  --line: #d9c3a0;
  --primary: #3d7a3a;
  --primary-dark: #285626;
  --gold: #f2b52e;
  --silver: #b9c3cc;
  --bronze: #c98a4b;
  --shadow: 0 5px 0 rgba(44, 31, 20, 0.25), 0 12px 30px rgba(44, 31, 20, 0.25);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #5f8a40;
  color: var(--ink);
  font-family: Fredoka, system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

canvas#view { position: fixed; inset: 0; display: block; touch-action: none; cursor: crosshair; }

[hidden] { display: none !important; }

.screen, #modal {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(44, 31, 20, 0.35); z-index: 10;
}
#modal { z-index: 20; }

.card {
  background: var(--panel); border-radius: 22px; box-shadow: var(--shadow); padding: 22px 24px;
  max-width: 560px; width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; text-align: center;
}
.title-card h1 { font-size: 56px; margin: 4px 0 6px; letter-spacing: 0.5px; color: #6b3f1f; }
.lede { font-size: 19px; margin: 0 0 14px; color: var(--ink-soft); }
.small { font-size: 14px; color: var(--ink-soft); margin: 8px 0; }
h2 { margin: 0 0 8px; font-size: 28px; }

.btn {
  font: inherit; font-size: 16px; font-weight: 600; border: 0; border-radius: 14px; padding: 10px 18px; margin: 6px 4px;
  background: #e9dcc5; color: var(--ink); box-shadow: 0 4px 0 rgba(44, 31, 20, 0.25); cursor: pointer;
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(44, 31, 20, 0.25); }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 4px 0 var(--primary-dark); }
.btn.big { font-size: 20px; padding: 13px 28px; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.privacy { margin-top: 14px; font-size: 13px; color: var(--ink-soft); }
.privacy summary { cursor: pointer; }

#hud {
  position: fixed; top: 0; left: 0; right: 0; display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px;
  z-index: 5; pointer-events: none; flex-wrap: wrap;
}
#hud .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  pointer-events: auto; background: var(--panel); border-radius: 14px; padding: 7px 12px; box-shadow: 0 3px 0 rgba(44, 31, 20, 0.25);
  font-size: 16px; font-weight: 600; white-space: nowrap;
}
.pill.btn { margin: 0; font-size: 16px; }
.pill.info { text-align: left; }
.pill .where { font-size: 14px; color: var(--ink-soft); }
.pill .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #e0452b; vertical-align: middle; }
.medal-now { font-size: 12px; border-radius: 8px; padding: 1px 7px; margin-left: 4px; color: #2c1f14; }
.medal-now.gold { background: var(--gold); }
.medal-now.silver { background: var(--silver); }
.medal-now.bronze { background: var(--bronze); }
.medal-now.none { background: #ddd; color: #777; }
.plain {
  pointer-events: auto; font-size: 18px; font-weight: 600; color: #fff6dc; white-space: nowrap; padding: 6px 4px;
  text-shadow: 0 1px 0 rgba(40, 25, 10, 0.8), 0 0 6px rgba(40, 25, 10, 0.6);
}
.plain.where { font-size: 15px; opacity: 0.92; }
.plain-btn {
  pointer-events: auto; background: none; border: none; font: inherit; font-size: 17px; font-weight: 600; color: #fff6dc;
  padding: 6px 8px; cursor: pointer; text-shadow: 0 1px 0 rgba(40, 25, 10, 0.8), 0 0 6px rgba(40, 25, 10, 0.6);
  text-decoration: underline; text-decoration-color: rgba(255, 246, 220, 0.4); text-underline-offset: 4px;
}
.plain-btn.big { font-size: 22px; text-decoration-color: rgba(242, 181, 46, 0.9); }
#modal.scene { background: radial-gradient(ellipse at center, rgba(30, 20, 10, 0.45), rgba(30, 20, 10, 0.1) 70%); }
.scene-end { text-align: center; color: #fff6dc; max-width: 520px; text-shadow: 0 1px 0 rgba(40, 25, 10, 0.9), 0 0 10px rgba(40, 25, 10, 0.7); }
.scene-end h2 { font-size: 32px; margin: 8px 0; color: #fff6dc; }
.scene-end p { font-size: 17px; margin: 6px 0; }
.scene-end .paid { font-size: 28px; font-weight: 700; color: #f7d58c; }
.scene-end .ways { display: flex; gap: 18px; justify-content: center; margin-top: 10px; }
.stamp {
  display: inline-block; font-size: 22px; font-weight: 700; padding: 10px 18px; border: 4px solid currentColor; border-radius: 50%;
  transform: rotate(-8deg); animation: stamp 0.35s ease-out; text-shadow: none;
}
.stamp.gold { color: #f2b52e; } .stamp.silver { color: #dfe5ea; } .stamp.bronze { color: #d39a5e; }
@keyframes stamp { from { transform: rotate(-8deg) scale(2.2); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: 1; } }
.ladder { font-size: 13px; white-space: normal; max-width: 520px; line-height: 1.7; }
.ladder .medal-now { margin-left: 8px; }
.ladder .medal-now:first-child { margin-left: 0; }
.ladder .step { color: var(--ink-soft); margin-left: 4px; }
.ladder .step.ok { color: #3f6b1f; font-weight: 700; }

#toolbar {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; gap: 8px; justify-content: center; padding: 10px 12px 14px;
  z-index: 5; pointer-events: none; flex-wrap: wrap;
}
.tool {
  pointer-events: auto; font: inherit; font-size: 12px; font-weight: 600; border: 0; border-radius: 14px; padding: 4px 8px 6px;
  background: var(--panel); box-shadow: 0 3px 0 rgba(44, 31, 20, 0.25); cursor: pointer; display: flex; flex-direction: column;
  align-items: center; min-width: 76px; color: var(--ink);
}
.tool.on { background: #fff6d6; outline: 3px solid var(--gold); }

#toasts { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100% - 32px)); pointer-events: none; }
.toast { background: rgba(44, 31, 20, 0.88); color: #fff6e4; padding: 10px 14px; border-radius: 12px; font-size: 15px; transition: opacity 0.4s; text-align: center; }
.toast.out { opacity: 0; }

.medal { display: inline-block; font-size: 22px; font-weight: 700; padding: 6px 22px; border-radius: 999px; margin: 6px 0; }
.medal.gold { background: var(--gold); }
.medal.silver { background: var(--silver); }
.medal.bronze { background: var(--bronze); }
.medal.none { background: #e2d7c6; color: var(--ink-soft); }
table.pay { margin: 10px auto; border-collapse: collapse; min-width: 260px; font-size: 16px; }
table.pay td { padding: 3px 8px; text-align: left; }
table.pay td:last-child { text-align: right; }
table.pay tr.total td { border-top: 2px solid var(--line); font-weight: 700; }
.cordbar { height: 12px; background: #e2d7c6; border-radius: 6px; overflow: hidden; margin: 8px auto 0; max-width: 320px; }
.cordbar div { height: 100%; background: #9a6a3a; }

.shop { text-align: left; margin: 10px 0; }
.shop-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.shop-text { flex: 1; min-width: 0; }
.shop-text .maker { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); }
.shop-text .name { font-size: 18px; font-weight: 700; }
.shop-text .blurb { font-size: 14px; color: var(--ink-soft); }
.shop-text .stats { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
@media (max-width: 520px) {
  .shop-row { flex-wrap: wrap; }
  .pill { font-size: 14px; padding: 6px 10px; }
  .title-card h1 { font-size: 44px; }
}

.stages { display: flex; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.stage { flex: 1 1 200px; background: #f3e7d2; border-radius: 16px; padding: 14px; text-align: center; }
.stage-name { font-size: 22px; font-weight: 700; }
.stage .btn { margin-top: 10px; }
#toolbar.stackbar { gap: 10px; }
.tool.wide { font-size: 26px; line-height: 1; min-width: 72px; padding: 8px 10px 6px; }
.tool.wide span { font-size: 12px; margin-top: 3px; }
.tool.done { background: #dff0d4; }
.tool:disabled { opacity: 0.5; cursor: default; }
.btn .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #e0452b; vertical-align: middle; }
.stage .btn { display: block; width: 100%; margin: 10px 0 2px; }
.bases { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 12px 0; }
.stage.base { border: 0; font: inherit; cursor: pointer; color: var(--ink); box-shadow: 0 3px 0 rgba(44, 31, 20, 0.2); }
.stage.base:hover { background: #fff3d6; }
.tool.on { background: #fff6d6; outline: 3px solid var(--gold); }
#title, #modal { background: rgba(44, 31, 20, 0.25); }
.shop-pics { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #fff8ea; border-radius: 10px; padding: 4px; }
.shop-text .spec { font-size: 13px; color: var(--ink); }
@media (max-width: 520px) { .shop-pics { width: 100%; } }
#hud .pill.info { white-space: normal; min-width: 0; flex: 1 1 180px; }

/* status reads as status, buttons as buttons */
#hud .pill:not(.btn) { box-shadow: none; background: rgba(251, 243, 228, 0.86); pointer-events: none; }
#hud .pill.btn { border: 2px solid rgba(61, 122, 58, 0.55); }
.medal-now.none { background: #cfc6b8; color: #4a3b2c; }
.swingmeter { min-width: 170px; }
.swingmeter .bar { position: relative; height: 10px; border-radius: 5px; background: #e2d7c6; overflow: hidden; margin: 4px 0 3px; }
.swingmeter .seg { position: absolute; top: 0; bottom: 0; }
.swingmeter .seg.gold { background: var(--gold); }
.swingmeter .seg.silver { background: var(--silver); }
.swingmeter .seg.bronze { background: var(--bronze); }
.swingmeter .mark { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px; background: #2c1f14; border-radius: 2px; }
.swingmeter .swings { font-size: 13px; }
.toast.bottom { position: fixed; left: 50%; transform: translateX(-50%); z-index: 30; width: min(520px, calc(100% - 32px)); pointer-events: none; }

/* No boxes anywhere: menus, notices and the HUD are text on the scene, over a soft shade where they need it
   (Jesse, 2026-11-08: "still too many cards", "too cluttered"). */
#title, #modal { background: radial-gradient(ellipse 75% 65% at 50% 50%, rgba(30, 20, 10, 0.66), rgba(30, 20, 10, 0.22) 75%, rgba(30, 20, 10, 0.08)); }
.card { background: none; box-shadow: none; color: #fff6dc; text-shadow: 0 1px 0 rgba(30, 18, 8, 0.9), 0 0 8px rgba(30, 18, 8, 0.6); }
.card h1, .card h2, .card .stage-name, .card .name { color: #fff6dc; }
.card .small, .card .lede, .card .privacy, .card .where, .card summary,
.shop-text .maker, .shop-text .blurb, .shop-text .stats, .shop-text .spec { color: rgba(255, 246, 220, 0.86); }
.card a { color: #f7d58c; }
.stage { background: none; padding: 4px 10px; }
.stage.base { box-shadow: none; color: #fff6dc; border-radius: 10px; }
.stage.base:hover { background: rgba(255, 246, 220, 0.1); }
.shop-row { border-top-color: rgba(255, 246, 220, 0.22); }
.shop-pics { background: none; }
table.pay tr.total td { border-top-color: rgba(255, 246, 220, 0.4); }
.btn:not(.primary) { background: none; color: #fff6dc; box-shadow: none; border: 2px solid rgba(255, 246, 220, 0.55); text-shadow: inherit; }
.btn { text-shadow: none; }
.toast {
  background: none; color: #fff6dc; font-size: 17px; font-weight: 600; padding: 4px 8px;
  text-shadow: 0 1px 0 rgba(30, 18, 8, 0.95), 0 0 6px rgba(30, 18, 8, 0.85), 0 0 14px rgba(30, 18, 8, 0.6);
}
#hud .pill, #hud .pill:not(.btn) {
  background: none; box-shadow: none; border: none; color: #fff6dc;
  text-shadow: 0 1px 0 rgba(30, 18, 8, 0.9), 0 0 8px rgba(30, 18, 8, 0.6);
}
#hud .pill .where { color: rgba(255, 246, 220, 0.86); }
#hud .pill.btn { text-decoration: underline; text-decoration-color: rgba(255, 246, 220, 0.4); text-underline-offset: 4px; }
#hud .pill.btn { background: none; box-shadow: none; border: none; }
.tool { background: rgba(30, 20, 10, 0.18); box-shadow: none; color: #fff6dc; border: 2px solid rgba(255, 246, 220, 0.5); text-shadow: 0 1px 0 rgba(30, 18, 8, 0.9); }
.tool.on { background: rgba(242, 181, 46, 0.25); outline: none; border-color: var(--gold); }

/* keyboard players (Tab and Enter): a clear ring on the button Enter would press, in the hot colour */
button:focus-visible, a:focus-visible, .btn:focus-visible { outline: 3px solid #ffcf3a; outline-offset: 2px; }
