@font-face { font-family: 'VT323'; src: url('fonts/vt323.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --ink: #07050F;
  --panel: rgba(16, 11, 36, .84);
  --panel-solid: #120C28;
  --ring: #33285A;
  --text: #EEE6FA;
  --muted: #A094C4;
  --dim: #6F6496;
  --lime: #A6E56A;
  --lime-deep: #10250C;
  --amber: #FFC266;
  --pink: #FF6F9F;
  /* rarity tiers */
  --t-common: #9C93B8;
  --t-uncommon: #4FB868;
  --t-rare: #4FA8F0;
  --t-super: #B479F2;
  --t-mega: #FFC266;
  --font: 'VT323', ui-monospace, monospace;
  --kb: 0px;                       /* on-screen keyboard height (set from JS on iOS) */
  --pad-x: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
  --dur: 1;                        /* animation speed multiplier (reduced motion sets 0.01) */
  --rings: 0 0 0 2px var(--ink), 0 0 0 4px var(--ring);
}
@media (prefers-reduced-motion: reduce) { :root { --dur: 0.01; } }
html.still { --dur: 0.01; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #140C2E; overflow: hidden; overscroll-behavior: none; }
body { font-family: var(--font); font-size: 20px; color: var(--text); -webkit-tap-highlight-color: transparent; touch-action: manipulation; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 6px; }
.micro { font-size: clamp(15px, 1.8vh, 18px); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.accent { color: var(--lime); }
.amber { color: var(--amber); }

/* ---------- the world (sprites are positioned from JS with transforms only) ---------- */
#world { position: fixed; top: 0; bottom: 0; left: var(--fx, 0px); width: var(--fw, 100%); overflow: hidden; contain: strict; background: #0C1330; }
#world > * { position: absolute; left: 0; top: 0; }
#fx { z-index: 2; }
#bg { image-rendering: pixelated; max-width: none; }
/* the scene is decoration: nothing in it can be dragged or selected */
#world { pointer-events: none; user-select: none; -webkit-user-select: none; }
#world img, #world svg { -webkit-user-drag: none; user-drag: none; }
/* nothing on the page highlights when you click or drag, except the answer box */
body { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
input { user-select: text; -webkit-user-select: text; -webkit-touch-callout: default; }
#sprite-defs { position: absolute; }
.sprite { position: absolute; left: 0; top: 0; will-change: transform, opacity; }
.sprite svg { display: block; width: 100%; height: 100%; overflow: visible; shape-rendering: crispEdges; }
#pads .sprite svg, #player svg { filter: drop-shadow(0 3px 0 rgba(6, 8, 26, .45)); }
#pads .sprite, #player, #crocs .sprite { transition: transform calc(.55s * var(--dur)) cubic-bezier(.3, .7, .3, 1), opacity calc(.4s * var(--dur)); }
#world.instant .sprite { transition: none !important; }
.croc svg { animation: bob calc(2.4s * var(--dur)) steps(2) infinite; }
@keyframes bob { 50% { transform: translateY(6%); } }
#fx .jaw { display: block; width: 100%; will-change: transform; transform: translateY(100%); }
#fx .drop, #fx .spark { background: #FFF3A8; box-shadow: 0 0 6px 2px rgba(255, 226, 130, .55); }
.bank-glow { opacity: 0; transition: opacity calc(1.4s * var(--dur)) ease-out; }
.lit .bank-glow { opacity: 1; animation: lanterns 3.6s ease-in-out infinite alternate; }
@keyframes lanterns { from { opacity: .75; } to { opacity: 1; } }
#fx .bub { position: absolute; left: 0; top: 0; will-change: transform, opacity; }
#fx .drop { background: linear-gradient(#F2FBFF 55%, #9FD3EA 55%); }
#fx .bub { background: transparent; box-shadow: inset 0 0 0 1px rgba(214, 242, 255, .9); }
.fly { position: absolute; width: 4px; height: 4px; background: #FFF8C8; box-shadow: 0 0 8px 3px rgba(255, 236, 150, .35); animation: blink 3.2s steps(4) infinite; will-change: opacity; }
@keyframes blink { 0%, 100% { opacity: .1; } 50% { opacity: .95; } }

/* faint scanlines + edge vignette, like an old monitor */
.crt { position: fixed; top: 0; bottom: 0; left: var(--fx, 0px); width: var(--fw, 100%); pointer-events: none; z-index: 1;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, .09) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(5, 3, 16, .5) 100%); }

/* ---------- screens ---------- */
.screen {
  position: fixed; top: 0; bottom: 0; left: var(--fx, 0px); width: var(--fw, 100%); z-index: 2; display: flex; flex-direction: column; align-items: center;
  padding: max(16px, env(safe-area-inset-top)) var(--pad-x) 0;
  pointer-events: none;
}
.screen > * { pointer-events: auto; }
.grow { flex: 1; pointer-events: none !important; }
.dock { width: min(560px, 100%); display: flex; flex-direction: column; gap: 18px; padding-bottom: max(24px, calc(env(safe-area-inset-bottom) + 14px)); }

.panel { background: var(--panel); box-shadow: var(--rings); }

/* buttons */
.btn { font-family: var(--font); border: 0; cursor: pointer; color: var(--text); background: var(--panel); box-shadow: var(--rings);
  text-transform: uppercase; letter-spacing: .2em; transition: background .15s, box-shadow .15s, color .15s; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-main { width: 100%; height: clamp(56px, 7.5vh, 70px); font-size: clamp(24px, 3.4vh, 32px); color: #E9FFD4;
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--lime), 0 0 22px rgba(166, 229, 106, .28); }
.btn-alt { width: 100%; height: clamp(50px, 6.5vh, 60px); display: flex; align-items: center; justify-content: center; gap: 14px;
  font-size: clamp(21px, 2.8vh, 26px); color: #FFE3B8; box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--amber), 0 0 18px rgba(255, 194, 102, .22); }
.btn-alt .micro { font-size: 13px; color: var(--amber); letter-spacing: .16em; }
.btn-small { height: 38px; padding: 0 14px; font-size: 16px; color: var(--muted); }
.btn-go { height: 56px; padding: 0 22px; font-size: 28px; color: var(--lime-deep); background: var(--lime);
  box-shadow: 0 0 0 2px var(--ink), inset 0 -4px 0 rgba(0, 0, 0, .2), 0 0 16px rgba(166, 229, 106, .3); }
@media (hover: hover) {
  .btn-main:hover { background: rgba(28, 44, 30, .9); }
  .btn-small:hover:not(:disabled) { color: var(--text); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--muted); }
  .btn-go:hover { background: #BDF286; }
  .btn-alt:hover { background: rgba(48, 34, 18, .9); }
}
.link { background: none; border: 0; padding: 0; font: inherit; letter-spacing: inherit; color: var(--muted); cursor: pointer; }
.link:hover { color: var(--text); }
.foot { display: flex; justify-content: space-between; gap: 12px; }

/* home */
.home-title { margin-top: clamp(28px, 9vh, 110px); display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 1.2vh, 14px); text-align: center; }
.logo { margin: 0; font-weight: 400; font-size: clamp(64px, min(13vh, 17vw), 150px); line-height: .9; letter-spacing: .06em; color: #F6EEFF;
  text-shadow: -3px 0 rgba(255, 111, 159, .85), 3px 0 rgba(120, 232, 160, .75), 0 0 26px rgba(255, 190, 130, .25); }
.logo span { white-space: nowrap; }
.subtitle { font-size: clamp(20px, 2.8vh, 28px); letter-spacing: .5em; padding-left: .5em; color: var(--lime); text-shadow: 0 0 12px rgba(166, 229, 106, .35); }
.tagline { margin: 4px 0 0; font-size: clamp(17px, 2.2vh, 22px); letter-spacing: .08em; color: #D6C9EE; text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.row-btns { display: flex; gap: 14px; }
.row-btns .btn { flex: 1; }

/* hud */
.hud { width: min(760px, 100%); display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 12px; }
.stat { justify-self: start; min-width: 96px; padding: 6px 14px 4px; display: flex; flex-direction: column; background: var(--panel); box-shadow: var(--rings); }
.stat.right { justify-self: end; text-align: right; }
.stat .micro { font-size: 13px; }
.stat b { font-weight: 400; font-size: 32px; line-height: 1; color: var(--lime); }
.stat b.amber { color: var(--amber); }
.hud-mid { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 4px; }
.hud-mid .micro { font-size: 13px; }
@media (max-width: 480px) {
  .hud { gap: 8px; }
  .stat { min-width: 64px; padding: 5px 10px 3px; }
  .stat b { font-size: 26px; }
  .trail { gap: 4px; }
}
@media (max-width: 420px) { .foot .hide-narrow { display: none; } }
.trail { display: flex; gap: 5px; }
.trail i { width: clamp(10px, 1.7vh, 16px); height: clamp(10px, 1.7vh, 16px); background: rgba(40, 32, 76, .9); box-shadow: 0 0 0 2px var(--ink); }
.trail i.now { background: var(--text); box-shadow: 0 0 0 2px var(--ink), 0 0 8px rgba(255, 255, 255, .5); }
.t-common { --t: var(--t-common); } .t-uncommon { --t: var(--t-uncommon); } .t-rare { --t: var(--t-rare); }
.t-super { --t: var(--t-super); } .t-mega { --t: var(--t-mega); } .t-chomp { --t: var(--pink); }
.trail i[class^="t-"], .tiles i[class^="t-"] { background: var(--t); }
.trail i.t-mega, .tiles i.t-mega { box-shadow: 0 0 0 2px var(--ink), 0 0 10px rgba(255, 194, 102, .6); }

/* the question and the reveal: no box, text straight on the water with a dark pixel outline */
.card { position: relative; margin-top: clamp(14px, 3vh, 34px); width: min(680px, calc(100% - 8px)); padding: 4px 8px 0; display: flex; flex-direction: column; align-items: center; gap: clamp(4px, .9vh, 10px); text-align: center;
  --edge: 2px 0 var(--ink), -2px 0 var(--ink), 0 2px var(--ink), 0 -2px var(--ink), 2px 2px var(--ink), -2px 2px var(--ink), 0 4px rgba(7, 5, 15, .55); }
.card > * { text-shadow: var(--edge); }
.card .micro { color: #CFC5EC; }
.card .micro.accent { color: var(--lime); }
.card-big { margin: 0; font-weight: 400; font-size: clamp(34px, 5.6vh, 58px); line-height: 1.02; color: #FFF6EA; letter-spacing: .02em; overflow-wrap: anywhere; }
.card-big.long { font-size: clamp(26px, 4vh, 42px); }
.sheet .card-big { text-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.heads { display: inline-flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; filter: drop-shadow(0 2px 0 var(--ink)); }
.heads svg { width: clamp(52px, 7.4vh, 78px); height: auto; shape-rendering: crispEdges; }
.tag { display: inline-block; padding: 2px 8px; margin-left: 8px; font-size: 14px; letter-spacing: .18em; color: var(--ink); vertical-align: 2px; }
/* cards slide down and fade in; transform + opacity only, so it runs on the GPU compositor */
.pop { animation: pop calc(.42s * var(--dur)) cubic-bezier(.16, 1, .3, 1) both; will-change: transform, opacity; }
@keyframes pop { from { opacity: 0; transform: translate3d(0, -18px, 0) scale(.985); } to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); } }
/* the 20-second clock: a thin bar under the question, seconds at its end */
.timer { display: none; position: relative; width: min(360px, 78%); height: 6px; margin-top: 6px; background: rgba(10, 8, 26, .9); box-shadow: 0 0 0 2px var(--ink); text-shadow: none; }
.timer i { display: block; height: 100%; background: var(--lime); transform-origin: left center; will-change: transform; }
.timer-secs { position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); font-weight: 400; font-size: clamp(24px, 3.2vh, 30px); line-height: 1; color: var(--lime); text-shadow: var(--edge); }
.card.timed .timer { display: block; }
.card.warn .timer i { background: var(--amber); } .card.warn .timer-secs { color: var(--amber); }
.card.danger .timer i { background: var(--pink); }
.card.danger .timer-secs { color: var(--pink); animation: tick calc(1s * var(--dur)) ease-out infinite; }
@keyframes tick { 0% { transform: translateY(-50%) scale(1.3); } 40%, 100% { transform: translateY(-50%) scale(1); } }
/* the reveal: your answer in its tier's colour, the points under it */
.card.reveal .card-big span { color: #FFF6EA; transition: color .12s; }
.card.reveal .card-big span.on { color: var(--t); }
.card.reveal.t-mega .card-big span.on { text-shadow: var(--edge), 0 0 18px rgba(255, 194, 102, .55); }
.card-pts { font-size: clamp(40px, 6.4vh, 64px); line-height: .9; color: var(--t, var(--amber)); }
.card.reveal #card-sub { letter-spacing: .16em; }
.card.reveal #card-sub .tier { font-weight: 400; color: var(--t); }
.card.reveal #card-sub .near { color: var(--pink); }
.card.reveal #card-sub b { font-weight: 400; color: var(--text); }
.card-croc { font-size: 15px; letter-spacing: .12em; color: var(--muted) !important; }
.card.chomp .card-big { color: var(--pink); }
.card.chomp #card-kicker { color: var(--pink); }
.card-big.wobble { animation: wobble calc(.5s * var(--dur)) ease-out .45s; }
@keyframes wobble { 0%, 100% { transform: none; } 25% { transform: rotate(-2deg) scale(1.04); } 60% { transform: rotate(1.5deg) scale(1.02); } }
.banner { position: absolute; left: 50%; top: 100%; margin-top: 14px; transform: translate(-50%, 0); padding: 4px 18px 2px; font-size: clamp(26px, 4vh, 40px); letter-spacing: .3em; padding-left: calc(18px + .3em); white-space: nowrap;
  color: var(--ink); background: var(--t-mega); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--t-mega), 0 0 26px rgba(255, 194, 102, .6); text-shadow: none; }
#dim { position: absolute; inset: 0; width: 100%; height: 100%; background: #07050F; opacity: 0; z-index: 1; pointer-events: none; }
#fx { z-index: 2; } #player { z-index: 2; }

/* poking the frog */
#world #player { pointer-events: auto; cursor: pointer; touch-action: manipulation; }
#fx .say { position: absolute; padding: 3px 10px 2px; font-family: var(--font); font-size: clamp(18px, 2.4vh, 24px); letter-spacing: .06em;
  color: var(--ink); background: #FFF6EA; box-shadow: 0 0 0 2px var(--ink); white-space: nowrap; will-change: transform, opacity; }
#fx .say::after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -5px; border: 5px solid transparent;
  border-top-color: #FFF6EA; filter: drop-shadow(0 2px 0 var(--ink)); }


/* answer bar */
.answer-bar {
  width: calc(100% + 2 * var(--pad-x)); margin-bottom: var(--kb);
  padding: 34px var(--pad-x) max(22px, calc(env(safe-area-inset-bottom) + 12px));
  background: linear-gradient(to bottom, rgba(8, 6, 20, 0), rgba(8, 6, 20, .88) 40%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.answer-bar > * { width: min(640px, 100%); }
.msg { min-height: 24px; font-size: 19px; letter-spacing: .04em; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.msg.bad { color: var(--pink); }
.chip { font-family: var(--font); font-size: 20px; letter-spacing: .06em; border: 0; cursor: pointer; padding: 2px 12px; color: var(--text); background: var(--panel-solid); box-shadow: var(--rings); }
.chip.first { color: var(--lime-deep); background: var(--lime); box-shadow: 0 0 0 2px var(--ink); }
.hint { font-size: 15px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.row { display: flex; gap: 14px; padding: 4px; }
#answer { flex: 1; min-width: 0; height: 56px; border: 0; padding: 0 16px; font-family: var(--font); font-size: max(26px, min(3.4vh, 32px)); letter-spacing: .04em; color: var(--text);
  background: rgba(10, 8, 26, .92); box-shadow: var(--rings), inset 0 -3px 0 rgba(166, 229, 106, .25); }
#answer::placeholder { color: var(--dim); }
#answer:focus { outline: none; box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--ring), inset 0 -3px 0 var(--lime); }
.shake { animation: shake calc(.3s * var(--dur)) steps(6); }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* result */
.res-card { margin-top: clamp(18px, 5vh, 60px); width: min(600px, 100%); min-height: 0; flex: 0 1 auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; overflow: hidden; }
.res-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.res-big { font-size: clamp(52px, 7.5vh, 76px); line-height: .95; color: #FFF6EA; text-shadow: -2px 0 rgba(255, 111, 159, .6), 2px 0 rgba(120, 232, 160, .5); }
.res-head .stat { box-shadow: var(--rings); }
.tiles { display: flex; gap: 6px; flex: none; }
.tiles.grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.tiles.grid i { height: 14px; }
.tiles i { flex: 1; height: 22px; background: rgba(10, 8, 26, .9); box-shadow: 0 0 0 2px var(--ink); }
.recap { margin: 0; padding: 0 6px 0 0; list-style: none; display: flex; flex-direction: column; min-height: 60px; overflow: auto; flex: 0 1 auto;
  scrollbar-width: thin; scrollbar-color: var(--ring) transparent; }
.recap li { display: grid; grid-template-columns: 30px 1fr auto; gap: 0 8px; padding: 6px 0; border-bottom: 1px dashed rgba(160, 148, 196, .25); }
.recap .n { color: var(--dim); }
.recap .a { color: var(--text); letter-spacing: .03em; }
.recap .r { font-size: 14px; letter-spacing: .16em; color: var(--t); align-self: center; text-align: right; }
.recap .c { grid-column: 2 / 4; color: var(--muted); font-size: 17px; }
.recap .chomped .a { color: var(--pink); }
.dists { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; flex: none; }
.dist { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 8px; background: rgba(10, 8, 26, .55); box-shadow: 0 0 0 2px var(--ink); min-width: 0; }
.dist-head { display: flex; justify-content: space-between; align-items: baseline; }
.dist-head .micro { font-size: 13px; }
.dist-head b { font-weight: 400; font-size: 26px; line-height: 1; color: var(--lime); }
.dist-head b.amber { color: var(--amber); }
.curve { position: relative; display: flex; align-items: flex-end; gap: 1px; height: clamp(40px, 7vh, 64px); margin-top: 14px; border-bottom: 2px solid var(--ring); }
.curve i { flex: 1; background: var(--ring); }
#dist-pads .curve i.on { background: #3E8F57; }
#dist-score .curve i.on { background: #B8873E; }
.curve.empty { margin-top: 0; height: 18px; border-bottom-style: dashed; }
.curve .you { position: absolute; bottom: 0; top: -16px; border-left: 2px solid var(--text); padding-left: 4px; font-size: 13px; letter-spacing: .16em; line-height: 1; color: var(--text); white-space: nowrap; }
.curve .you.flip { border-left: 0; border-right: 2px solid var(--text); padding: 0 4px 0 0; transform: translateX(-100%); }
.dist .note { font-size: 13px; letter-spacing: .12em; text-transform: none; }
#chart-note { font-size: 13px; text-align: center; margin-top: -8px; }
@media (max-width: 420px) { .dists { gap: 10px; } .dist { padding: 8px 8px 6px; } .dist-head b { font-size: 22px; } }
.res-actions { margin-top: 24px; }
.res-btns .btn-alt, .res-btns .btn-main { height: clamp(56px, 7.5vh, 70px); }

/* overlay */
.overlay { position: fixed; inset: 0; z-index: 5; background: rgba(8, 5, 20, .7); display: flex; align-items: center; justify-content: center; padding: 28px; }
.toast { position: fixed; left: 50%; bottom: 130px; transform: translateX(-50%); z-index: 6; padding: 8px 18px; font-size: 20px; letter-spacing: .12em; text-transform: uppercase; background: var(--panel-solid); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--lime); }

/* ---------- loading screen ---------- */
#boot { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: #140C2E; transition: opacity .35s; }
#boot.gone { opacity: 0; pointer-events: none; }
.boot-logo { font-size: clamp(44px, 9vw, 96px); letter-spacing: .06em; color: #F6EEFF; text-shadow: -3px 0 rgba(255, 111, 159, .85), 3px 0 rgba(120, 232, 160, .75); }
.boot-frog { image-rendering: pixelated; animation: boothop calc(.7s * var(--dur)) cubic-bezier(.3, 0, .7, 1) infinite alternate; }
#boot.failed .boot-frog { animation: none; filter: grayscale(.7); }
@keyframes boothop { from { transform: translateY(0) scale(1.06, .92); } to { transform: translateY(-26px) scale(.96, 1.05); } }

/* ---------- screens slide in ---------- */
.screen.enter > * { animation: enter calc(.32s * var(--dur)) cubic-bezier(.2, .8, .3, 1) both; }
@keyframes enter { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }

/* ---------- very wide monitors: the scene sits in a frame ---------- */
html.framed body { background: #0A0718 repeating-linear-gradient(45deg, rgba(51, 40, 90, .16) 0 2px, transparent 2px 14px); }
html.framed #world { box-shadow: 0 0 0 4px var(--ink), 0 0 0 8px var(--ring), 0 0 60px rgba(0, 0, 0, .6); }

/* ---------- keyboard hints (shown with a mouse, hidden on touch) ---------- */
kbd { display: none; font-family: var(--font); font-size: .55em; letter-spacing: .08em; margin-left: .7em; padding: 1px 7px; vertical-align: .18em; color: inherit; opacity: .6; box-shadow: 0 0 0 2px currentColor; }
html.keys kbd { display: inline-block; }
.btn-go kbd { opacity: .55; }

/* ---------- home: rank, streak, footer ---------- */
.rank { margin-top: clamp(4px, 1.4vh, 16px); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 16px; border: 0; font-family: var(--font); cursor: pointer; background: rgba(16, 11, 36, .6); box-shadow: var(--rings); }
.rank b { font-weight: 400; color: var(--amber); }
.rank-bar { display: block; width: min(300px, 62vw); height: 8px; background: rgba(10, 8, 26, .9); box-shadow: 0 0 0 2px var(--ink); overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--amber); transform-origin: left center; transition: transform .6s; }
.dimmer { color: var(--dim) !important; font-size: 13px !important; }
.streak { color: var(--amber); }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 13px; }
.links a, .sheet a { color: var(--muted); text-decoration: none; }
.links span { color: var(--dim); }
.foot { align-items: center; flex-wrap: wrap; }
.home-actions { gap: 14px; }
@media (hover: hover) {
  .rank:hover { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--amber); }
  .links a:hover, .sheet a:hover { color: var(--text); }
  .cell:hover:not(.on), .rowbtn:hover { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--muted); }
  .btn-main:hover { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--lime), 0 0 30px rgba(166, 229, 106, .45); }
}

/* ---------- the reveal's buttons ---------- */
.next-row { align-items: center; gap: 16px; padding: 4px; }
.next-row .btn-main { flex: 1; }
.next-row .link { white-space: nowrap; font-size: 13px; }
.msg .link { text-decoration: underline; font-size: 14px; }

/* ---------- results ---------- */
.tiles i.in { animation: tile calc(.3s * var(--dur)) cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes tile { from { opacity: 0; transform: translateY(-8px) scale(.6); } to { opacity: 1; transform: none; } }
#res-best { margin-top: -6px; letter-spacing: .12em; }
#res-best b, #stat-rarest b { font-weight: 400; color: var(--t); }
.res-actions .foot { gap: 6px 14px; }

/* ---------- overlays: how to play, pond, stats, more swamps, settings ---------- */
.sheet { width: min(560px, 100%); max-height: 100%; overflow: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; scrollbar-color: var(--ring) transparent; }
.sheet.wide { width: min(760px, 100%); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.how-list { margin: 0; padding-left: 26px; display: flex; flex-direction: column; gap: 8px; font-size: 20px; line-height: 1.2; color: #DCD2F0; }
.how-list li::marker { color: var(--lime); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.grid.themes { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.cell { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px 8px; border: 0; cursor: pointer; font-family: var(--font); color: var(--text); background: rgba(10, 8, 26, .6); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--ring); text-align: center; }
.cell svg { width: 78px; height: 72px; shape-rendering: crispEdges; overflow: visible; }
.grid.small .cell svg { width: 56px; height: 34px; }
.cell b { font-weight: 400; font-size: 20px; letter-spacing: .04em; }
.cell .micro { font-size: 12px; letter-spacing: .1em; line-height: 1.15; }
.cell.on { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--lime), 0 0 16px rgba(166, 229, 106, .3); }
.cell.on .micro { color: var(--lime); }
.cell.locked svg { filter: brightness(0) opacity(.55); }
.cell.locked b { color: var(--dim); }
.themes .cell { padding: 14px 8px; }
.themes .cell.locked b { color: var(--muted); }
.list { display: flex; flex-direction: column; gap: 8px; max-height: 34vh; overflow: auto; padding: 4px; color: var(--muted); }
.rowbtn { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 8px 12px; border: 0; cursor: pointer; font-family: var(--font); color: var(--text); background: rgba(10, 8, 26, .6); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--ring); text-align: left; }
.rowbtn b { font-weight: 400; font-size: 22px; }
.rowbtn .micro { font-size: 13px; }
.rowbtn.locked b { color: var(--dim); }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-grid .stat { min-width: 0; justify-self: stretch; flex-direction: column-reverse; }
.stat-grid .stat b { font-size: 30px; color: var(--text); }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar { display: grid; grid-template-columns: 118px 1fr 44px; gap: 10px; align-items: center; }
.bar .micro { font-size: 13px; color: var(--t); }
.bar i { display: block; height: 14px; background: var(--t); transform-origin: left center; box-shadow: 0 0 0 2px var(--ink); }
.bar b { font-weight: 400; text-align: right; }
.toggle { display: flex; align-items: center; gap: 14px; font-size: 24px; cursor: pointer; }
.toggle input { appearance: none; width: 28px; height: 28px; margin: 0; cursor: pointer; background: rgba(10, 8, 26, .9); box-shadow: var(--rings); }
.toggle input:checked { background: var(--lime); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--lime), inset 0 0 0 4px var(--panel-solid); }

/* the looping demo in How to play */
.demo { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: #0C1330; box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--ring); }
.demo-q { font-size: 26px; text-align: center; color: #FFF6EA; }
.demo-stage { position: relative; height: 92px; overflow: hidden; background: linear-gradient(#2C1B54 0 34%, #173556 34% 100%); }
.demo-stage svg { display: block; width: 100%; height: 100%; shape-rendering: crispEdges; overflow: visible; }
.demo-pad { position: absolute; left: 14%; bottom: 10px; width: 108px; height: 33px; }
.demo-pad.far { left: auto; right: 16%; bottom: 26px; width: 72px; height: 22px; }
.demo-frog { position: absolute; left: calc(14% + 27px); bottom: 26px; width: 54px; height: 42px; transform-origin: 50% 100%;
  transition: left calc(.5s * var(--dur)) cubic-bezier(.3, .1, .3, 1), bottom calc(.5s * var(--dur)) cubic-bezier(.2, 1.6, .5, 1), transform calc(.5s * var(--dur)), opacity .2s; }
.demo-croc { position: absolute; right: calc(16% - 4px); bottom: 22px; width: 78px; height: 21px; opacity: 0; transform: translateY(18px); transition: transform .25s, opacity .25s; }
.demo.safe .demo-frog, .demo.chomp .demo-frog { left: calc(84% - 63px); bottom: 38px; transform: scale(.7); }
.demo.chomp .demo-croc { opacity: 1; transform: translateY(-6px) scale(1.25); transition-delay: .45s; }
.demo.chomp .demo-frog { opacity: 0; transition-delay: 0s, 0s, 0s, .6s; }
.demo-in { display: flex; align-items: center; height: 38px; padding: 0 12px; font-size: 26px; background: rgba(10, 8, 26, .92); box-shadow: var(--rings), inset 0 -3px 0 var(--lime); }
.demo-in i { width: 10px; height: 22px; margin-left: 2px; background: var(--lime); animation: blink 1s steps(2) infinite; }
.demo-out { min-height: 24px; text-align: center; font-size: 19px; letter-spacing: .08em; color: var(--muted); }
.demo-out b { font-weight: 400; color: var(--t); }

/* ---------- phones ---------- */
.answer-bar { transition: margin-bottom .12s; }
html.typing .trail, html.typing #hud-swamp { display: none; }
html.typing .card { margin-top: 6px; }
html.typing .card-big { font-size: clamp(26px, 4vh, 36px); }
@media (max-width: 480px) {
  .timer-secs { left: auto; right: 0; top: -22px; transform: none; font-size: 22px; }
  @keyframes tick { 0% { transform: scale(1.3); } 40%, 100% { transform: scale(1); } }
  .row-btns { gap: 10px; }
  .btn-small { padding: 0 8px; font-size: 15px; letter-spacing: .12em; }
  .home-title { margin-top: clamp(16px, 5vh, 60px); }
  .sheet { padding: 16px; }
  .overlay { padding: 14px; }
  .bar { grid-template-columns: 96px 1fr 36px; }
}
@media (max-height: 700px) { .tagline { display: none; } .home-actions { gap: 10px; } .links { display: none; } }

/* home: the two big buttons sit side by side on a wide screen, so the frog on its pad stays in view */
.home-actions { width: min(720px, 100%); }
.home-main { display: flex; gap: 16px; }
.home-main .btn-main { flex: 1.35; }
.home-main .btn-alt { flex: 1; height: clamp(56px, 7.5vh, 70px); flex-direction: column; gap: 2px; }
.row-btns.five { flex-wrap: wrap; }
.row-btns.five .btn { flex: 1 1 auto; white-space: nowrap; }
.row-btns.five #settings-btn { flex: 0 0 48px; font-size: 22px; padding: 0; }
@media (max-width: 600px) {
  .home-main { flex-direction: column; gap: 12px; }
  .home-main .btn-alt { flex: none; height: 50px; flex-direction: row; gap: 14px; }
  .home-main .btn-main { flex: none; }
}
