:root {
  --bg: #1a0d12;
  --bg2: #26131b;
  --felt: #0f3b2e;
  --cream: #f6ead2;
  --ink: #f6ead2;
  --muted: #c6b39a;
  --line: rgba(246, 234, 210, 0.14);
  --gold: #ffc83d;
  --hot: #ff3d5a;
  --b: #2f7cf6;
  --i: #ff3d5a;
  --n: #e9e2d0;
  --g: #22b866;
  --o: #ffb21e;
  --radius: 18px;
  --mono: "DM Mono", ui-monospace, monospace;
  --display: "Bungee", "Impact", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font: 16px/1.55 "Space Grotesk", system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 61, 90, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(255, 200, 61, 0.10), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.015) 0 2px, transparent 2px 120px),
    var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--gold); }
code { font-family: var(--mono); font-size: 0.9em; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; line-height: 1.02; margin: 0 0 0.4em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }

/* bulb strip */
.bulbs {
  height: 14px;
  background: radial-gradient(circle, var(--gold) 0 3px, rgba(255,200,61,0.25) 4px, transparent 6px) 0 50% / 26px 14px repeat-x;
  animation: chase 1.2s steps(2) infinite;
  filter: drop-shadow(0 0 6px rgba(255, 200, 61, 0.6));
}
@keyframes chase { to { background-position: 13px 50%; } }

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(26, 13, 18, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo { font-family: var(--display); font-size: 1.5rem; color: var(--cream); text-decoration: none; letter-spacing: 0.02em; }
.logo span { color: var(--hot); margin-left: 4px; }
nav { display: flex; gap: 18px; margin-left: auto; }
nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
nav a:hover { color: var(--cream); }

.btn {
  font: 700 0.95rem/1 "Space Grotesk", sans-serif;
  border: 2px solid var(--cream); color: var(--cream); background: transparent;
  padding: 11px 18px; border-radius: 999px; cursor: pointer; text-decoration: none; display: inline-block;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); background: rgba(246, 234, 210, 0.08); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn.hot { background: var(--hot); border-color: var(--hot); color: #fff; box-shadow: 0 6px 0 #a3172c; }
.btn.hot:hover { background: #ff5670; }
.btn.hot:active { transform: translateY(4px); box-shadow: 0 2px 0 #a3172c; }
.btn.ghost { border-color: var(--line); }
.btn.big { padding: 16px 26px; font-size: 1.05rem; }
body.busy .btn { pointer-events: none; opacity: 0.6; }

main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); }

/* hero */
.hero { padding: 56px 0 40px; position: relative; }
.marquee {
  display: flex; gap: 18px; white-space: nowrap; overflow: hidden;
  font-family: var(--display); color: var(--gold); opacity: 0.85; font-size: 0.95rem;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  margin-bottom: 26px;
}
.marquee span { animation: slide 18s linear infinite; }
@keyframes slide { to { transform: translateX(-50%); } }
.hero h1 { font-size: clamp(2.8rem, 9vw, 6.6rem); }
.hero h1 em { font-style: normal; font-family: "Bungee Shade", var(--display); color: var(--gold); }
.lede { max-width: 640px; font-size: 1.15rem; color: var(--cream); }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 14px; }
.mint { color: var(--muted); font-size: 0.9rem; }

/* the hall */
.hall {
  display: grid; grid-template-columns: minmax(280px, 0.9fr) 1.3fr; gap: 26px;
  background:
    radial-gradient(circle at 30% 0%, rgba(255,255,255,0.06), transparent 50%),
    var(--felt);
  border: 3px solid #0a2a20; outline: 2px dashed rgba(246,234,210,0.15); outline-offset: -12px;
  border-radius: 28px; padding: clamp(18px, 3vw, 34px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.45), inset 0 0 120px rgba(0,0,0,0.35);
}
.caller { display: flex; flex-direction: column; gap: 10px; }
.callerTop { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font: 500 0.78rem var(--mono); padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,0.3); border: 1px solid var(--line); }
.demoTag { display: none; background: var(--gold); color: #2a1406; border-color: var(--gold); font-weight: 700; }
body.demo .demoTag { display: inline-block; }
.cage {
  position: relative; height: 230px; display: grid; place-items: center;
  border-radius: 50%; aspect-ratio: 1; width: min(230px, 70vw); margin: 6px auto;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.18), rgba(0,0,0,0.25) 70%);
  border: 6px solid #c99a2e;
  box-shadow: 0 0 0 3px #6b4b0e, inset 0 0 40px rgba(0,0,0,0.5), 0 0 40px rgba(255,200,61,0.2);
}
.cage::before {
  content: ""; position: absolute; inset: 10px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(201,154,46,0.5) 0 2deg, transparent 2deg 30deg);
  animation: spin 12s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.callout { position: absolute; bottom: -12px; font-family: var(--display); color: var(--gold); font-size: 1.1rem; text-shadow: 0 2px 0 #000; }

.ball {
  --c: var(--n);
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 32% 28%, #fff 0 8%, var(--c) 9% 60%, color-mix(in srgb, var(--c), #000 35%) 100%);
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  flex: none;
}
.ball span {
  display: grid; place-items: center; width: 62%; height: 62%; border-radius: 50%;
  background: #fffaf0; color: #1b0f0f; font: 700 0.95rem/1 var(--mono);
}
.ball small { font-size: 0.55em; line-height: 1; margin-bottom: -2px; }
.ball.c0 { --c: var(--b); } .ball.c1 { --c: var(--i); } .ball.c2 { --c: var(--n); } .ball.c3 { --c: var(--g); } .ball.c4 { --c: var(--o); }
.ball.xl { width: 140px; height: 140px; position: relative; z-index: 1; }
.ball.xl span { font-size: 2.6rem; }
.ball.sm { width: 38px; height: 38px; }
.ball.sm span { font-size: 0.8rem; }
.ball.empty { --c: #3a2a2a; }
.ball.empty span { color: #8a7a6a; }
.pop { animation: pop 0.6s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(0.2) rotate(-120deg); opacity: 0; } }
.rail { display: flex; gap: 8px; min-height: 40px; overflow: hidden; justify-content: center; }
#status { margin: 8px 0 0; font-size: 1.6rem; color: var(--cream); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.stats div { background: rgba(0,0,0,0.28); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.stats small { display: block; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.stats b { font: 500 1.25rem var(--mono); color: var(--gold); }

.board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.col { display: grid; gap: 5px; }
.head { font-family: var(--display); text-align: center; font-size: 1.6rem; padding: 6px 0; border-radius: 10px; color: #fff; }
.h0 { background: var(--b); } .h1 { background: var(--i); } .h2 { background: var(--n); color: #1b0f0f; } .h3 { background: var(--g); } .h4 { background: var(--o); color: #2a1406; }
.num {
  font: 500 0.95rem/1 var(--mono); text-align: center; padding: 6px 0; border-radius: 8px;
  color: rgba(246,234,210,0.35); background: rgba(0,0,0,0.22); transition: all 0.3s ease;
}
.num.on { color: #1b0f0f; background: var(--cream); box-shadow: 0 0 0 1px rgba(0,0,0,0.2); }
.num.last { background: var(--gold); transform: scale(1.12); box-shadow: 0 0 18px rgba(255,200,61,0.8); }
.boardWrap .small { margin-top: 12px; }

/* cards */
.mineWrap, .history, .how, .launch { margin: 46px 0; }
.mineHead { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.buy { max-width: 420px; text-align: right; }
.buy .small { margin: 8px 0 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.card {
  background: var(--cream); color: #1b0f0f; border-radius: var(--radius); padding: 12px;
  box-shadow: 0 10px 0 #b9a782, 0 18px 40px rgba(0,0,0,0.4);
  transform: rotate(-0.6deg);
}
.card:nth-child(even) { transform: rotate(0.7deg); }
.card.hit { outline: 4px solid var(--hot); animation: shake 0.5s ease 2; }
.card.winner { outline: 4px solid var(--gold); }
@keyframes shake { 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }
.cardHead { display: flex; justify-content: space-between; font: 700 0.85rem var(--mono); margin-bottom: 8px; }
.away { color: var(--hot); }
.cardGrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.ch { font-family: var(--display); text-align: center; color: var(--hot); }
.cc {
  aspect-ratio: 1; display: grid; place-items: center; border: 1.5px solid #d8c8a6; border-radius: 6px;
  font: 500 0.95rem var(--mono); position: relative;
}
.cc.daub::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255,61,90,0.75), rgba(200,20,60,0.85));
  mix-blend-mode: multiply; animation: daub 0.35s ease;
}
@keyframes daub { from { transform: scale(1.6); opacity: 0; } }
.cardActions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.cardActions .btn { padding: 8px 14px; font-size: 0.85rem; }
.cardActions .btn.ghost { color: #1b0f0f; border-color: #cdbb95; }
.note { font-size: 0.85rem; color: var(--muted); }
.card .note { color: #6b5a40; }

/* launch */
.launch { background: var(--bg2); border: 2px dashed var(--gold); border-radius: 24px; padding: 24px; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 16px 0; }
.form .wide { grid-column: 1 / -1; }
label { display: grid; gap: 6px; font-weight: 500; color: var(--muted); }
input { font: 1rem var(--mono); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #120a0d; color: var(--cream); width: 100%; }

/* history */
.hlist { display: grid; gap: 8px; }
.hrow {
  display: grid; grid-template-columns: 110px 80px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 16px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line);
  color: var(--cream); text-decoration: none; font-family: var(--mono); font-size: 0.9rem;
}
.hrow b { color: var(--gold); }
.hrow:hover { border-color: var(--gold); }

/* how */
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.steps li { counter-increment: s; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 18px 64px; position: relative; }
.steps li::before {
  content: counter(s); position: absolute; left: 16px; top: 16px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--display); background: var(--gold); color: #2a1406;
}
.facts { margin-top: 22px; }

footer { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; padding: 34px 16px 50px; color: var(--muted); border-top: 1px solid var(--line); }
footer a { color: var(--muted); }

#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: #2a171f; border: 1px solid var(--line); border-left: 4px solid var(--gold); padding: 12px 14px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.4); transition: opacity 0.5s, transform 0.5s; }
.toast.ok { border-left-color: var(--g); }
.toast.error { border-left-color: var(--hot); }
.toast.out { opacity: 0; transform: translateY(10px); }

@media (max-width: 860px) {
  .hall { grid-template-columns: 1fr; }
  nav { display: none; }
  .top { justify-content: space-between; }
  .buy { text-align: left; }
  .hrow { grid-template-columns: 1fr auto; }
  .hrow span:nth-child(2), .hrow span:nth-child(3) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
