/* =====================================================================
   SeekPPL Talent Hunt — styles (mobile only)
   Brand tokens taken from seekppl.com: ink / cream / gold / orange /
   teal / mint, Manrope for type, DM Mono for small labels.
   ===================================================================== */

@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("../fonts/dm-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("../fonts/dm-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --ink: #191e2b;
  --ink-2: #12161f;
  --navy: #2f3b52;
  --navy-2: #232c3f;
  --cream: #f1e7d4;
  --cream-70: rgba(241, 231, 212, 0.72);
  --cream-45: rgba(241, 231, 212, 0.45);
  --line: rgba(241, 231, 212, 0.12);
  --stone: #8a8378;
  --gold: #ddad26;
  --yellow: #f0ca5d;
  --orange: #ff8a3c;
  --red: #ec4224;
  --teal: #036d6e;
  --mint: #4ea6a0;
  --terracotta: #c1652d;
  --grad: linear-gradient(135deg, #ddad26 0%, #ff8a3c 55%, #ec4224 100%);
  --card: rgba(47, 59, 82, 0.5);
  --card-solid: #252e42;

  --font: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --col: 480px;
  --pad: 18px;
  --ease: cubic-bezier(0.2, 0.9, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ink); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--cream);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}
body.no-scroll { overflow: hidden; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; border-radius: 10px; }
em { font-style: normal; color: var(--gold); }

/* ---------------- background: aurora + particles ---------------- */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora span { position: absolute; border-radius: 50%; will-change: transform; }
.aurora .a1 { width: 120vmax; height: 120vmax; left: -60vmax; top: -55vmax; background: radial-gradient(circle, rgba(3, 109, 110, 0.55) 0%, rgba(3, 109, 110, 0) 60%); animation: drift1 22s ease-in-out infinite alternate; }
.aurora .a2 { width: 110vmax; height: 110vmax; right: -60vmax; bottom: -60vmax; background: radial-gradient(circle, rgba(236, 66, 36, 0.35) 0%, rgba(236, 66, 36, 0) 60%); animation: drift2 26s ease-in-out infinite alternate; }
.aurora .a3 { width: 80vmax; height: 80vmax; left: 10vmax; top: 30vh; background: radial-gradient(circle, rgba(221, 173, 38, 0.22) 0%, rgba(221, 173, 38, 0) 60%); animation: drift3 30s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(18vmax, 12vmax) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-16vmax, -10vmax) scale(1.12); } }
@keyframes drift3 { to { transform: translate(-14vmax, 8vmax) scale(0.9); } }
.fx-ambient { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.fx-top { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 300; pointer-events: none; }

/* ---------------- layout ---------------- */
.app { position: relative; z-index: 1; width: min(var(--col), 100%); margin: 0 auto; }
.screen { min-height: 100vh; min-height: 100dvh; padding: calc(var(--safe-t) + 14px) var(--pad) calc(var(--safe-b) + 24px); }
.screen.enter > * { animation: rise 0.6s var(--ease) both; }
.screen.enter > *:nth-child(2) { animation-delay: 0.06s; }
.screen.enter > *:nth-child(3) { animation-delay: 0.12s; }
.screen.enter > *:nth-child(4) { animation-delay: 0.18s; }
.screen.enter > *:nth-child(5) { animation-delay: 0.24s; }
.screen.enter > *:nth-child(6) { animation-delay: 0.3s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* ---------------- type ---------------- */
.eyebrow { margin: 0 0 8px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.wordmark { font-weight: 800; font-size: 24px; letter-spacing: -0.04em; color: var(--cream); line-height: 1; }
.wordmark-sm { font-size: 20px; }
.tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); background: var(--grad); padding: 5px 10px; border-radius: 999px; font-weight: 500; }

/* ---------------- controls ---------------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 12px 24px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--font); font-weight: 800; font-size: 15.5px; letter-spacing: -0.01em; line-height: 1.15;
  cursor: pointer; text-decoration: none; user-select: none; -webkit-user-select: none;
  transition: transform 0.18s var(--spring), filter 0.2s ease, box-shadow 0.2s ease;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn-block { width: 100%; }
.btn .arrow { font-size: 1.05em; transition: transform 0.25s var(--spring); }
.btn:active .arrow { transform: translate(2px, -2px); }
.btn-gold { color: var(--ink); background: var(--grad); background-size: 140% 140%; box-shadow: 0 12px 28px -12px rgba(255, 138, 60, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn-gold::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%); transform: translateX(-120%); animation: shimmer 4s ease-in-out infinite; }
@keyframes shimmer { 0%, 62% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.btn-ghost { color: var(--cream); background: rgba(241, 231, 212, 0.05); border-color: rgba(241, 231, 212, 0.22); }
.btn-danger { color: var(--orange); background: transparent; border-color: rgba(255, 138, 60, 0.45); }
.press-ripple { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: rgba(255, 255, 255, 0.45); pointer-events: none; animation: ripple 0.6s ease-out forwards; }
@keyframes ripple { to { transform: scale(40); opacity: 0; } }

.icon-btn { position: relative; overflow: hidden; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; border: 1px solid var(--line); background: rgba(241, 231, 212, 0.05); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--cream); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .snd-off { display: none; }
.icon-btn.is-muted .snd-on { display: none; }
.icon-btn.is-muted .snd-off { display: inline; }

.text-input, .code-input {
  width: 100%; min-height: 56px; padding: 12px 18px;
  font-family: var(--font); font-size: 17px; font-weight: 700; color: var(--cream);
  background: rgba(18, 22, 31, 0.7); border: 1.5px solid var(--line); border-radius: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.text-input::placeholder, .code-input::placeholder { color: var(--cream-45); font-weight: 500; letter-spacing: 0; text-transform: none; }
.text-input:focus, .code-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(221, 173, 38, 0.18); }
.code-input { text-align: center; font-size: 22px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.link-btn { background: none; border: 0; padding: 10px 2px; cursor: pointer; color: var(--cream-70); text-decoration: underline; text-underline-offset: 4px; font-size: 14.5px; font-weight: 600; }

.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 20px; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.card-h { margin: 0 0 10px; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }

.shake { animation: shake 0.45s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(3px); } }

/* ---------------- timer ---------------- */
.timer { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 999px; background: rgba(18, 22, 31, 0.65); border: 1px solid var(--line); font-family: var(--mono); font-weight: 500; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--cream); }
.timer-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(236, 66, 36, 0.7); animation: live 1.6s ease-out infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(236, 66, 36, 0); } 100% { box-shadow: 0 0 0 0 rgba(236, 66, 36, 0); } }
.timer-small { height: 34px; padding: 0 12px; font-size: 13.5px; }

/* ---------------- box artwork ---------------- */
.box-art { display: block; width: 100%; overflow: visible; }
.box-art .b-shadow { fill: rgba(0, 0, 0, 0.45); }
.box-art .b-lid { transform-box: fill-box; transform-origin: 0% 100%; transition: transform 0.6s var(--spring); }
.box-art .b-beam, .box-art .b-glow-in { opacity: 0; transition: opacity 0.5s ease 0.15s; }
.box-art .b-lock, .box-art .b-check { display: none; }
.box-art.is-open .b-lid { transform: translate(-6px, -26px) rotate(-24deg); }
.box-art.is-open .b-beam, .box-art.is-open .b-glow-in { opacity: 1; }
.box-art.is-open .b-beam { animation: beam 2.4s ease-in-out infinite; }
@keyframes beam { 50% { opacity: 0.65; } }

/* ---------------- start ---------------- */
.brandbar { display: flex; align-items: center; justify-content: space-between; height: 44px; }
.hero { padding: 6px 0 22px; }
.hero-boxes { position: relative; height: 170px; margin: 8px 0 14px; }
.hb { position: absolute; bottom: 0; }
.hb-0 { width: 92px; left: 6%; bottom: 10px; transform: rotate(-9deg); animation: bob 4.2s ease-in-out infinite; }
.hb-1 { width: 150px; left: 50%; margin-left: -75px; animation: bob 3.6s ease-in-out -1.2s infinite; filter: drop-shadow(0 18px 40px rgba(255, 138, 60, 0.35)); }
.hb-2 { width: 92px; right: 6%; bottom: 14px; transform: rotate(8deg); animation: bob 4.6s ease-in-out -2s infinite; }
.hb-1 .b-lid { animation: peek 3.6s var(--spring) -1.2s infinite; }
@keyframes bob { 50% { translate: 0 -10px; } }
@keyframes peek { 0%, 70%, 100% { transform: none; } 80% { transform: translate(-3px, -9px) rotate(-8deg); } 88% { transform: none; } }
.title { margin: 0 0 12px; font-size: clamp(40px, 12.5vw, 54px); font-weight: 800; line-height: 0.98; letter-spacing: -0.045em; text-wrap: balance; }
.lede { margin: 0; color: var(--cream-70); font-size: 16px; line-height: 1.55; max-width: 34ch; }
.start-form { display: grid; gap: 12px; margin-bottom: 14px; }
.field-label { font-weight: 700; font-size: 14px; }
.field-note { margin: 0; color: var(--cream-45); font-size: 13px; text-align: center; }
.board-card { margin-bottom: 20px; }

.leaderboard { list-style: none; margin: 0; padding: 0; }
.lb-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 11px 6px; border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: 0; }
.lb-rank { font-family: var(--mono); font-size: 13px; color: var(--cream-45); }
.lb-row.is-top .lb-rank { color: var(--gold); }
.lb-team { font-weight: 700; overflow-wrap: anywhere; }
.lb-time { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.lb-row.is-me { background: linear-gradient(90deg, rgba(221, 173, 38, 0.22), rgba(255, 138, 60, 0.08)); border-radius: 12px; border-bottom-color: transparent; }
.lb-gap { text-align: center; color: var(--cream-45); padding: 2px 0; }
.lb-empty { color: var(--cream-45); font-size: 14.5px; padding: 4px 0; }

/* ---------------- hunt ---------------- */
.screen-hunt { padding-top: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 calc(-1 * var(--pad)); padding: calc(var(--safe-t) + 10px) var(--pad) 10px; background: linear-gradient(var(--ink) 40%, rgba(25, 30, 43, 0)); }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.match { display: flex; align-items: center; gap: 18px; padding: 10px 0 20px; }
.match-ring { position: relative; width: 112px; height: 112px; flex: 0 0 112px; }
.match-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: rgba(241, 231, 212, 0.08); stroke-width: 10; }
.ring-fill { fill: none; stroke: url(#g-ring); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 1.2s var(--ease); filter: drop-shadow(0 0 6px rgba(255, 138, 60, 0.55)); }
.match-num { position: absolute; inset: 0; display: grid; place-content: center; grid-auto-flow: column; align-items: baseline; font-weight: 800; font-size: 34px; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.match-num small { font-size: 16px; color: var(--gold); margin-left: 1px; }
.match-copy { min-width: 0; }
.match-team { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; overflow-wrap: anywhere; }
.match-sub { margin: 4px 0 0; color: var(--cream-70); font-size: 14px; }

.boxes { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 12px; position: relative; }
.box-item { position: relative; animation: rise 0.55s var(--ease) both; animation-delay: calc(var(--i) * 0.07s); }
.box-item:not(:last-child)::after { content: ""; position: absolute; left: 39px; top: calc(100% - 6px); height: 24px; width: 2px; background: var(--line); z-index: 0; }
.box-item.box--open:not(:last-child)::after { background: var(--mint); }
.box-card {
  position: relative; z-index: 1; overflow: hidden; width: 100%;
  display: grid; grid-template-columns: 44px 1fr 84px; align-items: center; gap: 12px;
  padding: 12px 12px 12px 16px; border-radius: 22px; text-align: left; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: transform 0.2s var(--spring), border-color 0.3s ease, box-shadow 0.3s ease;
}
.box-card:active { transform: scale(0.97); }
.box-no { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--cream-45); background: rgba(18, 22, 31, 0.6); border: 1px solid var(--line); }
.box-info { display: grid; gap: 3px; min-width: 0; }
.box-game { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.box-status { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cream-45); }
.box-thumb { width: 84px; margin: -6px 0 -2px; }

.box--locked .box-card { opacity: 0.55; }
.box--locked .box-thumb { filter: grayscale(0.85) brightness(0.75); }
.box--locked .b-lock { display: inline; }

.box--ready .box-card, .box--playing .box-card, .box--solved .box-card {
  border-color: transparent;
  background: linear-gradient(var(--card-solid), var(--card-solid)) padding-box, var(--grad) border-box;
  box-shadow: 0 14px 34px -14px rgba(255, 138, 60, 0.6);
  animation: glow 2.6s ease-in-out infinite;
}
@keyframes glow { 50% { box-shadow: 0 14px 44px -10px rgba(255, 138, 60, 0.9); } }
.box--ready .box-no, .box--playing .box-no, .box--solved .box-no { color: var(--ink); background: var(--grad); border-color: transparent; }
.box--ready .box-status, .box--playing .box-status, .box--solved .box-status { color: var(--yellow); }
.box--ready .box-thumb, .box--playing .box-thumb, .box--solved .box-thumb { animation: bob 2.8s ease-in-out infinite; }
.box--solved .b-lid { animation: rattle-lid 2.2s ease-in-out infinite; }
@keyframes rattle-lid { 0%, 80%, 100% { transform: none; } 85% { transform: translateY(-4px) rotate(-3deg); } 90% { transform: translateY(-2px) rotate(2deg); } }

.box--open .box-no { color: var(--ink); background: var(--mint); border-color: transparent; }
.box--open .box-status { color: var(--mint); }
.box--open .b-check { display: inline; }
.box--open .box-card { border-color: rgba(78, 166, 160, 0.35); }

.box--awaken .box-card { animation: awaken 1.2s var(--ease) both; }
@keyframes awaken {
  0% { transform: scale(1); }
  30% { transform: scale(1.05) rotate(-1deg); box-shadow: 0 0 60px rgba(240, 202, 93, 0.9); }
  55% { transform: scale(1.04) rotate(1deg); }
  100% { transform: scale(1); box-shadow: 0 14px 44px -10px rgba(255, 138, 60, 0.9); }
}

.next-step {
  position: sticky; bottom: calc(var(--safe-b) + 12px); z-index: 15; margin-top: auto;
  padding: 16px 18px 18px; border-radius: 24px;
  background: rgba(35, 44, 63, 0.82); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 -10px 40px -10px rgba(0, 0, 0, 0.6);
  display: grid; gap: 10px;
}
.next-step p { margin: 0; }
.next-text { color: var(--cream-70); font-size: 14.5px; font-weight: 600; }
.next-clue { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.next-clue .eyebrow { display: block; margin-bottom: 4px; }

/* ---------------- sheet (modal) ---------------- */
.modal { position: fixed; inset: 0; z-index: 80; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 12, 18, 0.7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.3s ease; }
.modal-card {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto;
  width: min(var(--col), 100%); max-height: calc(100dvh - var(--safe-t) - 24px); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 22px calc(var(--safe-b) + 22px);
  background: linear-gradient(180deg, #2a3449 0%, #20283a 100%);
  border-radius: 28px 28px 0 0; border: 1px solid var(--line); border-bottom: 0;
  box-shadow: 0 -24px 60px -20px rgba(0, 0, 0, 0.8);
  transform: translateY(105%); transition: transform 0.45s var(--ease);
}
.modal-card::before { content: ""; position: absolute; left: 22px; right: 22px; top: 0; height: 2px; background: var(--grad); border-radius: 2px; opacity: 0.9; }
.modal.is-in .modal-backdrop { opacity: 1; }
.modal.is-in .modal-card { transform: translateY(0); }
.sheet-handle { display: block; width: 44px; height: 5px; margin: 0 auto 18px; border-radius: 3px; background: rgba(241, 231, 212, 0.22); }
.sheet-title { margin: 0 0 8px; font-size: 30px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.sheet-text { margin: 0 0 18px; color: var(--cream-70); font-size: 15.5px; }
.clue-big { margin: 2px 0 10px; font-size: clamp(32px, 10vw, 42px); font-weight: 800; line-height: 1.02; letter-spacing: -0.045em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; text-wrap: balance; animation: clue-in 0.7s var(--spring) 0.15s both; }
@keyframes clue-in { from { opacity: 0; transform: scale(0.85) translateY(10px); filter: blur(6px); } }
.code-form { display: grid; gap: 12px; }
.form-error { min-height: 1.4em; margin: 10px 0 0; color: var(--orange); font-weight: 700; font-size: 14.5px; text-align: center; }
.sheet-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 22px; margin-top: 4px; }
.modal-card--wide .table-wrap { overflow-x: auto; margin: 0 -4px 12px; }

.answer-chip { display: flex; width: 100%; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 14px; border-radius: 14px; border: 1.5px dashed rgba(240, 202, 93, 0.6); background: rgba(221, 173, 38, 0.08); color: var(--cream); cursor: pointer; text-align: left; }
.answer-chip span { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.answer-chip b { font-family: var(--mono); font-size: 16px; letter-spacing: 0.08em; }
.answer-chip i { margin-left: auto; font-style: normal; font-size: 12px; color: var(--cream-45); }

.staff-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; margin-bottom: 14px; border-radius: 16px; background: rgba(18, 22, 31, 0.5); border: 1px solid var(--line); }
.staff-toggle span { display: block; color: var(--cream-70); font-size: 13px; }
.switch { position: relative; flex: 0 0 52px; width: 52px; height: 30px; border-radius: 999px; border: 0; background: rgba(241, 231, 212, 0.15); cursor: pointer; transition: background 0.25s ease; }
.switch span { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--cream); transition: transform 0.3s var(--spring); }
.switch[aria-checked="true"] { background: var(--grad); }
.switch[aria-checked="true"] span { transform: translateX(22px); }
.staff-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.staff-table th, .staff-table td { text-align: left; padding: 8px 5px; border-bottom: 1px solid var(--line); }
.staff-table td:nth-child(3), .staff-table td:nth-child(4) { white-space: nowrap; }
.staff-table small { display: block; font-family: var(--font); font-size: 10.5px; color: var(--cream-45); }
.staff-table th { font-family: var(--mono); font-weight: 400; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cream-45); }
.staff-table td:nth-child(3), .staff-table td:nth-child(4) { font-family: var(--mono); font-weight: 500; color: var(--yellow); }
.staff-table tr.is-current td { background: rgba(221, 173, 38, 0.12); }
.staff-table .muted { color: var(--cream-45); }
.staff-note { font-size: 13px; color: var(--cream-70); margin: 0 0 14px; }
.staff-note strong { color: var(--cream); }
.staff-actions { display: grid; gap: 8px; margin-bottom: 10px; }

/* ---------------- toast, badges ---------------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 12px); z-index: 320;
  width: max-content; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 16px;
  background: var(--cream); color: var(--ink); font-weight: 700; font-size: 14.5px; text-align: center;
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -140%); opacity: 0; pointer-events: none; transition: transform 0.4s var(--spring), opacity 0.25s ease;
}
.toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.test-badge { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 4px); transform: translateX(-50%); z-index: 310; padding: 3px 10px; border-radius: 999px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); background: repeating-linear-gradient(135deg, var(--yellow) 0 8px, var(--gold) 8px 16px); pointer-events: none; }
.staff-link { display: block; margin: 6px auto 0; background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--cream-45); font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
body.is-test .game-body { padding-bottom: calc(var(--safe-b) + 54px); }
body.is-test .next-step { bottom: calc(var(--safe-b) + 30px); }
body.is-test .screen { padding-bottom: calc(var(--safe-b) + 44px); }

/* ---------------- minigame screen ---------------- */
.game-screen {
  position: fixed; inset: 0; z-index: 50; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; background: radial-gradient(120% 60% at 50% 0%, #26304a 0%, var(--ink) 60%);
}
.game-screen.enter { animation: slide-up 0.45s var(--ease) both; }
@keyframes slide-up { from { transform: translateY(30px); opacity: 0; } }
.game-bar { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 10px) var(--pad) 10px; background: linear-gradient(#232c42 55%, rgba(35, 44, 66, 0)); }
.game-heading { text-align: center; min-width: 0; }
.game-heading .eyebrow { margin: 0 0 2px; font-size: 10px; }
.game-name { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.game-intro { margin: 0 auto; padding: 0 var(--pad); width: min(var(--col), 100%); text-align: center; color: var(--cream-70); font-size: 14px; }
.game-body { flex: 1; width: min(var(--col), 100%); margin: 0 auto; padding: 14px var(--pad) calc(var(--safe-b) + 28px); }
.game-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.game-tools .btn { min-height: 44px; padding: 8px 16px; font-size: 14px; }
.test-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(240, 202, 93, 0.35); }
.btn-test { min-height: 40px; padding: 6px 14px; font-size: 13px; color: var(--ink); background: repeating-linear-gradient(135deg, var(--yellow) 0 8px, var(--gold) 8px 16px); }

.game-won { position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; text-align: center; background: rgba(12, 15, 22, 0.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade 0.3s ease both; }
.game-won-text { margin: 0; font-size: clamp(60px, 20vw, 88px); font-weight: 800; letter-spacing: -0.05em; line-height: 0.95; animation: pop 0.7s var(--spring) both; }
.game-won-text em { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.5) rotate(-4deg); } }

/* ---------------- game 1: crossword ---------------- */
.cw { display: grid; gap: 14px; }
.cw-current { position: sticky; top: calc(var(--safe-t) + 64px); z-index: 5; display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; gap: 6px; min-height: 58px; margin: 0; padding: 8px; border-radius: 16px; background: rgba(35, 44, 63, 0.92); border: 1px solid var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cw-current .cw-cur-text { font-size: 14.5px; font-weight: 600; line-height: 1.3; text-align: center; }
.cw-current strong { display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.cw-nav { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: rgba(18, 22, 31, 0.5); cursor: pointer; display: grid; place-items: center; }
.cw-nav svg { width: 18px; height: 18px; fill: none; stroke: var(--cream); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cw-len { color: var(--cream-45); font-size: 0.9em; }
.cw-grid { --cell: min(42px, calc((min(100vw, var(--col)) - 2 * var(--pad) - 4px) / var(--cols))); display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); grid-auto-rows: var(--cell); gap: 2px; justify-content: center; }
.cw-cell { position: relative; background: var(--cream); border-radius: 6px; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); transition: background-color 0.15s ease, transform 0.2s var(--spring); }
.cw-cell input { width: 100%; height: 100%; border: 0; background: transparent; padding: 0; text-align: center; font-family: var(--font); font-weight: 800; font-size: max(16px, calc(var(--cell) * 0.52)); text-transform: uppercase; color: var(--ink); caret-color: transparent; border-radius: 6px; cursor: pointer; }
.cw-cell input:focus { outline: none; }
.cw-num { position: absolute; top: 1px; left: 3px; font-family: var(--mono); font-size: max(8px, calc(var(--cell) * 0.24)); line-height: 1; color: var(--stone); pointer-events: none; }
.cw-cell.is-word { background: #f3dc98; }
.cw-cell.is-cur { background: var(--gold); transform: scale(1.06); z-index: 1; box-shadow: 0 0 0 3px rgba(240, 202, 93, 0.45), 0 6px 16px -4px rgba(0, 0, 0, 0.6); }
.cw-cell.is-wrong { background: #f5b9a5; animation: shake 0.4s ease; }
.cw-cell.is-wrong input { color: var(--red); }
.cw-cell.is-revealed input { color: var(--teal); }
.cw-cell.just-typed { animation: type-pop 0.25s var(--spring); }
@keyframes type-pop { 50% { transform: scale(1.15); } }
.cw-grid.is-solved .cw-cell { background: var(--mint); animation: wave 0.6s var(--spring) both; animation-delay: calc(var(--d, 0) * 25ms); }
@keyframes wave { 40% { transform: translateY(-8px) scale(1.08); } }
.is-test .cw-cell[data-a]::after { content: attr(data-a); position: absolute; right: 3px; bottom: 1px; font-family: var(--mono); font-size: max(8px, calc(var(--cell) * 0.25)); color: rgba(193, 101, 45, 0.9); pointer-events: none; }
.cw-clues { display: grid; gap: 14px; }
.cw-clues h3 { margin: 0 0 4px; font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.cw-clues ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cw-clues li { display: flex; gap: 10px; padding: 9px 10px; border-radius: 12px; cursor: pointer; font-size: 14.5px; }
.cw-clues li.is-active { background: rgba(221, 173, 38, 0.15); }
.cw-clues li.is-done { opacity: 0.45; text-decoration: line-through; }
.cw-clue-num { font-family: var(--mono); color: var(--gold); min-width: 1.6em; }

/* ---------------- game 2: memory ---------------- */
.mem-stats { display: flex; justify-content: space-between; margin-bottom: 12px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cream-70); }
.mem-stats strong { color: var(--yellow); font-weight: 500; }
.mem-grid { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 10px; }
.mem-card { position: relative; aspect-ratio: 4 / 5; padding: 0; border: 0; background: none; cursor: pointer; perspective: 700px; animation: deal 0.5s var(--spring) both; }
@keyframes deal { from { opacity: 0; transform: translateY(24px) scale(0.6) rotate(-6deg); } }
.mem-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.55s var(--spring); }
.mem-card.is-up .mem-inner, .mem-card.is-matched .mem-inner { transform: rotateY(180deg); }
.mem-back, .mem-front { position: absolute; inset: 0; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; }
.mem-back {
  background: linear-gradient(var(--card-solid), var(--card-solid)) padding-box, linear-gradient(135deg, rgba(221, 173, 38, 0.7), rgba(78, 166, 160, 0.5)) border-box;
  border: 1.5px solid transparent;
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.6);
}
.mem-back::before { content: "sp"; font-weight: 800; font-size: 22px; letter-spacing: -0.06em; color: transparent; background: var(--grad); -webkit-background-clip: text; background-clip: text; }
.mem-back::after { content: ""; position: absolute; inset: 7px; border-radius: 11px; border: 1px dashed rgba(241, 231, 212, 0.12); }
.mem-front { transform: rotateY(180deg); background: var(--cream); font-family: var(--emoji); font-size: clamp(30px, 10vw, 42px); line-height: 1; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.6); }
.mem-card.is-matched .mem-front { background: #d6eeea; box-shadow: 0 0 0 3px var(--mint), 0 0 24px rgba(78, 166, 160, 0.6); animation: matched 0.6s var(--spring); }
.mem-card.is-miss .mem-front { box-shadow: 0 0 0 3px var(--red); }
@keyframes matched { 50% { transform: rotateY(180deg) scale(1.1); } }
.mem-peek { position: absolute; right: 6px; top: 4px; z-index: 2; font-family: var(--emoji); font-size: 14px; opacity: 0.85; pointer-events: none; }

/* ---------------- game 3: quiz ---------------- */
.quiz-progress { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 18px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cream-70); }
.quiz-dots { display: flex; gap: 5px; list-style: none; margin: 0; padding: 0; }
.quiz-dots li { width: 9px; height: 9px; border-radius: 50%; background: rgba(241, 231, 212, 0.15); transition: transform 0.3s var(--spring); }
.quiz-dots li.is-now { background: var(--yellow); transform: scale(1.35); }
.quiz-dots li.is-right { background: var(--mint); }
.quiz-dots li.is-wrong { background: var(--red); }
.quiz-score { color: var(--yellow); }
.quiz-q { margin: 0 0 20px; font-size: 25px; font-weight: 800; line-height: 1.18; letter-spacing: -0.03em; text-wrap: balance; animation: q-in 0.45s var(--ease) both; }
@keyframes q-in { from { opacity: 0; transform: translateX(24px); } }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opt { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 12px 16px; border-radius: 18px; text-align: left; cursor: pointer; background: var(--card); border: 1.5px solid var(--line); font-size: 16.5px; font-weight: 700; animation: q-in 0.45s var(--ease) both; transition: transform 0.18s var(--spring), border-color 0.2s ease, background-color 0.2s ease; }
.quiz-opt:nth-child(2) { animation-delay: 0.05s; } .quiz-opt:nth-child(3) { animation-delay: 0.1s; } .quiz-opt:nth-child(4) { animation-delay: 0.15s; }
.quiz-opt:active { transform: scale(0.97); }
.quiz-opt:disabled { cursor: default; }
.quiz-letter { flex: 0 0 34px; display: grid; place-items: center; height: 34px; border-radius: 11px; font-family: var(--mono); font-size: 14px; color: var(--gold); background: rgba(18, 22, 31, 0.6); border: 1px solid var(--line); }
.quiz-opt.is-right { background: rgba(78, 166, 160, 0.22); border-color: var(--mint); animation: pop-soft 0.4s var(--spring); }
.quiz-opt.is-right .quiz-letter { background: var(--mint); color: var(--ink); border-color: transparent; }
.quiz-opt.is-wrong { background: rgba(236, 66, 36, 0.18); border-color: var(--red); animation: shake 0.4s ease; }
.quiz-opt.is-wrong .quiz-letter { background: var(--red); color: var(--cream); border-color: transparent; }
@keyframes pop-soft { 50% { transform: scale(1.03); } }
.quiz-opt .test-tag { margin-left: auto; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); background: var(--yellow); padding: 3px 8px; border-radius: 999px; }
.quiz-feedback { min-height: 1.5em; margin: 16px 0 0; text-align: center; font-weight: 700; }
.quiz-end { text-align: center; padding-top: 6vh; }
.quiz-final { margin: 0; font-size: 92px; font-weight: 800; letter-spacing: -0.06em; line-height: 1; font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; animation: pop 0.7s var(--spring) both; }
.quiz-final span { font-size: 0.32em; letter-spacing: -0.02em; }
.quiz-verdict { margin: 10px auto 24px; max-width: 30ch; font-size: 17px; color: var(--cream-70); }

/* ---------------- game 4: hidden items ---------------- */
.hid-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; list-style: none; margin: 0 0 12px; padding: 0; }
.hid-want { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 7px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: 13px; transition: all 0.3s var(--spring); }
.hid-want-sym { font-family: var(--emoji); font-size: 17px; line-height: 1; }
.hid-want.is-done { background: rgba(78, 166, 160, 0.2); border-color: var(--mint); color: var(--mint); text-decoration: line-through; transform: scale(0.94); }
.hid-scroll { border-radius: 20px; overflow: hidden; box-shadow: 0 0 0 1.5px rgba(221, 173, 38, 0.35), 0 24px 50px -20px rgba(0, 0, 0, 0.8); }
.hid-scene { position: relative; width: 100%; aspect-ratio: 3 / 4; container-type: inline-size; overflow: hidden; background: #263047; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.hid-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hid-layer { position: absolute; inset: 0; }
.hid-item { position: absolute; display: block; width: 1.3em; height: 1.3em; line-height: 1.3em; text-align: center; font-family: var(--emoji); transform: translate(-50%, -50%) rotate(var(--rot)); -webkit-tap-highlight-color: transparent; }
.hid-item.is-found { z-index: 500 !important; filter: none !important; animation: found 0.6s var(--spring) both; }
.hid-item.is-found::after { content: ""; position: absolute; inset: -0.22em; border-radius: 50%; border: 0.08em solid var(--yellow); box-shadow: 0 0 0.5em rgba(240, 202, 93, 0.9), inset 0 0 0.4em rgba(240, 202, 93, 0.5); }
@keyframes found { 0% { transform: translate(-50%, -50%) rotate(var(--rot)) scale(1); } 50% { transform: translate(-50%, -50%) rotate(0deg) scale(1.8); } 100% { transform: translate(-50%, -50%) rotate(0deg) scale(1.25); } }
.hid-item.is-hinted::before { content: ""; position: absolute; left: 50%; top: 50%; width: 3.6em; height: 3.6em; margin: -1.8em 0 0 -1.8em; border-radius: 50%; border: 0.1em solid var(--yellow); animation: hint-ring 1s ease-out 3; pointer-events: none; }
@keyframes hint-ring { from { transform: scale(1.6); opacity: 0; } 40% { opacity: 1; } to { transform: scale(0.4); opacity: 0; } }
.is-test .hid-item[data-t]:not(.is-found) { outline: 0.06em dashed var(--yellow); outline-offset: 0.08em; border-radius: 30%; }
.hid-miss { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 2px solid rgba(241, 231, 212, 0.75); pointer-events: none; z-index: 600; animation: miss 0.5s ease-out both; }
@keyframes miss { from { transform: scale(0.3); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.hid-count { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cream-70); }
.hid-count strong, .jig-count strong { color: var(--yellow); font-weight: 500; }

/* ---------------- game 5: jigsaw ---------------- */
.jig-area { position: relative; width: 100%; height: clamp(500px, calc(100dvh - 230px), 760px); touch-action: none; user-select: none; -webkit-user-select: none; }
.jig-board { position: absolute; border: 1.5px dashed rgba(240, 202, 93, 0.5); border-radius: 8px; background: rgba(18, 22, 31, 0.55); }
.jig-guide { position: absolute; inset: 0; background-size: 100% 100%; opacity: 0.14; filter: grayscale(0.7); transition: opacity 0.3s ease; border-radius: 6px; }
.jig-area.is-peek .jig-guide { opacity: 0.6; filter: none; }
.jig-piece { position: absolute; left: 0; top: 0; z-index: 5; will-change: transform; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.55)); touch-action: none; transition: filter 0.2s ease; }
.jig-piece.is-dragging { filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.6)) brightness(1.08); }
.jig-piece.is-locked { filter: none; }
.jig-piece.is-snapping { transition: transform 0.25s var(--spring); }
.jig-img { position: absolute; inset: 0; background-repeat: no-repeat; }
.jig-edge { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.jig-edge path { fill: none; stroke: rgba(255, 244, 214, 0.5); stroke-width: 1.2; }
.jig-piece.is-locked .jig-edge path { stroke: rgba(0, 0, 0, 0.12); }
.jig-area.is-solved .jig-edge path { stroke: transparent; transition: stroke 0.6s ease; }
.jig-area.is-solved .jig-board { border-color: var(--yellow); box-shadow: 0 0 50px rgba(240, 202, 93, 0.55); }

/* ---------------- scanner ---------------- */
.scanner { position: fixed; inset: 0; z-index: 70; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: calc(var(--safe-t) + 12px) var(--pad) calc(var(--safe-b) + 28px); background: var(--ink); }
.scanner-bar { width: min(var(--col), 100%); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.scanner-title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.04em; }
.scanner-bar .btn { min-height: 42px; padding: 8px 16px; font-size: 14px; }
.scanner-view { position: relative; width: min(var(--col), 100%); border-radius: 22px; overflow: hidden; background: #000; border: 1.5px solid rgba(221, 173, 38, 0.5); min-height: 280px; }
.scanner-view::after { content: ""; position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: linear-gradient(90deg, transparent, var(--red), transparent); box-shadow: 0 0 12px var(--red); animation: laser 1.8s ease-in-out infinite alternate; pointer-events: none; }
@keyframes laser { from { transform: translateY(-60px); } to { transform: translateY(60px); } }
#scanner-reader { width: 100%; }
#scanner-reader video { display: block; width: 100% !important; height: auto !important; }
.scanner-done { position: absolute; inset: 0; display: none; place-items: center; background: rgba(78, 166, 160, 0.45); z-index: 2; }
.scanner.is-success .scanner-done { display: grid; animation: fade 0.2s ease both; }
.scanner.is-success .scanner-view { border-color: var(--mint); }
.scanner.no-camera .scanner-view { display: none; }
.scanner-status { margin: 0; text-align: center; font-weight: 700; max-width: 34ch; min-height: 1.5em; }
.scanner-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; }
.scanner-manual { display: grid; gap: 10px; width: min(var(--col), 100%); }
.scanner-manual .text-input { text-transform: uppercase; text-align: center; letter-spacing: 0.1em; }
.scanner-manual .text-input::placeholder { text-transform: none; letter-spacing: 0; }
.scanner .answer-chip { width: min(var(--col), 100%); }

/* ---------------- box opening stage ---------------- */
.stage { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #33405d 0%, var(--ink) 65%); opacity: 0; transition: opacity 0.3s ease; }
.stage.is-in { opacity: 1; }
.stage.is-out { opacity: 0; transition-duration: 0.4s; }
.stage-box { position: relative; z-index: 2; width: min(260px, 66vw); margin-top: 6vh; transform: scale(0.6); transition: transform 0.6s var(--spring); }
.stage.is-in .stage-box { transform: scale(1); }
.stage-box.is-shaking { animation: rattle 0.9s ease-in-out; }
@keyframes rattle { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-6deg) translateY(-6px); } 20% { transform: rotate(6deg); } 30% { transform: rotate(-7deg) translateY(-8px); } 40% { transform: rotate(7deg); } 55% { transform: rotate(-4deg) translateY(-4px); } 70% { transform: rotate(4deg); } 85% { transform: rotate(-1deg); } }
.stage.is-open .stage-box { animation: lift 0.8s var(--spring); }
@keyframes lift { 40% { transform: scale(1.12) translateY(-10px); } }
.stage-rays { position: absolute; left: 50%; top: 44%; width: 200vmax; height: 200vmax; margin: -100vmax 0 0 -100vmax; z-index: 1; background: repeating-conic-gradient(from 0deg, rgba(240, 202, 93, 0.14) 0deg 6deg, transparent 6deg 16deg); -webkit-mask: radial-gradient(circle, #000 0%, transparent 45%); mask: radial-gradient(circle, #000 0%, transparent 45%); opacity: 0; transform: scale(0.3); transition: opacity 0.6s ease 0.2s, transform 1.2s var(--ease) 0.2s; }
.stage.is-open .stage-rays { opacity: 1; transform: scale(1); animation: spin 20s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.stage-copy { position: relative; z-index: 3; text-align: center; opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease 0.45s, transform 0.6s var(--spring) 0.45s; }
.stage.is-open .stage-copy { opacity: 1; transform: none; }
.stage-text { margin: 0 0 12px; font-size: clamp(52px, 16vw, 68px); font-weight: 800; letter-spacing: -0.05em; line-height: 1; }
.stage-text em { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stage-chip { display: inline-block; margin: 0; padding: 8px 16px; border-radius: 999px; background: rgba(78, 166, 160, 0.18); border: 1px solid var(--mint); color: var(--mint); font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------------- video ---------------- */
.video-screen { position: fixed; inset: 0; z-index: 85; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: calc(var(--safe-t) + 16px) var(--pad) calc(var(--safe-b) + 20px); background: radial-gradient(120% 70% at 50% 30%, #222b40 0%, #0d1018 75%); }
.video-screen.enter { animation: fade 0.4s ease both; }
.video-screen .eyebrow { margin: 0; }
.video-title { margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -0.04em; text-align: center; }
.video-frame { position: relative; width: min(var(--col), 100%); aspect-ratio: 16 / 9; background: #000; border-radius: 20px; overflow: hidden; box-shadow: 0 0 0 1.5px rgba(221, 173, 38, 0.45), 0 30px 60px -20px rgba(0, 0, 0, 0.9); }
.video-frame video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-play { position: absolute; inset: 0; margin: auto; width: max-content; height: max-content; display: flex; flex-direction: column; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; font-weight: 700; }
.video-play svg { width: 84px; height: 84px; padding: 22px; border-radius: 50%; fill: var(--ink); background: var(--grad); box-shadow: 0 0 0 8px rgba(255, 138, 60, 0.2); animation: glow 2s ease-in-out infinite; }
.video-progress { width: min(var(--col), 100%); height: 4px; border-radius: 2px; background: rgba(241, 231, 212, 0.12); overflow: hidden; }
.video-progress span { display: block; height: 100%; width: 0; background: var(--grad); transition: width 0.25s linear; }
.video-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; width: min(var(--col), 100%); margin-top: 6px; }
.video-frame.is-fallback { aspect-ratio: auto; min-height: 240px; display: flex; }
.video-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 20px; text-align: center; background: radial-gradient(circle at 50% 30%, #2f3b52, #191e2b 70%); }
.video-frame.is-fallback .video-fallback { position: relative; inset: auto; flex: 1; }
.video-fallback p { margin: 0; }
.fb-note { color: var(--cream-45); font-size: 13px; margin-bottom: 14px !important; }
.fb-note code { color: var(--yellow); font-family: var(--mono); }
.fb-label { color: var(--cream-70); }
.fb-word { font-size: clamp(36px, 12vw, 52px); font-weight: 800; letter-spacing: 0.04em; line-height: 1.1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fb-count { margin-top: 10px !important; font-family: var(--mono); color: var(--cream-45); font-variant-numeric: tabular-nums; }

/* ---------------- finale ---------------- */
.screen-finale { text-align: center; display: flex; flex-direction: column; align-items: center; padding-top: calc(var(--safe-t) + 36px); }
.finale-ring { margin-bottom: 18px; }
.match-ring-xl { width: 168px; height: 168px; flex-basis: 168px; filter: drop-shadow(0 0 30px rgba(255, 138, 60, 0.35)); }
.match-ring-xl .match-num { font-size: 52px; }
.match-ring-xl .match-num small { font-size: 22px; }
.finale-title { margin: 0 0 14px; font-size: clamp(40px, 12vw, 52px); font-weight: 800; letter-spacing: -0.05em; line-height: 0.98; text-wrap: balance; }
.finale-team { margin: 0; color: var(--cream-70); }
.finale-time { margin: 2px 0; font-family: var(--mono); font-weight: 500; font-size: clamp(56px, 18vw, 76px); letter-spacing: -0.04em; line-height: 1.05; font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.finale-rank { margin: 4px 0 22px; color: var(--cream-70); font-size: 15px; }
.screen-finale .board-card { width: 100%; text-align: left; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
