:root {
  color-scheme: dark;
  --paper: #f1eae0;
  --dim: #b3b1aa;
  --copper: #ff9c67;
  --progress: 0%;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  background: #111314;
  color: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--copper); outline-offset: 5px; }
button:active { transform: translateY(1px); }
[hidden] { display: none !important; }
.instrument { width: min(100%, 1500px); padding: clamp(18px, 3.5vw, 52px) clamp(18px, 5vw, 78px) 22px; margin: auto; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 clamp(18px, 3.2vh, 32px); }
h1 { font: 400 clamp(36px, 4.7vw, 68px)/1 "Baskervville", Georgia, serif; letter-spacing: -.065em; margin: 0; }
h1 em { color: var(--copper); font-weight: 400; }
.field { position: relative; height: clamp(265px, 62svh, 710px); overflow: hidden; isolation: isolate; border: 1px solid #393c39; border-radius: 16px; user-select: none; touch-action: none; background: radial-gradient(ellipse at 52% 54%, #242524, #191c1c 50%, #161819 88%); }
.field::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle, #a6b0ab21 .65px, transparent .95px) 8px 8px / 19px 19px; }
.field canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: crosshair; }
.field-top { position: absolute; inset: 22px 24px auto; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.state, .bite { display: inline-flex; align-items: center; gap: 9px; color: #cfcec5; font-size: 12px; letter-spacing: .015em; }
.state i { width: 7px; height: 7px; border: 1px solid #b5b4a8; border-radius: 50%; }
.field[data-held] .state { color: #ffd1ab; }
.field[data-held] .state i { border-color: var(--copper); background: var(--copper); box-shadow: 0 0 9px #ff9c6780; }
.bite { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; }
.bite i { display: block; width: 46px; height: 8px; background: linear-gradient(to right, var(--copper) var(--level, 0%), #555853 var(--level, 0%)); mask-image: repeating-linear-gradient(90deg, black 0 3px, transparent 3px 5px); }
.gesture { position: absolute; inset: auto 20px 20px; justify-content: center; display: flex; align-items: center; gap: 10px; margin: 0; color: #c7c5bc; font-size: 13px; pointer-events: none; text-shadow: 0 1px 5px #111; }
.mouse { position: relative; width: 13px; height: 18px; border: 1px solid #b6b8b0; border-radius: 7px; overflow: hidden; }
.mouse::before { content: ""; position: absolute; inset: 0 50% 48% 0; background: var(--copper); }
.axes { position: absolute; inset: 0; pointer-events: none; color: #aaa99c; font-size: 10px; letter-spacing: .08em; }
.axes span, .axes i { position: absolute; }
.axes .north, .axes .south { left: 50%; transform: translateX(-50%); }
.axes .north { top: 22px; } .axes .south { bottom: 52px; }
.axes .west, .axes .east { top: 50%; transform: translateY(-50%); }
.axes .west { left: 14px; } .axes .east { right: 14px; }
.axes i { left: 50%; top: 50%; width: 11px; height: 11px; transform: translate(-50%,-50%); background: linear-gradient(#a69d8f88,#a69d8f88) center / 1px 100% no-repeat, linear-gradient(#a69d8f88,#a69d8f88) center / 100% 1px no-repeat; }
.transport { display: flex; gap: clamp(12px, 1.6vw, 26px); align-items: center; padding: 24px 0; }
.play { display: grid; place-items: center; width: 50px; height: 50px; border: none; border-radius: 50%; background: var(--copper); color: #211710; flex: 0 0 auto; }
.play:hover { background: #ffb58c; }
.play span { width: 0; height: 0; border: solid transparent; border-width: 8px 0 8px 12px; border-left-color: currentColor; margin-left: 3px; }
.play[data-playing] span { width: 12px; height: 15px; border: solid currentColor; border-width: 0 4px; margin: 0; }
.track { min-width: 0; width: clamp(135px, 18vw, 255px); }
h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0 0 3px; font-weight: 550; font-size: 17px; }
.track > span, .track button, .volume label { font-size: 12px; color: var(--dim); }
.track button { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; color: #dbad8e; margin-left: 8px; }
.timeline { flex: 1; min-width: 55px; }
input[type="range"] { display: block; appearance: none; width: 100%; height: 19px; background: transparent; margin: 0; cursor: pointer; accent-color: var(--copper); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, var(--copper) var(--progress), #434644 var(--progress)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 9px; height: 9px; margin-top: -3px; border-radius: 100%; background: #e8d0b7; }
input[type="range"]::-moz-range-track { height: 3px; background: #434644; }
input[type="range"]::-moz-range-progress { height: 3px; background: var(--copper); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 0; background: #e8d0b7; }
.times { display: flex; justify-content: space-between; color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.volume { margin-left: clamp(5px, 2vw, 30px); width: clamp(62px, 8vw, 110px); }
#notice { color: #ffbc96; margin: 0; font-size: 14px; }
@media (max-width: 620px) {
  .instrument { padding-top: 22px; }
  .field { height: 55svh; min-height: 255px; }
  .field-top { inset: 17px 16px auto; }
  .transport { flex-wrap: wrap; padding: 17px 0 10px; gap: 12px; }
  .track { width: auto; flex: 1; }
  .timeline { order: 1; flex: 0 0 100%; }
  .volume { width: 68px; }
  .gesture { font-size: 12px; inset: auto 9px 15px; }
}
@media (pointer: coarse) { .mouse { display: none; } }
