:root {
  --bg-main: #090b10;
  --bg-card: #12161f;
  --bg-card-hover: #1b212f;
  --bg-surface: #181d28;
  --border: #232a3b;
  --border-active: #3b82f6;
  --accent: #1db954;
  --accent-hover: #1ed760;
  --accent-glow: rgba(29, 185, 84, 0.3);
  --text-main: #f8fafc;
  --text-sub: #94a3b8;
  --text-muted: #64748b;
  --correct: #22c55e;
  --partial: #eab308;
  --wrong: #ef4444;
  --skipped: #475569;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

input, button {
  user-select: auto;
  -webkit-user-select: auto;
  font-family: inherit;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

/* ==================== HEADER ==================== */
.app-header {
  width: 100%;
  max-width: 768px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 11, 16, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.brand-icon {
  font-size: 22px;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #1db954 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-nav {
  display: flex;
  gap: 8px;
}

.nav-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-sub);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-active);
}

/* ==================== MAIN WRAPPER ==================== */
.app-container {
  width: 100%;
  max-width: 680px;
  flex: 1 0 auto;
  padding: 16px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.view-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

/* ==================== HOME / DECADES HUB ==================== */
.hero-banner {
  background: linear-gradient(180deg, rgba(29, 185, 84, 0.12) 0%, rgba(18, 22, 31, 0.6) 100%);
  border: 1px solid rgba(29, 185, 84, 0.25);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.hero-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.hero-subtitle {
  font-size: 13px;
  color: var(--text-sub);
  max-width: 480px;
  line-height: 1.5;
}

/* Hero Quick Actions */
.hero-quick-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-btn.primary {
  background: var(--accent);
  color: #000;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.hero-btn.primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.hero-btn.secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.hero-btn.secondary:hover {
  background: var(--bg-card-hover);
  border-color: #38bdf8;
  transform: translateY(-2px);
}

/* 3 Main Catalog Game Modes Side-by-Side */
.catalog-modes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
}

@media (max-width: 640px) {
  .catalog-modes-grid {
    grid-template-columns: 1fr;
  }
}

.catalog-mode-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.catalog-mode-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.cat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cat-card-icon {
  font-size: 26px;
}

.cat-card-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.cat-card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.cat-card-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.4;
  min-height: 34px;
}

.cat-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preview-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
}

.preview-chip:hover {
  background: rgba(29, 185, 84, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.04);
}

.cat-view-all-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.cat-view-all-btn:hover {
  background: #38bdf8;
  color: #000;
}

/* Modal Large and Game Modes Popup */
.modal-box.modal-lg {
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
}

.modes-popup-quick-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.modes-popup-quick-btn {
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s;
}

.modes-popup-quick-btn:hover {
  transform: translateY(-2px);
}

.modes-popup-quick-btn.primary {
  background: var(--accent);
  color: #000;
}

.modes-popup-quick-btn.secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.modes-popup-sec-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 14px;
  margin-bottom: 6px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Decades Grid */
.decades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.decade-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.decade-card:hover {
  border-color: var(--accent);
  background: var(--bg-card);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.decade-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.decade-icon {
  font-size: 24px;
}

.decade-play-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(29, 185, 84, 0.1);
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid rgba(29, 185, 84, 0.2);
}

.decade-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.decade-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.4;
}

/* Artist Search & Packs */
.artist-search-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.artist-search-bar {
  display: flex;
  gap: 8px;
}

.artist-input {
  flex: 1;
  height: 44px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.artist-input:focus {
  border-color: #38bdf8;
}

.artist-submit-btn {
  background: #38bdf8;
  color: #000;
  border: none;
  font-weight: 700;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity 0.2s;
}

.artist-submit-btn:hover {
  opacity: 0.9;
}

.artist-autocomplete-dropdown {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
  margin-top: 4px;
  scrollbar-width: thin;
}

.artist-ac-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(45, 55, 72, 0.3);
  transition: all 0.15s ease;
}

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

.artist-ac-row:hover {
  background: var(--bg-card-hover);
  border-left: 3px solid #38bdf8;
}

.artist-ac-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.artist-ac-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.artist-ac-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artist-ac-icon {
  font-size: 18px;
}

.artist-ac-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.artist-ac-genre {
  font-size: 11px;
  color: var(--text-sub);
}

.artist-ac-pill {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.artist-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.artist-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.artist-pill:hover {
  border-color: #38bdf8;
  background: var(--bg-card);
  transform: scale(1.03);
}

.artist-pill.selected {
  background: rgba(29, 185, 84, 0.18);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0 14px rgba(29, 185, 84, 0.35);
  transform: scale(1.02);
}

.artist-pill.selected::after {
  content: '✓';
  margin-left: 4px;
  font-size: 11px;
  font-weight: 900;
  color: var(--accent);
}

/* Multi-Artist Selection Toolbar */
.multi-artist-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.multi-artist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.multi-artist-count-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.multi-artist-badge {
  font-size: 11px;
  font-weight: 800;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
}

.multi-artist-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s;
}

.multi-artist-clear-btn:hover {
  color: #f87171;
}

.selected-artists-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
  align-items: center;
}

.multi-artist-empty-hint {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.selected-artist-chip {
  background: rgba(29, 185, 84, 0.15);
  border: 1px solid var(--accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.selected-artist-chip .remove-chip-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.selected-artist-chip .remove-chip-btn:hover {
  background: #f87171;
}

.multi-artist-play-btn {
  background: var(--accent);
  color: #000000;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.multi-artist-play-btn:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(29, 185, 84, 0.4);
}

.multi-artist-play-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Playlists Grid */
.playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.playlist-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s;
}

.playlist-card:hover {
  border-color: #38bdf8;
  background: var(--bg-card);
  transform: translateY(-2px);
}

.playlist-card-title {
  font-size: 14px;
  font-weight: 700;
}

.playlist-card-desc {
  font-size: 11px;
  color: var(--text-sub);
}

/* ==================== GAME VIEW ==================== */
.game-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.current-mode-tag {
  background: rgba(29, 185, 84, 0.12);
  border: 1px solid rgba(29, 185, 84, 0.3);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

/* Guess History */
.guess-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guess-row {
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.guess-row.empty {
  border-style: dashed;
  background: transparent;
  color: var(--text-muted);
}

.guess-row.active {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.guess-row.correct {
  background: rgba(34, 197, 94, 0.2);
  border-color: var(--correct);
  color: #4ade80;
  font-weight: 700;
}

.guess-row.partial {
  background: rgba(234, 179, 8, 0.2);
  border-color: var(--partial);
  color: #facc15;
  font-weight: 700;
}

.guess-row.wrong {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--wrong);
  color: #f87171;
  font-weight: 700;
}

.guess-row.skipped {
  background: rgba(71, 85, 105, 0.2);
  border-color: var(--skipped);
  color: var(--text-sub);
}

.guess-icon {
  margin-right: 10px;
  font-size: 16px;
}

/* Progressive Hint Drawer */
.hint-drawer {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.3s;
}

.hint-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
  background: var(--bg-card);
}

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

.hint-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hint-badge {
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-radius: 10px;
  font-weight: 700;
}

.hint-cards {
  padding: 12px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  border-top: 1px solid var(--border);
}

.hint-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hint-card-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.hint-card-value {
  font-size: 13px;
  font-weight: 600;
  color: #38bdf8;
}

.hint-unlock-btn {
  background: rgba(56, 189, 248, 0.1);
  border: 1px dashed rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
}

.hint-unlock-btn:hover {
  background: rgba(56, 189, 248, 0.2);
}

/* Audio Player Section */
.player-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.waveform-box {
  height: 52px;
  width: 100%;
  border-radius: var(--radius-sm);
  background: rgba(9, 11, 16, 0.8);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#waveformCanvas {
  width: 100%;
  height: 100%;
}

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-segments {
  height: 12px;
  background: var(--bg-main);
  border-radius: 6px;
  display: flex;
  gap: 2px;
  overflow: hidden;
  position: relative;
}

.timeline-segment {
  height: 100%;
  background: #1e293b;
  position: relative;
  transition: background 0.2s;
}

.timeline-segment.unlocked {
  background: #334155;
}

.playhead-indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: #ffffff;
  box-shadow: 0 0 10px #ffffff;
  pointer-events: none;
  transition: left 0.05s linear;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.play-btn-large {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #000;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.play-btn-large:hover {
  transform: scale(1.06);
  background: var(--accent-hover);
}

.play-btn-large.playing {
  background: #38bdf8;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.4);
}

.time-readout {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-sub);
  width: 80px;
}

.volume-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100px;
  position: relative;
}

.volume-tooltip {
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  z-index: 20;
}

.volume-wrapper:hover .volume-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

.vol-slider {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Guess Input & Search Container */
.search-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.search-field-wrap {
  position: relative;
  width: 100%;
}

.game-search-input {
  width: 100%;
  height: 48px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 44px 0 16px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.game-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}

.clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: none;
}

.autocomplete-dropdown {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  display: none;
}

.autocomplete-item {
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid rgba(45, 55, 72, 0.3);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover, .autocomplete-item.selected {
  background: var(--bg-card-hover);
}

.ac-title {
  font-weight: 700;
  color: var(--text-main);
}

.ac-artist {
  font-size: 11px;
  color: var(--text-sub);
}

.game-action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.game-act-btn {
  height: 46px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.skip-action {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
}

.skip-action:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.submit-action {
  background: var(--accent);
  color: #000;
}

.submit-action:hover:not(:disabled) {
  background: var(--accent-hover);
}

.submit-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Post-Game Play Next Button */
.play-next-inline-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent), #38bdf8);
  color: #000;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(29, 185, 84, 0.35);
}

.play-next-inline-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(29, 185, 84, 0.5);
}

/* ==================== ADMIN TOOLBAR & CHEATS ==================== */
.admin-toolbar {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: pulse-border 3s infinite;
}

.admin-badge {
  background: #a855f7;
  color: #000;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-actions-group {
  display: flex;
  gap: 6px;
}

.admin-btn {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #f0abfc;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.admin-btn:hover {
  background: rgba(168, 85, 247, 0.4);
  color: #fff;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(45, 55, 72, 0.4);
  font-size: 14px;
}

.admin-input-wrap {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.admin-input {
  flex: 1;
  height: 40px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
}

.admin-input:focus {
  border-color: #a855f7;
}

.admin-submit-btn {
  background: #a855f7;
  color: #000;
  border: none;
  font-weight: 700;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.admin-submit-btn:hover {
  opacity: 0.9;
}

@keyframes pulse-border {
  0%, 100% { border-color: rgba(168, 85, 247, 0.4); }
  50% { border-color: rgba(236, 72, 153, 0.8); }
}

/* ==================== MODALS ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  animation: modal-appear 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modal-appear {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-heading {
  font-size: 18px;
  font-weight: 800;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.close-btn:hover {
  color: var(--text-main);
}

/* Result Modal Specifics */
.result-status-title {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
}

.result-status-title.win {
  color: #4ade80;
}

.result-status-title.lose {
  color: #f87171;
}

.result-art-box {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-md);
  margin: 0 auto;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.result-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-details {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-song-title {
  font-size: 18px;
  font-weight: 800;
}

.result-song-artist {
  font-size: 14px;
  color: #38bdf8;
  font-weight: 700;
}

.result-meta-line {
  font-size: 12px;
  color: var(--text-muted);
}

.emoji-share-box {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  font-family: monospace;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-primary-block {
  width: 100%;
  height: 44px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary-block:hover {
  background: var(--accent-hover);
}

.btn-secondary-block {
  width: 100%;
  height: 44px;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary-block:hover {
  background: var(--bg-card-hover);
}

/* Stats Modal Grid */
.stats-numbers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}

.stat-cell {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 4px;
}

.stat-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}

.stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

.dist-bar-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.dist-num {
  width: 14px;
  text-align: right;
  color: var(--text-muted);
}

.dist-track {
  flex: 1;
  height: 20px;
  background: var(--bg-main);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.dist-fill {
  height: 100%;
  background: #334155;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  font-size: 11px;
  font-weight: 800;
  transition: width 0.3s;
}

.dist-fill.active {
  background: var(--accent);
  color: #000;
}

/* Toast Messages */
.toast-shelf {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
}

.toast-msg {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid var(--border-active);
  color: #fff;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: toast-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@media (max-width: 480px) {
  .hero-banner { padding: 18px 14px; }
  .hero-title { font-size: 19px; }
  .decades-grid { grid-template-columns: 1fr 1fr; }
  .playlists-grid { grid-template-columns: 1fr 1fr; }
}

/* Daily Game specific banner & countdown */
.daily-done-card {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(29, 185, 84, 0.12) 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.daily-done-msg {
  font-size: 15px;
  font-weight: 800;
  color: #38bdf8;
}

.daily-done-sub {
  font-size: 12px;
  color: var(--text-sub);
}

.daily-countdown-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.daily-countdown-digits {
  font-family: monospace;
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 1px;
}

.daily-badge {
  font-size: 10px;
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 800;
  margin-left: 6px;
}

/* Daily Leaderboard Top 10 Highscores */
.daily-leaderboard-submit {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.leaderboard-prompt-title {
  font-size: 13px;
  font-weight: 800;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.leaderboard-input-row {
  display: flex;
  gap: 8px;
}

.leaderboard-name-input {
  flex: 1;
  height: 38px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.leaderboard-name-input:focus {
  border-color: #38bdf8;
}

.leaderboard-submit-btn {
  background: #38bdf8;
  color: #000;
  font-weight: 700;
  font-size: 13px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.leaderboard-submit-btn:hover {
  opacity: 0.9;
}

.daily-leaderboard-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.daily-leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(45, 55, 72, 0.5);
  padding-bottom: 6px;
}

.daily-reset-tag {
  font-size: 10px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 6px;
  border-radius: 6px;
}

.daily-leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--bg-surface);
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s;
}

.leaderboard-item.highlight-user {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.lb-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-rank {
  font-weight: 800;
  font-size: 11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-sub);
}

.lb-rank.gold { background: #eab308; color: #000; }
.lb-rank.silver { background: #94a3b8; color: #000; }
.lb-rank.bronze { background: #d97706; color: #000; }

.lb-name {
  color: var(--text-main);
  font-weight: 700;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-score {
  color: var(--accent);
  font-weight: 800;
}

.lb-time {
  font-size: 10px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Contact Modal Styles */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.contact-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.contact-input,
.contact-select,
.contact-textarea {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-main);
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-input:focus,
.contact-select:focus,
.contact-textarea:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.contact-select {
  cursor: pointer;
}

.contact-select option {
  background: var(--bg-surface);
  color: var(--text-main);
}

.contact-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.contact-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.contact-submit-btn {
  flex: 1;
  background: var(--accent);
  color: #000000;
  border: none;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.contact-submit-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(29, 185, 84, 0.35);
}

.contact-copy-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-sub);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.contact-copy-btn:hover {
  color: var(--text-main);
  border-color: #38bdf8;
}

/* ==================== FOOTER ==================== */
.app-footer {
  width: 100%;
  margin-top: auto;
  flex-shrink: 0;
  padding: 36px 16px 44px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  text-align: center;
}

.footer-content {
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
}

.footer-link {
  color: var(--text-sub);
  text-decoration: none;
  transition: color 0.15s;
  cursor: pointer;
}

.footer-link:hover {
  color: var(--accent);
}

.footer-sep {
  color: var(--text-muted);
  font-size: 10px;
}

.footer-copyright {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 600;
}

.footer-disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 560px;
  margin-top: 2px;
}
