/* Gift Fishing Challenge - frame, letterbox panels, screens, HUD, tutorial, form, leaderboard.
   Portrait-only: everything lives inside a centred 9:16 (max) frame; on
   desktop / landscape the sides are letterboxed with branded panels.
   --u is 1% of the frame width, set from JS (main.js layout()). */

:root {
  --u: 4px;
  --ink: #2a1830;
  --red: #e8322a;
  --red-dk: #a8150f;
  --green: #1f9a4c;
  --green-dk: #11622f;
  --gold: #ffcf40;
  --purple: #7b3fe4;
  --ice: #bfe8ff;
  --night: #0b1846;
  --cream: #fff8ec;
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none;
  background: #050b1c; color: var(--ink);
  font-family: "Baloo 2", "Trebuchet MS", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-weight: 700; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}

/* ---------- letterbox ---------- */
#app {
  position: fixed; inset: 0; display: flex; justify-content: center; align-items: stretch;
  background:
    radial-gradient(circle at 15% 25%, rgba(232,50,42,.22), transparent 38%),
    radial-gradient(circle at 85% 75%, rgba(31,154,76,.22), transparent 38%),
    radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,.5), transparent),
    radial-gradient(2px 2px at 90px 120px, rgba(255,255,255,.35), transparent),
    radial-gradient(1.5px 1.5px at 150px 60px, rgba(255,255,255,.4), transparent),
    #060d22;
  background-size: auto, auto, 180px 180px, 180px 180px, 180px 180px, auto;
}

.side {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none; overflow: hidden; color: #fff; text-align: center; padding: 2vh 1.5vw;
}
.side-left { background: linear-gradient(90deg, rgba(232,50,42,.18), transparent); }
.side-right { background: linear-gradient(270deg, rgba(31,154,76,.2), transparent); }
.side-inner { width: 100%; max-width: 300px; display: flex; flex-direction: column; align-items: center; gap: 1.6vh; }
.side.narrow .side-inner { display: none; }
.side h3 {
  margin: 0; font-family: "Mountains of Christmas", "Baloo 2", cursive; font-size: clamp(22px, 2.4vw, 40px); line-height: 1;
  color: var(--gold); text-shadow: 0 3px 0 var(--red-dk), 0 0 20px rgba(255,207,64,.35);
}
.side p { margin: 0; font-size: clamp(13px, 1.1vw, 18px); line-height: 1.3; opacity: .9; }
.side-logo {
  display: inline-flex; align-items: center; gap: .4em; padding: .35em 1em; border-radius: 2em;
  background: #fff; color: var(--purple); font-size: clamp(13px, 1.1vw, 18px); font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 0 4px 0 rgba(0,0,0,.3);
}
.side-star { color: var(--gold); -webkit-text-stroke: 1px var(--purple); font-size: 1.3em; }
.collage { position: relative; width: 100%; aspect-ratio: 1 / 1; max-width: 260px; }
.collage img { position: absolute; width: 38%; filter: drop-shadow(0 6px 6px rgba(0,0,0,.4)); animation: bob 3s ease-in-out infinite; }
.collage img:nth-child(1) { left: 4%; top: 6%; width: 42%; }
.collage img:nth-child(2) { right: 4%; top: 0; animation-delay: -.8s; }
.collage img:nth-child(3) { left: 30%; top: 36%; width: 44%; animation-delay: -1.6s; }
.collage img:nth-child(4) { left: 0; bottom: 0; width: 32%; animation-delay: -2.2s; }
.collage img:nth-child(5) { right: 2%; bottom: 4%; width: 34%; animation-delay: -1.1s; }
.side-vals { display: flex; gap: .6em; align-items: center; justify-content: center; }
.side-vals b { color: var(--gold); font-size: 1.4em; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(3deg); } }

#frame {
  position: relative; flex: none; height: 100%; width: min(100vw, 56.25vh); width: min(100vw, 56.25dvh);
  overflow: hidden; background: var(--night);
  box-shadow: 0 0 0 3px rgba(255,207,64,.35), 0 0 90px rgba(0,0,0,.7);
  font-size: calc(var(--u) * 4.3);
  user-select: none; -webkit-user-select: none;
}

#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.screen {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  padding: 1em; overflow: hidden;
}
.screen.active { display: flex; }

/* ---------- shared bits ---------- */
.panel {
  position: relative; width: 100%; max-width: 24em; text-align: center;
  background: var(--cream); border: .2em solid var(--ink); border-radius: 1.4em;
  box-shadow: 0 .35em 0 rgba(0,0,0,.3), 0 0 0 .35em rgba(255,255,255,.15); padding: 1.1em 1.2em 1.3em;
}
.panel::before {
  content: ""; position: absolute; left: 1.2em; right: 1.2em; top: -.2em; height: .45em; border-radius: 1em;
  background: repeating-linear-gradient(-45deg, var(--red) 0 .5em, #fff .5em 1em);
  border: .12em solid var(--ink);
}
.panel p { margin: .4em 0 0; font-weight: 600; line-height: 1.3; }
h1, h2 { margin: 0; font-weight: 800; line-height: 1; }
h2 { font-size: 1.7em; color: var(--red); text-shadow: 0 .06em 0 rgba(0,0,0,.12); }

.btn {
  font: inherit; font-weight: 800; font-size: 1.1em; color: #fff; letter-spacing: .02em;
  background: var(--red); border: 0; border-bottom: .28em solid var(--red-dk); border-radius: 1em;
  padding: .55em 1.5em; min-height: 48px; cursor: pointer; touch-action: manipulation;
  text-shadow: 0 .08em 0 rgba(0,0,0,.25); transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(.15em); border-bottom-width: .13em; }
.btn:disabled { filter: grayscale(.6) brightness(.9); cursor: default; }
.btn-big { font-size: 1.6em; padding: .45em 1.8em; }
.btn-small { font-size: .9em; padding: .4em 1.2em; min-height: 44px; }
.btn-alt { background: var(--green); border-bottom-color: var(--green-dk); }
.btn-row { display: flex; gap: .7em; justify-content: center; flex-wrap: wrap; margin-top: .9em; }
.btn:focus-visible, input:focus-visible, .icon-btn:focus-visible { outline: .18em solid var(--gold); outline-offset: .12em; }

.icon-btn {
  position: absolute; top: calc(var(--u) * 3); right: calc(var(--u) * 3); width: calc(var(--u) * 11); height: calc(var(--u) * 11);
  min-width: 40px; min-height: 40px; padding: 8px; z-index: 30;
  border-radius: 50%; border: 3px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,.3); touch-action: manipulation;
}
.icon-btn svg { width: 100%; height: 100%; display: block; }
.icon-btn.muted { color: #9a8f8f; }

/* ---------- menu ---------- */
#screen-menu { align-items: flex-end; padding-bottom: 14%; }
.menu-wrap { display: flex; flex-direction: column; align-items: center; gap: .6em; text-align: center; }
.title {
  font-family: "Mountains of Christmas", "Baloo 2", cursive; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; line-height: .9;
  filter: drop-shadow(0 .12em 0 rgba(0,0,0,.45));
  animation: floaty 3.2s ease-in-out infinite;
}
.title .t1 { font-size: 2.25em; white-space: nowrap; color: var(--gold); -webkit-text-stroke: .05em var(--red-dk); paint-order: stroke fill; text-shadow: 0 0 .35em rgba(255,207,64,.5); }
.title .t2 { font-size: 2.2em; color: #fff; -webkit-text-stroke: .06em var(--red-dk); paint-order: stroke fill; transform: rotate(-3deg); }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-.25em); } }
.tagline {
  margin: .2em 0 .5em; font-size: 1em; color: #fff; text-shadow: 0 .1em .2em rgba(0,0,0,.6);
  background: rgba(11,24,70,.6); padding: .3em .9em; border-radius: 1em;
}
#btn-play { animation: breathe 1.7s ease-in-out infinite; }
#btn-play:hover, #btn-play:active { animation-play-state: paused; }
.btn-play-label { display: inline-block; font-size: 1.25em; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
#btn-howto { min-width: 9.5em; }
.btn-music { display: inline-flex; align-items: center; gap: .45em; background: #3a5bb8; border-bottom-color: #233a7e; margin-top: .3em; }
.btn-music b { display: inline-block; min-width: 1.9em; text-align: left; }
.music-ic { display: inline-block; width: 1.3em; height: 1.3em; }
.music-ic svg { width: 100%; height: 100%; display: block; }
#btn-audio[aria-pressed=true] { background: #6b7280; border-bottom-color: #3f4652; }

/* ---------- tutorial ---------- */
#screen-howto { background: rgba(5,11,28,.45); }
.tut-card { max-width: 25em; padding-top: 1.4em; }
.tut-skip {
  position: absolute; top: .6em; right: .7em; font: inherit; font-size: .8em; font-weight: 800; color: #7b6a7a;
  background: none; border: 0; cursor: pointer; padding: .4em .6em; min-height: 40px;
}
.tut-step { font-size: .75em; letter-spacing: .12em; text-transform: uppercase; color: #7b6a7a; text-align: left; padding-left: .2em; }
.tut-slides { position: relative; min-height: 20em; }
.tut-slide { display: none; animation: slidein-r .35s ease-out; }
.tut-slide.active { display: block; }
.tut-slide.back { animation-name: slidein-l; }
@keyframes slidein-r { from { transform: translateX(2em); opacity: 0; } }
@keyframes slidein-l { from { transform: translateX(-2em); opacity: 0; } }
.tut-slide h2 { margin-top: .5em; }
.tut-slide p { font-size: .9em; }
.tut-slide b.red, .values b.red { color: var(--red); }

.tut-scene {
  position: relative; height: 9.5em; margin-top: .5em; border-radius: 1em; overflow: hidden;
  background: linear-gradient(#20306e 0 30%, #4cc6ea 30%, #1f78b8 100%); border: .14em solid var(--ink);
}
.tut-scene .water { position: absolute; left: 0; right: 0; top: 30%; height: .3em; background: rgba(255,255,255,.7); }
.tut-hook { position: absolute; left: 50%; top: 4%; width: 2.2em; margin-left: -1.1em; }
.sc-cast .line { position: absolute; left: 50%; top: 0; width: 2px; background: #fff; height: 1em; animation: line 2.2s ease-in-out infinite; }
.sc-cast .tut-hook { animation: drop 2.2s ease-in-out infinite; }
@keyframes drop { 0%, 15% { transform: translateY(0); } 55%, 70% { transform: translateY(4.3em); } 100% { transform: translateY(0); } }
@keyframes line { 0%, 15% { height: .6em; } 55%, 70% { height: 4.9em; } 100% { height: .6em; } }
.finger { position: absolute; right: 18%; top: 34%; font-size: 2.2em; animation: tap 2.2s ease-in-out infinite; }
.tap-ring { position: absolute; right: 21%; top: 30%; width: 2.4em; height: 2.4em; border-radius: 50%; border: .18em solid #fff; opacity: 0; animation: ring 2.2s ease-out infinite; }
@keyframes tap { 0%, 100% { transform: translateY(0); } 8% { transform: translateY(.25em) scale(.92); } 16% { transform: translateY(0); } }
@keyframes ring { 6% { opacity: .9; transform: scale(.4); } 30% { opacity: 0; transform: scale(1.4); } 100% { opacity: 0; } }

.sc-steer .tut-hook { top: 38%; animation: steer 2.6s ease-in-out infinite; }
.tut-gift { position: absolute; width: 2.6em; top: 52%; }
.tut-gift.g1 { left: 14%; animation: grab1 2.6s infinite; }
.tut-gift.g2 { right: 14%; animation: grab2 2.6s infinite; }
@keyframes steer { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5.6em); } 75% { transform: translateX(5.6em); } }
@keyframes grab1 { 0%, 22% { opacity: 1; transform: scale(1); } 28% { opacity: 0; transform: scale(1.5); } 90% { opacity: 0; } 100% { opacity: 1; } }
@keyframes grab2 { 0%, 72% { opacity: 1; transform: scale(1); } 78% { opacity: 0; transform: scale(1.5); } 96% { opacity: 0; } 100% { opacity: 1; } }
.arrows { position: absolute; left: 0; right: 0; bottom: .3em; color: #fff; font-size: 1.3em; text-shadow: 0 .1em 0 rgba(0,0,0,.4); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .55; } }

.values { list-style: none; margin: .7em 0 0; padding: 0; display: grid; gap: .35em; }
.values li {
  display: grid; grid-template-columns: 4.2em 1fr auto; align-items: center; gap: .5em; text-align: left;
  background: #fff; border: .12em solid rgba(42,24,48,.15); border-radius: .9em; padding: .25em .7em; font-size: .86em;
}
.values small { font-weight: 600; color: #7b6a7a; }
.values b { font-size: 1.25em; color: var(--red); }
.values b.purple { color: var(--purple); } .values b.gold { color: #c98a00; } .values b.green { color: var(--green); }
.vi { display: flex; align-items: center; justify-content: center; height: 2.4em; }
.vi img { height: 100%; }
.slots-demo { gap: .12em; }
.slots-demo i { width: .62em; height: .62em; border-radius: 50%; background: var(--green); border: .1em solid var(--ink); }

.sc-clock { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4em; background: linear-gradient(#20306e, #1f78b8); }
.clock {
  width: 3.4em; height: 3.4em; border-radius: 50%; display: grid; place-items: center; font-size: 1.3em; font-weight: 800; color: var(--ink);
  background: #fff; border: .18em solid var(--ink); box-shadow: 0 0 0 .25em var(--gold); animation: tickle 1s steps(2) infinite;
}
@keyframes tickle { 50% { transform: rotate(6deg); } }
.junk-row { display: flex; gap: .3em; opacity: .95; }
.junk-row img { height: 2.1em; filter: grayscale(.2); }

.tut-dots { display: flex; justify-content: center; gap: .45em; margin-top: .8em; }
.tut-dots i { width: .6em; height: .6em; border-radius: 50%; background: rgba(42,24,48,.2); transition: background .2s, transform .2s; }
.tut-dots i.on { background: var(--red); transform: scale(1.25); }
.tut-btns { margin-top: .6em; flex-wrap: nowrap; }
.tut-btns .btn { flex: 1; }
#btn-tut-next.go { background: var(--red); animation: breathe 1.4s ease-in-out infinite; }

/* ---------- HUD ---------- */
#screen-game { padding: 0; align-items: stretch; justify-content: stretch; touch-action: none; cursor: pointer; }
#hud { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; }
.hud-timer, .hud-score {
  position: absolute; top: calc(var(--u) * 3); display: flex; align-items: center; gap: .3em;
  background: rgba(10,20,55,.75); border: .14em solid #fff; border-radius: 1.2em; color: #fff;
  font-weight: 800; box-shadow: 0 .1em 0 rgba(0,0,0,.4);
}
.hud-timer { left: calc(var(--u) * 3); font-size: 1.25em; padding: .05em .7em .05em .35em; min-width: 3.6em; }
.clock-ic { width: 1.1em; height: 1.1em; border-radius: 50%; border: .14em solid #fff; position: relative; }
.clock-ic::before { content: ""; position: absolute; left: 50%; top: 18%; width: .12em; height: 38%; margin-left: -.06em; background: #fff; transform-origin: bottom; animation: hand 1s steps(8) infinite; }
@keyframes hand { to { transform: rotate(360deg); } }
.hud-timer.urgent { border-color: #ff6b6b; background: rgba(160,20,20,.85); animation: urgent .5s ease-in-out infinite alternate; }
@keyframes urgent { to { transform: scale(1.1); } }
.hud-score { left: 50%; transform: translateX(-50%); font-size: 1.55em; padding: .05em .8em .05em .3em; border-color: var(--gold); }
.hud-score.bump { animation: pop .25s ease-out; }
@keyframes pop { 40% { transform: translateX(-50%) scale(1.18); } }
.gift-ic { display: inline-block; width: 1.4em; height: 1.4em; background-size: contain; background-repeat: no-repeat; background-position: center; }

.hud-slots {
  position: absolute; left: 50%; top: calc(var(--u) * 15.5); transform: translateX(-50%);
  display: flex; gap: .3em; padding: .25em .5em; border-radius: 1em; background: rgba(10,20,55,.55); border: .1em solid rgba(255,255,255,.5);
}
.slot {
  width: 1.7em; height: 1.7em; border-radius: 50%; background: rgba(255,255,255,.14) center / 82% no-repeat;
  border: .12em dashed rgba(255,255,255,.6); transition: transform .15s;
}
.slot.on { border-style: solid; border-color: #fff; background-color: rgba(255,255,255,.3); animation: slotin .3s ease-out; }
.slot.on.golden { border-color: var(--gold); background-color: rgba(255,207,64,.5); }
.slot.on.featured { border-color: #c7a6ff; background-color: rgba(123,63,228,.5); }
.slot.on.junk { border-color: #ff6b6b; background-color: rgba(120,30,30,.6); }
@keyframes slotin { from { transform: scale(1.6); } }
.hud-slots.full { border-color: var(--gold); box-shadow: 0 0 .8em rgba(255,207,64,.7); }
.hud-slots.bad { animation: shakeX .35s; }
@keyframes shakeX { 20%, 60% { transform: translateX(calc(-50% - .3em)); } 40%, 80% { transform: translateX(calc(-50% + .3em)); } }

#fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pop {
  position: absolute; transform: translate(-50%, -50%); font-weight: 800; font-size: 1.35em; color: #fff; white-space: nowrap;
  -webkit-text-stroke: .1em var(--ink); paint-order: stroke fill; animation: popup 1.1s ease-out forwards;
}
.pop.featured { color: #d9c2ff; font-size: 1.55em; }
.pop.golden { color: var(--gold); font-size: 1.9em; }
.pop.neg { color: #ff8a80; }
.pop.full { color: var(--gold); font-size: 1.3em; }
.pop.miss { color: #cfe6ff; font-size: 1.1em; }
@keyframes popup {
  0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; }
  20% { transform: translate(-50%, -90%) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -260%) scale(1); opacity: 0; }
}

.hint {
  position: absolute; left: 50%; top: 52%; transform: translateX(-50%); pointer-events: none;
  padding: .35em 1em; border-radius: 1.2em; background: rgba(10,20,55,.75); color: #fff; font-size: 1.2em; white-space: nowrap;
  border: .12em solid #fff; animation: hintb 1s ease-in-out infinite alternate;
}
@keyframes hintb { to { transform: translateX(-50%) scale(1.07); } }

.banner {
  position: absolute; left: 0; right: 0; top: 30%; text-align: center; pointer-events: none;
  font-family: "Mountains of Christmas", "Baloo 2", cursive; font-size: 2.6em; color: #fff;
  -webkit-text-stroke: .06em var(--ink); paint-order: stroke fill; text-shadow: 0 .08em 0 rgba(0,0,0,.35);
}
.banner.show { animation: bannerin 1.1s ease-out forwards; }
.banner.gold { color: var(--gold); text-shadow: 0 0 .4em rgba(255,207,64,.8); }
.banner.perfect { color: #7dffb0; }
.banner.hurry { color: #ff8a80; }
.banner.timeup { color: var(--gold); font-size: 3.1em; animation-duration: 1.6s; }
@keyframes bannerin {
  0% { transform: scale(.3) rotate(-6deg); opacity: 0; }
  18% { transform: scale(1.12) rotate(2deg); opacity: 1; }
  30% { transform: scale(1) rotate(0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-.4em); }
}

.countdown {
  position: absolute; left: 0; right: 0; top: 40%; text-align: center; pointer-events: none;
  font-size: 5em; font-weight: 800; color: #fff; -webkit-text-stroke: .05em var(--ink); paint-order: stroke fill;
  text-shadow: 0 .06em 0 rgba(0,0,0,.35);
}
.countdown.tick { animation: cd .8s ease-out; }
@keyframes cd { 0% { transform: scale(2); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { transform: scale(.9); opacity: .9; } }

.pause { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(5,11,28,.55); z-index: 10; padding: 1em; }
.pause-card { max-width: 15em; }

/* demo autopilot finger (?demo=1) */
.demo-finger { position: absolute; top: 80%; transform: translateX(-35%); pointer-events: none; z-index: 8; transition: left .08s linear; }
.demo-finger .hand { display: block; font-size: 3.2em; filter: drop-shadow(0 .1em .15em rgba(0,0,0,.5)); }
.demo-finger .ripple { position: absolute; left: 12%; top: -12%; width: 2.6em; height: 2.6em; border-radius: 50%; border: .2em solid #fff; opacity: 0; }
.demo-finger.tap .hand { animation: tap .5s ease-out; }
.demo-finger.tap .ripple { animation: ring2 .6s ease-out; }
@keyframes ring2 { 0% { opacity: .95; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.6); } }

/* ---------- result ---------- */
#screen-result { z-index: 5; background: rgba(5,11,28,0); }
#screen-result.active { animation: fadebg .5s forwards; }
@keyframes fadebg { to { background: rgba(5,11,28,.55); } }
.result-card { opacity: 0; }
.result-card.in { animation: slidedown .6s cubic-bezier(.2,1.3,.4,1) forwards; }
@keyframes slidedown { from { transform: translateY(-70vh); opacity: 1; } to { transform: translateY(0); opacity: 1; } }
.result-label { margin-top: .5em; font-size: .85em; text-transform: uppercase; letter-spacing: .12em; color: #7b6a7a; }
.result-score { display: flex; align-items: center; justify-content: center; gap: .15em; font-size: 4.2em; font-weight: 800; line-height: 1.05; color: var(--red); text-shadow: 0 .05em 0 rgba(0,0,0,.15); }
.result-score .gift-ic { width: .9em; height: .9em; }
.result-best { font-size: .85em; color: #5a4a5a; min-height: 1.2em; }
.result-best .new { display: inline-block; padding: .05em .6em; border-radius: 1em; background: var(--gold); color: var(--ink); animation: breathe 1s infinite; }
.stats { list-style: none; margin: .6em 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .3em; }
.stats li { background: #fff; border-radius: .7em; padding: .25em .5em; font-size: .78em; display: flex; justify-content: space-between; gap: .4em; border: .1em solid rgba(42,24,48,.12); }
.stats li b { color: var(--red); }
.badges { display: flex; flex-wrap: wrap; gap: .3em; justify-content: center; margin-top: .55em; min-height: .5em; }
.badge { font-size: .72em; padding: .2em .7em; border-radius: 1em; background: var(--green); color: #fff; animation: slotin .4s ease-out backwards; }
.badge.gold { background: #d99a00; } .badge.purple { background: var(--purple); }

/* ---------- form (gift tag) ---------- */
.form-card { text-align: left; background: #fff4dc; padding-top: 2.1em; }
.tag-hole { position: absolute; top: .75em; left: 50%; width: 1.1em; height: 1.1em; margin-left: -.55em; border-radius: 50%; background: var(--night); border: .15em solid var(--ink); }
.form-card h2 { text-align: center; font-family: "Mountains of Christmas", "Baloo 2", cursive; font-size: 1.9em; }
.form-score { text-align: center; margin: .3em 0 .6em; font-size: .95em; }
.form-card label:not(.consent) { display: block; margin-top: .5em; font-size: .85em; }
.form-card input[type=text], .form-card input[type=email] {
  width: 100%; font: inherit; font-weight: 700; font-size: max(16px, 1em); color: var(--ink);
  padding: .5em .8em; margin-top: .25em; background: #fff;
  border: .15em solid var(--ink); border-radius: .7em; user-select: text; -webkit-user-select: text;
}
.form-card input[aria-invalid=true] { border-color: #e02b2b; background: #fff0ee; }
.consent { display: flex; gap: .6em; align-items: flex-start; margin-top: .8em; font-size: .72em; line-height: 1.3; cursor: pointer; font-weight: 600; }
.consent input { flex: none; width: 1.6em; height: 1.6em; margin: 0; accent-color: var(--red); }
.field-error { min-height: 1.1em; margin-top: .2em; font-size: .75em; color: #d62828; }
.field-error.center { text-align: center; }
.form-btns { flex-wrap: nowrap; margin-top: .5em; }
.form-btns .btn { flex: 1; padding-left: .5em; padding-right: .5em; }

/* ---------- leaderboard ---------- */
.board-card { max-width: 26em; font-size: .92em; }
.board-you { margin-top: .35em; font-size: .9em; color: #5a4a5a; min-height: 1.2em; }
.board-you b { color: var(--red); }
.board-head, .row { display: grid; grid-template-columns: 3em 1fr 4em; gap: .5em; align-items: center; padding: .4em .8em; text-align: left; }
.board-head { margin-top: .4em; font-size: .75em; text-transform: uppercase; letter-spacing: .1em; color: #7b6a7a; }
.board-head span:last-child, .row .sc { text-align: right; }
.board-rows { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow-y: auto; display: grid; gap: .3em; }
.row { background: #fff; border-radius: .8em; }
.row:nth-child(even) { background: #eef6ff; }
.row .rk { font-weight: 800; text-align: center; }
.row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sc { font-weight: 800; color: var(--red); }
.row.r1 .rk { color: #d99a00; } .row.r2 .rk { color: #7d8a96; } .row.r3 .rk { color: #b06a34; }
.row.me { background: #ffe58a; outline: .13em solid var(--ink); animation: meGlow 1.3s ease-in-out infinite; }
@keyframes meGlow {
  0%, 100% { background: #ffe58a; box-shadow: 0 0 0 0 rgba(255,207,64,.6); }
  50% { background: #ffd54f; box-shadow: 0 0 0 .45em rgba(255,207,64,0); }
}
.board-empty { padding: 1.4em 0; color: #7b6a7a; }
.board-foot { display: flex; justify-content: space-between; gap: .5em; margin-top: .6em; font-size: .72em; color: #7b6a7a; min-height: 1.2em; }
.board-timer { height: .5em; margin-top: .4em; border-radius: 1em; background: rgba(0,0,0,.12); overflow: hidden; }
.board-timer i { display: block; width: 100%; height: 100%; background: var(--green); transform-origin: left; }
.board-timer.run i { animation: drain var(--dur, 5s) linear forwards; }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- rotate prompt (phones held sideways) ---------- */
.rotate {
  display: none; position: absolute; inset: 0; z-index: 50; flex-direction: column; align-items: center; justify-content: center; gap: .5em;
  background: var(--night); color: #fff; text-align: center; padding: 1em;
}
.rotate-ic { font-size: 3em; animation: turn 1.6s ease-in-out infinite; }
@keyframes turn { 0%, 30% { transform: rotate(-90deg); } 60%, 100% { transform: rotate(0); } }
@media (orientation: landscape) and (pointer: coarse) and (max-height: 520px) {
  .rotate { display: flex; }
}

/* short screens */
@media (max-height: 640px) {
  .tut-slides { min-height: 17em; }
  .tut-scene { height: 8em; }
}

@media (prefers-reduced-motion: reduce) {
  .title, .row.me, #btn-play, .collage img, .hint { animation: none; }
}
