/* ==========================================================================
   JOE BONAMASSA - GUESS THAT SONG (PREMIUM STYLESHEET)
   ========================================================================== */

/* --- CSS VARIABLES & DESIGN SYSTEM --- */
:root {
  --bg-darkest: #07080a;
  --bg-darker: #0d0f14;
  --bg-card: rgba(18, 22, 31, 0.65);
  --border-glass: rgba(255, 255, 255, 0.08);
  
  /* Vintage Sunburst & Tube Glow Amber */
  --gold-primary: #f5a623;
  --gold-secondary: #d05a10;
  --gold-glow: rgba(245, 166, 35, 0.35);
  
  /* Electric Blues Neon */
  --blue-primary: #00d2ff;
  --blue-secondary: #0072ff;
  --blue-glow: rgba(0, 210, 255, 0.3);
  
  /* Text */
  --text-white: #f9fafb;
  --text-gray: #9ca3af;
  --text-muted: #6b7280;
  
  /* Font Family */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Timing */
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- BASE STYLES --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-darkest);
  color: var(--text-white);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- AMBIENT GLOW BACKDROPS --- */
.ambient-glow {
  position: fixed;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.15;
  pointer-events: none;
  mix-blend-mode: screen;
}

.glow-gold {
  top: -10vw;
  right: -10vw;
  background: radial-gradient(circle, var(--gold-primary), transparent 70%);
}

.glow-blue {
  bottom: -10vw;
  left: -10vw;
  background: radial-gradient(circle, var(--blue-primary), transparent 70%);
}

/* --- MAIN CONTAINER LAYOUT --- */
.app-container {
  display: grid;
  grid-template-columns: 360px 1fr;
  width: 100vw;
  height: 100vh;
  max-width: 1920px;
  max-height: 1080px;
  background-color: var(--bg-darker);
  border: 1px solid var(--border-glass);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

/* ==========================================================================
   SIDEBAR: STATS & DETAILS
   ========================================================================== */
.sidebar-panel {
  background: rgba(10, 12, 16, 0.85);
  border-right: 1px solid var(--border-glass);
  backdrop-filter: blur(20px);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

/* Brand Logo Styling */
.logo-area {
  margin-bottom: 2.5rem;
  text-align: center;
}

.logo-area .sub-logo {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.35em;
  color: var(--blue-primary);
  text-shadow: 0 0 10px var(--blue-glow);
  text-transform: uppercase;
}

.logo-area .main-logo {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--text-white);
  background: linear-gradient(to bottom, #ffffff 30%, #a1a1a1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 0.2rem;
}

.guitar-divider {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-primary), var(--gold-primary));
  margin: 1rem auto 0;
  border-radius: 2px;
}

/* Dashboard Statistics */
.stats-section h2, 
.instructions-section h2 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-gray);
  margin-bottom: 1.2rem;
  text-transform: uppercase;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Main Score card spans full width */
#stat-score-card {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.1), rgba(18, 22, 31, 0.65));
  border: 1px solid rgba(245, 166, 35, 0.2);
  align-items: center;
  padding: 1.2rem;
}

.stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-gray);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
}

#stat-score-card .stat-value {
  font-size: 2.4rem;
  text-shadow: 0 0 20px rgba(245, 166, 35, 0.3);
}

.highlight-gold {
  color: var(--gold-primary);
}

/* Instructions */
.instructions-section {
  flex-grow: 1;
}

.instructions-section ul {
  list-style: none;
}

.instructions-section li {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-gray);
}

.instructions-section li .bullet {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: -0.1rem;
}

.sidebar-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--border-glass);
  padding-top: 1rem;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sidebar-footer p {
  margin-bottom: 0.2rem;
}

/* ==========================================================================
   MAIN GAME PANEL
   ========================================================================== */
.main-panel {
  padding: 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  position: relative;
}

/* Game Header (Status & Volume) */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.active-track-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 0.5rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-white);
  transition: var(--transition-smooth);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.playing-state .pulse-dot {
  background-color: var(--blue-primary);
  box-shadow: 0 0 10px var(--blue-primary);
  animation: pulse-glow 1.5s infinite alternate;
}

@keyframes pulse-glow {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 1; }
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.icon {
  width: 20px;
  height: 20px;
}

/* STAGE: VINYL & MUSIC FREQUENCY VISUALIZER */
.stage-section {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.5rem 0;
  flex-grow: 1;
}

.vinyl-container-wrapper {
  position: relative;
  width: 320px;
  height: 320px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Vinyl Container holding canvas + record */
.vinyl-container {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* The Vinyl Disk */
.vinyl-record {
  width: 90%;
  height: 90%;
  border-radius: 50%;
  background: 
    radial-gradient(circle, #2c2c2c 4%, transparent 5%),
    radial-gradient(circle, #0e0e0e 10%, transparent 11%),
    repeating-radial-gradient(circle, #1f1f1f, #141414 1px, #1f1f1f 3px, #0e0e0e 5px);
  position: relative;
  z-index: 2;
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.05), 0 0 15px rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.5s ease-out;
}

/* Spinning animation when playing */
.playing-state .vinyl-record {
  animation: spin-vinyl 4s linear infinite;
}

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

.vinyl-grooves {
  position: absolute;
  top: 5%;
  left: 5%;
  right: 5%;
  bottom: 5%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

/* Vinyl Center Label */
.vinyl-sticker {
  width: 34%;
  height: 34%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-primary) 0%, var(--gold-secondary) 100%);
  border: 4px solid #111;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.sticker-logo {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 900;
  color: #111;
  letter-spacing: -0.05em;
  line-height: 1;
}

.sticker-text {
  font-size: 0.38rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(17,17,17,0.8);
  margin-top: 0.1rem;
  text-transform: uppercase;
}

.sticker-center-hole {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--bg-darker);
  border: 2px solid #000;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
  z-index: 3;
}

/* Album art overlay inside vinyl sticker */
.album-art-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  z-index: 1;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 20px var(--gold-glow);
}

.album-art-overlay.hidden {
  opacity: 0;
  transform: scale(0.8) rotate(-45deg);
  pointer-events: none;
}

@starting-style {
  .album-art-overlay:not(.hidden) {
    opacity: 0;
    transform: scale(0.8) rotate(-45deg);
  }
}

/* Visualizer canvas absolute positioning over vinyl */
.visualizer-canvas {
  position: absolute;
  top: -15%;
  left: -15%;
  width: 130%;
  height: 130%;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

/* Circular Timer Gauge overlay */
.timer-gauge {
  position: absolute;
  top: -15px;
  right: -15px;
  width: 90px;
  height: 90px;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-darker);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  border: 1px solid var(--border-glass);
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg-circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 6;
}

.timer-progress-circle {
  fill: none;
  stroke: var(--gold-primary);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 283; /* 2 * PI * 45 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.1s linear, stroke var(--transition-smooth);
}

.timer-content {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.timer-points {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text-gray);
  letter-spacing: 0.05em;
  margin-bottom: -0.1rem;
}

.timer-seconds {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.1;
}

/* PUZZLE BOARD: HINT LETTERS */
.tiles-section {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.tiles-board {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2rem 1.8rem; /* Gap between words */
  width: 100%;
  min-height: 80px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-glass);
  border-radius: 16px;
  padding: 1.5rem;
  align-content: center;
  transition: var(--transition-smooth);
}

.tile-word {
  display: flex;
  gap: 0.35rem; /* Gap between letters inside words */
}

/* Individual Letter Tiles */
.tile-card {
  width: 32px;
  height: 44px;
  perspective: 1000px;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
}

.tile-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.tile-card.revealed .tile-inner {
  transform: rotateY(180deg);
}

.tile-front, 
.tile-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Face down tile */
.tile-front {
  background: linear-gradient(135deg, #1d222d 0%, #11141a 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

/* Face up tile */
.tile-back {
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.15), rgba(20, 24, 33, 0.85));
  border: 1px solid rgba(245, 166, 35, 0.35);
  color: var(--gold-primary);
  transform: rotateY(180deg);
  text-shadow: 0 0 10px var(--gold-glow);
  text-transform: uppercase;
}

/* Special character tile (spaces, commas, punctuation) - always face up but simple */
.tile-card.special .tile-front {
  background: transparent;
  box-shadow: none;
  border: none;
  color: var(--text-gray);
}

.tiles-placeholder {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Hint HUD status bar */
.hint-notification-bar {
  margin-top: 1rem;
  background: rgba(245, 166, 35, 0.06);
  border: 1px solid rgba(245, 166, 35, 0.12);
  border-radius: 8px;
  padding: 0.5rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--gold-primary);
  width: 100%;
  max-width: 600px;
  justify-content: center;
  transition: var(--transition-smooth);
}

.hint-text {
  font-weight: 500;
}

/* PLAY SECTION: INPUT & AUTO-COMPLETE */
.play-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  margin-top: auto;
}

.input-autocomplete-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
}

.guess-form {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.guess-input {
  flex-grow: 1;
  min-width: 0;
  background: rgba(20, 24, 33, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-white);
  outline: none;
  transition: var(--transition-smooth);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.guess-input:focus:not(:disabled) {
  border-color: var(--blue-primary);
  box-shadow: 0 0 15px var(--blue-glow), inset 0 2px 4px rgba(0,0,0,0.5);
}

.guess-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Shake animation for wrong answers */
.input-shake {
  animation: shake 0.4s ease-in-out;
  border-color: #ef4444 !important;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3) !important;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* BUTTONS */
.btn {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 1rem 1.8rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-transform: uppercase;
}

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

.primary-btn {
  background: linear-gradient(135deg, var(--blue-primary) 0%, var(--blue-secondary) 100%);
  color: #111;
  box-shadow: 0 4px 14px var(--blue-glow);
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 210, 255, 0.5);
}

.primary-btn:active:not(:disabled) {
  transform: translateY(0);
}

.secondary-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-gray);
  padding: 0.75rem 1.5rem;
  font-size: 0.8rem;
}

.secondary-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: var(--text-white);
}

/* Autocomplete suggestion popup menu */
.autocomplete-list {
  position: absolute;
  bottom: calc(100% + 8px); /* Pop up ABOVE input */
  left: 0;
  right: 0;
  background: rgba(13, 15, 20, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 -10px 25px rgba(0,0,0,0.6);
  backdrop-filter: blur(14px);
  padding: 0.4rem;
  transition: display 0.2s, opacity 0.2s;
  transition-behavior: allow-discrete;
}

.autocomplete-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-gray);
  transition: var(--transition-smooth);
  text-align: left;
}

.autocomplete-item:hover,
.autocomplete-item.active-suggestion {
  background: linear-gradient(90deg, rgba(0, 210, 255, 0.15), transparent);
  color: var(--blue-primary);
  border-left: 3px solid var(--blue-primary);
  padding-left: calc(1rem - 3px);
}

/* Modern `@starting-style` for autocomplete entry animation */
@starting-style {
  .autocomplete-list:not(.hidden) {
    opacity: 0;
    transform: translateY(10px);
  }
}

.autocomplete-list:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
}

/* Hide helper class */
.hidden {
  display: none !important;
  opacity: 0;
}

/* ==========================================================================
   SCREEN OVERLAYS (START, GAME OVER)
   ========================================================================== */
.screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(5, 6, 8, 0.85);
  backdrop-filter: blur(18px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  transition: opacity 0.5s ease, display 0.5s ease;
  transition-behavior: allow-discrete;
}

/* Entry state starting style */
@starting-style {
  .screen-overlay:not(.hidden) {
    opacity: 0;
  }
}

.screen-overlay:not(.hidden) {
  opacity: 1;
}

.glassmorphic {
  background: rgba(18, 22, 31, 0.7);
  border: 1px solid var(--border-glass);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  border-radius: 24px;
}

.overlay-card {
  width: 100%;
  max-width: 580px;
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  overflow-y: auto;
  max-height: 90vh;
  border-top: 4px solid var(--gold-primary);
}

/* Custom premium scrollbar for overlays */
.overlay-card::-webkit-scrollbar {
  width: 6px;
}
.overlay-card::-webkit-scrollbar-track {
  background: transparent;
}
.overlay-card::-webkit-scrollbar-thumb {
  background: rgba(245, 166, 35, 0.2);
  border-radius: 10px;
}
.overlay-card::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 166, 35, 0.4);
}

.overlay-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 150px;
  background: radial-gradient(circle at 50% 0%, rgba(245, 166, 35, 0.15), transparent 70%);
  pointer-events: none;
}

.overlay-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 10px var(--gold-glow));
}

.overlay-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--text-white);
}

.overlay-subtitle {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--gold-primary);
  text-transform: uppercase;
  margin-bottom: 2rem;
  text-shadow: 0 0 8px rgba(245, 166, 35, 0.2);
}

.overlay-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-gray);
  margin-bottom: 2.5rem;
}

.overlay-body p {
  margin-bottom: 1rem;
}

.overlay-tip {
  background: rgba(0, 210, 255, 0.06);
  border: 1px solid rgba(0, 210, 255, 0.15);
  border-radius: 12px;
  padding: 1rem;
  font-size: 0.82rem;
  color: var(--blue-primary);
  text-align: left;
  line-height: 1.4;
}

.start-btn {
  width: 100%;
  padding: 1.25rem 2rem;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-secondary) 100%);
  color: #000;
  box-shadow: 0 6px 20px var(--gold-glow);
}

.start-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(245, 166, 35, 0.6);
}

/* GAME OVER SCORE GRID */
.game-over-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.go-stat {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 1.2rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.go-stat-val {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.go-stat-lbl {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-gray);
  text-transform: uppercase;
}

.rank-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue-primary);
  margin-top: 1rem;
}

/* ==========================================================================
   TOAST FLOATING FEEDBACK
   ========================================================================== */
.toast-feedback {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  background: rgba(10, 13, 20, 0.95);
  border: 2px solid var(--gold-primary);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 166, 35, 0.2);
  border-radius: 20px;
  padding: 2rem 3rem;
  min-width: 320px;
  text-align: center;
  backdrop-filter: blur(14px);
  transition: opacity 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), display 0.3s;
  transition-behavior: allow-discrete;
}

/* Entry starting state */
@starting-style {
  .toast-feedback:not(.hidden) {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.9);
  }
}

.toast-feedback:not(.hidden) {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.toast-content {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toast-header {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.toast-success .toast-header {
  color: var(--blue-primary);
  text-shadow: 0 0 10px var(--blue-glow);
}

.toast-fail {
  border-color: #ef4444;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(239, 68, 68, 0.2);
}

.toast-fail .toast-header {
  color: #ef4444;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.toast-points {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--gold-primary);
  text-shadow: 0 0 15px rgba(245,166,35,0.3);
}

.toast-subtitle {
  font-size: 0.85rem;
  color: var(--text-gray);
}

/* Spotify promo card in toast feedback */
.toast-spotify-promo {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.85rem;
  border-radius: 12px;
  margin: 0.8rem 0;
  text-align: left;
}

.promo-art {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.promo-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex-grow: 1;
  min-width: 0;
}

.promo-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.promo-album {
  font-size: 0.75rem;
  color: var(--text-gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.3rem;
}

.spotify-stream-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background-color: #1DB954;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  text-decoration: none;
  transition: var(--transition-smooth);
  width: fit-content;
  letter-spacing: 0.05em;
}

.spotify-stream-btn:hover {
  background-color: #1ed760;
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(29, 185, 84, 0.45);
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 900px) {
  .app-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    max-height: none;
    overflow-y: auto;
  }
  
  .sidebar-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-glass);
    padding: 1.5rem;
    height: auto;
  }
  
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 0.5rem;
  }
  
  #stat-score-card {
    grid-column: span 4;
    padding: 0.75rem;
  }
  
  #stat-score-card .stat-value {
    font-size: 1.8rem;
  }
  
  .stat-card {
    padding: 0.5rem;
    align-items: center;
  }
  
  .stat-value {
    font-size: 1.1rem;
  }
  
  .instructions-section, .logo-area, .sidebar-footer {
    display: none;
  }
  
  .main-panel {
    padding: 1.5rem;
    gap: 1.5rem;
    min-height: calc(100vh - 200px);
  }
  
  .vinyl-container-wrapper {
    width: 250px;
    height: 250px;
  }
  
  .timer-gauge {
    width: 75px;
    height: 75px;
  }
  
  .timer-seconds {
    font-size: 1.25rem;
  }
  
  .tile-card {
    width: 24px;
    height: 34px;
    font-size: 1.1rem;
  }
}

/* --- MOBILE SPECIFIC FIXES --- */
@media (max-width: 480px) {
  .overlay-card {
    padding: 2rem 1.25rem;
  }
  
  .game-over-stats {
    gap: 0.6rem;
    margin-bottom: 1.5rem;
  }
  
  .go-stat {
    padding: 1rem 0.25rem;
    border-radius: 12px;
  }
  
  .go-stat-val {
    font-size: 1.4rem;
  }
  
  .go-stat-lbl {
    font-size: 0.55rem;
    letter-spacing: 0.05em;
  }
  
  .leaderboard-submit-box {
    padding: 1rem;
    margin: 0.75rem auto;
    border-radius: 12px;
  }
  
  .leaderboard-form {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .leaderboard-input {
    width: 100%;
    min-width: 0;
  }
  
  .leaderboard-submit-box .submit-btn {
    width: 100%;
    padding: 0.85rem;
    font-size: 0.9rem;
  }

  .leaderboard-header, .leaderboard-row {
    grid-template-columns: 40px 1fr 70px 65px;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .leaderboard-row.user-row {
    padding-left: calc(0.75rem - 3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vinyl-record {
    animation: none !important;
  }
  .tile-inner {
    transition: none !important;
  }
  .screen-overlay, .toast-feedback, .autocomplete-list {
    transition: none !important;
  }
}

/* ==========================================================================
   GLOBAL LEADERBOARD STYLING
   ========================================================================== */

.leaderboard-submit-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 1.5rem;
  width: 100%;
  max-width: 450px;
  margin: 1rem auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.submit-prompt-text {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--blue-primary);
  text-shadow: 0 0 10px var(--blue-glow);
  margin-bottom: 1rem;
  text-transform: uppercase;
  text-align: center;
}

.leaderboard-form {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.leaderboard-input {
  flex-grow: 1;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.leaderboard-submit-box .submit-btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.leaderboard-display-box {
  width: 100%;
  max-width: 450px;
  margin: 1rem auto;
}

.leaderboard-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: var(--gold-primary);
  text-shadow: 0 0 12px var(--gold-glow);
  text-align: center;
  margin-bottom: 1rem;
}

.leaderboard-container {
  background: rgba(13, 15, 20, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
}

.leaderboard-header {
  background: rgba(0, 210, 255, 0.08);
  border-bottom: 1px solid var(--border-glass);
  padding: 0.75rem 1.25rem;
  display: grid;
  grid-template-columns: 45px 1fr 80px 75px;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--blue-primary);
  text-transform: uppercase;
}

.leaderboard-rows {
  max-height: 200px;
  overflow-y: auto;
}

/* Custom scrollbar for leaderboard rows */
.leaderboard-rows::-webkit-scrollbar {
  width: 6px;
}

.leaderboard-rows::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

.leaderboard-rows::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.leaderboard-rows::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 45px 1fr 80px 75px;
  align-items: center;
  padding: 0.65rem 1.25rem;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: var(--transition-smooth);
}

.leaderboard-row:last-child {
  border-bottom: none;
}

.leaderboard-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.leaderboard-row.user-row {
  background: rgba(0, 210, 255, 0.05);
  border-left: 3px solid var(--blue-primary);
  padding-left: calc(1.25rem - 3px);
}

.leaderboard-rank {
  font-family: var(--font-heading);
  font-weight: 900;
  color: var(--text-gray);
}

.leaderboard-rows .leaderboard-row:nth-child(1) .leaderboard-rank {
  color: var(--gold-primary);
  text-shadow: 0 0 10px rgba(245, 166, 35, 0.4);
}
.leaderboard-rows .leaderboard-row:nth-child(2) .leaderboard-rank {
  color: #d1d5db; /* Silver */
}
.leaderboard-rows .leaderboard-row:nth-child(3) .leaderboard-rank {
  color: #cd7f32; /* Bronze */
}

.leaderboard-name {
  font-weight: 600;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 0.5rem;
}

.leaderboard-score {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--gold-primary);
  text-align: right;
  text-shadow: 0 0 10px rgba(245, 166, 35, 0.2);
}

.leaderboard-speed {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
}

.leaderboard-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

