/* ============================================================
   DEVNTRIC SPINNER — CYBERPUNK / GOLD-ON-BLACK THEME
   ============================================================ */

/* ---- DESIGN TOKENS ---- */
:root {
  --bg:           #050507;
  --bg-2:         #0a0a0f;
  --bg-3:         #0f0f1a;
  --surface:      rgba(255,200,50,0.04);
  --surface-md:   rgba(255,200,50,0.07);
  --surface-hi:   rgba(255,200,50,0.12);
  --border:       rgba(255,200,50,0.18);
  --border-hi:    rgba(255,200,50,0.45);
  --text:         #f0e8d0;
  --text-dim:     #7a7060;
  --text-mid:     #b0a080;
  --gold:         #f5b942;
  --gold-bright:  #ffd166;
  --gold-dim:     #8a6a1a;
  --amber:        #ff8c00;
  --red:          #ff3c5a;
  --green:        #39ff8a;
  --radius-lg:    18px;
  --radius-md:    12px;
  --radius-sm:    8px;
  --font-display: 'Orbitron', 'Rajdhani', monospace;
  --font-ui:      'Rajdhani', 'Inter', sans-serif;
  --font-body:    'Inter', sans-serif;
  --glow-gold:    0 0 18px rgba(245,185,66,.55), 0 0 40px rgba(245,185,66,.2);
  --glow-gold-sm: 0 0 8px rgba(245,185,66,.5);
  --glow-red:     0 0 12px rgba(255,60,90,.6);
  --shadow-panel: 0 8px 40px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,200,50,.08);
}

html[data-theme="light"] {
  --bg:           #f5f0e8;
  --bg-2:         #fff8ee;
  --bg-3:         #fffaf5;
  --surface:      rgba(180,120,0,0.06);
  --surface-md:   rgba(180,120,0,0.1);
  --surface-hi:   rgba(180,120,0,0.16);
  --border:       rgba(160,100,0,0.22);
  --border-hi:    rgba(160,100,0,0.5);
  --text:         #1a1000;
  --text-dim:     #7a6030;
  --text-mid:     #5a4020;
  --gold:         #b07800;
  --gold-bright:  #d09000;
  --shadow-panel: 0 8px 32px rgba(120,80,0,.14), inset 0 1px 0 rgba(200,150,0,.1);
}

/* ---- PURPLE THEME ---- */
html[data-theme="purple"] {
  --bg:           #0a0710;
  --bg-2:         #120b1e;
  --bg-3:         #180f28;
  --surface:      rgba(168,85,247,0.05);
  --surface-md:   rgba(168,85,247,0.09);
  --surface-hi:   rgba(168,85,247,0.15);
  --border:       rgba(168,85,247,0.22);
  --border-hi:    rgba(168,85,247,0.5);
  --text:         #ece4fb;
  --text-dim:     #8a7aa0;
  --text-mid:     #b3a0cc;
  --gold:         #a855f7;
  --gold-bright:  #c084fc;
  --gold-dim:     #6b21a8;
  --amber:        #ec4899;
  --red:          #ff4d7a;
  --green:        #4ee39a;
  --glow-gold:    0 0 18px rgba(168,85,247,.55), 0 0 40px rgba(168,85,247,.2);
  --glow-gold-sm: 0 0 8px rgba(168,85,247,.5);
  --glow-red:     0 0 12px rgba(255,77,122,.6);
  --shadow-panel: 0 8px 40px rgba(0,0,0,.8), inset 0 1px 0 rgba(168,85,247,.08);
}

/* ---- CYBERPUNK THEME ---- */
html[data-theme="cyberpunk"] {
  --bg:           #050208;
  --bg-2:         #0a0512;
  --bg-3:         #0f0818;
  --surface:      rgba(0,229,255,0.05);
  --surface-md:   rgba(0,229,255,0.08);
  --surface-hi:   rgba(255,0,200,0.14);
  --border:       rgba(0,229,255,0.25);
  --border-hi:    rgba(255,0,200,0.55);
  --text:         #e8faff;
  --text-dim:     #6a7a8a;
  --text-mid:     #9ab0c0;
  --gold:         #00e5ff;
  --gold-bright:  #66f2ff;
  --gold-dim:     #0891a8;
  --amber:        #ff00c8;
  --red:          #ff2e63;
  --green:        #00ff9c;
  --glow-gold:    0 0 18px rgba(0,229,255,.6), 0 0 40px rgba(255,0,200,.25);
  --glow-gold-sm: 0 0 8px rgba(0,229,255,.55);
  --glow-red:     0 0 12px rgba(255,46,99,.65);
  --shadow-panel: 0 8px 40px rgba(0,0,0,.85), inset 0 1px 0 rgba(0,229,255,.1);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s, color .4s;
}
h1,h2,h3 { font-family: var(--font-display); letter-spacing: .05em; }
ul { list-style: none; }
button, input, textarea, select { font-family: inherit; color: inherit; }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }

/* ---- GRADIENT TEXT ---- */
.grad-text {
  background: linear-gradient(90deg, var(--gold-bright), var(--amber));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

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

.grid-floor {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(245,185,66,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,185,66,.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.6) 40%, rgba(0,0,0,.3) 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.6) 40%, rgba(0,0,0,.3) 100%);
}
html[data-theme="light"] .grid-floor {
  background-image:
    linear-gradient(rgba(180,120,0,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180,120,0,.08) 1px, transparent 1px);
}
html[data-theme="purple"] .grid-floor {
  background-image:
    linear-gradient(rgba(168,85,247,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168,85,247,.08) 1px, transparent 1px);
}
html[data-theme="cyberpunk"] .grid-floor {
  background-image:
    linear-gradient(rgba(0,229,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,0,200,.08) 1px, transparent 1px);
}

.glow-orb {
  position: absolute; border-radius: 50%;
  filter: blur(100px); pointer-events: none;
}
.orb-gold  { width: 600px; height: 600px; background: radial-gradient(circle, rgba(245,185,66,.22) 0%, transparent 70%); top: -200px; right: -100px; animation: driftA 20s ease-in-out infinite; }
.orb-amber { width: 500px; height: 500px; background: radial-gradient(circle, rgba(255,140,0,.16) 0%, transparent 70%); bottom: -180px; left: -120px; animation: driftB 24s ease-in-out infinite; }

html[data-theme="purple"] .orb-gold  { background: radial-gradient(circle, rgba(168,85,247,.26) 0%, transparent 70%); }
html[data-theme="purple"] .orb-amber { background: radial-gradient(circle, rgba(236,72,153,.18) 0%, transparent 70%); }

html[data-theme="cyberpunk"] .orb-gold  { background: radial-gradient(circle, rgba(0,229,255,.26) 0%, transparent 70%); }
html[data-theme="cyberpunk"] .orb-amber { background: radial-gradient(circle, rgba(255,0,200,.2) 0%, transparent 70%); }

@keyframes driftA { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-60px,50px) scale(1.1)} }
@keyframes driftB { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(60px,-40px) scale(1.08)} }

.scanlines {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.08) 2px, rgba(0,0,0,.08) 4px);
  opacity: .4;
}
html[data-theme="light"] .scanlines { opacity: .08; }
html[data-theme="cyberpunk"] .scanlines { opacity: .55; }

.particles { position: absolute; inset: 0; }

/* ============================================================
   CYBERPUNK PANEL — glass with neon border
   ============================================================ */
.cyber-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  position: relative;
  overflow: hidden;
}
.cyber-panel::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--surface-hi) 0%, transparent 60%);
  pointer-events: none; border-radius: inherit;
}

/* corner brackets */
.modal-corner {
  position: absolute; width: 16px; height: 16px;
  border-color: var(--gold); border-style: solid; border-width: 0;
}
.modal-corner.tl { top: 10px; left: 10px; border-top-width: 2px; border-left-width: 2px; border-radius: 3px 0 0 0; }
.modal-corner.tr { top: 10px; right: 10px; border-top-width: 2px; border-right-width: 2px; border-radius: 0 3px 0 0; }
.modal-corner.bl { bottom: 10px; left: 10px; border-bottom-width: 2px; border-left-width: 2px; border-radius: 0 0 0 3px; }
.modal-corner.br { bottom: 10px; right: 10px; border-bottom-width: 2px; border-right-width: 2px; border-radius: 0 0 3px 0; }

/* ============================================================
   TOP NAV
   ============================================================ */
.topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(14px, 4vw, 44px);
  border-bottom: 1px solid var(--border);
  background: rgba(5,5,7,.85);
  backdrop-filter: blur(12px);
  position: relative; z-index: 10;
}
html[data-theme="light"] .topnav { background: rgba(245,240,232,.9); }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-mark span { font-family: var(--font-display); font-weight: 900; font-size: 1.1rem; color: #000; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--font-display); font-weight: 900; font-size: .85rem; color: var(--gold); letter-spacing: .18em; }
.brand-sub  { font-family: var(--font-ui); font-weight: 600; font-size: .65rem; color: var(--text-dim); letter-spacing: .25em; }

.topnav-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-md);
  cursor: pointer; font-size: 1rem; display: grid; place-items: center;
  color: var(--gold); transition: all .2s;
}
.icon-btn:hover { border-color: var(--gold); box-shadow: var(--glow-gold-sm); background: var(--surface-hi); }

.wheel-theme-picker { display: flex; align-items: center; gap: 6px; }
.wheel-theme-select {
  height: 38px; padding: 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-md);
  color: var(--gold); font-family: var(--font-ui); font-weight: 600; font-size: .78rem;
  letter-spacing: .03em; cursor: pointer; transition: all .2s;
}
.wheel-theme-select:hover, .wheel-theme-select:focus {
  border-color: var(--gold); box-shadow: var(--glow-gold-sm); background: var(--surface-hi); outline: none;
}
.wheel-theme-select option { background: var(--bg-2); color: var(--text); }

.site-theme-picker { display: flex; align-items: center; }
.site-theme-select {
  height: 38px; padding: 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-md);
  color: var(--gold); font-family: var(--font-ui); font-weight: 600; font-size: .78rem;
  letter-spacing: .03em; cursor: pointer; transition: all .2s;
}
.site-theme-select:hover, .site-theme-select:focus {
  border-color: var(--gold); box-shadow: var(--glow-gold-sm); background: var(--surface-hi); outline: none;
}
.site-theme-select option { background: var(--bg-2); color: var(--text); }
.wheel-photo-upload {
  height: 38px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-md);
  color: var(--gold); font-family: var(--font-ui); font-weight: 600; font-size: .78rem;
  letter-spacing: .02em; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  transition: all .2s; white-space: nowrap;
}
.wheel-photo-upload:hover {
  border-color: var(--gold); box-shadow: var(--glow-gold-sm); background: var(--surface-hi);
}
@media (max-width: 640px) {
  .wheel-photo-upload { padding: 0 8px; font-size: 0; }
  .wheel-photo-upload::before { content: '📷'; font-size: 1rem; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  border: none; cursor: pointer; border-radius: var(--radius-sm);
  padding: 11px 22px; font-family: var(--font-ui); font-weight: 700; font-size: .88rem;
  letter-spacing: .08em; text-transform: uppercase;
  transition: all .2s ease; display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap; position: relative; overflow: hidden;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.btn-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.18), transparent 70%);
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, #b07800, var(--gold), var(--gold-bright));
  color: #000; font-weight: 800;
  box-shadow: 0 0 20px rgba(245,185,66,.4), 0 4px 16px rgba(0,0,0,.5);
  border: 1px solid var(--gold-bright);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--glow-gold), 0 6px 20px rgba(0,0,0,.5);
}

.btn-ghost {
  background: var(--surface-md); color: var(--text-mid);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); background: var(--surface-hi); }

.btn-text  { background: transparent; color: var(--text-dim); }
.btn-text:hover { color: var(--gold); }
.btn-danger { background: rgba(255,60,90,.1); color: var(--red); border: 1px solid rgba(255,60,90,.3); }
.btn-danger:hover { background: rgba(255,60,90,.2); box-shadow: var(--glow-red); }

.btn-sm  { padding: 7px 14px; font-size: .78rem; }
.btn-lg  { padding: 14px 30px; font-size: .95rem; }
.btn-xl  { padding: 16px 36px; font-size: 1rem; letter-spacing: .12em; }
.file-btn { cursor: pointer; }

/* ============================================================
   LANDING
   ============================================================ */
.view { position: relative; z-index: 2; }
.landing { min-height: 100vh; display: flex; flex-direction: column; }

.hero {
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 48px;
  padding: 50px clamp(14px,5vw,60px) 60px; max-width: 1360px; margin: 0 auto; flex: 1;
}
.eyebrow {
  display: flex; align-items: center; gap: 8px;
  color: var(--gold); font-family: var(--font-display); font-size: .72rem;
  letter-spacing: .25em; text-transform: uppercase; margin-bottom: 18px;
}
.eye-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: var(--glow-gold-sm); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 4rem); line-height: 1.05; font-weight: 900;
  text-shadow: 0 0 60px rgba(245,185,66,.15);
}
.hero-sub { margin-top: 20px; color: var(--text-mid); font-size: 1.02rem; line-height: 1.65; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.hero-visual { position: relative; display: grid; place-items: center; }
.wheel-halo {
  position: absolute; width: 460px; height: 460px; max-width: 92vw; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,229,255,.16) 0%, rgba(143,43,255,.10) 40%, transparent 65%);
  animation: haloBreath 4s ease-in-out infinite;
}
@keyframes haloBreath { 0%,100%{transform:scale(1);opacity:.7} 50%{transform:scale(1.06);opacity:1} }
#heroWheel {
  width: min(420px, 88vw); height: auto;
  filter: drop-shadow(0 0 26px rgba(0,229,255,.4)) drop-shadow(0 0 40px rgba(143,43,255,.25));
  animation: heroSpin 40s linear infinite;
}
@keyframes heroSpin { to { transform: rotate(360deg); } }
.hero-pointer {
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 14px solid transparent; border-right: 14px solid transparent;
  border-top: 26px solid #00e5ff;
  filter: drop-shadow(0 0 10px rgba(0,229,255,.9));
}

.features {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 16px;
  max-width: 1360px; margin: 0 auto; padding: 0 clamp(14px,5vw,60px) 60px;
}
.feature-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 24px 20px;
  transition: all .25s ease;
}
.feature-card:hover { border-color: var(--border-hi); transform: translateY(-4px); box-shadow: var(--glow-gold-sm), var(--shadow-panel); }
.feature-icon { font-size: 1.5rem; margin-bottom: 10px; }
.feature-line { width: 32px; height: 2px; background: linear-gradient(90deg, var(--gold), transparent); margin-bottom: 10px; }
.feature-card h3 { font-size: .82rem; letter-spacing: .14em; color: var(--gold); margin-bottom: 8px; }
.feature-card p  { color: var(--text-dim); font-size: .87rem; line-height: 1.55; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.8);
  display: grid; place-items: center; z-index: 80; padding: 20px;
  backdrop-filter: blur(6px);
}
.modal-overlay[hidden] { display: none; }
.modal { max-width: 480px; width: 100%; padding: 36px 32px; }
.modal h2 { color: var(--gold); margin-bottom: 20px; font-size: 1rem; }
.inst-list { padding-left: 20px; color: var(--text-mid); line-height: 1.8; margin-bottom: 24px; }
.inst-list li { margin-bottom: 4px; }
.inst-list strong { color: var(--gold); }

/* ============================================================
   GAME LAYOUT
   ============================================================ */
.game { min-height: 100vh; display: flex; flex-direction: column; }
.game-layout {
  display: grid; grid-template-columns: 290px 1fr 310px; gap: 16px; align-items: start;
  padding: 16px clamp(10px,2.5vw,28px) 100px; flex: 1;
}
.panel { border-radius: var(--radius-lg); padding: 18px; }
.panel h2 { font-size: .8rem; letter-spacing: .18em; color: var(--gold); margin-bottom: 14px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex-wrap: wrap; margin-bottom: 14px;
}
.panel-head h2 { margin-bottom: 0; }

/* Pills */
.counts { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  font-size: .68rem; padding: 3px 9px; border-radius: 4px;
  background: var(--surface-md); border: 1px solid var(--border);
  color: var(--text-dim); font-family: var(--font-ui); letter-spacing: .06em; font-weight: 600;
}
.pill-ok  { color: var(--green); border-color: rgba(57,255,138,.3); background: rgba(57,255,138,.08); }
.pill-bad { color: var(--red);   border-color: rgba(255,60,90,.3);  background: rgba(255,60,90,.08); }

/* Inputs */
.add-row { display: flex; gap: 8px; margin-bottom: 10px; }
.add-row input { flex: 1; }
input[type="text"],
input[type="search"],
textarea {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; color: var(--text); font-size: .88rem; width: 100%;
  transition: border-color .2s;
}
input:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245,185,66,.12); outline: none; }
textarea { resize: vertical; margin-bottom: 8px; }
.search-input { margin: 10px 0; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions.wrap { margin-top: 10px; }

/* Entry list */
.participant-list {
  max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; margin: 6px 0;
}
.participant-list::-webkit-scrollbar { width: 4px; }
.participant-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.p-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--bg-3); border: 1px solid var(--border);
  cursor: grab; font-size: .87rem; transition: border-color .2s;
}
.p-item:hover { border-color: var(--border-hi); }
.p-item.eliminated { opacity: .35; text-decoration: line-through; cursor: default; }
.p-item .p-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-actions { display: flex; gap: 4px; flex-shrink: 0; }
.p-actions button {
  background: none; border: none; cursor: pointer; color: var(--text-dim);
  font-size: .82rem; padding: 2px 5px; border-radius: 4px; transition: color .2s;
}
.p-actions button:hover { color: var(--red); }
.p-name-input { background: transparent; border: none; border-bottom: 1px dashed var(--border); width: 100%; font-size: .87rem; color: var(--text); }

/* ============================================================
   SPINNER CENTER
   ============================================================ */
.center { display: flex; flex-direction: column; align-items: center; gap: 20px; }

.wheel-wrap {
  position: relative; width: min(500px, 100%); aspect-ratio: 1/1;
  display: grid; place-items: center;
}
.wheel-ring-outer, .wheel-ring-inner {
  position: absolute; border-radius: 50%; pointer-events: none;
}
.wheel-ring-outer {
  inset: -12px;
  border: 1px solid rgba(0,229,255,.28);
  box-shadow: 0 0 30px rgba(0,229,255,.12), 0 0 60px rgba(143,43,255,.08);
  animation: ringPulse 3s ease-in-out infinite;
}
.wheel-ring-inner { inset: -4px; border: 1px solid rgba(143,43,255,.4); }
@keyframes ringPulse { 0%,100%{opacity:.6} 50%{opacity:1} }

#wheelCanvas {
  width: 100%; height: 100%; border-radius: 50%;
  box-shadow: 0 0 50px rgba(0,229,255,.18), 0 0 90px rgba(143,43,255,.12), 0 20px 60px rgba(0,0,0,.7);
}
.pointer {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; z-index: 5;
}
.pointer::before {
  content: '';
  width: 0; height: 0;
  border-left: 16px solid transparent; border-right: 16px solid transparent;
  border-top: 30px solid #00e5ff;
  filter: drop-shadow(0 0 12px rgba(0,229,255,.95));
}
.pointer-inner {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ff1fb0; margin-top: -4px;
  box-shadow: 0 0 12px rgba(255,31,176,.85);
}
.wheel-center-label {
  position: absolute; inset: 0; display: grid; place-items: center;
  text-align: center; padding: 25% 10%;
  color: var(--text-dim); font-size: .9rem; pointer-events: none;
}

/* Spin controls */
.spin-controls { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 440px; }
.controls-row { display: flex; align-items: center; gap: 20px; width: 100%; justify-content: center; flex-wrap: wrap; }
.duration-control { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .78rem; color: var(--text-dim); font-family: var(--font-ui); letter-spacing: .08em; }
.sound-control { display: flex; align-items: center; gap: 8px; }
.sound-control input[type="range"] { width: 90px; }
input[type="range"] { width: 100%; accent-color: var(--gold); }

.elimination-banner {
  background: linear-gradient(120deg, rgba(255,60,90,.15), rgba(255,60,90,.05));
  border: 1px solid rgba(255,60,90,.45); color: var(--red);
  font-family: var(--font-display); font-weight: 700; letter-spacing: .08em;
  padding: 13px 24px; border-radius: var(--radius-md); text-align: center;
  animation: bannerIn .35s cubic-bezier(.34,1.56,.64,1);
  box-shadow: var(--glow-red);
}
@keyframes bannerIn { from{opacity:0;transform:scale(.9) translateY(-8px)} to{opacity:1;transform:scale(1) translateY(0)} }

/* ============================================================
   STATS & HISTORY
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-card {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 12px; text-align: center; transition: border-color .2s;
}
.stat-card:hover { border-color: var(--border-hi); }
.stat-card.wide { grid-column: span 2; }
.stat-num {
  display: block; font-family: var(--font-display); font-weight: 900; font-size: 1.5rem;
  color: var(--gold); text-shadow: var(--glow-gold-sm);
}
.stat-label { font-family: var(--font-ui); font-size: .65rem; letter-spacing: .14em; color: var(--text-dim); }

.history-list { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.h-item {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
  font-size: .8rem; padding: 8px 10px; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-dim);
}
.h-item b { color: var(--gold); }

/* ============================================================
   FAB + BOTTOM NAV
   ============================================================ */
.fab { display: none; }
.bottom-nav { display: none; }

/* ============================================================
   WINNER OVERLAY
   ============================================================ */
.winner-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(ellipse at 50% 20%, rgba(245,185,66,.2) 0%, rgba(0,0,0,.96) 60%);
  display: grid; place-items: center;
}
.winner-overlay[hidden] { display: none; }
#confettiCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.winner-beams {
  position: absolute; inset: 0; display: flex; justify-content: center; align-items: flex-start;
  overflow: hidden; pointer-events: none;
}
.beam {
  position: absolute; top: 0; width: 2px; height: 100vh;
  background: linear-gradient(to bottom, rgba(245,185,66,.4), transparent);
  transform-origin: top center; animation: beamSweep 4s ease-in-out infinite;
}
.beam:nth-child(1){left:30%;animation-delay:0s;opacity:.6}
.beam:nth-child(2){left:40%;animation-delay:.4s;opacity:.5}
.beam:nth-child(3){left:50%;animation-delay:.8s;opacity:.7}
.beam:nth-child(4){left:60%;animation-delay:1.2s;opacity:.5}
.beam:nth-child(5){left:70%;animation-delay:1.6s;opacity:.6}
.beam:nth-child(6){left:55%;animation-delay:2s;opacity:.4}
@keyframes beamSweep { 0%,100%{transform:rotate(-4deg);opacity:.3} 50%{transform:rotate(4deg);opacity:.7} }

.winner-card {
  position: relative; z-index: 2; text-align: center;
  padding: 50px 44px; border-radius: 22px; max-width: 500px; width: 92%;
  border-color: var(--border-hi);
  box-shadow: var(--glow-gold), 0 40px 100px rgba(0,0,0,.8);
  animation: winnerIn .6s cubic-bezier(.34,1.56,.64,1);
}
@keyframes winnerIn { from{opacity:0;transform:scale(.8) translateY(30px)} to{opacity:1;transform:scale(1) translateY(0)} }

.trophy { font-size: 4.5rem; filter: drop-shadow(0 0 20px rgba(245,185,66,.6)); animation: trophyFloat 2s ease-in-out infinite; }
@keyframes trophyFloat { 0%,100%{transform:translateY(0) rotate(-2deg)} 50%{transform:translateY(-12px) rotate(2deg)} }

.winner-eyebrow {
  font-family: var(--font-display); font-size: .75rem; letter-spacing: .25em;
  color: var(--gold); margin: 16px 0 8px; text-shadow: var(--glow-gold-sm);
}
#winnerName {
  font-size: clamp(1.8rem,5vw,2.8rem); font-weight: 900; color: var(--text);
  text-shadow: 0 0 40px rgba(245,185,66,.3);
}
.winner-meta { color: var(--text-dim); margin-top: 10px; font-size: .88rem; }
.winner-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 28px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { position: relative; z-index: 2; padding: 0 clamp(14px,4vw,44px) 30px; }
.footer-line { height: 1px; background: linear-gradient(90deg, transparent, var(--border-hi), transparent); margin-bottom: 20px; }
.footer-inner {
  max-width: 1360px; margin: 0 auto; display: flex; align-items: center;
  justify-content: center; gap: 24px; flex-wrap: wrap;
  color: var(--text-dim); font-size: .82rem; text-align: center;
}
.footer-link {
  color: var(--text-dim); text-decoration: none; padding: 6px 4px;
  min-height: 34px; display: inline-flex; align-items: center; gap: 7px;
  transition: color .2s; font-family: var(--font-ui); letter-spacing: .04em;
}
.footer-link:hover { color: var(--gold); text-shadow: var(--glow-gold-sm); }
.footer-logo { font-weight: 700; font-family: var(--font-display); font-size: .78rem; letter-spacing: .14em; color: var(--text-mid); }
.devntric-mark {
  width: 22px; height: 22px; border-radius: 6px;
  object-fit: contain; vertical-align: middle;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--bg-3); border: 1px solid var(--border-hi);
  color: var(--gold); padding: 10px 22px; border-radius: var(--radius-sm);
  font-size: .83rem; font-family: var(--font-ui); letter-spacing: .06em;
  z-index: 120; box-shadow: var(--glow-gold-sm); white-space: nowrap;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .game-layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .center  { order: 1; }
  .stats   { order: 3; }
  .features { grid-template-columns: repeat(2,1fr); }
  .hero { grid-template-columns: 1fr; text-align: center; gap: 30px; }
  .hero-sub { margin: 16px auto 0; }
  .hero-actions { justify-content: center; }
  .eyebrow { justify-content: center; }
  .wheel-halo { width: 360px; height: 360px; }
}

@media (max-width: 720px) {
  .features { grid-template-columns: 1fr; }
  .game-layout { padding-bottom: 140px; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: rgba(5,5,7,.95); backdrop-filter: blur(18px);
    border-top: 1px solid var(--border);
    padding: 8px max(10px,env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .bn-item {
    background: none; border: none; color: var(--text-dim);
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 1.1rem; cursor: pointer; padding: 6px 12px; border-radius: var(--radius-sm);
    transition: color .2s;
  }
  .bn-item span { font-size: .62rem; font-family: var(--font-ui); letter-spacing: .08em; }
  .bn-item.active { color: var(--gold); }
  .fab {
    display: grid; place-items: center; position: fixed; right: 16px; bottom: 76px; z-index: 65;
    width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--gold);
    cursor: pointer; font-size: 1.3rem;
    background: linear-gradient(135deg, #7a5000, var(--gold));
    color: #000; box-shadow: var(--glow-gold);
    animation: fabPulse 2s ease-in-out infinite;
  }
  @keyframes fabPulse { 0%,100%{box-shadow:var(--glow-gold)} 50%{box-shadow:0 0 30px rgba(245,185,66,.8),0 0 60px rgba(245,185,66,.3)} }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
  .add-row { flex-direction: column; }
  .winner-actions { flex-direction: column; }
  .winner-actions .btn { justify-content: center; }
  .winner-card { padding: 36px 24px; }
  .topnav { padding: 12px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
/* 1. Let the nav bar wrap instead of overflowing */
.topnav {
  /* ...existing styles... */
  flex-wrap: wrap; row-gap: 10px;
}

/* 2. Let the actions group wrap too */
.topnav-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
/* 3. Inside the existing @media (max-width: 640px) block, add: */
.topnav { justify-content: center; }
.brand { flex: 1 1 auto; min-width: 0; }
.brand-text { min-width: 0; }
.brand-name, .brand-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topnav-actions { flex: 1 1 100%; justify-content: center; }
.wheel-theme-picker, .site-theme-picker { flex: 1 1 auto; min-width: 0; }
.wheel-theme-select, .site-theme-select {
  width: 100%; min-width: 0; padding: 0 8px; font-size: .72rem;
}

/* 4. New breakpoint for very small phones */
@media (max-width: 400px) {
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: .72rem; }
  .brand-sub { font-size: .56rem; }
  .icon-btn { width: 34px; height: 34px; }
}