:root {
  --bg-1: #10212b;
  --bg-2: #193646;
  --card: rgba(12, 27, 38, 0.78);
  --stroke: rgba(255, 255, 255, 0.1);
  --text: #f4fbff;
  --muted: #c4d9e4;
  --accent: #ffd166;
  --accent-2: #7bdff2;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  --radius: 24px;
  --font: ui-rounded, "Avenir Next Rounded", "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 600px at 10% 10%, rgba(255, 209, 102, 0.28), transparent 60%),
    radial-gradient(900px 700px at 85% 20%, rgba(123, 223, 242, 0.22), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
}

.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -1;
}

.blob {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(56px);
  opacity: 0.35;
  animation: drift 14s ease-in-out infinite;
}

.blob-a {
  top: -120px;
  left: -90px;
  background: #ffd166;
}

.blob-b {
  top: 100px;
  right: -130px;
  background: #7bdff2;
  animation-duration: 17s;
}

.blob-c {
  left: 30%;
  bottom: -180px;
  background: #95d5b2;
  animation-duration: 19s;
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(24px, 18px, 0) scale(1.04);
  }
}

.app {
  width: min(980px, calc(100% - 28px));
  margin: 20px auto 32px;
  display: grid;
  gap: 16px;
}

.card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 20px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
}

h1,
h2,
p,
ul {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(22px, 3vw, 28px);
}

.lead,
.section-head p,
.tips li,
.status {
  color: var(--muted);
  line-height: 1.5;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 12px;
}

.sound-panel {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
}

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

.field {
  display: grid;
  gap: 8px;
  align-content: start;
}

.field span {
  font-weight: 800;
}

.field select,
.field input[type="range"],
.field output {
  width: 100%;
}

.field select {
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(14, 33, 45, 0.92);
  color: var(--text);
  font: inherit;
}

.field output {
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.btn {
  min-height: 52px;
  padding: 12px 18px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: rgba(14, 33, 45, 0.9);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  background: rgba(19, 42, 57, 0.95);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ffe7a6);
  color: #3d2a00;
}

.status {
  margin-bottom: 0;
  min-height: 24px;
}

.staff-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.staff-shell {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
}

.staff-svg {
  width: 100%;
  height: auto;
  display: block;
  cursor: crosshair;
}

.composition-text {
  margin-top: 10px;
  color: #fff1b8;
  font-weight: 700;
}

.pronunciation-board {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.pronunciation-step {
  min-height: 76px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
}

.pronunciation-step.is-current {
  border-color: rgba(255, 209, 102, 0.8);
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.12);
}

.pronunciation-step.is-done {
  background: rgba(149, 213, 178, 0.16);
  border-color: rgba(149, 213, 178, 0.45);
}

.pronunciation-name {
  font-size: 20px;
  font-weight: 900;
}

.pronunciation-index {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pronunciation-controls,
.fallback-pad {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.fallback-pad .btn {
  min-height: 46px;
  padding: 10px 14px;
}

.heard-text {
  margin-top: 8px;
  color: #fff1b8;
  font-weight: 700;
  line-height: 1.45;
}

.random-answer {
  margin-top: 10px;
  font-weight: 800;
  color: #fff1b8;
}

.hidden {
  display: none;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.note-btn {
  display: grid;
  gap: 6px;
  justify-items: start;
  text-align: left;
}

.note-label {
  font-size: 20px;
}

.note-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.tips ul {
  margin-bottom: 0;
  padding-left: 20px;
}

@media (max-width: 720px) {
  .settings-grid,
  .pronunciation-board,
  .note-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .app {
    width: min(100%, calc(100% - 18px));
  }

  .card {
    padding: 16px;
  }

  .settings-grid,
  .pronunciation-board,
  .note-grid,
  .controls {
    grid-template-columns: 1fr;
  }

  .controls {
    display: grid;
  }
}
