/* ══════════════════════════════════════
   イントロドン！ — Retro Neon Arcade
   ══════════════════════════════════════ */

:root {
  --bg:        #07080f;
  --bg2:       #0d0f1a;
  --cyan:      #00e5ff;
  --pink:      #ff2d78;
  --yellow:    #ffe500;
  --green:     #00ff88;
  --white:     #f0f0f8;
  --muted:     #4a5070;
  --card:      rgba(255,255,255,0.05);
  --card-bdr:  rgba(255,255,255,0.08);
  --font-disp: 'Bebas Neue', sans-serif;
  --font-body: 'Noto Sans JP', sans-serif;
  --radius:    14px;
  --glow-c:    0 0 20px rgba(0,229,255,0.4);
  --glow-p:    0 0 20px rgba(255,45,120,0.4);
  --glow-y:    0 0 20px rgba(255,229,0,0.5);
}

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

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  overflow-x: hidden;
}

/* ── Screens ── */
.screen {
  display: none;
  min-height: 100vh;
  width: 100%;
}
.screen.active { display: flex; }

/* ══════════════
   TITLE SCREEN
   ══════════════ */
#screen-title {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 20px 60px;
  position: relative;
}

.title-bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,229,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.title-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
}

.title-logo {
  text-align: center;
  margin-bottom: 44px;
}

.logo-note {
  display: block;
  font-size: 48px;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(var(--glow-c));
}

.logo-text {
  font-family: var(--font-disp);
  font-size: clamp(52px, 10vw, 80px);
  letter-spacing: 4px;
  color: var(--cyan);
  text-shadow: 0 0 30px rgba(0,229,255,0.6), 0 0 60px rgba(0,229,255,0.3);
  line-height: 1;
}

.logo-exclaim { color: var(--pink); text-shadow: 0 0 30px rgba(255,45,120,0.8); }

.logo-sub {
  font-family: var(--font-disp);
  letter-spacing: 8px;
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.section-label {
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  margin-top: 28px;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mode-btn {
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  color: #c2d0e6;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.mode-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.22);
}

.mode-btn.active {
  color: var(--cyan);
  background: rgba(0,229,255,0.12);
  border-color: rgba(0,229,255,0.5);
  box-shadow: 0 0 0 1px rgba(0,229,255,0.18), 0 12px 28px rgba(0,229,255,0.12);
}

.mode-panel {
  display: none;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(12px);
  margin-top: 18px;
}

.mode-panel.active {
  display: block;
}

.mode-panel .section-label {
  margin-top: 0;
}

.mode-panel-label {
  margin-bottom: 14px;
}

.mode-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.artist-search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.artist-search-input,
.artist-search-btn {
  border-radius: 14px;
  font-family: var(--font-body);
}

.artist-search-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(7,8,15,0.85);
  color: var(--white);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.artist-search-input::placeholder {
  color: rgba(240,240,248,0.38);
}

.artist-search-input:focus {
  border-color: rgba(0,229,255,0.6);
  box-shadow: 0 0 0 4px rgba(0,229,255,0.12);
}

.artist-search-btn {
  min-width: 90px;
  padding: 0 18px;
  border: none;
  background: linear-gradient(135deg, rgba(0,229,255,0.95), rgba(0,170,255,0.9));
  color: #03111a;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 12px 30px rgba(0,229,255,0.22);
}

.artist-search-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(0,229,255,0.3);
}

.artist-search-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.search-status {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  min-height: 2.8em;
}

.search-status.success { color: #9cf8d0; }
.search-status.error { color: #ff9cbc; }

.artist-results {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.artist-result-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  color: var(--white);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.artist-result-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
}

.artist-result-card.selected {
  border-color: rgba(0,229,255,0.8);
  background: rgba(0,229,255,0.12);
  box-shadow: 0 0 0 1px rgba(0,229,255,0.28), 0 10px 30px rgba(0,229,255,0.14);
}

.artist-result-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,45,120,0.9), rgba(0,229,255,0.9));
  color: #fff;
  font-family: var(--font-disp);
  font-size: 24px;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.artist-result-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.artist-result-name {
  display: block;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artist-result-meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.artist-selected-card {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,45,120,0.12), rgba(0,229,255,0.1));
  border: 1px solid rgba(255,255,255,0.1);
}

.artist-selected-card.hidden {
  display: none;
}

.artist-selected-art {
  width: 86px;
  height: 86px;
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}

.artist-selected-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.artist-selected-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ff2d78, #00c7ff);
  color: #fff;
  font-family: var(--font-disp);
  font-size: 36px;
  letter-spacing: 1px;
}

.artist-selected-copy {
  min-width: 0;
}

.artist-selected-label {
  color: rgba(255,255,255,0.45);
  font-family: var(--font-disp);
  font-size: 12px;
  letter-spacing: 3px;
  margin-bottom: 6px;
}

.artist-selected-name {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.15;
}

.artist-selected-meta {
  color: #c2d0e6;
  font-size: 13px;
  margin-top: 6px;
}

.artist-selected-note {
  color: var(--white);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 8px;
}

.artist-selected-note.muted {
  color: #c2d0e6;
}

.artist-selected-note.error {
  color: #ff9cbc;
}

/* Genre grid */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.genre-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 6px;
  background: var(--card);
  border: 1px solid var(--card-bdr);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--white);
  font-family: var(--font-body);
}

.genre-btn:hover {
  background: rgba(0,229,255,0.08);
  border-color: rgba(0,229,255,0.3);
  transform: translateY(-2px);
}

.genre-btn.selected {
  background: rgba(0,229,255,0.12);
  border-color: var(--cyan);
  box-shadow: var(--glow-c);
}

.genre-emoji { font-size: 22px; }
.genre-name  { font-size: 12px; font-weight: 700; }

/* Count selector */
.count-selector {
  display: flex;
  gap: 10px;
}

.count-btn {
  flex: 1;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--card-bdr);
  border-radius: 10px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.count-btn:hover { border-color: rgba(255,229,0,0.4); }
.count-btn.active {
  background: rgba(255,229,0,0.1);
  border-color: var(--yellow);
  color: var(--yellow);
  box-shadow: var(--glow-y);
}

/* Start button */
.start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin-top: 28px;
  padding: 20px;
  background: linear-gradient(135deg, #ff2d78, #ff006e);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-family: var(--font-disp);
  font-size: 24px;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 30px rgba(255,45,120,0.5);
}

.start-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(255,45,120,0.7);
}

.start-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-icon { font-size: 20px; }

.start-note {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  margin-top: 14px;
}

/* ══════════════
   LOADING
   ══════════════ */
#screen-loading {
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.loading-inner { text-align: center; }

.loading-waveform {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  height: 60px;
  margin-bottom: 24px;
}

.loading-waveform span {
  display: block;
  width: 6px;
  border-radius: 3px;
  background: var(--cyan);
  animation: waveLoad 0.8s ease-in-out infinite alternate;
  box-shadow: 0 0 8px var(--cyan);
}

.loading-waveform span:nth-child(1)  { height: 20px; animation-delay: 0s; }
.loading-waveform span:nth-child(2)  { height: 40px; animation-delay: 0.1s; }
.loading-waveform span:nth-child(3)  { height: 55px; animation-delay: 0.2s; }
.loading-waveform span:nth-child(4)  { height: 35px; animation-delay: 0.3s; }
.loading-waveform span:nth-child(5)  { height: 50px; animation-delay: 0.4s; }
.loading-waveform span:nth-child(6)  { height: 30px; animation-delay: 0.5s; }
.loading-waveform span:nth-child(7)  { height: 45px; animation-delay: 0.6s; }
.loading-waveform span:nth-child(8)  { height: 20px; animation-delay: 0.7s; }
.loading-waveform span:nth-child(9)  { height: 38px; animation-delay: 0.8s; }
.loading-waveform span:nth-child(10) { height: 25px; animation-delay: 0.9s; }

.loading-text {
  color: var(--muted);
  letter-spacing: 2px;
  font-size: 14px;
}

/* ══════════════
   QUIZ SCREEN
   ══════════════ */
#screen-quiz {
  flex-direction: column;
  align-items: center;
}

.quiz-header {
  width: 100%;
  max-width: 540px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
}

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

.q-genre {
  background: rgba(0,229,255,0.12);
  border: 1px solid rgba(0,229,255,0.3);
  color: var(--cyan);
  display: inline-block;
  max-width: 240px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.q-count { color: var(--muted); font-size: 13px; }

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

.score-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.score-label {
  font-family: var(--font-disp);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--muted);
}

.score-value {
  font-family: var(--font-disp);
  font-size: 28px;
  color: var(--yellow);
  text-shadow: var(--glow-y);
  line-height: 1;
  transition: all 0.3s;
}

.quiz-exit-btn {
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: #c2d0e6;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, color 0.2s;
}

.quiz-exit-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.28);
  color: var(--white);
}

.progress-bar-wrap {
  width: 100%;
  max-width: 540px;
  height: 3px;
  background: rgba(255,255,255,0.06);
  padding: 0 20px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  border-radius: 2px;
  transition: width 0.5s ease;
  width: 0%;
  box-shadow: 0 0 8px rgba(0,229,255,0.6);
}

.quiz-body {
  width: 100%;
  max-width: 540px;
  padding: 20px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* Album art */
.art-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.album-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #05060b;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.album-art.blurred {
  opacity: 0;
  transform: scale(1.08);
}

.art-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  color: rgba(255,255,255,0.92);
  background:
    radial-gradient(circle at 30% 20%, rgba(0,229,255,0.2), transparent 35%),
    radial-gradient(circle at 70% 80%, rgba(255,45,120,0.18), transparent 30%),
    linear-gradient(160deg, rgba(6,8,18,0.98), rgba(8,10,20,1));
  transition: opacity 0.4s;
  z-index: 1;
}

.art-overlay span {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  box-shadow: inset 0 0 24px rgba(0,229,255,0.08), 0 10px 24px rgba(0,0,0,0.35);
}

.art-overlay.hidden { opacity: 0; pointer-events: none; }

/* Waveform */
.waveform {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--card-bdr);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.waveform::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(0,229,255,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.waveform-bars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 52px;
  width: 100%;
}

.wbar {
  width: 4px;
  border-radius: 2px;
  background: var(--cyan);
  transition: height 0.1s;
  animation: wavePause 2s ease-in-out infinite alternate;
}

.waveform.playing .wbar {
  animation-name: wavePlay;
  box-shadow: 0 0 6px rgba(0,229,255,0.5);
}

.play-duration {
  display: flex;
  align-items: center;
  gap: 8px;
}

.duration-now {
  font-family: var(--font-disp);
  font-size: 22px;
  color: var(--cyan);
  text-shadow: var(--glow-c);
}

.duration-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
}

/* Level dots */
.level-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.3s;
}

.dot.active {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: var(--glow-c);
}

.dot.used {
  background: var(--muted);
  border-color: var(--muted);
}

/* Play controls */
.play-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, rgba(0,229,255,0.2), rgba(0,229,255,0.08));
  border: 1px solid rgba(0,229,255,0.5);
  border-radius: var(--radius);
  color: var(--cyan);
  font-family: var(--font-disp);
  font-size: 20px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 15px rgba(0,229,255,0.15);
}

.btn-play:hover:not(:disabled) {
  background: rgba(0,229,255,0.2);
  box-shadow: 0 0 30px rgba(0,229,255,0.3);
}

.btn-play:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-play.playing {
  background: rgba(255,229,0,0.1);
  border-color: var(--yellow);
  color: var(--yellow);
  animation: playPulse 0.8s ease-in-out infinite alternate;
}

.btn-hint {
  width: 100%;
  padding: 11px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-hint:hover:not(:disabled) {
  border-color: rgba(255,229,0,0.3);
  color: var(--yellow);
}

.btn-hint:disabled { opacity: 0.3; cursor: not-allowed; }
.hint-cost { font-size: 11px; opacity: 0.7; }

/* Choices */
.choices {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-btn {
  width: 100%;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--card-bdr);
  border-radius: var(--radius);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.choice-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  transform: translateX(4px);
}

.choice-track { font-weight: 700; font-size: 14px; }
.choice-artist { font-size: 12px; color: var(--muted); }

.choice-btn.correct {
  background: rgba(0,255,136,0.12);
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 15px rgba(0,255,136,0.2);
}

.choice-btn.correct .choice-artist { color: rgba(0,255,136,0.6); }

.choice-btn.wrong {
  background: rgba(255,45,120,0.1);
  border-color: rgba(255,45,120,0.4);
  color: rgba(255,80,120,0.7);
}

.choice-btn.dim { opacity: 0.3; }
.choice-btn:disabled { cursor: default; }

/* ══════════════
   ANSWER OVERLAY
   ══════════════ */
.answer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  transition: opacity 0.3s;
}

.answer-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.answer-card {
  background: #0f1120;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 32px 28px;
  text-align: center;
  max-width: 360px;
  width: 100%;
  animation: cardPop 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.answer-verdict {
  font-family: var(--font-disp);
  font-size: 32px;
  letter-spacing: 3px;
  margin-bottom: 16px;
}

.answer-verdict.correct { color: var(--green); text-shadow: 0 0 20px rgba(0,255,136,0.6); }
.answer-verdict.wrong   { color: var(--pink);  text-shadow: 0 0 20px rgba(255,45,120,0.6); }

.ans-art {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  object-fit: cover;
  margin: 0 auto 14px;
  display: block;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.ans-track  { font-size: 17px; font-weight: 900; margin-bottom: 4px; }
.ans-artist { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

.ans-pts {
  font-family: var(--font-disp);
  font-size: 28px;
  color: var(--yellow);
  text-shadow: var(--glow-y);
}

.answer-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.answer-btn-primary,
.answer-btn-secondary {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
}

.answer-btn-primary {
  border: none;
  background: linear-gradient(135deg, #ff2d78, #ff006e);
  color: #fff;
  box-shadow: 0 12px 24px rgba(255,45,120,0.28);
}

.answer-btn-secondary {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: #c2d0e6;
}

.answer-btn-primary:hover,
.answer-btn-secondary:hover {
  transform: translateY(-1px);
}

.answer-btn-secondary:hover {
  border-color: rgba(255,255,255,0.28);
  color: var(--white);
}

/* Confetti */
.confetti-piece {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 200;
  animation: confettiFall linear forwards;
}

/* Flash overlay */
.flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
  animation: flashRed 0.5s ease-out forwards;
}

/* ══════════════
   RESULT SCREEN
   ══════════════ */
#screen-result {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.result-inner {
  width: 100%;
  max-width: 540px;
  text-align: center;
}

.result-logo { font-size: 52px; margin-bottom: 8px; }

.result-title {
  font-family: var(--font-disp);
  font-size: 48px;
  letter-spacing: 6px;
  color: var(--cyan);
  text-shadow: var(--glow-c);
  margin-bottom: 20px;
}

.result-context {
  margin-top: -6px;
  margin-bottom: 16px;
  color: #c2d0e6;
  font-size: 14px;
  letter-spacing: 1px;
}

.result-score-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.result-score {
  font-family: var(--font-disp);
  font-size: 72px;
  color: var(--yellow);
  text-shadow: var(--glow-y);
  line-height: 1;
}

.result-score-unit {
  font-family: var(--font-disp);
  font-size: 24px;
  color: var(--muted);
}

.result-rank {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  min-height: 28px;
}

.result-stats {
  background: var(--card);
  border: 1px solid var(--card-bdr);
  border-radius: var(--radius);
  padding: 14px 20px;
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--muted);
}

.result-stats strong { display: block; font-size: 22px; color: var(--white); font-weight: 900; }

.result-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 24px;
  padding-right: 4px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--card);
  border-radius: 10px;
  font-size: 13px;
  text-align: left;
}

.history-art {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.history-info { flex: 1; overflow: hidden; }
.history-track  { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-artist { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.history-pts {
  font-family: var(--font-disp);
  font-size: 16px;
  flex-shrink: 0;
}

.history-pts.correct { color: var(--green); }
.history-pts.wrong   { color: var(--pink); }

.result-share {
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  text-align: left;
}

.result-share-title {
  font-family: var(--font-disp);
  font-size: 18px;
  letter-spacing: 3px;
  color: var(--cyan);
  margin-bottom: 8px;
}

.result-share-url {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.22);
  color: #c2d0e6;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
}

.result-share-btns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.share-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.share-btn:hover {
  transform: translateY(-1px);
}

.share-btn-x {
  background: linear-gradient(135deg, #1f2937, #111827);
  box-shadow: 0 12px 24px rgba(17,24,39,0.28);
}

.share-btn-copy {
  background: linear-gradient(135deg, rgba(0,229,255,0.9), rgba(0,170,255,0.82));
  color: #03111a;
  box-shadow: 0 12px 24px rgba(0,229,255,0.22);
}

.share-feedback {
  min-height: 1.4em;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.share-feedback.success {
  color: #9cf8d0;
}

.share-feedback.error {
  color: #ff9cbc;
}

.result-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-btn-primary {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #ff2d78, #ff006e);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-family: var(--font-disp);
  font-size: 22px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 24px rgba(255,45,120,0.4);
}

.result-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(255,45,120,0.6);
}

.result-btn-secondary {
  width: 100%;
  padding: 13px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.result-btn-secondary:hover {
  border-color: rgba(255,255,255,0.3);
  color: var(--white);
}

/* ══════════════
   ANIMATIONS
   ══════════════ */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

@keyframes waveLoad {
  from { transform: scaleY(0.3); opacity: 0.5; }
  to   { transform: scaleY(1);   opacity: 1; }
}

@keyframes wavePause {
  0%   { height: 12px; }
  100% { height: 16px; }
}

@keyframes wavePlay {
  0%   { height: var(--h-min, 8px); }
  100% { height: var(--h-max, 48px); }
}

@keyframes playPulse {
  from { box-shadow: 0 0 10px rgba(255,229,0,0.3); }
  to   { box-shadow: 0 0 30px rgba(255,229,0,0.7); }
}

@keyframes cardPop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

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

@keyframes flashRed {
  0%   { background: rgba(255,45,120,0.3); }
  100% { background: transparent; }
}

@keyframes scoreUp {
  0%   { transform: scale(1.4); }
  100% { transform: scale(1);   }
}

.score-pop { animation: scoreUp 0.3s ease-out; }

/* ══════════════
   RESPONSIVE
   ══════════════ */
@media (max-width: 400px) {
  .genre-grid { grid-template-columns: repeat(3, 1fr); }
  .logo-text  { font-size: 44px; }
}

@media (max-width: 560px) {
  .logo-line1,
  .logo-line2 { display: block; }

  .mode-switch {
    grid-template-columns: 1fr;
  }

  .quiz-header {
    align-items: flex-start;
  }

  .header-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }

  .artist-search-form {
    grid-template-columns: 1fr;
  }

  .artist-search-btn {
    min-height: 48px;
  }

  .artist-selected-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .artist-selected-art {
    width: 100%;
    height: 160px;
  }

  .result-share-btns {
    grid-template-columns: 1fr;
  }

  .q-genre {
    max-width: 170px;
  }
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 2px; }
