/* ════════════════════════════════════════════════════════════════
   PULSE CASINO — Design System v1.0
   ════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;700&display=swap');

/* ── TOKENS ──────────────────────────────────────────────────── */
:root {
  /* backgrounds */
  --bg:        #030306;
  --bg-2:      #07070d;
  --surface:   #0b0b14;
  --surface-2: #0f0f1a;
  --line:      #19192b;
  --line-2:    #23233a;

  /* brand — red */
  --red:        #c8111f;
  --red-bright: #e8192c;
  --red-glow:   rgba(200,17,31,.55);
  --red-soft:   rgba(200,17,31,.10);

  /* accent — gold */
  --gold:       #b5892a;
  --gold-bright:#d4aa40;
  --gold-soft:  rgba(181,137,42,.13);

  /* text */
  --text:    #ede8e3;
  --muted:   #7a7888;
  --muted-2: #404055;

  /* semantic */
  --green:      #1a8a4a;
  --green-glow: rgba(26,138,74,.45);
  --amber:      #d4883a;

  /* geometry */
  --radius:    10px;
  --radius-lg: 16px;
  --sidebar-w: 260px;

  /* fonts */
  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Cinzel', Georgia, serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}
::selection { background: var(--red); color: #fff; }
a { color: inherit; text-decoration: none; }
input, button, select, textarea { font-family: inherit; }

/* ── BACKGROUND ──────────────────────────────────────────────── */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 600px at 80% -5%,  rgba(200,17,31,.11), transparent 60%),
    radial-gradient(700px 500px at  5% 105%, rgba(200,17,31,.07), transparent 60%),
    var(--bg);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 25%, #000, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 25%, #000, transparent 70%);
  opacity: .25;
}

/* ── SCROLLBAR ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes fadeUp    { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulseDot  { 0%,100% { opacity:1;transform:scale(1); } 50% { opacity:.4;transform:scale(.75); } }
@keyframes float     { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-6px); } }
@keyframes ecgDraw   { to { stroke-dashoffset: 0; } }
@keyframes shimmer   { 0% { background-position:-500px 0; } 100% { background-position:500px 0; } }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; cursor: pointer; font-family: var(--font); font-weight: 600;
  font-size: 13px; letter-spacing: .01em; padding: 11px 22px;
  border-radius: var(--radius); white-space: nowrap; user-select: none;
  transition: transform .14s, box-shadow .22s, background .18s, border-color .18s;
}
.btn-primary {
  background: var(--red); color: #fff;
  box-shadow: 0 0 0 1px rgba(200,17,31,.45), 0 5px 20px rgba(200,17,31,.28);
}
.btn-primary:hover {
  background: var(--red-bright); transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(232,25,44,.6), 0 8px 28px rgba(200,17,31,.4);
}
.btn-ghost {
  background: transparent; color: var(--text); border: 1px solid var(--line-2);
}
.btn-ghost:hover { border-color: var(--red); color: var(--red-bright); background: var(--red-soft); }
.btn-gold {
  background: var(--gold); color: #0a0802; font-weight: 700;
  box-shadow: 0 0 0 1px rgba(181,137,42,.4), 0 5px 20px rgba(181,137,42,.25);
}
.btn-gold:hover { background: var(--gold-bright); transform: translateY(-1px); }
.btn-lg  { padding: 15px 30px; font-size: 15px; }
.btn-sm  { padding: 7px 14px; font-size: 12px; }
.btn:disabled { opacity: .38; cursor: not-allowed; transform: none !important; }

/* ── GAME NAV BAR ─────────────────────────────────────────────── */
.gv-bar {
  position: sticky; top: 0; z-index: 10; height: 62px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  background: rgba(3,3,6,.9);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.gv-back {
  display: flex; align-items: center; gap: 8px; background: none;
  border: 1px solid var(--line-2); color: var(--muted);
  font-family: var(--font); font-weight: 600; font-size: 13px;
  padding: 8px 14px; border-radius: var(--radius); cursor: pointer; transition: .18s;
}
.gv-back:hover { border-color: var(--red); color: var(--red-bright); }
.gv-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: .02em; }
.gv-title .gi {
  width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center;
  border: 1px solid rgba(200,17,31,.35); background: var(--red-soft); color: var(--red-bright);
}
.gv-bal {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--surface); font-weight: 600; font-size: 13px;
}
.gv-bal .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red-bright); box-shadow: 0 0 8px var(--red-glow);
  animation: pulseDot 2s infinite;
}
.gv-bal b { color: var(--red-bright); font-family: var(--font-mono); font-weight: 700; }

/* ── GAME BODY ────────────────────────────────────────────────── */
.gv-body { max-width: 1100px; margin: 0 auto; padding: 32px 24px 80px; }
.gv-hero { text-align: center; margin-bottom: 28px; }
.gv-hero h1 { font-size: clamp(26px,4.5vw,40px); font-weight: 700; letter-spacing: -.03em; }
.gv-hero p { color: var(--muted); margin-top: 8px; font-size: 14px; }

/* ── GAME STAGE ───────────────────────────────────────────────── */
.gv-stage {
  background: linear-gradient(158deg, var(--surface), #070710 80%);
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px;
  position: relative; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(200,17,31,.07), 0 20px 60px rgba(0,0,0,.55);
}
.gv-stage::before {
  content: ""; position: absolute; top: -90px; left: 50%; transform: translateX(-50%);
  width: 480px; height: 260px;
  background: radial-gradient(circle, rgba(200,17,31,.07), transparent 70%);
  pointer-events: none;
}

/* ── STATUS MESSAGE ───────────────────────────────────────────── */
.gv-msg { min-height: 26px; text-align: center; font-weight: 600; font-size: 14px; margin-top: 16px; color: var(--muted); }
.gv-msg.win  { color: var(--red-bright); text-shadow: 0 0 18px var(--red-glow); }
.gv-msg.lose { color: #ff7070; }

/* ── RULES PANEL ──────────────────────────────────────────────── */
.gv-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.gv-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.gv-panel h3 { font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted-2); margin-bottom: 14px; }
.gv-panel ul { list-style: none; display: flex; flex-direction: column; }
.gv-panel li { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); padding: 9px 0; border-bottom: 1px solid var(--line); }
.gv-panel li:last-child { border-bottom: none; }
.gv-panel li span:last-child { color: var(--text); font-weight: 700; font-family: var(--font-mono); font-size: 13px; }

/* ── CHIPS ────────────────────────────────────────────────────── */
.gv-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 8px; }
.gv-chip {
  background: var(--surface-2); border: 1px solid var(--line-2);
  color: var(--muted); border-radius: 8px; padding: 7px 14px;
  font-family: var(--font); font-weight: 700; font-size: 12px; cursor: pointer; transition: .15s;
}
.gv-chip:hover, .gv-chip.sel { border-color: var(--red); color: var(--red-bright); background: var(--red-soft); }

/* ── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .gv-stage { padding: 20px 14px; }
  .gv-rules { grid-template-columns: 1fr; }
  .gv-bar   { padding: 0 14px; }
  .gv-body  { padding: 24px 14px 80px; }
}
@media (max-width: 380px) { .gv-back span { display: none; } }
