*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #080812;
  --surface:  #0f0f1e;
  --surface2: #16162a;
  --border:   #1e1e3a;
  --primary:  #7c3aed;
  --primary-h:#6d28d9;
  --accent:   #06b6d4;
  --success:  #10b981;
  --danger:   #ef4444;
  --text:     #e2e8f0;
  --muted:    #64748b;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image: url('/studio-bg.jpg');
  background-size: cover;
  background-position: 60% 45%;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* dark overlay so text stays readable over the photo */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(8,8,18,.72) 0%,
    rgba(8,8,18,.55) 40%,
    rgba(8,8,18,.80) 100%
  );
}

/* .stars div kept in HTML but hidden — no longer needed */
.stars { display: none; }

/* ── Screens ── */
.screen { position: relative; z-index: 1; min-height: 100vh; }
.screen.hidden, .hidden { display: none !important; }

/* ── Topbar ── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 60px;
  background: rgba(8,8,18,.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-ball { font-size: 24px; }
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: .02em; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.points-pill {
  display: flex; align-items: center; gap: 6px;
  background: rgba(124,58,237,.15);
  border: 1px solid rgba(124,58,237,.3);
  color: #c4b5fd;
  font-size: 14px; font-weight: 700;
  padding: 6px 14px; border-radius: 20px;
}
.profile-btn {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-size: 18px;
  width: 36px; height: 36px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.profile-btn:hover { background: var(--border); }

/* ── Profile menu ── */
.profile-menu {
  position: fixed; top: 68px; right: 24px; z-index: 200;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.pm-name  { font-weight: 700; font-size: 15px; }
.pm-email { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pm-hr    { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.pm-item  {
  width: 100%; text-align: left; background: none; border: none;
  color: var(--danger); font-size: 14px; font-weight: 600;
  cursor: pointer; padding: 6px 0;
}
.pm-item:hover { opacity: .8; }

/* ── Hero ── */
.hero {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 60px);
  position: relative; overflow: hidden;
}
.hero-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(124,58,237,.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 20%, rgba(6,182,212,.10) 0%, transparent 60%);
  pointer-events: none;
}
.hero-content {
  text-align: center; position: relative; z-index: 1;
  padding: 40px 24px; max-width: 560px;
}
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.35);
  color: #fff; font-size: 13px; font-weight: 700;
  padding: 6px 16px; border-radius: 20px; margin-bottom: 24px;
  letter-spacing: .05em;
}
.hero-sub {
  font-size: 16px; color: #fff; margin-bottom: 40px; font-weight: 500;
}
.home-btns {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 28px; border-radius: 10px;
  font-size: 15px; font-weight: 700;
  cursor: pointer; transition: opacity .15s, transform .1s;
  border: none; text-decoration: none; white-space: nowrap;
}
.btn:hover  { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline  { background: transparent; border: 2px solid var(--accent); color: var(--accent); }
.btn-accent   { background: var(--accent); color: #000; font-weight: 800; }
.btn-full     { width: 100%; margin-top: 8px; }

/* ── Modal overlay ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(4,4,14,.82);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 36px 32px;
  width: 100%; max-width: 420px;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  animation: slideUp .25s cubic-bezier(.175,.885,.32,1.275);
}
@keyframes slideUp { from{transform:translateY(24px);opacity:0} to{transform:translateY(0);opacity:1} }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); font-size: 14px;
  width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--text); }
.modal-logo { font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.modal-title { font-size: 22px; font-weight: 800; margin-bottom: 20px; }
.modal-hint { font-size: 13px; color: var(--muted); text-align: center; margin-top: 14px; }
.modal-hint a { color: var(--accent); text-decoration: none; font-weight: 600; }
.modal-body { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 20px; }

/* ── Fields ── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.field input, .field select {
  width: 100%; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 14px;
  padding: 10px 14px; outline: none;
  transition: border-color .15s;
}
.field input:focus { border-color: var(--primary); }
.opt { font-weight: 400; color: var(--muted); }

/* ── Alerts ── */
.alert-err {
  background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3);
  color: #fca5a5; font-size: 13px; font-weight: 600;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 14px;
}
.alert-ok {
  background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3);
  color: #6ee7b7; font-size: 13px; font-weight: 600;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 14px;
}

/* ── Success toast ── */
.success-toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid rgba(16,185,129,.4);
  color: #6ee7b7; font-size: 15px; font-weight: 700;
  padding: 16px 28px; border-radius: 12px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,.5);
  z-index: 400; animation: toastIn .35s cubic-bezier(.175,.885,.32,1.275);
}
@keyframes toastIn { from{transform:translateX(-50%) translateY(-20px);opacity:0} to{transform:translateX(-50%) translateY(0);opacity:1} }
.toast-icon { font-size: 20px; }

/* ── Game tabs ── */
.game-tabs {
  display: flex; gap: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 24px; position: sticky; top: 60px; z-index: 50;
  overflow-x: auto;
}
.gtab {
  background: none; border: none; color: var(--muted);
  font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 16px 20px; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.gtab:hover  { color: var(--text); }
.gtab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Tab panels ── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.panel-inner { max-width: 720px; margin: 0 auto; padding: 32px 24px 64px; }
.panel-title { font-size: 20px; font-weight: 800; margin-bottom: 24px; }

/* ── Countdown card ── */
.countdown-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 40px 32px;
  text-align: center;
  box-shadow: 0 0 60px rgba(124,58,237,.08);
}
.cc-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 8px; }
.cc-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.cc-time  { font-size: 14px; color: var(--muted); margin-bottom: 32px; }
.countdown { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; }
.cd-unit  { display: flex; flex-direction: column; align-items: center; }
.cd-val   {
  font-size: clamp(48px, 10vw, 80px); font-weight: 900; line-height: 1;
  color: var(--primary);
  background: rgba(124,58,237,.1); border: 1px solid rgba(124,58,237,.2);
  border-radius: 12px; padding: 8px 16px; min-width: 80px;
}
.cd-lbl   { font-size: 10px; font-weight: 700; color: var(--muted); margin-top: 6px; letter-spacing: .12em; }
.cd-sep   { font-size: 40px; font-weight: 900; color: var(--primary); align-self: flex-start; margin-top: 12px; }
.cc-sub   { font-size: 13px; color: var(--muted); margin-bottom: 24px; }

/* ── Draw cards ── */
.draw-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 12px;
  transition: border-color .2s;
}
.draw-card:hover { border-color: var(--primary); }
.dc-info { flex: 1; }
.dc-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.dc-meta  { font-size: 13px; color: var(--muted); }
.dc-price { font-size: 14px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.badge {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .06em;
}
.badge-scheduled { background: rgba(124,58,237,.15); color: #a78bfa; }
.badge-running   { background: rgba(16,185,129,.15);  color: #34d399; }
.badge-completed { background: rgba(100,116,139,.15); color: var(--muted); }

/* ── Bingo room panel ── */
.room-panel { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.room-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 48px 40px; text-align: center; max-width: 400px;
}
.room-icon  { font-size: 56px; margin-bottom: 16px; }
.room-card h2 { font-size: 22px; font-weight: 800; margin-bottom: 12px; }
.room-card p  { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 28px; }

/* ── Points info ── */
.points-info { background: var(--surface2); border-radius: 10px; padding: 16px; margin-bottom: 20px; }
.pi-row { display: flex; justify-content: space-between; font-size: 14px; }

/* ── Buy modal ── */
.buy-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.buy-row label { font-size: 14px; font-weight: 600; }
.qty-ctrl { display: flex; align-items: center; gap: 16px; }
.qty-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--text); font-size: 20px; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.qty-btn:hover { background: var(--border); }
#qtyVal { font-size: 22px; font-weight: 800; min-width: 32px; text-align: center; }
.buy-cost { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.buy-cost strong { color: var(--text); }

/* ── Loading ── */
.loading-state { color: var(--muted); text-align: center; padding: 48px 0; font-size: 14px; }
.empty-state   { color: var(--muted); text-align: center; padding: 48px 0; font-size: 14px; }
