/* ═══════════════════════════════════════════════════════
   GOYGBIV — Design System
   A prismatic, dark, immersive music game UI
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ─── Tokens ─── */
:root {
  /* Rainbow / Prismatic palette (ROYGBIV inspired) */
  --clr-red:     #ff3b5c;
  --clr-orange:  #ff8c42;
  --clr-yellow:  #ffd166;
  --clr-green:   #06d6a0;
  --clr-blue:    #118ab2;
  --clr-indigo:  #6c5ce7;
  --clr-violet:  #a855f7;

  /* Spotify accent */
  --clr-spotify: #1db954;

  /* Surfaces */
  --bg-primary:    #0a0a0f;
  --bg-secondary:  #12121a;
  --bg-card:       rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-glass:      rgba(255, 255, 255, 0.06);
  --bg-glass-border: rgba(255, 255, 255, 0.1);

  /* Text */
  --text-primary:   #f0f0f5;
  --text-secondary: #8888a0;
  --text-muted:     #55556a;

  /* Gradients */
  --grad-rainbow: linear-gradient(135deg, var(--clr-red), var(--clr-orange), var(--clr-yellow), var(--clr-green), var(--clr-blue), var(--clr-indigo), var(--clr-violet));
  --grad-warm:    linear-gradient(135deg, var(--clr-red), var(--clr-orange), var(--clr-yellow));
  --grad-cool:    linear-gradient(135deg, var(--clr-blue), var(--clr-indigo), var(--clr-violet));
  --grad-spotify: linear-gradient(135deg, #1db954, #1ed760);
  --grad-dark:    linear-gradient(180deg, var(--bg-primary) 0%, #0d0d18 100%);

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Radius */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:   0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(168, 85, 247, 0.15);

  /* Transitions */
  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:  150ms;
  --dur-med:   300ms;
  --dur-slow:  500ms;

  /* Typography */
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', 'Inter', system-ui, sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  color: var(--clr-violet);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
  color: var(--clr-indigo);
}

/* ─── Animated Background ─── */
.bg-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--grad-dark);
}

.bg-ambient::before,
.bg-ambient::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.3;
  animation: float 20s ease-in-out infinite;
}

.bg-ambient::before {
  width: 600px;
  height: 600px;
  background: var(--clr-violet);
  top: -200px;
  right: -100px;
  animation-delay: -5s;
}

.bg-ambient::after {
  width: 500px;
  height: 500px;
  background: var(--clr-indigo);
  bottom: -150px;
  left: -100px;
  animation-delay: -10s;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  animation: float 25s ease-in-out infinite;
}

.bg-orb--green {
  width: 400px;
  height: 400px;
  background: var(--clr-green);
  top: 40%;
  left: 60%;
  animation-delay: -8s;
}

.bg-orb--orange {
  width: 350px;
  height: 350px;
  background: var(--clr-orange);
  top: 60%;
  right: 30%;
  animation-delay: -15s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(30px, -40px) scale(1.05); }
  50%      { transform: translate(-20px, 20px) scale(0.95); }
  75%      { transform: translate(15px, 30px) scale(1.02); }
}

/* ─── Layout ─── */
.page-container {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

.page-container--wide {
  max-width: 1200px;
}

.page-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  text-align: center;
}

/* ─── Logo ─── */
.logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3rem, 8vw, 5rem);
  background: var(--grad-rainbow);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.08em;
  animation: shimmer 8s ease-in-out infinite;
  user-select: none;
  cursor: default;
}

.logo--sm {
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: 0.06em;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.tagline {
  font-family: var(--font-display);
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 400;
  margin-top: var(--space-sm);
  letter-spacing: 0.04em;
}

/* ─── Glassmorphism Card ─── */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  transition: all var(--dur-med) var(--ease-out);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.glass-card--static:hover {
  background: var(--bg-glass);
  border-color: var(--bg-glass-border);
  box-shadow: var(--shadow-md);
}

.glass-card--compact {
  padding: var(--space-lg);
}

/* ─── Typography ─── */
.heading-xl {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  color: var(--text-primary);
}

.heading-lg {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.3;
  color: var(--text-primary);
}

.heading-md {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.text-body {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.text-sm {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.text-gradient {
  background: var(--grad-rainbow);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 6s ease-in-out infinite;
}

.text-spotify {
  color: var(--clr-spotify);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-out);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.1), rgba(255,255,255,0));
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.btn:hover::before {
  opacity: 1;
}

.btn:active {
  transform: scale(0.97);
}

.btn--spotify {
  background: var(--grad-spotify);
  color: #000;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(29, 185, 84, 0.3);
}

.btn--spotify:hover {
  box-shadow: 0 6px 30px rgba(29, 185, 84, 0.5);
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--grad-cool);
  color: #fff;
  box-shadow: 0 4px 20px rgba(108, 92, 231, 0.3);
}

.btn--primary:hover {
  box-shadow: 0 6px 30px rgba(108, 92, 231, 0.5);
  transform: translateY(-2px);
}

.btn--rainbow {
  background: var(--grad-rainbow);
  background-size: 300% 100%;
  color: #fff;
  font-weight: 700;
  animation: shimmer 4s ease-in-out infinite;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
}

.btn--rainbow:hover {
  box-shadow: 0 6px 30px rgba(168, 85, 247, 0.5);
  transform: translateY(-2px);
}

.btn--outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--bg-glass-border);
}

.btn--outline:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
}

.btn--ghost:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.btn--sm {
  font-size: 0.8rem;
  padding: 0.5rem 1.25rem;
}

.btn--lg {
  font-size: 1.1rem;
  padding: 1rem 2.5rem;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── Form Controls ─── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  width: 100%;
}

.form-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-input {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--dur-fast) var(--ease-out);
  outline: none;
}

.form-input:focus {
  border-color: var(--clr-violet);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* Toggle Group (for radio-style options) */
.toggle-group {
  display: flex;
  gap: var(--space-xs);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 4px;
  border: 1px solid var(--bg-glass-border);
}

.toggle-option {
  flex: 1;
  padding: 0.6rem 1rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  text-align: center;
}

.toggle-option:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.toggle-option.active {
  background: var(--clr-indigo);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* Checkbox Cards */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-sm);
}

.checkbox-card {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1.5px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  user-select: none;
}

.checkbox-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.checkbox-card.checked {
  border-color: var(--clr-violet);
  background: rgba(168, 85, 247, 0.1);
}

.checkbox-card__indicator {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease-out);
  flex-shrink: 0;
}

.checkbox-card.checked .checkbox-card__indicator {
  background: var(--clr-violet);
  border-color: var(--clr-violet);
}

.checkbox-card.checked .checkbox-card__indicator::after {
  content: '✓';
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}

.checkbox-card__label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.checkbox-card.checked .checkbox-card__label {
  color: var(--text-primary);
}

/* ─── Player Card ─── */
.player-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  transition: all var(--dur-med) var(--ease-out);
}

.player-card:hover {
  background: var(--bg-card-hover);
}

.player-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--grad-cool);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-info {
  flex: 1;
  min-width: 0;
}

.player-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.player-badge--host {
  background: rgba(255, 209, 102, 0.15);
  color: var(--clr-yellow);
}

.player-badge--premium {
  background: rgba(29, 185, 84, 0.15);
  color: var(--clr-spotify);
}

/* ─── Vote Card (clickable player during voting) ─── */
.vote-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 2px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-spring);
  user-select: none;
}

.vote-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-lg);
}

.vote-card.selected {
  border-color: var(--clr-violet);
  background: rgba(168, 85, 247, 0.12);
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.2);
  transform: translateY(-4px) scale(1.02);
}

.vote-card.correct {
  border-color: var(--clr-green);
  background: rgba(6, 214, 160, 0.12);
  box-shadow: 0 0 30px rgba(6, 214, 160, 0.2);
}

.vote-card.wrong {
  border-color: var(--clr-red);
  background: rgba(255, 59, 92, 0.12);
  box-shadow: 0 0 30px rgba(255, 59, 92, 0.2);
}

.vote-card__avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--grad-cool);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: #fff;
  overflow: hidden;
  transition: all var(--dur-med) var(--ease-out);
}

.vote-card.selected .vote-card__avatar {
  box-shadow: 0 0 0 3px var(--clr-violet);
}

.vote-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vote-card__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.vote-card__result {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  opacity: 0;
  transform: scale(0.8);
  transition: all var(--dur-med) var(--ease-spring);
}

.vote-card__result.visible {
  opacity: 1;
  transform: scale(1);
}

.vote-card__result--correct {
  background: rgba(6, 214, 160, 0.2);
  color: var(--clr-green);
}

.vote-card__result--wrong {
  background: rgba(255, 59, 92, 0.2);
  color: var(--clr-red);
}

.vote-card__result--owns {
  background: rgba(29, 185, 84, 0.2);
  color: var(--clr-spotify);
}

/* ─── Now Playing ─── */
.now-playing {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-xl);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-lg);
}

.now-playing__art {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
  position: relative;
}

.now-playing__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.now-playing__art--spinning {
  border-radius: var(--radius-full);
  animation: spin-vinyl 4s linear infinite;
}

@keyframes spin-vinyl {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.now-playing__info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.now-playing__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-playing__artist {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 2px;
}

.now-playing__album {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

/* ─── Timer Bar ─── */
.timer-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-card);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: var(--space-md) 0;
}

.timer-bar__fill {
  height: 100%;
  background: var(--grad-rainbow);
  background-size: 300% 100%;
  animation: shimmer 2s linear infinite;
  border-radius: var(--radius-full);
  transition: width 1s linear;
}

.timer-bar__fill--danger {
  background: var(--clr-red);
}

/* ─── Scoreboard ─── */
.scoreboard {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.scoreboard__entry {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  transition: all var(--dur-fast) var(--ease-out);
}

.scoreboard__entry:first-child {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.scoreboard__rank {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 24px;
  text-align: center;
}

.scoreboard__entry:first-child .scoreboard__rank {
  color: var(--clr-violet);
}

.scoreboard__name {
  flex: 1;
  font-weight: 500;
  font-size: 0.9rem;
}

.scoreboard__score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--clr-violet);
}

.scoreboard__delta {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  animation: pop-in var(--dur-med) var(--ease-spring);
}

.scoreboard__delta--positive {
  color: var(--clr-green);
  background: rgba(6, 214, 160, 0.15);
}

.scoreboard__delta--negative {
  color: var(--clr-red);
  background: rgba(255, 59, 92, 0.15);
}

@keyframes pop-in {
  0%   { transform: scale(0); opacity: 0; }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* ─── Invite URL ─── */
.invite-box {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  padding-left: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-full);
  width: 100%;
  max-width: 500px;
}

.invite-box__url {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-box__copy {
  flex-shrink: 0;
}

/* ─── Loading States ─── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-card);
  border-top-color: var(--clr-violet);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-out);
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.loading-text {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text-secondary);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ─── Round Counter ─── */
.round-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 14px;
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ─── Game Phase Indicators ─── */
.phase-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-align: center;
  animation: fade-slide-in var(--dur-med) var(--ease-out);
}

@keyframes fade-slide-in {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ─── Toast / Notification ─── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-secondary);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.9rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  transition: all var(--dur-med) var(--ease-spring);
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Confetti / Winner ─── */
.winner-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease-out);
}

.winner-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.winner-crown {
  font-size: 4rem;
  animation: bounce 1s var(--ease-spring) infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-15px); }
}

.winner-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 6vw, 3.5rem);
  background: var(--grad-rainbow);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s ease-in-out infinite;
}

.winner-score {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--text-secondary);
}

.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 160;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ─── Settings Summary ─── */
.settings-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.settings-pill {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.75rem;
  padding: 4px 12px;
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

/* ─── Section Spacing ─── */
.section {
  width: 100%;
  margin-top: var(--space-2xl);
}

.section:first-child {
  margin-top: 0;
}

.section__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
}

/* ─── Player List ─── */
.player-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
}

/* ─── Vote Grid ─── */
.vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-md);
  width: 100%;
}

/* ─── Game Layout ─── */
.game-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-xl);
  width: 100%;
  align-items: start;
}

.game-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
}

.game-sidebar {
  position: sticky;
  top: var(--space-xl);
}

/* ─── Utility ─── */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.gap-xs  { gap: var(--space-xs); }
.gap-sm  { gap: var(--space-sm); }
.gap-md  { gap: var(--space-md); }
.gap-lg  { gap: var(--space-lg); }
.gap-xl  { gap: var(--space-xl); }
.gap-2xl { gap: var(--space-2xl); }

.w-full  { width: 100%; }
.mt-sm   { margin-top: var(--space-sm); }
.mt-md   { margin-top: var(--space-md); }
.mt-lg   { margin-top: var(--space-lg); }
.mt-xl   { margin-top: var(--space-xl); }
.mt-2xl  { margin-top: var(--space-2xl); }

.text-center { text-align: center; }

.hidden { display: none !important; }

.fade-in {
  animation: fade-slide-in var(--dur-med) var(--ease-out);
}

/* ─── Device Selector ─── */
.device-selector {
  width: 100%;
}

.device-selector select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238888a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.device-selector select:focus {
  border-color: var(--clr-violet);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.device-selector select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

  .game-sidebar {
    position: static;
    order: -1;
  }

  .now-playing {
    flex-direction: column;
    text-align: center;
  }

  .now-playing__info {
    text-align: center;
  }

  .vote-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .toggle-group {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .page-container {
    padding: var(--space-md);
  }

  .glass-card {
    padding: var(--space-lg);
  }

  .vote-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  .now-playing__art {
    width: 80px;
    height: 80px;
  }
}

/* ─── No-Premium Banner ─── */
.premium-banner {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 140, 66, 0.1);
  border: 1px solid rgba(255, 140, 66, 0.2);
  border-radius: var(--radius-md);
  color: var(--clr-orange);
  font-size: 0.8rem;
  text-align: center;
  font-weight: 500;
}
