/* ==========================================================================
   SONGAME - Main CSS & Design Tokens
   ========================================================================== */

:root {
  /* Color Palette - Rainy Grey Slate Aesthetic */
  --bg-app: #0d1117;
  --bg-surface: #161b22;
  --bg-surface-elevated: #1f242c;
  --bg-surface-hover: #282e38;
  --bg-glass: rgba(22, 27, 34, 0.78);
  
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-focus: rgba(99, 102, 241, 0.6);

  /* Brand Accents - Elegant Platinum Silver & Slate Grey */
  --spotify-green: #e2e8f0;
  --spotify-green-hover: #ffffff;
  --spotify-green-dim: rgba(226, 232, 240, 0.15);
  --spotify-glow: 0 0 24px rgba(255, 255, 255, 0.35);

  /* Status Colors */
  --color-correct: #1ed760;
  --color-partial: #f59e0b;
  --color-miss: #ef4444;
  --color-skipped: #64748b;

  /* Typography */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Elevation */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(30, 215, 96, 0.25);

  /* Transitions */
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
}

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

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.05), transparent 45%),
    radial-gradient(circle at 10% 40%, rgba(148, 163, 184, 0.04), transparent 40%),
    radial-gradient(circle at 90% 70%, rgba(71, 85, 105, 0.06), transparent 45%);
  background-attachment: fixed;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 680px;
  margin: 0 auto;
  padding: 12px 16px 32px 16px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px 0;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 10;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Brand Logo */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.logo-bars {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 18px;
}

.logo-bars .bar {
  width: 3.5px;
  background: var(--spotify-green);
  border-radius: 2px;
  animation: logoWave 1.4s ease-in-out infinite alternate;
}

.logo-bars .bar-1 { height: 8px; animation-delay: 0.1s; }
.logo-bars .bar-2 { height: 16px; animation-delay: 0.3s; }
.logo-bars .bar-3 { height: 12px; animation-delay: 0.2s; }
.logo-bars .bar-4 { height: 18px; animation-delay: 0.4s; }

.logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.logo-accent {
  color: var(--spotify-green);
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.4);
}

/* Buttons & Badges */
.badge-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.825rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.badge-button:hover {
  background: var(--bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.icon-button:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.icon-button:active {
  transform: scale(0.94);
}

/* Game Stage */
.game-stage {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 14px;
  flex: 1;
}

/* Sub-header banner */
.game-info-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
}

.info-tag {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.difficulty-indicator {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--spotify-green-dim);
  color: var(--spotify-green);
  border: 1px solid rgba(30, 215, 96, 0.3);
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-smooth);
  user-select: none;
}

.btn-primary {
  background: var(--spotify-green);
  color: #0d1117;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.22);
}

.btn-primary:hover:not(:disabled) {
  background: var(--spotify-green-hover);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-secondary:active:not(:disabled) {
  transform: scale(0.98);
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Accessibility Focus States */
:focus-visible {
  outline: 2px solid var(--spotify-green);
  outline-offset: 2px;
}

/* Responsive Mobile Adjustments */
@media (max-width: 520px) {
  .app-container {
    padding: 10px 14px 24px 14px;
  }
  
  .app-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 12px;
  }

  .header-center {
    order: 1;
  }

  .header-right {
    order: 2;
    gap: 6px;
  }

  .header-left {
    order: 3;
    width: 100%;
  }

  .badge-button {
    width: 100%;
    justify-content: center;
    max-width: none;
    padding: 7px 12px;
    font-size: 0.825rem;
  }

  .brand-logo {
    gap: 6px;
  }

  .logo-text {
    font-size: 1.15rem;
  }

  .logo-bars {
    height: 15px;
  }

  .icon-button {
    width: 34px;
    height: 34px;
  }

  .icon-button svg {
    width: 17px;
    height: 17px;
  }

  .game-stage {
    gap: 12px;
    margin-top: 8px;
  }

  .guess-row {
    padding: 8px 10px;
    min-height: 42px;
    font-size: 0.85rem;
  }

  .audio-deck {
    padding: 14px;
    gap: 10px;
  }

  .play-main-button {
    width: 56px;
    height: 56px;
  }

  .play-main-button svg {
    width: 24px;
    height: 24px;
  }

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

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

