/* ============================================================
   V3 GAME — "Marble & Lightning" theme
   Near-black marble ground, gold/amber accent, Cinzel display type
   8px spacing grid throughout
   ============================================================ */

:root {
  /* palette */
  --bg-void:        #08070b;
  --bg-marble:      #0f0d14;
  --bg-marble-2:    #16131d;
  --bg-card:        #1a1622;
  --bg-card-hi:     #211c2c;
  --line:           rgba(255,255,255,0.08);
  --line-strong:    rgba(255,255,255,0.14);

  --gold:           #f0b649;
  --gold-bright:    #ffd76a;
  --gold-dim:       #a9812f;
  --gold-ink:       #241a05;

  --purple:         #6b4fc9;
  --purple-deep:    #2d1f57;

  --ink-0:          #f7f3ea;
  --ink-1:          #cdc4d6;
  --ink-2:          #948b9e;
  --ink-3:          #635b70;

  --ok:             #58d68d;
  --err:            #ef5a6f;

  /* type */
  --font-display:   'Cinzel', 'Times New Roman', serif;
  --font-body:      'Manrope', -apple-system, sans-serif;

  /* spacing grid (8px) */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 40px;
  --sp-6: 48px;
  --sp-7: 64px;
  --sp-8: 80px;
  --sp-9: 96px;
  --sp-10: 128px;

  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 20px;

  --shadow-card: 0 20px 60px -20px rgba(0,0,0,0.6);
  --shadow-gold: 0 8px 30px -8px rgba(240,182,73,0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* The `hidden` attribute and the UA stylesheet's `[hidden]{display:none}` rule share
   the same specificity as a single class selector (0,1,0). Several toggled elements
   here (.nav-actions, etc.) declare their own `display:flex/grid/block`, and being an
   author rule it wins the cascade over the UA default -- silently making `el.hidden =
   true` a no-op (the element keeps rendering at full size). Force it explicitly. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg-void);
  color: var(--ink-1);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink-0);
  margin: 0;
  letter-spacing: 0.01em;
}

p { margin: 0; }
em { font-style: normal; }

a { color: inherit; }

button {
  font-family: var(--font-body);
  cursor: pointer;
}

.accent-text { color: var(--gold); }

/* ============ BACKGROUND FX ============ */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
}
.bg-glow--1 {
  width: 700px; height: 700px;
  top: -280px; left: -180px;
  background: radial-gradient(circle, var(--gold-dim), transparent 70%);
}
.bg-glow--2 {
  width: 800px; height: 800px;
  top: 20%; right: -320px;
  background: radial-gradient(circle, var(--purple-deep), transparent 70%);
}

.bg-columns {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 100% 8px, 64px 100%;
}

/* ============ NAV ============ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8,7,11,0.78);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-2) var(--sp-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  text-decoration: none;
}
.brand-mark {
  font-size: 22px;
  color: var(--gold);
  filter: drop-shadow(0 0 8px rgba(240,182,73,0.6));
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--ink-0);
  letter-spacing: 0.04em;
}
.brand-name em { color: var(--gold); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.nav-balance {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
  padding-right: var(--sp-2);
  border-right: 1px solid var(--line);
}
.nav-balance-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.nav-balance-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--gold-bright);
}
.nav-username {
  color: var(--ink-1);
  font-weight: 600;
  font-size: 14px;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
  position: relative;
}
.btn:active { transform: translateY(1px); }

.btn-gold {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--gold-ink);
  box-shadow: var(--shadow-gold);
}
.btn-gold:hover { filter: brightness(1.06); box-shadow: 0 10px 36px -8px rgba(240,182,73,0.6); }

.btn-ghost {
  background: transparent;
  color: var(--ink-1);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--gold-dim); color: var(--ink-0); }

.btn-outline {
  background: transparent;
  color: var(--ink-1);
  border-color: var(--line-strong);
}
.btn-outline:hover { border-color: var(--err); color: var(--err); }

.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; }

.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-spinner {
  display: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(36,26,5,0.35);
  border-top-color: var(--gold-ink);
  animation: spin 0.7s linear infinite;
}
.btn.is-loading .btn-label { opacity: 0.55; }
.btn.is-loading .btn-spinner { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

.link-btn {
  background: none;
  border: none;
  color: var(--gold);
  font-weight: 700;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============ TOASTS ============ */
.toast-stack {
  position: fixed;
  top: var(--sp-3);
  right: var(--sp-3);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  max-width: 360px;
}
.toast {
  background: var(--bg-card-hi);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-s);
  padding: var(--sp-2);
  font-size: 14px;
  color: var(--ink-0);
  box-shadow: var(--shadow-card);
  animation: toast-in 0.25s ease;
}
.toast.toast--error { border-left-color: var(--err); }
.toast.toast--success { border-left-color: var(--ok); }
.toast.is-leaving { animation: toast-out 0.2s ease forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(20px); }
}

/* ============ VIEWS ============ */
.view {
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold-dim);
  font-weight: 700;
  margin: 0 0 var(--sp-2);
}

/* ============ HERO ============ */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-3) var(--sp-6);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--sp-8);
  align-items: center;
}

.hero-title {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 700;
  line-height: 1.06;
  margin-bottom: var(--sp-3);
}

.hero-sub {
  font-size: 17px;
  color: var(--ink-2);
  max-width: 46ch;
  margin-bottom: var(--sp-4);
}

.hero-cta {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
}

.hero-trust {
  font-size: 13px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
  display: inline-block;
}
.dot--live {
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(88,214,141,0.6);
  animation: pulse-live 2s infinite;
}
@keyframes pulse-live {
  0% { box-shadow: 0 0 0 0 rgba(88,214,141,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(88,214,141,0); }
  100% { box-shadow: 0 0 0 0 rgba(88,214,141,0); }
}

/* ============ HERO BANNER (Gates of Olympus CSS art) ============ */
.hero-banner { perspective: 1000px; }

.banner-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-l);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(240,182,73,0.18), transparent 60%),
    linear-gradient(160deg, #241636 0%, #180f26 45%, #0c0813 100%);
  border: 1px solid rgba(240,182,73,0.25);
  box-shadow: var(--shadow-card), inset 0 0 80px rgba(107,79,201,0.15);
  overflow: hidden;
  transform: rotateY(-4deg) rotateX(2deg);
}

.game-tile-art {
  position: relative;
  border-radius: var(--radius-m) var(--radius-m) 0 0;
  min-height: 220px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(240,182,73,0.18), transparent 60%),
    linear-gradient(160deg, #241636 0%, #180f26 45%, #0c0813 100%);
  border: 1px solid rgba(240,182,73,0.25);
  border-bottom: none;
  overflow: hidden;
}

.banner-glow {
  position: absolute;
  top: -20%; left: 50%;
  width: 140%; height: 90%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(240,182,73,0.35), transparent 65%);
  animation: glow-pulse 4s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.banner-rays {
  position: absolute;
  inset: -20%;
  background: repeating-conic-gradient(from 0deg, rgba(240,182,73,0.07) 0deg 6deg, transparent 6deg 12deg);
  animation: rays-spin 40s linear infinite;
  mix-blend-mode: screen;
}
@keyframes rays-spin { to { transform: rotate(360deg); } }

.banner-bolt {
  position: absolute;
  font-size: 42px;
  color: var(--gold-bright);
  filter: drop-shadow(0 0 14px rgba(255,215,106,0.9));
  animation: bolt-flicker 3.4s ease-in-out infinite;
}
.banner-bolt--1 { top: 12%; left: 12%; animation-delay: 0.2s; }
.banner-bolt--2 { top: 18%; right: 10%; font-size: 30px; animation-delay: 1.6s; transform: scaleX(-1); }
@keyframes bolt-flicker {
  0%, 100% { opacity: 0.55; transform: scale(1) translateY(0); }
  10% { opacity: 1; transform: scale(1.08) translateY(-2px); }
  20% { opacity: 0.6; }
}

.banner-crown {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 34px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5)) drop-shadow(0 0 10px rgba(240,182,73,0.5));
}

.banner-columns {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 55%;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  opacity: 0.5;
}
.banner-columns span {
  width: 10%;
  height: 100%;
  background: linear-gradient(180deg, rgba(240,182,73,0.35), rgba(240,182,73,0.02));
  border-radius: 3px 3px 0 0;
  box-shadow: inset 0 0 0 1px rgba(240,182,73,0.15);
}
.banner-columns span:nth-child(2), .banner-columns span:nth-child(4) { height: 85%; opacity: 0.8; }
.banner-columns span:nth-child(3) { height: 100%; opacity: 1; }

.banner-text {
  position: absolute;
  bottom: var(--sp-4);
  left: 0; right: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 var(--sp-3);
}
.banner-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold-bright);
  font-weight: 700;
}
.banner-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
}
.banner-title em { color: var(--gold-bright); font-style: normal; }
.banner-multiplier {
  display: inline-block;
  margin: 6px auto 0;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(240,182,73,0.15);
  border: 1px solid rgba(240,182,73,0.4);
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 700;
}

/* ============ STATS STRIP ============ */
.strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}
.strip-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-3);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  text-align: center;
}
.strip-num {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
}
.strip-label {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* ============ AUTH SECTION ============ */
.auth-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-3) var(--sp-9);
  display: grid;
  grid-template-columns: 1fr 0.7fr;
  gap: var(--sp-6);
  align-items: start;
  scroll-margin-top: 90px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: var(--sp-4);
  box-shadow: var(--shadow-card);
}

.auth-tabs {
  display: flex;
  gap: var(--sp-1);
  margin-bottom: var(--sp-4);
  background: var(--bg-marble);
  border-radius: var(--radius-s);
  padding: 4px;
}
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--ink-3);
  font-weight: 700;
  font-size: 14px;
  padding: 10px;
  border-radius: 5px;
  transition: all 0.15s ease;
}
.auth-tab.is-active {
  background: var(--bg-card-hi);
  color: var(--gold);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.auth-form { display: none; }
.auth-form.is-active { display: block; animation: form-in 0.25s ease; }
@keyframes form-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-title {
  font-size: 24px;
  margin-bottom: var(--sp-1);
}
.auth-sub {
  color: var(--ink-3);
  font-size: 14px;
  margin-bottom: var(--sp-4);
}

.field {
  display: block;
  margin-bottom: var(--sp-3);
}
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field-input {
  width: 100%;
  background: var(--bg-marble);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--ink-0);
  font-family: var(--font-body);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field-input::placeholder { color: var(--ink-3); }
.field-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240,182,73,0.18);
}
.field-input.is-invalid {
  border-color: var(--err);
}
.field-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239,90,111,0.18);
}

.field-error {
  display: block;
  min-height: 16px;
  font-size: 12px;
  color: var(--err);
  margin-top: 4px;
}

.field-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: var(--sp-3);
  cursor: pointer;
}
.field-check input { margin-top: 3px; accent-color: var(--gold); }

.form-alert {
  background: rgba(239,90,111,0.1);
  border: 1px solid rgba(239,90,111,0.35);
  color: #ff9baa;
  border-radius: var(--radius-s);
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: var(--sp-3);
}

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
  margin-top: var(--sp-3);
}

.auth-side {
  padding-top: var(--sp-2);
}
.auth-side-title {
  font-size: 18px;
  margin-bottom: var(--sp-3);
}
.auth-side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.auth-side-list li {
  font-size: 14px;
  color: var(--ink-2);
  padding-left: var(--sp-2);
  border-left: 2px solid var(--gold-dim);
}
.auth-side-list strong { color: var(--ink-0); }

/* ============ DASHBOARD ============ */
.dash-hero {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(240,182,73,0.05), transparent);
}
.dash-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
}
.dash-username {
  font-size: 32px;
}

.wallet-card {
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 220px;
  box-shadow: var(--shadow-card);
}
.wallet-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.wallet-amount {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--gold-bright);
  margin: 4px 0;
}
.wallet-updated {
  font-size: 11px;
  color: var(--ink-3);
}

.wallet-skeleton {
  display: inline-block;
  width: 90px;
  height: 26px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-marble-2) 25%, var(--bg-card-hi) 50%, var(--bg-marble-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.dash-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-3) var(--sp-9);
}

.section-title {
  font-size: 20px;
  margin-bottom: var(--sp-3);
}

.game-tile {
  display: grid;
  grid-template-columns: 340px 1fr;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.game-tile-body {
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.game-tile-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-dim);
  font-weight: 700;
}
.game-tile-title {
  font-size: 28px;
  margin: 4px 0 var(--sp-2);
}
.game-tile-title em { color: var(--gold); }
.game-tile-desc {
  color: var(--ink-2);
  font-size: 14px;
  max-width: 52ch;
  margin-bottom: var(--sp-3);
}
.game-tile-meta {
  display: flex;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
  font-size: 13px;
  color: var(--ink-3);
}
.game-tile-meta strong { color: var(--ink-0); }

.btn-play { align-self: flex-start; min-width: 200px; }

.game-tile-status {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: var(--sp-1);
}
.game-tile-status.is-error { color: var(--err); }

/* ============ FOOTER ============ */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-marble);
  position: relative;
  z-index: 1;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-3) var(--sp-5);
}
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.footer-age {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-s);
  padding: 3px 10px;
}
.footer-disclaimer {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-3);
  max-width: 90ch;
  margin-bottom: var(--sp-2);
}
.footer-legal {
  font-size: 11.5px;
  color: var(--ink-3);
  opacity: 0.7;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-banner { order: -1; max-width: 380px; margin: 0 auto; }
  .auth-section { grid-template-columns: 1fr; }
  .auth-side { order: -1; }
  .strip-inner { grid-template-columns: repeat(2, 1fr); }
  .game-tile { grid-template-columns: 1fr; }
  .game-tile-art { min-height: 180px; }
  .dash-hero-inner { flex-direction: column; align-items: flex-start; }
  .wallet-card { align-items: flex-start; width: 100%; }
}

@media (max-width: 560px) {
  .nav-balance { display: none; }
  .hero-title { font-size: 34px; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
}
