/* Homepage only: the Loot practice sprint and the sealed tiles. The creator
   page keeps the shared styles.css tokens. */
.launch {
  --gold: #e9cf8c;
  --gold-soft: #e9cf8c1c;
  --gold-button: #e7d09a;
  --gold-ink: #202a20;
  --card-line: #3c5a3d;
  --card-soft: #ffffff08;
  --card-track: #ffffff14;
  --card-muted: #b9cbbd;
  --miss: #ff8a7a;
  min-height: 100svh;
  background: radial-gradient(ellipse at 50% 30%, #12372555, transparent 55%), #04110d;
}
.launch-header, .launch-footer, .launch-main {
  width: min(100% - 96px, 1180px);
  margin-inline: auto;
}
.launch-header, .launch-footer { display: flex; align-items: center; justify-content: space-between; }
.launch-header { min-height: 96px; }
.wordmark { color: var(--ink); text-decoration: none; font-size: 27px; font-weight: 650; letter-spacing: -1.4px; }
.wordmark span { color: #72c995; }
.launch-status { display: inline-flex; align-items: center; gap: 9px; color: #a5b4aa; font-size: 12px; }
.status-dot { width: 5px; height: 5px; background: #78c291; border-radius: 50%; box-shadow: 0 0 10px #78c29144; }
.launch-footer { min-height: 76px; border-top: 1px solid #a6c1ac14; color: #8a9e90; font-size: 11px; gap: 18px; }
.launch-footer a { color: inherit; text-decoration: none; }
.launch-footer a:hover { color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* styles.css centres a bare <main>; this page lays out its own sections. */
.launch-main { display: block; flex: 1; text-align: left; padding: 16px 0 88px; }

/* ---- hero ---- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 72px; align-items: center; }
.launch-eyebrow { margin: 0 0 19px; color: #a3b5a6; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .2em; }
.launch h1 { margin: 0; max-width: none; font-size: clamp(44px, 6vw, 80px); letter-spacing: -.055em; line-height: 1.04; font-weight: 500; }
.launch h1 span, .soon h2 span { color: #89b98a; }
.launch-description { max-width: 44ch; margin: 22px 0 0; color: #a3b5aa; font-size: 16px; line-height: 1.7; }
.score-rules { display: grid; gap: 14px; max-width: 46ch; margin: 30px 0 0; padding: 0; list-style: none; }
.score-rules li { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: baseline; color: #a3b5aa; font-size: 13px; line-height: 1.6; }
.score-rules b { color: var(--gold); font-weight: 600; font-size: 13px; white-space: nowrap; }

/* ---- game card ---- */
.game { position: relative; min-width: 0; padding: 20px; border: 1px solid var(--card-line); border-radius: 24px; background: radial-gradient(ellipse at 50% 16%, #234d36, #0e241b 72%); box-shadow: 0 30px 80px #0007; text-align: center; overflow: hidden; scroll-margin-top: 16px; }
.game :is(button, input, a):focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.game-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mode { display: inline-flex; padding: 3px; border: 1px solid var(--card-line); border-radius: 999px; background: #04110d88; }
.mode button { padding: 7px 13px; border: 0; border-radius: 999px; background: none; color: var(--card-muted); font-size: 12px; }
.mode button[aria-pressed="true"] { background: var(--gold-soft); color: var(--gold); }
.mode button:disabled { cursor: default; }
.mode button:disabled:not([aria-pressed="true"]) { opacity: .45; }
.sound { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--card-line); border-radius: 50%; background: transparent; color: var(--card-muted); }
.sound .off, .sound[aria-pressed="false"] .on { display: none; }
.sound[aria-pressed="false"] .off { display: block; }

.stage { position: relative; height: 220px; margin: 6px auto 0; display: grid; place-items: center; transition: height .25s ease; }
.stage-glow { position: absolute; inset: 10px 30px 20px; background: radial-gradient(ellipse, #edc64c26, transparent 65%); }
.game[data-state="end"] .stage-glow { background: radial-gradient(ellipse, #ffd76a5c, transparent 68%); }
.bag-wrap { position: relative; width: 170px; height: 180px; transition: width .25s ease, height .25s ease; }
.bag-wrap.packing { animation: pack .45s ease-out; }
.bag-wrap.open { animation: pop .8s ease-out; }
.loot-bag { width: 100%; height: 100%; filter: drop-shadow(0 14px 16px #0005); animation: hover-bag 7s ease-in-out infinite; }
.coins { position: absolute; inset: 0; pointer-events: none; }
.coin { position: absolute; top: 0; left: calc(50% + var(--x, 0px) - 10px); width: 20px; height: 20px; border: 2px solid #f5d999; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f3d77c, #c99a3a); box-shadow: 0 2px 6px #0006; animation: drop .6s ease-in var(--delay, 0s) both; }
.coin.burst { top: 32%; left: calc(50% - 10px); animation: burst .9s ease-out var(--delay, 0s) both; }
.gain { position: absolute; left: 50%; bottom: 36px; color: var(--gold); font-size: 16px; font-weight: 650; animation: gain .7s ease-out both; }
.haul { position: absolute; left: 50%; bottom: 0; margin: 0; padding: 5px 12px; transform: translateX(-50%); border: 1px solid var(--card-line); border-radius: 999px; background: #04110dcc; color: var(--card-muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.haul strong { color: var(--gold); font-weight: 600; }

.timer { height: 4px; margin-top: 16px; overflow: hidden; border-radius: 4px; background: var(--card-track); }
.timer i { display: block; height: 100%; background: linear-gradient(90deg, #44b577, var(--gold)); transform-origin: left; }
.timer.low i { background: var(--miss); }

.panel { display: none; padding-top: 18px; }
.game[data-state="idle"] .panel-idle,
.game[data-state="play"] .panel-play,
.game[data-state="end"] .panel-end { display: block; }
.panel-title { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.panel-sub { margin: 8px 0 0; color: var(--card-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.primary, .secondary { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; margin-top: 18px; border-radius: 12px; font-size: 15px; font-weight: 600; text-decoration: none; transition: filter 150ms ease, background 150ms ease; }
.primary { border: 1px solid #eeddba; background: var(--gold-button); color: var(--gold-ink); }
.primary:hover { filter: brightness(1.06); }
.secondary { border: 1px solid var(--card-line); background: var(--card-soft); color: var(--ink); }
.secondary:hover { background: #ffffff12; }
.hint { margin: 12px 0 0; color: var(--card-muted); font-size: 11px; line-height: 1.6; }

.play-meta { display: flex; justify-content: space-between; gap: 12px; margin: 0; color: var(--card-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.play-meta strong { color: var(--ink); font-weight: 600; }
.play-meta .mult[data-level="2"], .play-meta .mult[data-level="3"] { color: var(--gold); }
.equation { min-height: 1.1em; margin: 14px 0 0; font-size: clamp(40px, 6vw, 54px); font-weight: 500; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.answer-row { display: flex; gap: 8px; margin-top: 16px; }
.answer-row input { flex: 1; min-width: 0; height: 54px; padding: 0 12px; border: 1px solid var(--card-line); border-radius: 12px; outline: none; background: #04110d; text-align: center; font-size: 24px; font-variant-numeric: tabular-nums; }
.answer-row input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px #e9cf8c22; }
.game .answer-row input:focus-visible { outline: none; }
.answer-row input.miss { border-color: var(--miss); animation: shake .3s; }
.skip { padding: 0 16px; border: 1px solid var(--card-line); border-radius: 12px; background: transparent; color: var(--card-muted); font-size: 13px; }
.skip:hover { color: var(--ink); }
.miss-note { min-height: 18px; margin: 10px 0 0; color: var(--miss); font-size: 12px; font-variant-numeric: tabular-nums; }

.end-score { margin: 6px 0 0; color: var(--card-muted); font-size: 14px; }
.end-score strong { display: block; color: var(--gold); font-size: 58px; font-weight: 500; letter-spacing: -.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.best-flag { display: inline-block; margin: 10px 0 0; padding: 4px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.best-flag[hidden] { display: none; }
.end-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 0; }
.end-stats div { padding: 10px 6px; border: 1px solid var(--card-line); border-radius: 10px; background: var(--card-soft); }
.end-stats dt { color: var(--card-muted); font-size: 10px; }
.end-stats dd { margin: 4px 0 0; font-size: 18px; font-variant-numeric: tabular-nums; }
.end-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.game-foot { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid #ffffff10; color: var(--card-muted); font-size: 11px; line-height: 1.6; }

/* ---- sealed tiles ---- */
.soon { margin-top: 112px; text-align: center; }
.soon h2 { margin: 0; font-size: clamp(30px, 4vw, 46px); font-weight: 500; letter-spacing: -.045em; line-height: 1.1; text-wrap: balance; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 36px; text-align: left; }
.tile { display: flex; flex-direction: column; min-height: 176px; padding: 20px; border: 1px solid #a6c1ac1f; border-radius: 18px; background: #ffffff05; }
.tile-tag { display: inline-flex; align-items: center; gap: 7px; color: #8a9e90; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.tile h3 { margin: 18px 0 0; font-size: 19px; font-weight: 500; letter-spacing: -.02em; }
.tile p { margin: 8px 0 0; color: #a3b5aa; font-size: 13px; line-height: 1.6; }
.tile-open { border-color: #e9cf8c40; background: linear-gradient(160deg, #234d3655, #0e241b55); }
.tile-open .tile-tag, .tile a { color: var(--gold); }
.tile a { margin-top: auto; padding-top: 16px; font-size: 13px; text-decoration: none; }
.tile a:hover { text-decoration: underline; text-underline-offset: 4px; }
.redacted { display: inline-block; max-width: 100%; height: 16px; border-radius: 4px; background: repeating-linear-gradient(90deg, #a6c1ac24 0 8px, #a6c1ac12 8px 16px); vertical-align: middle; }
.updates-link { display: inline-flex; gap: 17px; align-items: center; margin-top: 36px; padding: 13px 20px; border: 1px solid #35513e; border-radius: 999px; color: #d4e5d8; background: #a3c99808; font-size: 12px; text-decoration: none; transition: background 160ms ease, border-color 160ms ease; }
.updates-link:hover { background: #a3c99815; border-color: #69816b; }

@keyframes hover-bag { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(1deg); } }
@keyframes pack { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.06, .94); } 70% { transform: scale(.97, 1.04); } }
@keyframes pop { 0%, 100% { transform: scale(1); } 35% { transform: scale(1.14) rotate(-6deg); } 65% { transform: scale(1.04) rotate(4deg); } }
@keyframes drop { from { transform: translateY(-16px); opacity: 0; } 25%, 80% { opacity: 1; } to { transform: translateY(78px) scale(.8); opacity: 0; } }
@keyframes burst { from { transform: translate(0, 0) scale(.6); opacity: 0; } 20% { opacity: 1; } to { transform: translate(var(--dx), var(--dy)) rotate(160deg); opacity: 0; } }
@keyframes gain { from { transform: translate(-50%, 0); opacity: 0; } 20% { opacity: 1; } to { transform: translate(-50%, -34px); opacity: 0; } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .hero-copy { text-align: center; }
  .launch-description, .score-rules { margin-inline: auto; }
  .score-rules { text-align: left; }
  .game { width: 100%; max-width: 520px; margin-inline: auto; }
  /* Leave room for the on-screen keyboard while a round runs. */
  .game[data-state="play"] .stage { height: 130px; }
  .game[data-state="play"] .bag-wrap { width: 100px; height: 106px; }
  .soon { margin-top: 80px; }
  .tiles { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }
  .tile { min-height: 0; }
}
@media (max-width: 600px) {
  .launch-header, .launch-footer, .launch-main { width: calc(100% - 32px); }
  .launch-header { min-height: 76px; }
  .wordmark { font-size: 24px; }
  .launch-status { font-size: 11px; }
  .launch-main { padding: 8px 0 56px; }
  .launch-eyebrow { font-size: 10px; }
  .launch-description { font-size: 14px; margin-top: 18px; }
  .score-rules li { grid-template-columns: 72px 1fr; gap: 10px; font-size: 12px; }
  .game { padding: 16px; border-radius: 20px; }
  .stage { height: 190px; }
  .bag-wrap { width: 146px; height: 156px; }
  .end-score strong { font-size: 50px; }
  .launch-footer { min-height: 68px; font-size: 10px; }
}
@media (max-width: 360px) {
  .mode button { padding: 7px 10px; font-size: 11px; }
  .end-actions { grid-template-columns: 1fr; }
  .end-actions .secondary { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .loot-bag, .bag-wrap.packing, .bag-wrap.open, .answer-row input.miss { animation: none; }
  .coin, .gain { display: none; }
  .stage, .bag-wrap, .updates-link, .primary, .secondary { transition: none; }
}
