:root {
  --bg: #101226;
  --panel: #1a1d3a;
  --panel-edge: #2e3160;
  --text: #e8e9f5;
  --muted: #9aa3c7;
  --good: #00b09b;
  --bad: #e05252;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(1200px 800px at 50% -10%, #232752 0%, var(--bg) 60%);
  color: var(--text);
  font-family: "Montserrat", system-ui, -apple-system, sans-serif;
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 16px;
}
.app { width: min(720px, 100%); }
.screen { display: none; flex-direction: column; align-items: center; text-align: center; gap: 22px; }
.screen.active { display: flex; }

/* start */
.emblem .wave { display: flex; gap: 8px; align-items: flex-end; height: 56px; }
.emblem .wave span {
  width: 10px; border-radius: 6px; background: linear-gradient(180deg, #56b4e9, #2e3160);
  animation: eq 1.1s ease-in-out infinite;
}
.emblem .wave span:nth-child(1){ height: 30%; animation-delay: 0s; }
.emblem .wave span:nth-child(2){ height: 70%; animation-delay: .15s; background: linear-gradient(180deg, #e69f00, #2e3160); }
.emblem .wave span:nth-child(3){ height: 100%; animation-delay: .3s; background: linear-gradient(180deg, #009e73, #2e3160); }
.emblem .wave span:nth-child(4){ height: 60%; animation-delay: .45s; background: linear-gradient(180deg, #e69f00, #2e3160); }
.emblem .wave span:nth-child(5){ height: 40%; animation-delay: .6s; background: linear-gradient(180deg, #56b4e9, #2e3160); }
@keyframes eq { 0%,100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }
h1 { font-size: clamp(2.6rem, 8vw, 3.6rem); font-weight: 700; letter-spacing: .04em; }
.tagline { color: var(--muted); font-style: italic; font-size: 1.3rem; margin-top: -14px; }
.desc { color: var(--muted); line-height: 1.6; }
.hint { color: var(--muted); font-size: .8rem; opacity: .7; }
.btn-primary {
  background: linear-gradient(180deg, #2e3160, #1d1f3d);
  border: 1px solid var(--panel-edge); color: var(--text);
  font: inherit; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 16px 44px; border-radius: 14px; cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.btn-primary:hover { transform: translateY(-2px); border-color: #56b4e9; }

/* game */
.hud { display: flex; justify-content: space-between; width: 100%; align-items: center; gap: 12px; }
.hud-left, .hud-right { display: flex; flex-direction: column; gap: 2px; min-width: 90px; }
.hud-right { align-items: flex-end; }
.label { color: var(--muted); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.hud-left span:last-child, .hud-right span:last-child { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.lives { display: flex; gap: 6px; }
.life { width: 14px; height: 14px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 8px rgba(224,82,82,.6); transition: opacity .3s; }
.life.lost { opacity: .18; box-shadow: none; }

.subtitle-card {
  width: 100%; background: linear-gradient(180deg, #1c1f3d, #161831);
  border: 1px solid var(--panel-edge); border-radius: 18px;
  padding: 28px 24px; min-height: 140px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  position: relative; overflow: hidden;
}
.subtitle-line { font-size: clamp(1.4rem, 4.5vw, 2rem); font-weight: 500; line-height: 1.4; max-width: 90%; }
.speaker-chip {
  display: flex; align-items: center; gap: 8px;
  font-size: .9rem; font-weight: 600; letter-spacing: .05em;
  padding: 6px 16px; border-radius: 999px; border: 1px solid transparent;
  opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s;
}
.speaker-chip.show { opacity: 1; transform: translateY(0); }
.speaker-chip .dot { width: 12px; height: 12px; border-radius: 50%; }

.timer-track { width: 100%; height: 8px; background: #0d0f22; border-radius: 999px; overflow: hidden; }
.timer-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #56b4e9, #009e73); border-radius: 999px; transition: none; }

.speakers { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.speaker-btn {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 2px solid var(--panel-edge); border-radius: 14px;
  padding: 12px 18px; color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
  transition: transform .12s, border-color .12s, opacity .2s;
}
.speaker-btn:hover { transform: translateY(-2px); border-color: #56b4e9; }
.speaker-btn:disabled { opacity: .55; cursor: default; }
.speaker-btn .dot { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.speaker-btn.correct { border-color: var(--good); box-shadow: 0 0 0 3px rgba(0,176,155,.35); }
.speaker-btn.wrong { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(224,82,82,.35); }

.feedback {
  min-height: 34px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: 1rem;
  opacity: 0; transition: opacity .2s;
}
.feedback.show { opacity: 1; }
.feedback.good { color: var(--good); }
.feedback.bad { color: var(--bad); }

/* game over */
.final-score { font-size: 2.4rem; font-weight: 700; }
.final-best { color: var(--muted); }

@media (max-width: 520px) {
  .hud-left, .hud-right { min-width: 64px; }
  .hud-left span:last-child, .hud-right span:last-child { font-size: 1.25rem; }
  .speaker-btn { padding: 10px 12px; font-size: .9rem; }
}
