:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #0f3460;
  --bg-card-correct: #1b5e20;
  --bg-card-wrong: #b71c1c;
  --accent: #e94560;
  --accent-hover: #ff6b81;
  --accent-green: #4caf50;
  --accent-gold: #f1c40f;
  --text-primary: #eaeaea;
  --text-secondary: #a0a0b0;
  --text-muted: #6c6c7e;
  --border: #2a2a4a;
  --drop-zone-bg: #2a2a4a;
  --shadow: rgba(0, 0, 0, 0.4);
  --transition: 0.3s ease;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.screen {
  display: none;
}

.screen.active {
  display: flex;
}

#start-screen {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.start-container {
  max-width: 500px;
  padding: 40px;
  text-align: center;
}

.game-title {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #ff9a56);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.game-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.rules {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
  text-align: left;
}

.rule {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.rule-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.btn {
  border: none;
  padding: 12px 32px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.mode-select {
  margin-bottom: 28px;
}

.mode-label {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 600;
}

.mode-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  flex: 1;
  min-width: 180px;
  font-family: inherit;
}

.btn-mode:hover {
  border-color: var(--accent);
  background: var(--bg-card);
}

.btn-mode.active-mode {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.15);
  color: var(--text-primary);
}

.mode-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.mode-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
  text-align: center;
}

.btn-mode.active-mode .mode-desc {
  color: var(--text-secondary);
}

.endless-toggle-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
}

.endless-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.endless-toggle-label input[type="checkbox"] {
  display: none;
}

.endless-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  transition: background var(--transition);
  flex-shrink: 0;
}

.endless-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all var(--transition);
}

.endless-toggle-label input:checked + .endless-switch {
  background: var(--accent);
}

.endless-toggle-label input:checked + .endless-switch::after {
  left: 23px;
  background: white;
}

.endless-label-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.endless-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 300px;
  text-align: center;
}

.filter-select {
  margin-bottom: 24px;
}

.filter-label {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 600;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: flex-end;
}

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

.filter-group-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-dropdown {
  padding: 8px 14px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 120px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.filter-dropdown:hover {
  border-color: var(--accent);
  background-color: var(--bg-card);
}

.filter-dropdown:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.3);
}

.filter-dropdown option {
  background: #1a1a2e;
  color: var(--text-primary);
}

.filter-count {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 10px;
  font-weight: 600;
}

.filter-count.filter-warning {
  color: #ff6b6b;
  animation: pulse 1.5s ease-in-out infinite;
}

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

.mode-badge {
  font-size: 0.7rem;
  background: var(--bg-card);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.year-hint-section {
  text-align: center;
  max-width: 500px;
}

.year-hint-text {
  font-size: 1.1rem;
  color: var(--text-primary);
}

.year-hint-text strong {
  color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

.btn-home {
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.2rem;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1;
}

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

.btn-primary:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  margin-top: 8px;
}

.btn-small:hover {
  background: var(--border);
  color: var(--text-primary);
}

#game-screen {
  flex-direction: column;
  min-height: 100vh;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}

.header-right {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.stat {
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.stat span {
  color: var(--text-primary);
  font-weight: 600;
}

.streak-stat span {
  color: var(--accent-gold) !important;
}

#lives {
  color: var(--accent);
  letter-spacing: 2px;
}

.game-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 24px;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.player-section {
  text-align: center;
  width: 100%;
  max-width: 400px;
}

#player-container {
  position: relative;
  min-height: 80px;
}

#yt-player {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

#player-container iframe {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.custom-play-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 28px;
  background: linear-gradient(135deg, var(--bg-card), #1a3a5c);
  border-radius: 12px;
  border: 2px dashed var(--border);
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  width: 100%;
  box-sizing: border-box;
}

.custom-play-btn:hover {
  border-color: var(--accent);
  border-style: solid;
  background: linear-gradient(135deg, rgba(233,69,96,0.15), rgba(15,52,96,0.8));
}

.custom-play-icon {
  font-size: 1.6rem;
  color: var(--accent);
  transition: transform 0.2s;
}

.custom-play-btn:hover .custom-play-icon {
  transform: scale(1.2);
}

.custom-play-text {
  letter-spacing: 0.5px;
}

.custom-play-btn.playing {
  border-style: solid;
  border-color: var(--accent-green);
  background: linear-gradient(135deg, rgba(76,175,80,0.1), rgba(15,52,96,0.8));
}

.custom-play-btn.playing .custom-play-icon {
  color: var(--accent-green);
}

#player-container.mystery-mode .custom-play-btn,
#player-container.has-track .custom-play-btn {
  display: flex;
}

.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 2px dashed var(--border);
  color: var(--text-secondary);
}

.placeholder-icon {
  font-size: 2rem;
}

.hint-text {
  margin-top: 10px;
  font-size: 1rem;
  color: var(--text-secondary);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 14px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.volume-icon {
  font-size: 1.1rem;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.volume-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.15s;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

.volume-slider::-moz-range-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}

.volume-value {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
  flex-shrink: 0;
}

.guess-section {
  text-align: center;
  width: 100%;
  max-width: 500px;
}

.guess-label {
  font-size: 1.05rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

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

#series-input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition);
}

#series-input:focus {
  border-color: var(--accent);
}

#series-input::placeholder {
  color: var(--text-muted);
}

.suggestions-list {
  list-style: none;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 180px;
  overflow-y: auto;
  background: var(--bg-secondary);
  display: none;
}

.suggestions-list.visible {
  display: block;
}

.suggestions-list li {
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--transition);
  font-size: 0.95rem;
  text-align: left;
}

.suggestions-list li:hover,
.suggestions-list li.highlighted {
  background: var(--bg-card);
}

.guess-feedback {
  margin-top: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 1.4em;
}

.guess-feedback.hidden {
  display: none;
}

.guess-feedback.correct {
  color: var(--accent-green);
}

.guess-feedback.wrong {
  color: var(--accent);
}

.tip-section {
  margin-top: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--accent-gold);
  animation: revealPop 0.3s ease;
}

.tip-content {
  text-align: left;
  margin-bottom: 10px;
}

.tip-item {
  padding: 6px 10px;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: rgba(241, 196, 15, 0.08);
  border-radius: 6px;
  border-left: 3px solid var(--accent-gold);
  line-height: 1.4;
}

.tip-item:last-child {
  margin-bottom: 0;
}

.tip-btn {
  background: var(--accent-gold) !important;
  color: #1a1a2e !important;
  font-weight: 700;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.85rem;
}

.tip-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(241, 196, 15, 0.4);
}

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

.placement-prompt {
  font-size: 1rem;
  color: var(--text-secondary);
}

.placement-prompt strong {
  color: var(--accent);
}

.timeline-section {
  width: 100%;
  overflow: hidden;
}

.timeline-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-align: center;
}

.timeline-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  padding: 16px 0 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-secondary);
}

.timeline-wrapper::-webkit-scrollbar {
  height: 6px;
}

.timeline-wrapper::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 3px;
}

.timeline-wrapper::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.timeline-track {
  position: relative;
  min-width: fit-content;
  padding: 0 20px;
}

.timeline-track::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
  transform: translateY(-50%);
  z-index: 0;
}

.timeline-cards {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
  z-index: 1;
}

.timeline-card {
  flex-shrink: 0;
  width: 120px;
  background: var(--bg-card);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  position: relative;
  z-index: 2;
  border: 2px solid transparent;
  transition: all var(--transition);
  box-shadow: 0 2px 10px var(--shadow);
  animation: cardFadeIn 0.4s ease;
}

.timeline-card.seed {
  border-color: var(--accent-gold);
}

.timeline-card.correct {
  border-color: var(--accent-green);
  background: var(--bg-card-correct);
}

.timeline-card.wrong {
  border-color: var(--accent);
  background: var(--bg-card-wrong);
}

.card-name {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.3;
  color: var(--text-primary);
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-year {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.timeline-card.correct .card-year,
.timeline-card.wrong .card-year {
  color: white;
}

.drop-zone {
  flex-shrink: 0;
  width: 50px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  position: relative;
  transition: all var(--transition);
  border-radius: 6px;
}

.drop-zone::before {
  content: '\25BC';
  font-size: 1.2rem;
  color: var(--text-muted);
  opacity: 0.4;
  transition: all var(--transition);
}

.drop-zone:hover {
  background: rgba(233, 69, 96, 0.1);
}

.drop-zone:hover::before {
  opacity: 1;
  color: var(--accent);
  transform: scale(1.3);
}

.drop-zone.disabled {
  pointer-events: none;
  opacity: 0;
}

.drop-zone.active-dz::before {
  color: var(--accent);
  opacity: 0.7;
  animation: dzPulse 1.2s ease infinite;
}

.reveal-section {
  text-align: center;
  max-width: 400px;
}

.reveal-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 30px var(--shadow);
  animation: revealPop 0.4s ease;
  margin-bottom: 16px;
}

.reveal-card-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.reveal-poster {
  width: 90px;
  min-width: 90px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 16px var(--shadow);
  object-fit: cover;
  flex-shrink: 0;
}

.reveal-card-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.reveal-card.correct-reveal {
  border: 2px solid var(--accent-green);
}

.reveal-card.wrong-reveal {
  border: 2px solid var(--accent);
}

.reveal-card h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
  text-align: left;
}

.reveal-card p {
  font-size: 1rem;
  color: var(--text-secondary);
  text-align: left;
}

#reveal-result {
  font-weight: 700;
  font-size: 1.05rem;
  margin-top: 8px;
}

.reveal-song {
  font-style: italic;
  color: var(--accent-gold);
  margin: 2px 0 4px 0;
  font-size: 0.95rem;
}

#reveal-result.result-correct {
  color: var(--accent-green);
}

#reveal-result.result-wrong {
  color: var(--accent);
}

#end-screen {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.end-container {
  max-width: 500px;
  padding: 40px;
  text-align: center;
}

#end-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.end-title-victory {
  background: linear-gradient(135deg, var(--accent-green), #81c784);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.end-title-defeat {
  background: linear-gradient(135deg, var(--accent), #ff9a56);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.end-message {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.final-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 32px;
}

.final-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.final-stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
}

.final-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: scale(0.5) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes correctPulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.5); }
  70% { box-shadow: 0 0 0 15px rgba(76, 175, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

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

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

@keyframes dzPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.animate-correct {
  animation: correctPulse 0.6s ease;
}

.animate-wrong {
  animation: wrongShake 0.5s ease;
}

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

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

.hs-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, margin 0.4s ease;
  margin-top: 0;
  width: 100%;
}

.hs-panel.hs-visible {
  max-height: 500px;
  margin-top: 16px;
}

.hs-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 12px;
}

.hs-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: hs-counter;
}

.hs-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--bg-secondary);
  margin-bottom: 6px;
  transition: background var(--transition);
}

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

.hs-entry.hs-top {
  background: rgba(241, 196, 15, 0.1);
  border: 1px solid rgba(241, 196, 15, 0.3);
}

.hs-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.hs-top .hs-rank {
  background: var(--accent-gold);
  color: #1a1a2e;
}

.hs-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hs-score {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent);
}

.hs-top .hs-score {
  color: var(--accent-gold);
}

.hs-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hs-name {
  font-weight: 600;
  color: var(--text);
  margin-left: 4px;
}

.name-entry {
  margin: 12px 0;
  text-align: center;
}

.name-entry.name-saved .name-input-row {
  display: none;
}

.name-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.name-input-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.name-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 1rem;
  width: 180px;
  outline: none;
  transition: border-color var(--transition);
}

.name-input:focus {
  border-color: var(--accent);
}

@media (max-width: 600px) {
  .game-title {
    font-size: 2rem;
  }

  .game-header {
    justify-content: center;
    text-align: center;
    padding: 12px 16px;
  }

  .header-right {
    justify-content: center;
    gap: 10px;
  }

  .guess-input-row {
    flex-direction: column;
  }

  .timeline-card {
    width: 90px;
    padding: 10px 6px;
  }

  .card-name {
    font-size: 0.7rem;
  }

  .drop-zone {
    width: 35px;
  }

  .start-container,
  .end-container {
    padding: 20px;
  }

  .final-stats {
    gap: 24px;
  }

  .final-stat-value {
    font-size: 2rem;
  }

  .mode-buttons {
    flex-direction: column;
  }

  .btn-mode {
    min-width: auto;
  }

  .mode-badge {
    display: none;
  }

  .filter-row {
    gap: 8px;
  }

  .filter-dropdown {
    min-width: 100px;
    font-size: 0.78rem;
    padding: 6px 10px;
    padding-right: 28px;
  }

  .mp-choice-buttons {
    flex-direction: column;
  }

  .mp-host-settings .btn-mode {
    min-width: auto;
  }

  .reveal-card-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .reveal-poster {
    width: 70px;
    min-width: 70px;
  }

  .reveal-card-info h2,
  .reveal-card-info p {
    text-align: center;
  }
}

.hitster-turn-section {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 16px 24px;
  text-align: center;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.hitster-turn-info {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.hitster-your-turn {
  color: var(--accent-green);
  font-weight: 700;
  font-size: 1.1rem;
}

.hitster-active-player {
  color: var(--accent-gold);
  font-weight: 700;
}

.hitster-reveal {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.1rem;
}

.hitster-challenge-sent {
  color: var(--accent-gold);
  font-size: 0.85rem;
  margin-left: 8px;
}

.hitster-turn-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.btn-hitster {
  background: linear-gradient(135deg, #f1c40f, #e94560);
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  padding: 14px 28px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all var(--transition);
  animation: hitsterPulse 1s ease infinite;
}

.btn-hitster:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(241, 196, 15, 0.6);
}

@keyframes hitsterPulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}
.hitster-challenge-section {
  text-align: center;
  max-width: 100%;
  margin-top: 16px;
  padding: 16px;
  background: rgba(241, 196, 15, 0.08);
  border-radius: 12px;
  border: 1px solid var(--accent-gold);
}
.hitster-all-timelines {
  margin-top: 20px;
}
.hitster-player-timeline {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.hitster-active-player-section {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.05);
}
.hitster-self-section {
  border-color: var(--accent-green);
  background: rgba(76, 175, 80, 0.05);
}
.hitster-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 4px 8px;
}
.hitster-player-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.hitster-player-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.hitster-mini-timeline .timeline-card {
  width: 70px;
  padding: 6px 4px;
}
.hitster-mini-timeline .card-name {
  font-size: 0.6rem;
  min-height: auto;
}
.hitster-mini-timeline .card-year {
  font-size: 0.75rem;
}
.timeline-card.mystery {
  background: linear-gradient(135deg, var(--bg-card), var(--accent));
  border: 2px dashed var(--accent);
  animation: mysteryPulse 1.5s ease infinite;
}
.timeline-card.stolen {
  background: rgba(241, 196, 15, 0.15);
  border-color: var(--accent-gold);
}
@keyframes mysteryPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

#mp-screen {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.mp-container {
  max-width: 500px;
  padding: 40px 20px;
  text-align: center;
  width: 100%;
}

.mp-step {
  margin-top: 20px;
}

.mp-label {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 600;
}

.mp-name-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.mp-name-row .name-input {
  width: 200px;
  text-align: center;
}

.mp-choice-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.mp-error {
  color: var(--accent);
  font-size: 0.9rem;
  margin-top: 10px;
}

.mp-room-code-box {
  background: var(--bg-secondary);
  border: 2px solid var(--accent-gold);
  border-radius: 16px;
  padding: 24px;
  margin: 20px 0;
}

.mp-code-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.mp-code {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 6px;
  font-family: 'Courier New', monospace;
}

.mp-player-section {
  margin: 16px 0;
}

.mp-section-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.mp-player-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.mp-player-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.mp-player-item.mp-self {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.1);
}

.mp-player-item.mp-disconnected {
  opacity: 0.5;
}

.mp-player-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.mp-host-badge {
  font-size: 0.7rem;
  background: var(--accent-gold);
  color: #1a1a2e;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.mp-host-settings {
  margin: 16px 0;
  text-align: left;
}

.mp-host-settings .mode-buttons {
  margin-bottom: 16px;
}

.mp-waiting {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 12px;
  animation: mpPulse 1.5s ease infinite;
}

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

.mp-scoreboard {
  margin: 16px 0;
  width: 100%;
  max-width: 400px;
}

.mp-scoreboard-title {
  font-size: 1.1rem;
  color: var(--accent-gold);
  margin-bottom: 12px;
}

.mp-scoreboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mp-score-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.mp-score-entry.mp-self {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.1);
}

.mp-score-entry.mp-first {
  border-color: var(--accent-gold);
  background: rgba(241, 196, 15, 0.1);
}

.mp-score-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mp-score-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.mp-first .mp-score-rank {
  background: var(--accent-gold);
  color: #1a1a2e;
}

.mp-score-name {
  font-weight: 600;
  font-size: 0.95rem;
}

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

.mp-score-pts {
  font-weight: 800;
  color: var(--accent);
  font-size: 1.05rem;
}

.mp-score-result {
  font-size: 1.1rem;
}

.mp-waiting-area {
  text-align: center;
  margin: 12px 0;
}

.mp-waiting-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  animation: mpPulse 1.5s ease infinite;
}

.mp-standings {
  margin: 20px 0;
  width: 100%;
}

.mp-standings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.mp-standing-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 2px solid var(--border);
}

.mp-standing-entry.mp-rank-1 {
  border-color: var(--accent-gold);
  background: rgba(241, 196, 15, 0.1);
}

.mp-standing-entry.mp-rank-2 {
  border-color: #a0a0b0;
  background: rgba(160, 160, 176, 0.1);
}

.mp-standing-entry.mp-rank-3 {
  border-color: #cd7f32;
  background: rgba(205, 127, 50, 0.1);
}

.mp-standing-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mp-standing-rank {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-gold);
  min-width: 32px;
}

.mp-rank-2 .mp-standing-rank { color: #a0a0b0; }
.mp-rank-3 .mp-standing-rank { color: #cd7f32; }

.mp-standing-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.mp-standing-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.mp-standing-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.mp-standing-score {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
}

.report-song-btn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  padding: 10px 18px;
  border-radius: 10px;
  border: 2px solid var(--accent);
  background: rgba(183, 28, 28, 0.85);
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.report-song-btn:hover {
  background: rgba(233, 69, 96, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(233, 69, 96, 0.4);
}

.report-song-btn.visible {
  display: block;
  animation: reportFadeIn 0.3s ease;
}

.report-song-btn.reported {
  border-color: var(--accent-green);
  background: rgba(27, 94, 32, 0.85);
}

.report-song-btn.reported:hover {
  background: rgba(76, 175, 80, 0.95);
}

@keyframes reportFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .report-song-btn {
    bottom: 12px;
    right: 12px;
    padding: 8px 14px;
    font-size: 0.78rem;
  }
}

@media (max-width: 600px) {
  .mp-code {
    font-size: 2rem;
    letter-spacing: 4px;
  }

  .mp-container {
    padding: 20px 16px;
  }

  .mp-choice-buttons {
    flex-direction: column;
  }

  .mp-host-settings .mode-buttons {
    flex-direction: column;
  }

  .mp-host-settings .btn-mode {
    min-width: auto;
  }
}
