/* MT Play — single stylesheet. Dark theme for dim environments: near-black
   blue-tinted base, card surfaces, muted gold accent. */

:root {
  --bg: #0d0f14;
  --surface: #151823;
  --surface-2: #1b1f2e;
  --border: #262b3b;
  --text: #e9e7e2;
  --muted: #939aa8;
  --accent: #d9ad52;
  --accent-strong: #eec26a;
  --accent-ink: #171106;
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 500px at 50% -200px, #171c2c 0%, transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.6em 1.3em;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); }

.btn-outline {
  background: transparent;
  color: var(--accent-strong);
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--muted); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: rgba(13, 15, 20, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 1.05rem;
}
.logo:hover { text-decoration: none; }

.logo-mark {
  color: var(--accent);
  font-size: 1.15em;
}
.logo-mark-big {
  font-size: 2.2rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.balance {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45em 0.95em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.balance-icon { color: var(--accent); }
.balance-amount { font-weight: 700; }
.balance-label { color: var(--muted); font-size: 0.85rem; }

/* ---------- Main / hero / home grid ---------- */

.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.hero { text-align: center; padding: 1.5rem 0 2rem; }
.hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); }
.hero-sub { color: var(--muted); margin: 0; font-size: 1.05rem; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.game-tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.game-tile:hover {
  text-decoration: none;
  transform: translateY(-3px);
  border-color: var(--accent);
}

/* Art slot: fixed-ratio placeholder area, real art drops in later. */
.tile-art {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
}
.tile-glyph {
  font-size: 3.2rem;
  font-weight: 800;
  opacity: 0.9;
}
.art-keno  { background: radial-gradient(circle at 30% 25%, rgba(64, 160, 150, 0.28), transparent 65%), var(--surface-2); }
.art-poker { background: radial-gradient(circle at 30% 25%, rgba(180, 70, 80, 0.26), transparent 65%), var(--surface-2); }
.art-lines { background: radial-gradient(circle at 30% 25%, rgba(217, 173, 82, 0.24), transparent 65%), var(--surface-2); }
.art-bingo { background: radial-gradient(circle at 30% 25%, rgba(120, 90, 200, 0.26), transparent 65%), var(--surface-2); }
.art-owl   { background: radial-gradient(circle at 30% 25%, rgba(196, 142, 72, 0.28), transparent 65%), var(--surface-2); }

.tile-info {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.15rem 0.75rem;
  padding: 0.85rem 1rem;
}
.tile-name { margin: 0; font-size: 1.15rem; }
.tile-info .badge { grid-column: 2; grid-row: 1; justify-self: end; }
.tile-tagline {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.badge {
  padding: 0.25em 0.75em;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-live {
  background: var(--accent);
  color: var(--accent-ink);
}

/* ---------- Game screen ---------- */

.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.game-title { margin: 0; font-size: 1.6rem; }

.game-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.odds-toggle {
  display: inline-flex;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.odds-option {
  padding: 0.45em 1.1em;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.odds-option:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.odds-option:hover:not(:disabled):not(.is-selected) { color: var(--text); }
.odds-option.is-selected {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}
.odds-option.is-selected:not(:disabled) {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: none;
}

.mode-static {
  display: inline-block;
  padding: 0.45em 1.1em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.audio-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 3px 12px 3px 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.mute-btn {
  padding: 0.3em 0.45em;
  border: none;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.volume-slider {
  width: 90px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Mount target for game bundles (PLATFORM-SPEC.md §4). */
.game-container {
  min-height: min(62vh, 560px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
/* Mounted bundles (and placeholders) get the full container width; games
   manage their own max-width inside it. */
.game-container > * { width: 100%; }

.coming-soon { text-align: center; padding: 2rem; }
.coming-soon-glyph {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.55;
  margin-bottom: 0.5rem;
}
.coming-soon p { color: var(--muted); margin-bottom: 1.5rem; }

.odds-note {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.odds-note strong { color: var(--text); }

/* ---------- Content pages / legal ---------- */

.page-narrow { max-width: 700px; margin: 0 auto; }
.page-center { text-align: center; padding-top: 3rem; }

.legal { line-height: 1.7; }
.legal h1 { font-size: 1.8rem; }
.legal h2 { font-size: 1.15rem; margin-top: 1.8em; }
.legal p { color: #c7c9ce; }

.draft-banner {
  padding: 0.6em 1em;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(217, 173, 82, 0.08);
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 600;
}

.legal-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.25rem 2rem;
  text-align: center;
}
.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-bottom: 0.9rem;
}
.footer-links a { color: var(--muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--text); }
.footer-notice {
  margin: 0 auto;
  max-width: 640px;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ---------- Age gate ---------- */
/* Visible by default so the gate fails closed; the boot script adds .age-ok
   to <html> before paint when the visitor has already confirmed. */

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(8, 9, 13, 0.96);
  backdrop-filter: blur(6px);
}
html.age-ok .age-gate { display: none; }
html:not(.age-ok) body { overflow: hidden; }

.age-gate-card {
  max-width: 430px;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.age-gate-card p { color: #c7c9ce; font-size: 0.95rem; }
.age-gate-question { font-weight: 700; color: var(--text); font-size: 1.05rem; }

.age-gate-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.25rem;
}
.age-gate-noscript { margin-top: 1rem; color: var(--accent-strong); }

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
  .balance-label { display: none; }
  .site-main { padding: 1.25rem 1rem 2rem; }
  .game-topbar { flex-direction: column; align-items: flex-start; }
  .game-container { min-height: 55vh; }
}
