/* ═══════════════════════════════════════════════════════════
   NAMEWHEEL.ORG — GOD-TIER DESIGN SYSTEM
   ═══════════════════════════════════════════════════════════ */

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

:root {
  --bg: #07070F;
  --surface: rgba(15,15,26,0.85);
  --surface2: rgba(22,22,42,0.9);
  --border: rgba(124,58,237,0.15);
  --border-hover: rgba(124,58,237,0.35);
  --purple: #7C3AED;
  --purple-light: #A78BFA;
  --purple-deep: #4C1D95;
  --cyan: #06B6D4;
  --cyan-light: #22D3EE;
  --amber: #F59E0B;
  --pink: #EC4899;
  --green: #10B981;
  --red: #EF4444;
  --text: #F8FAFC;
  --text-dim: #CBD5E1;
  --muted: #64748B;
  --glass: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.08);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ═══ AMBIENT BACKGROUND ═══ */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
}
.b1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(124,58,237,0.12) 0%, transparent 70%);
  top: -200px; left: -150px;
  animation: blobPulse 10s ease-in-out infinite alternate;
}
.b2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(6,182,212,0.08) 0%, transparent 70%);
  bottom: -150px; right: -100px;
  animation: blobPulse 12s ease-in-out infinite alternate-reverse;
}
.b3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(236,72,153,0.06) 0%, transparent 70%);
  top: 40%; left: 50%; transform: translate(-50%,-50%);
  animation: blobPulse 8s ease-in-out infinite alternate;
}
@keyframes blobPulse { 0%{transform:scale(1);opacity:1} 100%{transform:scale(1.3);opacity:0.6} }

#ambient-particles {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
}

/* ═══ NAV ═══ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 32px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(7,7,15,0.8);
  backdrop-filter: blur(24px) saturate(1.5);
  border-bottom: 1px solid var(--glass-border);
}

.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px; font-weight: 800;
  color: var(--text); letter-spacing: -0.5px;
}
.logo-text span {
  background: linear-gradient(135deg, var(--purple-light), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.nav-links { display: flex; gap: 4px; list-style: none; align-items: center; }
.nav-link {
  display: flex; align-items: center; gap: 6px;
  text-decoration: none; color: var(--muted);
  font-size: 13px; font-weight: 500;
  padding: 7px 14px; border-radius: 10px;
  transition: all 0.2s ease;
}
.nav-link:hover {
  color: var(--text);
  background: var(--glass);
}
.nav-link svg { opacity: 0.6; transition: opacity 0.2s; }
.nav-link:hover svg { opacity: 1; }

.nav-cta {
  display: flex; align-items: center; gap: 6px;
  text-decoration: none;
  background: linear-gradient(135deg, var(--purple), var(--purple-deep));
  color: white !important;
  border-radius: 10px; padding: 8px 18px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 0 24px rgba(124,58,237,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: all 0.25s ease;
  position: relative; overflow: hidden;
}
.nav-cta::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  pointer-events: none;
}
.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 36px rgba(124,58,237,0.6), inset 0 1px 0 rgba(255,255,255,0.2);
}
.nav-cta svg { opacity: 0.9; }

/* ═══ LAYOUT ═══ */
main {
  position: relative; z-index: 1;
  padding-top: 64px; min-height: 100vh;
  display: flex; flex-direction: column;
}
.hero {
  flex: 1;
  display: grid; grid-template-columns: 1fr 540px;
  gap: 48px; align-items: center;
  max-width: 1280px; margin: 0 auto;
  padding: 40px 32px; width: 100%;
}

/* ═══ LEFT PANEL ═══ */
.left-panel { display: flex; flex-direction: column; gap: 20px; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 100px; padding: 6px 16px;
  font-size: 12px; font-weight: 600;
  color: var(--purple-light); width: fit-content;
  animation: fadeInUp 0.6s ease both;
}
.badge svg { opacity: 0.8; }
.badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(0.8)} }

h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(38px, 4.5vw, 60px);
  font-weight: 800; line-height: 1.05; letter-spacing: -2.5px;
  animation: fadeInUp 0.6s 0.1s ease both;
}
.line1 { display: block; color: var(--text); }
.line2 {
  display: block;
  background: linear-gradient(135deg, var(--purple-light) 0%, var(--cyan) 40%, var(--pink) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite, fadeInUp 0.6s 0.1s ease both;
}
@keyframes gradientShift { 0%{background-position:0 50%} 50%{background-position:100% 50%} 100%{background-position:0 50%} }

.subtitle {
  font-size: 16px; color: var(--muted); line-height: 1.7;
  max-width: 440px; animation: fadeInUp 0.6s 0.2s ease both;
}

/* ═══ INPUT AREA ═══ */
.input-area {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 18px; padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  animation: fadeInUp 0.6s 0.3s ease both;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: border-color 0.3s;
}
.input-area:focus-within { border-color: var(--border-hover); }

.input-header { display: flex; justify-content: space-between; align-items: center; }
.input-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--muted);
}
.input-label svg { opacity: 0.6; }

.tags { display: flex; gap: 6px; }
.tag {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500; padding: 4px 10px;
  border-radius: 8px;
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--muted); cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.tag:hover {
  background: rgba(124,58,237,0.15);
  color: var(--purple-light);
  border-color: rgba(124,58,237,0.3);
}
.tag-ai {
  color: var(--amber);
  border-color: rgba(245,158,11,0.2);
}
.tag-ai:hover {
  background: rgba(245,158,11,0.12);
  color: var(--amber);
  border-color: rgba(245,158,11,0.35);
}

.names-input {
  background: var(--surface2);
  border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 12px 14px;
  color: var(--text); font-family: 'Inter', sans-serif;
  font-size: 14px; resize: none; height: 112px;
  outline: none; transition: all 0.25s ease;
  line-height: 1.8; width: 100%;
}
.names-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}
.names-input::placeholder { color: var(--muted); }

.input-footer { display: flex; justify-content: space-between; align-items: center; }
.name-count { font-size: 12px; color: var(--muted); }
.name-count strong { color: var(--purple-light); }
.ready-badge {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--green); font-weight: 500;
}

/* ═══ SETTINGS BAR ═══ */
.settings-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  animation: fadeInUp 0.6s 0.35s ease both;
  flex-wrap: wrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.setting-group { display: flex; align-items: center; gap: 8px; }
.settings-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap;
}
.settings-label svg { opacity: 0.5; }
.setting-divider { width: 1px; height: 24px; background: var(--glass-border); }

.toggle-group {
  display: flex; gap: 3px;
  background: rgba(0,0,0,0.3);
  border-radius: 9px; padding: 3px;
  border: 1px solid var(--glass-border);
}
.toggle-opt {
  font-size: 12px; padding: 5px 12px;
  border-radius: 7px; color: var(--muted);
  cursor: pointer; transition: all 0.25s ease;
  font-weight: 500; border: none; background: none;
  font-family: inherit;
}
.toggle-opt:hover { color: var(--text-dim); }
.toggle-opt.active {
  background: var(--purple);
  color: white;
  box-shadow: 0 0 14px rgba(124,58,237,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}

.volume-icon {
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center;
  transition: color 0.2s;
}
.volume-icon:hover { color: var(--text); }

input[type=range] {
  -webkit-appearance: none; width: 76px; height: 4px;
  background: linear-gradient(90deg, var(--purple) 60%, rgba(255,255,255,0.08) 60%);
  border-radius: 2px; outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px;
  border-radius: 50%; background: var(--purple-light);
  box-shadow: 0 0 10px rgba(124,58,237,0.6);
  transition: transform 0.15s;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* ═══ CONTROLS ROW ═══ */
.controls-row {
  display: flex; gap: 10px;
  animation: fadeInUp 0.6s 0.4s ease both;
}
.spin-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(135deg, var(--purple) 0%, #5B21B6 50%, var(--purple) 100%);
  background-size: 200% 200%;
  border: none; border-radius: 14px; padding: 16px 28px;
  color: white; font-family: 'Space Grotesk', sans-serif;
  font-size: 17px; font-weight: 700; cursor: pointer;
  letter-spacing: 0.5px;
  box-shadow: 0 0 32px rgba(124,58,237,0.45), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: all 0.25s ease;
  position: relative; overflow: hidden;
  animation: gradientShift 4s ease infinite;
}
.spin-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  pointer-events: none;
}
.spin-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 50px rgba(124,58,237,0.7), inset 0 1px 0 rgba(255,255,255,0.2);
}
.spin-btn:active { transform: translateY(0); }
.spin-btn.spinning {
  background: linear-gradient(135deg, var(--purple-deep), #3B0F7A);
  cursor: not-allowed;
}
.spin-btn-icon { flex-shrink: 0; }

.icon-btn {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 14px; width: 54px; height: 54px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted);
  transition: all 0.25s ease;
}
.icon-btn:hover {
  background: var(--surface2); color: var(--text);
  border-color: var(--border-hover);
  box-shadow: 0 0 16px rgba(124,58,237,0.15);
}

/* ═══ HISTORY ═══ */
.history-strip {
  display: flex; gap: 10px; align-items: center;
  animation: fadeInUp 0.6s 0.5s ease both;
  min-height: 28px;
}
.history-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.history-label svg { opacity: 0.5; }
.history-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.history-chip {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 8px; padding: 3px 12px;
  font-size: 12px; color: var(--green); font-weight: 500;
  animation: chipIn 0.3s ease both;
}
@keyframes chipIn { from{opacity:0;transform:scale(0.8)} to{opacity:1;transform:scale(1)} }

@keyframes fadeInUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

/* ═══ WHEEL SECTION ═══ */
.wheel-section {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  animation: fadeInUp 0.6s 0.2s ease both;
}
.wheel-hero-bg {
  position: absolute;
  width: 640px; height: 640px;
  border-radius: 50%;
  background: url('hero-wheel.png') center/contain no-repeat;
  opacity: 0.22;
  filter: blur(3px);
  animation: atmoSpin 25s linear infinite;
  pointer-events: none;
}

.atmo-glow {
  position: absolute;
  width: 560px; height: 560px; border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(124,58,237,0), rgba(124,58,237,0.55),
    rgba(6,182,212,0.55), rgba(6,182,212,0),
    rgba(236,72,153,0.45), rgba(236,72,153,0),
    rgba(245,158,11,0.45), rgba(245,158,11,0),
    rgba(16,185,129,0.45), rgba(16,185,129,0),
    rgba(124,58,237,0)
  );
  filter: blur(40px);
  animation: atmoSpin 8s linear infinite;
  opacity: 0.45;
}
@keyframes atmoSpin { to{transform:rotate(360deg)} }

.pulse-ring {
  position: absolute;
  width: 520px; height: 520px; border-radius: 50%;
  border: 2px solid rgba(124,58,237,0.2);
  animation: ringPulse 3s ease-in-out infinite;
}
.pulse-ring.r2 {
  width: 550px; height: 550px;
  border: 1px solid rgba(6,182,212,0.12);
  animation-delay: 1s;
}
@keyframes ringPulse { 0%,100%{opacity:0.2;transform:scale(1)} 50%{opacity:0.7;transform:scale(1.02)} }

.wheel-wrap { position: relative; width: 490px; height: 490px; }

canvas#wheel {
  width: 490px; height: 490px;
  border-radius: 50%;
  cursor: pointer;
  transition: filter 0.3s;
}
canvas#wheel:hover { filter: drop-shadow(0 0 45px rgba(124,58,237,0.6)) drop-shadow(0 0 15px rgba(6,182,212,0.3)); }

/* ═══ POINTER ═══ */
.pointer-wrap {
  position: absolute; top: -32px; left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex; flex-direction: column; align-items: center;
  animation: pointerFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(124,58,237,0.5));
  transition: transform 0.1s;
}
.pointer-wrap.wobble {
  animation: pointerWobble 0.15s ease;
}
@keyframes pointerFloat { 0%,100%{transform:translateX(-50%) translateY(0)} 50%{transform:translateX(-50%) translateY(-5px)} }
@keyframes pointerWobble {
  0%{transform:translateX(-50%) rotate(0deg)}
  25%{transform:translateX(-50%) rotate(4deg)}
  50%{transform:translateX(-50%) rotate(-3deg)}
  75%{transform:translateX(-50%) rotate(2deg)}
  100%{transform:translateX(-50%) rotate(0deg)}
}
.pointer-svg { width: 36px; }

/* ═══ WINNER OVERLAY — Premium Redesign ═══ */
.winner-overlay {
  position: fixed; inset: 0;
  background: rgba(5,5,15,0.94);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.5s ease;
  will-change: opacity;
}
.winner-overlay.show {
  opacity: 1 !important;
  pointer-events: all !important;
}

#winner-particles {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
}

.winner-card {
  background: linear-gradient(165deg, rgba(12,12,24,0.97) 0%, rgba(20,16,36,0.97) 50%, rgba(12,12,24,0.97) 100%);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 32px;
  padding: 52px 60px; text-align: center;
  box-shadow:
    0 0 100px rgba(124,58,237,0.2),
    0 0 200px rgba(124,58,237,0.08),
    0 40px 80px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.06);
  transform: scale(0.8) translateY(30px);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
  opacity: 0;
  position: relative; overflow: hidden;
  max-width: 540px; width: 92%;
  z-index: 2;
}
.winner-overlay.show .winner-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Animated glow orbs behind card content */
.wc-orb {
  position: absolute; border-radius: 50%;
  pointer-events: none; z-index: 0;
  filter: blur(60px);
}
.wc-orb1 {
  width: 250px; height: 250px; top: -80px; left: -60px;
  background: rgba(124,58,237,0.25);
  animation: orbFloat 5s ease-in-out infinite alternate;
}
.wc-orb2 {
  width: 200px; height: 200px; bottom: -60px; right: -40px;
  background: rgba(6,182,212,0.2);
  animation: orbFloat 6s ease-in-out infinite alternate-reverse;
}
.wc-orb3 {
  width: 160px; height: 160px; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  background: rgba(236,72,153,0.12);
  animation: orbFloat 4s ease-in-out infinite alternate;
}
@keyframes orbFloat {
  0%{transform:translate(0,0) scale(1)} 100%{transform:translate(10px,-10px) scale(1.15)}
}
.wc-orb3 { animation-name: orbFloat3; }
@keyframes orbFloat3 {
  0%{transform:translate(-50%,-50%) scale(1)} 100%{transform:translate(-50%,-50%) scale(1.2)}
}

/* Top decorative gradient line */
.wc-topline {
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg,
    transparent 0%, rgba(124,58,237,0.6) 20%,
    rgba(167,139,250,0.9) 50%,
    rgba(6,182,212,0.6) 80%, transparent 100%);
  z-index: 1;
}
.wc-botline {
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg,
    transparent 0%, rgba(6,182,212,0.3) 30%,
    rgba(124,58,237,0.3) 70%, transparent 100%);
  z-index: 1;
}

/* Trophy */
.wc-trophy {
  position: relative; z-index: 2;
  margin-bottom: 14px;
  animation: trophyEntry 0.8s 0.2s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes trophyEntry {
  from{opacity:0;transform:scale(0) rotate(-15deg)} to{opacity:1;transform:scale(1) rotate(0deg)}
}

/* Label */
.wc-label {
  position: relative; z-index: 2;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 4px;
  color: var(--muted); margin-bottom: 16px;
  animation: labelEntry 0.5s 0.3s ease both;
}
@keyframes labelEntry { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

/* Winner Name */
.winner-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(44px, 8vw, 72px);
  font-weight: 800; letter-spacing: -2.5px;
  background: linear-gradient(135deg, #E8DEFF 0%, var(--purple-light) 25%, var(--cyan-light) 50%, var(--pink) 75%, #E8DEFF 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: nameGradient 4s ease infinite, nameEntry 0.6s 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
  margin-bottom: 6px;
  position: relative; z-index: 2;
  line-height: 1.1;
}
@keyframes nameGradient {
  0%{background-position:0 50%} 33%{background-position:100% 50%} 66%{background-position:50% 100%} 100%{background-position:0 50%}
}
@keyframes nameEntry { from{opacity:0;transform:scale(0.5) translateY(10px)} to{opacity:1;transform:scale(1) translateY(0)} }

/* Divider */
.wc-divider {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 14px 0 12px; position: relative; z-index: 2;
  animation: labelEntry 0.5s 0.4s ease both;
}
.wc-divider-line {
  width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167,139,250,0.4), transparent);
}
.wc-divider-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--purple-light);
  box-shadow: 0 0 8px var(--purple-light);
  animation: pulse 2s infinite;
}

.winner-sub {
  font-size: 13px; color: var(--muted); margin-bottom: 32px;
  position: relative; z-index: 2;
  animation: labelEntry 0.5s 0.45s ease both;
}

.winner-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  position: relative; z-index: 2;
  animation: labelEntry 0.5s 0.5s ease both;
}

.btn-primary, .btn-secondary, .btn-ghost {
  display: flex; align-items: center; gap: 8px;
  border-radius: 12px; padding: 12px 22px;
  font-weight: 600; font-size: 13px;
  cursor: pointer; transition: all 0.25s ease;
  font-family: inherit; border: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--purple-deep));
  color: white;
  box-shadow: 0 0 20px rgba(124,58,237,0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(124,58,237,0.5);
}
.btn-secondary {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.25);
  color: var(--red);
}
.btn-secondary:hover { background: rgba(239,68,68,0.2); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--muted);
}
.btn-ghost:hover {
  background: var(--glass); color: var(--text);
  border-color: var(--border-hover);
}
.btn-close-winner {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent;
  border: none;
  color: rgba(148,163,184,0.5);
  font-size: 12px; font-weight: 500;
  cursor: pointer; padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  transition: color 0.2s, background 0.2s;
  margin: 0 auto;
}
.btn-close-winner:hover {
  color: rgba(148,163,184,0.9);
  background: rgba(255,255,255,0.04);
}

#confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 10000; }

/* ═══ STATS BAR ═══ */
.stats-bar {
  max-width: 1280px; margin: 0 auto;
  padding: 0 32px 40px; position: relative; z-index: 1; width: 100%;
}
.stats-inner {
  display: flex; justify-content: center; align-items: center; gap: 32px;
  padding: 20px 28px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 18px; flex-wrap: wrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.stat { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.stat svg { flex-shrink: 0; }
.stat strong { color: var(--text); font-weight: 700; display: block; font-size: 16px; font-family: 'Space Grotesk', sans-serif; }
.stat-divider { width: 1px; height: 32px; background: var(--glass-border); }

/* ═══ FOOTER ═══ */
footer {
  border-top: 1px solid var(--glass-border);
  padding: 18px 32px;
  display: flex; justify-content: space-between; align-items: center;
  position: relative; z-index: 1; flex-wrap: wrap; gap: 12px;
}
.footer-brand {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 14px;
  background: linear-gradient(135deg, var(--purple-light), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 12px; color: var(--muted); }

/* ═══ FULLSCREEN SPIN MODE ═══ */
.spin-fullscreen-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(7,7,15,0.97);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.spin-fullscreen-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.spin-fullscreen-overlay .wheel-container {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  transform: scale(0.8);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.spin-fullscreen-overlay.active .wheel-container {
  transform: scale(1);
}
.spin-fullscreen-overlay .atmo-glow-fs {
  position: absolute;
  width: 700px; height: 700px; border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(124,58,237,0), rgba(124,58,237,0.4),
    rgba(6,182,212,0.4), rgba(6,182,212,0),
    rgba(236,72,153,0.35), rgba(236,72,153,0),
    rgba(245,158,11,0.35), rgba(245,158,11,0),
    rgba(16,185,129,0.35), rgba(16,185,129,0),
    rgba(124,58,237,0)
  );
  filter: blur(50px);
  animation: atmoSpin 6s linear infinite;
  opacity: 0.5;
}
.spin-fullscreen-overlay .fs-pointer {
  position: absolute;
  top: calc(50% - 310px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  filter: drop-shadow(0 4px 12px rgba(124,58,237,0.5));
  animation: pointerFloat 3s ease-in-out infinite;
}
.spin-fullscreen-overlay .fs-pointer.wobble {
  animation: pointerWobble 0.15s ease;
}
.spin-fullscreen-overlay canvas {
  width: 580px; height: 580px;
  border-radius: 50%;
}
.spin-fullscreen-overlay .fs-pulse1 {
  position: absolute;
  width: 640px; height: 640px; border-radius: 50%;
  border: 2px solid rgba(124,58,237,0.2);
  animation: ringPulse 3s ease-in-out infinite;
}
.spin-fullscreen-overlay .fs-pulse2 {
  position: absolute;
  width: 670px; height: 670px; border-radius: 50%;
  border: 1px solid rgba(6,182,212,0.12);
  animation: ringPulse 3s 1s ease-in-out infinite;
}

/* ═══ SCREEN SHAKE ═══ */
@keyframes screenShake {
  0%,100%{transform:translate(0,0)}
  10%{transform:translate(-3px,2px)}
  20%{transform:translate(4px,-2px)}
  30%{transform:translate(-2px,3px)}
  40%{transform:translate(3px,-1px)}
  50%{transform:translate(-1px,2px)}
  60%{transform:translate(2px,-3px)}
  70%{transform:translate(-4px,1px)}
  80%{transform:translate(1px,-2px)}
  90%{transform:translate(-2px,1px)}
}
body.shaking { animation: screenShake 0.4s ease; }

/* ═══ WINNER FLASH ═══ */
.screen-flash {
  position: fixed; inset: 0;
  background: white; z-index: 195;
  opacity: 0; pointer-events: none;
  animation: flash 0.4s ease-out;
}
@keyframes flash { 0%{opacity:0.8} 30%{opacity:0.4} 100%{opacity:0} }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Tablet & Mobile
   ═══════════════════════════════════════════════════════════ */

/* Tablet landscape */
@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 20px;
    text-align: center;
  }
  .left-panel { align-items: center; }
  .subtitle { margin: 0 auto; }
  .wheel-section { order: -1; }
  .wheel-wrap { width: 380px; height: 380px; }
  canvas#wheel { width: 380px; height: 380px; }
  .atmo-glow { width: 420px; height: 420px; }
  .pulse-ring { width: 400px; height: 400px; }
  .pulse-ring.r2 { width: 420px; height: 420px; }
  .wheel-hero-bg { width: 460px; height: 460px; }
  .pointer-wrap { top: -26px; }
  .pointer-svg { width: 30px; }
  .stats-inner { gap: 18px; padding: 16px 20px; }
  .stat-divider:nth-child(4), .stat:nth-child(5),
  .stat-divider:nth-child(8), .stat:nth-child(9) { display: none; }
}

/* Tablet portrait */
@media (max-width: 768px) {
  nav { padding: 0 16px; height: 56px; }
  .nav-links { display: none; }
  .logo-text { font-size: 18px; }
  main { padding-top: 56px; }

  .hero { padding: 16px; gap: 20px; }
  h1 { font-size: clamp(28px, 6vw, 42px); letter-spacing: -1.5px; }
  .subtitle { font-size: 14px; }

  .wheel-wrap { width: 320px; height: 320px; }
  canvas#wheel { width: 320px; height: 320px; }
  .atmo-glow { width: 360px; height: 360px; }
  .pulse-ring { width: 340px; height: 340px; }
  .pulse-ring.r2 { width: 360px; height: 360px; }
  .wheel-hero-bg { width: 400px; height: 400px; }

  .input-area { padding: 14px; }
  .names-input { height: 90px; font-size: 13px; }
  .settings-bar { padding: 10px 12px; gap: 8px; }
  .setting-divider { display: none; }
  .toggle-opt { font-size: 11px; padding: 4px 8px; }
  .controls-row { flex-wrap: wrap; }
  .spin-btn { font-size: 15px; padding: 14px 20px; }
  .icon-btn { width: 48px; height: 48px; }

  .stats-bar { padding: 0 16px 24px; }
  .stats-inner { gap: 12px; padding: 14px 16px; }
  .stat strong { font-size: 14px; }
  .stat { font-size: 12px; }

  .winner-card { padding: 36px 28px; border-radius: 22px; }
  .winner-name { font-size: clamp(32px, 7vw, 48px); }
  .wc-trophy svg { width: 36px; height: 36px; }

  footer { padding: 14px 16px; flex-direction: column; text-align: center; gap: 8px; }

  /* Fullscreen spin — scale for tablets */
  .spin-fullscreen-overlay canvas { width: 420px; height: 420px; }
  .spin-fullscreen-overlay .atmo-glow-fs { width: 500px; height: 500px; }
  .spin-fullscreen-overlay .fs-pulse1 { width: 470px; height: 470px; }
  .spin-fullscreen-overlay .fs-pulse2 { width: 490px; height: 490px; }
  .spin-fullscreen-overlay .fs-pointer { top: calc(50% - 225px); }
}

/* Mobile */
@media (max-width: 480px) {
  nav { height: 50px; padding: 0 12px; }
  .logo-text { font-size: 16px; }
  main { padding-top: 50px; }

  .hero { padding: 12px; gap: 16px; }
  h1 { font-size: clamp(24px, 7vw, 34px); letter-spacing: -1px; }
  .subtitle { font-size: 13px; line-height: 1.6; }
  .badge { font-size: 10px; padding: 4px 12px; }

  .wheel-wrap { width: 260px; height: 260px; }
  canvas#wheel { width: 260px; height: 260px; }
  .atmo-glow { width: 290px; height: 290px; }
  .pulse-ring { width: 280px; height: 280px; }
  .pulse-ring.r2 { width: 290px; height: 290px; }
  .wheel-hero-bg { width: 320px; height: 320px; }
  .pointer-wrap { top: -22px; }
  .pointer-svg { width: 24px; }

  .input-area { padding: 12px; border-radius: 14px; }
  .input-header { flex-direction: column; gap: 8px; align-items: flex-start; }
  .names-input { height: 80px; font-size: 13px; border-radius: 10px; }
  .settings-bar { border-radius: 12px; padding: 8px 10px; gap: 6px; flex-direction: column; align-items: stretch; }
  .setting-group { justify-content: center; }
  .controls-row { gap: 8px; }
  .spin-btn { font-size: 14px; padding: 12px 16px; border-radius: 12px; }
  .icon-btn { width: 44px; height: 44px; border-radius: 12px; }

  .stats-inner { flex-direction: column; gap: 8px; align-items: flex-start; }
  .stat-divider { display: none; }

  .winner-card { padding: 28px 20px; border-radius: 18px; max-width: 95%; }
  .winner-name { font-size: clamp(28px, 8vw, 40px); }
  .wc-trophy svg { width: 32px; height: 32px; }
  .wc-label { font-size: 9px; letter-spacing: 3px; }
  .wc-divider-line { width: 40px; }
  .winner-actions { flex-direction: column; gap: 8px; }
  .btn-primary, .btn-secondary, .btn-ghost { width: 100%; justify-content: center; }

  /* Fullscreen spin — mobile */
  .spin-fullscreen-overlay canvas { width: 300px; height: 300px; }
  .spin-fullscreen-overlay .atmo-glow-fs { width: 360px; height: 360px; }
  .spin-fullscreen-overlay .fs-pulse1 { width: 340px; height: 340px; }
  .spin-fullscreen-overlay .fs-pulse2 { width: 360px; height: 360px; }
  .spin-fullscreen-overlay .fs-pointer { top: calc(50% - 165px); }
}
