/* ============================================================
   RocketBust - neon dark theme
   ============================================================ */

:root {
  --bg: #070b16;
  --bg2: #0a101f;
  --panel: #0e1526;
  --panel2: #131c33;
  --border: #1d2942;
  --border2: #2a3a5f;
  --text: #dbe4f5;
  --dim: #8aa0c8;
  --accent: #8b5cf6;
  --accent2: #22d3ee;
  --win: #3ddc84;
  --lose: #ff5470;
  --gold: #ffd166;
  --glow-a: 0 0 24px rgba(139, 92, 246, .45);
  --glow-c: 0 0 24px rgba(34, 211, 238, .35);
  --radius: 14px;
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(139, 92, 246, .16), transparent 60%),
    radial-gradient(900px 420px at 0% 0%, rgba(34, 211, 238, .10), transparent 55%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main.wrap { flex: 1 0 auto; padding-bottom: 48px; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; }
p { margin: 8px 0; }
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.win { color: var(--win); }
.lose { color: var(--lose); }
.gold { color: var(--gold); }
.small { font-size: 13px; }
.big { font-size: 22px; }
.center { text-align: center; }
.breakable { word-break: break-all; }
.mt { margin-top: 22px; }
.grad {
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------------- top bar ---------------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 11, 22, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 18px; padding: 12px 0; flex-wrap: wrap; }
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 19px; color: var(--text);
  letter-spacing: .3px;
}
.brand:hover { text-decoration: none; }
.brand .logo { width: 24px; height: 24px; fill: url(#none), var(--accent); filter: drop-shadow(0 0 8px rgba(139,92,246,.8)); }
.brand.sm { font-size: 16px; }
.navlinks { display: flex; gap: 4px; flex-wrap: wrap; }
.navlinks a {
  color: var(--dim); padding: 7px 12px; border-radius: 9px; font-weight: 500;
}
.navlinks a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.navlinks a.on { color: var(--text); background: var(--panel2); box-shadow: inset 0 0 0 1px var(--border2); }
.navlinks a.admin-link { color: var(--gold); }
.navright { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.balance-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel2); border: 1px solid var(--border2);
  padding: 6px 12px; border-radius: 999px; color: var(--text);
}
.balance-chip:hover { text-decoration: none; border-color: var(--accent); }
.coin-ico {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, #ffb224 70%);
  box-shadow: 0 0 10px rgba(255, 178, 36, .7);
  display: inline-block; vertical-align: -2px;
}
.userbox { display: flex; align-items: center; gap: 8px; }
.userlink { color: var(--text); font-weight: 600; }
.inlineform { display: inline; }

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 11px; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: 15px;
  padding: 10px 18px; color: #fff; background: var(--panel2);
  transition: transform .08s ease, box-shadow .2s ease, filter .2s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--accent), #6d28d9); box-shadow: var(--glow-a); }
.btn.cyan { background: linear-gradient(135deg, var(--accent2), #0891b2); box-shadow: var(--glow-c); }
.btn.win { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 0 24px rgba(52, 211, 153, .35); }
.btn.warn { background: linear-gradient(135deg, #f59e0b, #d97706); }
.btn.danger { background: linear-gradient(135deg, #f43f5e, #be123c); }
.btn.ghost { background: transparent; border-color: var(--border2); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.lg { font-size: 17px; padding: 13px 24px; border-radius: 13px; }
.btn.sm { font-size: 13px; padding: 7px 12px; }
.btn.xs { font-size: 12px; padding: 4px 9px; border-radius: 8px; }
.btn.wide { width: 100%; }

/* ---------------- flashes & toasts ---------------- */

.flashes { margin-top: 14px; }
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 10px; font-weight: 500; }
.flash-ok { background: rgba(61, 220, 132, .12); border: 1px solid rgba(61, 220, 132, .4); color: #9ff2c6; }
.flash-err { background: rgba(255, 84, 112, .12); border: 1px solid rgba(255, 84, 112, .4); color: #ffb3c0; }
#toasts { position: fixed; bottom: 20px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel2); border: 1px solid var(--border2); color: var(--text);
  padding: 10px 16px; border-radius: 11px; font-weight: 600; box-shadow: 0 8px 30px rgba(0,0,0,.4);
  animation: toastin .25s ease;
}
.toast.ok { border-color: rgba(61,220,132,.55); }
.toast.err { border-color: rgba(255,84,112,.55); }
@keyframes toastin { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- panels & tables ---------------- */

.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.panel-title { font-size: 16px; font-weight: 700; letter-spacing: .4px; margin-bottom: 14px; color: var(--text); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; color: var(--dim); font-weight: 500; font-size: 12px;
  text-transform: uppercase; letter-spacing: .8px; padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.table td { padding: 9px 10px; border-bottom: 1px solid rgba(29, 41, 66, .5); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid rgba(29,41,66,.4); font-size: 14px; }
.kv:last-of-type { border-bottom: 0; }
.kv span { color: var(--dim); }
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--panel2); border: 1px solid var(--border2); color: var(--dim);
}
.pill.ok { color: var(--win); border-color: rgba(61,220,132,.5); background: rgba(61,220,132,.08); }
.pill.warn { color: var(--gold); border-color: rgba(255,209,102,.5); background: rgba(255,209,102,.08); }
.pill.bad { color: var(--lose); border-color: rgba(255,84,112,.5); background: rgba(255,84,112,.08); }

/* ---------------- forms ---------------- */

.field-label { display: block; font-size: 13px; color: var(--dim); margin: 12px 0 5px; font-weight: 500; letter-spacing: .3px; }
input[type="text"], input[type="password"], input[type="number"] {
  width: 100%; padding: 11px 13px; border-radius: 11px;
  border: 1px solid var(--border2); background: #0a1120; color: var(--text);
  font-family: var(--font); font-size: 15px; outline: none;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 92, 246, .18); }
input.mono { font-family: var(--mono); }
input.sm { padding: 8px 10px; font-size: 14px; width: 200px; }
.stack-form .btn { margin-top: 16px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--panel2); border: 1px solid var(--border2); border-radius: 999px; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: var(--dim); transition: .2s; }
.switch input:checked + span { background: rgba(139,92,246,.35); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--accent); }

/* ---------------- hero (landing) ---------------- */

.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 36px; align-items: center; padding: 44px 0 26px; }
.hero-badge {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .4px;
  color: var(--accent2); border: 1px solid rgba(34,211,238,.4); background: rgba(34,211,238,.07);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 700; letter-spacing: -.5px; }
.lead { font-size: 17px; color: var(--dim); max-width: 56ch; }
.hero-cta { display: flex; gap: 12px; margin: 22px 0 26px; flex-wrap: wrap; }
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 16px; min-width: 120px;
}
.stat b { display: block; font-size: 20px; }
.stat span { color: var(--dim); font-size: 12px; }
.demo-sky {
  position: relative; height: 340px; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--border2);
  background:
    radial-gradient(600px 300px at 70% 110%, rgba(139,92,246,.25), transparent 60%),
    radial-gradient(400px 240px at 15% -10%, rgba(34,211,238,.18), transparent 55%),
    linear-gradient(180deg, #0b1226, #070b16);
  box-shadow: inset 0 0 60px rgba(0,0,0,.5);
}
.demo-mult {
  position: absolute; top: 26px; left: 0; right: 0; text-align: center;
  font-size: 58px; font-weight: 700; letter-spacing: 1px;
  text-shadow: 0 0 30px rgba(34,211,238,.45);
}
.demo-mult.crashed { color: var(--lose); text-shadow: 0 0 30px rgba(255,84,112,.6); }
.demo-rocket { position: absolute; width: 46px; height: 46px; fill: #c4b5fd; left: 12%; bottom: 18%; filter: drop-shadow(0 0 12px rgba(139,92,246,.9)); transition: none; }
.demo-label { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; color: var(--dim); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }

/* stars */
.star { position: absolute; background: #fff; border-radius: 50%; opacity: .5; animation: twinkle 3s infinite ease-in-out; }
@keyframes twinkle { 0%, 100% { opacity: .18; } 50% { opacity: .75; } }

/* ---------------- grids ---------------- */

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid2 > .panel, .grid3 > .panel { margin-bottom: 0; }
.grid2 { margin-bottom: 20px; }

/* ---------------- how it works ---------------- */

.how { padding: 26px 0 8px; }
.how h2 { font-size: 28px; margin-bottom: 22px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.step-n {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 17px; font-weight: 700; margin-bottom: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  box-shadow: var(--glow-a);
}
.step h3 { font-size: 17px; }
.step p { color: var(--dim); font-size: 14px; }
.trust-list { margin: 0; padding-left: 20px; color: var(--dim); }
.trust-list li { margin: 9px 0; }
.trust-list b { color: var(--text); }

/* ---------------- game page ---------------- */

.game-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.game-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.game-side { display: flex; flex-direction: column; gap: 0; }
.rules-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.rules-panel .panel-title { font-size: 14px; margin-bottom: 6px; }
.game-stage { padding: 0; overflow: hidden; }
.sky {
  position: relative; height: 470px; overflow: hidden;
  background:
    radial-gradient(700px 340px at 72% 115%, rgba(139,92,246,.22), transparent 60%),
    radial-gradient(460px 260px at 12% -12%, rgba(34,211,238,.14), transparent 55%),
    linear-gradient(180deg, #0b1226, #060a14);
}
.mult {
  position: absolute; top: 30px; left: 0; right: 0; text-align: center;
  font-size: clamp(48px, 8vw, 84px); font-weight: 700; letter-spacing: 1px;
  text-shadow: 0 0 34px rgba(34, 211, 238, .4); transition: color .1s;
}
.mult.flying { color: #e8fbff; }
.mult.crashed { color: var(--lose); text-shadow: 0 0 34px rgba(255, 84, 112, .6); }
.mult.cashed { color: var(--win); text-shadow: 0 0 34px rgba(61, 220, 132, .6); }
.game-status {
  position: absolute; top: 128px; left: 0; right: 0; text-align: center;
  color: var(--dim); font-size: 15px; letter-spacing: .4px;
}
.rocket { position: absolute; width: 52px; height: 52px; fill: #c4b5fd; left: 10%; bottom: 16%; filter: drop-shadow(0 0 14px rgba(139, 92, 246, .9)); will-change: transform; }
.rocket .flame { display: none; }
.rocket.flying .flame { display: block; animation: flame .12s infinite alternate; transform-origin: 12px 17px; }
@keyframes flame { from { transform: scale(1); } to { transform: scale(1.5) translateY(1px); } }
.sky.shake { animation: shake .45s; }
@keyframes shake {
  10% { transform: translate(-7px, 3px); }
  30% { transform: translate(6px, -4px); }
  50% { transform: translate(-5px, -3px); }
  70% { transform: translate(5px, 4px); }
  90% { transform: translate(-3px, 1px); }
}
.boom { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.particle {
  position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle, #ffd7a0, #ff5470);
  animation: fly .8s ease-out forwards; pointer-events: none;
}
@keyframes fly { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
.cashout-badge {
  position: absolute; top: 168px; left: 50%; transform: translateX(-50%);
  background: rgba(61, 220, 132, .12); border: 1px solid rgba(61, 220, 132, .6);
  color: var(--win); font-weight: 700; font-size: 18px;
  padding: 8px 20px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 0 30px rgba(61, 220, 132, .25);
}
.trail-dot { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: rgba(139, 92, 246, .55); animation: fade 1.1s forwards; pointer-events: none; }
@keyframes fade { to { opacity: 0; } }
.hist-strip {
  display: flex; gap: 7px; padding: 12px 14px; overflow-x: auto;
  border-top: 1px solid var(--border); min-height: 52px; align-items: center;
}
.hist-strip:empty::after { content: "Your round history will appear here"; color: var(--dim); font-size: 13px; }
.mult-chip {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap;
}
.mult-chip.lo { color: #ff8fa3; border-color: rgba(255,84,112,.4); background: rgba(255,84,112,.07); }
.mult-chip.mid { color: #b6a5ff; border-color: rgba(139,92,246,.45); background: rgba(139,92,246,.08); }
.mult-chip.hi { color: #7cf0b2; border-color: rgba(61,220,132,.5); background: rgba(61,220,132,.08); }

/* bet panel */
.game-side .panel { padding: 16px; }
.balance-line { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--bg2); padding: 5px; border-radius: 12px; margin-bottom: 6px; }
.mode-tab {
  border: 0; background: transparent; color: var(--dim); font-family: var(--font);
  font-weight: 700; font-size: 13.5px; padding: 9px 6px; border-radius: 9px; cursor: pointer;
}
.mode-tab.on { background: var(--panel2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border2); }
.bet-input { display: grid; grid-template-columns: 1fr; gap: 8px; }
.bet-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.winchance { margin-top: 4px; min-height: 18px; }
#betForm .btn.lg { margin-top: 16px; }
.claim-timer { font-size: 18px; margin: 8px 0; color: var(--accent2); min-height: 26px; }
.claim-timer.ready { color: var(--win); }
.claim-captcha input { margin-top: 4px; }
.mini-stats .kv b { font-size: 13.5px; }

/* ---------------- misc pages ---------------- */

.page-title { font-size: 30px; margin: 26px 0 10px; }
.auth-wrap { display: flex; justify-content: center; padding: 44px 0; }
.auth-panel { width: min(430px, 100%); }
.withdraw-grid { margin-top: 22px; }
.big-balance { font-size: 30px; margin: 6px 0 14px; }
.reflink-row { display: flex; gap: 10px; }
.reflink-row input { flex: 1; }
.ref-hero .stat-row { margin-top: 16px; }
.verify-form input { margin-bottom: 4px; }
.verify-result { margin-top: 16px; font-size: 17px; }
.reveal-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin: 8px 0; }
.code { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; overflow-x: auto; font-size: 13.5px; color: #b8e7ff; }
.searchrow { display: flex; gap: 10px; margin: 14px 0; }
.searchrow input { max-width: 340px; }
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 20px; }
.admin-tabs a { color: var(--dim); padding: 8px 14px; border-radius: 10px; font-weight: 600; }
.admin-tabs a:hover { text-decoration: none; background: var(--panel); color: var(--text); }
.admin-tabs a.on { background: var(--panel2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border2); }
.admin-stats { margin-bottom: 20px; }
.pill-filter { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.pill-filter a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border2); color: var(--dim); font-size: 13px; font-weight: 600; }
.pill-filter a.on { color: var(--text); border-color: var(--accent); background: rgba(139,92,246,.12); }
.row-actions { display: flex; gap: 6px; }
.feed-table td { vertical-align: middle; }

/* ---------------- footer ---------------- */

.footer { border-top: 1px solid var(--border); background: rgba(7, 11, 22, .6); margin-top: 30px; }
.foot-grid { display: flex; justify-content: space-between; gap: 20px; padding: 26px 0 8px; flex-wrap: wrap; }
.footlinks { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.legal { padding: 14px 0 26px; }

/* ---------------- error pages ---------------- */

.errbody { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--font); }
.errbox { text-align: center; }

/* ---------------- responsive ---------------- */

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .demo-sky { height: 280px; }
  .steps { grid-template-columns: 1fr; }
  .game-layout { grid-template-columns: 1fr; }
  .rules-grid { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr; }
  .nav { gap: 10px; }
  .navlinks { order: 3; width: 100%; justify-content: center; }
}
@media (max-width: 560px) {
  .stat-row { gap: 8px; }
  .stat { min-width: 100px; padding: 8px 12px; }
  .sky { height: 350px; }
  .panel { padding: 15px; }
  .reflink-row { flex-direction: column; }
}
