:root {
  color-scheme: light;
  --page: #b7c3ad;
  --case: #c0ccb5;
  --screen: #ced8c3;
  --surface: #dce5d2;
  --ink: #283c2b;
  --muted: #5b6e55;
  --line: #a0b192;
  --accent: #3f5b39;
  --sans: 'Manrope', Arial, sans-serif;
  --mono: 'DM Mono', monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .45; cursor: default; }
[hidden] { display: none !important; }
.shell { width: 100%; display: flex; justify-content: center; }
.game-card {
  width: min(100%, 440px);
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--case);
  box-shadow: 0 14px 40px #283c2b12, inset 0 1px 0 #e2e9da;
}
.screen {
  min-height: 590px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--screen);
  box-shadow: inset 0 1px 4px #283c2b0c;
  display: flex;
  flex-direction: column;
}
.screen-status, .listen-topline, .screen-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
}
.screen-status { padding-bottom: 18px; }
.screen-brand { margin: 0; font: 800 26px/1.15 var(--sans); letter-spacing: -.06em; }
#roundLabel { font-size: 11px; color: var(--muted); letter-spacing: .06em; }
.progress-track { height: 4px; display: flex; gap: 5px; margin-bottom: 15px; }
.progress-segment { flex: 1; border-radius: 2px; background: #b3c1a8; }
.progress-segment.active { background: var(--accent); }
.listen-panel { height: 34px; }
.listen-topline { gap: 8px; font-size: 10px; color: var(--muted); }
.signal { display: flex; align-items: center; gap: 2px; height: 12px; }
.signal i { width: 3px; height: 5px; background: var(--accent); border-radius: 1px; }
.signal i:nth-child(2) { height: 11px; }
.signal i:nth-child(3) { height: 8px; }
#nowPlaying { margin-right: auto; }
.duration { white-space: nowrap; font-variant-numeric: tabular-nums; }
.instrument-list { display: grid; gap: 6px; margin-bottom: 16px; }
.instrument {
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  border: 1px solid #acba9f;
  border-radius: 6px;
  color: var(--muted);
}
.instrument.active { border-color: #92a785; color: var(--ink); }
.instrument.current { background: var(--surface); }
.instrument-name { flex: 0 0 70px; font: 500 11px var(--mono); letter-spacing: .02em; }
.lane-wave { min-width: 0; height: 22px; flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 2px; overflow: hidden; }
.lane-wave span { flex: 1; min-width: 2px; max-width: 3px; height: var(--h); border-radius: 1px; background: #94a586; }
.instrument.active .lane-wave span { background: var(--accent); }
.lane-wave.playing span { animation: wave .48s ease-in-out infinite alternate; animation-delay: var(--d); }
@keyframes wave { to { height: calc(var(--h) * .4); opacity: .45; } }
.instrument-lock { flex: 0 0 39px; text-align: right; font: 8px var(--mono); color: var(--muted); }
.timeline { height: 3px; overflow: hidden; border-radius: 2px; background: #adbd9f; margin-bottom: 9px; }
.timeline div { width: 0; height: 100%; background: var(--accent); }
.screen-foot { color: var(--muted); font-size: 9px; letter-spacing: .06em; }
.guess-form { margin-top: auto; padding-top: 24px; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.input-row input {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 13px;
  border: 1px solid #92a785;
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  outline: 0;
}
.input-row input::placeholder { color: var(--muted); }
.input-row button, .result button {
  min-height: 46px;
  padding: 10px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #edf2e7;
  font: 500 11px var(--mono);
  letter-spacing: .03em;
  cursor: pointer;
}
.input-row .skip-button { color: var(--ink); background: transparent; border-color: #92a785; }
.screen-actions { min-height: 32px; display: flex; align-items: center; justify-content: flex-end; padding-top: 7px; }
.feedback { margin: 0; text-align: right; color: var(--muted); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.feedback.error { color: #873c30; }
.feedback.success { color: var(--accent); }
.result { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: center; margin-top: auto; padding-top: 24px; }
.result-icon { font-size: 23px; }
.result strong { font-size: 15px; overflow-wrap: anywhere; }
.result p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.result button { grid-column: 1 / -1; margin-top: 6px; }
.transport { min-height: 88px; display: flex; align-items: center; justify-content: center; gap: 19px; }
.transport-button, .play-button {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid #92a785;
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
}
.transport-button { width: 46px; height: 46px; font: 26px var(--sans); }
.play-button { width: 62px; height: 62px; border-color: var(--accent); background: var(--accent); color: #edf2e7; box-shadow: 0 4px 10px #283c2b16; }
.play-button svg { width: 25px; height: 25px; }
.pause-icon { display: none; }
.play-button.playing .play-icon { display: none; }
.play-button.playing .pause-icon { display: block; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
@media (hover: hover) {
  button:not(:disabled):hover { filter: brightness(.95); }
}
@media (max-width: 380px) {
  body { padding: 12px; }
  .game-card { padding: 10px; border-radius: 22px; }
  .screen { padding: 16px; min-height: 560px; }
  .instrument { height: 41px; gap: 6px; padding: 0 7px; }
  .instrument-name { flex-basis: 65px; font-size: 10px; }
  .instrument-lock { flex-basis: 34px; font-size: 7px; }
  .listen-topline { gap: 6px; font-size: 9px; }
  .transport { min-height: 82px; }
}
@media (max-height: 760px) {
  body { align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  .lane-wave.playing span { animation: none; }
}
