body.cassette-page {
  font-family: "Bebas Neue", "Arial Narrow", sans-serif;
  background:
    radial-gradient(800px 400px at 50% 0%, #3a2a20 0%, transparent 55%),
    #121214;
  color: #f3ead8;
}

.desk {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 8px 12px 32px;
  padding-top: max(8px, env(safe-area-inset-top));
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  margin-bottom: 8px;
}

.brand-mark {
  margin: 0;
  font-family: "Permanent Marker", "Comic Sans MS", cursive;
  font-size: 1.15rem;
  line-height: 1;
  color: #f3ead8;
}

.looks-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.looks-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 4px 9px;
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: #e8d8b0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(232, 216, 176, 0.35);
  border-radius: 999px;
}

.looks-nav a.is-current {
  background: #f3e2b8;
  color: #2a1c10;
  border-color: #f3e2b8;
}

.stage {
  display: flex;
  flex-direction: column;
}

.boombox {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(180deg, #4a4a52 0%, #2a2a30 40%, #141418 100%);
  border: 4px solid #8a8a92;
  border-radius: 16px;
  padding: 10px 10px 12px;
  box-shadow:
    inset 0 2px 0 #b0b0b8,
    inset 0 -10px 18px rgba(0, 0, 0, 0.45),
    0 16px 28px rgba(0, 0, 0, 0.5);
}

.handle {
  width: 46%;
  height: 16px;
  margin: 0 auto 2px;
  border: 4px solid #8a8a92;
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, #6a6a72, transparent 70%);
  box-shadow: inset 0 2px 0 #d0d0d6;
  flex-shrink: 0;
}

.boombox-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "sl center sr";
  gap: 8px;
  align-items: center;
  min-height: 0;
}

.speaker-left { grid-area: sl; }
.speaker-right { grid-area: sr; }
.boombox-center { grid-area: center; min-width: 0; }

.speaker {
  position: relative;
  width: min(22vw, 76px);
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #3a3a40 0 12%, transparent 13%),
    repeating-radial-gradient(circle at 50% 50%, #1a1a1e 0 1.5px, #3a3a42 1.5px 3.2px);
  box-shadow:
    inset 0 0 0 7px #2a2a30,
    0 0 0 3px #8a8a92,
    0 8px 14px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
}

.speaker .ring {
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  border: 2px solid rgba(200, 200, 210, 0.28);
  pointer-events: none;
}

.speaker .cone {
  width: 40%;
  height: 40%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #666, #111 72%);
  box-shadow: inset 0 0 8px #000;
  transform: scale(var(--thump, 1));
  transition: transform 70ms linear, box-shadow 70ms linear;
}

.speaker .cap {
  position: absolute;
  width: 16%;
  height: 16%;
  border-radius: 50%;
  background: #d0d0d6;
  box-shadow: 0 0 0 2px #2a2a2e;
  transform: scale(var(--thump-cap, 1));
  transition: transform 70ms linear;
}

.speaker .cone {
  box-shadow:
    inset 0 0 8px #000,
    0 0 calc(var(--thump-shadow, 0) * 1px) rgba(240, 220, 160, calc(var(--thump-glow, 0) * 0.45));
}

.boombox:not(.is-beating) .speaker .cone,
.boombox:not(.is-beating) .speaker .cap {
  transform: scale(1);
  transition-duration: 0s;
}

.boombox:not(.is-beating) .speaker .cone {
  box-shadow: inset 0 0 8px #000;
}

.boombox-center {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.vu {
  display: grid;
  grid-template-columns: 1fr 26px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.meter {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
  height: 12px;
  padding: 2px;
  background: #0a0a0c;
  border: 1px solid #333;
  border-radius: 3px;
}

.meter i {
  display: block;
  background: #1a3a16;
  border-radius: 1px;
  transform: scaleY(var(--vu-scale, 0.28));
  transform-origin: center bottom;
  transition: transform 70ms linear;
}

body.is-playing .meter i:nth-child(1),
body.is-playing .meter i:nth-child(2) { background: #3dff6a; }
body.is-playing .meter i:nth-child(3),
body.is-playing .meter i:nth-child(4) { background: #b6ff3d; }
body.is-playing .meter i:nth-child(5),
body.is-playing .meter i:nth-child(6) { background: #ffe23d; }
body.is-playing .meter i:nth-child(7) { background: #ff8a3d; }
body.is-playing .meter i:nth-child(8) { background: #ff3d3d; }

.boombox:not(.is-beating) .meter i {
  transform: scaleY(0.28);
  transition-duration: 0s;
}

.tune-dial {
  width: 24px;
  height: 24px;
  justify-self: center;
  border-radius: 50%;
  background: conic-gradient(#c8c8ce, #333, #eee, #222, #c8c8ce);
  box-shadow: 0 0 0 2px #8a8a92;
  position: relative;
}

.tune-dial::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 3px;
  width: 2px;
  height: 8px;
  background: #f4f0e6;
  transform: translateX(-50%);
}

.screen-well {
  padding: 5px;
  background: #0a0a0c;
  border: 3px solid #5a5a62;
  border-radius: 10px;
  min-width: 0;
}

.cassette-well {
  padding: 6px;
  background: #0e0e12;
  border: 3px solid #5a5a62;
  border-radius: 10px;
  flex-shrink: 0;
}

.deck-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg, #2a2a30, #141418);
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: inset 0 0 0 2px #3a3a42, inset 0 8px 12px rgba(0, 0, 0, 0.45);
}

.cassette {
  --tape-left: 1;
  --tape-right: 0.2;
  container-type: inline-size;
  container-name: cass;
  width: 100%;
  height: auto;
  aspect-ratio: 1.58 / 1;
  position: relative;
}

.shell {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(230, 240, 245, 0.45), rgba(150, 170, 180, 0.22)),
    linear-gradient(180deg, #c5d2d8 0%, #8ea0aa 45%, #6d8088 100%);
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 0 0 1px rgba(40, 50, 55, 0.35),
    0 6px 14px rgba(0, 0, 0, 0.35);
}

.screw {
  position: absolute;
  z-index: 5;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: conic-gradient(#d8d8d8, #666, #eee, #555, #d8d8d8);
  box-shadow: 0 0 0 1px #3a3a3a;
}

.screw-tl { top: 4px; left: 4px; }
.screw-tr { top: 4px; right: 4px; }
.screw-bl { bottom: 4px; left: 4px; }
.screw-br { bottom: 4px; right: 4px; }

.paper-label {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 7%;
  height: 24%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f3e2b8;
  border: 1px solid #2a1c10;
  border-radius: 2px;
  padding: 0 28px 0 8px;
  color: #2a1c10;
  z-index: 4;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.label-title {
  margin: 0;
  width: 100%;
  font-family: "Permanent Marker", "Comic Sans MS", cursive;
  font-size: clamp(0.95rem, 9.2cqi, 1.85rem);
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: rotate(-0.6deg);
}

.label-side {
  position: absolute;
  right: 5px;
  top: 50%;
  translate: 0 -50%;
  font-family: "Permanent Marker", "Comic Sans MS", cursive;
  font-size: clamp(0.7rem, 5.4cqi, 1.05rem);
  line-height: 1;
  color: #7a2a16;
}

.reel-window {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 34%;
  height: 46%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12%;
  align-items: center;
  justify-items: center;
  z-index: 2;
  overflow: hidden;
}

.reel-hole {
  width: 78%;
  max-width: 100%;
  aspect-ratio: 1;
  height: auto;
  max-height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #1a1410;
  box-shadow:
    inset 0 0 0 2px rgba(40, 30, 24, 0.7),
    inset 0 0 8px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
}

.reel {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.wound {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: calc(28% + var(--tape-left) * 62%);
  height: calc(28% + var(--tape-left) * 62%);
  max-width: 90%;
  max-height: 90%;
  border-radius: 50%;
  background:
    repeating-radial-gradient(
      circle at 50% 50%,
      #2a1608 0 1px,
      #6a3a18 1px 2px,
      #4a2810 2px 3px
    );
  box-shadow:
    inset 0 0 6px rgba(0, 0, 0, 0.55),
    0 0 0 1px #2a1608;
  transition: width 0.2s linear, height 0.2s linear;
}

.reel-right .wound {
  width: calc(28% + var(--tape-right) * 62%);
  height: calc(28% + var(--tape-right) * 62%);
}

.hub {
  position: relative;
  z-index: 2;
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    #f4f1ea
    repeating-conic-gradient(
      from 0deg,
      #f4f1ea 0 16deg,
      #2a2420 16deg 20deg
    );
  box-shadow:
    inset 0 0 0 3px #d8d4cc,
    0 0 0 1px #1a1410;
}

.hub::after {
  content: "";
  position: absolute;
  inset: 32%;
  border-radius: 50%;
  background: #1a1410;
}

body.is-playing .reel-left {
  animation: spin var(--spin-left, 2.6s) linear infinite;
}

body.is-playing .reel-right {
  animation: spin var(--spin-right, 1.4s) linear infinite;
}

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

.tape-window-frame {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 4%;
  height: 13%;
  background: rgba(8, 10, 12, 0.4);
  border: 1px solid rgba(20, 20, 20, 0.5);
  border-radius: 2px;
  z-index: 1;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.tape-ribbon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}

.ribbon-body {
  fill: none;
  stroke: #4a2810;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ribbon-flow {
  fill: none;
  stroke: #c9a46c;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-dasharray: 2.4 3.6;
  stroke-dashoffset: 0;
}

body.is-playing .ribbon-flow {
  animation: ribbon-flow 0.7s linear infinite;
}

@keyframes ribbon-flow {
  to { stroke-dashoffset: -26; }
}

.now-playing {
  margin: 0;
  padding: 8px 10px;
  min-height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: "Caveat", "Segoe Script", cursive;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.15;
  color: #f3e2b8;
  background: #0e0e12;
  border: 2px solid #5a5a62;
  border-radius: 8px;
}

.deck,
.deck-balanced {
  display: grid;
  grid-template-columns: 1.05fr 0.9fr 1.2fr 0.9fr 1.05fr;
  flex-shrink: 0;
  align-items: end;
  gap: 6px;
}

.deck-btn {
  min-height: 52px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: #1a1a18;
  background: linear-gradient(180deg, #eeebe4, #c4c0b6 70%, #8e8a82);
  border: 2px solid #4a4a46;
  border-radius: 4px 4px 8px 8px;
  box-shadow: inset 0 1px 0 #fff, 0 5px 0 #2a2a28;
}

.deck-btn:active {
  transform: translateY(3px);
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 #2a2a28;
}

.symbol {
  font-size: 0.8rem;
  letter-spacing: 0;
  line-height: 1;
}

.deck-play {
  background: linear-gradient(180deg, #4aa86a, #145028);
  color: #f4f0e6;
  border-color: #8ad0a0;
  box-shadow: inset 0 1px 0 #b8efc8, 0 5px 0 #0a3018;
}

.deck-play.is-playing {
  background: linear-gradient(180deg, #d4a024, #8a6010);
  border-color: #ffe08a;
}

.deck-side {
  flex-direction: row;
  font-size: 0.95rem;
  background: linear-gradient(180deg, #efe4c8, #c9a46c 70%, #8a6840);
  color: #2a1c10;
  border-color: #6a4a28;
}

.deck-btn[data-action="side-a"].is-on,
.deck-btn[data-action="side-b"].is-on {
  background: linear-gradient(180deg, #ffe9a8, #d4a024);
  border-color: #ffe08a;
  box-shadow: inset 0 1px 0 #fff4cc, 0 5px 0 #4a2800, 0 0 12px rgba(240, 200, 80, 0.55);
}

@media (min-width: 960px) {
  .desk {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 8px 16px 40px;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(40px, env(safe-area-inset-bottom));
  }

  .topbar {
    min-height: 44px;
    margin-bottom: 6px;
  }

  .stage {
    min-height: calc(100dvh - 66px);
    height: calc(100dvh - 66px);
    flex: 0 0 auto;
    display: flex;
  }

  .boombox {
    flex: 1;
    min-height: 0;
    height: 100%;
    padding: 10px 14px 12px;
  }

  .boombox-body {
    grid-template-columns: minmax(88px, 16%) minmax(0, 1fr) minmax(88px, 16%);
    grid-template-areas: "sl center sr";
    gap: 12px;
    flex: 1;
    min-height: 0;
    align-items: stretch;
  }

  .speaker {
    width: min(100%, 150px);
    align-self: center;
  }

  .boombox-center {
    min-height: 0;
    height: 100%;
  }

  .screen-well {
    flex: 1;
    min-height: 0;
    display: flex;
  }

  .screen-well .yt-frame {
    aspect-ratio: auto;
    flex: 1;
    height: auto;
    min-height: 0;
  }

  .cassette-well {
    width: min(100%, 460px);
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.is-playing .reel-left,
  body.is-playing .reel-right,
  body.is-playing .ribbon-flow,
  body.is-playing .meter i {
    animation-duration: 4s !important;
    animation-iteration-count: infinite !important;
    transition-duration: 0.6s !important;
  }

  body.is-playing .ribbon-flow {
    animation-duration: 3.2s !important;
  }

  .wound {
    transition-duration: 0.6s !important;
  }

  .speaker .cone,
  .speaker .cap,
  .meter i {
    transition-duration: 0.28s !important;
  }
}
