/* Stellar Play — the emulated operator's shop window.
 *
 * The palette deliberately walks away from the game's own: that one is
 * neon violet and outer space, so the lobby is a cold blue-green
 * near-black with a single warm gold accent. The iframe then reads as
 * somebody ELSE's object inside somebody else's site — which is exactly
 * what is being demonstrated here.
 *
 * Gold is the only bright colour, and it is spent on money and on the
 * primary button. Everything else stays quiet. */

:root {
  --ground:  #0A1014;
  --surface: #111A1F;
  --raised:  #16222A;
  --line:    #213039;
  --line-2:  #2E4250;

  --ink:   #E9EFF2;
  --ink-2: #93A6B0;
  --ink-3: #5F7480;

  --gold:     #E5B252;
  --gold-ink: #2A1E07;
  --gold-dim: #6E5526;

  --good: #4FB286;
  --bad:  #D96A5B;

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

/* `hidden` has to win. Any class carrying its own display —
   .modal{display:grid}, .bar-guest{display:flex} — beats the browser's
   rule for [hidden] on specificity, and an element the code believes is
   hidden stays on screen. Here that looked like an empty lobby sitting
   under three invisible dialogs. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 15px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}

/* A soft glow at the top, so "near-black" does not read as an empty
   div. One layer, not a gradient hero. */
body::before {
  content: "";
  position: fixed;
  inset: -30vh 0 auto 0;
  height: 70vh;
  background:
    radial-gradient(60% 100% at 22% 0%, rgba(229,178,82,.09), transparent 70%),
    radial-gradient(55% 100% at 78% 6%, rgba(79,178,134,.07), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

main, header, .stage { position: relative; z-index: 1; }

/* ── header ──────────────────────────────────────────────── */

.bar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(10,16,20,.82);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.spacer { flex: 1; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--gold); text-decoration: none;
  font: 700 19px/1 var(--display); letter-spacing: -.01em;
}
.brand span { color: var(--ink); }
.brand b { color: var(--gold); font-weight: 800; }
.mark { width: 26px; height: 26px; flex: none; }

.bar-guest { display: flex; align-items: center; gap: 14px; }
.hint { color: var(--ink-3); font-size: 13px; }
@media (max-width: 640px) { .hint { display: none; } }

.bar-account { display: flex; align-items: center; gap: 10px; }

.wallet {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 7px 8px 7px 14px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--raised); color: var(--ink);
  font: 600 15px/1 var(--body); cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.wallet:hover { border-color: var(--gold-dim); }
.wallet-cur { color: var(--ink-3); font-size: 12px; letter-spacing: .06em; }
.wallet-plus {
  margin-left: 4px; width: 22px; height: 22px; border-radius: 999px;
  background: var(--gold); color: var(--gold-ink);
  font: 700 15px/22px var(--body); text-align: center;
  align-self: center;
}

.avatar {
  width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--raised);
  color: var(--ink); font: 600 15px/1 var(--display); cursor: pointer;
}
.avatar:hover { border-color: var(--gold-dim); }

/* ── hero ────────────────────────────────────────────────── */

main { max-width: 1120px; margin: 0 auto; padding: clamp(28px, 6vw, 64px) clamp(16px, 4vw, 40px) 80px; }

.hero { max-width: 46rem; }
.eyebrow {
  margin: 0 0 12px; color: var(--gold);
  font: 600 12px/1 var(--body); letter-spacing: .14em; text-transform: uppercase;
}
h1 {
  margin: 0 0 16px;
  font: 700 clamp(30px, 5vw, 46px)/1.08 var(--display);
  letter-spacing: -.025em; text-wrap: balance;
}
.lede { margin: 0; color: var(--ink-2); font-size: 16px; max-width: 40rem; }

/* ── game tiles ──────────────────────────────────────────── */

.games {
  margin: clamp(32px, 6vw, 56px) 0 0;
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.tile {
  position: relative; display: block; width: 100%; padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); color: inherit;
  overflow: hidden; cursor: pointer; text-align: left;
  transition: border-color .18s, transform .18s;
}
.tile:hover { border-color: var(--gold-dim); transform: translateY(-2px); }
.tile:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.tile-art { display: block; width: 100%; aspect-ratio: 16 / 10; }
.tile-body { padding: 16px 18px 18px; border-top: 1px solid var(--line); }
.tile-title { margin: 0; font: 700 19px/1.2 var(--display); letter-spacing: -.015em; }
.tile-tag { margin: 5px 0 0; color: var(--ink-3); font-size: 13.5px; }
.tile-play {
  position: absolute; right: 14px; top: 14px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--gold); color: var(--gold-ink);
  font: 600 12.5px/1 var(--body); letter-spacing: .02em;
}

/* ── the cast ────────────────────────────────────────────── */

.cast { margin-top: clamp(40px, 7vw, 72px); }
.cast h2 { margin: 0 0 16px; font: 600 15px/1 var(--body); color: var(--ink-2);
           letter-spacing: .1em; text-transform: uppercase; }
.cast-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.cast-card {
  display: flex; align-items: baseline; gap: 10px;
  padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface);
}
.cast-card b { font: 600 15px/1 var(--mono); }
.cast-card span { color: var(--ink-3); font-size: 13px; }
.cast-card em {
  margin-left: auto; font-style: normal; color: var(--gold);
  font: 600 12px/1 var(--body); letter-spacing: .08em;
}
.foot { margin: 14px 0 0; color: var(--ink-3); font-size: 13px; max-width: 44rem; }

.nav-doc {
  color: var(--ink-2); text-decoration: none;
  font: 500 13.5px/1 var(--body);
  padding: 8px 12px; border-radius: 999px; border: 1px solid transparent;
}
.nav-doc:hover { color: var(--ink); border-color: var(--line-2); }

/* ── documentation ───────────────────────────────────────── */

.doc-cta {
  margin-top: clamp(32px, 6vw, 56px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 20px;
  padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: linear-gradient(120deg, rgba(229,178,82,.06), transparent 60%), var(--surface);
}
.doc-cta > div { flex: 1 1 22rem; }
.doc-cta h2 {
  margin: 0 0 6px; font: 700 19px/1.2 var(--display);
  letter-spacing: -.015em; color: var(--ink); text-transform: none;
}
.doc-cta p { margin: 0; color: var(--ink-2); font-size: 14px; max-width: 44rem; }
.doc-cta .btn { flex: none; text-decoration: none; }

/* ── the game screen ─────────────────────────────────────── */

.stage { position: fixed; inset: 0; z-index: 40; background: var(--ground);
         display: flex; flex-direction: column; }
.stage-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px clamp(12px, 3vw, 24px);
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.stage-title { font: 600 15px/1 var(--display); }
.stage-bal { font: 600 15px/1 var(--body); font-variant-numeric: tabular-nums; }
.badge {
  padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-2);
  color: var(--ink-2); font: 600 11px/1 var(--body);
  letter-spacing: .08em; text-transform: uppercase;
}
.badge.demo { border-color: var(--gold-dim); color: var(--gold); }
#frame { flex: 1; width: 100%; border: 0; background: #000; }

/* ── buttons ─────────────────────────────────────────────── */

.btn {
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--raised); color: var(--ink);
  font: 600 14px/1 var(--body); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:hover { background: #F0C169; border-color: #F0C169; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }

/* ── dialogs ─────────────────────────────────────────────── */

.modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 20px;
  background: rgba(6,10,13,.72); backdrop-filter: blur(3px);
}
.sheet {
  width: min(420px, 100%);
  display: flex; flex-direction: column; gap: 14px;
  padding: 24px; border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.sheet h2 { margin: 0; font: 700 21px/1.2 var(--display); letter-spacing: -.02em; }
.sheet label { display: grid; gap: 6px; font: 500 13px/1 var(--body); color: var(--ink-2); }
.sheet input, .sheet select {
  padding: 10px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--ground); color: var(--ink);
  font: 400 15px/1.2 var(--body);
}
.sheet input:focus, .sheet select:focus { outline: 2px solid var(--gold-dim); outline-offset: 0; }
.sheet .acts { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.sheet .acts .btn:last-child { margin-left: auto; }
.sheet .acts .spacer { flex: 1; }
.sheet-foot { margin: 0; color: var(--ink-3); font-size: 12.5px; }
.note { margin: 0; color: var(--ink-3); font-size: 12.5px; }
.err { margin: 0; color: var(--bad); font-size: 13px; }

.amount { display: flex; align-items: center; gap: 8px; }
.amount input { flex: 1; font-variant-numeric: tabular-nums; }
.amount span { color: var(--ink-3); font: 600 13px/1 var(--body); letter-spacing: .06em; }

.seg { display: flex; gap: 6px; padding: 4px; border-radius: 999px;
       border: 1px solid var(--line); background: var(--ground); }
.seg button {
  flex: 1; padding: 8px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink-2); font: 600 13.5px/1 var(--body);
}
.seg button.on { background: var(--raised); color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink-2);
  font: 500 13px/1 var(--body); font-variant-numeric: tabular-nums;
}
.chips button:hover { border-color: var(--gold-dim); color: var(--ink); }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--ink-3); font-size: 13px; }
.facts dd { margin: 0; font-size: 14px; }
.mono { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .tile:hover { transform: none; }
}
