:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: rgba(255, 255, 255, 0.09);
  --panel-strong: rgba(255, 255, 255, 0.14);
  --text: #f8f4eb;
  --muted: #bcb5a7;
  --gold: #ffd166;
  --mint: #55e6a5;
  --red: #ff5c7a;
  --blue: #6ab7ff;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 209, 102, 0.18), transparent 28%),
    radial-gradient(circle at 82% 20%, rgba(85, 230, 165, 0.16), transparent 26%),
    linear-gradient(140deg, #121316 0%, #20202a 48%, #121316 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(980px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 56px);
  display: grid;
  place-items: center;
}

.screen {
  display: none;
  width: 100%;
  animation: rise 260ms ease both;
}

.screen.is-active {
  display: grid;
  gap: clamp(22px, 5vw, 42px);
}

#menuScreen {
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  align-items: center;
}

.brand-block h1 {
  margin: 0;
  max-width: 7ch;
  font-size: clamp(4.25rem, 14vw, 9.5rem);
  line-height: 0.82;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tagline {
  max-width: 560px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.55;
}

.menu-panel,
.content-panel,
.lyric-card {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.menu-panel {
  padding: clamp(18px, 4vw, 28px);
}

.stat-card {
  padding: 24px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.stat-card span,
.hud-item span,
.guess-form label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(2.7rem, 8vw, 5rem);
  line-height: 1;
}

.menu-actions {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.menu-actions.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.primary-button,
.secondary-button {
  min-height: 52px;
  border-radius: 8px;
  padding: 0 20px;
  color: #111217;
  font-weight: 900;
  transition: transform 150ms ease, filter 150ms ease, background 150ms ease;
}

.primary-button {
  background: var(--gold);
}

.secondary-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.content-panel {
  width: min(720px, 100%);
  justify-self: center;
  padding: clamp(22px, 5vw, 42px);
}

.content-panel h2,
.result-panel h2 {
  margin: 0;
  font-size: clamp(2.1rem, 7vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.rules-list {
  margin: 26px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.7;
}

#gameScreen {
  max-width: 820px;
  justify-self: center;
}

.game-hud {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.hud-item strong {
  display: block;
  min-width: 72px;
  font-size: clamp(2rem, 7vw, 3.5rem);
  line-height: 1;
}

.align-right {
  text-align: right;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.progress-fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--mint));
  transform-origin: left;
  transition: transform 220ms linear;
}

.lyric-card {
  min-height: 270px;
  padding: clamp(22px, 5vw, 42px);
  display: grid;
  align-content: center;
}

.artist-hint {
  margin: 0 0 18px;
  color: var(--blue);
  font-weight: 800;
}

.lyric-text {
  margin: 0;
  font-size: clamp(2rem, 7vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.round-feedback {
  min-height: 28px;
  margin: 20px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.guess-form {
  display: grid;
  gap: 12px;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

input {
  width: 100%;
  min-height: 58px;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.24);
  outline: none;
}

input:focus {
  border-color: var(--gold);
}

.skip-button {
  justify-self: start;
}

.final-score {
  display: block;
  margin-top: 16px;
  font-size: clamp(4rem, 18vw, 9rem);
  line-height: 0.9;
}

.new-high-score {
  min-height: 28px;
  color: var(--mint);
  font-weight: 900;
}

.is-correct {
  animation: correctPulse 540ms ease both;
}

.is-wrong {
  animation: wrongShake 430ms ease both;
  border-color: var(--red);
}

.score-pop {
  animation: scorePop 320ms ease both;
}

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

@keyframes correctPulse {
  0%,
  100% {
    box-shadow: var(--shadow);
  }
  45% {
    box-shadow: 0 0 0 5px rgba(85, 230, 165, 0.25), var(--shadow);
  }
}

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

@keyframes scorePop {
  45% {
    transform: scale(1.14);
    color: var(--mint);
  }
}

@media (max-width: 760px) {
  #menuScreen {
    grid-template-columns: 1fr;
  }

  .brand-block h1 {
    max-width: 100%;
    font-size: clamp(4.2rem, 22vw, 7rem);
  }

  .game-hud {
    grid-template-columns: 1fr 1fr;
  }

  .progress-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .input-row,
  .menu-actions.compact {
    grid-template-columns: 1fr;
  }

  .skip-button {
    justify-self: stretch;
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding: 16px;
  }

  .lyric-card {
    min-height: 230px;
  }

  .primary-button,
  .secondary-button,
  input {
    min-height: 50px;
  }
}
