/*
 * site.css
 * Master stylesheet for the Songs Guessing Game ("מי שר?").
 * Contains design tokens, global styles, shared components,
 * and styles for all 8 game screens.
 *
 * Design system: "Hot Pink Professional"
 *   - Background: #fafafa
 *   - Primary: #e91e63 (hot pink)
 *   - Font: Rubik (Hebrew + Latin)
 *   - RTL layout
 */

/* ═══════════════════════════════════════════════════
   Design tokens
   ═══════════════════════════════════════════════════ */

:root {
  /* Primary colors */
  --color-primary: #e91e63;
  --color-primary-dark: #c2185b;
  --color-primary-light: rgba(233, 30, 99, 0.15);
  --color-primary-bg: #fce4ec;
  --color-primary-border: #f8bbd0;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #e91e63, #c2185b);
  --gradient-primary-shadow: rgba(233, 30, 99, 0.3);

  /* Background / surface */
  --color-bg: #fafafa;
  --color-card: #fff;
  --color-card-border: #f0f0f0;
  --color-input-bg: #f8f8f8;

  /* Text */
  --color-text-primary: #222;
  --color-text-secondary: #555;
  --color-text-muted: #999;

  /* Semantic colors */
  --color-success: #2e7d32;
  --color-success-bg: #e8f5e9;
  --color-error: #c62828;
  --color-error-bg: #ffebee;
  --color-info: #1565c0;
  --color-info-bg: #e3f2fd;

  /* Accent colors */
  --color-purple-dark: #6a1b9a;
  --color-purple-bg: #f3e5f5;
  --color-green-dark: #2e7d32;
  --color-green-bg: #e8f5e9;

  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 6px 30px rgba(0, 0, 0, 0.08);
}

/* ═══════════════════════════════════════════════════
   Global reset & body
   ═══════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  font-family: 'Rubik', sans-serif;
  background: var(--color-bg);
  color: var(--color-text-primary);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════
   Screen container (shared across all screens)
   ═══════════════════════════════════════════════════ */

.screen {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.screen-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem 1.5rem;
}

/* ═══════════════════════════════════════════════════
   Decorative circles (pink background decorations)
   ═══════════════════════════════════════════════════ */

.deco {
  display: none;
}

.deco-1 { width: 160px; height: 160px; background: rgba(233,30,99,0.05); top: -40px; right: -40px; }
.deco-2 { width: 100px; height: 100px; background: rgba(233,30,99,0.04); top: 50px; right: 50px; }
.deco-3 { width: 200px; height: 200px; border: 2px solid rgba(233,30,99,0.05); bottom: -50px; left: -70px; }
.deco-4 { width: 80px; height: 80px; background: rgba(233,30,99,0.03); bottom: 120px; right: 20px; }

/* ═══════════════════════════════════════════════════
   Shared button styles
   ═══════════════════════════════════════════════════ */

.btn-primary {
  width: 100%;
  max-width: 20rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--gradient-primary);
  color: #fff;
  font-family: 'Rubik', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 16px var(--gradient-primary-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--gradient-primary-shadow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: #fff;
}

.btn-outline {
  width: 100%;
  max-width: 20rem;
  padding: 0.875rem 1.5rem;
  border: 2px solid #e0e0e0;
  border-radius: var(--radius-pill);
  background: var(--color-card);
  color: var(--color-text-primary);
  font-family: 'Rubik', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.btn-outline:hover {
  border-color: #ccc;
  background: #f9f9f9;
}

.btn-outline svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: var(--color-text-secondary);
}

/* ═══════════════════════════════════════════════════
   Quit button (X in top-left)
   ═══════════════════════════════════════════════════ */

.quit-btn {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.quit-btn:hover { background: rgba(0, 0, 0, 0.1); }
.quit-btn svg { width: 0.875rem; height: 0.875rem; fill: #999; }

/* ═══════════════════════════════════════════════════
   Quit Confirmation Dialog (Friendly Style)
   ═══════════════════════════════════════════════════ */

.quit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
  animation: quit-fade-in 0.2s ease-out;
}

@keyframes quit-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes quit-slide-up {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.quit-dialog {
  background: #fff;
  border-radius: 20px;
  padding: 1.5rem 1.25rem;
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  animation: quit-slide-up 0.25s ease-out;
}

.quit-dialog-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: #fef0f4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quit-dialog-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: var(--color-primary);
}

.quit-dialog-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-text-primary);
}

.quit-dialog-text {
  font-size: 0.75rem;
  color: #888;
  text-align: center;
  line-height: 1.6;
}

.quit-dialog-buttons {
  display: flex;
  gap: 0.625rem;
  width: 100%;
}

.quit-btn-stay,
.quit-btn-exit {
  flex: 1;
  padding: 0.625rem;
  border-radius: 12px;
  border: none;
  font-family: 'Rubik', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

.quit-btn-stay:active,
.quit-btn-exit:active {
  transform: scale(0.97);
}

.quit-btn-stay {
  background: var(--gradient-primary);
  color: #fff;
}

.quit-btn-exit {
  background: #fff;
  color: #c0392b;
  border: 1.5px solid #c0392b;
}

/* ═══════════════════════════════════════════════════
   Card component
   ═══════════════════════════════════════════════════ */

.card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-border);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  width: 100%;
}

/* ═══════════════════════════════════════════════════
   Section label (icon + text)
   ═══════════════════════════════════════════════════ */

.section-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-primary);
  align-self: flex-start;
  margin-bottom: -0.5rem;
}

.section-label svg {
  width: 1rem;
  height: 1rem;
  fill: var(--color-primary);
}

/* ═══════════════════════════════════════════════════
   Mini scoreboard (bottom of screens)
   ═══════════════════════════════════════════════════ */

.mini-scoreboard {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-border);
  box-shadow: var(--shadow-sm);
  padding: 0.875rem 1.125rem;
}

.mini-sb-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.mini-sb-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #555;
}

.mini-sb-score {
  font-size: 1.75rem;
  font-weight: 900;
  color: #333;
}

.mini-sb-active .mini-sb-name { color: var(--color-primary); }
.mini-sb-active .mini-sb-score { color: var(--color-primary); }

.mini-sb-divider {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #ccc;
  padding: 0 0.5rem;
}

/* ═══════════════════════════════════════════════════
   Top bar (round badge + team badge) — shared
   ═══════════════════════════════════════════════════ */

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.5rem;
}

.round-badge {
  background: var(--color-card);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3125rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid #eee;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.round-badge-text { color: var(--color-text-muted); }
.round-badge-num { color: var(--color-primary); font-weight: 800; }

.team-badge {
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3125rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-primary-border);
  display: flex;
  align-items: center;
  gap: 0.3125rem;
}

.team-badge svg {
  width: 0.875rem;
  height: 0.875rem;
  fill: var(--color-primary);
}

/* ═══════════════════════════════════════════════════
   Equalizer animation
   ═══════════════════════════════════════════════════ */

.equalizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 2rem;
}

.equalizer.eq-large {
  height: 3rem;
  gap: 4px;
}

.eq-bar {
  width: 4px;
  border-radius: 2px;
  background: var(--color-primary);
  animation: eq-bounce 0.8s ease-in-out infinite alternate;
}

.eq-large .eq-bar { width: 5px; border-radius: 3px; }

@keyframes eq-bounce {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1); }
}

/* Equalizer — mockup style (used on home + song playing) */
@keyframes eq { 0%,100%{transform:scaleY(.35)} 50%{transform:scaleY(1)} }
.eq { display: flex; align-items: flex-end; gap: 5px; height: 36px; }
.eq .b { width: 6px; border-radius: 4px; animation: eq 1.3s ease-in-out infinite; }
.eq .b:nth-child(odd) { background: #e91e63; }
.eq .b:nth-child(even) { background: #f48fb1; }

/* Larger equalizer for song playing */
.eq-large { height: 56px; gap: 6px; }
.eq-large .b { width: 8px; border-radius: 5px; }

/* ═══════════════════════════════════════════════════
   Animations
   ═══════════════════════════════════════════════════ */

@keyframes ring-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.06); opacity: 1; }
}

@keyframes card-appear {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes trophy-pop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes name-pop {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════
   Screen 1 — Home
   ═══════════════════════════════════════════════════ */

.home-screen .screen-content {
  justify-content: center;
  gap: 2rem;
}

/* Vinyl record logo — spinning disc with title in the center label */
.home-vinyl {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    #444 0%, #222 30%, #333 31%, #1a1a1a 60%, #333 61%, #222 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 8px 30px rgba(0,0,0,0.35), inset 0 0 30px rgba(0,0,0,0.3);
}

/* Center label — pink disc */
.home-vinyl::before {
  content: '';
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(145deg, #e91e63, #c2185b);
  position: absolute;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.3);
}

/* Center hole */
.home-vinyl::after {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1a1a1a;
  position: absolute;
}

/* Title text on vinyl center */
.home-vinyl-text {
  position: absolute;
  font-size: 1.25rem;
  font-weight: 900;
  color: #fff;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  letter-spacing: 1px;
}

/* Hebrew slogan below vinyl */
.home-logo-slogan {
  font-size: 0.8125rem;
  color: #ad1457;
  text-align: center;
  letter-spacing: 2px;
  font-weight: 700;
}

.home-subtitle {
  font-size: 0.9375rem;
  color: #888;
  text-align: center;
  font-weight: 400;
  margin-top: -0.5rem;
}

/* ═══════════════════════════════════════════════════
   Screen 2 — Game Setup
   Matches approved mockup: screen_02_game_setup.html
   ═══════════════════════════════════════════════════ */

/* Header */
.setup-header {
  padding: 3rem 1.5rem 0.5rem; /* top padding clears the absolute quit button */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.setup-header-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #222;
}

/* Header actions row — side-by-side reset buttons */
.setup-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Reset defaults pill button */
.reset-defaults-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  font-family: 'Rubik', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  transition: all 0.15s ease;
}
.reset-defaults-pill svg {
  width: 13px;
  height: 13px;
  fill: #999;
}
.reset-defaults-pill:hover,
.reset-defaults-pill:active {
  border-color: #f48fb1;
  color: #e91e63;
}
.reset-defaults-pill:hover svg,
.reset-defaults-pill:active svg {
  fill: #e91e63;
}

/* Reset memory pill button — clears played songs/artists cookies */
.reset-memory-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  font-family: 'Rubik', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  transition: all 0.15s ease;
}
.reset-memory-pill svg {
  width: 13px;
  height: 13px;
  fill: #999;
}
.reset-memory-pill:hover,
.reset-memory-pill:active {
  border-color: #ffb74d;
  color: #ef6c00;
}
.reset-memory-pill:hover svg,
.reset-memory-pill:active svg {
  fill: #ef6c00;
}

/* Inline feedback text below reset buttons */
.reset-feedback {
  font-size: 0.75rem;
  font-weight: 600;
  color: #4caf50;
  min-height: 1rem;
  transition: opacity 0.3s ease;
}

/* Scrollable form area */
.setup-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

/* Input card (white card container for form sections) */
.input-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  border: 1px solid #f0f0f0;
}

/* Two-column side-by-side inputs */
.input-row { display: flex; gap: 10px; }
.input-col { flex: 1; }
.input-label-mini {
  font-size: 10px;
  font-weight: 600;
  color: #999;
  margin-bottom: 4px;
  display: block;
}

/* Text input matching mockup */
.text-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid #e8e8e8;
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  color: #333;
  background: #fafafa;
  outline: none;
  direction: rtl;
}
.text-input::placeholder { color: #bbb; }
.text-input:focus { border-color: #f48fb1; background: #fff; }

/* Language chip group */
.chip-group { display: flex; gap: 8px; }
.chip {
  flex: 1;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1.5px solid #e8e8e8;
  background: #fff;
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #888;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip.active {
  background: linear-gradient(135deg, #e91e63, #c2185b);
  border-color: #e91e63;
  color: #fff;
  box-shadow: 0 3px 10px rgba(233,30,99,0.2);
}

/* Year range — Stacked rows with dual-handle slider (Option C — Bubble) */
.range-stack { display: flex; flex-direction: column; gap: 10px; }
.range-row {
  background: #fafafa;
  border-radius: 12px;
  padding: 14px 16px 10px 30px;
  border: 1px solid #f0f0f0;
  position: relative;
}
.range-row-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.range-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #e91e63;
  color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.range-row-spacer { flex: 1; }
.remove-range-btn {
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 1.5px solid #e0e0e0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  position: absolute;
  top: -10px;
  left: -10px;
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.remove-range-btn svg { width: 12px; height: 12px; fill: #999; }
.add-range-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; border-radius: 12px;
  border: 1.5px dashed #e0e0e0;
  background: #fff; cursor: pointer;
  font-family: 'Rubik', sans-serif;
  font-size: 12px; font-weight: 600; color: #999;
  transition: all 0.15s; margin-top: 8px;
}
.add-range-btn svg { width: 16px; height: 16px; fill: #999; }

/* ═══════════════════════════════════════════════════
   Dual-handle year range slider (Option C — Bubbles)
   Two draggable thumbs with floating bubble labels,
   connected by a pink fill on the track.
   ═══════════════════════════════════════════════════ */

/* Slider container — enough top padding for bubbles, side padding for dots */
.year-slider-container {
  position: relative;
  padding: 52px 20px 0;
}

/* Track base */
.year-slider-track {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: #eee;
  cursor: pointer;
}

/* Pink fill between the two thumbs */
.year-slider-fill {
  position: absolute;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #f48fb1, #e91e63);
  pointer-events: none;
}

/* Thumb dot — small solid pink circle on the track */
.year-slider-thumb {
  position: absolute;
  top: 50%;
  transform: translate(50%, -50%);
  /* 44px hit area for easy touch/click, transparent padding around the 20px dot */
  width: 44px; height: 44px;
  cursor: grab;
  z-index: 3;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.year-slider-thumb-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #e91e63;
  box-shadow: 0 2px 8px rgba(233, 30, 99, 0.4);
  transition: transform 0.1s;
}
.year-slider-thumb:active .year-slider-thumb-dot,
.year-slider-thumb.dragging .year-slider-thumb-dot {
  transform: scale(1.2);
}
/* When thumbs are close, "to" thumb sits above "from" by default.
   The active/dragging thumb always goes on top so it's grabbable. */
.year-slider-thumb-to { z-index: 4; }
.year-slider-thumb.dragging { z-index: 6; }

/* Bubble floating above each thumb */
.year-slider-bubble {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #e91e63, #c2185b);
  color: #fff;
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  z-index: 4;
}
/* Bubble triangle pointer */
.year-slider-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #c2185b;
}
/* Label text inside bubble ("משנת" / "עד שנת") */
.year-slider-bubble-label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  line-height: 1;
  margin-bottom: 1px;
}

/* Merged bubble — shown when from/to thumbs are close together to prevent overlap */
.year-slider-merged-bubble {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #e91e63, #c2185b);
  color: #fff;
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
}
.year-slider-merged-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #c2185b;
}
.year-slider-merged-sep {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.7;
}

/* Edge labels (1950 / current year) below track */
.year-slider-edges {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  padding: 0 2px;
}
.year-slider-edge-label {
  font-size: 11px;
  font-weight: 700;
  color: #bbb;
}

/* Error state — red border on the range row + shake */
.range-row.range-error {
  border-color: #d32f2f;
  animation: dropdown-shake 0.4s ease;
}

@keyframes dropdown-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Validation error message shown below the range row */
.year-range-error {
  font-size: 12px;
  font-weight: 600;
  color: #d32f2f;
  text-align: center;
  padding: 4px 0;
  animation: dropdown-shake 0.4s ease;
}

/* Slider — Ringed Thumb (matches mockup Option C) */
.slider-wrap {
  display: flex; align-items: center; gap: 10px;
}
.slider-range-label {
  font-size: 12px; font-weight: 700; color: #bbb;
  min-width: 44px; text-align: center; flex-shrink: 0;
}
.slider-track {
  flex: 1; height: 6px; border-radius: 3px;
  background: #eee; position: relative; cursor: pointer;
}
.slider-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #e91e63, #f48fb1);
  width: 33%; pointer-events: none;
}
.slider-thumb-wrap {
  position: absolute; top: 50%; right: 33%;
  transform: translate(50%, -50%);
  /* 48px hit area for easy touch/click on the circle */
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  cursor: grab;
  touch-action: none;
  z-index: 2;
}
.slider-thumb-ring {
  position: absolute; width: 100%; height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(233,30,99,0.2);
}
.slider-thumb-inner {
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 2.5px solid #e91e63;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #e91e63;
  z-index: 1;
}

/* Timer section */
.timer-row { display: flex; gap: 8px; align-items: center; }
/* Timer slider reuses the shared .slider-* classes from the rounds slider */
.timer-label { font-size: 13px; color: #888; }
.timer-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #999; cursor: pointer;
}
.toggle-track {
  width: 36px; height: 20px; border-radius: 10px;
  background: #e91e63; position: relative; cursor: pointer;
}
.toggle-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; position: absolute; top: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  left: 18px; transition: left 0.2s ease;
}

/* Advanced section toggle */
.advanced-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: #fff; border-radius: 14px;
  border: 1.5px dashed #e0e0e0; cursor: pointer;
}
.advanced-toggle-text { font-size: 13px; font-weight: 700; color: #e91e63; }
.advanced-toggle svg { width: 18px; height: 18px; fill: #e91e63; }
.advanced-toggle .advanced-chevron { transition: transform 0.2s ease; }

/* ═══════════════════════════════════════════════════
   Advanced Filter — Genre / Artist Section
   ═══════════════════════════════════════════════════ */

.advanced-section {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #f0f0f0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Filter mode tabs (genre / artist) ── */
.filter-mode-tabs {
  display: flex;
  gap: 8px;
}
.filter-mode-tab {
  flex: 1;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1.5px solid #e8e8e8;
  background: #fff;
  font-family: 'Rubik', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
}
.filter-mode-tab svg {
  width: 14px;
  height: 14px;
  fill: #888;
}
.filter-mode-tab.active {
  background: linear-gradient(135deg, #e91e63, #c2185b);
  border-color: #e91e63;
  color: #fff;
  box-shadow: 0 3px 10px rgba(233,30,99,0.2);
}
.filter-mode-tab.active svg {
  fill: #fff;
}

/* ── Genre chips grid ── */
.genre-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.genre-chip {
  padding: 7px 12px;
  border-radius: 20px;
  border: 1.5px solid #e8e8e8;
  background: #fafafa;
  font-family: 'Rubik', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  transition: all 0.15s ease;
}
.genre-chip.selected {
  background: #fef0f4;
  border-color: #f48fb1;
  color: #e91e63;
}

/* ── Artist Search ── */
.artist-search-wrap {
  position: relative;
}

.artist-search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  fill: #bbb;
  pointer-events: none;
}

.artist-search-input {
  width: 100%;
  padding: 10px 40px 10px 14px;
  border-radius: 12px;
  border: 1.5px solid #e0e0e0;
  background: #fafafa;
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  outline: none;
  transition: border-color 0.15s ease;
}

.artist-search-input:focus {
  border-color: var(--color-primary);
}

.artist-search-input::placeholder {
  color: #bbb;
}

/* Autocomplete dropdown */
.artist-autocomplete {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  margin-top: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.artist-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.1s ease;
  border-bottom: 1px solid #f5f5f5;
}

.artist-result:last-child {
  border-bottom: none;
}

.artist-result:hover {
  background: #fef0f4;
}

.artist-result-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.artist-result-img-placeholder {
  background: #eee;
}

.artist-result-info {
  flex: 1;
  min-width: 0;
}

.artist-result-name {
  font-size: 13px;
  font-weight: 700;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artist-result-genres {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artist-result-add {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--color-primary);
  background: #fff;
  color: var(--color-primary);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.artist-result-add:hover {
  background: var(--color-primary);
  color: #fff;
}

/* Selected artist tags */
.artist-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.artist-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 20px;
  background: #fef0f4;
  border: 1px solid #f8d0dc;
}

.artist-tag-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
}

.artist-tag-remove {
  background: none;
  border: none;
  color: #c2185b;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.artist-tag-remove:hover {
  color: #880e4f;
}

/* Start button */
.start-btn {
  width: 100%; padding: 16px; border: none; border-radius: 50px;
  font-family: 'Rubik', sans-serif; font-size: 19px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #e91e63, #c2185b);
  box-shadow: 0 4px 16px rgba(233,30,99,0.3);
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 4px;
}
.start-btn svg { width: 24px; height: 24px; fill: #fff; }

/* ═══════════════════════════════════════════════════
   Screen 3 — Loading
   ═══════════════════════════════════════════════════ */

.loading-screen .screen-content {
  justify-content: center;
  gap: 1.5rem;
}

.loading-icon {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(233, 30, 99, 0.25);
  animation: icon-pulse 2s ease-in-out infinite;
  z-index: 1;
}

@keyframes icon-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.loading-icon svg { width: 2.5rem; height: 2.5rem; fill: #fff; }

.loading-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(233, 30, 99, 0.15);
  width: 5rem; height: 5rem;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(1);
  animation: ring-expand 2s ease-out infinite;
}

@keyframes ring-expand {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}

.loading-icon-wrap {
  position: relative;
  width: 5rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-ring:nth-child(2) { animation-delay: 0.6s; }
.loading-ring:nth-child(3) { animation-delay: 1.2s; }

/* Stops all loading animations when an error occurs */
.loading-icon-wrap.loading-stopped .loading-ring { animation: none; opacity: 0; }
.loading-icon-wrap.loading-stopped .loading-icon { animation: none; }

.loading-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.loading-progress-bar {
  width: 100%;
  max-width: 16rem;
  height: 0.5rem;
  background: #eee;
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.loading-progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

.loading-progress-text {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* Loading steps */
.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: 100%;
  max-width: 18rem;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
}

.loading-step-active {
  border-color: var(--color-primary-border);
  background: #fff5f8;
}

.loading-step-done {
  border-color: #c8e6c9;
  background: var(--color-success-bg);
}

.loading-step-icon {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-step-done .loading-step-icon {
  background: var(--color-success);
}

/* Note: svg sizing/fill for step icons is handled via .loading-step-svg-check / .loading-step-svg-spinner */

.loading-step-active .loading-step-icon {
  background: var(--color-primary);
}

/* Spinner rotation for active step — counterclockwise to match the arrow direction */
@keyframes step-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

/* Show spinner in active state, check in done state, hide both in pending */
.loading-step-svg-check,
.loading-step-svg-spinner {
  width: 0.875rem;
  height: 0.875rem;
  fill: #fff;
}

/* By default hide both */
.loading-step-svg-check { display: none; }
.loading-step-svg-spinner { display: none; }

/* Active: show spinning arrows */
.loading-step-active .loading-step-svg-spinner {
  display: block;
  animation: step-spin 1.2s linear infinite;
}

/* Done: show checkmark (white on green bg), hide spinner */
.loading-step-done .loading-step-svg-check {
  display: block;
  fill: #fff;
}
.loading-step-done .loading-step-svg-spinner {
  display: none !important;
}

/* Pending: show checkmark (grey, via icon background) */
.loading-step-pending .loading-step-svg-check {
  display: block;
  fill: #ccc;
}
.loading-step-pending .loading-step-svg-spinner {
  display: none;
}

.loading-step-pending .loading-step-icon {
  background: #eee;
}

.loading-step-text {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

/* ═══════════════════════════════════════════════════
   Screen 4 — Round Start
   ═══════════════════════════════════════════════════ */

.round-start-screen .screen-content {
  justify-content: center;
  gap: 1.25rem;
}

.rs-round-badge {
  background: var(--color-card);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.375rem 1rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid #eee;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.rs-round-badge-text { color: var(--color-text-muted); }
.rs-round-badge-num { color: var(--color-primary); font-weight: 800; }

.rs-team-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--gradient-primary-shadow);
}

.rs-team-icon svg { width: 2rem; height: 2rem; fill: #fff; }

.rs-turn-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.rs-team-name {
  font-size: 2.125rem;
  font-weight: 900;
  color: var(--color-primary);
  text-shadow: 0 2px 8px rgba(233, 30, 99, 0.15);
  text-align: center;
  word-break: break-word;
  animation: name-pop 0.5s ease-out;
}

@keyframes name-pop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.rs-hint-badge {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.75rem;
  background: #fef0f4;
  border: 1px solid #f8d0dc;
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-primary);
}

.rs-hint-badge svg {
  width: 0.75rem;
  height: 0.75rem;
  fill: var(--color-primary);
}

/* Progress dots */
.rs-progress-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  width: 100%;
}

.rs-progress-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.rs-progress-dots {
  display: flex;
  gap: 0.3125rem;
  flex-wrap: wrap;
  justify-content: center;
}

.rs-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: #e0e0e0;
}

.rs-dot-done { background: #e91e63; }
.rs-dot-done-b { background: #ff9800; }
.rs-dot-current {
  width: 0.75rem;
  height: 0.75rem;
  border: 2.5px solid var(--color-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.15);
}

/* ═══════════════════════════════════════════════════
   Screen 5 — Song Playing
   ═══════════════════════════════════════════════════ */

.song-playing-screen .screen-content {
  gap: 1rem;
  justify-content: center;
  padding-top: 3rem; /* clear the absolute quit button */
}

/* Timer circle */
.sp-timer-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sp-timer-svg {
  transform: rotate(0);
}

.sp-timer-track { stroke: #eee; }
.sp-timer-progress {
  stroke: var(--color-primary);
  transition: stroke-dashoffset 1s linear;
}

.sp-timer-text {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sp-timer-number {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--color-primary);
}

.sp-timer-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-top: -0.25rem;
}

.sp-listening-text {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
}

/* Tap-to-play overlay — shown when autoplay is blocked (iOS/Safari) */
.sp-tap-play-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(233,30,99,0.35);
  animation: sp-tap-pulse 1.5s ease-in-out infinite;
}
.sp-tap-play-text {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-primary);
}
@keyframes sp-tap-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(233,30,99,0.35); }
  50% { transform: scale(1.08); box-shadow: 0 6px 28px rgba(233,30,99,0.5); }
}

.sp-hint-text {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-align: center;
}

/* Phase 2: plain text warning + reveal button */
.sp-reveal-warning-text {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-align: center;
}

.sp-reveal-btn {
  width: 100%;
  max-width: 20rem;
  padding: 0.875rem 1.5rem;
  border: 2px solid var(--color-primary-border);
  border-radius: var(--radius-pill);
  background: var(--color-card);
  color: var(--color-primary);
  font-family: 'Rubik', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.sp-reveal-btn:hover {
  background: #fff5f8;
}

/* Replay button — circular icon button next to timer (phase 2 only) */
.sp-timer-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.sp-replay-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sp-replay-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--color-primary-border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}

.sp-replay-btn:hover {
  background: #fff0f3;
}

.sp-replay-btn:active {
  transform: scale(0.92);
}

.sp-replay-btn svg {
  width: 20px;
  height: 20px;
  fill: var(--color-primary);
}

.sp-replay-label {
  font-size: 0.7rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-top: 0.15rem;
  text-align: center;
}

/* Replace song button — circular icon button next to timer (orange accent) */
.sp-replace-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sp-replace-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #ffe0b2;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}

.sp-replace-btn:hover {
  background: #fff8e1;
}

.sp-replace-btn:active {
  transform: scale(0.92);
}

.sp-replace-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sp-replace-btn svg {
  width: 20px;
  height: 20px;
  fill: #ef6c00;
  transition: transform 0.3s ease;
}

.sp-replace-btn.sp-replace-loading svg {
  animation: sp-replace-spin 0.8s linear infinite;
}

@keyframes sp-replace-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.sp-replace-label {
  font-size: 0.7rem;
  color: #ef6c00;
  font-weight: 600;
  margin-top: 0.15rem;
  text-align: center;
}

/* ═══════════════════════════════════════════════════
   Screen 6 — Answer Reveal
   ═══════════════════════════════════════════════════ */

.answer-reveal-screen .screen-content {
  gap: 0.6rem;
  padding-top: 1.25rem;
  justify-content: flex-start;
}

.ar-answer-card {
  padding: 1rem 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: card-appear 0.4s ease-out;
}

/* Music note icon at top of card */
.ar-note-circle {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px var(--gradient-primary-shadow);
}

.ar-note-circle svg { width: 1.5rem; height: 1.5rem; fill: #fff; }

/* Answer rows */
.ar-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-input-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-md);
}

.ar-row-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ar-row-icon svg { width: 13px; height: 13px; }

.ar-row-icon-song { background: #fce4ec; }
.ar-row-icon-song svg { fill: #e91e63; }

.ar-row-icon-artist { background: #f3e5f5; }
.ar-row-icon-artist svg { fill: #9c27b0; }

.ar-row-icon-year { background: #e8f5e9; }
.ar-row-icon-year svg { fill: #4caf50; }

.ar-row-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
  min-width: 0;
}

.ar-row-label {
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.ar-row-value {
  font-size: 15px;
  font-weight: 800;
  word-break: break-word;
}

.ar-row-value-song { color: #e91e63; }
.ar-row-value-artist { color: #7b1fa2; }
.ar-row-value-album { color: #1565c0; }
.ar-row-value-year { color: #388e3c; }

.ar-row-icon-album { background: #e3f2fd; }
.ar-row-icon-album svg { fill: #1976d2; }

/* Toggle buttons */
.ar-toggles {
  display: flex;
  gap: 0.375rem;
}

.ar-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #e0e0e0;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.ar-toggle-btn svg {
  width: 18px;
  height: 18px;
  fill: #ccc;
}

/* Check button default — light green border */
.ar-toggle-btn[data-value="true"] {
  border-color: #c8e6c9;
}
.ar-toggle-btn[data-value="true"] svg { fill: #a5d6a7; }

/* Check button selected — solid green fill */
.ar-toggle-btn.toggle-correct {
  background: #4caf50;
  border-color: #4caf50;
}
.ar-toggle-btn.toggle-correct svg { fill: #fff; }

/* X button selected — solid red fill */
.ar-toggle-btn.toggle-wrong {
  background: #ef5350;
  border-color: #ef5350;
}
.ar-toggle-btn.toggle-wrong svg { fill: #fff; }

/* Validation tooltip */
.ar-tooltip {
  position: relative;
  background: #333;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
  margin-bottom: 0.5rem;
  animation: fade-in 0.2s ease-out;
}

.ar-tooltip-arrow {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #333;
}

/* ═══════════════════════════════════════════════════
   Screen 7 — Score Breakdown
   ═══════════════════════════════════════════════════ */

.score-breakdown-screen .screen-content {
  gap: 0.5rem;
  padding-top: 1rem;
  justify-content: flex-start;
}

.sb-breakdown-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem 0.85rem;
  animation: card-appear 0.4s ease-out;
}

/* Score rows */
.sb-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.65rem;
  background: var(--color-input-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-md);
}

.sb-row-icon {
  width: 1.6rem;
  height: 1.6rem;
  min-width: 1.6rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sb-row-icon svg { width: 1rem; height: 1rem; }

.sb-row-icon-song { background: #fce4ec; }
.sb-row-icon-song svg { fill: var(--color-primary); }

.sb-row-icon-artist { background: var(--color-purple-bg); }
.sb-row-icon-artist svg { fill: var(--color-purple-dark); }

.sb-row-icon-time { background: var(--color-info-bg); }
.sb-row-icon-time svg { fill: var(--color-info); }

.sb-row-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
  min-width: 0;
}

.sb-row-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.sb-row-name {
  font-size: 0.8125rem;
  font-weight: 600;
  word-break: break-word;
}

.sb-row-name-song { color: var(--color-primary); }
.sb-row-name-artist { color: var(--color-purple-dark); }
.sb-row-name-time { color: var(--color-info); }

/* Result badges */
.sb-result-badge {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.1875rem 0.5rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.sb-badge-correct { background: var(--color-success-bg); color: var(--color-success); }
.sb-badge-wrong { background: var(--color-error-bg); color: var(--color-error); }

/* Points */
.sb-row-pts {
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
  min-width: 3rem;
  text-align: start;
}

.sb-pts-correct { color: var(--color-success); }
.sb-pts-wrong { color: var(--color-text-muted); }
.sb-pts-time { color: var(--color-info); }

/* Divider */
.sb-divider {
  width: 100%;
  height: 1px;
  background: var(--color-card-border);
  margin: 0.375rem 0;
}

/* Total row */
.sb-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #fef0f4, #fce4ec);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.85rem;
  margin-top: 0.2rem;
}

.sb-total-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-primary);
}

.sb-total-score {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
}

/* Podium */
.sb-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-top: -0.25rem;
  gap: 1rem;
  width: 100%;
  padding: 0.5rem 0;
}

.sb-podium-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  flex: 1;
  max-width: 10rem;
}

.sb-podium-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text-primary);
  text-align: center;
  word-break: break-word;
}

.sb-podium-block {
  width: 100%;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.sb-podium-leading {
  height: 4.5rem;
  background: linear-gradient(180deg, #fce4ec, #f8bbd0);
  border: 1.5px solid #f8d0dc;
}

.sb-podium-leading .sb-podium-score {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-primary);
}

.sb-podium-leading .sb-podium-rank,
.sb-podium-trailing .sb-podium-rank {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #bbb;
}

.sb-podium-trailing {
  height: 3rem;
  background: linear-gradient(180deg, #f5f5f5, #e0e0e0);
  border: 1.5px solid #e0e0e0;
}

.sb-podium-trailing .sb-podium-score {
  font-size: 1.25rem;
  font-weight: 900;
  color: #757575;
}

/* Horizontal bar scoreboard — proportionally split between leading and trailing teams */
.sb-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 1rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 2.5rem;
}

.sb-bar-team {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0 0.875rem;
  height: 100%;
  min-width: 5rem;
}

.sb-bar-leading {
  background: linear-gradient(135deg, #f06292, #e91e63);
  color: #fff;
}

.sb-bar-trailing {
  background: #eee;
  color: #777;
}

.sb-bar-name {
  font-size: 0.625rem;
  font-weight: 600;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-bar-score {
  font-size: 0.9375rem;
  font-weight: 800;
  white-space: nowrap;
}

.sb-bar-leading .sb-bar-score { font-size: 1rem; }

/* Secondary outline button — used for "back to fix answers" */
.btn-secondary-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 1rem;
  border-radius: 1.25rem;
  background: transparent;
  color: #999;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid #ddd;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.btn-secondary-outline:hover {
  background: #f5f5f5;
  color: #666;
}

/* ═══════════════════════════════════════════════════
   Screen 8 — Final Results
   ═══════════════════════════════════════════════════ */

.final-results-screen .screen-content {
  gap: 0.5rem;
  padding-top: 0.75rem;
  padding-bottom: 1rem;
  justify-content: flex-start;
}

/* Trophy */
.fr-trophy-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  margin-bottom: 0.25rem;
}

.fr-trophy-circle {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  box-shadow: 0 0.25rem 1rem var(--gradient-primary-shadow);
  animation: trophy-pop 0.6s ease-out;
}

.fr-trophy-svg { width: 2rem; height: 2rem; fill: #fff; }

.fr-trophy-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 2px solid rgba(233, 30, 99, 0.15);
  transform: translate(-50%, -50%);
  animation: ring-pulse 2.4s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}

.fr-trophy-ring:nth-child(2) { width: 6rem; height: 6rem; }
.fr-trophy-ring:nth-child(3) { width: 7.5rem; height: 7.5rem; }
.fr-trophy-ring:nth-child(4) { width: 9rem; height: 9rem; }

/* Winner announcement */
.fr-winner-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  text-align: center;
}

.fr-winner-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.fr-winner-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
  animation: name-pop 0.5s ease-out 0.3s both;
  word-break: break-word;
}

.fr-winner-subtitle {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

/* Podium */
.fr-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
  width: 100%;
}

.fr-podium-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
}

.fr-podium-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text-primary);
  text-align: center;
  word-break: break-word;
  max-width: 7.5rem;
}

.fr-podium-block {
  width: 7.5rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.fr-podium-winner {
  height: 4.5rem;
  background: linear-gradient(180deg, #fce4ec, #f8bbd0);
  border: 1.5px solid #f8d0dc;
  box-shadow: 0 0.25rem 1rem rgba(233, 30, 99, 0.15);
}

.fr-podium-winner .fr-podium-score {
  font-size: 2rem;
  font-weight: 900;
  color: var(--color-primary);
}

.fr-podium-winner .fr-podium-rank,
.fr-podium-loser .fr-podium-rank {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #bbb;
}

.fr-podium-loser {
  height: 3rem;
  background: linear-gradient(180deg, #f5f5f5, #e0e0e0);
  border: 1.5px solid #e0e0e0;
}

.fr-podium-loser .fr-podium-score {
  font-size: 1.375rem;
  font-weight: 900;
  color: #757575;
}

/* Stats row */
.fr-stats-row {
  display: flex;
  gap: 0.625rem;
  width: 100%;
}

.fr-stat-card {
  flex: 1;
  background: var(--color-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-card-border);
  box-shadow: var(--shadow-sm);
  padding: 0.5rem 0.375rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.fr-stat-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fr-stat-icon svg { width: 1rem; height: 1rem; }

.fr-stat-icon-rounds { background: var(--color-info-bg); }
.fr-stat-icon-rounds svg { fill: var(--color-info); }

.fr-stat-icon-avg { background: var(--color-green-bg); }
.fr-stat-icon-avg svg { fill: var(--color-green-dark); }

.fr-stat-icon-best { background: #fce4ec; }
.fr-stat-icon-best svg { fill: var(--color-primary); }

.fr-stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-text-primary);
}

.fr-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: center;
}

/* Action buttons */
.fr-actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: 100%;
  align-items: center;
  margin-top: 0.5rem;
}

/* Extra rounds dialog */
.fr-dialog-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.fr-dialog {
  background: var(--color-card);
  border-radius: var(--radius-xl);
  padding: 1.75rem 1.5rem;
  width: 100%;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
  animation: card-appear 0.3s ease-out;
}

.fr-dialog-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text-primary);
  text-align: center;
}

/* Pill stepper */
.fr-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  background: #f0f0f0;
  border-radius: var(--radius-pill);
  padding: 0.25rem;
}

.fr-stepper-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: none;
  background: var(--color-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.fr-stepper-btn svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: var(--color-text-primary);
}

.fr-stepper-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.fr-stepper-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-text-primary);
  min-width: 3.5rem;
  text-align: center;
}

.fr-dialog-note {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-align: center;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════
   Responsive — small screens
   ═══════════════════════════════════════════════════ */

/* Compact song playing screen for short viewports */
@media (max-height: 700px) {
  .sp-timer-wrapper { width: 120px; height: 120px; }
  .sp-timer-svg { width: 120px; height: 120px; }
  .sp-timer-number { font-size: 2rem; }
  .eq-large { height: 40px; }
  .song-playing-screen .screen-content { gap: 0.5rem; }
}

@media (max-width: 360px) {
  .home-vinyl {
    width: 150px;
    height: 150px;
  }
  .home-vinyl::before {
    width: 50px;
    height: 50px;
  }
  .home-vinyl-text {
    font-size: 1.1rem;
  }
  .rs-team-name { font-size: 1.75rem; }
  .fr-winner-name { font-size: 1.5rem; }

  .fr-podium-block { width: 6rem; }
  .fr-podium-winner { height: 5.5rem; }
  .fr-podium-loser { height: 3.75rem; }
  .fr-podium-winner .fr-podium-score { font-size: 1.5rem; }

  .sb-breakdown-card { padding: 0.75rem; }
  .sb-row { gap: 0.375rem; }
  .sb-row-pts { font-size: 0.75rem; min-width: 2.5rem; }
  .sb-result-badge { font-size: 0.5625rem; padding: 0.125rem 0.375rem; }
  .sb-total-score { font-size: 1.125rem; }

  .sb-podium-leading { height: 4rem; }
  .sb-podium-trailing { height: 3.5rem; }

  .fr-stat-card { padding: 0.5rem 0.375rem; }
  .fr-stat-value { font-size: 1rem; }
  .fr-stat-label { font-size: 0.625rem; }

  .fr-dialog { padding: 1.25rem 1rem; }
}

/* ═══════════════════════════════════════════════════
   Utility: hidden
   ═══════════════════════════════════════════════════ */

.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════
   Debug panel — fixed at bottom of screen.
   Shows diagnostic info when setting-debug-mode-enable = 1.
   ═══════════════════════════════════════════════════ */

.debug-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #1a1a2e;
  color: #e0e0e0;
  font-family: 'Courier New', Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
  direction: ltr;
  text-align: left;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  border-top: 2px solid #e91e63;
}

/* Push page content up so it's not hidden behind the fixed debug panel */
body.debug-active {
  padding-bottom: 220px;
}

/* Smaller padding when debug panel is collapsed (only header bar visible) */
body.debug-collapsed {
  padding-bottom: 32px;
}

.debug-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 10px;
  background: #16213e;
  cursor: pointer;
}

.debug-panel-title {
  font-weight: 700;
  color: #e91e63;
  font-size: 12px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.debug-panel-icon {
  width: 16px;
  height: 16px;
  fill: #e91e63;
}

.debug-panel-toggle {
  background: none;
  border: none;
  color: #e91e63;
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
}

.debug-panel-body {
  max-height: 180px;
  overflow-y: auto;
  padding: 6px 10px;
}

.debug-section {
  margin-bottom: 8px;
}

.debug-section-title {
  font-weight: 700;
  color: #4fc3f7;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  border-bottom: 1px solid #333;
  padding-bottom: 2px;
}

.debug-row {
  display: flex;
  gap: 8px;
  padding: 1px 0;
}

.debug-label {
  color: #aaa;
  min-width: 160px;
  flex-shrink: 0;
}

.debug-value {
  color: #76ff03;
  word-break: break-all;
}

/* Debug panel — log entries (warnings & errors) */

.debug-log-row {
  display: flex;
  gap: 6px;
  padding: 2px 0;
  border-bottom: 1px solid #222;
  align-items: flex-start;
}

.debug-log-time {
  color: #888;
  flex-shrink: 0;
  min-width: 75px;
}

.debug-log-level {
  flex-shrink: 0;
  font-weight: 700;
  min-width: 36px;
}

.debug-log-msg {
  word-break: break-word;
}

.debug-log-warning .debug-log-level { color: #ffb74d; }
.debug-log-warning .debug-log-msg { color: #ffe0b2; }

.debug-log-error .debug-log-level { color: #ef5350; }
.debug-log-error .debug-log-msg { color: #ffcdd2; }

.debug-section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #333;
  padding-bottom: 2px;
  margin-bottom: 2px;
}

.debug-toggle-arrow {
  font-size: 8px;
  color: #888;
  user-select: none;
  width: 10px;
  display: inline-block;
}

.debug-section-toggle:hover .debug-toggle-arrow {
  color: #4fc3f7;
}

.debug-clear-btn {
  background: #333;
  color: #ff8a80;
  border: 1px solid #555;
  border-radius: 4px;
  font-size: 10px;
  font-family: inherit;
  padding: 1px 8px;
  cursor: pointer;
}

.debug-clear-btn:hover {
  background: #ef5350;
  color: #fff;
  border-color: #ef5350;
}

/* Debug test search button */
.debug-test-search-btn {
  background: #1b5e20;
  color: #a5d6a7;
  border: 1px solid #388e3c;
  border-radius: 4px;
  font-size: 10px;
  font-family: inherit;
  padding: 1px 8px;
  cursor: pointer;
}
.debug-test-search-btn:hover {
  background: #2e7d32;
  color: #fff;
  border-color: #2e7d32;
}
.debug-test-search-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Debug song results table */
.debug-song-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  margin-top: 3px;
  direction: rtl;
}
.debug-song-table th {
  background: #333;
  color: #4fc3f7;
  padding: 2px 4px;
  text-align: right;
  border: 1px solid #444;
  font-weight: 600;
}
.debug-song-table td {
  padding: 2px 4px;
  border: 1px solid #333;
  color: #ccc;
  text-align: right;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

