/* ==========================================================================
   Starlight Midway — night carnival theme
   Rebrand: change the tokens in :root and the values in assets/js/config.js
   ========================================================================== */

:root {
  --night: #0F2731;
  --night-2: #15343F;
  --night-3: #1D4552;
  --line: rgba(255, 244, 222, 0.14);
  --cream: #FFF4DE;
  --cream-dim: rgba(255, 244, 222, 0.72);
  --gold: #FFD27A;
  --gold-deep: #F2A93B;
  --red: #E0475B;
  --red-deep: #A92D40;
  --mint: #7FD8BE;
  --ink: #0A1D24;

  --font-display: 'Bungee', 'Arial Black', system-ui, sans-serif;
  --font-body: 'Familjen Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 500px at 50% -120px, rgba(255, 210, 122, 0.10), transparent 70%),
    var(--night);
  color: var(--cream);
  font: 400 1.0625rem/1.55 var(--font-body);
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--cream); }
h1, h2, h3 { line-height: 1.12; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; border-radius: 4px; }
.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; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 200; padding: 10px 16px; border-radius: 10px; background: var(--gold); color: var(--ink); font-weight: 700; }
.skip:focus { top: 12px; color: var(--ink); }
#daily { scroll-margin-top: 110px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
code { font-size: 0.9em; background: var(--night-3); padding: 0.1em 0.35em; border-radius: 4px; }

.display { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.01em; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--night-3);
  --btn-fg: var(--cream);
  --btn-edge: rgba(0, 0, 0, 0.35);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 48px;
  padding: 0.7em 1.4em;
  border: 0;
  border-radius: 12px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--btn-edge);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
.btn:hover { color: var(--btn-fg); filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--btn-edge); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: 0 4px 0 var(--btn-edge); filter: none; }
.btn--gold { --btn-bg: var(--gold); --btn-fg: var(--ink); --btn-edge: var(--gold-deep); }
.btn--red { --btn-bg: var(--red); --btn-fg: var(--cream); --btn-edge: var(--red-deep); }
.btn--cream { --btn-bg: var(--cream); --btn-fg: var(--ink); --btn-edge: #CDBF9F; }
.btn--ghost { --btn-bg: transparent; --btn-edge: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.btn--ghost:hover { box-shadow: inset 0 0 0 2px var(--cream-dim); }
.btn--ghost:active { transform: none; box-shadow: inset 0 0 0 2px var(--cream); }
.btn--small { min-height: 40px; padding: 0.45em 1em; font-size: 0.95rem; }
.btn--block { width: 100%; }
.linkish { background: none; border: 0; padding: 0; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- Awning (signature edge) ---------- */
.awning {
  --stripe: 34px;
  --stripe-a: var(--red);
  --stripe-b: var(--cream);
  height: 22px;
  background: repeating-linear-gradient(90deg, var(--stripe-a) 0 var(--stripe), var(--stripe-b) var(--stripe) calc(var(--stripe) * 2));
  -webkit-mask:
    linear-gradient(#000 0 0) top / 100% 6px no-repeat,
    radial-gradient(circle at calc(var(--stripe) / 2) 5px, #000 calc(var(--stripe) / 2 - 0.5px), transparent calc(var(--stripe) / 2)) 0 0 / var(--stripe) 100% repeat-x;
          mask:
    linear-gradient(#000 0 0) top / 100% 6px no-repeat,
    radial-gradient(circle at calc(var(--stripe) / 2) 5px, #000 calc(var(--stripe) / 2 - 0.5px), transparent calc(var(--stripe) / 2)) 0 0 / var(--stripe) 100% repeat-x;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.25));
}

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; }
.site-header__bar {
  display: flex; align-items: center; gap: 24px;
  min-height: 68px;
  background: var(--night-2);
  max-width: none;
  padding-block: 10px;
}
.site-header__bar { padding-inline: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter))); }
.site-header .awning { margin-top: -1px; }

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cream); flex-shrink: 0; }
.logo:hover { color: var(--cream); }
.logo__mark { width: 36px; height: 36px; }
.logo__word { font-family: var(--font-display); font-size: 1.15rem; line-height: 1; }

.nav { display: flex; gap: 4px; margin-right: auto; }
.nav a {
  padding: 10px 14px; border-radius: 10px;
  color: var(--cream-dim); text-decoration: none; font-weight: 600;
}
.nav a:hover { color: var(--cream); background: var(--night-3); }
.nav a[aria-current="page"] { color: var(--cream); box-shadow: inset 0 -3px 0 var(--gold); border-radius: 10px 10px 4px 4px; }

.nav-dot { display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--night-2); vertical-align: 2px; }
.nav-dot[hidden] { display: none; }

/* ---------- Rewards: missions + leaderboard ---------- */
.missions { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.mission .stub__top h3 { font-size: 1.05rem; }
.mission__meter { height: 10px; border-radius: 999px; background: rgba(10, 29, 36, 0.18); overflow: hidden; margin: 12px 0 6px; }
.mission__meter span { display: block; height: 100%; background: var(--ink); border-radius: inherit; transition: width 0.4s; }
.mission__count { font-weight: 700; font-variant-numeric: tabular-nums; }
.mission .pack__row .btn { --btn-bg: var(--ink); --btn-fg: var(--gold); --btn-edge: #000; }
.mission.is-claimed { opacity: 0.6; }
.rewards-meta { color: var(--cream-dim); margin: 6px 0 0; font-variant-numeric: tabular-nums; }

.lb { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.lb th, .lb td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.lb th { color: var(--cream-dim); font-weight: 600; font-size: 0.92rem; }
.lb td.num, .lb th.num { text-align: right; }
.lb .lb__rank { font-family: var(--font-display); color: var(--gold); width: 3ch; }
.lb tr.is-me td { background: rgba(127, 216, 190, 0.12); }
.lb tr.is-me td:first-child { box-shadow: inset 4px 0 0 var(--mint); }
.lb-wrap { overflow-x: auto; border-radius: var(--radius-m); background: var(--night-2); border: 1px solid var(--line); }
.lb-claim { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; padding: 18px 20px; margin-bottom: 18px; border-radius: var(--radius-m); background: var(--gold); color: var(--ink); }
.lb-claim p { margin: 0; font-weight: 600; }
.lb-claim .btn { --btn-bg: var(--ink); --btn-fg: var(--gold); --btn-edge: #000; }

/* Missions card on game pages */
.side-missions { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.side-missions li { display: grid; gap: 6px; }
.side-missions .row { display: flex; justify-content: space-between; gap: 10px; font-size: 0.94rem; }
.side-missions .row span:last-child { color: var(--cream-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.side-missions .bar { height: 6px; border-radius: 999px; background: var(--night-3); overflow: hidden; }
.side-missions .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--gold)); transition: width 0.4s; }
.side-missions .is-done .row span:first-child { color: var(--mint); }

.site-header__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.balance {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 8px; border-radius: 999px;
  background: var(--ink); color: var(--gold); text-decoration: none; font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px rgba(255, 210, 122, 0.3);
}
.balance:hover { color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.coin-icon { width: 22px; height: 22px; flex-shrink: 0; }
.balance__amount.is-bump { animation: bump 0.4s ease-out; }
@keyframes bump { 40% { transform: scale(1.18); color: var(--cream); } }

.account { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 0; background: var(--night-3); cursor: pointer; font-weight: 600; }
.account__lvl { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--mint); color: var(--ink); font-family: var(--font-display); font-size: 0.85rem; }
.account__name { max-width: 10ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu-btn { display: none; width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--night-3); cursor: pointer; padding: 12px 11px; flex-direction: column; justify-content: space-between; }
.menu-btn span { display: block; height: 2px; background: var(--cream); border-radius: 2px; }

@media (max-width: 920px) {
  .menu-btn { display: flex; }
  .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--night-2);
    border-bottom: 1px solid var(--line);
  }
  .site-header.is-open .nav { display: flex; }
  .site-header.is-open .awning { visibility: hidden; }
  .nav a { padding: 14px 8px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--gold); padding-left: 16px; border-radius: 0; }
  .logo__word { font-size: 1rem; }
}
@media (max-width: 520px) {
  .logo__word { display: none; }
  .site-header__bar { gap: 10px; }
  .account__name { display: none; }
  .account { padding: 4px; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(40px, 6vw, 72px); }
.section--tight { padding-top: 8px; }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0; }
.section__lede { color: var(--cream-dim); max-width: 60ch; margin: 8px 0 0; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(28px, 5vw, 56px) clamp(24px, 4vw, 40px); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr); gap: clamp(20px, 3vw, 40px); align-items: stretch; }

.marquee {
  position: relative;
  padding: clamp(52px, 6vw, 68px) clamp(48px, 6vw, 72px);
  border-radius: var(--radius-l);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(224, 71, 91, 0.35), transparent 60%),
    linear-gradient(160deg, #23505E, #163844 60%);
  box-shadow: inset 0 0 0 10px var(--ink), inset 0 0 0 12px rgba(255, 210, 122, 0.35), 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  display: flex; flex-direction: column; justify-content: center;
  min-height: 420px;
}
.marquee__bulbs { position: absolute; inset: 0; pointer-events: none; }
.bulb {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: #6B5A3A;
  animation: chase 1.05s steps(1) infinite;
}
.bulb:nth-child(3n+1) { animation-delay: -0.35s; }
.bulb:nth-child(3n+2) { animation-delay: -0.7s; }
@keyframes chase {
  0% { background: #FFF1C9; box-shadow: 0 0 10px 3px rgba(255, 210, 122, 0.85); }
  33% { background: #6B5A3A; box-shadow: none; }
}
.marquee__title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  line-height: 0.95;
  color: var(--gold);
  text-shadow: 0 0 22px rgba(255, 210, 122, 0.45), 0 4px 0 var(--red-deep);
  margin: 0 0 20px;
}
.marquee__text { font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 34ch; color: var(--cream); margin-bottom: 26px; }
.marquee__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.marquee__facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 26px 0 0; padding: 0; list-style: none; color: var(--cream-dim); font-size: 0.95rem; }
.marquee__facts li { display: inline-flex; align-items: center; gap: 8px; }
.marquee__facts li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }

/* Daily wheel */
.daily {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 26px 22px 24px;
  border-radius: var(--radius-l);
  background: var(--night-2);
  border: 1px solid var(--line);
}
.daily__title { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; margin: 0 0 4px; }
.daily__text { color: var(--cream-dim); margin: 0 0 14px; font-size: 0.98rem; }
.daily__wheel { position: relative; width: min(280px, 100%); aspect-ratio: 1; margin-bottom: 18px; }
.daily__wheel > svg:first-child { width: 100%; height: 100%; }
.daily__rotor { transform-origin: 50% 50%; transform-box: fill-box; }
.daily__pointer { position: absolute; top: -6px; left: 50%; width: 30px; height: 36px; margin-left: -15px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.4)); }
.daily__status { min-height: 1.5em; margin: 12px 0 0; color: var(--cream-dim); font-variant-numeric: tabular-nums; }

@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
  .marquee { min-height: 0; }
}

/* ---------- Category chips + search ---------- */
.filters { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 26px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.chip {
  flex-shrink: 0; padding: 9px 16px; border-radius: 999px; border: 0;
  background: var(--night-2); color: var(--cream-dim); font-weight: 600; text-decoration: none; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line);
}
.chip:hover { color: var(--cream); }
.chip[aria-pressed="true"], .chip[aria-current="true"] { background: var(--gold); color: var(--ink); box-shadow: none; }
.search { position: relative; flex: 0 1 300px; }
.search input {
  width: 100%; min-height: 46px; padding: 10px 14px 10px 42px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--night-2); color: var(--cream); font: inherit;
}
.search input::placeholder { color: var(--cream-dim); }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--cream-dim); stroke-width: 2; }
@media (max-width: 640px) { .search { flex-basis: 100%; } }

/* ---------- Booths (game cards) ---------- */
.booths { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 26px 18px; }
.booths--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
@media (max-width: 480px) { .booths { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; } }

.booth { position: relative; }
.booth__link {
  display: flex; flex-direction: column; height: 100%;
  padding-top: 18px;
  border-radius: 6px 6px var(--radius-m) var(--radius-m);
  background: var(--night-2);
  color: var(--cream); text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--line);
  position: relative;
}
.booth__link::before {
  /* mini awning on every booth */
  content: ''; position: absolute; left: -4px; right: -4px; top: -6px; height: 26px;
  --stripe: 22px;
  background: repeating-linear-gradient(90deg, var(--booth) 0 var(--stripe), var(--cream) var(--stripe) calc(var(--stripe) * 2));
  -webkit-mask:
    linear-gradient(#000 0 0) top / 100% 12px no-repeat,
    radial-gradient(circle at 11px 12px, #000 10.5px, transparent 11px) 0 0 / 22px 100% repeat-x;
          mask:
    linear-gradient(#000 0 0) top / 100% 12px no-repeat,
    radial-gradient(circle at 11px 12px, #000 10.5px, transparent 11px) 0 0 / 22px 100% repeat-x;
  border-radius: 6px 6px 0 0;
}
.booth__link:hover { color: var(--cream); box-shadow: inset 0 0 0 2px var(--booth); }
.booth__link:hover .booth__title { color: var(--gold); }
.booth__art {
  margin: 14px 12px 0;
  aspect-ratio: 4 / 3;
  display: grid; place-items: center;
  border-radius: var(--radius-s);
  background: radial-gradient(70% 70% at 50% 55%, color-mix(in srgb, var(--booth) 30%, transparent), transparent 70%), var(--night-3);
}
.booth__art svg { width: 82%; height: auto; }
.booth__body { padding: 12px 14px 16px; }
.booth__title { font-family: var(--font-display); font-weight: 400; font-size: 1.05rem; margin: 0 0 2px; }
.booth__cat { margin: 0; color: var(--cream-dim); font-size: 0.92rem; display: flex; align-items: center; gap: 8px; }
.tag-new { padding: 1px 8px; border-radius: 999px; background: var(--mint); color: var(--ink); font-size: 0.78rem; font-weight: 700; }
.booth__fav {
  position: absolute; top: 28px; right: 18px;
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: rgba(10, 29, 36, 0.72); cursor: pointer;
}
.booth__fav svg { width: 20px; height: 20px; fill: none; stroke: var(--cream); stroke-width: 2; }
.booth__fav[aria-pressed="true"] svg { fill: var(--red); stroke: var(--red); }
.booth__fav:hover svg { stroke: var(--gold); }

.booth--wide .booth__link { flex-direction: row; align-items: stretch; }
.booth--wide .booth__art { width: 44%; flex-shrink: 0; margin: 14px 0 14px 14px; aspect-ratio: auto; min-height: 170px; }
.booth--wide .booth__body { padding: 16px 20px 20px; display: flex; flex-direction: column; align-items: flex-start; }
.booth--wide .booth__title { font-size: 1.3rem; }
.booth--wide .booth__blurb { color: var(--cream-dim); margin: 10px 0 16px; font-size: 0.98rem; }
.booth--wide .btn { margin-top: auto; }
.booth--wide .booth__fav { left: 24px; right: auto; }
@media (max-width: 520px) {
  .booth--wide .booth__link { flex-direction: column; }
  .booth--wide .booth__art { width: auto; margin: 14px 12px 0; aspect-ratio: 16 / 9; min-height: 0; }
  .booth--wide .booth__fav { left: auto; right: 18px; }
}

.empty { padding: 40px 24px; text-align: center; border-radius: var(--radius-m); border: 2px dashed var(--line); color: var(--cream-dim); }
.empty h2 { color: var(--cream); font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; }

/* ---------- Ticket stubs (packs + how-it-works) ---------- */
.stubs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.stub {
  --stub: var(--cream);
  --notch: 14px;
  position: relative;
  display: flex; flex-direction: column;
  padding: 22px 22px 20px;
  background: var(--stub); color: var(--ink);
  border-radius: 10px;
  -webkit-mask:
    radial-gradient(circle at 0 var(--tear), transparent var(--notch), #000 calc(var(--notch) + 0.5px)) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% var(--tear), transparent var(--notch), #000 calc(var(--notch) + 0.5px)) right / 51% 100% no-repeat;
          mask:
    radial-gradient(circle at 0 var(--tear), transparent var(--notch), #000 calc(var(--notch) + 0.5px)) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% var(--tear), transparent var(--notch), #000 calc(var(--notch) + 0.5px)) right / 51% 100% no-repeat;
  --tear: 66%;
}
.stub__top { flex: 1; }
.stub__tear { margin: 18px -22px 16px; border-top: 2px dashed rgba(10, 29, 36, 0.28); }
.stub h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.15rem; margin: 0 0 6px; }
.stub p { margin: 0; color: rgba(10, 29, 36, 0.78); }
.stub--gold { --stub: var(--gold); }
.stub--mint { --stub: var(--mint); }
.stub--red { --stub: var(--red); color: var(--cream); }
.stub--red p { color: rgba(255, 244, 222, 0.88); }
.stub--red .stub__tear { border-color: rgba(255, 244, 222, 0.4); }

.pack__coins { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.2rem); line-height: 1; margin: 6px 0 4px; display: flex; align-items: center; gap: 8px; }
.pack__coins .coin-icon { width: 28px; height: 28px; }
.pack__price { font-weight: 700; font-size: 1.2rem; }
.pack__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pack .btn { --btn-bg: var(--ink); --btn-fg: var(--gold); --btn-edge: #000; }
.pack .fine { margin-top: 12px; font-size: 0.85rem; }

/* ---------- Info strip ---------- */
.notice {
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start;
  padding: 20px 22px; border-radius: var(--radius-m);
  background: var(--night-2); border: 1px solid var(--line);
}
.notice p { margin: 0; color: var(--cream-dim); }
.notice strong { color: var(--cream); }
.badge-18 {
  display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 6px;
  border-radius: 50%; border: 3px solid var(--red); color: var(--cream);
  font-family: var(--font-display); font-size: 0.9rem;
}

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { border-radius: var(--radius-m); background: var(--night-2); border: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 56px 18px 20px; position: relative; font-weight: 700; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ''; position: absolute; right: 22px; top: 50%; width: 12px; height: 12px; margin-top: -8px;
  border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(45deg); transition: transform 0.2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details > div { padding: 0 20px 18px; color: var(--cream-dim); max-width: 70ch; }
.faq details > div p:last-child { margin-bottom: 0; }

/* ---------- Prose pages (legal, disclosure) ---------- */
.page-head { padding-block: clamp(32px, 5vw, 56px) 8px; }
.crumbs { display: flex; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; font-size: 0.92rem; color: var(--cream-dim); }
.crumbs li + li::before { content: '/'; margin-right: 8px; opacity: 0.5; }
.crumbs a { color: var(--cream-dim); }
.page-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 10px; color: var(--gold); }
.page-lede { font-size: 1.15rem; color: var(--cream-dim); max-width: 62ch; }
.prose { max-width: 72ch; padding-bottom: 72px; }
.prose h2 { font-size: 1.35rem; margin: 2em 0 0.6em; }
.prose h3 { font-size: 1.1rem; margin: 1.6em 0 0.5em; }
.prose p, .prose li { color: rgba(255, 244, 222, 0.86); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose .notice { margin: 1.5em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0 1.5em; font-size: 0.97rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--cream); }
.fine { font-size: 0.9rem; color: var(--cream-dim); }
.updated { color: var(--cream-dim); font-size: 0.95rem; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; background: var(--ink); border-top: 1px solid var(--line); }
.site-footer__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; padding-block: 48px 32px; }
.site-footer__about p { color: var(--cream-dim); font-size: 0.95rem; max-width: 46ch; margin-top: 16px; }
.site-footer__badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.site-footer__badges span:not(.badge-18) { font-weight: 600; color: var(--cream); font-size: 0.9rem; }
.site-footer nav { display: flex; flex-direction: column; gap: 10px; }
.site-footer nav h2 { font-size: 1rem; margin: 0 0 4px; color: var(--cream); }
.site-footer nav a { color: var(--cream-dim); text-decoration: none; font-size: 0.95rem; }
.site-footer nav a:hover { color: var(--gold); }
.site-footer__legal { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 18px 28px; border-top: 1px solid var(--line); color: var(--cream-dim); font-size: 0.88rem; }
.site-footer__legal p { margin: 0; }
@media (max-width: 860px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__about { grid-column: 1 / -1; } }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 16px;
  background: rgba(6, 18, 23, 0.78);
  backdrop-filter: blur(4px);
}
.modal {
  width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  padding: 28px 26px 24px; border-radius: var(--radius-l);
  background: var(--night-2); border: 1px solid var(--line);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
}
.modal__title { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; color: var(--gold); }
.modal p { color: var(--cream-dim); }
.modal__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.modal__summary { margin: 0 0 16px; padding: 14px 16px; border-radius: var(--radius-m); background: var(--night-3); display: grid; gap: 6px; }
.modal__summary div { display: flex; justify-content: space-between; gap: 12px; }
.modal__summary dt { color: var(--cream-dim); }
.modal__summary dd { margin: 0; font-weight: 700; }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 0.95rem; }
.form input[type="text"], .form input[type="email"], .form input[type="password"], .form input[type="number"], .form input[type="tel"], .form input:not([type]), .form textarea, .form select {
  min-height: 48px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--night); color: var(--cream); font: inherit;
}
.form textarea { min-height: 120px; resize: vertical; }
.form input:focus-visible, .form textarea:focus-visible, .form select:focus-visible { outline: 3px solid var(--mint); outline-offset: 1px; }
.form__error { color: #FF9AA8; margin: 0; min-height: 1.2em; font-size: 0.95rem; }
.check { display: flex !important; grid-template-columns: none !important; align-items: flex-start; gap: 10px !important; font-weight: 400 !important; color: var(--cream-dim); }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--gold); flex-shrink: 0; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
.stats div { padding: 12px 14px; border-radius: var(--radius-m); background: var(--night-3); }
.stats dt { color: var(--cream-dim); font-size: 0.9rem; }
.stats dd { margin: 0; font-family: var(--font-display); font-size: 1.4rem; color: var(--gold); }
.meter { height: 10px; border-radius: 999px; background: var(--night-3); overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--gold)); }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: var(--cream); color: var(--ink);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.4);
}
.cookie-banner__inner { display: flex; gap: 24px; align-items: center; justify-content: space-between; padding-block: 18px; flex-wrap: wrap; }
.cookie-banner h2 { font-size: 1.1rem; margin: 0 0 4px; }
.cookie-banner p { margin: 0 0 10px; max-width: 70ch; font-size: 0.95rem; }
.cookie-banner a { color: var(--red-deep); }
.cookie-banner__toggles { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-banner .btn--ghost { --btn-fg: var(--ink); box-shadow: inset 0 0 0 2px rgba(10, 29, 36, 0.3); }
.cookie-banner .btn--ghost:hover { box-shadow: inset 0 0 0 2px var(--ink); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 0.92rem; font-weight: 600; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle span { width: 36px; height: 20px; border-radius: 999px; background: rgba(10, 29, 36, 0.25); position: relative; transition: background 0.15s; flex-shrink: 0; }
.toggle span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.toggle input:checked + span { background: var(--red-deep); }
.toggle input:checked + span::after { transform: translateX(16px); }
.toggle input:disabled + span { opacity: 0.55; }
.toggle input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--cream);
  border: 1px solid var(--line); font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.2s ease-out;
}
.toast--win { background: var(--gold); color: var(--ink); border-color: transparent; }
.toast--error { background: var(--red); color: var(--cream); border-color: transparent; }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: 0.3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Big win ---------- */
.celebrate { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; pointer-events: none; background: radial-gradient(circle, rgba(255, 210, 122, 0.25), transparent 60%); animation: fade-in 0.2s; }
.celebrate__sign {
  display: grid; justify-items: center; gap: 2px; padding: 26px 40px; border-radius: var(--radius-l);
  background: var(--ink); box-shadow: 0 0 0 4px var(--gold), 0 0 60px rgba(255, 210, 122, 0.6);
  animation: pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.celebrate__sign span { font-family: var(--font-display); color: var(--red); font-size: 1.1rem; }
.celebrate__sign strong { font-family: var(--font-display); font-weight: 400; color: var(--gold); font-size: clamp(2.4rem, 8vw, 4rem); line-height: 1; }
.celebrate__sign em { font-style: normal; color: var(--cream-dim); font-weight: 600; }
.celebrate.is-out { opacity: 0; transition: opacity 0.4s; }
@keyframes pop { from { transform: scale(0.5); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- Play page ---------- */
.play-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-block: 24px 18px; }
.play-head__back { display: inline-flex; align-items: center; gap: 6px; color: var(--cream-dim); text-decoration: none; font-weight: 600; padding: 8px 12px 8px 8px; border-radius: 10px; }
.play-head__back:hover { color: var(--cream); background: var(--night-2); }
.play-head__back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.play-head__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 0; color: var(--gold); }
.play-head__cat { color: var(--cream-dim); }
.play-head .booth__fav { position: static; margin-left: auto; background: var(--night-2); width: 44px; height: 44px; }

.cabinet {
  position: relative;
  padding: clamp(18px, 3vw, 30px) clamp(12px, 3vw, 30px) clamp(20px, 3vw, 30px);
  border-radius: var(--radius-l);
  background: linear-gradient(180deg, var(--night-2), #11303A);
  box-shadow: inset 0 0 0 1px var(--line), 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}
.cabinet > .awning { position: absolute; top: 0; left: 0; right: 0; border-radius: var(--radius-l) var(--radius-l) 0 0; }
.cabinet .stage { max-width: 760px; margin: 22px auto 0; min-height: 360px; }
.stage__loading, .stage__error { display: grid; place-items: center; min-height: 340px; color: var(--cream-dim); text-align: center; }

.play-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.side { display: grid; gap: 16px; }
.side__card { padding: 20px; border-radius: var(--radius-m); background: var(--night-2); border: 1px solid var(--line); }
.side__card h2 { font-size: 1.05rem; margin: 0 0 8px; }
.side__card p { color: var(--cream-dim); font-size: 0.95rem; }
.side__balance { font-family: var(--font-display); font-size: 1.9rem; color: var(--gold); display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; font-variant-numeric: tabular-nums; }
.side__balance .coin-icon { width: 30px; height: 30px; }
@media (max-width: 960px) { .play-grid { grid-template-columns: 1fr; } }

/* Bet bar (used by games via api.betBar) */
.betbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.betbar__label { font-weight: 700; color: var(--cream-dim); margin-right: 4px; }
.betbar__opt {
  min-width: 52px; min-height: 42px; padding: 0 12px; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--night-3); color: var(--cream); font-weight: 700; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px var(--line);
}
.betbar__opt:hover { box-shadow: inset 0 0 0 1px var(--cream-dim); }
.betbar__opt[aria-pressed="true"] { background: var(--gold); color: var(--ink); box-shadow: none; }
.betbar__opt:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .bulb { background: #FFE3A0; box-shadow: 0 0 8px 2px rgba(255, 210, 122, 0.6); }
}
