@font-face {
  font-family: "Barlow Condensed";
  src: url("./fonts/barlow-condensed.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  --page: #e8eee8;
  --surface: #fdf9ee;
  --ink: #232a23;
  --dim: #555f50;
  --line: #c0c5b4;
  --key: #852f20;
  --on-key: #fff7eb;
  --pad: #f9e5c6;
  --board: #24372e;
  --board-text: #fcf3dd;
  --board-muted: #c1cdbb;
  --board-line: #697f70;
  --board-active: #f4b56c;
  --focus: #aa4834;
  font-family: system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #19241f;
  --surface: #24312a;
  --ink: #f7eedb;
  --dim: #b8c4ad;
  --line: #607567;
  --key: #f1b572;
  --on-key: #2d2118;
  --pad: #333e32;
  --board: #101a15;
  --board-text: #fff1d8;
  --board-muted: #b9cdbd;
  --board-line: #648373;
  --board-active: #f6b976;
  --focus: #ffcd87;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); }
::selection { background: var(--key); color: var(--on-key); }
a { color: inherit; }
button, input { font: inherit; }
button { border: 1px solid var(--key); background: var(--key); color: var(--on-key); cursor: pointer; font-weight: 650; }
button, input { min-height: 44px; border-radius: 5px; padding: 9px 13px; }
.quiet { background: transparent; color: inherit; border-color: var(--line); }
button:hover:not(:disabled) { filter: brightness(0.92); }
.quiet:hover:not(:disabled) { border-color: currentColor; }
button:disabled { opacity: .65; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1, h2, .brand, .pad span { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 700; }
h2 { font-size: 1.9rem; line-height: 1; }
.topbar, main { max-width: 1136px; margin-inline: auto; padding-inline: 24px; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { text-decoration: none; font-size: 1.55rem; display: inline-flex; align-items: center; gap: 10px; }
.oscillogram { display: inline-flex; align-items: center; gap: 3px; height: 26px; color: var(--key); }
.oscillogram i { display: block; width: 3px; background: currentColor; border-radius: 2px; height: 10px; }
.oscillogram i:nth-child(2) { height: 23px; }
.oscillogram i:nth-child(3) { height: 16px; }
.intro { display: flex; justify-content: space-between; gap: 24px; align-items: end; border-top: 1px solid var(--line); padding: 34px 0 24px; }
h1 { line-height: .91; font-size: clamp(3.6rem, 9vw, 6rem); letter-spacing: -.025em; }
.intro p { max-width: 54ch; line-height: 1.5; color: var(--dim); margin-top: 14px; }
.mode { display: flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--dim); font-size: .875rem; padding-block: 6px; }
.mode i { height: 9px; width: 9px; border: 1px solid currentColor; border-radius: 50%; }
.mode[data-live] i { background: var(--key); border-color: var(--key); }
.studio { display: grid; grid-template-columns: minmax(0, 2fr) minmax(230px, 1fr); gap: 16px; }
.score, .control { border-radius: 8px; min-width: 0; padding: 26px; }
.score { background: var(--board); color: var(--board-text); --line: var(--board-line); --focus: var(--board-active); }
.score-head, .score-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.score-head p, .haptic-status { color: var(--board-muted); margin-top: 6px; font-size: .875rem; }
#counter { font: 650 clamp(1.3rem, 4vw, 1.8rem) ui-monospace, monospace; font-variant-numeric: tabular-nums; letter-spacing: -.045em; }
.tracks { padding-block: 18px; display: grid; gap: 4px; }
.track { display: grid; grid-template-columns: minmax(4.4rem, .7fr) 3fr; align-items: center; text-align: left; gap: 8px; padding: 6px 8px; min-height: 44px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--board-text); width: 100%; }
.track:hover:not(:disabled), .track[aria-pressed="true"] { border-color: var(--board-line); filter: none; }
.track[aria-pressed="true"] { color: var(--board-active); }
.track[data-hit] .track-name { color: var(--board-active); text-decoration: underline; text-underline-offset: 4px; }
.steps { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: clamp(2px, .55vw, 7px); }
.step { height: 12px; border: 1px solid var(--board-line); border-radius: 2px; }
.step:nth-child(4n + 1) { height: 15px; margin-block: -1.5px; }
.step[data-beat] { background: var(--board-line); }
.step[data-cursor] { border-color: var(--board-text); }
.step[data-cursor][data-beat] { background: var(--board-active); border-color: var(--board-active); }
.score-foot { justify-content: flex-start; }
.score-foot button:not(.quiet) { background: var(--board-active); color: #2b2019; border-color: var(--board-active); }
.control { display: grid; align-content: center; justify-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.pad-head p, .tap-status { color: var(--dim); font-size: .875rem; }
.pad-head h2 { margin-top: 4px; }
.pad { display: grid; place-content: center; justify-items: center; width: min(100%, 166px); aspect-ratio: 1; border: 2px solid var(--key); border-radius: 50%; background: var(--pad); color: var(--key); gap: 4px; box-shadow: inset 0 0 0 6px var(--surface), 0 5px 11px #17221323; transition: transform .14s; }
.pad span { display: block; font-size: 3.3rem; line-height: .9; }
.pad:active, .pad[data-hit] { transform: scale(.97); background: var(--key); color: var(--on-key); }
.rooms { margin-block: 27px 36px; padding-top: 19px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 14px 20px; }
.rooms p { color: var(--dim); line-height: 1.5; margin-top: 5px; }
.room-actions, form { display: flex; flex-wrap: wrap; gap: 8px; }
.rooms input { color: var(--ink); border: 1px solid var(--line); background: var(--surface); width: 8rem; }
.rooms input::placeholder { color: var(--dim); opacity: 1; }
.invite { grid-column: 1 / -1; display: grid; gap: 8px; }
.invite input { width: min(100%, 450px); }
#room-notice { grid-column: 1 / -1; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 710px) {
  .topbar, main { padding-inline: 16px; }
  .topbar { min-height: 64px; }
  .intro { align-items: start; flex-direction: column; gap: 6px; padding: 24px 0 13px; }
  .studio { grid-template-columns: minmax(0, 1fr); }
  .score, .control { padding: 15px; }
  .control { grid-row: 1; grid-template-columns: 1fr 1fr; justify-items: start; text-align: left; }
  .pad { grid-column: 2; grid-row: 1 / 3; justify-self: center; width: min(105px, 100%); font-size: .875rem; }
  .pad span { font-size: 2.55rem; }
  .tap-status { align-self: start; }
  .rooms { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .pad { transition: none; } }
