:root {
  color-scheme: light;
  --bg: #151719;
  --ink: #211b16;
  --muted: #d2c8b9;
  --panel: rgba(255, 248, 232, 0.92);
  --line: rgba(246, 222, 180, 0.34);
  --accent: #18a999;
  --accent-dark: #0e6f66;
  --gold: #e3a63c;
  --clay: #d66b4f;
  --night: #111315;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(10, 12, 13, 0.2), rgba(10, 12, 13, 0.88)),
    radial-gradient(circle at 20% 16%, rgba(24, 169, 153, 0.22), transparent 34%),
    radial-gradient(circle at 82% 20%, rgba(227, 166, 60, 0.18), transparent 28%),
    linear-gradient(135deg, #202326, var(--bg));
  color: #fff7e8;
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.95;
}

.subtitle {
  max-width: 520px;
  margin: 12px 0 0;
  color: #d9d0c4;
  font-size: 1rem;
}

h2 {
  margin-bottom: 18px;
  font-size: 1.25rem;
}

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

.primary-button,
.icon-button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.icon-button {
  width: 46px;
  background: rgba(255, 247, 232, 0.96);
  border-color: var(--line);
  color: var(--ink);
  font-size: 1.3rem;
}

.primary-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: stretch;
}

.stage-panel,
.side-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 250, 241, 0.14), rgba(255, 250, 241, 0.06));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.stage-panel {
  min-height: 620px;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
}

.drum-wrap {
  display: grid;
  place-items: center;
  padding: 36px;
}

.drum {
  position: relative;
  width: min(68vmin, 520px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 45% 35%, rgba(255, 255, 255, 0.55), transparent 14%),
    radial-gradient(circle at 54% 62%, rgba(120, 74, 38, 0.18), transparent 28%),
    radial-gradient(circle, #f4d8a8 0 43%, #d38b4b 44% 49%, #71452d 50% 56%, #1e1714 57%);
  box-shadow:
    inset 0 0 36px rgba(67, 36, 18, 0.28),
    0 24px 55px rgba(47, 29, 17, 0.24);
}

.drum::before {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  border: 2px dashed rgba(95, 54, 25, 0.28);
}

.hit-zone {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.82);
  pointer-events: none;
}

.edge-zone {
  inset: 6%;
  border: 24px solid rgba(181, 83, 61, 0.8);
}

.center-zone {
  inset: 34%;
  background: rgba(15, 118, 110, 0.78);
}

.hit-zone.is-active {
  animation: pulseHit 180ms ease-out;
}

.hit-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 104px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.88);
  color: var(--ink);
  text-align: center;
  font-weight: 800;
}

@keyframes pulseHit {
  0% {
    opacity: 0.92;
    transform: scale(0.84);
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

.beat-strip {
  padding: 18px;
  border-top: 1px solid var(--line);
  background: rgba(14, 16, 18, 0.42);
}

.beat-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
  gap: 8px;
}

.beat-cell {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 250, 241, 0.9);
  color: var(--muted);
  font-weight: 800;
}

.beat-cell.center {
  border-color: rgba(15, 118, 110, 0.42);
}

.beat-cell.edge {
  border-color: rgba(181, 83, 61, 0.42);
}

.beat-cell.rest {
  color: #a69a8f;
}

.beat-cell.is-current {
  background: var(--ink);
  color: white;
  transform: translateY(-3px);
}

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

.song-card {
  min-height: 246px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.current-lyric {
  min-height: 96px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  color: #fff2ca;
  font-size: clamp(2rem, 7vw, 4rem);
  font-weight: 900;
  line-height: 1;
}

.lyrics-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lyric-chip {
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 243, 219, 0.92);
  color: var(--muted);
  font-weight: 700;
}

.lyric-chip.is-current {
  background: var(--gold);
  color: #1f160b;
}

.control-grid {
  display: grid;
  gap: 14px;
}

.import-card {
  min-height: 0;
}

.file-drop {
  display: grid;
  place-items: center;
  min-height: 58px;
  margin-bottom: 10px;
  border: 1px dashed rgba(255, 242, 202, 0.58);
  border-radius: 8px;
  background: rgba(14, 16, 18, 0.28);
  color: #fff2ca;
  cursor: pointer;
  text-align: center;
  font-weight: 800;
}

.file-drop input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

audio {
  width: 100%;
  min-height: 40px;
  display: none;
}

.hint {
  margin: 10px 0 0;
  color: #d9d0c4;
  font-size: 0.9rem;
  line-height: 1.35;
}

.field,
.toggle {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.9);
  color: var(--ink);
}

.field span,
.toggle span {
  color: var(--muted);
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.toggle {
  grid-template-columns: 22px 1fr;
  align-items: center;
}

.toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100vw - 20px, 720px);
    padding: 12px 0;
  }

  .topbar {
    align-items: flex-start;
  }

  .practice-layout {
    grid-template-columns: 1fr;
  }

  .stage-panel {
    min-height: 420px;
  }

  .drum-wrap {
    padding: 24px 12px;
  }

  .beat-track {
    grid-template-columns: repeat(8, minmax(28px, 1fr));
  }
}

@media (max-width: 520px) {
  .topbar {
    flex-direction: column;
  }

  .transport {
    width: 100%;
  }

  .primary-button {
    flex: 1;
    justify-content: center;
  }

  .drum {
    width: min(86vw, 360px);
  }
}
