:root {
  --bg: #08090d;
  --panel: #111620;
  --panel-2: #171d29;
  --line: #2e384d;
  --text: #f5f7ff;
  --muted: #a8b1c7;
  --hot: #ff3d8b;
  --gold: #f7c948;
  --cyan: #4ce5ff;
  --green: #54f59b;
  --red: #ff5b6e;
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 61, 139, 0.22), transparent 32rem),
    radial-gradient(circle at 82% 24%, rgba(76, 229, 255, 0.15), transparent 28rem),
    linear-gradient(180deg, #0b0b10 0%, var(--bg) 100%);
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero-panel,
.play-surface,
.side-panel > div {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(17, 22, 32, 0.84);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
}

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 150px;
  padding: 26px;
  border-radius: 8px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  display: block;
  width: 72px;
  height: 72px;
  border: 2px solid var(--hot);
  border-radius: 50%;
  object-fit: cover;
  background: #000;
  box-shadow: 0 0 0 6px rgba(255, 61, 139, 0.08), 0 0 35px rgba(255, 61, 139, 0.45);
}

.eyebrow,
.panel-label {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow: 0 0 24px rgba(255, 61, 139, 0.48);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 12px;
  min-width: min(100%, 430px);
}

.stat-row div {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.26);
}

.stat-row span {
  display: block;
  color: var(--gold);
  font-size: 1.7rem;
  font-weight: 900;
}

.stat-row small {
  color: var(--muted);
}

.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 18px;
  margin-top: 18px;
}

.play-surface {
  min-height: 560px;
  padding: 28px;
  border-radius: 8px;
}

.meter-shell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 230px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 61, 139, 0.12), transparent, rgba(76, 229, 255, 0.1)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 38px),
    #080b11;
  transition: min-height 180ms ease;
}

.meter-shell.showing-reaction {
  min-height: clamp(220px, 56vw, 420px);
  aspect-ratio: 16 / 9;
}

.pulse-ring {
  position: absolute;
  width: 130px;
  height: 130px;
  border: 2px solid rgba(255, 61, 139, 0.78);
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(255, 61, 139, 0.7), inset 0 0 28px rgba(76, 229, 255, 0.24);
}

.waveform {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 130px;
  width: min(100%, 620px);
}

.waveform span {
  width: 12px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(var(--hot), var(--gold));
  box-shadow: 0 0 18px rgba(255, 61, 139, 0.55);
  transform-origin: center;
  animation: idleWave 1.6s ease-in-out infinite;
}

.waveform span:nth-child(2n) {
  animation-delay: -0.4s;
  background: linear-gradient(var(--cyan), var(--green));
}

.waveform span:nth-child(3n) {
  animation-delay: -0.8s;
  height: 62px;
}

body.playing .waveform span {
  animation-duration: 0.42s;
}

.reaction-embed {
  position: absolute;
  inset: 0;
  z-index: 4;
  padding: 10px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 61, 139, 0.22), transparent 26rem),
    #05060a;
}

.reaction-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 70px rgba(0, 0, 0, 0.55);
}

@keyframes idleWave {
  0%,
  100% {
    transform: scaleY(0.55);
  }
  50% {
    transform: scaleY(1.35);
  }
}

.attempt-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.attempt {
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.22);
  font-weight: 900;
}

.attempt.active {
  color: var(--bg);
  border-color: var(--gold);
  background: var(--gold);
}

.attempt.wrong {
  color: white;
  border-color: rgba(255, 91, 110, 0.7);
  background: rgba(255, 91, 110, 0.22);
}

.attempt.correct {
  color: var(--bg);
  border-color: var(--green);
  background: var(--green);
}

.controls-row,
.footer-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  color: var(--text);
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.primary-button,
.submit-button {
  background: linear-gradient(135deg, var(--hot), #a332ff);
  box-shadow: 0 10px 24px rgba(255, 61, 139, 0.24);
  font-weight: 900;
}

.ghost-button {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.text-button {
  min-height: auto;
  padding: 0;
  color: var(--muted);
  border: 0;
  background: transparent;
}

.guess-form {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 22px;
}

.guess-form label {
  grid-column: span 1;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.guess-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  outline: 0;
}

.guess-form input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(76, 229, 255, 0.12);
}

#playerName {
  grid-row: 2;
}

#guessInput {
  grid-row: 2;
}

.submit-button {
  grid-row: 2;
}

.status-line {
  min-height: 24px;
  margin: 18px 0 0;
  color: var(--muted);
}

.status-line.good {
  color: var(--green);
}

.status-line.bad {
  color: var(--red);
}

.side-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.side-panel > div {
  border-radius: 8px;
  padding: 20px;
}

.answer-panel h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.answer-timestamp {
  margin: 0 0 10px;
  color: var(--gold);
  font-weight: 800;
}

.answer-panel a {
  color: var(--cyan);
}

ol {
  margin: 0;
  padding-left: 22px;
}

li {
  margin: 8px 0;
  color: var(--muted);
}

li strong {
  color: var(--text);
}

.leaderboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-actions {
  margin-top: 18px;
}

.dev-panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(17, 22, 32, 0.9);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.35);
}

.dev-head,
.dev-layout,
.dev-button-row {
  display: flex;
  gap: 14px;
}

.dev-head {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.dev-head h2,
.dev-current h3 {
  margin: 0;
}

.dev-count {
  color: var(--gold);
  font-weight: 900;
}

.dev-layout {
  align-items: stretch;
}

.dev-list-shell {
  width: min(100%, 360px);
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr);
  gap: 12px;
}

.dev-list-shell input,
.dev-editor input,
.dev-editor textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.24);
}

.dev-song-list {
  max-height: 620px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.dev-song-button {
  width: 100%;
  min-height: auto;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  text-align: left;
  background: transparent;
}

.dev-song-button strong,
.dev-song-button span {
  display: block;
}

.dev-song-button span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.dev-song-button.active {
  color: var(--bg);
  background: var(--gold);
}

.dev-song-button.active span {
  color: rgba(8, 9, 13, 0.76);
}

.dev-editor {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 16px;
  align-content: start;
}

.dev-current {
  display: grid;
  gap: 6px;
}

.dev-current a {
  color: var(--cyan);
}

#devAudio {
  width: 100%;
}

.dev-time-grid {
  display: grid;
  grid-template-columns: 130px minmax(110px, 160px) 90px;
  gap: 12px;
  align-items: center;
}

.dev-time-grid label,
.dev-note-label {
  color: var(--muted);
  font-weight: 800;
}

.dev-time-grid input[type="range"] {
  grid-column: 1 / -1;
  padding: 0;
}

#devStartFormatted {
  color: var(--gold);
  font-weight: 900;
}

.dev-button-row {
  flex-wrap: wrap;
}

.dev-export {
  min-height: 180px;
  padding: 12px;
  resize: vertical;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .hero-panel,
  .game-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    display: grid;
  }

  .stat-row {
    grid-template-columns: repeat(3, 1fr);
    min-width: 0;
  }

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

  .guess-form label,
  #playerName,
  #guessInput,
  .submit-button {
    grid-column: 1;
    grid-row: auto;
  }

  .dev-layout {
    display: grid;
  }

  .dev-list-shell {
    width: 100%;
  }

  .dev-time-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .hero-panel,
  .play-surface,
  .side-panel > div {
    padding: 16px;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-mark {
    width: 54px;
    height: 54px;
  }

  .stat-row,
  .attempt-track {
    grid-template-columns: 1fr;
  }
}
