/* ========================================================
   Knockbox — Beatmaker's Workstation
   Top-down view of a beatmaker's desk
   ======================================================== */

* {
  box-sizing: border-box;
}

/* Reveal the page once this stylesheet is parsed — pairs with the
   `body { opacity: 0; transition: opacity 0.25s }` in critical
   inline CSS to eliminate FOUT during the async main.css load. */
body {
  opacity: 1;
}

/* ============================================================
   Boot sequence — page loads in "powered off" state, JS adds
   .powered-on after the boot animation completes. Props fade in
   on staggered delays matching the LCD boot messages so the
   whole scene comes alive in unison with the sampler.
   ============================================================ */

/* Each prop is PLACED into the scene with directional motion — they slide,
   drop, or settle into their resting position rather than fading in. The
   end frame of every keyframe restores the prop's resting transform
   (rotation, etc.) so the existing static styling stays intact. Easing uses
   a slight back-overshoot so things "thump" into place like real objects. */

/* Notebook — placed down from upper-left */
@keyframes place-polaroid {
  0% {
    opacity: 0;
    transform: translate(60px, -40px) rotate(15deg);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate(0, 0);
  }
}

/* Vinyl — slid in from the bottom-left edge */
@keyframes place-vinyl {
  0% {
    opacity: 0;
    transform: translate(-60px, 30px);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate(0, 0);
  }
}

/* LP fan — pushed up from below */
@keyframes place-lp-fan {
  0% {
    opacity: 0;
    transform: translate(-30px, 60px);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate(0, 0);
  }
}

/* Soul Brother LP — dropped in from the upper-right corner */
@keyframes place-soul-brother {
  0% {
    opacity: 0;
    transform: translate(60px, -50px) rotate(20deg);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) rotate(6deg);
  }
}

/* Cassette — slid in from the right edge */
@keyframes place-cassette {
  0% {
    opacity: 0;
    transform: translate(70px, 10px);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate(0, 0);
  }
}

/* Sticky note — drops onto the desk from above, twists as it settles */
@keyframes place-disks {
  0% {
    opacity: 0;
    transform: translate(-60px, -30px) rotate(-14deg) scale(0.92);
  }
  55% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) rotate(-3deg) scale(1);
  }
}

@keyframes place-sticky {
  0% {
    opacity: 0;
    transform: translate(8px, -80px) rotate(-22deg) scale(0.92);
  }
  55% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) rotate(-4deg) scale(1);
  }
}

/* Funk LP — tossed in from the bottom-right corner */
@keyframes place-funk {
  0% {
    opacity: 0;
    transform: translate(70px, 40px) rotate(18deg);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) rotate(4deg);
  }
}

/* Props are hidden during the entire boot sequence — they only appear
   the instant the step cells light up (.powered-on fires at T≈4s).
   Once .powered-on is set, each prop runs its placement keyframe with
   a tiny millisecond stagger so they enter the scene one after another
   in quick succession rather than all snapping in at the exact same frame. */
body:not(.powered-on) .prop {
  opacity: 0;
  pointer-events: none;
}

/* Common animation settings — applied only under body.powered-on */
body.powered-on .prop {
  animation-duration: 0.7s;
  animation-timing-function: cubic-bezier(0.34, 1.4, 0.5, 1);
  animation-fill-mode: both;
}

body.powered-on .prop-polaroid {
  animation-name: place-polaroid;
  animation-delay: 50ms;
}
body.powered-on .prop-vinyl {
  animation-name: place-vinyl;
  animation-delay: 100ms;
}
body.powered-on .prop-lp-fan {
  animation-name: place-lp-fan;
  animation-delay: 150ms;
}
body.powered-on .prop-soul-brother {
  animation-name: place-soul-brother;
  animation-delay: 200ms;
}
body.powered-on .prop-cassette {
  animation-name: place-cassette;
  animation-delay: 250ms;
}
body.powered-on .prop-disks {
  animation-name: place-disks;
  animation-delay: 300ms;
}
body.powered-on .prop-sticky {
  animation-name: place-sticky;
  animation-delay: 300ms;
}
body.powered-on .prop-funk {
  animation-name: place-funk;
  animation-delay: 350ms;
}

/* Patch cables fade in over the desk early in the sequence — kept as
   opacity-only since cables don't get "placed", they're already wired up. */
@keyframes cables-arrive {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.cables {
  animation: cables-arrive 0.8s ease-out 0.2s both;
}

/* Boot LCD overlay — sits absolutely over the .lcd, hides cells while booting */
.lcd-boot {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "VT323", monospace;
  font-size: clamp(14px, 1.3vw, 22px);
  color: var(--lcd-text, #1f2913);
  letter-spacing: 2px;
  text-shadow: 1px 2px 0 rgba(31, 41, 19, 0.2);
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 2;
}

/* LCD dark only while NO power is detected — the moment power-on-detected
   fires (T≈0.85s, in the lamp's pool) the LCD lights up green so the boot text is legible. */
body:not(.power-on-detected) .lcd {
  background: linear-gradient(180deg, #1a1f12 0%, #0e120a 100%);
  text-shadow: none;
}

/* Light flicker when the LCD first wakes up (mimics real LCDs settling) */
body.power-on-detected .lcd {
  animation: lcd-wake 0.45s ease-out;
}

@keyframes lcd-wake {
  0% {
    filter: brightness(0.4);
    opacity: 0.7;
  }
  25% {
    filter: brightness(1.3);
    opacity: 1;
  }
  40% {
    filter: brightness(0.85);
  }
  100% {
    filter: brightness(1);
    opacity: 1;
  }
}

/* LCD cells stay hidden behind the boot overlay until the full sequence
   completes — power-on-detected lights the panel, .powered-on reveals
   the live BPM/STEP/MODE/SWING values. */
body:not(.powered-on) .lcd-cell {
  opacity: 0;
}

body:not(.powered-on) .lcd-boot {
  opacity: 1;
}

/* A word from the machine, over the live readout for a moment */
.lcd-msg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: "VT323", monospace;
  font-size: clamp(13px, 1.15vw, 20px);
  line-height: 1;
  color: var(--lcd-text, #1f2913);
  letter-spacing: 2px;
  text-shadow: 1px 2px 0 rgba(31, 41, 19, 0.2);
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
}

body.powered-on .lcd.is-messaging .lcd-msg {
  opacity: 1;
}

body.powered-on .lcd.is-messaging .lcd-cell {
  opacity: 0;
  transition: opacity 0.2s ease;
}

body.powered-on .lcd-boot {
  opacity: 0;
}

body.powered-on .lcd-cell {
  opacity: 1;
  transition: opacity 0.3s ease 0.2s;
}

/* Brand LED dot dark until power is detected (then pulses alongside the boot) */
body:not(.power-on-detected) .brand-mark .dot {
  animation: none;
  background: radial-gradient(circle at 35% 30%, #3a2a1a 0%, #1a0d05 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 220, 180, 0.08),
    inset 0 -1px 1px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.6);
}

/* Pads are plain unlit rubber until powered — only their LED layers
   (::before backlight, ::after playhead) wake up with the machine.
   The lit state itself lives with the pad styles further down. */

/* Pad self-test sweep — JS adds .self-test to each row in sequence */
.track-row.self-test .step::before {
  opacity: 1;
  transition-duration: 0.08s;
}

/* Reduced motion — collapse boot animations to near-instant */
@media (prefers-reduced-motion: reduce) {
  .prop,
  .cables {
    animation-duration: 0.01s;
    animation-delay: 0s;
  }
  .lcd-boot,
  .lcd-cell {
    transition: none;
  }
}

html,
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  background: #1a120a;
  font-family: "JetBrains Mono", monospace;
  color: #e9e1d3;
}

/* ------ Scene tokens ------
   One key light for the whole scene: a desk lamp above and slightly behind
   the sampler. Every surface follows the same rule — top edges catch warm
   light, bottom edges fall into shadow, cast shadows drop straight down.
   Textures are tiny SVG noise tiles: rasterised once, then just blitted. */
:root {
  /* The header's row: the wordmark and whoever is at the desk (ADR-0080) */
  --top-h: 48px;
  --amber: #ff7a2b;
  /* The dock along the desk's front edge, and how wide the sampler is */
  --dock: max(7vh, 46px);
  --sampler-w: clamp(820px, 72vw, 1400px);
  --edge-hi: rgba(255, 240, 215, 0.16);
  --edge-lo: rgba(0, 0, 0, 0.7);
  /* Long vertical wood fibres */
  --tex-wood: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='900'><filter id='w' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='0.16 0.005' numOctaves='4' seed='11' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.06  0 0 0 0 0.025  0 0 0 0 0  1.5 0 0 0 -0.55'/></filter><rect width='100%25' height='100%25' filter='url(%23w)'/></svg>");
  /* Pebbled powder-coat / moulded ABS */
  --tex-plastic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='p' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' seed='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 0.95  0 0 0 0 0.88  0.5 0 0 0 -0.22'/></filter><rect width='100%25' height='100%25' filter='url(%23p)'/></svg>");
  /* Sparse dust specks that settle on dark gear */
  --tex-dust: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='d' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='1' seed='23' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.95  0 0 0 0 0.9  0 0 0 0 0.8  0 0 0 4 -2.75'/></filter><rect width='100%25' height='100%25' filter='url(%23d)'/></svg>");
}

/* ------ The desk surface ------ */
.desk {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: /* lamp pool */
      radial-gradient(ellipse 60% 50% at 50% 18%, rgba(255, 200, 130, 0.2), transparent 70%),
      radial-gradient(ellipse 90% 90% at 50% 55%, transparent 40%, rgba(0, 0, 0, 0.55) 100%),
      /* coffee ring left by a mug that sat here too long */
      radial-gradient(
        circle at 30% 26%,
        transparent 0 2.05vw,
        rgba(30, 14, 4, 0.3) 2.2vw,
        rgba(30, 14, 4, 0.1) 2.42vw,
        transparent 2.6vw
      ),
      /* plank seams: dark gap with a lit lip on the far side */
      repeating-linear-gradient(
        90deg,
        transparent 0 calc(27vw - 3px),
        rgba(0, 0, 0, 0.3) calc(27vw - 3px) calc(27vw - 1px),
        rgba(255, 220, 180, 0.06) calc(27vw - 1px) 27vw
      ),
      var(--tex-wood), linear-gradient(180deg, #5a3a22 0%, #4a2e1a 60%, #3a230f 100%);
  background-position:
    0 0,
    0 0,
    0 0,
    11vw 0,
    0 0,
    0 0;
  isolation: isolate;
}

/* Lamp falloff over the whole scene — props near the edges sit in the same
   dimmer light as the wood under them instead of looking pasted on. */
.desk::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  background: radial-gradient(
    ellipse 78% 72% at 50% 38%,
    rgba(255, 214, 160, 0.05) 0%,
    transparent 45%,
    rgba(8, 4, 0, 0.32) 100%
  );
}

.desk::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.45 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
  mix-blend-mode: overlay;
  opacity: 0.45;
}

/* SVG cables container — sits in front of desk but behind stage props */
.cables {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  width: 100%;
  height: 100%;
}

/* Two shadows per cable: a tight one where the jacket touches the wood and
   a wide soft one from the lamp. Blurred once; nothing here animates. */
.cable-shadow-contact {
  filter: blur(1.5px);
}

.cable-shadow-soft {
  filter: blur(6px);
}

.stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.stage > * {
  pointer-events: auto;
}

/* === Sampler stage === */
.sampler-stage {
  position: absolute;
  /* Hung from its front edge, well clear of the mic and the avatar: take
     rows make the chassis grow upward only. --stage-drop nudges it back down
     if the title would leave the top of the desk (set by VoxLane). */
  bottom: 33vh;
  left: 50%;
  transform: translate(-50%, var(--stage-drop, 0px));
  width: var(--sampler-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

/* === Absolutely-positioned props === */
.prop {
  position: absolute;
}

.prop-vinyl {
  bottom: 26vh;
  left: -9vw;
  width: 15vw;
  z-index: 3;
}

.prop-lp-fan {
  bottom: 10vh;
  left: -3vw;
  width: 19vw;
  max-width: 320px;
  z-index: 4;
}

.prop-polaroid {
  top: 16vh;
  right: 1vw;
  width: 12vw;
  max-width: 200px;
  z-index: 5;
}

.prop-cassette {
  top: 36vh;
  /* Hangs off the desk's edge, and no further on a wide monitor */
  right: max(-1.5vw, -24px);
  width: 17vw;
  max-width: 280px;
  z-index: 4;
}

.prop-disks {
  top: 17vh;
  left: 1.1vw;
  /* Everything inside is sized in em, so the box scales as one object */
  font-size: clamp(8px, 0.8vw, 12px);
  width: 14.5em;
  height: 15em;
  transform: rotate(-3deg);
  z-index: 5;
}

/* A disk in the hand lies over the sampler's edge */
.prop-disks.is-open {
  z-index: 13;
}

.prop-disks[hidden] {
  display: none;
}

.prop-crate {
  top: 2vh;
  left: 66vw;
  /* Everything inside is sized in em, so the crate scales as one object */
  font-size: clamp(8px, 0.8vw, 12px);
  width: 13em;
  height: 9.4em;
  transform: rotate(2deg);
  z-index: 5;
}

/* A disk in the hand lies over the title */
.prop-crate.is-open {
  z-index: 13;
}

.prop-crate[hidden] {
  display: none;
}

.prop-mic {
  bottom: 12vh;
  left: 57vw;
  width: 13vw;
  max-width: 200px;
  /* above the sampler: on a cramped window the mic must stay reachable */
  z-index: 11;
}

/* The mic comes in with its cable, before the rest of the desk is dressed:
   a lead that ends in nothing looks cut. Same animation before and after
   power-on, so it doesn't play twice. */
body:not(.powered-on) .prop-mic {
  opacity: 1;
}

body:not(.powered-on) .prop-mic,
body.powered-on .prop-mic {
  animation: place-mic 0.8s ease-out 0.2s both;
}

@keyframes place-mic {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.prop-funk {
  bottom: 11vh;
  right: -2vw;
  width: 14vw;
  max-width: 230px;
  transform: rotate(4deg);
  z-index: 4;
}

/* ============ The header (ADR-0080): the wordmark top left, who is at the desk top right ============ */
.desk-top {
  position: absolute;
  top: 1.5vh;
  left: 0;
  right: 0;
  z-index: 14;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--top-h);
  padding: 0 1.2vw;
}

/* Only what is drawn in it takes a press: the wood between is the desk's */
.stage > .desk-top {
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.3em;
  margin: 0;
  font-family: "Permanent Marker", cursive;
  font-size: clamp(24px, 2.3vw, 34px);
  line-height: 1;
  color: #f8e6c8;
  letter-spacing: 0.02em;
  transform: rotate(-2deg);
  text-shadow:
    -1px -1px 0 #2a1810,
    1px 1px 0 #2a1810,
    2px 3px 0 rgba(0, 0, 0, 0.6),
    0 8px 20px rgba(0, 0, 0, 0.6);
}

.brand em {
  font-style: normal;
  color: #ff7a2b;
  text-shadow:
    -1px -1px 0 #2a1810,
    1px 1px 0 #2a1810,
    2px 3px 0 rgba(0, 0, 0, 0.7),
    0 0 18px rgba(255, 122, 43, 0.45);
}

.logo-mark {
  width: 1.45em;
  height: 1.45em;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  transform: rotate(2deg); /* counter the wordmark's -2deg so the logo sits straight */
}

.desk-nav {
  display: flex;
  align-items: center;
  gap: 1.4em;
  font-size: clamp(11px, 0.85vw, 13px);
  pointer-events: auto;
}

.how-btn {
  padding: 0.6em 0.2em;
  border: none;
  background: none;
  color: rgba(248, 230, 200, 0.78);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.92em;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  cursor: pointer;
}

.how-btn:hover,
.how-btn:focus-visible {
  color: #ffb46e;
  outline: none;
}

.how-btn:focus-visible .how-words {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

/* Where there is no room for the words, a ? on a round key */
.how-mark {
  display: none;
  width: 2.2em;
  height: 2.2em;
  border-radius: 50%;
  background: linear-gradient(180deg, #3a342d, #231f1a);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 215, 0.18),
    0 2px 0 #0a0806;
  color: #f4ecd6;
  line-height: 2.2em;
  text-align: center;
}

.account {
  position: relative;
}

.account[hidden] {
  display: none;
}

.acct-key {
  font-size: 1em;
}

/* A face and a name on a pill of the sampler's metal */
.acct-btn {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.25em 0.9em 0.25em 0.25em;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #3a342d, #231f1a);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 215, 0.18),
    0 2px 0 #0a0806,
    0 6px 14px rgba(0, 0, 0, 0.45);
  color: #f4ecd6;
  font-size: 1em;
  cursor: pointer;
}

.acct-btn:hover,
.acct-btn:focus-visible,
.acct-btn[aria-expanded="true"] {
  filter: brightness(1.15);
  outline: none;
}

.acct-btn:focus-visible {
  box-shadow:
    0 0 0 2px #ff7a2b,
    0 6px 14px rgba(0, 0, 0, 0.45);
}

.acct-btn.is-nudged {
  animation: held-nudge 0.5s ease-in-out 2;
}

.acct-face {
  display: block;
  width: 2.5em;
  height: 2.5em;
  padding: 0.12em;
  border-radius: 50%;
  background: #fff;
}

.acct-name {
  max-width: 11em;
  overflow: hidden;
  font-family: "Permanent Marker", cursive;
  font-size: 1.25em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.acct-stamp {
  padding: 0.15em 0.45em;
  border: 2px solid #d0452e;
  border-radius: 3px;
  color: #ff8a70;
  font-family: "Bowlby One", sans-serif;
  font-size: 0.68em;
  letter-spacing: 0.18em;
  transform: rotate(-6deg);
}

.acct-caret {
  color: rgba(244, 236, 214, 0.55);
  font-size: 0.8em;
}

.acct-menu {
  position: absolute;
  top: calc(100% + 0.7em);
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: 18em;
  padding: 0.5em;
  border-radius: 0.8em;
  background: linear-gradient(180deg, #2e2924, #1b1714);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 215, 0.14),
    0 0 0 1px #0a0806,
    0 1.4em 2.4em -0.4em rgba(0, 0, 0, 0.75);
  color: #f4ecd6;
  font-family: "JetBrains Mono", monospace;
  transform-origin: top right;
  animation: acct-drop 0.16s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes acct-drop {
  from {
    opacity: 0;
    transform: translateY(-0.4em) scale(0.97);
  }
}

.acct-me {
  display: flex;
  align-items: center;
  gap: 0.8em;
  min-width: 0;
  padding: 0.5em 0.5em 0.8em;
}

.acct-me .acct-face {
  flex: none;
  width: 3.2em;
  height: 3.2em;
}

.acct-mine {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #f8e6c8;
  font-family: "Permanent Marker", cursive;
  font-size: 1.45em;
  font-weight: 400;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.acct-input {
  padding: 0.1em 0;
  border: none;
  border-bottom: 2px dashed rgba(244, 236, 214, 0.5);
  background: none;
  outline: none;
  caret-color: #ff7a2b;
  text-overflow: clip;
}

.acct-under:empty {
  display: none;
}

.acct-note {
  display: block;
  padding: 0 0.6em 0.7em;
  color: #b9a888;
  font-size: 0.85em;
  line-height: 1.4;
}

.acct-note b,
.acct-try {
  color: #ffb46e;
  font-weight: 700;
}

.acct-note.is-ok {
  color: #9fe07a;
}

.acct-try {
  margin-left: 0.5em;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.acct-line {
  display: block;
  width: 100%;
  padding: 0.75em 0.7em;
  border: none;
  border-radius: 0.45em;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.acct-line:first-of-type {
  margin-top: 0.3em;
}

.acct-line:hover,
.acct-line:focus-visible {
  background: rgba(255, 240, 215, 0.09);
  outline: none;
}

.acct-hot {
  margin: 0 0.2em 0.4em;
  font-size: 0.82em;
}

/* The way out, under a rule of its own */
.acct-out {
  margin-top: 0.4em;
  border-top: 1px solid rgba(255, 240, 215, 0.12);
  border-radius: 0 0 0.45em 0.45em;
  color: #ff9b8a;
}

/* The faces, sixteen to pick from */
.acct-faces {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7em;
  padding: 0.3em 0.5em 0.6em;
}

.acct-pick {
  aspect-ratio: 1;
  padding: 0.2em;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.acct-pick img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.acct-pick:hover,
.acct-pick:focus-visible {
  transform: scale(1.12);
  outline: none;
}

.acct-pick[aria-checked="true"] {
  box-shadow:
    0 0 0 3px #ff7a2b,
    0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ============ How it works (ADR-0080): a page of the manual laid over the desk ============ */
.how-veil {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3vh 16px;
  background: rgba(10, 6, 2, 0.72);
}

.how-veil[hidden] {
  display: none;
}

.how-sheet {
  position: relative;
  width: 100%;
  max-width: 58em;
  max-height: 100%;
  overflow-y: auto;
  padding: 2.2em 2.6em 2em;
  border-radius: 0.5em;
  background: linear-gradient(180deg, #fdf8e8, #f4ecd3);
  box-shadow: 0 1.6em 2.4em -0.6em rgba(0, 0, 0, 0.7);
  color: #2a1f10;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(12px, 1vw, 14.5px);
  line-height: 1.6;
  outline: none;
  animation: keep-note-stick 0.25s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.how-sheet h2 {
  margin: 0 1.5em 0.4em 0;
  font-family: "Permanent Marker", cursive;
  font-size: 2.6em;
  font-weight: 400;
  line-height: 1.05;
}

.how-sheet h2 em {
  color: #d9541a;
  font-style: normal;
}

.how-lede {
  max-width: 70ch;
  margin: 0 0 1.6em;
  font-size: 1.05em;
}

.how-sheet strong {
  padding: 0 3px;
  background: rgba(255, 230, 120, 0.65);
  font-weight: 700;
}

.how-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.3em 2.6em;
}

.how-list h3 {
  margin: 0 0 0.15em;
  color: #a8370a;
  font-family: "Permanent Marker", cursive;
  font-size: 1.35em;
  font-weight: 400;
}

.how-list p {
  margin: 0;
}

.how-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.2em 2em;
  margin-top: 1.8em;
  padding-top: 1.4em;
  border-top: 2px dashed rgba(60, 40, 10, 0.25);
}

/* The keys, as a crib list: each one drawn as a little inked keycap */
.how-keys {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 6px 2.4em;
  margin: 0;
  font-size: 0.9em;
}

.how-keys div {
  display: grid;
  grid-template-columns: 4.6em 1fr;
  align-items: baseline;
  gap: 8px;
}

.how-keys dt,
.how-keys dd {
  margin: 0;
}

.how-keys kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 0.35em;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82em;
  font-weight: 700;
  text-align: center;
  color: #3b2a12;
  border: 1.5px solid rgba(60, 40, 10, 0.55);
  border-bottom-width: 3px;
  border-radius: 4px;
}

.how-shut {
  position: absolute;
  top: 0.5em;
  right: 0.6em;
  padding: 0.3em 0.5em;
  border: none;
  background: none;
  color: #6b5a3c;
  font-size: 1.8em;
  line-height: 1;
  cursor: pointer;
}

.how-shut:hover,
.how-shut:focus-visible {
  color: #a8370a;
  outline: none;
}

@media (max-width: 900px) {
  .how-list,
  .how-keys {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============ Sampler chassis ============ */
.sampler-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  gap: 0.5vh;
  width: 100%;
}

.sampler {
  position: relative;
  width: 100%;
  max-width: 100%;
  padding: 2vh 1.4vw 2.2vh;
  border-radius: 0.8vw;
  isolation: isolate;
  background: /* lamp sheen rolling off the top face */
      radial-gradient(ellipse 75% 60% at 50% -12%, rgba(255, 226, 190, 0.1), transparent 70%),
      var(--tex-plastic), linear-gradient(180deg, #2b2621 0%, #1e1a16 32%, #151210 100%);
  box-shadow: /* chamfered rim: lit along the top, shadowed along the bottom */
    inset 0 1px 0 var(--edge-hi),
    inset 0 3px 4px -2px rgba(255, 240, 215, 0.07),
    inset 0 -2px 3px var(--edge-lo),
    inset 2px 0 2px -1px rgba(255, 255, 255, 0.05),
    inset -2px 0 2px -1px rgba(0, 0, 0, 0.5),
    /* front wall — the body has thickness */
    0 7px 0 #0a0806,
    /* contact shadow, then two softer ambient layers */
    0 10px 4px rgba(0, 0, 0, 0.75),
    0 24px 30px -6px rgba(0, 0, 0, 0.7),
    0 55px 70px -22px rgba(0, 0, 0, 0.75);
}

/* Twenty years of gigs: hairline scratches, corners rubbed down to the
   primer, a worn palm-rest edge and a film of dust. Sits above the paint
   but below every control. */
.sampler::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(172deg, transparent 49.5%, rgba(255, 240, 220, 0.11) 50%, transparent 50.5%) 9%
    97% / 11% 14px no-repeat,
    linear-gradient(8deg, transparent 49.4%, rgba(255, 240, 220, 0.08) 50%, transparent 50.6%) 64%
    3% / 15% 12px no-repeat,
    linear-gradient(-4deg, transparent 49.4%, rgba(255, 240, 220, 0.07) 50%, transparent 50.6%) 93%
    98% / 8% 8px no-repeat,
    radial-gradient(ellipse 9% 16% at 0% 100%, rgba(196, 170, 130, 0.15), transparent 70%),
    radial-gradient(ellipse 7% 13% at 100% 100%, rgba(196, 170, 130, 0.11), transparent 70%),
    radial-gradient(ellipse 6% 12% at 100% 0%, rgba(196, 170, 130, 0.08), transparent 70%),
    radial-gradient(ellipse 32% 5% at 50% 100%, rgba(196, 170, 130, 0.09), transparent 70%),
    var(--tex-dust);
}

.sampler-strip,
.tracks {
  position: relative;
  z-index: 1;
}

/* Corner screws — the slot is a background layer so it can turn while the
   head's lighting stays put (a real screw's highlight doesn't rotate). */
@property --slot {
  syntax: "<angle>";
  inherits: false;
  initial-value: 35deg;
}

.screw,
.transport::before,
.transport::after {
  --rust: transparent;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background:
    linear-gradient(var(--slot), transparent 42%, rgba(0, 0, 0, 0.78) 42% 58%, transparent 58%),
    radial-gradient(circle at 68% 72%, var(--rust), transparent 62%),
    radial-gradient(circle at 50% 26%, #d8d1c2 0%, #8f8778 48%, #37322a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 1px rgba(0, 0, 0, 0.6),
    /* countersunk seat with a lit lower lip */
    0 0 0 2px rgba(0, 0, 0, 0.78),
    0 1px 0 2px rgba(255, 240, 215, 0.09);
}

.screw {
  position: absolute;
  z-index: 2;
  cursor: pointer;
  transition: --slot 0.55s cubic-bezier(0.3, 0.9, 0.3, 1);
}

.screw.tl {
  top: 9px;
  left: 9px;
}
.screw.tr {
  top: 9px;
  right: 9px;
  --slot: -18deg;
}
.screw.bl {
  bottom: 9px;
  left: 9px;
  --slot: 82deg;
  --rust: rgba(125, 62, 20, 0.5);
}
.screw.br {
  bottom: 9px;
  right: 9px;
  --slot: 118deg;
}

/* Give it a quarter turn */
.screw.tl:hover {
  --slot: 125deg;
}
.screw.tr:hover {
  --slot: 72deg;
}
.screw.bl:hover {
  --slot: 172deg;
}
.screw.br:hover {
  --slot: 208deg;
}

/* Sampler top brand strip */
.sampler-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0.8vw 1vh;
  padding-bottom: 0.8vh;
  /* machined groove: dark cut with a lit lower lip */
  border-bottom: 1px solid rgba(0, 0, 0, 0.65);
  box-shadow: 0 1px 0 rgba(255, 240, 215, 0.07);
  gap: 1vw;
}

.brand-mark {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5vw;
  font-family: "Bowlby One", sans-serif;
  font-size: clamp(11px, 0.9vw, 16px);
  letter-spacing: 0.25vw;
  /* Machined-into-chassis: letter color matches the chassis dark tone,
     a hair deeper so the face reads as a recessed surface, not paint */
  color: #0e0b08;
  /* The 3D illusion comes entirely from edge shadows + highlights:
     - dark line on the TOP edge of each letter (recess wall facing away from overhead lamp)
     - subtle warm highlight on the BOTTOM edge (chamfered lip catching the lamp glow above)
     - the lamp on the desk is at top center, so all letters share the same light direction */
  text-shadow:
    0 -1px 0 rgba(0, 0, 0, 0.95),
    -1px -1px 1px rgba(0, 0, 0, 0.55),
    0 1px 0 rgba(255, 230, 200, 0.16),
    1px 1px 1px rgba(255, 220, 180, 0.08);
  cursor: default;
  user-select: none;
}

.brand-mark .dot {
  width: 0.5vw;
  height: 0.5vw;
  min-width: 7px;
  min-height: 7px;
  max-width: 10px;
  max-height: 10px;
  border-radius: 50%;
  /* Recessed LED-in-chassis look: dark well + glowing dome inside */
  background: radial-gradient(circle at 35% 30%, #ffb46e 0%, #ff7a2b 45%, #c2410c 90%);
  box-shadow:
    inset 0 1px 1px rgba(255, 220, 180, 0.5),
    inset 0 -1px 1px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 0 10px rgba(255, 122, 43, 0.55);
  animation: pulse 1.4s ease-in-out infinite;
}

.brand-mark::after {
  content: "BUILT IN THE BASEMENT · '00";
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  color: rgba(255, 200, 100, 0.7);
  letter-spacing: 0.2vw;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  pointer-events: none;
}

.brand-mark:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* Opacity-only so the power LED blinks on the compositor */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* LCD display — reflective panel behind a glass window, set into a bezel */
.lcd {
  position: relative; /* positioning context for .lcd-boot overlay */
  background: /* pixel grid */
      repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.15) 0 1px, transparent 1px 3px),
      repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0 1px, transparent 1px 3px),
      /* edge-lit backlight: hotter near the LED on the left */
      radial-gradient(ellipse 55% 150% at 0% 50%, rgba(238, 255, 205, 0.4), transparent 70%),
      linear-gradient(180deg, #b4d491 0%, #98b874 100%);
  color: #1f2913;
  font-family: "VT323", monospace;
  font-size: clamp(14px, 1.3vw, 22px);
  line-height: 1;
  padding: 0.7vh 1vw;
  border-radius: 3px;
  box-shadow:
    inset 0 3px 7px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(0, 0, 0, 0.35),
    /* bezel, then the lit lip of the cut-out it sits in */
    0 0 0 3px #0b0908,
    0 0 0 4px rgba(255, 240, 215, 0.06),
    0 2px 0 4px rgba(255, 240, 215, 0.05);
  /* Segments cast a faint shadow onto the reflector behind them */
  text-shadow: 1px 2px 0 rgba(31, 41, 19, 0.2);
  letter-spacing: 1px;
  display: flex;
  gap: 1.2vw;
  align-items: center;
  overflow: hidden; /* keep the boot text clipped to the LCD bounds */
}

/* Lamp reflection on the glass */
.lcd::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: linear-gradient(
    112deg,
    rgba(255, 255, 255, 0.24) 0%,
    rgba(255, 255, 255, 0.07) 24%,
    transparent 24.5%,
    transparent 70%,
    rgba(255, 255, 255, 0.05) 100%
  );
}

.lcd .v {
  color: #2a3a16;
  display: inline-block;
}

/* Fixed-width value cells so the LCD never resizes when its values change
   (e.g. mode switching FRICTION → LIMP → LIVE).
   ch counts characters but the LCD also applies letter-spacing: 1px, so
   we add a small calc() padding to keep the cell stable even at the
   longest expected content. */
.lcd .v[data-bind="bpm"] {
  min-width: calc(3ch + 4px);
  text-align: right;
}
.lcd .v[data-bind="step"] {
  min-width: calc(2ch + 3px);
  text-align: right;
}
.lcd .v[data-bind="mode"] {
  /* "FRICTION" = 8 chars + 7 letter-spacing gaps + safety margin */
  min-width: calc(8ch + 12px);
  text-align: left;
}
.lcd .v[data-bind="humanize"] {
  min-width: calc(4ch + 5px);
  text-align: right;
}

.lcd .lbl {
  font-size: clamp(7px, 0.55vw, 10px);
  opacity: 0.6;
  letter-spacing: 1.5px;
  font-family: "JetBrains Mono", monospace;
  margin-bottom: 2px;
}

.lcd-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
  min-width: 3.5vw;
  white-space: nowrap;
}

.lcd-cell:not(:last-child) {
  border-right: 1px solid rgba(30, 50, 20, 0.25);
  padding-right: 1vw;
}

/* ---- Track rows (#app populated by Grid.js) ---- */
/* The pad bed: a recessed plate the pads poke up through */
.tracks,
#app {
  display: flex;
  flex-direction: column;
  gap: 1vh;
  padding: 1.1vh 0.6vw 1.3vh;
  border-radius: 0.5vw;
  background: linear-gradient(180deg, #0f0c0a 0%, #16120f 100%);
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.85),
    inset 0 0 0 1px rgba(0, 0, 0, 0.6),
    0 1px 0 rgba(255, 240, 215, 0.08);
}

.track-row {
  display: grid;
  /* The plate has room for a sound's name with its row's before it ("kick_punch.wav") */
  grid-template-columns:
    clamp(122px, 10vw, 140px)
    auto
    auto
    1fr;
  column-gap: 0.7vw;
  align-items: center;
  position: relative;
}

.track-info {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2vh;
  width: 100%;
  min-width: 0;
}

/* Standalone track-name (only briefly visible before SampleUploader wraps it) */
.track-name {
  position: relative;
  display: block;
  font-family: "Bowlby One", sans-serif;
  font-size: clamp(10px, 0.75vw, 14px);
  letter-spacing: 0.08vw;
  color: #f0e8d8;
  text-transform: uppercase;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The wrapper SampleUploader injects becomes an embossed label-maker strip
   stuck to the chassis, colour-coded along its left edge */
.track-info .track-name-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4vw;
  width: 100%;
  padding: 0.6vh 0.35vw 0.6vh 0.55vw;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 38%, rgba(0, 0, 0, 0.25) 100%),
    #241e18;
  border: none;
  border-left: 3px solid var(--track-color, #ff7a2b);
  border-radius: 2px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    0 1px 2px rgba(0, 0, 0, 0.7);
}

/* Track-name inside the container: raised white embossed letters */
.track-name-container .track-name {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
  text-align: left;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: clamp(9px, 0.72vw, 13px);
  letter-spacing: 0.12vw;
  color: #f4eee0;
  text-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.35),
    0 1px 1px rgba(0, 0, 0, 0.9);
}

/* ---- What a drum row plays (SampleUploader.js, ADR-0049) ----
   On the row's plate, under its name: a pair of keys to step through the
   built-in sounds and a lit readout that names the one it is on, as a
   sampler names a file. Pressing the readout slides the list out. */
.track-info .sound-plate {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.35vh;
  padding-right: clamp(3px, 0.35vw, 5px);
  padding-left: clamp(5px, 0.55vw, 8px);
}

.sound-plate .track-name {
  flex: none;
}

.sound-pick {
  display: flex;
  align-items: stretch;
  gap: 3px;
  min-width: 0;
}

.sound-steps {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 1px;
}

.sound-step {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(15px, 1.25vw, 20px);
  flex: 1;
  padding: 0;
  border: none;
  border-radius: 2px;
  background: linear-gradient(180deg, #5a4b3a, #33291e);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 1px 0 #0d0906;
  cursor: pointer;
}

.sound-step::before {
  content: "";
  border: 3.5px solid transparent;
  border-top: 0;
  border-bottom: 5px solid #f4ecd6;
}

.sound-step.is-next::before {
  border-top: 5px solid #f4ecd6;
  border-bottom: 0;
}

.sound-step:hover {
  background: linear-gradient(180deg, #7a6248, #45372a);
}

.sound-step:active {
  transform: translateY(1px);
}

.sound-readout {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 3px;
  min-width: 0;
  height: clamp(19px, 1.62vw, 25px);
  padding: 0 4px;
  border: none;
  border-radius: 2px;
  background: #1a0503;
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.9),
    0 1px 0 rgba(255, 255, 255, 0.08);
  color: #e2412a;
  font-family: "VT323", monospace;
  font-size: clamp(13px, 0.95vw, 17px);
  line-height: 1;
  letter-spacing: 0.02em;
  text-align: left;
  text-shadow: 0 0 6px rgba(255, 74, 46, 0.55);
  cursor: pointer;
  transition:
    color 0.12s ease,
    box-shadow 0.12s ease;
}

/* The row's name, for where the plate has no room for it */
.sound-row {
  display: none;
}

.sound-file {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* The mark that says there is a list behind it */
.sound-readout::after {
  content: "";
  flex: none;
  border: 3px solid transparent;
  border-top: 4px solid currentColor;
  border-bottom: 0;
  opacity: 0.55;
  transition: opacity 0.12s ease;
}

/* Under the pointer, or with its list out, it lights as a key would */
.sound-readout:hover,
.sound-readout:focus-visible,
.sound-readout[aria-expanded="true"] {
  color: #ff6a4a;
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 122, 43, 0.85),
    0 0 8px rgba(255, 122, 43, 0.35);
  outline: none;
}

.sound-readout:hover::after,
.sound-readout:focus-visible::after,
.sound-readout[aria-expanded="true"]::after {
  opacity: 1;
}

/* A sound of the maker's own */
.sound-readout.is-own {
  color: #ffd23f;
  text-shadow: 0 0 6px rgba(255, 210, 63, 0.5);
}

/* The list: a slip of paper out from under the plate */
.sound-menu {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  width: clamp(150px, 12vw, 200px);
  padding: 0.3em 0;
  background: linear-gradient(180deg, #f4ecd6, #e6d8ba);
  border-radius: 0 0 3px 3px;
  box-shadow:
    inset 0 3px 4px -2px rgba(0, 0, 0, 0.35),
    0 1.2em 1.6em -0.5em rgba(0, 0, 0, 0.75);
  font-size: clamp(10px, 0.74vw, 13px);
  transform-origin: top center;
  animation: cassette-menu-out 0.2s cubic-bezier(0.3, 1.3, 0.5, 1);
}

/* The lower rows' lists go up, clear of the bottom of the sampler */
.sound-menu.is-up {
  top: auto;
  bottom: calc(100% + 3px);
  border-radius: 3px 3px 0 0;
  box-shadow:
    inset 0 -3px 4px -2px rgba(0, 0, 0, 0.35),
    0 1.2em 1.6em -0.5em rgba(0, 0, 0, 0.75);
  transform-origin: bottom center;
}

.sound-menu[hidden] {
  display: none;
}

/* The row whose list is out lies over the rows after it */
.track-row.is-choosing {
  z-index: 20;
}

.sound-line {
  display: flex;
  align-items: center;
  gap: 0.6em;
  min-height: 2.3em;
  margin: 0;
  padding: 0 0.9em;
  border: none;
  background: none;
  color: #2a1f10;
  font-family: "JetBrains Mono", monospace;
  font-size: inherit;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.sound-line::before {
  content: "";
  flex: none;
  width: 0.55em;
  height: 0.55em;
  border: 1.5px solid rgba(42, 31, 16, 0.45);
  border-radius: 50%;
}

.sound-line[aria-checked="true"]::before {
  border-color: #c2410c;
  background: #c2410c;
}

.sound-line:hover,
.sound-line:focus-visible {
  background: rgba(194, 65, 12, 0.12);
  outline: none;
}

.sound-line.is-own,
.sound-line.is-upload {
  font-weight: 400;
}

/* The maker's own, and the way to add one, below a rule */
.sound-line:not(.is-own):not(.is-upload) + .is-own,
.sound-line:not(.is-own):not(.is-upload) + .is-upload {
  margin-top: 0.3em;
  border-top: 1px solid rgba(42, 31, 16, 0.2);
  padding-top: 0.3em;
}

.sound-line.is-upload {
  color: #c2410c;
  font-weight: 700;
}

.sound-line.is-upload::before {
  content: "+";
  width: 0.55em;
  height: auto;
  border: none;
  border-radius: 0;
  font-size: 1.2em;
  line-height: 1;
}

/* The row lock, last in the list under its own rule: a tick box, not a pick */
.sound-line.is-lock {
  margin-top: 0.3em;
  border-top: 1px solid rgba(42, 31, 16, 0.2);
  padding-top: 0.3em;
  font-weight: 400;
}

.sound-line.is-lock::before {
  border-radius: 2px;
}

.sound-line[aria-disabled="true"] {
  opacity: 0.6;
  cursor: default;
}

/* The readout's own tip would sit on the open list */
body:has(.sound-readout[aria-expanded="true"]) .tooltip {
  display: none;
}

/* Below the largest desk the plate is one line: the name is put away and
   the readout carries it ("kick_deep.wav") */
@media (max-width: 1599px), (max-height: 799px) {
  .sound-plate .track-name {
    display: none;
  }

  .sound-row {
    display: inline;
    flex: none;
  }

  .sound-readout {
    gap: 0;
    font-size: clamp(12px, 1.02vw, 13.5px);
  }

  .sound-readout::after {
    margin-left: 3px;
  }
}

/* Under a finger the step keys and the list's lines take a press */
@media (pointer: coarse) {
  .sound-step::after {
    content: "";
    position: absolute;
    inset: -10px -4px 0 -12px;
  }

  .sound-step.is-next::after {
    inset: 0 -4px -10px -12px;
  }

  .sound-line {
    min-height: 44px;
  }
}

.track-controls-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4vw;
  margin-top: 0.3vh;
}

/* Ghost mini-dial container — auto-height so the GHOST label sits naturally below */
.track-dial-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.track-dial-container .mini-dial-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2vh;
}

.mini-dial-svg {
  width: clamp(38px, 3.4vw, 50px);
  height: clamp(38px, 3.4vw, 50px);
  cursor: ns-resize;
  display: block;
}

/* Dials turn under a mouse or a finger (Turnable.js, ADR-0050): the browser
   leaves a press on one alone, so a drag turns it and never scrolls or zooms */
.track-row .mini-dial-wrapper {
  position: relative;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: ns-resize;
}

.track-row .mini-dial-wrapper:focus-visible {
  outline: 2px solid #ff7a2b;
  outline-offset: 2px;
  border-radius: 6px;
}

/* A finger gets a wider place to take hold */
@media (pointer: coarse) {
  .track-row .mini-dial-wrapper::before {
    content: "";
    position: absolute;
    inset: -4px -6px;
  }
}

.mini-dial-svg:active {
  cursor: grabbing;
}

.mini-knob-group {
  transform-origin: 18px 18px;
  transition: transform 0.05s ease-out;
}

.mini-dial-label {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(6px, 0.48vw, 8px);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  text-align: center;
  line-height: 1;
  margin-top: 2px;
}

/* The label reads the value while the pot is held: a finger covers the pot */
.mini-dial-label::after {
  content: attr(data-label);
}

.mini-dial-wrapper.is-held .mini-dial-label {
  color: #ff7a2b;
}

.mini-dial-wrapper.is-held .mini-dial-label::after {
  content: attr(data-value);
}

.mini-dial-arc {
  transition: stroke-dashoffset 0.05s ease-out;
}

/* The take row's pocket key (it was the row lock's key first, and keeps its name) */
.swing-lock-btn {
  width: clamp(22px, 1.9vw, 28px);
  height: clamp(22px, 1.9vw, 28px);
  padding: 2px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -1px 2px rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
}

.swing-lock-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Mute and solo, a pair on every row where the row lock was (ADR-0053) */
.ms-keys {
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-self: center;
}

.ms-key {
  width: clamp(22px, 1.9vw, 28px);
  height: clamp(11px, 0.95vw, 14px);
  padding: 0;
  display: grid;
  place-items: center;
  font:
    400 clamp(7px, 0.6vw, 9px) / 1 "Bowlby One",
    sans-serif;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -1px 2px rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.ms-key:hover {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.25);
}

.ms-key.is-mute[aria-pressed="true"] {
  color: #1a1410;
  background: #ff7a2b;
  border-color: #ff7a2b;
}

.ms-key.is-solo[aria-pressed="true"] {
  color: #1a1410;
  background: #ffd23f;
  border-color: #ffd23f;
  box-shadow: 0 0 8px rgba(255, 210, 63, 0.5);
}

/* The row lock is a line in the sound's list: a small padlock on the plate while it is on */
.track-info .sound-plate {
  position: relative;
}

.plate-lock {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 13px;
  height: 13px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ff7a2b;
  color: #1a1410;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.plate-lock[hidden] {
  display: none;
}

.plate-lock svg {
  width: 9px;
  height: 9px;
}

/* ---- Pads (the step cells) ----
   Each pad is three stacked layers, so every state change is an opacity
   fade the compositor can run without repainting anything:
     .step          aged silicone cap (static)
     .step::before  amber backlight bleeding through the rubber (step on)
     .step::after   playhead strobe — snaps on, decays like a warm LED */
.track-steps {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 0.34vw;
}

.step {
  --rub-hi: #dcd2bf;
  --rub-mid: #b4a993;
  --rub-lo: #80755f;
  --dimple: linear-gradient(transparent, transparent);
  --art-mark: linear-gradient(transparent, transparent);
  --art-ink: rgba(40, 28, 12, 0.72);
  position: relative;
  aspect-ratio: 1;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  background:
    var(--art-mark), var(--dimple),
    /* soft sheen across the domed top */
    radial-gradient(ellipse 85% 55% at 50% 6%, rgba(255, 255, 255, 0.5), transparent 72%),
    linear-gradient(180deg, var(--rub-hi) 0%, var(--rub-mid) 58%, var(--rub-lo) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -4px 6px rgba(60, 45, 25, 0.45),
    /* grime packed into the edge */
    inset 0 0 0 1px rgba(70, 55, 35, 0.3),
    /* side wall of the cap, then its shadow on the bed */
    0 2px 0 #4d4537,
    0 5px 5px rgba(0, 0, 0, 0.65);
  /* Release: the rubber dome springs back with a little overshoot */
  transition:
    transform 0.18s cubic-bezier(0.3, 1.8, 0.5, 1),
    box-shadow 0.18s ease-out;
}

/* Moulded dimple marking each downbeat */
.step.beat {
  --dimple: radial-gradient(circle at 50% 84%, rgba(40, 28, 12, 0.55) 0 1.5px, transparent 2.2px);
}

/* Articulation notches, moulded into the cap so they read lit or unlit.
   Short ticks are grace notes ahead of the hit (tall tick); equal ticks are
   roll hits; three dots are the triplet. */
.step[data-art="flam"] {
  --art-mark:
    linear-gradient(var(--art-ink), var(--art-ink)) calc(50% - 3px) 9px / 2px 5px no-repeat,
    linear-gradient(var(--art-ink), var(--art-ink)) calc(50% + 2px) 5px / 2px 9px no-repeat;
}
.step[data-art="drag"] {
  --art-mark:
    linear-gradient(var(--art-ink), var(--art-ink)) calc(50% - 6px) 9px / 2px 5px no-repeat,
    linear-gradient(var(--art-ink), var(--art-ink)) calc(50% - 1px) 9px / 2px 5px no-repeat,
    linear-gradient(var(--art-ink), var(--art-ink)) calc(50% + 4px) 5px / 2px 9px no-repeat;
}
.step[data-art="roll2"] {
  --art-mark:
    linear-gradient(var(--art-ink), var(--art-ink)) calc(50% - 3px) 5px / 2px 9px no-repeat,
    linear-gradient(var(--art-ink), var(--art-ink)) calc(50% + 3px) 5px / 2px 9px no-repeat;
}
.step[data-art="roll3"] {
  --art-mark:
    linear-gradient(var(--art-ink), var(--art-ink)) calc(50% - 5px) 5px / 2px 9px no-repeat,
    linear-gradient(var(--art-ink), var(--art-ink)) 50% 5px / 2px 9px no-repeat,
    linear-gradient(var(--art-ink), var(--art-ink)) calc(50% + 5px) 5px / 2px 9px no-repeat;
}
.step[data-art="trip"] {
  --art-mark:
    radial-gradient(circle, var(--art-ink) 0 1.6px, transparent 2.2px) calc(50% - 6px) 7px / 5px 5px
    no-repeat,
    radial-gradient(circle, var(--art-ink) 0 1.6px, transparent 2.2px) 50% 7px / 5px 5px no-repeat,
    radial-gradient(circle, var(--art-ink) 0 1.6px, transparent 2.2px) calc(50% + 6px) 7px / 5px 5px
    no-repeat;
}

/* Uneven ageing — downbeats are polished by fingers, others have yellowed
   or picked up grime. Strides differ per row so the wear never lines up
   into columns. */
.step:nth-child(4n + 1) {
  --rub-hi: #e6ddcc;
  --rub-mid: #bfb49f;
}
.track-row:nth-child(odd) .step:nth-child(7n + 3),
.track-row:nth-child(even) .step:nth-child(9n + 6) {
  --rub-hi: #ddd1b8;
  --rub-mid: #b7a98c;
  --rub-lo: #837253;
}
.track-row:nth-child(3n + 1) .step:nth-child(5n + 4),
.track-row:nth-child(3n + 2) .step:nth-child(6n + 2),
.track-row:nth-child(3n) .step:nth-child(11n + 8) {
  --rub-hi: #d2c8b5;
  --rub-mid: #a79c87;
  --rub-lo: #746a56;
}

.step:hover {
  filter: brightness(1.05);
}

/* Press: fast travel down, the cap sinks flush and its shadow closes up */
.step:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 4px rgba(60, 45, 25, 0.5),
    inset 0 -2px 4px rgba(60, 45, 25, 0.4),
    inset 0 0 0 1px rgba(70, 55, 35, 0.3),
    0 0 0 #4d4537,
    0 1px 2px rgba(0, 0, 0, 0.7);
  transition-duration: 0.04s;
}

.step::before,
.step::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
}

/* Backlight: hottest over the LED in the middle, deep amber at the rim,
   with a little light spilling onto the bed around the pad */
.step::before {
  background:
    var(--art-mark), var(--dimple),
    radial-gradient(ellipse 85% 55% at 50% 6%, rgba(255, 255, 255, 0.35), transparent 72%),
    radial-gradient(circle at 50% 55%, #ffd7a3 0%, #ff9443 36%, #f2691c 68%, #b9410d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -3px 6px rgba(120, 30, 0, 0.55),
    0 2px 0 #7c2d08,
    0 0 3px rgba(255, 160, 90, 0.8),
    0 0 14px 1px rgba(255, 122, 43, 0.42);
  transition: opacity 0.16s ease-out;
}

body.powered-on .step.active::before {
  opacity: 1;
  transition-duration: 0.05s;
}

.step::after {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 250, 235, 0.8) 0%,
    rgba(255, 236, 205, 0.3) 62%,
    rgba(255, 236, 205, 0.12) 100%
  );
  box-shadow: 0 0 10px 1px rgba(255, 236, 205, 0.3);
  transition: opacity 0.24s ease-out;
}

.step.playing::after {
  opacity: 0.7;
  transition-duration: 0s;
}

.step.active.playing::after {
  opacity: 1;
}

/* A switched bar (ADR-0078, FR-DESK-43): its step lights run dimmer, so the eye knows which bar it is */
body.is-switched-bar .step.playing::after {
  opacity: 0.4;
}

body.is-switched-bar .step.active.playing::after {
  opacity: 0.75;
}

/* ---- VOX lane: the voice take as a fifth row ---- */
.track-row.vox-row[hidden] {
  display: none;
}

/* A take row's plate reads as a drum row's does (ADR-0051): the pocket key where
   the step keys would be, then the take's name on the readout */
.vox-row .sound-pick .vox-follow-btn {
  align-self: stretch;
  width: clamp(20px, 1.7vw, 26px);
  height: auto;
  border-radius: 2px;
}

.vox-row .sound-file {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A line that does something has no mark to carry: only a pick has */
.vox-row .sound-line:not(.is-upload) {
  font-weight: 400;
}

.vox-row .sound-line:not(.is-upload)::before {
  content: none;
}

/* The line that takes something away, below a rule */
.sound-line.is-off {
  margin-top: 0.3em;
  border-top: 1px solid rgba(42, 31, 16, 0.2);
  padding-top: 0.3em;
  color: #8a2a12;
}

/* SAUCE and TUNE sit side by side under the name plate */
.vox-fx-keys {
  display: flex;
  gap: 3px;
}

/* TUNE: a small latching key beside the SAUCE slot, marked with a tuning fork */
.vox-tune-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(20px, 1.7vw, 26px);
  color: rgba(240, 232, 216, 0.6);
  padding: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 38%, rgba(0, 0, 0, 0.25) 100%),
    #241e18;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 2px 3px rgba(0, 0, 0, 0.6);
  transition:
    color 0.2s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
}

.vox-tune-btn svg {
  width: 62%;
  height: 80%;
}

.vox-tune-btn:hover {
  color: #f0e8d8;
}

/* SAUCE send: a fader slot under the name plate. Sliding the cap to the
   right uncovers a pearly strip that gets brighter and more thickly
   sequinned the further it goes; the slot glows to match. --dream is 0-1. */
.vox-dream {
  --dream: 0;
  position: relative;
  flex: 1.6;
  display: block;
  border-radius: 2px;
  background: linear-gradient(180deg, #0d0a08 0%, #1d1813 100%);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.9),
    0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 calc(var(--dream) * 12px) rgba(247, 168, 200, calc(var(--dream) * 0.6)),
    0 0 calc(var(--dream) * 24px) rgba(201, 179, 255, calc(var(--dream) * 0.35));
  cursor: ew-resize;
}

/* The word sits in the middle of the slot however tall the slot is */
.vox-dream,
.vox-dream-fill {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* A squeeze bottle before the word: what the slot pours */
.vox-dream-bottle {
  width: auto;
  height: 1.55em;
  margin-right: 0.45em;
  vertical-align: -0.38em;
}

.vox-dream-label {
  display: block;
  font-family: "Bowlby One", sans-serif;
  font-size: clamp(7px, 0.55vw, 9px);
  letter-spacing: 0.04vw;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  padding: 0.4vh 0.15vw;
  color: rgba(240, 232, 216, 0.5);
}

/* The uncovered strip carries its own dark copy of the label */
.vox-dream-fill {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  clip-path: inset(0 calc(100% - var(--dream) * 100%) 0 0 round 2px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, transparent 45%, rgba(0, 0, 0, 0.12) 100%),
    linear-gradient(90deg, #8a6a52 0%, #ffb37a 30%, #f7a8c8 62%, #c9b3ff 86%, #f4efff 100%);
}

.vox-dream-fill .vox-dream-label {
  color: #2a1030;
}

/* Sequins: sparse at the dry end, thick at the wet end, and they twinkle */
.vox-dream-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 68%, #fff 0 0.6px, transparent 1.2px),
    radial-gradient(circle at 41% 26%, #fff 0 0.7px, transparent 1.4px),
    radial-gradient(circle at 55% 74%, #fff 0 0.7px, transparent 1.4px),
    radial-gradient(circle at 64% 30%, #fff 0 0.9px, transparent 1.7px),
    radial-gradient(circle at 72% 62%, #fff 0 0.8px, transparent 1.6px),
    radial-gradient(circle at 79% 22%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 85% 78%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 90% 40%, #fff 0 1.2px, transparent 2.4px),
    radial-gradient(circle at 95% 68%, #fff 0 1.1px, transparent 2.2px),
    radial-gradient(circle at 98% 20%, #fff 0 1.3px, transparent 2.6px);
  animation: dream-twinkle 1.6s ease-in-out infinite alternate;
}

@keyframes dream-twinkle {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}

/* Fader cap: a ridged chrome cap, taller than its slot so there is
   something to get hold of, with an index line down the middle */
.vox-dream-cap {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: clamp(5px, calc(var(--dream) * 100%), calc(100% - 5px));
  width: 10px;
  transform: translateX(-50%);
  border-radius: 2px;
  background:
    linear-gradient(90deg, transparent 0 4px, #ff7a2b 4px 6px, transparent 6px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.4) 0 1px, transparent 1px 2px),
    linear-gradient(180deg, #f6f1e8 0%, #b9b1a5 45%, #6b645b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(0, 0, 0, 0.6);
  transition:
    transform 0.12s ease,
    filter 0.12s ease;
}

.vox-dream:hover .vox-dream-cap {
  filter: brightness(1.2);
  transform: translateX(-50%) scaleY(1.08);
}

.vox-dream:active .vox-dream-cap {
  transform: translateX(-50%) scaleY(0.96);
}

/* The real control: an invisible range input over the slot */
.vox-dream-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: grab;
}

.vox-dream-input:active {
  cursor: grabbing;
}

.vox-dream:focus-within {
  outline: 1px solid #f7a8c8;
  outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
  .vox-dream-fill::after {
    animation: none;
  }
}

/* TUNE key: lit amber, like the other latching mode keys */
.vox-tune-btn[aria-pressed="true"] {
  color: #1a0f06;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, transparent 40%, rgba(0, 0, 0, 0.15) 100%),
    #ff7a2b;
}

/* FOLLOW key: beside the take's name, drawn as the keys of that column are */
.swing-lock-btn.vox-follow-btn {
  font-family: "Bowlby One", sans-serif;
  font-size: clamp(9px, 0.7vw, 12px);
  color: #ffc58a;
  text-shadow: 0 0 6px rgba(255, 122, 43, 0.6);
}

/* Chop screen: a second LCD the width of the pads, showing the take's
   waveform with its slice markers. Same glass and backlight as the main one. */
.vox-lcd {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 4px 4px 4px 0;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse 40% 150% at 0% 50%, rgba(238, 255, 205, 0.4), transparent 70%),
    linear-gradient(180deg, #b4d491 0%, #98b874 100%);
  color: #1f2913;
  border-radius: 3px;
  overflow: hidden;
  box-shadow:
    inset 0 3px 7px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 0 3px #0b0908,
    0 0 0 4px rgba(255, 240, 215, 0.06),
    0 2px 0 4px rgba(255, 240, 215, 0.05);
}

/* Lamp reflection on the glass */
.vox-lcd::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    112deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0.05) 12%,
    transparent 12.5%
  );
}

.vox-screen {
  position: relative;
  height: clamp(58px, 5.4vw, 92px);
  cursor: pointer;
  touch-action: none;
}

/* Both take rows showing: shallower screens, so the unit still fits the desk */
.two-takes .vox-screen {
  height: clamp(36px, 3vw, 50px);
}

.vox-screen canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* The step being played, as an inverse-video block sliding along */
.vox-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: rgba(31, 41, 19, 0.2);
  opacity: 0;
  pointer-events: none;
}

/* Soft keys along the bottom of the screen: a readout, then CHOP and GRID */
.vox-softkeys {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px 3px 6px;
  border-top: 1px solid rgba(31, 41, 19, 0.35);
  font-family: "VT323", monospace;
  font-size: clamp(11px, 0.95vw, 15px);
  line-height: 1;
  letter-spacing: 1px;
}

.vox-readout {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #2a3a16;
}

/* Inverse video, as function-key labels are drawn */
.vox-soft {
  position: relative;
  z-index: 1;
  flex: none;
  font: inherit;
  letter-spacing: 1px;
  color: #b4d491;
  background: #1f2913;
  border: none;
  border-radius: 1px;
  padding: 1px 6px 2px;
  cursor: pointer;
}

.vox-soft:hover {
  background: #33451d;
}

.vox-soft:disabled {
  opacity: 0.3;
  cursor: default;
}

/* SLIDE / SWAP / COPY: one of the three is lit, like a latching mode switch */
.vox-tools {
  display: flex;
  flex: none;
  gap: 1px;
  margin-right: 4px;
}

.vox-tools .vox-soft {
  color: #1f2913;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(31, 41, 19, 0.75);
}

.vox-tools .vox-soft:hover {
  background: rgba(31, 41, 19, 0.18);
}

.vox-tools .vox-soft[aria-pressed="true"] {
  color: #d6ecb8;
  background: #b3200a;
  box-shadow: none;
}

.vox-soft:focus-visible {
  outline: 2px solid #b3200a;
  outline-offset: 1px;
}

/* CUT: the key that commits a trim is the lit one */
.vox-soft.vox-trim-apply {
  color: #d6ecb8;
  background: #b3200a;
}

.vox-soft.vox-trim-apply:hover {
  background: #cf2a10;
}

/* Trim screen: its own keys take the place of the chopping ones */
.vox-row:not(.is-trimming) .vox-trim-only,
.vox-row.is-trimming .vox-softkeys > :not(.vox-readout, .vox-trim-only),
.vox-row.is-trimming .vox-playhead {
  display: none;
}

/* Reading a file: the row comes up at once, its screen saying what it is
   doing, with a block running along the bottom like a tape counter */
.vox-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12%;
  background: linear-gradient(180deg, rgba(180, 212, 145, 0.94), rgba(152, 184, 116, 0.94));
  font-family: "VT323", monospace;
  font-size: clamp(13px, 1.15vw, 18px);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #1f2913;
  cursor: progress;
}

.vox-loading[hidden] {
  display: none;
}

.vox-loading-text {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.vox-loading-text::after {
  content: "_";
  animation: vox-loading-blink 0.7s steps(2, jump-none) infinite;
}

/* A row of LCD segments, with a few lit ones sweeping across */
.vox-loading-bar {
  position: relative;
  width: 100%;
  height: clamp(6px, 0.6vw, 9px);
  overflow: hidden;
  background: repeating-linear-gradient(90deg, rgba(31, 41, 19, 0.16) 0 6px, transparent 6px 8px);
}

.vox-loading-bar i {
  position: absolute;
  inset: 0;
  width: 25%;
  background: repeating-linear-gradient(90deg, #1f2913 0 6px, transparent 6px 8px);
  animation: vox-loading-sweep 1.1s steps(20) infinite;
}

.vox-row.is-loading {
  animation: vox-row-in 0.28s ease-out;
}

/* The drummer's thought bubble (ADR-0058): beside his head, its trail rising from the crown */
.drummer-thought {
  position: fixed;
  z-index: 26;
  transform: translateY(-100%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px 10px;
  border: 2px solid #2a1f10;
  border-radius: 22px;
  background: #fbf3df;
  color: #2a1f10;
  font-family: "Permanent Marker", cursive;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}

/* With nothing to say the bubble is put away: its last words and keys are not left on the desk */
.drummer-thought[hidden] {
  display: none;
}

.drummer-thought::before,
.drummer-thought::after {
  content: "";
  position: absolute;
  border: 2px solid #2a1f10;
  border-radius: 50%;
  background: #fbf3df;
}

.drummer-thought::before {
  right: -17px;
  bottom: 12px;
  width: 11px;
  height: 11px;
}

.drummer-thought::after {
  right: -30px;
  bottom: 22px;
  width: 6px;
  height: 6px;
}

.drummer-thought .words {
  padding: 4px 2px;
}

.drummer-thought .which {
  font-size: 11px;
  opacity: 0.6;
}

/* His keys are raised, and go down under a press */
.drummer-thought button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 10px;
  border: 2px solid #2a1f10;
  border-radius: 8px;
  background: #efe4c8;
  color: #2a1f10;
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 3px 0 #2a1f10;
}

.drummer-thought button:active {
  transform: translateY(3px);
  box-shadow: none;
}

.drummer-thought button:disabled {
  opacity: 0.4;
  cursor: default;
}

.drummer-thought button:focus-visible {
  outline: 2px solid #ff7a1a;
  outline-offset: 2px;
}

.drummer-thought .is-next,
.drummer-thought .is-try,
.drummer-thought .is-another,
.drummer-thought .is-ask {
  background: #ff9a3c;
}

.drummer-thought .is-keep,
.drummer-thought .is-ideakeep {
  background: #8fd18a;
}

.drummer-thought svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#avatar-canvas.is-pressable {
  pointer-events: auto;
  cursor: pointer;
  transition: filter 0.15s ease;
}

/* Under a mouse he lights up: he can be tapped. His own shadow stays under the glow. */
@media (hover: hover) {
  #avatar-canvas.is-pressable:hover {
    filter: drop-shadow(0 0.8vh 1.6vh rgba(0, 0, 0, 0.6))
      drop-shadow(0 0 12px rgba(255, 196, 92, 0.9)) brightness(1.08);
  }
}

#avatar-canvas.is-pressable:active {
  filter: drop-shadow(0 0.8vh 1.6vh rgba(0, 0, 0, 0.6)) brightness(0.92);
}

/* From the logo's head: to its right, on its level, the trail leading back to him */
.drummer-thought.is-from-logo {
  transform: translateY(-50%);
  flex-wrap: wrap;
}

.drummer-thought.is-from-logo::before {
  right: auto;
  left: -17px;
  bottom: calc(50% - 6px);
}

.drummer-thought.is-from-logo::after {
  right: auto;
  left: -29px;
  bottom: calc(50% - 3px);
}

/* Where the cassette sits close by, the keys alone: no take number, and LAST ONE is its arrow */
@media (max-width: 1199px) {
  .drummer-thought.is-from-logo .which {
    display: none;
  }

  .drummer-thought.is-from-logo .is-back,
  .drummer-thought.is-from-logo .is-putback {
    font-size: 0;
    gap: 0;
  }

  .drummer-thought.is-from-logo .words {
    font-size: 12px;
    padding: 0 2px;
  }

  /* An idea on trial: its keys alone */
  .drummer-thought.is-from-logo.is-trying .words {
    display: none;
  }
}

@media (pointer: coarse) {
  .drummer-thought button {
    min-height: 44px;
    padding: 5px 14px;
  }
}

/* A pad the drummer lit is in pencil (ADR-0058): paler, with a dashed rim, until it is kept.
   So are the lit pads of a row whose feel he has on trial (FR-DESK-40) */
.track-row.is-on-trial .step.active::before,
.step.active.is-pencil::before {
  background:
    radial-gradient(ellipse 85% 55% at 50% 6%, rgba(255, 255, 255, 0.4), transparent 72%),
    radial-gradient(circle at 50% 55%, #fff6df 0%, #ffe3a6 40%, #eebf66 74%, #b08433 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -3px 6px rgba(120, 80, 0, 0.4),
    0 2px 0 #7a5a1c,
    0 0 3px rgba(255, 220, 140, 0.7);
}

.track-row.is-on-trial .step.active,
.step.active.is-pencil {
  outline: 1.5px dashed rgba(90, 60, 10, 0.55);
  outline-offset: -5px;
}

/* A note the drummer adds at the turn (ADR-0079, FR-DESK-44): its pad shows a faint dashed rim,
   in his pencil, while that bar plays. It is not a lit pad: a press lights the maker's own there */
.step.is-turn-note:not(.active) {
  outline: 1.5px dashed rgba(120, 78, 16, 0.7);
  outline-offset: -5px;
}

.step.is-turn-note:not(.active)::before {
  box-shadow:
    inset 0 0 12px rgba(255, 190, 90, 0.75),
    0 0 3px rgba(255, 220, 140, 0.5);
}

/* The loop's screen before there is a loop (ADR-0056): asleep, and the way in for one */
.vox-sleep,
.vox-sleep-off {
  display: none;
  position: absolute;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: #10240c;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 600;
  cursor: pointer;
}

.vox-row.is-asleep .vox-sleep {
  display: grid;
  inset: 0;
  font-size: 15px;
  letter-spacing: 0.28em;
}

.vox-row.is-asleep .vox-sleep-off {
  display: grid;
  top: 3px;
  right: 5px;
  width: 24px;
  height: 24px;
  font-size: 17px;
  opacity: 0.55;
}

.vox-row.is-asleep .vox-sleep-off:hover,
.vox-row.is-asleep .vox-sleep-off:focus-visible {
  opacity: 1;
}

.vox-row.is-asleep .vox-lcd {
  filter: saturate(0.35) brightness(0.5);
  transition:
    filter 0.6s ease,
    box-shadow 0.6s ease;
}

/* With records on the desk the screen has two ways in, side by side (ADR-0088) */
.vox-sleep-pick {
  display: none;
  position: absolute;
  place-items: center;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(16, 36, 12, 0.35);
  background: none;
  color: #10240c;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.28em;
  cursor: pointer;
}

.vox-row.is-asleep.has-records .vox-sleep {
  inset: 0 50% 0 0;
}

.vox-row.is-asleep.has-records .vox-sleep-pick {
  display: grid;
  inset: 0 0 0 50%;
}

.vox-row.is-asleep .vox-lcd > :not(.vox-sleep, .vox-sleep-off, .vox-sleep-pick) {
  visibility: hidden;
}

.vox-row.is-asleep .track-name-container {
  visibility: hidden;
}

/* A few bars into the beat it wakes */
.vox-row.is-asleep.is-awake .vox-lcd {
  filter: none;
  box-shadow: 0 0 18px rgba(170, 255, 140, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  .vox-row.is-asleep .vox-lcd {
    transition: none;
  }
}

@media (pointer: coarse) {
  /* Drawn small, pressed large */
  .vox-row.is-asleep .vox-sleep-off::after {
    content: "";
    position: absolute;
    inset: -4px -6px -16px -14px;
  }
}

/* Nothing on the row yet: its keys have nothing to say */
.vox-row.is-empty .vox-softkeys,
.vox-row.is-empty .track-info > *:not(.track-name-container),
.vox-row.is-empty .ms-keys,
.vox-row.is-empty .vox-follow-btn,
.vox-row.is-empty .track-dial-container {
  visibility: hidden;
}

@keyframes vox-loading-sweep {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(400%);
  }
}

@keyframes vox-loading-blink {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes vox-row-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vox-row.is-loading,
  .vox-loading-bar i {
    animation: none;
  }
}

/* A muted lane: the screen's backlight drops */
.vox-row.is-muted .vox-screen {
  opacity: 0.4;
}

/* A row that is not heard: muted, or left out by another row's solo */
.track-row.is-quiet .step,
.track-row.is-quiet .vox-lcd {
  filter: saturate(0.25) brightness(0.62);
}

.track-row.is-quiet .sound-readout {
  opacity: 0.5;
}

/* Sample drop overlay — overrides SampleUploader's TR-909 styling */
.track-row.sample-drop-zone .sample-drop-overlay {
  background: rgba(20, 17, 13, 0.92);
  border: 2px solid #ff7a2b;
  border-radius: 4px;
  backdrop-filter: blur(2px);
}

.track-row.sample-drop-zone .sample-drop-overlay-text {
  font-family: "Bowlby One", sans-serif;
  color: #fef3e2;
  font-size: clamp(11px, 0.85vw, 14px);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.track-row.sample-drop-zone .sample-drop-overlay-track {
  font-family: "JetBrains Mono", monospace;
  color: #ff7a2b;
  font-size: clamp(9px, 0.65vw, 11px);
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-top: 4px;
}

.track-row.sample-drop-zone.drag-over .sample-drop-overlay {
  animation: dropzone-glow 1.2s ease-in-out infinite;
}

@keyframes dropzone-glow {
  0%,
  100% {
    border-color: #ff7a2b;
    box-shadow: 0 0 12px rgba(255, 122, 43, 0.35);
  }
  50% {
    border-color: #ff9d50;
    box-shadow: 0 0 22px rgba(255, 122, 43, 0.55);
  }
}

/* ---- Transport — a rack-style control strip along the desk's front edge ---- */
.transport {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--dock);
  /* Above the desk's lamp falloff (40): the strip is the front edge of the
     desk, and dimmed with the corners its keys read as switched off */
  z-index: 45;
  background:
    var(--tex-plastic),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.022) 0 1px, rgba(0, 0, 0, 0.03) 1px 3px),
    linear-gradient(180deg, #25201b 0%, #191511 40%, #0e0b09 100%);
  padding: 0 calc(3vw + 20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2vw;
  box-shadow:
    inset 0 1px 0 var(--edge-hi),
    inset 0 4px 5px -3px rgba(255, 240, 215, 0.06),
    0 -2px 0 #070504,
    0 -12px 26px rgba(0, 0, 0, 0.6);
}

/* Rack screws at each end (head styling shared with the chassis screws) */
.transport::before,
.transport::after {
  content: "";
  position: absolute;
  top: 50%;
  margin-top: -7px;
}

.transport::before {
  left: 1.2vw;
  --slot: 64deg;
}

.transport::after {
  right: 1.2vw;
  --slot: -12deg;
}

.transport-group {
  display: flex;
  align-items: center;
  gap: 1vw;
}

/* Keycap sitting in a routed pocket: dark seat, lit lower lip, visible
   side wall. Pressing it removes the wall and closes the shadow. */
.transport-btn {
  position: relative;
  font-family: "Bowlby One", sans-serif;
  letter-spacing: 0.2vw;
  font-size: clamp(9px, 0.7vw, 12px);
  padding: 0.85vh 1.1vw;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  background: linear-gradient(180deg, #453c32 0%, #2f2720 55%, #241d17 100%);
  color: #f0e8d8;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 215, 0.2),
    inset 0 -2px 3px rgba(0, 0, 0, 0.5),
    0 3px 0 #120e0b,
    0 3px 0 2px #060504,
    0 4px 0 2px rgba(255, 240, 215, 0.07),
    0 7px 8px rgba(0, 0, 0, 0.5);
  transition:
    transform 0.16s cubic-bezier(0.3, 1.7, 0.5, 1),
    box-shadow 0.16s ease-out,
    filter 0.1s;
}

.transport-btn:hover {
  filter: brightness(1.1);
}

.transport-btn:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.6),
    inset 0 -1px 2px rgba(0, 0, 0, 0.4),
    0 0 0 #120e0b,
    0 0 0 2px #060504,
    0 1px 0 2px rgba(255, 240, 215, 0.07),
    0 1px 2px rgba(0, 0, 0, 0.5);
  transition-duration: 0.04s;
}

/* Play: translucent amber cap over a lamp */
.transport-btn.primary {
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(255, 255, 255, 0.28), transparent 70%),
    linear-gradient(180deg, #f5853b 0%, #d9531b 60%, #b9410d 100%);
  color: #1a0d05;
  text-shadow: 0 1px 0 rgba(255, 200, 150, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 3px rgba(120, 40, 0, 0.6),
    0 3px 0 #6e2707,
    0 3px 0 2px #060504,
    0 4px 0 2px rgba(255, 240, 215, 0.07),
    0 7px 8px rgba(0, 0, 0, 0.5);
}

/* Latched: the cap stays down and the lamp behind it comes on */
.transport-btn.primary.is-playing {
  transform: translateY(2px);
  background:
    radial-gradient(ellipse 70% 90% at 50% 55%, #ffd7a3 0%, #ff9443 45%, transparent 100%),
    linear-gradient(180deg, #f5853b 0%, #d9531b 100%);
  box-shadow:
    inset 0 2px 3px rgba(120, 40, 0, 0.45),
    0 1px 0 #6e2707,
    0 1px 0 2px #060504,
    0 2px 0 2px rgba(255, 240, 215, 0.07),
    0 0 18px 2px rgba(255, 122, 43, 0.5);
}

.reset-samples-btn.has-custom {
  color: #ffb46e;
  text-shadow:
    0 -1px 0 rgba(0, 0, 0, 0.7),
    0 0 8px rgba(255, 122, 43, 0.7);
}

/* SAVE key: unlit with nothing to keep, the brightest thing on the strip
   with unsaved work, settled to a tick and the disk count once saved */
.save-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5vw;
  color: #b9ad95;
}

.save-btn[hidden] {
  display: none;
}

.save-icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

.save-icon-tick,
.save-btn[data-state="saved"] .save-icon-disk {
  display: none;
}

.save-btn[data-state="saved"] .save-icon-tick {
  display: block;
}

.save-btn[data-state="saved"] {
  color: #f0e8d8;
}

.save-count {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78em;
  letter-spacing: 0;
  color: #cdbf9f;
}

.save-btn[data-state="unsaved"],
.save-btn[data-state="saving"],
.save-btn[data-state="full"] {
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(255, 255, 255, 0.28), transparent 70%),
    linear-gradient(180deg, #f5853b 0%, #d9531b 60%, #b9410d 100%);
  color: #1a0d05;
  text-shadow: 0 1px 0 rgba(255, 200, 150, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 3px rgba(120, 40, 0, 0.6),
    0 3px 0 #6e2707,
    0 3px 0 2px #060504,
    0 4px 0 2px rgba(255, 240, 215, 0.07),
    0 7px 8px rgba(0, 0, 0, 0.5);
}

.save-btn[data-state="unsaved"] {
  animation: save-glow 2.4s ease-in-out infinite;
}

.save-btn[data-state="saving"] {
  filter: saturate(0.7) brightness(0.9);
  cursor: progress;
}

.save-btn[data-state="full"] .save-count {
  color: inherit;
}

@keyframes save-glow {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.4),
      inset 0 -2px 3px rgba(120, 40, 0, 0.6),
      0 3px 0 #6e2707,
      0 3px 0 2px #060504,
      0 0 0 3px rgba(255, 122, 43, 0.2),
      0 0 12px rgba(255, 122, 43, 0.4);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.4),
      inset 0 -2px 3px rgba(120, 40, 0, 0.6),
      0 3px 0 #6e2707,
      0 3px 0 2px #060504,
      0 0 0 3px rgba(255, 122, 43, 0.35),
      0 0 22px rgba(255, 122, 43, 0.7);
  }
}

@media (prefers-reduced-motion: reduce) {
  .save-btn[data-state="unsaved"] {
    animation: none;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.4),
      0 3px 0 #6e2707,
      0 3px 0 2px #060504,
      0 0 0 3px rgba(255, 122, 43, 0.35),
      0 0 18px rgba(255, 122, 43, 0.6);
  }
}

/* The one-time strip of tape pointing at SAVE, stuck just above the key */
.transport-group:has(.save-nudge) {
  position: relative;
}

.save-nudge {
  position: absolute;
  /* Clear of the key's own tooltip, which sits just above it on hover */
  bottom: calc(100% + 7.5vh);
  padding: 0.45em 1em 0.55em;
  background: linear-gradient(180deg, #f1e7c9, #e2d4ad);
  clip-path: polygon(0 12%, 2% 0, 98% 6%, 100% 0, 99% 88%, 100% 100%, 2% 94%, 0 100%);
  color: #2a1f10;
  font-family: "Permanent Marker", cursive;
  font-size: clamp(12px, 1vw, 15px);
  line-height: 1.25;
  white-space: nowrap;
  transform: translateX(-50%) rotate(-2deg);
  animation: save-nudge-stick 0.3s cubic-bezier(0.3, 1.5, 0.5, 1);
  pointer-events: none;
}

.save-nudge[hidden] {
  display: none;
}

.save-nudge b {
  color: #a8370a;
  font-weight: 400;
}

@keyframes save-nudge-stick {
  from {
    opacity: 0;
    transform: translateX(-50%) rotate(-7deg) translateY(-10px) scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .save-nudge {
    animation: none;
  }
}

/* ------ Held, not kept: a guest's disks belong to this browser's cookie (HeldSign.js, ADR-0035) ------ */

/* A tick is a promise: a guest's key keeps its disk */
.save-btn[data-state="saved"][data-held] .save-icon-disk {
  display: block;
}

.save-btn[data-state="saved"][data-held] .save-icon-tick {
  display: none;
}

.save-warn {
  display: inline-flex;
  align-items: center;
  margin-left: -0.5vw;
  padding: 0.85vh 0.6vw;
  color: #ffb020;
}

.save-warn[hidden] {
  display: none;
}

.save-warn svg {
  width: 1.5em;
  height: 1.5em;
}

.save-warn[aria-expanded="true"] {
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.7),
    inset 0 0 0 1px rgba(255, 176, 32, 0.4);
}

/* The first time, it is seen to arrive */
.save-warn.is-ringing::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 4px;
  border: 2px solid #ffb020;
  opacity: 0;
  animation: save-warn-ring 1.6s ease-out 0.5s 3;
  pointer-events: none;
}

@keyframes save-warn-ring {
  from {
    opacity: 0.9;
    transform: scale(0.7);
  }
  to {
    opacity: 0;
    transform: scale(1.7);
  }
}

.transport-group:has(.save-warn) {
  position: relative;
}

/* The words, only when asked for */
.save-why {
  position: absolute;
  bottom: calc(100% + 1.6vh);
  z-index: 40;
  width: 21em;
  padding: 1.1em 1.1em 1em;
  border-radius: 3px;
  background: linear-gradient(180deg, #fff3b8, #f3df8a);
  box-shadow: 0 1.2em 2em rgba(0, 0, 0, 0.6);
  color: #2a1810;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(11px, 0.85vw, 14px);
  transform: translateX(-50%) rotate(-1.2deg);
  transform-origin: 50% 100%;
  animation: save-why-stick 0.22s cubic-bezier(0.3, 1.3, 0.5, 1);
}

@keyframes save-why-stick {
  from {
    opacity: 0;
    transform: translateX(-50%) rotate(-1.2deg) translateY(0.8em) scale(0.96);
  }
}

.save-why h3 {
  margin: 0 0 0.6em;
  font-family: "Permanent Marker", cursive;
  font-size: 1.45em;
  font-weight: 400;
  line-height: 1.1;
}

.save-why-ways {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45em;
  margin: 0 0 0.9em;
  padding: 0;
  list-style: none;
}

.save-why-ways li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35em;
  padding: 0.7em 0.2em 0.5em;
  border-radius: 3px;
  background: rgba(42, 24, 16, 0.08);
  font-size: 0.74em;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.save-why-ways svg {
  width: 2.4em;
  height: 2.4em;
  fill: currentColor;
}

.save-why-ways b {
  color: #c0372a;
  font-family: "Permanent Marker", cursive;
  font-size: 1.3em;
  font-weight: 400;
}

.save-why .desk-key {
  width: 100%;
}

/* The way out gets a nudge when the sign first rings */
.desk-key.is-nudged {
  animation: held-nudge 0.5s ease-in-out 2;
}

@keyframes held-nudge {
  25% {
    transform: rotate(-4deg) scale(1.06);
  }
  75% {
    transform: rotate(3deg) scale(1.06);
  }
}

/* In the box they sit loose, labels in pencil, under an amber lamp */
.prop-disks.is-held button.disk-slot {
  rotate: 6deg;
  translate: 0 -0.7em;
}

.prop-disks.is-held button.disk-slot:nth-child(odd) {
  rotate: -5deg;
}

.prop-disks.is-held button.disk-slot .floppy-label {
  color: #8a7f6c;
  outline: 1.5px dashed #8a7f6c;
  outline-offset: -0.3em;
}

.disk-box-lamp {
  position: absolute;
  top: 0.7em;
  left: 0.8em;
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: #ffb020;
  box-shadow: 0 0 0.7em #ffb020;
  animation: held-breathe 2.4s ease-in-out infinite;
}

@keyframes held-breathe {
  50% {
    opacity: 0.35;
  }
}

/* No room for it when its maker signed in: it lies on top of the box until dealt with */
.disk-waiting {
  position: absolute;
  /* Against the box's side, on the bare wood between it and the sampler */
  left: calc(100% + 0.5em + var(--i) * 0.9em);
  top: calc(4.4em - var(--i) * 0.5em);
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
  rotate: 13deg;
  transition: transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.disk-waiting:hover,
.disk-waiting:focus-visible,
.disk-waiting.is-picked {
  transform: translateY(-0.6em);
}

.disk-waiting:focus-visible {
  outline: 2px solid #ff7a2b;
  outline-offset: 2px;
}

.disk-waiting .disk-box-lamp {
  top: -0.3em;
  left: auto;
  right: -0.3em;
}

/* Made theirs: the disks drop into the box */
.prop-disks.is-settling button.disk-slot {
  animation: held-settle 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) backwards;
}

@keyframes held-settle {
  from {
    rotate: 6deg;
    translate: 0 -0.7em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .save-warn.is-ringing::after,
  .save-why,
  .desk-key.is-nudged,
  .disk-box-lamp,
  .prop-disks.is-settling button.disk-slot {
    animation: none;
  }
}

/* MIXER key: latches, and stays lit while the faders are showing */
.mixer-btn[aria-pressed="true"] {
  color: #ffb46e;
  text-shadow:
    0 -1px 0 rgba(0, 0, 0, 0.7),
    0 0 8px rgba(255, 122, 43, 0.7);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.7),
    inset 0 0 0 1px rgba(255, 122, 43, 0.35);
}

/* ---- Mixer: one long fader per row, laid over its pads or chop screen ---- */
.track-steps {
  position: relative;
}

.mix-strip {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: none;
  align-items: center;
  gap: 1vw;
  padding: 0 0.4vw 0 1vw;
  background: linear-gradient(180deg, #17130f 0%, #1f1a15 100%);
  border-radius: 4px;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.85),
    inset 0 0 0 1px rgba(255, 240, 215, 0.05);
}

body.mixer-open .mix-strip {
  display: flex;
}

/* The pads keep their place (so the rows keep their height) but go dark,
   glow and all, while the faders are up */
body.mixer-open .track-steps .step,
body.mixer-open .vox-lcd > :not(.mix-strip) {
  visibility: hidden;
}

/* The slot the cap rides in: a dark groove with a scale printed under it */
.mix-slot {
  --level: 80%;
  position: relative;
  flex: 1;
  align-self: stretch;
  cursor: ew-resize;
  touch-action: none;
  outline: none;
  background:
    linear-gradient(#0a0806, #0a0806) center / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, rgba(240, 232, 216, 0.22) 0 1px, transparent 1px 5%) left
    calc(50% + 11px) / 100% 5px no-repeat;
}

.mix-slot:focus-visible {
  box-shadow: 0 0 0 1px rgba(255, 122, 43, 0.6);
}

/* Lit from the left edge up to the cap, in the row's own colour */
.mix-fill {
  position: absolute;
  top: calc(50% - 2px);
  left: 0;
  width: var(--level);
  height: 4px;
  border-radius: 2px;
  background: var(--track-color, #ff7a2b);
  box-shadow: 0 0 8px var(--track-color, #ff7a2b);
  opacity: 0.9;
}

/* Unity (0 dB): a notch across the groove */
.mix-unity {
  position: absolute;
  top: calc(50% - 9px);
  left: 80%;
  width: 1px;
  height: 18px;
  background: rgba(240, 232, 216, 0.55);
}

.mix-cap {
  position: absolute;
  top: 50%;
  left: var(--level);
  width: clamp(16px, 1.4vw, 24px);
  height: min(70%, 34px);
  transform: translate(-50%, -50%);
  border-radius: 3px;
  background:
    linear-gradient(
      90deg,
      transparent calc(50% - 1px),
      #2a2118 calc(50% - 1px) calc(50% + 1px),
      transparent calc(50% + 1px)
    ),
    linear-gradient(180deg, #e6dcc8 0%, #b9ad96 55%, #8a7e68 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 2px 4px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.mix-value {
  flex: none;
  width: 6em;
  text-align: right;
  white-space: nowrap;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(9px, 0.72vw, 12px);
  letter-spacing: 0.05vw;
  color: #d9cfbb;
}

.tempo-display {
  display: flex;
  align-items: center;
  gap: 0.6vw;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(9px, 0.7vw, 12px);
  letter-spacing: 0.2vw;
  /* silk-screened legend */
  color: rgba(240, 232, 216, 0.5);
  text-transform: uppercase;
}

/* LED readout behind smoked red glass */
.tempo-num {
  font-family: "VT323", monospace;
  font-size: clamp(20px, 1.7vw, 30px);
  background:
    linear-gradient(
      112deg,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(255, 255, 255, 0.03) 30%,
      transparent 30.5%
    ),
    #170b05;
  color: #ff7a2b;
  padding: 0.4vh 1vw;
  border-radius: 3px;
  min-width: 4.2vw;
  text-align: center;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.85),
    0 0 0 2px #060504,
    0 1px 0 2px rgba(255, 240, 215, 0.08);
  text-shadow: 0 0 8px rgba(255, 122, 43, 0.6);
  cursor: ns-resize;
  user-select: none;
  /* Dragged up or down to nudge it (TempoDrag.js): the page stays where it is */
  touch-action: none;
  border: none;
  outline: none;
}

/* TAP: pressed in time to set the tempo, a small key beside the readout */
.tempo-tap {
  padding: 0.7vh 0.8vw;
  border: none;
  border-radius: 4px;
  background: linear-gradient(180deg, #453c32 0%, #2f2720 55%, #241d17 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 215, 0.2),
    inset 0 -2px 3px rgba(0, 0, 0, 0.5),
    0 3px 0 #120e0b,
    0 3px 0 2px #060504;
  color: #f0e8d8;
  font-family: "Bowlby One", sans-serif;
  font-size: clamp(9px, 0.7vw, 12px);
  letter-spacing: 0.2vw;
  text-transform: uppercase;
  touch-action: manipulation;
  cursor: pointer;
}

.tempo-tap:hover {
  filter: brightness(1.1);
}

.tempo-tap:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.6),
    0 0 0 2px #060504;
}

.tempo-num:focus {
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.85),
    0 0 0 2px #060504,
    0 0 0 4px rgba(255, 122, 43, 0.5);
}

/* Mode select — three interlocked push switches in one pocket. The chosen
   one stays latched down with its legend lit; the others stand proud. */
.mode-toggle {
  display: flex;
  align-items: center;
  gap: 3px;
  background: #080605;
  border-radius: 5px;
  padding: 3px 3px 6px;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.8),
    0 1px 0 rgba(255, 240, 215, 0.08);
}

.mode-toggle .lbl,
.mode-toggle .mode-label {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(9px, 0.7vw, 11px);
  letter-spacing: 0.15vw;
  color: rgba(240, 232, 216, 0.45);
  padding: 0.8vh 0.8vw;
  text-transform: uppercase;
  align-self: center;
}

.mode-btn {
  position: relative;
  font-family: "Bowlby One", sans-serif;
  font-size: clamp(10px, 0.78vw, 12px);
  letter-spacing: 0.15vw;
  padding: 1.1vh 1vw 0.7vh;
  background: linear-gradient(180deg, #3b332b 0%, #2a231d 60%, #211b16 100%);
  color: rgba(240, 232, 216, 0.55);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 215, 0.16),
    inset 0 -2px 3px rgba(0, 0, 0, 0.45),
    0 3px 0 #110d0a;
  transition:
    transform 0.16s cubic-bezier(0.3, 1.7, 0.5, 1),
    box-shadow 0.16s ease-out,
    color 0.15s ease;
}

/* Indicator window set into the top of each cap */
.mode-btn::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 50%;
  width: 34%;
  height: 2px;
  margin-left: -17%;
  border-radius: 1px;
  background: #140a05;
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.8);
  transition:
    background 0.12s ease,
    box-shadow 0.12s ease;
}

.mode-btn:hover {
  color: rgba(240, 232, 216, 0.9);
}

.mode-btn:active,
.mode-btn.active {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.6),
    0 0 0 #110d0a;
}

.mode-btn.active {
  background: linear-gradient(180deg, #4a3526 0%, #33241a 100%);
  color: #ffc58a;
  text-shadow:
    0 -1px 0 rgba(0, 0, 0, 0.7),
    0 0 8px rgba(255, 122, 43, 0.75);
}

.mode-btn.active::before {
  background: #ffb46e;
  box-shadow:
    0 0 4px #ff7a2b,
    0 0 9px rgba(255, 122, 43, 0.7);
}

/* NOTE REPEAT — the same interlocked switches as the hi-hat mode select,
   cut smaller to sit on the brand strip */
.note-repeat .lbl {
  font-size: clamp(7px, 0.5vw, 9px);
  line-height: 1.25;
  letter-spacing: 0.1vw;
  padding: 0 0.5vw 0 0.4vw;
}

.note-repeat .mode-btn {
  font-size: clamp(8px, 0.62vw, 10px);
  letter-spacing: 0.08vw;
  padding: 1vh 0.55vw 0.55vh;
}

/* ============================================================
   Humanize potentiometer — mounted on the sampler chassis,
   right of the LCD. Chassis-matched dark metal with a modern
   orange LED progress ring.
   ============================================================ */
.chassis-pot {
  /* CSS variables consumed by Dial.js's SVG so the knob reads as
     chassis-machined hardware rather than TR-909 silver. */
  --dial-bezel: #14110d;
  --dial-bezel-stroke: #0a0805;
  --dial-bezel-inner: #1c1814;
  --dial-bezel-inner-stroke: #0a0805;
  --dial-track-bg: #0a0805;
  --dial-track-inactive: #1c1814;
  --dial-accent: #ff7a2b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* What the pot pours: a beer running over, cut into the metal beside it. The
   cut is dark with a lit lower lip, as the groove under the strip is. */
.chassis-pot {
  position: relative;
  /* Room for the cut, taken from the gaps of the strip */
  margin-left: clamp(14px, 1.5vw, 26px);
}

.chassis-pot::before {
  content: "";
  position: absolute;
  right: calc(100% + clamp(3px, 0.4vw, 8px));
  top: 50%;
  width: clamp(19px, 1.9vw, 30px);
  aspect-ratio: 26 / 28;
  background: rgba(0, 0, 0, 0.62);
  mask:
    url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 26 28%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M6.5 11v13a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V11%22/%3E%3Cpath d=%22M18.5 14h2a2.5 2.5 0 0 1 2.5 2.5v3a2.5 2.5 0 0 1-2.5 2.5h-2%22/%3E%3Cpath d=%22M12.5 16v6M15.5 15v4%22 stroke-width=%221.3%22/%3E%3Cpath fill=%22%23000%22 d=%22M5.6 11a3.1 3.1 0 0 1 .7-6 3.7 3.7 0 0 1 6.6-1.5 3.5 3.5 0 0 1 5.7 1.9A2.9 2.9 0 0 1 19.4 11h-9v4.2a1.6 1.6 0 0 1-3.2 0V11z%22/%3E%3Ccircle cx=%223.2%22 cy=%2217.5%22 r=%221%22 fill=%22%23000%22 stroke=%22none%22/%3E%3Ccircle cx=%224.4%22 cy=%2222.5%22 r=%22.8%22 fill=%22%23000%22 stroke=%22none%22/%3E%3C/svg%3E")
    center / contain no-repeat;
  filter: drop-shadow(0 1px 0 rgba(255, 240, 215, 0.16));
  transform: translateY(-50%) rotate(-9deg);
  pointer-events: none;
}

/* Wrapper: knob only, no vertical stacking — keeps strip horizontally balanced */
.chassis-pot .dial-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  margin: 0;
}

/* Hide the embedded label and value — the LCD's SWING cell already shows the % */
.chassis-pot .dial-label,
.chassis-pot .dial-value {
  display: none;
}

/* Knob sized to match the LCD's vertical extent so the strip reads as one row */
.chassis-pot .dial-container {
  position: relative;
  width: clamp(38px, 3.4vw, 50px);
  height: clamp(38px, 3.4vw, 50px);
  padding: 0;
  margin: 0;
}

.chassis-pot .dial-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* The swing pot turns under a mouse or a finger, as the rows' dials do (ADR-0050) */
.chassis-pot .dial-container {
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: ns-resize;
}

.chassis-pot .dial-container:focus-visible {
  outline: 2px solid #ff7a2b;
  outline-offset: 3px;
  border-radius: 50%;
}

@media (pointer: coarse) {
  .chassis-pot .dial-container::after {
    content: "";
    position: absolute;
    inset: -5px;
  }
}

/* Inset bezel ring so the pot looks bolted INTO the chassis surface */
.chassis-pot .dial-container::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 35%,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(0, 0, 0, 0.3) 60%,
    rgba(0, 0, 0, 0.6) 100%
  );
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.06),
    inset 0 -1px 1px rgba(0, 0, 0, 0.7),
    0 1px 0 rgba(255, 255, 255, 0.04);
  z-index: -1;
}

/* Soft halo behind the active ring — modern LED glow that bleeds into the chassis */
.chassis-pot .dial-glow {
  filter: drop-shadow(0 0 4px rgba(255, 122, 43, 0.55)) drop-shadow(0 0 1px rgba(255, 122, 43, 0.9));
}

/* ---- Vinyl record (SIDE A) ---- */
.vinyl {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  /* Layers, top to bottom: Tamla 45 label (transparent PNG, so the spindle
     hole shows through), the smooth run-out band around it, two silent
     bands between tracks, then the grooves themselves. */
  background:
    url("../public/images/label-tamla-54196.png?v=2") center / 40% 40% no-repeat,
    radial-gradient(circle closest-side, #2e2822 0 50%, #0d0b09 50.5% 52.5%, transparent 53%),
    radial-gradient(
      circle closest-side,
      transparent 0 66%,
      rgba(255, 240, 215, 0.14) 66.4% 67.4%,
      transparent 67.8% 82%,
      rgba(255, 240, 215, 0.11) 82.4% 83.2%,
      transparent 83.6%
    ),
    repeating-radial-gradient(circle at center, #100d0b 0 1px, #2f2923 1px 3px),
    #100d0b;
  box-shadow:
    0 2vh 4vh -1vh rgba(0, 0, 0, 0.8),
    0 1vh 2vh -0.5vh rgba(0, 0, 0, 0.5),
    /* moulded rim catching the lamp */
    inset 0 0 0 1px rgba(255, 240, 215, 0.18),
    inset 0 0 0 4px rgba(0, 0, 0, 0.35);
  transform: rotate(-4deg);
  transition: transform 0.4s ease;
}

/* Lamp reflection in the grooves: two bright wedges pointing at the light.
   It lives on the prop, not the record, so it holds still while the vinyl
   spins underneath. Masked off the label. */
.prop-vinyl::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(
    from 28deg,
    transparent 0deg,
    rgba(255, 240, 215, 0.3) 24deg,
    transparent 50deg,
    transparent 180deg,
    rgba(255, 240, 215, 0.18) 204deg,
    transparent 230deg
  );
  -webkit-mask: radial-gradient(circle closest-side, transparent 52%, #000 54%);
  mask: radial-gradient(circle closest-side, transparent 52%, #000 54%);
}

/* Kraft-paper inner sleeve — pale enough that the black disc reads against it */
.sleeve {
  position: absolute;
  inset: -0.6vh -1vw -1vh -0.8vw;
  background: var(--tex-wood), linear-gradient(135deg, #bfa981 0%, #a8926b 60%, #948058 100%);
  z-index: -1;
  transform: rotate(-2deg);
  box-shadow:
    0 2vh 4vh -1vh rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 245, 220, 0.35),
    inset 0 0 30px rgba(70, 45, 15, 0.35);
}

.prop-vinyl {
  transition: transform 0.3s ease;
}

.prop-vinyl:hover {
  transform: translateY(-3px);
}

.prop-vinyl:hover .vinyl {
  animation: vinyl-spin 3.5s linear infinite;
  transform: rotate(0deg);
}

@keyframes vinyl-spin {
  to {
    transform: rotate(360deg);
  }
}

.prop-vinyl .sticker {
  z-index: 1; /* above the groove reflection */
  transition:
    transform 0.25s ease,
    opacity 0.25s;
}

.prop-vinyl:hover .sticker {
  opacity: 0;
  pointer-events: none;
}

/* ---- Polaroid ---- */
.polaroid {
  background: #f4ecd6;
  padding: 0.7vw 0.7vw 2.2vw 0.7vw;
  box-shadow:
    0 2vh 3vh -1vh rgba(0, 0, 0, 0.6),
    0 0.8vh 1.6vh -0.5vh rgba(0, 0, 0, 0.4);
  transform: rotate(2.5deg);
  position: relative;
  width: 100%;
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s;
}

.polaroid:hover {
  transform: rotate(1deg) translateY(-4px) scale(1.03);
  box-shadow:
    0 3vh 4vh -1vh rgba(0, 0, 0, 0.65),
    0 1.2vh 2vh -0.4vh rgba(0, 0, 0, 0.45);
}

.polaroid-photo {
  width: 100%;
  aspect-ratio: 1.1 / 1;
  background: linear-gradient(135deg, #3a2a1a 0%, #1a1208 100%);
  overflow: hidden;
}

.polaroid-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* faded instant film */
  filter: sepia(0.3) contrast(0.92) saturate(0.85) brightness(1.08);
}

.polaroid-caption {
  position: absolute;
  bottom: 0.4vw;
  left: 0;
  right: 0;
  text-align: center;
  font-family: "Permanent Marker", cursive;
  color: #2a1f10;
  font-size: clamp(10px, 0.75vw, 13px);
}

/* ---- Sticky note ---- */
.sticky {
  background: linear-gradient(180deg, #fde047 0%, #facc15 100%);
  color: #1a1208;
  padding: 1.2vh 1vw;
  font-family: "Permanent Marker", cursive;
  font-size: clamp(11px, 0.85vw, 14px);
  line-height: 1.4;
  width: 100%;
  box-shadow:
    0 1.5vh 2.5vh -0.5vh rgba(0, 0, 0, 0.55),
    0 0.5vh 1vh -0.2vh rgba(0, 0, 0, 0.4);
  transform: rotate(-2deg);
  position: relative;
  transition:
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.25s;
}

.sticky::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 40%;
  height: 12px;
  background: rgba(255, 250, 220, 0.7);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.25);
}

.sticky:hover {
  transform: rotate(-2deg) translateY(-6px) scale(1.04);
  box-shadow:
    0 2.5vh 4vh -0.5vh rgba(0, 0, 0, 0.55),
    0 1vh 1.5vh -0.2vh rgba(0, 0, 0, 0.4);
}

/* ---- Disk box = saved beats ---- */
.floppy {
  position: relative;
  display: block;
  width: 10em;
  height: 10.5em;
  border-radius: 0.4em 1.1em 0.4em 0.4em;
  background: linear-gradient(180deg, #3d4047, #25272c);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0.5em 0.8em -0.25em rgba(0, 0, 0, 0.7);
}

.floppy-shutter {
  position: absolute;
  top: 0;
  left: 26%;
  width: 46%;
  height: 30%;
  background: linear-gradient(180deg, #d9dbde, #a9adb3);
  border-radius: 0 0 2px 2px;
}

.floppy-shutter::after {
  content: "";
  position: absolute;
  top: 14%;
  left: 58%;
  width: 22%;
  height: 66%;
  background: #25272c;
  border-radius: 1px;
}

.floppy-label {
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: 0;
  height: 54%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2em;
  overflow: hidden;
  padding: 0.4em 0.4em 0;
  background: #f4ecd6;
  border-top: 0.55em solid var(--label, #ff7a2b);
  border-radius: 3px 3px 0 0;
  font-family: "Permanent Marker", cursive;
  font-size: 1.1em;
  line-height: 1.15;
  color: #2a1f10;
  text-align: center;
  overflow-wrap: anywhere;
}

.floppy-bpm {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75em;
}

.floppy-title-input {
  width: 100%;
  border: none;
  border-bottom: 1px dashed #2a1f10;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: center;
  outline: none;
}

.floppy-small {
  width: 5.6em;
  height: 5.9em;
}

.floppy-small .floppy-label {
  font-size: 0.78em;
  padding: 0.25em 0.25em 0;
  border-width: 0.5em;
}

/* Standing in the box: shutter down, label up */
.floppy-standing .floppy-shutter {
  top: auto;
  bottom: 0;
  border-radius: 2px 2px 0 0;
}

.floppy-standing .floppy-label {
  top: 0;
  bottom: auto;
  border-top: 0;
  border-bottom: 0.5em solid var(--label, #ff7a2b);
  border-radius: 0 0 3px 3px;
}

.floppy-blank .floppy-label {
  color: #8a7f6c;
}

.disk-stack {
  position: absolute;
  inset: 0;
}

.disk-slot {
  position: absolute;
  left: calc(0.6em + var(--i) * 4.1em);
  top: 0.1em;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  transition: transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.disk-slot:focus-visible {
  outline: 2px solid #ff7a2b;
  outline-offset: 2px;
}

/* Not quite level, as things dropped in a box aren't */
.disk-slot:nth-child(odd) {
  top: 1em;
}

button.disk-slot {
  cursor: pointer;
}

button.disk-slot:hover,
button.disk-slot:focus-visible,
.disk-slot.is-picked {
  transform: translateY(-1.1em);
}

/* The disk the beat on the pads came from */
.disk-slot.is-in-drive::after {
  content: "";
  position: absolute;
  top: -0.9em;
  left: 50%;
  width: 0.55em;
  height: 0.55em;
  margin-left: -0.275em;
  border-radius: 50%;
  background: #ff7a2b;
  box-shadow: 0 0 0.6em rgba(255, 122, 43, 0.9);
}

/* A new disk, still in the air over its place (DiskBox.takeIn) */
.disk-slot.is-arriving {
  visibility: hidden;
}

.disk-box-front {
  position: absolute;
  left: 0;
  right: 0;
  top: 4.6em;
  height: 7.4em;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #d8cfbc, #b9ae97);
  border-radius: 0.6em;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    0 1em 1.5em -0.35em rgba(0, 0, 0, 0.75);
  flex-direction: column;
  gap: 0.35em;
  color: #4a4033;
  /* Clicks fall through to the wood: the disks are what is picked up */
  pointer-events: none;
}

/* Whose box it is: their name in marker, MY BEATS on embossed label tape,
   their face stuck on the corner */
.disk-box-owner {
  max-width: 82%;
  font-family: "Permanent Marker", cursive;
  font-size: 1.15em;
  line-height: 1.1;
  color: #2a1f10;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: rotate(-2deg);
}

.disk-box-label {
  padding: 0.18em 0.7em 0.2em;
  border-radius: 1px;
  background: #c8241a;
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 1em;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}

.disk-box-face {
  position: absolute;
  right: -0.9em;
  top: -1em;
  width: 3.1em;
  height: 3.1em;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 0.16em #fff,
    0 2px 5px rgba(0, 0, 0, 0.55);
  transform: rotate(8deg);
}

.disk-count {
  position: absolute;
  left: 1.2em;
  top: 11.6em;
  padding: 0.35em 0.9em 0.45em;
  background: linear-gradient(180deg, #f1e7c9, #e2d4ad);
  clip-path: polygon(0 12%, 2% 0, 98% 6%, 100% 0, 99% 88%, 100% 100%, 2% 94%, 0 100%);
  color: #2a1f10;
  font-family: "Permanent Marker", cursive;
  font-size: 1.1em;
  line-height: 1.25;
  white-space: nowrap;
  transform: rotate(-2deg);
}

.disk-count b {
  color: #a8370a;
  font-weight: 400;
}

.disk-hand {
  position: absolute;
  /* Held up over the bare wood between the engine notes and the title, clear
     of the pads (ADR-0022) */
  left: calc(100% + 6.5em);
  top: -8em;
  display: flex;
  align-items: flex-start;
  gap: 1em;
  transform: rotate(3deg);
  animation: disk-pick-up 0.22s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.disk-hand .floppy-big {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 1.6em 2em -0.5em rgba(0, 0, 0, 0.8);
}

@keyframes disk-pick-up {
  from {
    opacity: 0;
    transform: rotate(3deg) translate(-1.5em, 1em) scale(0.8);
  }
}

.disk-tabs {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6em;
}

.disk-tab {
  padding: 0.3em 0.8em;
  border: none;
  border-radius: 2px 2px 0 0;
  background: #f1e7c9;
  color: #2a1f10;
  font-family: "Permanent Marker", cursive;
  font-size: 1.15em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s;
}

.disk-tab:hover,
.disk-tab:focus-visible {
  transform: translateX(0.3em);
}

.disk-tab.is-hot {
  background: #ff7a2b;
  color: #1a1208;
}

@media (prefers-reduced-motion: reduce) {
  .disk-hand {
    animation: none;
  }

  .disk-slot,
  .disk-tab {
    transition: none;
  }
}

/* A lit key lying on the wood: "sign in", "send my sign-in link" */
.desk-key {
  padding: 0.75em 1em;
  border: none;
  border-radius: 4px;
  background: linear-gradient(180deg, #3a342d, #231f1a);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 215, 0.18),
    0 2px 0 #0a0806;
  color: #f4ecd6;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

.desk-key.is-hot {
  background: linear-gradient(180deg, #ff9a55, #ff7a2b);
  color: #1a1208;
}

.desk-key:hover,
.desk-key:focus-visible {
  filter: brightness(1.1);
}

.desk-key:active {
  transform: translateY(1px);
}

.desk-key:disabled {
  filter: grayscale(0.6);
  cursor: default;
}

/* === Sending: the note that asks, the stamp on a sent disk, its link and where it can go === */
.send-note {
  position: absolute;
  /* Above the disk in the hand, so what it asks about stays in view */
  top: 2.5vh;
  left: 18vw;
  width: clamp(230px, 21vw, 300px);
  display: flex;
  flex-direction: column;
  gap: 1.1vh;
  font-size: clamp(12px, 1vw, 15px);
  z-index: 14;
  animation: keep-note-stick 0.25s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.send-note:hover {
  transform: rotate(-2deg);
}

/* Asked from the cassette: in the middle of the view, where the eye already is */
.send-note.is-centred,
.send-note.is-centred:hover {
  position: fixed;
  top: 50%;
  left: 50%;
  width: clamp(260px, 24vw, 340px);
  transform: translate(-50%, -50%) rotate(-1.5deg);
  animation: send-note-centre 0.25s cubic-bezier(0.3, 1.5, 0.5, 1);
}

/* Its link, on the strip of tape a sent disk carries, and the ways out as keys */
.send-note-link {
  align-self: flex-start;
  max-width: 100%;
  padding: 0.4em 0.9em 0.5em;
  background: linear-gradient(180deg, #f1e7c9, #e2d4ad);
  clip-path: polygon(0 12%, 2% 0, 98% 6%, 100% 0, 99% 88%, 100% 100%, 2% 94%, 0 100%);
  color: #2a1f10;
  font:
    0.8em "JetBrains Mono",
    monospace;
  overflow-wrap: anywhere;
  user-select: all;
}

.send-note-way {
  text-decoration: none;
}

@keyframes send-note-centre {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) rotate(-1.5deg) scale(0.94);
  }
}

.send-note-list,
.send-note-tick,
.send-note-small {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8em;
  line-height: 1.5;
}

.send-note-list {
  white-space: pre-line;
}

.send-note-tick {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
  cursor: pointer;
}

.send-note-tick input {
  flex: none;
  width: 1.2em;
  height: 1.2em;
  margin: 0.15em 0 0;
  accent-color: #a8370a;
}

.send-note-small {
  font-size: 0.72em;
  color: #5c4a14;
}

.send-note-small a {
  color: #7a2a08;
}

.report-note {
  top: 9vh;
  left: 30vw;
  transform: rotate(1.5deg);
}

.report-note:hover {
  transform: rotate(1.5deg);
}

.report-note-line {
  width: 100%;
  padding: 0.4em 0.5em;
  border: none;
  border-bottom: 2px solid rgba(26, 18, 8, 0.45);
  background: rgba(255, 255, 255, 0.35);
  color: #1a1208;
  font:
    0.85em / 1.4 "JetBrains Mono",
    monospace;
  resize: none;
}

.report-note-line:focus {
  outline: 2px solid #a8370a;
  outline-offset: 1px;
}

/* SENT, stamped across a disk that has a public link */
.disk-stamp {
  position: absolute;
  left: 8%;
  top: 46%;
  padding: 0.05em 0.4em;
  border: 2px solid #a8321e;
  border-radius: 3px;
  background: rgba(244, 236, 214, 0.88);
  color: #a8321e;
  font-family: "Bowlby One", sans-serif;
  font-size: 0.75em;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: rotate(-12deg);
  pointer-events: none;
}

.floppy-big .disk-stamp {
  font-size: 1.3em;
}

.disk-hand {
  flex-wrap: wrap;
  max-width: 30em;
}

.disk-sent {
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7em;
}

.disk-link {
  padding: 0.4em 0.9em 0.5em;
  background: linear-gradient(180deg, #f1e7c9, #e2d4ad);
  clip-path: polygon(0 12%, 2% 0, 98% 6%, 100% 0, 99% 88%, 100% 100%, 2% 94%, 0 100%);
  color: #2a1f10;
  font:
    1em "JetBrains Mono",
    monospace;
  transform: rotate(-1.5deg);
  user-select: all;
}

.disk-ways {
  display: flex;
  gap: 0.6em;
}

.disk-ways .disk-tab {
  text-decoration: none;
}

.disk-ways .disk-tab:hover,
.disk-ways .disk-tab:focus-visible {
  transform: translateY(-0.2em);
}

/* === The listening room: someone else's beat, over the whole desk (ADR-0044) ===
   Drawn on a 1440 by 820 sheet and scaled to the window as one scene: --u is one
   of the sheet's units. The record is the middle of it. */
.room {
  --u: min(100vw / 1440, 100vh / 820);
  position: fixed;
  inset: 0;
  /* Over the desk and its dock; under a toast */
  z-index: 900;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 46% 62% at 54% 50%, transparent 0 55%, rgba(8, 5, 3, 0.72) 100%),
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(255, 200, 130, 0.22), transparent 70%),
    repeating-linear-gradient(
      90deg,
      transparent 0 calc(var(--u) * 178),
      rgba(0, 0, 0, 0.28) calc(var(--u) * 178) calc(var(--u) * 180)
    ),
    linear-gradient(180deg, #5a3a22, #4a2e1a 60%, #3a230f);
  color: #f4ecd6;
  font-family: "JetBrains Mono", monospace;
  font-size: calc(var(--u) * 14);
  animation: room-in 0.3s ease-out both;
}

@keyframes room-in {
  from {
    opacity: 0;
  }
}

/* Where the desk doesn't fit, the tape deck is the listening room */
@media (max-width: 899px), (max-height: 480px) {
  .room {
    display: none;
  }
}

.room-stage {
  position: relative;
  width: calc(var(--u) * 1440);
  height: calc(var(--u) * 820);
}

.room-mark {
  position: absolute;
  left: calc(var(--u) * 44);
  top: calc(var(--u) * 34);
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 12);
  color: #f8e6c8;
  font-family: "Permanent Marker", cursive;
  font-size: calc(var(--u) * 44);
  line-height: 1;
  text-shadow: calc(var(--u) * 2) calc(var(--u) * 3) 0 rgba(0, 0, 0, 0.6);
  transform: rotate(-2deg);
}

.room-mark img {
  width: calc(var(--u) * 58);
  height: calc(var(--u) * 58);
}

.room-mark em {
  color: #ff7a2b;
  font-style: normal;
}

.room-plant {
  position: absolute;
  right: calc(var(--u) * 22);
  top: calc(var(--u) * 10);
  width: calc(var(--u) * 260);
  height: calc(var(--u) * 260);
}

/* The record's sleeve, standing beside the deck */
.room-sleeve {
  position: absolute;
  left: calc(var(--u) * 150);
  top: calc(var(--u) * 250);
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 14);
  width: calc(var(--u) * 330);
  height: calc(var(--u) * 330);
  padding: calc(var(--u) * 26);
  box-sizing: border-box;
  border-radius: calc(var(--u) * 3);
  background: linear-gradient(160deg, #f1e7c9, #d9c99c);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.12),
    inset calc(var(--u) * -8) 0 calc(var(--u) * 14) calc(var(--u) * -8) rgba(0, 0, 0, 0.35),
    0 calc(var(--u) * 22) calc(var(--u) * 30) calc(var(--u) * -10) rgba(0, 0, 0, 0.8);
  color: #2a1f10;
  transform: rotate(-4deg);
}

.room-sleeve h2 {
  margin: 0;
  overflow: hidden;
  font-family: "Permanent Marker", cursive;
  font-size: calc(var(--u) * 54);
  font-weight: 400;
  line-height: 0.98;
  overflow-wrap: anywhere;
  transform: rotate(-2deg);
}

.room-by {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 12);
  font-size: calc(var(--u) * 15);
}

.room-by img {
  width: calc(var(--u) * 44);
  height: calc(var(--u) * 44);
  border-radius: 50%;
  box-shadow:
    0 0 0 calc(var(--u) * 3) #fff,
    0 calc(var(--u) * 2) calc(var(--u) * 5) rgba(0, 0, 0, 0.5);
}

.room-loop,
.room-chain {
  margin: 0;
  color: #5c4a2e;
  font-size: calc(var(--u) * 12);
  line-height: 1.5;
}

.room-chain a,
.room-chain b {
  color: #a8370a;
  font-weight: 700;
}

.room-tags {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--u) * 8);
  margin-top: auto;
}

.room-tags span {
  padding: calc(var(--u) * 5) calc(var(--u) * 9);
  border: calc(var(--u) * 2) solid #2a1f10;
  border-radius: calc(var(--u) * 3);
  font-size: calc(var(--u) * 12);
  font-weight: 700;
  letter-spacing: calc(var(--u) * 2);
}

/* The turntable */
.room-deck {
  position: absolute;
  left: calc(var(--u) * 500);
  top: calc(var(--u) * 172);
  width: calc(var(--u) * 600);
  height: calc(var(--u) * 470);
  border-radius: calc(var(--u) * 14);
  background:
    radial-gradient(ellipse 80% 60% at 40% -10%, rgba(255, 226, 190, 0.12), transparent 70%),
    linear-gradient(180deg, #2b2621, #1e1a16 40%, #141110);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 215, 0.18),
    inset 0 calc(var(--u) * -2) calc(var(--u) * 3) rgba(0, 0, 0, 0.7),
    0 calc(var(--u) * 8) 0 #0a0806,
    0 calc(var(--u) * 30) calc(var(--u) * 40) calc(var(--u) * -10) rgba(0, 0, 0, 0.85);
}

.room-platter {
  position: absolute;
  left: calc(var(--u) * 34);
  top: calc(var(--u) * 34);
  width: calc(var(--u) * 402);
  height: calc(var(--u) * 402);
  border-radius: 50%;
  background: radial-gradient(circle, #3a352f 0 62%, #55504a 62.5% 64%, #2a2622 64.5% 100%);
  box-shadow:
    inset 0 0 0 calc(var(--u) * 2) rgba(255, 240, 215, 0.1),
    0 calc(var(--u) * 6) calc(var(--u) * 14) rgba(0, 0, 0, 0.6);
}

.room-record {
  position: absolute;
  inset: calc(var(--u) * 11);
  border-radius: 50%;
  background:
    conic-gradient(
      from 20deg,
      transparent 0 8%,
      rgba(255, 255, 255, 0.13) 12%,
      transparent 17% 50%,
      rgba(255, 255, 255, 0.09) 56%,
      transparent 62%
    ),
    repeating-radial-gradient(
      circle,
      #0c0b0a 0 max(2px, calc(var(--u) * 2)),
      #1b1917 max(2px, calc(var(--u) * 2)) max(3.5px, calc(var(--u) * 3.5))
    );
  box-shadow: 0 calc(var(--u) * 2) calc(var(--u) * 6) rgba(0, 0, 0, 0.7);
}

/* It turns only while it is heard */
.room.is-sounding .room-record {
  animation: room-spin 1.8s linear infinite;
}

@keyframes room-spin {
  to {
    transform: rotate(360deg);
  }
}

.room-label {
  position: absolute;
  inset: calc(var(--u) * 115);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--u) * 20) calc(var(--u) * 12) calc(var(--u) * 32);
  box-sizing: border-box;
  border-radius: 50%;
  background:
    radial-gradient(circle, #1a1208 0 4%, transparent 4.5%),
    linear-gradient(180deg, #ff9a55, #e2641c);
  color: #1a1208;
  text-align: center;
}

/* A long title takes two lines over the spindle; the credit sits under it, where the label is wide */
.room-label b {
  display: -webkit-box;
  max-width: 100%;
  max-height: calc(var(--u) * 40);
  overflow: hidden;
  font-family: "Permanent Marker", cursive;
  font-size: calc(var(--u) * 18);
  font-weight: 400;
  line-height: 1.05;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.room-label span {
  max-width: 100%;
  overflow: hidden;
  font-size: calc(var(--u) * 8);
  font-weight: 700;
  letter-spacing: calc(var(--u) * 0.5);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-arm-base {
  position: absolute;
  right: calc(var(--u) * 44);
  top: calc(var(--u) * 40);
  width: calc(var(--u) * 74);
  height: calc(var(--u) * 74);
  border-radius: 50%;
  background: radial-gradient(circle, #d8cfbc 0 26%, #6d665b 28% 44%, #2a2622 46%);
  box-shadow: 0 calc(var(--u) * 4) calc(var(--u) * 8) rgba(0, 0, 0, 0.6);
}

.room-arm {
  position: absolute;
  right: calc(var(--u) * 74);
  top: calc(var(--u) * 74);
  width: calc(var(--u) * 14);
  height: calc(var(--u) * 290);
  border-radius: calc(var(--u) * 7);
  background: linear-gradient(90deg, #8d867a, #e6dfd0 45%, #8d867a);
  box-shadow: calc(var(--u) * 3) calc(var(--u) * 6) calc(var(--u) * 8) rgba(0, 0, 0, 0.5);
  transform: rotate(-4deg);
  transform-origin: 50% 0;
  transition: transform 0.5s ease-in-out;
}

.room-arm::after {
  content: "";
  position: absolute;
  left: calc(var(--u) * -9);
  bottom: calc(var(--u) * -8);
  width: calc(var(--u) * 32);
  height: calc(var(--u) * 52);
  border-radius: calc(var(--u) * 4);
  background: linear-gradient(180deg, #3a342d, #151210);
  box-shadow: 0 calc(var(--u) * 3) calc(var(--u) * 5) rgba(0, 0, 0, 0.6);
}

/* On the record while it plays */
.room.is-sounding .room-arm {
  transform: rotate(24deg);
}

.room-lamp {
  position: absolute;
  right: calc(var(--u) * 77);
  bottom: calc(var(--u) * 124);
  width: calc(var(--u) * 9);
  height: calc(var(--u) * 9);
  border-radius: 50%;
  background: #4a2a14;
}

.room.is-sounding .room-lamp {
  background: #ff7a2b;
  box-shadow: 0 0 calc(var(--u) * 10) #ff7a2b;
}

.room-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: calc(var(--u) * 16) calc(var(--u) * 26);
  border: none;
  border-radius: calc(var(--u) * 5);
  background: linear-gradient(180deg, #3a342d, #231f1a);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 215, 0.18),
    0 calc(var(--u) * 3) 0 #0a0806;
  color: #f4ecd6;
  font-family: "JetBrains Mono", monospace;
  font-size: calc(var(--u) * 16);
  font-weight: 700;
  letter-spacing: calc(var(--u) * 2);
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

.room-key.is-hot {
  background: linear-gradient(180deg, #ff9a55, #ff7a2b);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 calc(var(--u) * 4) 0 #6b2c08,
    0 0 calc(var(--u) * 26) rgba(255, 122, 43, 0.35);
  color: #1a1208;
}

.room-key:focus-visible,
.room-quiet:focus-visible,
.room-flips a:focus-visible {
  outline: 2px solid #f4ecd6;
  outline-offset: 3px;
}

.room-key:disabled {
  opacity: 0.6;
  cursor: default;
}

.room-play {
  position: absolute;
  right: calc(var(--u) * 28);
  bottom: calc(var(--u) * 28);
  padding: calc(var(--u) * 20) calc(var(--u) * 30);
  border-radius: calc(var(--u) * 7);
  font-size: calc(var(--u) * 20);
  letter-spacing: calc(var(--u) * 4);
}

/* The beat is on its way */
.room-play.is-readying {
  font-size: calc(var(--u) * 13);
  letter-spacing: calc(var(--u) * 2);
  animation: room-readying 1.6s ease-in-out infinite;
}

@keyframes room-readying {
  50% {
    color: rgba(26, 18, 8, 0.45);
  }
}

/* The way to the desk, and what has been made from this beat */
.room-side {
  position: absolute;
  left: calc(var(--u) * 1150);
  top: calc(var(--u) * 300);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: calc(var(--u) * 18);
  width: calc(var(--u) * 250);
}

.room-flip-line {
  margin: 0;
  padding: calc(var(--u) * 8) calc(var(--u) * 18) calc(var(--u) * 9);
  background: linear-gradient(180deg, #f1e7c9, #e2d4ad);
  clip-path: polygon(0 12%, 2% 0, 98% 6%, 100% 0, 99% 88%, 100% 100%, 2% 94%, 0 100%);
  color: #5c4a2e;
  font-family: "Permanent Marker", cursive;
  font-size: calc(var(--u) * 14);
  line-height: 1.25;
  transform: rotate(-2deg);
}

/* A quiet list, the count its only heading */
.room-flips {
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 12);
  max-height: calc(var(--u) * 250);
  margin-top: calc(var(--u) * 30);
  padding-left: calc(var(--u) * 4);
  overflow-y: auto;
}

.room-flips h3 {
  margin: 0;
  color: #b8a988;
  font-size: calc(var(--u) * 11);
  font-weight: 700;
  letter-spacing: calc(var(--u) * 3);
  text-transform: uppercase;
}

.room-flips a {
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 3);
  text-decoration: none;
}

.room-flips a b {
  color: #f4ecd6;
  font-family: "Permanent Marker", cursive;
  font-size: calc(var(--u) * 16);
  font-weight: 400;
}

.room-flips a span {
  color: #b8a988;
  font-size: calc(var(--u) * 11);
}

/* What listeners have put on the sleeve (ADR-0046): along its top edge, stuck by hand */
.room-stuck {
  position: absolute;
  left: calc(var(--u) * 56);
  top: calc(var(--u) * 168);
  z-index: 1;
  display: flex;
  align-items: flex-start;
}

.room-stuck .stk {
  --k: calc(var(--u) * 0.72);
  /* The one before lies over the next, so every count shows */
  z-index: 3;
  transform: rotate(-5deg);
  animation: stk-on 0.22s ease-out both;
}

.room-stuck .stk + .stk {
  z-index: 2;
  margin-left: calc(var(--u) * -4);
  margin-top: calc(var(--u) * -16);
  transform: rotate(4deg);
}

.room-stuck .stk + .stk + .stk {
  z-index: 1;
  margin-top: calc(var(--u) * 6);
  transform: rotate(-3deg);
}

@keyframes stk-on {
  from {
    opacity: 0;
    scale: 1.25;
  }
}

/* The backing sheet they peel from, under the turntable once the record has played */
.room-sheet {
  position: absolute;
  left: calc(var(--u) * 800);
  top: calc(var(--u) * 672);
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 14);
  padding: calc(var(--u) * 14) calc(var(--u) * 16);
  border-radius: calc(var(--u) * 4);
  background: linear-gradient(180deg, #e6e1d3, #cfc8b6);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 calc(var(--u) * 14) calc(var(--u) * 20) calc(var(--u) * -8) rgba(0, 0, 0, 0.8);
  transform: translateX(-50%) rotate(-1deg);
  animation: room-sheet-in 0.35s ease-out both;
}

.room-sheet .stk,
.room-sheet .stk-gone {
  --k: calc(var(--u) * 0.9);
}

@keyframes room-sheet-in {
  from {
    opacity: 0;
    translate: 0 calc(var(--u) * 40);
  }
}

/* A strip of tape beside the sheet: where a stickered beat is kept */
.room-kept {
  position: absolute;
  left: calc(var(--u) * 1168);
  top: calc(var(--u) * 664);
  margin: 0;
  padding: calc(var(--u) * 8) calc(var(--u) * 18) calc(var(--u) * 9);
  background: linear-gradient(180deg, #f1e7c9, #e2d4ad);
  clip-path: polygon(0 12%, 2% 0, 98% 6%, 100% 0, 99% 88%, 100% 100%, 2% 94%, 0 100%);
  color: #5c4a2e;
  font-family: "Permanent Marker", cursive;
  font-size: calc(var(--u) * 14);
  line-height: 1.25;
  width: calc(var(--u) * 172);
  transform: rotate(-2deg);
}

.room-quiet {
  position: absolute;
  bottom: calc(var(--u) * 30);
  padding: 0;
  border: none;
  background: none;
  color: #d9ccae;
  font:
    calc(var(--u) * 12) "JetBrains Mono",
    monospace;
  text-decoration: underline;
  cursor: pointer;
}

.room-blank {
  left: calc(var(--u) * 44);
}

.room-report {
  right: calc(var(--u) * 44);
}

.room-quiet:hover {
  color: #f4ecd6;
}

@media (prefers-reduced-motion: reduce) {
  .room,
  .room.is-sounding .room-record,
  .room-play.is-readying,
  .room-stuck .stk,
  .room-sheet {
    animation: none;
  }

  .room-arm {
    transition: none;
  }
}

/* === Where the beat on the desk came from: whose it is, its chain and its flips, on tape === */
.beat-tag {
  position: absolute;
  /* Taped to the sampler's top lip, at the end away from the wordmark: it belongs to the
     machine playing it */
  right: 1.4vw;
  bottom: calc(100% - 0.9em);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5em;
  font-size: clamp(9px, 0.8vw, 13px);
  z-index: 12;
  animation: keep-note-stick 0.3s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.beat-tag-row {
  display: flex;
  align-items: flex-end;
  gap: 0.8em;
}

/* The flips hang under their count, one strip each */
.beat-tag-stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4em;
}

.beat-tag-chain,
.beat-tag-flips,
.beat-tag-made {
  font-size: 0.95em;
  transform: rotate(1deg);
}

.beat-tag-small,
.beat-tag-then {
  opacity: 0.65;
}

.beat-tag-name,
.beat-tag-made {
  color: #a8370a;
}

.beat-tag-chain {
  gap: 0.35em;
}

.beat-tag-flips {
  border: none;
  cursor: pointer;
}

.beat-tag-list {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
}

.beat-tag-list[hidden] {
  display: none;
}

.beat-tag-made {
  text-decoration: none;
}

.beat-tag-made b {
  text-decoration: underline;
}

.floppy-from {
  display: block;
  font-size: 0.62em;
  line-height: 1.2;
  opacity: 0.75;
}

/* ------ The disk file: beats from other desks, under lock and a smoked lid (Crate.js) ------ */
.crate-pull {
  position: absolute;
  inset: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
}

.crate-pull:focus-visible {
  outline: 2px solid #ff7a2b;
  outline-offset: 3px;
}

/* The lid: smoked plastic, so the disks filed under it show through */
.crate-lid {
  position: absolute;
  left: 0.25em;
  right: 0.25em;
  top: 0;
  height: 4.5em;
  border-radius: 0.55em 0.55em 0 0;
  border: 1px solid rgba(255, 240, 215, 0.3);
  border-bottom: none;
  background: /* the window's glare, across one corner */
      linear-gradient(
        112deg,
        rgba(255, 255, 255, 0.3) 0 9%,
        transparent 9.5% 16%,
        rgba(255, 255, 255, 0.12) 16.5% 20%,
        transparent 20.5%
      ),
      linear-gradient(180deg, rgba(92, 70, 50, 0.5), rgba(34, 24, 16, 0.74));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.25),
    inset 0 -0.5em 0.6em -0.3em rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transform-origin: 50% 0;
  transition: transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.crate-pull:hover .crate-lid,
.crate-pull:focus-visible .crate-lid {
  transform: perspective(20em) rotateX(14deg) translateY(-0.25em);
}

.crate-disks {
  position: absolute;
  left: 0.9em;
  right: 0.9em;
  bottom: 0;
  height: 3.9em;
  display: flex;
  align-items: flex-end;
  gap: 0.3em;
  /* Behind the smoke */
  z-index: -1;
  opacity: 0.85;
}

/* A disk standing in the file: only its top edge and label colour show */
.crate-disk {
  flex: 1;
  height: calc(2.7em + var(--h, 0) * 0.26em);
  border-top: 0.45em solid var(--label, #ff7a2b);
  border-radius: 0.2em 0.45em 0 0;
  background: linear-gradient(180deg, #3d4047, #25272c);
}

/* The base: putty-coloured plastic, a rib along its hinge line */
.crate-front {
  position: absolute;
  left: 0;
  right: 0;
  top: 4.4em;
  height: 5em;
  border-radius: 0.3em 0.3em 0.6em 0.6em;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.28) 0 0.12em,
      rgba(255, 255, 255, 0.5) 0.12em 0.24em,
      transparent 0.24em
    ),
    var(--tex-plastic), linear-gradient(180deg, #d8cfbc, #bdb29b 62%, #9d927b);
  box-shadow:
    inset 0 -3px 4px rgba(0, 0, 0, 0.28),
    inset 2px 0 2px -1px rgba(255, 255, 255, 0.4),
    0 1em 1.5em -0.4em rgba(0, 0, 0, 0.75);
}

/* The lock, with its key in it */
.crate-lock {
  position: absolute;
  left: calc(50% - 0.85em);
  top: 1.3em;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #f4f4f2, #a3a5a8 55%, #55575a);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.6),
    inset 0 0 0 0.16em rgba(0, 0, 0, 0.18);
}

.crate-key {
  position: absolute;
  left: calc(50% - 0.13em);
  top: 1.5em;
  width: 0.26em;
  height: 1.3em;
  border-radius: 0.1em;
  background: linear-gradient(90deg, #e2c266, #a8842c);
  transform-origin: 50% 50%;
  transition: transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1);
}

/* Its bow, turned to the front */
.crate-key::after {
  content: "";
  position: absolute;
  left: -0.42em;
  top: 0.9em;
  width: 1.1em;
  height: 1.1em;
  border-radius: 50%;
  border: 0.24em solid #c9a441;
  box-sizing: border-box;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.45);
}

.crate-pull:hover .crate-key,
.crate-pull:focus-visible .crate-key {
  transform: rotate(-40deg);
}

.crate-tape {
  position: absolute;
  left: 0.5em;
  top: 8.3em;
  padding: 0.3em 0.8em 0.4em;
  background: linear-gradient(180deg, #f1e7c9, #e2d4ad);
  clip-path: polygon(0 12%, 2% 0, 98% 6%, 100% 0, 99% 88%, 100% 100%, 2% 94%, 0 100%);
  color: #2a1f10;
  font-family: "Permanent Marker", cursive;
  font-size: 1.05em;
  line-height: 1.25;
  white-space: nowrap;
  transform: rotate(-3deg);
  pointer-events: none;
}

/* How many are inside, on embossed label tape */
.crate-count {
  position: absolute;
  right: 0.5em;
  top: 5.1em;
  padding: 0.12em 0.5em;
  border-radius: 1px;
  background: #1c1a18;
  color: #f4ecd6;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* ---- The crate open over the whole desk (ADR-0031) ----
   One scale: 2.6 for its name, 1.15 for a beat's, .86 for keys and credits.
   One gap between its parts: 1.6. */
.crate-open {
  position: fixed;
  inset: 0;
  /* Over the desk and its dock; under a toast */
  z-index: 900;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  row-gap: 1.6em;
  padding: 2.2em 2.8em 1.8em;
  box-sizing: border-box;
  background: rgba(12, 7, 3, 0.95);
  color: #f4ecd6;
  /* Everything inside is sized in em, so the crate scales as one object */
  font-size: clamp(8px, min(1vw, 1.6vh), 16px);
  font-family: "JetBrains Mono", monospace;
  animation: crate-rise 0.22s ease-out both;
}

@keyframes crate-rise {
  from {
    opacity: 0;
  }
}

.crate-open button {
  font-family: inherit;
  cursor: pointer;
}

.crate-open button:focus-visible {
  outline: 2px solid #f4ecd6;
  outline-offset: 2px;
}

.dig-top {
  display: flex;
  align-items: center;
  gap: 1.6em;
}

.dig-name {
  margin: 0;
  font:
    400 2.6em / 1 "Permanent Marker",
    cursive;
  color: #f8e6c8;
}

.dig-name em {
  font-style: normal;
  color: #ff7a2b;
}

.dig-left {
  flex: 1;
  font-size: 0.9em;
  color: #cdbf9f;
}

.dig-shut,
.dig-turn {
  min-width: 2.8em;
  padding: 0.8em 1em;
  border: 1px solid #5a4630;
  border-radius: 0.3em;
  background: #1a120b;
  color: #f4ecd6;
  font-size: 0.86em;
  font-weight: 700;
}

.dig-keys {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8em 2em;
  padding-bottom: 1.4em;
  border-bottom: 1px solid #3a2c1d;
}

.dig-seg {
  display: flex;
}

.dig-key {
  margin-left: -1px;
  padding: 0.72em 0.95em;
  border: 1px solid #5a4630;
  background: none;
  color: #f4ecd6;
  font-size: 0.86em;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.dig-key:first-child {
  margin-left: 0;
  border-radius: 0.3em 0 0 0.3em;
}

.dig-key:last-child {
  border-radius: 0 0.3em 0.3em 0;
}

.dig-key:hover {
  background: #2a1d12;
}

.dig-key[aria-pressed="true"] {
  position: relative;
  border-color: #f4ecd6;
  background: #f4ecd6;
  color: #2a1810;
}

.dig-clear {
  margin-left: auto;
  padding: 0.72em 0;
  border: 0;
  background: none;
  color: #cdbf9f;
  font-size: 0.86em;
  text-decoration: underline;
}

.dig-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 27em;
  column-gap: 2.8em;
  min-height: 0;
}

.dig-sleeves {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5em 1.6em;
  align-content: start;
}

.dig-sleeve {
  display: flex;
  flex-direction: column;
  gap: 0.55em;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #f4ecd6;
  text-align: left;
}

/* What most of its listeners say it has got, stuck on the sleeve's corner (ADR-0046) */
.dig-sleeve {
  position: relative;
}

.dig-stack {
  position: absolute;
  top: -0.9em;
  right: -0.7em;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

.dig-stack .stk {
  --k: 0.037em;
  font-size: 1em;
  transform: rotate(5deg);
}

/* Each lies over the one before, lower and a little across, so every count shows */
.dig-stack .stk + .stk {
  margin-top: calc(var(--k) * -50);
  margin-right: 1.5em;
  transform: rotate(-4deg);
}

.dig-stack .stk + .stk + .stk {
  margin-right: 0.3em;
  transform: rotate(3deg);
}

.dig-stack .stk i,
.dig-stickers .stk i {
  min-width: 1.9em;
  height: 1.9em;
  padding: 0 0.4em;
  border-radius: 1em;
  font-size: 0.72em;
}

/* The pulled sleeve's stickers: pressed to put on, pressed again to take back */
.dig-stickers {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* A little over the sleeve's edges, as things stuck on by hand are */
  margin: 0 -1.1em;
  padding: 0.5em 0 0.1em;
}

.dig-stickers:empty {
  display: none;
}

.dig-stickers .stk {
  --k: 0.0385em;
  font-size: 1em;
}

.dig-stickers .stk:nth-child(odd) {
  rotate: -2deg;
}

.dig-stickers .stk:nth-child(even) {
  rotate: 2deg;
}

/* A strip of tape by the crate's name: the records this person stickered */
.dig-pile {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  padding: 0.45em 1em 0.55em;
  border: 0;
  background: linear-gradient(180deg, #f1e7c9, #e2d4ad);
  clip-path: polygon(0 12%, 2% 0, 98% 6%, 100% 0, 99% 88%, 100% 100%, 2% 94%, 0 100%);
  color: #2a1f10;
  transform: rotate(2deg);
}

.dig-pile b {
  font:
    400 1.25em / 1.2 "Permanent Marker",
    cursive;
}

.dig-pile small {
  font-size: 0.8em;
  color: #5c4a2e;
}

.dig-pile[aria-pressed="true"] {
  background: linear-gradient(180deg, #ff9a52, #ff7a2b);
}

.dig-pile[aria-pressed="true"] small {
  color: #2a1f10;
}

/* The sleeve's colour is the beat's feel */
.dig-art {
  --sleeve: #6b5a3e;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 0.16em;
  align-content: center;
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 16 / 14.6;
  padding: 0 1.3em;
  border-radius: 0.3em;
  background: linear-gradient(150deg, var(--sleeve), #1a120b 140%);
  box-shadow:
    0 0.7em 1.3em rgba(0, 0, 0, 0.55),
    inset 0 0 2em rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}

.dig-sleeve[data-feel="friction"] .dig-art {
  --sleeve: #b5482a;
}

.dig-sleeve[data-feel="limp"] .dig-art {
  --sleeve: #3f6f6a;
}

.dig-sleeve[data-feel="live"] .dig-art {
  --sleeve: #8a6a1f;
}

.dig-art i {
  aspect-ratio: 1;
  border-radius: 0.08em;
  background: rgba(0, 0, 0, 0.22);
}

.dig-art i.is-on {
  background: #fff6e0;
}

.dig-sleeve:hover .dig-art {
  transform: translateY(-0.3em);
}

.dig-sleeve.is-picked .dig-art {
  outline: 0.24em solid #ff7a2b;
  outline-offset: 0.26em;
}

.dig-sleeve:focus-visible {
  outline: none;
}

.dig-sleeve:focus-visible .dig-art {
  outline: 0.24em solid #f4ecd6;
  outline-offset: 0.26em;
}

.dig-title {
  overflow: hidden;
  font:
    400 1.15em / 1.15 "Permanent Marker",
    cursive;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dig-credit {
  overflow: hidden;
  font-size: 0.8em;
  color: #cdbf9f;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dig-none {
  grid-column: 1 / -1;
  margin: 0;
  padding: 4em 0;
  font:
    400 1.4em / 1.3 "Permanent Marker",
    cursive;
  color: #cdbf9f;
}

.dig-pulled {
  display: flex;
  flex-direction: column;
  gap: 1.2em;
  align-self: start;
  min-width: 0;
  padding: 1.8em;
  border-radius: 0.5em;
  background: linear-gradient(180deg, #f1e6c6, #dccfa6);
  color: #2a1810;
  box-shadow: 0 1.2em 2.4em rgba(0, 0, 0, 0.6);
}

.dig-pulled-title {
  margin: 0;
  font:
    400 2.2em / 1.05 "Permanent Marker",
    cursive;
  overflow-wrap: anywhere;
}

.dig-who {
  display: flex;
  align-items: center;
  gap: 0.7em;
  margin-top: -0.5em;
}

.dig-face {
  width: 2.2em;
  height: 2.2em;
  border-radius: 50%;
}

.dig-by {
  overflow: hidden;
  font-size: 0.9em;
  color: #5c4c33;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dig-by b {
  color: #2a1810;
}

.dig-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}

.dig-tags span {
  padding: 0.42em 0.6em;
  border: 1px solid #2a1810;
  border-radius: 0.2em;
  font-size: 0.76em;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.dig-grid {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 0.22em;
  padding: 0.9em;
  border-radius: 0.35em;
  background: #171514;
}

.dig-grid i {
  aspect-ratio: 1;
  border-radius: 0.12em;
  background: #4a4640;
}

.dig-grid i.is-on {
  background: #ff7a2b;
  box-shadow: 0 0 0.5em rgba(255, 122, 43, 0.7);
}

.dig-acts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6em;
}

.dig-act {
  padding: 1.05em 0.4em;
  border: 1px solid #2a1810;
  border-radius: 0.3em;
  background: none;
  color: #2a1810;
  font-size: 0.86em;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.dig-act.is-hot {
  grid-column: 1 / -1;
  padding: 1.25em;
  border-color: #ff7a2b;
  background: #ff7a2b;
  font-size: 1em;
  letter-spacing: 0.12em;
}

/* On its way: the key is down and its words breathe, slowly */
.dig-act.is-readying {
  background: #e06a22;
  animation: dig-readying 1.6s ease-in-out infinite;
}

@keyframes dig-readying {
  50% {
    color: rgba(42, 24, 16, 0.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dig-act.is-readying {
    animation: none;
  }
}

.crate-open .dig-act:focus-visible {
  outline-color: #2a1810;
}

.dig-pager {
  display: flex;
  align-items: center;
  gap: 1em;
  font-size: 0.86em;
  color: #cdbf9f;
}

.dig-turn {
  font-size: 1em;
}

.dig-turn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* A narrow window: the pulled sleeve goes under the rest, and the page scrolls */
@media (max-width: 899px) {
  .crate-open {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    font-size: 12px;
  }

  .dig-body {
    display: flex;
    flex-direction: column-reverse;
    gap: 1.6em;
  }

  .dig-sleeves {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dig-pulled {
    align-self: stretch;
  }
}

/* A longer stamp than "sent", on the same label */
.disk-stamp.is-crate {
  left: 4%;
  font-size: 0.52em;
  white-space: nowrap;
}

/* The second box on the send note: a separate thing to agree to */
.send-note-crate {
  padding-top: 0.7em;
  border-top: 1px dashed rgba(26, 18, 8, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  .crate-open {
    animation: none;
  }

  .crate-lid,
  .crate-key,
  .dig-art {
    transition: none;
  }
}

.beat-tag[hidden] {
  display: none;
}

.beat-tag-tape {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.4em 1.1em 0.5em 0.6em;
  background: linear-gradient(180deg, #f1e7c9, #e2d4ad);
  clip-path: polygon(0 10%, 1.5% 0, 98.5% 5%, 100% 0, 99.5% 90%, 100% 100%, 1.5% 95%, 0 100%);
  color: #2a1f10;
  font-family: "Permanent Marker", cursive;
  font-size: 1.15em;
  white-space: nowrap;
  transform: rotate(-3deg);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45);
}

.beat-tag-tape b,
.beat-tag-own {
  color: #a8370a;
  font-weight: 400;
}

@media (prefers-reduced-motion: reduce) {
  .send-note,
  .beat-tag {
    animation: none;
  }
}

/* Signing out: the sampler is switched off and on again (PowerCycle.js).
   Off, nothing on it glows: the pads, the display, the LED by its name,
   the lit keys on its strip, and the tempo and PLAY on the transport. */
body.powered-on .track-row.is-dark .step::before,
body.powered-on .track-row.is-dark .step::after {
  opacity: 0;
  transition-duration: 0.12s;
}

body.is-off .lcd {
  background: linear-gradient(180deg, #1a1f12 0%, #0e120a 100%);
  text-shadow: none;
}

body.is-off .lcd > * {
  visibility: hidden;
}

body.is-off .brand-mark .dot {
  animation: none;
  background: radial-gradient(circle at 35% 30%, #3a2a1a 0%, #1a0d05 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 220, 180, 0.08),
    inset 0 -1px 1px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.6);
}

.note-repeat,
.chassis-pot,
.tempo-display,
.transport .mode-toggle,
#save-btn,
#play-btn {
  transition: filter 0.12s ease-out;
}

body.is-off .note-repeat,
body.is-off .chassis-pot,
body.is-off .tempo-display,
body.is-off .transport .mode-toggle,
body.is-off #save-btn,
body.is-off #play-btn {
  filter: brightness(0.38) saturate(0.2);
}

/* Waking: the boot words are back on the display, over everything else it shows */
.lcd.is-rebooting {
  animation: lcd-wake 0.45s ease-out;
}

body.powered-on .lcd.is-rebooting .lcd-boot {
  opacity: 1;
  transition: none;
}

body.powered-on .lcd.is-rebooting .lcd-cell,
body.powered-on .lcd.is-rebooting .lcd-msg {
  opacity: 0;
  transition: none;
}

/* === The sheet that deals with email: sign in === */
.account-veil {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 6, 2, 0.62);
}

.account-sheet {
  display: flex;
  flex-direction: column;
  gap: 1em;
  width: 24em;
  max-width: 92vw;
  padding: 1.5em 1.6em 1.3em;
  border-radius: 0.5em;
  background: #fbfaf6;
  box-shadow: 0 1.6em 2.4em -0.6em rgba(0, 0, 0, 0.7);
  color: #2a1f10;
  font-size: clamp(13px, 1.05vw, 16px);
  transform: rotate(-1.2deg);
  animation: keep-note-stick 0.25s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.account-title {
  color: #a8370a;
  font-family: "Permanent Marker", cursive;
  font-size: 1.6em;
  line-height: 1;
}

.account-field {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
}

.account-label {
  color: #a8370a;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.account-input {
  min-width: 0;
  padding: 0.55em 0.65em;
  border: 1.5px solid #2a1f10;
  border-radius: 4px;
  background: #fff;
  color: #2a1f10;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95em;
}

.account-input:focus {
  outline: 2px solid #ff7a2b;
  outline-offset: 1px;
}

.account-says {
  min-height: 1.3em;
  color: #a8370a;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8em;
}

/* What was reached for, and that the beat is safe */
.account-why {
  margin-top: -0.5em;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82em;
  line-height: 1.4;
}

/* Six digits, read at a glance */
.account-code {
  font-size: 1.5em;
  font-weight: 700;
  letter-spacing: 0.45em;
  text-align: center;
}

.account-small {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75em;
  line-height: 1.4;
}

.account-later {
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.account-later:hover,
.account-later:focus-visible {
  color: #a8370a;
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .acct-pick {
    transition: none;
  }

  .acct-menu,
  .how-sheet,
  .account-sheet {
    animation: none;
  }
}

/* A new disk in the middle of the desk, waiting for its name */
.disk-namer {
  position: fixed;
  left: 50%;
  top: 44%;
  /* Over the strip, the desk and the lamp falloff */
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1em;
  font-size: clamp(15px, 1.7vw, 26px);
  transform: translate(-50%, -50%) rotate(-3deg);
  filter: drop-shadow(0 2.2em 2.4em rgba(0, 0, 0, 0.75));
}

.disk-namer .floppy-label {
  justify-content: center;
  gap: 0;
  padding: 0.3em 0.5em 0.2em;
}

/* The name, scribbled: marker on the label, not a form field */
.disk-namer-input {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: #1c1409;
  font-family: "Permanent Marker", cursive;
  font-size: 1.05em;
  line-height: 1.2;
  text-align: center;
  outline: none;
  caret-color: #a8370a;
  transform: rotate(-2deg);
}

.disk-namer-input::placeholder {
  color: rgba(42, 31, 16, 0.32);
}

.disk-namer-line {
  width: 92%;
  height: 0.5em;
  overflow: visible;
  transform: rotate(-1.5deg);
}

.disk-namer-line path {
  fill: none;
  stroke: #2a1f10;
  stroke-width: 1.1;
  stroke-linecap: round;
  /* Longer than the stroke, so one dash covers all of it */
  stroke-dasharray: 130;
  stroke-dashoffset: 130;
  animation: disk-namer-draw 0.5s ease-out 0.35s forwards;
}

@keyframes disk-namer-draw {
  to {
    stroke-dashoffset: 0;
  }
}

.disk-namer-hint {
  padding: 0.4em 1em 0.5em;
  background: linear-gradient(180deg, #f1e7c9, #e2d4ad);
  clip-path: polygon(0 12%, 2% 0, 98% 6%, 100% 0, 99% 88%, 100% 100%, 2% 94%, 0 100%);
  color: #2a1f10;
  font-family: "Permanent Marker", cursive;
  font-size: 0.55em;
  white-space: nowrap;
  transform: rotate(2deg);
}

.disk-namer-hint b {
  color: #a8370a;
  font-weight: 400;
}

/* Up out of the way while a kept disk is chosen to write over */
.disk-namer {
  transition:
    top 0.3s cubic-bezier(0.3, 1.2, 0.5, 1),
    font-size 0.3s cubic-bezier(0.3, 1.2, 0.5, 1);
}

.disk-namer.is-choosing {
  top: 25%;
  font-size: clamp(10px, min(1.15vw, 2vh), 18px);
}

/* A full box: the kept disks in the middle of the desk, one to be written over */
.disk-chooser {
  position: fixed;
  left: 50%;
  top: 38%;
  /* Under the new disk, over everything else */
  z-index: 59;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4em;
  font-size: clamp(9px, min(1.05vw, 1.9vh), 16px);
  transform: translateX(-50%);
}

/* The lamp turned down on the rest of the desk */
.disk-chooser::before {
  content: "";
  position: fixed;
  inset: -100vh -100vw;
  z-index: -1;
  background: rgba(10, 6, 2, 0.62);
}

.disk-chooser-ask,
.disk-chooser-words {
  padding: 0.4em 1em 0.5em;
  background: linear-gradient(180deg, #f1e7c9, #e2d4ad);
  clip-path: polygon(0 12%, 2% 0, 98% 6%, 100% 0, 99% 88%, 100% 100%, 2% 94%, 0 100%);
  color: #2a1f10;
  font-family: "Permanent Marker", cursive;
  font-size: 1.15em;
  white-space: nowrap;
}

.disk-chooser-ask {
  transform: rotate(-1.5deg);
}

.disk-chooser-ask b,
.disk-chooser-words b {
  color: #a8370a;
  font-weight: 400;
}

.disk-chooser-row {
  display: flex;
  gap: 2.4em;
}

.disk-choice {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
  filter: drop-shadow(0 1.2em 1.4em rgba(0, 0, 0, 0.7));
  transition:
    transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1),
    opacity 0.2s;
}

.disk-choice:nth-child(odd) {
  transform: rotate(-2.5deg);
}

.disk-choice:nth-child(even) {
  transform: rotate(2deg) translateY(0.5em);
}

.disk-choice:hover,
.disk-choice:focus-visible,
.disk-choice.is-picked {
  transform: translateY(-1em) rotate(0deg);
}

.disk-choice:focus-visible {
  outline: 2px solid #ff7a2b;
  outline-offset: 6px;
}

/* One is in the hand: the others wait */
.disk-chooser.is-asking .disk-choice:not(.is-picked) {
  opacity: 0.4;
}

/* Room on the label for the name and what is taped under it */
.disk-choice .floppy-label {
  height: 61%;
  justify-content: space-between;
  padding-bottom: 0.4em;
}

.disk-choice .floppy-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.9em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* What is known about a disk, on strips of masking tape across its label */
.disk-tapes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25em;
}

.disk-tape {
  padding: 0.12em 0.7em 0.18em;
  background: rgba(226, 200, 128, 0.92);
  clip-path: polygon(
    0 0,
    3% 22%,
    0 48%,
    3% 74%,
    0 100%,
    100% 100%,
    97% 76%,
    100% 50%,
    97% 24%,
    100% 0
  );
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12);
  color: #2a1f10;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.disk-tape:nth-child(odd) {
  transform: rotate(-2.5deg);
}

.disk-tape:nth-child(even) {
  transform: rotate(1.5deg);
}

.disk-chooser-confirm {
  display: flex;
  align-items: center;
  gap: 1em;
}

.disk-chooser-confirm[hidden] {
  display: none;
}

.disk-chooser-confirm .disk-tab:hover,
.disk-chooser-confirm .disk-tab:focus-visible {
  transform: translateY(-0.2em);
}

/* Its disks are out on the desk */
.prop-disks.is-emptied .disk-stack {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .disk-namer,
  .disk-choice {
    transition: none;
  }
}

/* Committed or called off: the hint has said its piece */
.disk-namer.is-named .disk-namer-hint {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .disk-namer-line path {
    animation: none;
    stroke-dashoffset: 0;
  }
}

/* The note that asks before unsaved work is lost, stuck by the disk box */
.keep-note {
  position: absolute;
  /* Above the disk in the hand, so what it asks about stays in view */
  top: 2.5vh;
  left: 18vw;
  width: clamp(190px, 17vw, 250px);
  display: flex;
  flex-direction: column;
  gap: 1.2vh;
  font-size: clamp(12px, 1vw, 15px);
  z-index: 14;
  animation: keep-note-stick 0.25s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.keep-note:hover {
  transform: rotate(-2deg);
}

@keyframes keep-note-stick {
  from {
    opacity: 0;
    transform: rotate(-8deg) translateY(-14px) scale(1.08);
  }
}

.keep-note-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keep-note-key {
  padding: 0.6em 0.8em;
  border: none;
  border-radius: 4px;
  background: linear-gradient(180deg, #3a342d, #231f1a);
  color: #f4ecd6;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 215, 0.18),
    0 2px 0 #0a0806;
}

.keep-note-key.is-hot {
  background: linear-gradient(180deg, #ff9a55, #ff7a2b);
  color: #1a1208;
}

.keep-note-key:active {
  transform: translateY(2px);
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .keep-note {
    animation: none;
  }
}

/* ---- Cassette = MIDI Export ---- */
.cassette {
  position: relative;
  width: 100%;
  aspect-ratio: 1.55;
  /* Smoke-grey shell rather than black, so its mouldings are readable:
     two case screws in the lower corners, then the plastic itself */
  background:
    radial-gradient(circle at 4.5% 91%, #a39a8b 0 1.6px, #120e0b 1.9px 3.2px, transparent 3.6px),
    radial-gradient(circle at 95.5% 91%, #a39a8b 0 1.6px, #120e0b 1.9px 3.2px, transparent 3.6px),
    var(--tex-plastic), linear-gradient(180deg, #4a4138 0%, #352d26 55%, #28211b 100%);
  border-radius: 6px;
  padding: 0.9vh 0.7vw;
  border: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 215, 0.28),
    inset 0 0 0 1px rgba(255, 240, 215, 0.07),
    inset 0 -2px 3px rgba(0, 0, 0, 0.5),
    0 2vh 3vh -0.8vh rgba(0, 0, 0, 0.7),
    0 0.6vh 1.2vh rgba(0, 0, 0, 0.5),
    0 0 22px rgba(255, 122, 43, 0.18);
  transform: rotate(-2.5deg);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.cassette:hover {
  transform: rotate(-2.5deg) translateY(-3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 2.6vh 4vh -0.8vh rgba(0, 0, 0, 0.75),
    0 1vh 1.8vh rgba(0, 0, 0, 0.55),
    0 0 32px rgba(255, 122, 43, 0.32);
}

.cassette-label {
  background: linear-gradient(180deg, #f4ecd6 0%, #e6d8ba 100%);
  height: 55%;
  border-radius: 2px;
  padding: 0.6vh 0.7vw;
  font-family: "Permanent Marker", cursive;
  color: #2a1f10;
  font-size: clamp(10px, 0.7vw, 12px);
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.3);
}

.cassette-label .tagline {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(7px, 0.5vw, 9px);
  letter-spacing: 1.5px;
  color: #6b4a2a;
  margin: 0;
  text-transform: uppercase;
}

/* The one way out to a DAW, written across the label */
.cassette-export {
  align-self: center;
  margin: 0;
  padding: 0.1em 0.5em 0.2em;
  border: none;
  border-bottom: 2px solid #c2410c;
  background: none;
  color: #2a1f10;
  font-family: "Permanent Marker", cursive;
  font-size: clamp(14px, 1.2vw, 20px);
  letter-spacing: 1px;
  line-height: 1.1;
  cursor: pointer;
  transition: color 0.2s;
}

.cassette-export-caret {
  display: inline-block;
  color: #c2410c;
  transition: transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.cassette-export:hover,
.cassette-export[aria-expanded="true"] {
  color: #c2410c;
}

.cassette-export[aria-expanded="true"] .cassette-export-caret {
  transform: rotate(180deg);
}

.cassette-export:focus-visible {
  outline: 2px solid #c2410c;
  outline-offset: 2px;
  border-radius: 2px;
}

/* The inlay card slid out from under the label: a line for each format */
.cassette-menu {
  position: absolute;
  /* The tape hangs off the desk's edge: its card stops short of that side */
  left: 3%;
  right: 13%;
  top: 52%;
  z-index: 6;
  display: flex;
  flex-direction: column;
  padding: 0.4em 0;
  background: linear-gradient(180deg, #f4ecd6, #e6d8ba);
  border-radius: 0 0 3px 3px;
  box-shadow:
    inset 0 3px 4px -2px rgba(0, 0, 0, 0.35),
    0 1.2em 1.6em -0.5em rgba(0, 0, 0, 0.75);
  font-size: clamp(10px, 0.74vw, 13px);
  transform-origin: top center;
  animation: cassette-menu-out 0.2s cubic-bezier(0.3, 1.3, 0.5, 1);
}

.cassette-menu[hidden] {
  display: none;
}

@keyframes cassette-menu-out {
  from {
    opacity: 0;
    transform: translateY(-0.8em) scaleY(0.85);
  }
}

.cassette-action {
  display: grid;
  grid-template-columns: 5.2em 1fr;
  align-items: baseline;
  gap: 0.5em;
  min-height: 2.6em;
  margin: 0;
  padding: 0.35em 0.8em;
  border: none;
  background: none;
  color: #2a1f10;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.cassette-action + .cassette-action {
  border-top: 1px solid rgba(42, 31, 16, 0.14);
}

.cassette-action b {
  color: #c2410c;
  font-family: "Permanent Marker", cursive;
  font-size: 1.25em;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.cassette-action span {
  font-family: "Special Elite", "JetBrains Mono", monospace;
  line-height: 1.25;
}

.cassette-action:hover,
.cassette-action:focus-visible {
  background: rgba(255, 122, 43, 0.22);
  outline: none;
}

.cassette-action[draggable="true"] {
  cursor: grab;
}

/* Not a file for a DAW: what other people open, on a key of its own on the shell */
.cassette-share {
  position: absolute;
  left: 50%;
  bottom: 4%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  transform: translateX(-50%);
  padding: 0.45em 1em;
  border: 0;
  border-radius: 3px;
  background: linear-gradient(180deg, #e2452a, #b53a1e);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 2px 0 #6e1f0e,
    0 3px 6px rgba(0, 0, 0, 0.5);
  color: #fff6e2;
  font:
    700 clamp(9px, 0.68vw, 12px) / 1 "JetBrains Mono",
    monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

.cassette-share[hidden] {
  display: none;
}

.cassette-share:hover {
  background: linear-gradient(180deg, #f05a3c, #c8452a);
}

.cassette-share:active {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translate(-50%, 2px);
}

.cassette-share:focus-visible {
  outline: 2px solid #f4ecd6;
  outline-offset: 2px;
}

/* Share's two lines, on a card that comes up from the key over the tape: the cassette
   does not grow, and the card stays on it, where the desk has no room beside it */
.share-card {
  position: absolute;
  /* Clear of the sampler's edge on one side and the desk's on the other */
  left: 9%;
  right: 13%;
  bottom: 23%;
  z-index: 7;
  display: flex;
  flex-direction: column;
  padding: 0.3em 0;
  border-radius: 4px;
  background: linear-gradient(180deg, #f4ecd6, #e6d8ba);
  box-shadow: 0 1.2em 1.6em -0.5em rgba(0, 0, 0, 0.75);
  font-size: clamp(10px, 0.74vw, 13px);
  transform-origin: bottom center;
  animation: share-card-out 0.18s cubic-bezier(0.3, 1.3, 0.5, 1);
}

.share-card[hidden] {
  display: none;
}

/* It points back at its key */
.share-card::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.4em;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.5em;
  background: #e6d8ba;
  transform: rotate(45deg);
}

/* On a narrow desk the tape is small and close under the header: the card is its two
   words alone, so it stays on the tape */
@media (max-width: 1199px) {
  .share-card .cassette-action {
    grid-template-columns: 1fr;
    min-height: 2.2em;
  }

  .share-card .cassette-action span {
    display: none;
  }
}

@keyframes share-card-out {
  from {
    opacity: 0;
    transform: translateY(0.6em) scale(0.92);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cassette-menu,
  .share-card {
    animation: none;
  }
}

.cassette:hover .cassette-export {
  text-shadow: 0 0 6px rgba(255, 200, 80, 0.5);
}

.cassette-reels {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.8vh;
  padding: 0 0.8vw;
  height: 35%;
}

.reel {
  width: 2.2vw;
  height: 2.2vw;
  max-width: 38px;
  max-height: 38px;
  min-width: 24px;
  min-height: 24px;
  border-radius: 50%;
  /* Spindle hole, cream hub ring with the tape pack wound round it, and
     drive teeth showing through the middle (they make the spin visible) */
  background:
    radial-gradient(circle closest-side, #120e0b 0 13%, transparent 14%),
    radial-gradient(circle closest-side, transparent 0 36%, #ece3cf 37% 58%, #4a2c1a 60% 100%),
    repeating-conic-gradient(from 0deg, #ece3cf 0 22deg, #1f1914 22deg 60deg);
  box-shadow:
    0 0 0 1px rgba(255, 240, 215, 0.22),
    0 0 0 3px rgba(0, 0, 0, 0.45);
  transition: transform 0.3s ease;
}

/* Take-up reel: nearly empty, so less tape around the hub */
.reel:nth-child(2) {
  background:
    radial-gradient(circle closest-side, #120e0b 0 13%, transparent 14%),
    radial-gradient(
      circle closest-side,
      transparent 0 36%,
      #ece3cf 37% 58%,
      #4a2c1a 60% 74%,
      #17120e 76% 100%
    ),
    repeating-conic-gradient(from 0deg, #ece3cf 0 22deg, #1f1914 22deg 60deg);
}

.cassette:hover .reel {
  animation: reel-spin 3.2s linear infinite;
}

.cassette:hover .reel:nth-child(2) {
  animation-direction: reverse;
}

@keyframes reel-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.cassette-window {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 50%;
  height: 60%;
  /* Amber-tinted window with a lamp glare across one corner */
  background:
    linear-gradient(
      112deg,
      rgba(255, 255, 255, 0.3) 0%,
      rgba(255, 255, 255, 0.08) 24%,
      transparent 24.5%
    ),
    linear-gradient(180deg, rgba(226, 190, 132, 0.6), rgba(160, 122, 78, 0.55));
  border-radius: 4px;
  border: 1px solid rgba(255, 240, 215, 0.3);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
}

.cassette-confirm {
  position: absolute;
  top: 22%;
  left: 10%;
  right: 10%;
  padding: 0.6vh 0.6vw;
  background: #ff7a2b;
  color: #0a0805;
  font-family: "Permanent Marker", cursive;
  font-size: clamp(10px, 0.85vw, 14px);
  text-align: center;
  border-radius: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  z-index: 10;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.cassette.is-confirming .cassette-confirm {
  opacity: 1;
  transform: translateY(0);
}

.cassette.is-confirming .reel {
  animation: reel-spin 0.8s linear 2;
}

/* Tape rolls for as long as an audio bounce is rendering */
.cassette.is-rendering .reel {
  animation: reel-spin 0.5s linear infinite;
}

/* ---- Microphone = voice in ---- */
.mic-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.mic-body {
  width: 100%;
  /* One shadow for the whole mic, thrown down-right by the lamp */
  filter: drop-shadow(5px 9px 6px rgba(0, 0, 0, 0.6));
  transition: transform 0.25s ease;
}

.mic-body svg {
  display: block;
  width: 100%;
  height: auto;
}

.mic-btn:hover .mic-body {
  transform: translateY(-3px);
}

.mic-btn:focus-visible {
  outline: 2px solid #ff7a2b;
  outline-offset: 4px;
  border-radius: 4px;
}

/* Tally light by the switch: dark, blinking while armed, solid while recording */
.mic-tally {
  fill: #3a0f08;
  stroke: #0d0b09;
  stroke-width: 1.2;
}

.prop-mic[data-state="arming"] .mic-tally,
.prop-mic[data-state="waiting"] .mic-tally,
.prop-mic[data-state="countin"] .mic-tally {
  fill: #ff4a26;
  animation: pulse 0.5s steps(2, jump-none) infinite;
}

.prop-mic[data-state="recording"] .mic-tally {
  fill: #ff3b1f;
  filter: drop-shadow(0 0 4px #ff3b1f);
}

/* Strip of masking tape with the instruction written on it */
.mic-tag {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  /* stuck to the desk in the space under the mic's tail */
  position: absolute;
  right: -2vw;
  bottom: -0.8vh;
  padding: 0.45vh 0.9vw 0.5vh;
  background: linear-gradient(180deg, #f1e7c9 0%, #e2d4ad 100%);
  color: #2a1f10;
  transform: rotate(-3deg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 2px 5px rgba(0, 0, 0, 0.5);
  /* torn ends */
  clip-path: polygon(0 12%, 2% 0, 98% 6%, 100% 0, 99% 88%, 100% 100%, 2% 94%, 0 100%);
}

.mic-tag-text {
  font-family: "Permanent Marker", cursive;
  font-size: clamp(10px, 0.82vw, 13px);
  letter-spacing: 0.5px;
  color: #c2410c;
  white-space: nowrap;
}

.mic-tag-hint {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(7px, 0.52vw, 9px);
  letter-spacing: 0.5px;
  color: #6b4a2a;
  white-space: nowrap;
}

/* Input meter: a strip along the bottom of the tape while the mic is open */
.mic-meter {
  display: none;
  width: 100%;
  height: 3px;
  margin-top: 2px;
  background: rgba(42, 31, 16, 0.25);
  border-radius: 2px;
  overflow: hidden;
}

.prop-mic:not([data-state="idle"]) .mic-meter,
.prop-mic.is-listening .mic-meter {
  display: block;
}

.mic-meter-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #4d7c0f 0%, #65a30d 60%, #f59e0b 85%, #dc2626 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.08s linear;
}

.prop-mic[data-state="recording"] .mic-tag-text,
.prop-mic[data-state="countin"] .mic-tag-text {
  color: #b3200a;
}

.prop-mic.drag-over .mic-body {
  transform: translateY(-5px) scale(1.04);
}

.prop-mic.drag-over .mic-tag {
  background: #ffb46e;
}

/* VOCAL / BEATBOX: two strips of embossed label tape; the one in use is orange */
.mic-mode {
  position: absolute;
  top: -1.4vh;
  left: -0.4vw;
  display: flex;
  gap: 3px;
  transform: rotate(-5deg);
}

.mic-mode-btn,
.mic-load-btn {
  font-family: "Bowlby One", sans-serif;
  font-size: clamp(7px, 0.55vw, 9px);
  letter-spacing: 0.08vw;
  text-transform: uppercase;
  color: rgba(240, 232, 216, 0.6);
  padding: 0.45vh 0.4vw;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 38%, rgba(0, 0, 0, 0.25) 100%),
    #241e18;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 2px 3px rgba(0, 0, 0, 0.6);
}

.mic-mode-btn:hover,
.mic-load-btn:hover {
  color: #f0e8d8;
}

/* LOAD: a momentary key, set a little apart from the two-way switch */
.mic-load-btn {
  margin-left: 0.3vw;
  white-space: nowrap;
}

.mic-mode-btn.active {
  color: #1a0f06;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, transparent 40%, rgba(0, 0, 0, 0.15) 100%),
    #ff7a2b;
}

/* INPUT and MON: small print above the mode keys, for which mic or
   interface the lead is plugged into and whether it is heard. Kept flat
   and quiet so the mode keys stay the main choice. */
.mic-io {
  position: absolute;
  top: -3.9vh;
  left: -0.6vw;
  display: flex;
  align-items: center;
  gap: 0.7vw;
  transform: rotate(-5deg);
}

.mic-input-btn,
.mic-mon-btn,
.mic-menu-item,
.mic-menu-channels button {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(9px, 0.68vw, 11.5px);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(240, 232, 216, 0.78);
  padding: 2px 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.mic-input-btn:hover,
.mic-mon-btn:hover,
.mic-menu-item:hover,
.mic-menu-channels button:hover {
  color: #f0e8d8;
}

.mic-input-btn {
  border-bottom: 1px dotted rgba(240, 232, 216, 0.45);
}

/* MON has a lamp that lights while the input is being played back */
.mic-mon-btn {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mic-mon-btn::before,
.mic-menu-item::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(240, 232, 216, 0.3);
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.mic-mon-btn[aria-pressed="true"],
.mic-menu-item[aria-pressed="true"],
.mic-menu-channels button[aria-pressed="true"] {
  color: #f0e8d8;
}

.mic-mon-btn[aria-pressed="true"]::before,
.mic-menu-item[aria-pressed="true"]::before {
  background: #ff7a2b;
  box-shadow: 0 0 5px rgba(255, 122, 43, 0.8);
}

.mic-input-btn:focus-visible,
.mic-mon-btn:focus-visible,
.mic-menu-item:focus-visible,
.mic-menu-channels button:focus-visible {
  outline: 1px solid #ff7a2b;
  outline-offset: 2px;
}

/* Input select: a flat slip that opens above the labels */
.mic-input-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-width: 100%;
  padding: 6px 10px;
  background: rgba(22, 18, 14, 0.97);
  border: 1px solid rgba(240, 232, 216, 0.1);
  border-radius: 3px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}

.mic-input-menu[hidden] {
  display: none;
}

/* The key's own tooltip would sit on top of the open panel */
body:has(.mic-input-btn[aria-expanded="true"]) .tooltip {
  display: none;
}

.mic-menu-head {
  margin: 0 0 3px;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(8px, 0.58vw, 10px);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(240, 232, 216, 0.55);
}

/* Each input has a lamp that lights on the one in use */
.mic-menu-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  text-align: left;
}

.mic-menu-channels {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 3px;
  padding-top: 4px;
  border-top: 1px solid rgba(240, 232, 216, 0.1);
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(8px, 0.58vw, 10px);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(240, 232, 216, 0.55);
}

.mic-menu-channels button[aria-pressed="true"] {
  color: #ff7a2b;
}

/* Only offered once there is a take to erase */
.mic-erase {
  display: none;
  position: absolute;
  right: -2vw;
  bottom: -2.8vh;
  font-family: "Permanent Marker", cursive;
  font-size: clamp(8px, 0.62vw, 10px);
  color: rgba(254, 243, 226, 0.6);
  background: none;
  border: none;
  cursor: pointer;
}

.prop-mic.has-take .mic-erase,
.prop-mic.can-restore .mic-erase {
  display: block;
}

.prop-mic.can-restore .mic-erase {
  color: #ffc58a;
}

.mic-erase:hover {
  color: #ff7a2b;
}

/* Stickers/labels */
.sticker {
  position: absolute;
  font-family: "Permanent Marker", cursive;
  color: #fef3e2;
  font-size: 12px;
  letter-spacing: 1px;
  background: #c2410c;
  padding: 4px 10px;
  transform: rotate(-6deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* ====================================================
   LP sleeves
   ==================================================== */
.lp-with-peek {
  position: relative;
}

.lp-with-peek .lp {
  position: relative;
  z-index: 2;
  transition: transform 0.45s cubic-bezier(0.3, 0.7, 0.4, 1.4);
}

.lp-vinyl-peek {
  position: absolute;
  top: 4%;
  right: 4%;
  width: 92%;
  height: 92%;
  border-radius: 50%;
  background:
    url("../public/images/label-tamla-54243.png?v=2") center / 38% 38% no-repeat,
    radial-gradient(circle at center, #15110a 0 22%, #0a0805 22.3% 23.5%, transparent 23.8%),
    repeating-radial-gradient(circle at center, #0a0805 0 1px, #1a1510 1px 3px),
    #0a0805;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.6),
    inset 0 0 40px rgba(0, 0, 0, 0.4);
  transform: translate(0, 0) rotate(0deg);
  transition: transform 0.55s cubic-bezier(0.3, 0.7, 0.4, 1.4);
  z-index: 1;
  pointer-events: none;
}

.lp-with-peek:hover .lp-vinyl-peek {
  transform: translate(55%, 6%) rotate(18deg);
}

.lp-with-peek:hover .lp {
  transform: translate(-3%, -1%);
}

.lp {
  position: relative;
  aspect-ratio: 1;
  background: #1a1510;
  box-shadow:
    0 18px 30px -10px rgba(0, 0, 0, 0.7),
    0 6px 14px -4px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 -3px 6px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  user-select: none;
}

.lp::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: /* ring wear: the record inside has rubbed its outline through the print */
      radial-gradient(
        circle at 50% 50%,
        transparent 41%,
        rgba(255, 255, 255, 0.32) 43%,
        transparent 46%
      ),
      radial-gradient(ellipse 80% 30px at 50% 0%, rgba(255, 255, 255, 0.06), transparent 60%),
      radial-gradient(ellipse 30px 80% at 0% 50%, rgba(0, 0, 0, 0.45), transparent 60%),
      radial-gradient(ellipse 30px 80% at 100% 50%, rgba(0, 0, 0, 0.45), transparent 60%);
  mix-blend-mode: overlay;
  opacity: 0.7;
}

.lp::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    transparent 35%,
    rgba(255, 255, 255, 0.12) 45%,
    transparent 55%,
    rgba(255, 255, 255, 0.04) 65%,
    transparent 80%
  );
  z-index: 5;
}

/* Photo LP variant */
.lp--photo {
  background: #15110a;
  display: flex;
  flex-direction: column;
}

.lp-photo-img {
  flex: 1;
  background: #2a1810;
  overflow: hidden;
  position: relative;
}

.lp-photo-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lp--photo .footer {
  background: #1a0d05;
  color: #ff7a2b;
  padding: 8px 12px;
  font-family: "Bowlby One", sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-top: 1px solid rgba(255, 122, 43, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lp--photo .footer small {
  font-family: "JetBrains Mono", monospace;
  font-size: 8px;
  opacity: 0.6;
  letter-spacing: 1.5px;
}

/* Circles variant */
.lp--circles {
  background:
    radial-gradient(circle at 30% 35%, #f59e0b 0 90px, transparent 92px),
    radial-gradient(circle at 65% 60%, #c2410c 0 60px, transparent 62px),
    radial-gradient(circle at 75% 30%, #fef3e2 0 30px, transparent 32px),
    linear-gradient(135deg, #2a1810 0%, #4a2818 100%);
  padding: 14px 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #f4ecd6;
}

.lp--circles .meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 2px;
  opacity: 0.7;
  text-transform: uppercase;
}

.lp--circles .title {
  font-family: "Bowlby One", sans-serif;
  font-size: clamp(16px, 1.5vw, 22px);
  letter-spacing: 1px;
  margin-top: 4px;
  text-transform: uppercase;
  line-height: 0.95;
}

/* Stripes variant */
.lp--stripes {
  background: repeating-linear-gradient(45deg, #c2410c 0 18px, #1a0d05 18px 36px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lp--stripes .badge {
  background: #fef3e2;
  color: #1a0d05;
  padding: 12px 14px;
  font-family: "Bowlby One", sans-serif;
  font-size: clamp(12px, 1.2vw, 18px);
  letter-spacing: 1px;
  text-align: center;
  line-height: 1;
  transform: rotate(-3deg);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.lp--stripes .badge small {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  margin-top: 6px;
  letter-spacing: 2px;
  font-weight: 400;
  opacity: 0.7;
}

/* Portrait variant */
.lp--portrait {
  background: linear-gradient(180deg, #c2410c 0%, #7a2810 100%);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* One-colour press job: black photo ink multiplied onto orange stock */
.lp-portrait-img {
  flex: 1;
  min-height: 0;
  background: #e8742f;
  overflow: hidden;
}

.lp-portrait-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  display: block;
  filter: grayscale(1) contrast(1.15);
  mix-blend-mode: multiply;
}

.lp--portrait .text {
  font-family: "Bowlby One", sans-serif;
  color: #fef3e2;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: center;
}

.lp--portrait .text small {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 2px;
  margin-top: 2px;
  opacity: 0.75;
}

/* Live-album variant: full-bleed concert photo, title set in the dark */
.lp--live img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 0%;
  display: block;
}

.lp--live .title {
  position: absolute;
  top: 5%;
  left: 7%;
  /* series line sits above the title, keeping both in the dark of the photo */
  display: flex;
  flex-direction: column-reverse;
  font-family: "Bowlby One", sans-serif;
  font-size: clamp(12px, 1.15vw, 18px);
  line-height: 1;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ffb46e;
}

.lp--live .title small {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 2px;
  margin-bottom: 5px;
  color: #fef3e2;
  opacity: 0.75;
}

/* Fanned LP cluster */
.lp-fan {
  position: relative;
  aspect-ratio: 1.6;
  flex-shrink: 0;
  width: 100%;
}

.lp-fan > .lp-with-peek {
  position: absolute;
  top: 0;
  left: 0;
  width: 55%;
  aspect-ratio: 1;
}

.lp-fan > .lp-with-peek > .lp {
  width: 100%;
  height: 100%;
}

.prop-funk {
  transition: transform 0.3s ease;
}

.prop-funk:hover {
  transform: rotate(2deg) translateY(-3px);
}

/* ---- Avatar canvas (head-bob character) — fixed to bottom of screen ---- */
#avatar-canvas {
  position: fixed;
  bottom: calc(var(--dock) + 0.5vh);
  left: 50%;
  transform: translateX(-50%);
  width: clamp(100px, 10vw, 160px);
  height: clamp(100px, 10vw, 160px);
  display: block;
  background: transparent;
  pointer-events: none;
  z-index: 25;
  filter: drop-shadow(0 0.8vh 1.6vh rgba(0, 0, 0, 0.6));
}

/* ========================================================
   The tour — a sticky note that hops around the desk while
   the lamp is turned down on everything else
   ======================================================== */
.tour {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

/* The lit patch; its shadow is the dimmed room */
.tour-spot {
  position: absolute;
  border-radius: 14px;
  box-shadow:
    0 0 0 200vmax rgba(12, 7, 3, 0.64),
    inset 0 0 0 2px rgba(255, 200, 120, 0.55),
    inset 0 0 26px rgba(255, 190, 110, 0.25);
  transition:
    left 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    top 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tour-note {
  position: absolute;
  width: min(310px, calc(100vw - 24px));
  padding: 26px 20px 16px;
  background: linear-gradient(180deg, #fde047 0%, #facc15 100%);
  color: #1a1208;
  transform: rotate(var(--tour-tilt, -1.5deg));
  box-shadow:
    0 22px 34px -10px rgba(0, 0, 0, 0.7),
    0 8px 14px -6px rgba(0, 0, 0, 0.5);
  transition:
    left 0.4s cubic-bezier(0.34, 1.3, 0.64, 1),
    top 0.4s cubic-bezier(0.34, 1.3, 0.64, 1),
    transform 0.4s ease;
}

/* A strip of tape holds it down */
.tour-note::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 34%;
  height: 16px;
  background: rgba(255, 250, 220, 0.75);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.25);
}

.tour-title {
  margin: 0 0 8px;
  font-family: "Permanent Marker", cursive;
  font-size: 21px;
  line-height: 1.15;
  color: #9a3412;
}

.tour-text {
  margin: 0 0 16px;
  font-family: "Special Elite", "JetBrains Mono", monospace;
  font-size: 14px;
  line-height: 1.5;
}

.tour-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tour-count {
  flex: 1;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(26, 18, 8, 0.55);
}

.tour-note button {
  all: unset;
  cursor: pointer;
  font-family: "Permanent Marker", cursive;
}

.tour-note button[hidden] {
  display: none;
}

.tour-note .tour-next {
  margin-left: auto;
  padding: 6px 14px;
  font-size: 15px;
  color: #fde047;
  background: #1a1208;
  border-radius: 3px;
  transform: rotate(-1deg);
  transition: transform 0.15s;
}

.tour-note .tour-next:hover {
  transform: rotate(-1deg) scale(1.06);
}

.tour-note .tour-back {
  font-size: 13px;
  color: rgba(26, 18, 8, 0.7);
}

.tour-note .tour-skip {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 11px;
  color: rgba(26, 18, 8, 0.55);
}

.tour-note .tour-back:hover,
.tour-note .tour-skip:hover {
  color: #1a1208;
}

.tour-note button:focus-visible {
  outline: 2px solid #9a3412;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .tour-spot,
  .tour-note {
    transition: none;
  }
}

/* ========================================================
   J-card — the last bounce, listed on a card that sits under
   the cassette. Each file is a strip of masking tape that can
   be dragged out of the browser.
   ======================================================== */
.cassette-tray {
  position: absolute;
  top: calc(100% - 0.6vh);
  left: 6%;
  right: 12%;
  z-index: -1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 6px;
  padding: 1.6vh 0.7vw 1vh;
  background:
    repeating-linear-gradient(180deg, transparent 0 1.25em, rgba(100, 140, 200, 0.16) 1.25em 1.3em),
    linear-gradient(180deg, #efe5cb 0%, #e3d6b6 100%);
  border-radius: 0 0 3px 3px;
  box-shadow:
    inset 0 6px 8px -4px rgba(0, 0, 0, 0.45),
    0 1.2vh 2vh -0.6vh rgba(0, 0, 0, 0.6);
  transform: rotate(-1.2deg);
  transform-origin: top center;
  animation: tray-slide 0.45s cubic-bezier(0.34, 1.3, 0.5, 1);
}

.cassette-tray[hidden] {
  display: none;
}

@keyframes tray-slide {
  from {
    opacity: 0;
    transform: translateY(-60%) rotate(-1.2deg);
  }
}

.tray-heading {
  flex-basis: 100%;
  margin: 0;
  font-family: "Permanent Marker", cursive;
  font-size: clamp(9px, 0.7vw, 12px);
  color: #6b4a2a;
}

.tray-strip {
  padding: 2px 8px 3px;
  font-family: "Permanent Marker", cursive;
  font-size: clamp(9px, 0.72vw, 12px);
  color: #2a1f10;
  text-decoration: none;
  text-transform: uppercase;
  background: linear-gradient(180deg, rgba(255, 250, 225, 0.95), rgba(236, 224, 184, 0.9));
  /* Torn ends */
  clip-path: polygon(0 12%, 3% 0, 97% 4%, 100% 20%, 99% 88%, 96% 100%, 4% 96%, 1% 82%);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35);
  cursor: grab;
  transition: transform 0.15s ease;
}

.tray-strip:nth-child(odd) {
  transform: rotate(-1.5deg);
}

.tray-strip:nth-child(even) {
  transform: rotate(1.2deg);
}

.tray-strip:hover {
  transform: translateY(-2px) rotate(0deg);
  color: #c2410c;
}

.tray-strip:active {
  cursor: grabbing;
}

.tray-strip:focus-visible {
  outline: 2px solid #c2410c;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .cassette-tray {
    animation: none;
  }
}

/* ========================================================
   Desk sizes (ADR-0022, ADR-0023). The tools are on the desk
   at every size; the set dressing comes out as the window
   has room. Large is the desk as laid out above. Medium
   (under 1600px wide) puts the fan of sleeves away. Small
   (under 1200px wide) has the tools alone. A window under
   800px tall gets the next size's dressing down. The
   selectors name the desk and the stage to outrank the
   entrance rules at the top of the file.

   What holds it together (ADR-0023): the sampler and its
   title are one block, and the wood left over is shared
   out 1 above to 1.618 below. The sampler is never wider
   than the window's height allows, so there is always a
   band under it. Sizes step by the same ratio: the title
   is 8 hundredths of the window's height, 5 with a loop or
   a vocal loaded; the band under the sampler is 13 at
   least; the dock is 7.
   ======================================================== */
@media (max-width: 1599px), (max-height: 799px) {
  .desk .stage .prop-lp-fan {
    display: none;
  }
}

@media (max-width: 1199px), (max-width: 1599px) and (max-height: 799px) {
  .desk .stage .prop-vinyl,
  .desk .stage .prop-polaroid,
  .desk .stage .prop-funk,
  #avatar-canvas {
    display: none;
  }
}

/* ---- The desk with room beside the sampler: laptops and monitors ---- */
@media (min-width: 1200px) {
  :root {
    /* Two more rows must still leave the band under the sampler; with no title over it the
       sampler has the height the title had */
    --sampler-w: clamp(820px, min(72vw, 132vh), 1400px);
    --under: 13vh;
  }

  /* The sampler block floats between the top of the desk and the dock: of
     the wood left over, 1 part above it and 1.618 below */
  .stage .sampler-stage {
    top: 0;
    bottom: var(--dock);
    transform: translateX(-50%);
    display: grid;
    /* Never up under the header */
    grid-template-rows: minmax(calc(1.5vh + var(--top-h) + 26px), 1fr) auto minmax(
        var(--under),
        1.618fr
      );
    pointer-events: none;
  }

  .stage .sampler-wrap {
    grid-row: 2;
    width: 100%;
    pointer-events: auto;
  }

  .desk .stage .prop-polaroid {
    top: 21vh;
  }

  .desk .stage .prop-cassette {
    top: 45vh;
    z-index: 6;
  }

  .desk .stage .prop-funk {
    bottom: calc(var(--dock) + 2vh);
  }

  /* The record sits lower, clear of the disk file */
  .desk .stage .prop-vinyl {
    bottom: calc(var(--dock) + 6vh);
  }

  /* The head-bobber stands in the band under the sampler, and no taller */
  #avatar-canvas {
    width: clamp(84px, min(10vw, 12.5vh), 160px);
    height: clamp(84px, min(10vw, 12.5vh), 160px);
  }

  /* Every disk is on the left: your own box, and the file from other desks under it */
  .desk .stage .prop-disks {
    top: 12vh;
  }

  .desk .stage .prop-crate {
    top: calc(12vh + 17.2em);
    left: 1.5vw;
    transform: rotate(1.5deg);
  }

  /* A disk from the box is held flat over the wood under the header, clear of the wordmark */
  .disk-hand {
    left: calc(100% + 1em + 11vw);
    top: -5.4em;
    flex-wrap: nowrap;
    max-width: none;
    font-size: 10px;
    transform: none;
  }

  .disk-hand .disk-sent {
    flex-basis: auto;
  }

  /* The mic lies on clear wood under the sampler, no bigger than the band allows */
  .desk .stage .prop-mic {
    left: 57vw;
    bottom: calc(var(--dock) + 1.5vh);
    width: min(13vw, 19vh, 200px);
  }
}

/* Short: no band under the sampler worth the name, so the mic lies beside the
   chassis at its foot, on its lead */
@media (min-width: 1200px) and (max-height: 799px) {
  :root {
    --under: 3vh;
    --top-h: 42px;
  }

  .desk .stage .prop-mic {
    left: auto;
    /* Its tag hangs off its right: room is left for it */
    right: 4.6vw;
    bottom: calc(var(--dock) + 3vh);
    width: min(10.5vw, 160px);
  }

  .desk .stage .prop-cassette {
    top: 38vh;
  }

  .disk-hand {
    font-size: 9px;
  }

  /* Two more rows and the sampler would be hard against the header:
     it gives up a little width, and with it height */
  body.has-takes {
    --sampler-w: clamp(760px, min(72vw, 126vh), 1400px);
  }
}

/* ---- Narrow: the sampler leaves little room beside it, so the tools line
   up along the top ---- */
@media (max-width: 1199px) {
  /* On a window taller than it is wide the desk keeps its shape and sits in
     the middle: --u stands in for 1vh, --edge is the bare wood above and below */
  .stage {
    --u: min(1vh, 0.78vw);
    --edge: calc((100vh - 100 * var(--u)) / 2);
  }

  .stage .sampler-stage {
    bottom: calc(var(--edge) + 33 * var(--u));
  }

  .desk .stage .desk-top {
    top: calc(var(--edge) + 1.5 * var(--u));
  }

  /* The top row is the tools' here. The wordmark is no bigger than they are; the corner keeps
     a ? and a face, and the name is in the menu */
  .desk-top {
    --top-h: 34px;
  }

  .brand {
    font-size: 22px;
  }

  .desk-nav {
    gap: 0.7em;
    font-size: 11px;
  }

  .acct-key {
    padding: 0.7em 0.8em;
    font-size: 0.82em;
  }

  .acct-name,
  .acct-caret,
  .how-words {
    display: none;
  }

  .how-mark {
    display: block;
  }

  .acct-btn {
    position: relative;
    padding: 0.2em;
  }

  .acct-btn .acct-stamp {
    position: absolute;
    left: 50%;
    bottom: -0.9em;
    background: #1b1714;
    font-size: 0.56em;
    transform: translateX(-50%) rotate(-6deg);
  }

  .desk .stage .prop-disks {
    top: calc(var(--edge) + 17 * var(--u));
  }

  .desk .stage .prop-mic {
    bottom: calc(var(--edge) + 12 * var(--u));
  }

  .desk .stage .prop-crate {
    top: calc(var(--edge) + 1.5 * var(--u));
  }

  /* The cassette takes the corner the polaroid left */
  .desk .stage .prop-cassette {
    /* Under the account's corner */
    top: calc(var(--edge) + 1.5 * var(--u) + 40px);
    right: 1vw;
    width: min(17vw, 200px);
  }
}

/* Too narrow for the disk box beside the sampler: it joins the top row */
@media (max-width: 1099px) {
  .desk .stage .prop-disks {
    top: calc(var(--edge) + 1.5 * var(--u));
    left: 1vw;
  }

  /* The box has the corner here, and the wordmark stands beside it */
  .desk-top {
    padding-left: calc(1vw + 15.5em);
    font-size: clamp(8px, 0.8vw, 12px);
  }

  /* A disk from it is held past the wordmark, a little lower */
  .disk-hand {
    left: calc(100% + 1.2em + 17vw);
    top: 1em;
  }
}

/* The narrow desk has no room to give beside the sampler, so its top row is
   made flatter and the sampler moves up under it: a smaller disk file and
   cassette, and the wood won back goes under the sampler for the mic */
@media (max-width: 1199px) {
  body.has-takes .desk .stage .prop-crate {
    top: calc(var(--edge) + 0.4 * var(--u));
  }

  body.has-takes .desk .stage .prop-cassette {
    /* Still under the account's corner: the zoom below shrinks this length too */
    top: calc((var(--edge) + 0.3 * var(--u) + 40px) / 0.74);
    /* zoom, not a transform: the props' entrances hold theirs */
    zoom: 0.74;
  }
}

/* With a row or two more there is no wood left under the narrow desk's
   sampler. From 1100px the mic goes beside the chassis at its foot. */
@media (min-width: 1100px) and (max-width: 1199px) {
  body.has-takes .desk .stage .prop-mic {
    left: auto;
    /* Its tag hangs off its right: room is left for it */
    right: 4.6vw;
    bottom: 11.5vh;
    width: min(10.5vw, 160px);
  }

  /* The crate stands over the far end of the lip here: whose beat it is goes on the near end */
  .beat-tag {
    right: auto;
    left: 1.4vw;
    align-items: flex-start;
  }

  /* The disk box is still beside the sampler here: a disk from it is held under it */
  body.has-takes .disk-hand {
    left: 0.4em;
    top: calc(100% + 2.4em);
    max-width: 15.5em;
    gap: 0.7em;
    transform: none;
  }

  body.has-takes .disk-hand .disk-tabs {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* Under 1100px the disk box is in the top row too, and lies over the
   sampler's blank corner */
@media (max-width: 1099px) {
  body.has-takes .desk .stage .prop-disks {
    z-index: 11;
  }

  body.has-takes .desk .stage .prop-disks.is-open {
    z-index: 13;
  }
}

/* ========================================================
   Too small — on a phone (or anything the sampler can't fit
   on) the desk is covered by a note sending you to a laptop.
   The same sizes are named in main.js (TOO_SMALL).
   ======================================================== */
.too-small {
  display: none;
}

@media (max-width: 899px), (max-height: 480px) {
  .too-small {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 28px;
    text-align: center;
    overflow-y: auto;
    background:
      repeating-linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.1) 0 2px,
        transparent 2px 9px,
        rgba(255, 200, 140, 0.025) 9px 10px,
        transparent 10px 23px
      ),
      radial-gradient(ellipse at 50% 30%, #4a2c14 0%, #2a180b 55%, #170e06 100%);
  }

  .too-small-logo {
    width: min(46vw, 34vh, 220px);
    height: auto;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.6));
    transform: rotate(-3deg);
  }

  .too-small-kicker {
    margin: 0;
    font-size: 11px;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: rgba(248, 230, 200, 0.55);
  }

  .too-small-title {
    margin: 0;
    max-width: 14em;
    font-family: "Permanent Marker", cursive;
    font-size: clamp(26px, 8vw, 40px);
    font-weight: 400;
    line-height: 1.1;
    color: #f8e6c8;
    transform: rotate(-2deg);
    text-shadow:
      2px 3px 0 rgba(0, 0, 0, 0.6),
      0 8px 20px rgba(0, 0, 0, 0.6);
  }

  .too-small-title em {
    font-style: normal;
    color: #ff7a2b;
  }

  .too-small-text {
    margin: 0;
    max-width: 24em;
    font-size: 15px;
    line-height: 1.5;
    color: rgba(248, 230, 200, 0.85);
  }

  .too-small-copy {
    margin-top: 8px;
    padding: 12px 18px;
    font-family: "JetBrains Mono", monospace;
    font-size: 14px;
    font-weight: 700;
    color: #1a0f06;
    background: #ff7a2b;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transform: rotate(-1.5deg);
    box-shadow: 0 4px 0 #6e2707;
  }

  .too-small-copy:active {
    transform: rotate(-1.5deg) translateY(3px);
    box-shadow: 0 1px 0 #6e2707;
  }
}

/* ========================================================
   The player card (ADR-0012): a beat's link opened where
   the desk doesn't fit. It lies over the note above.
   ======================================================== */
.player {
  display: none;
}

/* A beat's link on a phone: the card is all there is. The desk under it is
   not drawn at all, so nothing of it is laid out, painted or animated while
   the beat plays (main.js sets is-player) */
body.is-player .desk,
body.is-player .too-small {
  display: none;
}

@media (max-width: 899px), (max-height: 480px) {
  .player:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 3001;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: max(22px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
    overflow-y: auto;
    text-align: center;
    color: rgba(248, 230, 200, 0.85);
    background:
      repeating-linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.1) 0 2px,
        transparent 2px 9px,
        rgba(255, 200, 140, 0.025) 9px 10px,
        transparent 10px 23px
      ),
      radial-gradient(ellipse at 50% 30%, #4a2c14 0%, #2a180b 55%, #170e06 100%);
  }

  /* Whatever is on the card stays as wide as a hand */
  .player > * {
    width: 100%;
    max-width: 380px;
    flex-shrink: 0;
  }

  /* ---- The deck (ADR-0032): the clip's tape deck, standing on the desk's wood ---- */
  .player-deck {
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
    padding: 14px 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 16px;
    background:
      repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px),
      linear-gradient(180deg, #3b3834, #2a2826 50%, #1a1918);
    box-shadow: 0 22px 40px rgba(0, 0, 0, 0.7);
    text-align: left;
  }

  .player-deck > * {
    min-width: 0;
  }

  .player-mark {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font:
      400 17px / 1 "Permanent Marker",
      cursive;
    color: #f8e6c8;
  }

  .player-mark img {
    width: 24px;
    height: 24px;
  }

  .player-mark em {
    font-style: normal;
    color: #ff7a2b;
  }

  .player-meters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    /* Small beside the cassette, which is the picture */
    width: 84%;
    margin-inline: auto;
  }

  .player-meter {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: 4px solid #0c0b0a;
    border-radius: 6px;
    background: #0c0b0a;
  }

  .player-dial {
    fill: #ecdcae;
  }

  .player-scale {
    fill: none;
    stroke: #2a1810;
    stroke-width: 5;
  }

  .player-scale.is-hot {
    stroke: #b53a1e;
  }

  .player-needle {
    stroke: #1a0f08;
    stroke-width: 4;
    transform-origin: 175px 216px;
    transform: rotate(-38deg);
  }

  .player-door {
    position: relative;
    padding: 18px 16px;
    border-radius: 9px;
    background: #070706;
  }

  /* The door's glass, once the tape is behind it */
  .player-door::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9px;
    background: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0) 35%,
      rgba(255, 255, 255, 0.04)
    );
    opacity: 0;
    pointer-events: none;
  }

  /* Waiting: the tape stands out of the deck, over the meters, to be tapped in */
  .player-tape {
    position: relative;
    z-index: 1;
    padding: 10px 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 9px;
    background: linear-gradient(180deg, #2c2a27, #151413);
    box-shadow: 0 18px 26px rgba(0, 0, 0, 0.6);
    transform: translateY(-44px) rotate(-3deg) scale(1.03);
    animation: player-wait 2.6s ease-in-out infinite;
    cursor: pointer;
  }

  @keyframes player-wait {
    50% {
      transform: translateY(-50px) rotate(-3deg) scale(1.03);
    }
  }

  /* The first tap: it drops, seats with a clack, and the door shuts over it */
  .player.is-loading .player-tape,
  .player.is-loaded .player-tape {
    transform: none;
    box-shadow: none;
    animation: none;
    cursor: default;
  }

  .player.is-loading .player-tape {
    animation: player-drop 0.62s cubic-bezier(0.5, 0, 0.9, 0.5) both;
  }

  @keyframes player-drop {
    from {
      transform: translateY(-44px) rotate(-3deg) scale(1.03);
      box-shadow: 0 18px 26px rgba(0, 0, 0, 0.6);
    }
    86% {
      transform: translateY(3px);
    }
  }

  .player.is-loading .player-door::after,
  .player.is-loaded .player-door::after {
    opacity: 1;
    transition: opacity 0.16s 0.8s;
  }

  .player.is-loaded .player-door::after {
    transition: none;
  }

  .player-label {
    padding: 8px 10px 10px;
    border-radius: 5px;
    background: linear-gradient(180deg, #f1e6c6, #dccfa6);
    color: #2a1810;
  }

  .player-label-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding-bottom: 5px;
    border-bottom: 3px solid #b53a1e;
  }

  .player-label-top .player-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font:
      400 23px / 1.1 "Permanent Marker",
      cursive;
    color: #2a1810;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .player-label-top small {
    font:
      700 10px / 1 "JetBrains Mono",
      monospace;
    letter-spacing: 0.08em;
    color: #6b5a3e;
    white-space: nowrap;
  }

  .player-reels {
    display: flex;
    justify-content: space-between;
    width: 62%;
    box-sizing: border-box;
    margin: 9px auto 0;
    padding: 7px 16px;
    border-radius: 6px;
    background: #0d0c0b;
  }

  .player-reel {
    width: 30px;
    height: 30px;
    border: 5px solid #3b2416;
    border-radius: 50%;
    background:
      radial-gradient(circle, #111 0 5px, transparent 5.5px),
      repeating-conic-gradient(#111 0 12deg, #e8e2d2 12deg 60deg);
  }

  .player.is-playing .player-reel {
    animation: player-turn 2.4s linear infinite;
  }

  @keyframes player-turn {
    to {
      transform: rotate(360deg);
    }
  }

  .player-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
  }

  .player-counter {
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: 3px;
    background: #0a0a09;
  }

  .player-counter b {
    width: 17px;
    padding: 3px 0;
    background: #efe6cc;
    color: #151515;
    font:
      700 14px / 1 "JetBrains Mono",
      monospace;
    text-align: center;
  }

  .player-lamps {
    display: flex;
    gap: 14px;
  }

  .player-lamp {
    width: 9px;
    height: 9px;
    border: 2px solid #0a0a09;
    border-radius: 50%;
    background: #ff7a2b;
    opacity: 0.22;
  }

  .player-lamp:nth-child(2) {
    background: #f4ecd6;
  }

  .player-lamp:nth-child(3) {
    background: #ffd166;
  }

  .player-lamp:nth-child(4) {
    background: #8ecae6;
  }

  .player-well {
    padding: 8px 8px 14px;
    border-radius: 6px;
    background: #0a0a09;
  }

  .player .player-key {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 64px;
    border: 0;
    border-radius: 6px;
    background: linear-gradient(180deg, #d9d3c4, #9a9486);
    box-shadow:
      inset 0 3px 0 rgba(255, 255, 255, 0.35),
      0 6px 0 #050505;
    color: #2a2622;
    font:
      700 15px / 1 "JetBrains Mono",
      monospace;
    letter-spacing: 0.14em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
      transform 0.06s,
      box-shadow 0.06s;
  }

  /* Waiting to be tapped: the key is lit, and breathes */
  .player:not(.is-loading, .is-loaded) .player-key {
    background: linear-gradient(180deg, #ff9a56, #e0651c);
    color: #2a1810;
    animation: player-ask 2.6s ease-in-out infinite;
  }

  @keyframes player-ask {
    50% {
      box-shadow:
        inset 0 3px 0 rgba(255, 255, 255, 0.35),
        0 6px 0 #050505,
        0 0 26px rgba(255, 122, 43, 0.55);
    }
  }

  .player-key:active,
  .player.is-loading .player-key,
  .player.is-playing .player-key {
    transform: translateY(5px);
    background: linear-gradient(180deg, #c4bead, #8a8476);
    box-shadow:
      inset 0 3px 0 rgba(255, 255, 255, 0.2),
      0 1px 0 #050505;
  }

  .player-key svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
  }

  /* Whose it is, in one quiet line */
  .player-credit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45em;
    margin: 2px 0 0;
    font:
      500 12px / 1 "JetBrains Mono",
      monospace;
    letter-spacing: 0.08em;
    color: #b9a888;
  }

  .player-credit b {
    min-width: 0;
    overflow: hidden;
    color: #f8e6c8;
    font:
      400 17px / 1.1 "Permanent Marker",
      cursive;
    letter-spacing: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .player .player-face {
    flex: none;
    width: 26px;
    height: 26px;
    margin-right: 0.2em;
    border: 2px solid #fbf7ea;
    border-radius: 50%;
    background: #16324a;
  }

  /* The link gone nowhere: plain words on the wood */
  .player > .player-title {
    margin: 20vh 0 0;
    font:
      400 26px / 1.1 "Permanent Marker",
      cursive;
    color: #f8e6c8;
  }

  .player-by {
    margin: 0;
    font:
      500 13px / 1.4 "JetBrains Mono",
      monospace;
  }

  /* One key for what the link is for; three signs for other ways to carry it */
  .player-ways {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 6px;
  }

  .player-way {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    box-sizing: border-box;
    border: 1px solid rgba(248, 230, 200, 0.4);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
    color: #f8e6c8;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .player-way svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
  }

  .player-way.is-whatsapp {
    border-color: rgba(37, 211, 102, 0.6);
    color: #25d366;
  }

  .player-way.is-hot {
    grid-column: 1 / -1;
    min-height: 54px;
    border-color: #ff7a2b;
    background: #ff7a2b;
    color: #2a1810;
    font:
      700 13px / 1 "JetBrains Mono",
      monospace;
    letter-spacing: 0.12em;
    text-decoration: none;
    text-transform: uppercase;
  }

  .player-flips {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .player-strip {
    min-height: 44px;
    padding: 5px 16px;
    border: 0;
    background: #e8d9a8;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    color: #2a1810;
    font:
      400 15px / 1.2 "Permanent Marker",
      cursive;
    transform: rotate(-1deg);
    cursor: pointer;
  }

  .player-flips-list:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .player-flip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid rgba(248, 230, 200, 0.3);
    border-radius: 6px;
    color: rgba(248, 230, 200, 0.85);
    font:
      500 13px / 1.2 "JetBrains Mono",
      monospace;
    text-decoration: none;
  }

  .player-flip b {
    font:
      400 16px / 1 "Permanent Marker",
      cursive;
    color: #f8e6c8;
  }

  .player :focus-visible {
    outline: 2px solid #f8e6c8;
    outline-offset: 2px;
  }

  @media (prefers-reduced-motion: reduce) {
    .player-tape,
    .player .player-key,
    .player.is-playing .player-reel {
      animation: none;
    }
  }
}

/* A phone on its side: the tape on the left; the meters, the lamps and the key on the right */
@media (max-height: 480px) and (min-width: 560px) {
  .player > * {
    max-width: 640px;
  }

  .player-deck {
    display: grid;
    /* A long title is cut short on the label; it never widens the deck */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "mark meters"
      "door meters"
      "door row"
      "door well";
    column-gap: 14px;
    align-items: center;
  }

  .player-mark {
    grid-area: mark;
  }

  .player-meters {
    grid-area: meters;
  }

  .player-door {
    grid-area: door;
  }

  .player-row {
    grid-area: row;
  }

  .player-well {
    grid-area: well;
  }

  /* No room above the door on its side: the waiting tape only tilts */
  .player-tape {
    transform: rotate(-3deg) scale(1.03);
    animation: none;
  }

  .player .player-key {
    height: 52px;
  }
}

/* ---- The pulse: what the day's beats have been like, and the way into the crate (ADR-0031) ---- */
.pulse-toast {
  position: fixed;
  right: 1.6vw;
  bottom: calc(var(--dock, 9vh) + 2vh);
  z-index: 880;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.8em;
  width: 27em;
  max-width: calc(100vw - 3.2vw);
  box-sizing: border-box;
  padding: 1.3em 1.4em 1.2em;
  border: 1px solid #4a443c;
  border-left: 0.35em solid #ff7a2b;
  border-radius: 0.5em;
  background: linear-gradient(180deg, #24201c, #151312);
  box-shadow: 0 1.4em 3em rgba(0, 0, 0, 0.65);
  color: #f4ecd6;
  font-size: clamp(11px, min(1vw, 1.6vh), 16px);
  font-family: "JetBrains Mono", monospace;
  animation: pulse-rise 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
}

@keyframes pulse-rise {
  from {
    opacity: 0;
    transform: translateY(2em);
  }
}

.pulse-line {
  margin: 0;
  padding-right: 1.4em;
  font:
    400 1.55em / 1.15 "Permanent Marker",
    cursive;
  color: #f8e6c8;
}

.pulse-line em {
  font-style: normal;
  color: #ff7a2b;
}

.pulse-sound {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}

.pulse-sound span {
  padding: 0.42em 0.6em;
  border: 1px solid #6b6257;
  border-radius: 0.2em;
  font-size: 0.74em;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.pulse-dig {
  padding: 0.95em 1.2em;
  border: 0;
  border-radius: 0.3em;
  background: #ff7a2b;
  color: #2a1810;
  font:
    700 0.8em / 1 "JetBrains Mono",
    monospace;
  letter-spacing: 0.15em;
  cursor: pointer;
}

.pulse-shut {
  position: absolute;
  top: 0.3em;
  right: 0.3em;
  padding: 0.6em;
  border: 0;
  background: none;
  color: #8b8275;
  font:
    400 1em / 1 "JetBrains Mono",
    monospace;
  cursor: pointer;
}

.pulse-dig:focus-visible,
.pulse-shut:focus-visible {
  outline: 2px solid #f4ecd6;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .pulse-toast {
    animation: none;
  }
}

/* A disk in the hand is held where he speaks from the logo: he holds his thought until it is put down */
body:has(.disk-hand) .drummer-thought.is-from-logo {
  visibility: hidden;
}

body:has(.disk-hand) .brand.is-speaking span {
  visibility: visible;
}

/* The drummer speaking from the logo's head (ADR-0060): the wordmark steps aside, and the head takes a press */
.brand.is-speaking span {
  visibility: hidden;
}

.logo-mark.is-pressable {
  pointer-events: auto;
  cursor: pointer;
  transition: filter 0.15s ease;
}

@media (hover: hover) {
  .logo-mark.is-pressable:hover {
    filter: drop-shadow(0 0 6px rgba(255, 196, 92, 0.85));
  }
}

/* ============================================================
   The desk coming on (ADR-0072). After the resting styles of the pieces
   these rules hold back, and before the touch rules.
   ============================================================ */

/* The room before its lamp is switched on (ADR-0072), in two layers over the whole desk.
   The dark itself lifts first, as a bulb warms: what it leaves is the lamp alone, a warm
   pool on the middle of the desk falling away to deep shadow at its edges, with the
   sampler throwing its shadow forward. Then the room fills in slowly while the sampler
   boots. Nothing flickers. Should the script never run, both lift by themselves. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

/* The lamp alone: its own warmth at the top, and the falloff around its pool */
body::before {
  z-index: 8999;
  background:
    radial-gradient(ellipse 34% 30% at 50% 12%, rgba(255, 196, 120, 0.17), transparent 70%),
    radial-gradient(
      ellipse 64% 72% at 50% 24%,
      transparent 0%,
      rgba(7, 4, 3, 0.36) 36%,
      rgba(7, 4, 3, 0.84) 68%,
      rgba(7, 4, 3, 0.96) 100%
    );
  opacity: 0;
  transition: opacity 2s cubic-bezier(0.45, 0, 0.25, 1);
}

body:not(.room-lit)::before {
  opacity: 1;
  animation: room-lit-anyway 2s ease-in-out 9s forwards;
}

/* The dark before the lamp */
body::after {
  z-index: 9000;
  background: #070403;
  opacity: 0;
  transition: opacity 0.9s cubic-bezier(0.3, 0, 0.2, 1);
}

body:not(.lamp-on)::after {
  opacity: 0.96;
  animation: room-lit-anyway 0.9s ease-out 8s forwards;
}

@keyframes room-lit-anyway {
  to {
    opacity: 0;
  }
}

/* Under the lamp alone the sampler throws a long shadow toward the front of the desk,
   which softens away as the room fills in */
.sampler-stage::before {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  top: 48%;
  bottom: -16%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 50% 50% at 50% 42%, rgba(0, 0, 0, 0.9), transparent 72%);
  filter: blur(14px);
  opacity: 0;
  transition: opacity 2s cubic-bezier(0.45, 0, 0.25, 1);
}

body:not(.room-lit) .sampler-stage::before {
  opacity: 1;
}

/* The keys along the desk's front edge, the drummer and what he says are not there until the
   sampler says READY: then the strip slides up and he comes into view, after the props */
.transport {
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s;
}

body:not(.powered-on) .transport {
  transform: translateY(100%);
}

body:not(.powered-on) #avatar-canvas,
body:not(.powered-on) .drummer-thought {
  opacity: 0;
}

/* Only while the desk is arriving: a bubble that comes up later comes up at once */
body.is-arriving #avatar-canvas {
  animation: come-into-view 0.5s ease-out 0.45s backwards;
}

body.is-arriving .drummer-thought {
  animation: come-into-view 0.3s ease-out 0.95s backwards;
}

@keyframes come-into-view {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  .sampler-stage::before,
  .transport {
    transition: none;
  }

  body.is-arriving #avatar-canvas,
  body.is-arriving .drummer-thought {
    animation: none;
  }
}

/* ========================================================
   THE RECORDS (ADR-0088): built-in loops, kept on records.
   Opened over the desk from the records lying on it, from
   the loop's sleeping screen, and from "Replace loop…".
   ======================================================== */
.prop-lp-fan.is-tool {
  pointer-events: auto;
  cursor: pointer;
}

.prop-lp-fan.is-tool:focus-visible {
  outline: 2px solid #ff7a1a;
  outline-offset: 6px;
}

.record-box {
  position: fixed;
  inset: 0;
  z-index: 890;
  display: grid;
  place-items: center;
  padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px
    max(16px, env(safe-area-inset-left, 0px));
  background: rgba(12, 8, 4, 0.78);
  overflow: auto;
}

.record-box-in {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 22px;
  width: min(920px, 100%);
  padding: 44px 0 8px;
}

.record-box-shut {
  position: absolute;
  top: 0;
  right: 0;
  width: 36px;
  height: 36px;
  border: 0;
  background: none;
  color: #f4ecd6;
  font:
    400 26px / 1 "JetBrains Mono",
    ui-monospace,
    monospace;
  cursor: pointer;
}

.record-sleeve {
  --sleeve: #c2410c;
  position: relative;
  width: 180px;
  aspect-ratio: 1;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: repeating-linear-gradient(45deg, var(--sleeve) 0 18px, #1a0d05 18px 36px);
  box-shadow:
    0 18px 30px -10px rgba(0, 0, 0, 0.7),
    0 6px 14px -4px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 -3px 6px rgba(0, 0, 0, 0.5);
}

button.record-sleeve {
  cursor: pointer;
  transition: transform 0.15s ease;
}

button.record-sleeve:hover,
button.record-sleeve:focus-visible {
  transform: translateY(-5px);
}

.record-sleeve:nth-of-type(4n + 2) {
  --sleeve: #3f6f6a;
}

.record-sleeve:nth-of-type(4n + 3) {
  --sleeve: #8a6a1f;
}

.record-sleeve:nth-of-type(4n + 4) {
  --sleeve: #6b3a5b;
}

.record-sleeve.is-turned {
  width: 220px;
}

/* A guest's own cover goes over the printed sleeve, name and all */
.record-sleeve img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.record-sleeve b {
  max-width: 86%;
  padding: 9px 11px;
  background: #fef3e2;
  color: #1a0d05;
  font:
    400 15px / 1 "Bowlby One",
    sans-serif;
  letter-spacing: 1px;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(-3deg);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.record-sleeve small {
  padding: 3px 7px;
  background: rgba(0, 0, 0, 0.55);
  color: #fef3e2;
  font:
    700 10px "JetBrains Mono",
    ui-monospace,
    monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.record-back {
  width: min(420px, 100%);
  padding: 16px 18px 18px;
  background: linear-gradient(180deg, #f4ecd6, #e6d8ba);
  color: #2a1f10;
  box-shadow:
    0 18px 30px -10px rgba(0, 0, 0, 0.7),
    inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.record-back h3 {
  margin: 0;
  font:
    400 20px / 1.1 "Bowlby One",
    sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.record-by {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin: 6px 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid #2a1f10;
  font:
    400 12px "JetBrains Mono",
    ui-monospace,
    monospace;
}

.record-by a {
  color: #c2410c;
  font-weight: 700;
  text-underline-offset: 3px;
}

.record-loop {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border-bottom: 1px solid rgba(42, 31, 16, 0.2);
}

.record-hear {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid #2a1f10;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.record-hear::before {
  content: "";
  margin-left: 3px;
  border: 6px solid transparent;
  border-left: 9px solid #2a1f10;
  border-right: 0;
}

.record-hear[aria-pressed="true"] {
  border-color: #c2410c;
  background: #c2410c;
}

.record-hear[aria-pressed="true"]::before {
  width: 9px;
  height: 9px;
  margin: 0;
  border: 0;
  background: #fbf3df;
}

.record-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font:
    700 13px "JetBrains Mono",
    ui-monospace,
    monospace;
  text-align: left;
  cursor: pointer;
  opacity: 0.55;
}

/* The loop USE IT takes */
.record-pick[aria-pressed="true"] {
  opacity: 1;
}

.record-pick span {
  font-weight: 400;
  font-size: 12px;
}

.record-foot {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.record-foot button {
  min-height: 40px;
  padding: 0 14px;
  border: 2px solid #2a1f10;
  border-radius: 8px;
  background: #efe4c8;
  color: #2a1f10;
  font:
    14px "Permanent Marker",
    cursive;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 3px 0 #2a1f10;
}

.record-foot .is-use {
  background: #8fd18a;
}

.record-foot button:disabled {
  opacity: 0.4;
  cursor: default;
}

.record-foot button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: none;
}

.record-box button:focus-visible,
.record-box a:focus-visible {
  outline: 2px solid #ff7a1a;
  outline-offset: 2px;
}

/* A line of a readout's list that is only read */
.sound-said {
  display: block;
  padding: 0.7em 0.9em 0.3em;
  color: #2a1f10;
  font-family: "JetBrains Mono", monospace;
  font-size: inherit;
  line-height: 1.35;
}

/* ============================================================
   The desk under a finger (ADR-0050, FR-DESK-19). Every rule here is under
   (pointer: coarse): a desk under a mouse is not changed by any of it. Keys
   are drawn bigger where the desk has room, and where it has none they keep
   their size and take a press on an unseen area around them.
   ============================================================ */
@media (pointer: coarse) {
  html {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  body {
    overscroll-behavior: none;
    -webkit-touch-callout: none;
  }

  /* An unseen press area around a key that the desk has no room to draw bigger */
  .transport-btn::after,
  .tempo-tap::after,
  .mode-btn::after,
  .swing-lock-btn::after,
  #export-menu-btn::after,
  #share-btn::after,
  .how-btn::after,
  .acct-btn::after,
  .mic-mode-btn::after,
  .mic-load-btn::after,
  .mic-input-btn::after,
  .mic-mon-btn::after {
    content: "";
    position: absolute;
    inset: var(--press, -9px 0);
  }
  .swing-lock-btn,
  #export-menu-btn,
  #share-btn,
  .how-btn,
  .acct-btn,
  .mic-mode-btn,
  .mic-load-btn,
  .mic-input-btn,
  .mic-mon-btn,
  .tempo-tap {
    position: relative;
  }
}

/* A tablet: the sampler takes the width the cables had, and the pads grow with it */
@media (pointer: coarse) and (max-width: 1199px) {
  :root {
    --sampler-w: min(97vw, 1150px);
  }
}

@media (pointer: coarse) {
  .track-row {
    grid-template-columns: clamp(158px, 12.2vw, 168px) auto auto 1fr;
    column-gap: 8px;
  }

  /* The step keys stand side by side, each the height of the plate */
  .sound-steps {
    flex-direction: row;
    gap: 2px;
  }
  .sound-step {
    width: 26px;
  }
  .sound-step::after,
  .sound-step.is-next::after {
    inset: -5px -1px;
  }
  .sound-step.is-prev::after {
    inset: -5px -1px -5px -8px;
  }
  .sound-readout {
    position: relative;
    height: 34px;
  }
  .sound-readout::before {
    content: "";
    position: absolute;
    inset: -5px 0;
  }

  .swing-lock-btn {
    width: 34px;
    height: 34px;
    --press: -5px;
  }

  /* Transport: keys a finger tall */
  .transport-btn,
  .tempo-tap {
    padding-block: 10px;
    --press: -5px 0;
  }
  .tempo-num {
    padding-block: 6px;
  }
  .mode-btn {
    padding-block: 12px 9px;
    --press: -5px 0;
  }
  /* Note repeat keeps its height (the chassis has none to spare) and is pressed above and below it */
  .note-repeat .mode-btn {
    padding: 1vh 12px 0.55vh;
    font-size: 10px;
    --press: -10px 0;
  }

  /* Mute and solo side by side: stacked, each would be half a fingertip */
  .ms-keys {
    flex-direction: row;
    gap: 4px;
  }
  .ms-key {
    position: relative;
    width: 32px;
    height: 34px;
    font-size: 11px;
  }
  .ms-key::after {
    content: "";
    position: absolute;
    inset: -5px -2px;
  }
  /* The pocket key is as wide as a drum row's two step keys, so the readouts line up */
  .vox-row .sound-pick .vox-follow-btn {
    width: 54px;
  }
  /* The sauce slot stays a slim slot under the taller plate, and is pressed well past its edges */
  .vox-dream {
    min-height: 24px;
  }
  .vox-dream-input {
    inset: -10px 0;
    height: auto;
  }
  .vox-softkeys {
    gap: 6px;
    padding-block: 5px;
  }
  .vox-soft {
    padding: 8px 8px 9px;
  }
  .vox-soft::after {
    content: "";
    position: absolute;
    inset: -6px -3px;
  }

  /* The mic's keys: two rows opened up, each key a finger tall */
  .mic-io {
    top: 20px;
    left: calc(100% + 30px);
    gap: 14px;
  }
  .mic-mode {
    top: -36px;
    gap: 6px;
  }
  .mic-mode-btn,
  .mic-load-btn {
    padding: 9px 8px;
    font-size: 9px;
    --press: -6px 0;
  }
  .mic-input-btn,
  .mic-mon-btn {
    padding-block: 8px;
    font-size: 11px;
    --press: -5px -4px;
  }
}

/* A large tablet: the name is set a touch smaller so the longest still fits beside its keys */
@media (pointer: coarse) and (min-width: 1200px) and (max-width: 1599px) {
  .sound-readout {
    font-size: 12.5px;
  }
}
