/* ==========================================================================
   iomega · main.css
   Two scopes: admin dashboard (dark, PS-blue, smooth) and the public album/
   deck pages (light "clay studio": warm grey, cobalt/teal/magenta drive
   colors). Tokens are redeclared inside body.page-album so var(--accent)
   etc. resolve differently per scope.
   ========================================================================== */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; padding: 0; margin: 0; }

/* ---------- global tokens (admin defaults) ---------- */
:root {
  --bg: #03050d;
  --bg-deep: #000003;
  --text: #e8e8f0;
  --text-dim: #7a7c95;
  --accent: #5ab9ff;
  --accent-glow: rgba(90, 185, 255, 0.55);
  --accent-warm: #ff3b3b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Courier New", monospace;
}

/* ---------- shared backgrounds ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(1200px 600px at 50% 0%, rgba(90, 185, 255, 0.10), transparent 60%),
    linear-gradient(180deg, #060a18 0%, #02030a 60%, #000 100%);
}
.bg-vignette {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.7) 100%);
}

/* admin-only soft scanline overlay */
body.page-admin::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

.logo { width: 140px; height: auto; filter: drop-shadow(0 0 12px var(--accent-glow)); }
.logo-sm { width: 96px; }


/* ==========================================================================
   ADMIN (release manager)
   ========================================================================== */

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--line);
}
.admin-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.4rem 0.75rem;
  background: rgba(90, 185, 255, 0.05);
}
.admin-main {
  max-width: 1100px;
  margin: 2.5rem auto 4rem;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}
.admin-section-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.5em;
  color: var(--text-dim);
  margin: 0 0 1.25rem;
}
.stat-counts {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  color: var(--text);
  margin: 0 0 0.5rem;
}
.stat-counts strong { color: var(--accent); font-weight: 600; }
.admin-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin: 0;
}

.release-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.release {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  transition: border-color 200ms ease, background 200ms ease;
}
.release:hover { border-color: var(--line-strong); }
.release.is-live    { border-left: 3px solid var(--accent); }
.release.is-scaffold { border-left: 3px solid #3a3d50; }
@media (max-width: 600px) {
  .release { grid-template-columns: 1fr; }
  .release-cover { width: 100%; max-width: 220px; height: auto; aspect-ratio: 1/1; }
}

.release-cover {
  width: 140px;
  height: 140px;
  background: #0a0c1c;
  overflow: hidden;
  border: 1px solid var(--line);
}
.release-cover img { width: 100%; height: 100%; object-fit: cover; }

.release-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.release-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
}
.release-title { margin: 0; font-size: 1.2rem; letter-spacing: 0.02em; }
.release-cat {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.25em;
}
.release-status {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--line-strong);
  color: var(--text-dim);
}
.release.is-live .release-status {
  color: var(--accent);
  border-color: var(--accent);
  text-shadow: 0 0 6px var(--accent-glow);
}

.release-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 600px) { .release-grid { grid-template-columns: 1fr; } }
.release-grid h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  margin: 0 0 0.5rem;
  font-weight: 400;
}
.checks {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.check {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}
.check.is-set { color: var(--text); }
.release-base {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0;
  word-break: break-all;
}
.release-base code {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}
.release-base em { opacity: 0.6; font-style: normal; }

.release-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}
.release-url {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  flex: 1;
  min-width: 200px;
  word-break: break-all;
}
.copy-btn, .open-btn {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  transition: color 150ms ease, border-color 150ms ease;
}
.copy-btn:hover, .open-btn:hover { color: var(--accent); border-color: var(--accent); }

.howto-steps {
  list-style: decimal;
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.6;
}
.howto-steps code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  color: var(--text);
  font-size: 0.85rem;
}
.admin-footer {
  padding: 2rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.3em;
  border-top: 1px solid var(--line);
}


/* ==========================================================================
   ALBUM + DECK — CLAY STUDIO
   Light warm-grey "unpainted render" world after the room-reference plates.
   The only saturated things on a page are the drive colors: cobalt body,
   teal dot, magenta slot. Contemporary + high end, yet playful: springy
   hovers, breathing magenta beacons, lowercase display type.
   Scoped to body.page-album (deck carries page-album + page-deck).
   ========================================================================== */

body.page-album {
  /* clay palette */
  --paper: #e4e4e6;
  --paper-2: #d7d8da;
  --card: #f6f6f7;
  --ink: #191a1d;
  --ink-soft: #55575e;
  --ink-faint: #9a9ca3;
  --line: rgba(25, 26, 29, 0.10);
  --line-strong: rgba(25, 26, 29, 0.20);

  /* drive colors */
  --cobalt: #5661e0;
  --cobalt-deep: #3f49c4;
  --teal: #46d4bd;
  --teal-deep: #0d8f7b;
  --magenta: #e93ce0;

  --accent: var(--cobalt);
  --accent-glow: rgba(86, 97, 224, 0.35);

  --shadow-1: 0 1px 2px rgba(23, 24, 27, 0.05), 0 8px 24px rgba(23, 24, 27, 0.09);
  --shadow-2: 0 2px 6px rgba(23, 24, 27, 0.07), 0 20px 50px rgba(23, 24, 27, 0.16);
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 9px;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --f-sans: "Inter", "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --f-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  -webkit-font-smoothing: antialiased;
}

/* soft studio light instead of the old aquatic CRT gradient */
body.page-album .bg-grid {
  background:
    radial-gradient(1100px 520px at 50% -6%, rgba(255, 255, 255, 0.9), transparent 65%),
    radial-gradient(900px 700px at 82% 110%, rgba(86, 97, 224, 0.07), transparent 60%),
    linear-gradient(180deg, #e9e9eb 0%, #e0e1e3 55%, #d6d7d9 100%);
}
body.page-album .bg-vignette {
  background: radial-gradient(ellipse at center, transparent 62%, rgba(23, 24, 27, 0.10) 100%);
}

/* state machine (unchanged contract) */
.page-album section { display: none; }
.page-album.state-start  #start-screen { display: flex; }
.page-album.state-intro  #intro        { display: flex; }
.page-album.state-player #player       { display: block; }

/* tiny tracked label utility look, reused across chips */
.player-cat, .mode-badge, .presence-chip,
.deck-section-title, .deck-readout, .unlock-title,
.memcard-title, .start-subtitle, .player-artist {
  font-family: var(--f-mono);
  text-transform: uppercase;
}

/* ---------- pills & buttons ---------- */
.pill {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-1);
  transition: transform 200ms var(--spring), border-color 150ms ease, color 150ms ease, box-shadow 200ms ease;
}
.pill:hover {
  transform: translateY(-2px);
  color: var(--cobalt);
  border-color: var(--cobalt);
}
.pill:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(23, 24, 27, 0.08); }

.skip-btn {
  position: fixed;
  bottom: 1.4rem;
  right: 1.4rem;
  z-index: 50;
  padding: 0.55rem 1.1rem;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  background: rgba(246, 246, 247, 0.82);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  transition: color 150ms ease, border-color 150ms ease;
}
.skip-btn:hover { color: var(--ink); border-color: var(--line-strong); }


/* ---------- start screen ---------- */
.start-screen {
  position: fixed; inset: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.start-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  text-align: center;
}
.start-kicker {
  margin: 0;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.start-title {
  margin: 0;
  font-weight: 650;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.start-subtitle {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.26em;
  color: var(--ink-soft);
}
.press-start {
  margin-top: 2.2rem;
  padding: 1rem 2.6rem;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fff;
  background: var(--cobalt);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(86, 97, 224, 0.35), 0 2px 6px rgba(23, 24, 27, 0.12);
  transition: transform 220ms var(--spring), box-shadow 220ms ease, background 150ms ease;
  animation: beacon 3s ease-in-out infinite;
}
.press-start:hover {
  transform: translateY(-3px) scale(1.03);
  background: var(--cobalt-deep);
}
.press-start:active { transform: translateY(0) scale(0.99); }
@keyframes beacon {
  0%, 100% { box-shadow: 0 10px 30px rgba(86, 97, 224, 0.35), 0 2px 6px rgba(23, 24, 27, 0.12), 0 0 0 0 rgba(233, 60, 224, 0); }
  50%      { box-shadow: 0 10px 30px rgba(86, 97, 224, 0.35), 0 2px 6px rgba(23, 24, 27, 0.12), 0 0 34px 4px rgba(233, 60, 224, 0.30); }
}


/* ---------- intro (Blender video OR splash fallback) ---------- */
.intro {
  position: fixed; inset: 0;
  align-items: center; justify-content: center;
  background: var(--paper);
  overflow: hidden;
}
.intro-video { max-width: 100%; max-height: 100%; }

/* CSS stand-in for the render: blue drive on clay, disk drops into the slot */
.intro-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(900px 480px at 50% 0%, rgba(255, 255, 255, 0.85), transparent 60%),
    linear-gradient(180deg, #e7e7e9 0%, #dcdddf 60%, #cfd0d3 100%);
}
.splash-scene {
  position: relative;
  width: min(680px, 92vw);
  aspect-ratio: 16 / 11;
  perspective: 1400px;
  perspective-origin: 50% 40%;
  transform-style: preserve-3d;
  z-index: 2;
}
.splash-drive {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  width: 52%;
  aspect-ratio: 1.45 / 1;
  height: auto;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.35), transparent 55%),
    var(--cobalt);
  border: 0;
  border-radius: 36px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    inset 0 -14px 24px rgba(35, 40, 120, 0.35),
    0 24px 40px rgba(23, 24, 27, 0.30),
    0 6px 12px rgba(23, 24, 27, 0.18);
  z-index: 2;
}
.splash-drive::after {           /* the teal dot */
  content: "";
  position: absolute;
  left: 50%;
  top: 34%;
  width: 17%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--teal);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.16), 0 0 18px rgba(70, 212, 189, 0.45);
}
.splash-slot {
  position: absolute;
  top: 72%;
  left: 14%;
  right: 14%;
  height: 9%;
  background: #1c1d22;
  border: 0;
  border-radius: 999px;
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.8),
    0 0 16px rgba(233, 60, 224, 0.55),
    inset 0 0 10px rgba(233, 60, 224, 0.65);
}
.splash-brand {
  position: absolute;
  bottom: 7%;
  left: 12%;
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.34em;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: none;
}
.splash-led {
  position: absolute;
  bottom: 9%;
  right: 12%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: 0;
}
.splash-disk-anchor {
  position: absolute;
  left: 50%;
  top: 30%;
  width: 190px;
  height: 190px;
  margin-left: -95px;
  margin-top: -95px;
  transform-style: preserve-3d;
  z-index: 3;
}
.splash-disk {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform, opacity;
}
.splash-disk-label {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: cover;
  background: #23252e;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.25),
    0 18px 36px rgba(23, 24, 27, 0.35);
}
.splash-readout {
  position: absolute;
  bottom: 4%;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
  opacity: 0;
  z-index: 5;
}

.intro-fallback:not([hidden]) .splash-disk {
  animation: insertDisk 4.6s cubic-bezier(0.5, 0, 0.3, 1) forwards;
}
.intro-fallback:not([hidden]) .splash-led {
  animation: ledBlink 0.5s ease 3s 5 alternate forwards;
}
.intro-fallback:not([hidden]) .splash-readout {
  animation: readoutFade 0.6s ease 3.4s forwards;
}
@keyframes insertDisk {
  0%   { transform: translate3d(0, -70px, 120px) rotateX(8deg)  scale(1.02); opacity: 0; }
  10%  { opacity: 1; }
  40%  { transform: translate3d(0, 150px, 60px)  rotateX(35deg) scale(0.8); opacity: 1; }
  70%  { transform: translate3d(0, 255px, 10px)  rotateX(72deg) scale(0.55); opacity: 1; }
  88%  { transform: translate3d(0, 295px, -10px) rotateX(80deg) scale(0.5);  opacity: 0.6; }
  100% { transform: translate3d(0, 310px, -16px) rotateX(82deg) scale(0.48); opacity: 0; }
}
@keyframes ledBlink {
  from { background: rgba(255, 255, 255, 0.35); box-shadow: none; }
  to   { background: var(--teal); box-shadow: 0 0 10px rgba(70, 212, 189, 0.9); }
}
@keyframes readoutFade { from { opacity: 0; } to { opacity: 1; } }


/* ==========================================================================
   PLAYER — light sleeve
   ========================================================================== */

.player {
  position: relative;
  display: block;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(16px, 3vh, 32px) clamp(20px, 4vw, 56px) clamp(24px, 4vh, 48px);
  isolation: isolate;
}

/* HEADER */
.player-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(16px, 3vh, 36px);
}
.player-cat {
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--ink-soft);
  padding: 7px 14px 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-1);
}
.mode-badge {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.22em;
  padding: 7px 14px 6px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
body.page-album.is-owned .mode-badge {
  color: var(--teal-deep);
  border-color: rgba(70, 212, 189, 0.7);
  background: rgba(70, 212, 189, 0.14);
}
.eject {
  font-size: 10px;
  padding: 8px 18px 7px;
}

/* STAGE */
.player-stage {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 1.1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  margin-bottom: clamp(20px, 4vh, 36px);
}

.disc-tray {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  justify-self: center;
  filter: drop-shadow(0 24px 30px rgba(23, 24, 27, 0.28));
}
.disc-tray::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    conic-gradient(from 210deg,
      #fdfdfe 0deg, #e6e7e9 70deg, #f4f4f6 130deg,
      #dcdde0 190deg, #f7f7f9 260deg, #e2e3e6 320deg, #fdfdfe 360deg);
  box-shadow: inset 0 0 0 1px rgba(25, 26, 29, 0.12);
}
.disc-label {
  position: absolute;
  inset: 6%;
  width: 88%;
  height: 88%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--card);
  box-shadow:
    inset 0 0 0 1px rgba(25, 26, 29, 0.14),
    0 0 0 4px rgba(255, 255, 255, 0.5);
  --spin-speed: 4s;
  animation: disc-spin var(--spin-speed) linear infinite;
  animation-play-state: paused;
}
.disc-tray::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12%;
  height: 12%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--card);
  box-shadow:
    inset 0 1px 3px rgba(23, 24, 27, 0.25),
    0 0 0 1px rgba(25, 26, 29, 0.14);
  pointer-events: none;
  z-index: 2;
}
@keyframes disc-spin { to { transform: rotate(360deg); } }
.player.is-playing .disc-label { animation-play-state: running; }
.player:not(.is-playing) .disc-label { filter: saturate(0.75) brightness(0.97); }

/* TRACKLIST */
.tracklist-wrap { min-width: 0; }
.player-meta { margin-bottom: 16px; }
.player-title {
  margin: 0 0 6px;
  font-weight: 650;
  font-size: clamp(28px, 4.2vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.player-artist {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.26em;
  color: var(--ink-soft);
}
.player-artist[data-year]:not([data-year=""])::after {
  content: " · " attr(data-year);
  color: var(--ink-faint);
}
.player-edition {
  margin: 8px 0 0;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--teal-deep);
}
body.page-album.is-preview .player-edition { color: var(--ink-faint); }

.tracklist {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  max-height: min(46vh, 360px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-faint) transparent;
}
.track {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 12px 18px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  transition: background 140ms ease, color 140ms ease;
}
.track:last-child { border-bottom: 0; }
.track:hover { background: rgba(86, 97, 224, 0.06); color: var(--ink); }
.track-num {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.track-title {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-time {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.track.is-current {
  background: rgba(86, 97, 224, 0.10);
  color: var(--ink);
}
.track.is-current .track-num { color: var(--cobalt); }
.track.is-current .track-title { font-weight: 600; }
.track.is-current .track-time  { color: var(--ink-soft); }
.track.is-current .track-num::before {
  content: "● ";
  font-size: 8px;
  color: var(--teal);
  vertical-align: 1px;
}
.player.is-playing .track.is-current .track-num::before {
  animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* CONTROLS */
.player-controls {
  position: relative;
  z-index: 2;
  max-width: 920px;
  margin: 0 auto clamp(14px, 3vh, 24px);
}
.time-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
.time {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  min-width: 48px;
  text-align: center;
}
.progress {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(25, 26, 29, 0.12);
  cursor: pointer;
}
.progress-fill {
  position: relative;
  height: 100%;
  width: var(--progress, 0%);
  border-radius: 999px;
  background: var(--cobalt);
}
.progress-fill::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--cobalt);
  box-shadow: 0 1px 4px rgba(23, 24, 27, 0.25);
}

.buttons-row {
  display: grid;
  grid-template-columns: repeat(3, auto) 1fr;
  gap: 14px;
  align-items: center;
  justify-items: center;
}
.ctl-btn {
  appearance: none;
  cursor: pointer;
  font-size: 13px;
  width: 46px;
  height: 46px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  box-shadow: var(--shadow-1);
  transition: transform 200ms var(--spring), color 150ms ease, border-color 150ms ease;
}
.ctl-btn:hover  { transform: translateY(-2px); color: var(--cobalt); border-color: var(--cobalt); }
.ctl-btn:active { transform: translateY(0); }

.ctl-play {
  width: 64px;
  height: 64px;
  color: #fff;
  font-size: 0;
  background: var(--cobalt);
  border: 0;
  box-shadow: 0 10px 26px rgba(86, 97, 224, 0.4), 0 2px 6px rgba(23, 24, 27, 0.12);
}
.ctl-play:hover { color: #fff; background: var(--cobalt-deep); }
.ctl-play::before { font-size: 19px; }
.player.is-playing       .ctl-play::before { content: "❚❚"; letter-spacing: -0.05em; }
.player:not(.is-playing) .ctl-play::before { content: "▶"; margin-left: 3px; }

.volume {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  max-width: 150px;
  height: 16px;
  background: transparent;
  margin: 0 0 0 12px;
  cursor: pointer;
  justify-self: end;
}
.volume::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background:
    linear-gradient(to right,
      var(--cobalt) 0%,
      var(--cobalt) var(--vol, 70%),
      rgba(25, 26, 29, 0.14) var(--vol, 70%),
      rgba(25, 26, 29, 0.14) 100%);
}
.volume::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background:
    linear-gradient(to right,
      var(--cobalt) 0%,
      var(--cobalt) var(--vol, 70%),
      rgba(25, 26, 29, 0.14) var(--vol, 70%),
      rgba(25, 26, 29, 0.14) 100%);
}
.volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--cobalt);
  box-shadow: 0 1px 4px rgba(23, 24, 27, 0.25);
  cursor: pointer;
}
.volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--cobalt);
  cursor: pointer;
}

/* DOWNLOAD */
.download-btn {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 340px;
  margin: 0 auto;
  padding: 14px 28px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  background: var(--cobalt);
  box-shadow: 0 10px 26px rgba(86, 97, 224, 0.35), 0 2px 6px rgba(23, 24, 27, 0.12);
  transition: transform 200ms var(--spring), background 150ms ease;
}
.download-btn:hover  { transform: translateY(-2px); background: var(--cobalt-deep); }
.download-btn:active { transform: translateY(0); }
.download-btn.is-disabled {
  background: var(--paper-2);
  color: var(--ink-faint);
  box-shadow: none;
  pointer-events: none;
}
.download-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.download-row .download-btn { margin: 0; }
.files-btn {
  padding: 12px 20px;
  cursor: pointer;
}
/* preview mode: the mail button is a nudge toward the code, not a promise */
.page-album.is-preview .files-btn { color: var(--ink-faint); }

/* FILES SHEET (download / email me the link) — shared by album page + /ar/ */
.filesheet-panel { text-align: left; }
.filesheet-album {
  margin: 0 0 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.filesheet-album b { color: var(--ink); font-weight: 600; }
.filesheet .memcard-copy { margin-bottom: 18px; }
.filesheet-dl { max-width: none; margin: 0 0 14px; }
.filesheet-mail { justify-content: flex-start; margin: 0 0 6px; }
.filesheet-mail[hidden] { display: none; }
.filesheet-mail .unlock-input {
  flex: 1 1 180px;
  min-width: 0;
  text-transform: none;      /* it's an email, not a code */
  text-align: left;
  letter-spacing: 0.03em;
  font-size: 13px;
}
.filesheet-mail .unlock-input::placeholder { text-transform: none; }

/* CLAIM (arrival by tap: /deck/?insert=CODE) */
.claim-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 6px;
}
.claim-actions [hidden] { display: none; }
.claim-fine {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}
.filesheet-fine {
  margin: 8px 0 18px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}
.filesheet-fine[hidden] { display: none; }
.filesheet .memcard-btn { display: block; margin: 0 auto; }

/* MOBILE */
@media (max-width: 720px) {
  .player { padding: 16px 14px 28px; }
  .player-stage { grid-template-columns: 1fr; gap: 20px; }
  .disc-tray { max-width: 230px; }
  .player-title { font-size: 30px; }
  .tracklist { max-height: 38vh; }
  .buttons-row {
    grid-template-columns: repeat(3, auto);
    grid-template-rows: auto auto;
    gap: 12px 14px;
  }
  .volume {
    grid-column: 1 / -1;
    max-width: 100%;
    margin: 4px 0 0;
    justify-self: stretch;
  }
  .ctl-btn { width: 44px; height: 44px; }
  .ctl-play { width: 58px; height: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  .disc-label,
  .press-start,
  .player.is-playing .track.is-current .track-num::before,
  .intro-fallback:not([hidden]) .splash-disk,
  .intro-fallback:not([hidden]) .splash-led { animation: none !important; }
}


/* ==========================================================================
   OWNERSHIP — preview vs owned states on the album page
   ========================================================================== */

.track.is-locked { cursor: not-allowed; }
.track.is-locked .track-title,
.track.is-locked .track-num { color: var(--ink-faint); opacity: 0.6; }
.track.is-locked .track-time {
  color: var(--ink-faint);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 9px;
  opacity: 0.8;
}
.track.is-locked:hover { background: transparent; color: var(--ink-faint); }

/* ---------- INSERT DISK panel ---------- */
.unlock {
  position: relative;
  z-index: 2;
  max-width: 560px;
  margin: 0 auto clamp(14px, 3vh, 24px);
  padding: 22px 24px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-1);
  text-align: center;
}
/* nested <section> would be hidden by the album state machine — re-show it */
.page-album.state-player #player .unlock { display: block; }
.page-album.is-owned #player .unlock { display: none; }

.unlock-title {
  margin: 0 0 4px;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink);
}
.unlock-title::before {
  content: "● ";
  font-size: 9px;
  color: var(--magenta);
  vertical-align: 1px;
}
.unlock-hint {
  margin: 0 0 16px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}
.unlock-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.unlock-input {
  font-family: var(--f-mono);
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 12px 16px;
  width: min(300px, 100%);
  text-align: center;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.unlock-input::placeholder { color: var(--ink-faint); }
.unlock-input:focus {
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgba(86, 97, 224, 0.18);
}
.unlock-btn {
  font-size: 11px;
  padding: 12px 22px;
  color: #fff;
  background: var(--cobalt);
  border: 0;
}
.unlock-btn:hover { color: #fff; background: var(--cobalt-deep); border: 0; }
.unlock-msg {
  margin: 12px 0 0;
  min-height: 1.2em;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}
.unlock-msg.is-ok    { color: var(--teal-deep); }
.unlock-msg.is-error { color: #d43c2e; }

.unlock.is-nudged { animation: nudge 0.4s ease 2; }
@keyframes nudge {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-6px); }
  75%  { transform: translateX(6px); }
  100% { transform: translateX(0); }
}

/* ---------- MEMORY CARD overlay ---------- */
.memcard {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(228, 228, 230, 0.72);
  backdrop-filter: blur(10px);
}
.memcard[hidden] { display: none; }
.memcard-panel {
  width: min(460px, 100%);
  padding: 30px 28px 26px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fff;
  box-shadow: var(--shadow-2);
}
.memcard-title {
  margin: 0 0 14px;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink);
}
.memcard-title::before {
  content: "● ";
  font-size: 9px;
  color: var(--teal);
  vertical-align: 1px;
}
.memcard-copy {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.memcard-copy code {
  font-family: var(--f-mono);
  color: var(--cobalt);
  font-size: 12px;
}
.memcard-code {
  margin: 0 0 20px;
  padding: 14px 12px;
  font-family: var(--f-mono);
  font-size: clamp(14px, 4vw, 18px);
  letter-spacing: 0.12em;
  color: var(--cobalt);
  border: 1.5px dashed var(--cobalt);
  border-radius: var(--r-md);
  background: rgba(86, 97, 224, 0.05);
  user-select: all;
}
.memcard-btn {
  font-size: 11px;
  padding: 11px 24px;
}
.memcard-status { margin-bottom: 6px; }
.memcard .unlock-form { margin-bottom: 4px; }
.memcard .unlock-input { width: min(260px, 100%); font-size: 12px; }


/* ==========================================================================
   DECK — the listening room (/deck). Inherits page-album tokens.
   ========================================================================== */

.page-deck.state-boot #boot { display: flex; }
.page-deck.state-deck #deck { display: block; }
.page-deck.state-deck #deck section { display: block; }

/* ---------- boot splash ---------- */
.boot {
  position: fixed;
  inset: 0;
  background: var(--paper);
  align-items: center;
  justify-content: center;
}
.boot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  text-align: center;
}
.boot-word {
  margin: 0;
  font-weight: 650;
  font-size: clamp(2.6rem, 8vw, 4rem);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
}
.boot-dot {
  display: inline-block;
  width: 0.17em;
  height: 0.17em;
  margin-left: 0.09em;
  border-radius: 50%;
  background: var(--teal);
}
.boot-tag {
  margin: 0;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.boot-status {
  margin: 2.4rem 0 0;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  min-height: 1.4em;
}
.boot-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--magenta);
  animation: pulse-dot 1.2s ease-in-out infinite;
}

/* ---------- deck shell ---------- */
.deck {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(16px, 3vh, 32px) clamp(20px, 4vw, 56px) clamp(24px, 4vh, 48px);
}
.deck-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: clamp(18px, 3vh, 32px);
}
.deck-brandmark {
  font-weight: 650;
  font-size: 20px;
  letter-spacing: -0.03em;
  color: var(--ink);
  white-space: nowrap;
}
.deck-brandmark::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 3px;
  border-radius: 50%;
  background: var(--teal);
}
.deck-title {
  margin: 0;
  font-weight: 450;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--ink-faint);
}
.memcard-open {
  margin-left: auto;
  font-size: 10px;
  padding: 9px 16px 8px;
}
.deck-section-title {
  margin: 0 0 14px;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
}
.deck-count { color: var(--cobalt); }

/* ---------- the drive zone ---------- */
.deck-drive-zone {
  position: relative;
  margin: 0 auto clamp(28px, 5vh, 48px);
  width: min(620px, 100%);
}

/* 2D fallback drive — the blue zip drive, face on */
.deck-drive {
  position: relative;
  height: clamp(96px, 15vw, 128px);
  border: 0;
  border-radius: 30px;
  background:
    radial-gradient(130% 100% at 50% 0%, rgba(255, 255, 255, 0.35), transparent 55%),
    var(--cobalt);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    inset 0 -12px 22px rgba(35, 40, 120, 0.35),
    0 20px 36px rgba(23, 24, 27, 0.25),
    0 4px 10px rgba(23, 24, 27, 0.14);
}
.deck-drive::after {           /* teal dot */
  content: "";
  position: absolute;
  right: 9%;
  top: 24%;
  width: clamp(18px, 3.4vw, 26px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.16), 0 0 14px rgba(70, 212, 189, 0.4);
}
.deck-slot {
  position: absolute;
  top: 38%;
  left: 8%;
  right: 22%;
  height: 13%;
  background: #1c1d22;
  border: 0;
  border-radius: 999px;
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.8),
    0 0 14px rgba(233, 60, 224, 0.5),
    inset 0 0 9px rgba(233, 60, 224, 0.6);
}
.deck-brand {
  position: absolute;
  bottom: 13%;
  left: 9%;
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.34em;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: none;
}
.deck-led {
  position: absolute;
  bottom: 16%;
  right: 10.5%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: 0;
}
.deck-led.is-busy { animation: ledBusy 0.4s ease infinite alternate; }
@keyframes ledBusy {
  from { background: rgba(255, 255, 255, 0.35); box-shadow: none; }
  to   { background: var(--magenta); box-shadow: 0 0 10px rgba(233, 60, 224, 0.8); }
}
.deck-readout {
  margin: 16px 0 0;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}
body.is-inserting .deck-readout { color: var(--magenta); }

/* flying disk during 2D insert */
.deck-stage {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  perspective: 900px;
}
.fly-disk {
  position: absolute;
  left: 50%;
  top: 0;
  width: 140px;
  aspect-ratio: 1 / 1.08;
  margin-left: -70px;
  border-radius: 10px;
  background: #23252e;
  box-shadow: 0 14px 30px rgba(23, 24, 27, 0.4);
  overflow: hidden;
}
body.is-inserting .fly-disk { animation: deckInsert 1.6s cubic-bezier(0.5, 0, 0.3, 1) forwards; }
@keyframes deckInsert {
  0%   { transform: translateY(240px) scale(1.05) rotateX(0deg);  opacity: 1; }
  30%  { transform: translateY(-40px) scale(1)    rotateX(18deg); opacity: 1; }
  55%  { transform: translateY(6px)   scale(0.62) rotateX(64deg); opacity: 1; }
  78%  { transform: translateY(26px)  scale(0.5)  rotateX(78deg); opacity: 1; }
  92%  { transform: translateY(34px)  scale(0.46) rotateX(82deg); opacity: 0.4; }
  100% { transform: translateY(38px)  scale(0.44) rotateX(84deg); opacity: 0; }
}

/* ---------- caddy / zip disks (2D fallback grid) ---------- */
.caddy-section { margin-bottom: clamp(28px, 5vh, 48px); }
.caddy {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: clamp(14px, 2.5vw, 24px);
}
.disk-slot { display: flex; flex-direction: column; gap: 9px; }

.disk {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.08;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #23252e;
  box-shadow: var(--shadow-1);
  overflow: hidden;
  cursor: pointer;
  transition: transform 220ms var(--spring), box-shadow 220ms ease;
}
.disk:hover  { transform: translateY(-5px) rotate(-0.5deg); box-shadow: var(--shadow-2); }
.disk:active { transform: translateY(-1px); }

.disk-shutter {
  position: absolute;
  top: 0;
  left: 22%;
  right: 22%;
  height: 11%;
  background: linear-gradient(180deg, #d6d7da 0%, #aeb0b6 100%);
  border-radius: 0 0 5px 5px;
}
.disk-window {
  position: absolute;
  top: 22%;
  left: 50%;
  width: 52%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #17181b;
}
.disk-window img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.disk-mystery {
  font-family: var(--f-mono);
  font-size: clamp(26px, 5vw, 36px);
  color: rgba(255, 255, 255, 0.28);
}
.disk-strip {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 6%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px 5px;
  background: #f2f2f4;
  border-radius: 7px;
}
.disk-name {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.disk-unit {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.disk-caption {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-align: center;
  color: var(--ink-faint);
}
.disk-slot.is-owned .disk-caption { color: var(--teal-deep); }

.disk-slot.is-missing .disk {
  background: #c6c7cb;
  box-shadow: none;
  border: 1px dashed var(--line-strong);
}
.disk-slot.is-missing .disk:hover { transform: translateY(-3px); }
.disk-slot.is-missing .disk-shutter { background: #b5b6bb; }
.disk-slot.is-missing .disk-window { background: #b0b1b6; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35); }
.disk-slot.is-missing .disk-mystery { color: rgba(25, 26, 29, 0.3); }
.disk-slot.is-missing .disk-strip { background: rgba(255, 255, 255, 0.55); }
.disk-slot.is-missing .disk-name,
.disk-slot.is-missing .disk-unit { color: var(--ink-faint); }

/* ---------- items ---------- */
.items-section { margin-bottom: clamp(28px, 5vh, 48px); }
.items {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.item {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 12px;
  align-items: baseline;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--f-mono);
}
.item:last-child { border-bottom: 0; }
.item-icon { font-size: 13px; color: var(--cobalt); }
.item-name {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-from {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}
.item-state {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 4px 10px 3px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-faint);
}
.item.is-unlocked .item-state {
  color: var(--teal-deep);
  border-color: rgba(70, 212, 189, 0.7);
  background: rgba(70, 212, 189, 0.13);
}
.item.is-locked { opacity: 0.55; }
.item.is-locked .item-icon { color: var(--ink-faint); }
.item.is-meta .item-icon { color: #d9a13b; }
.item.is-meta.is-unlocked .item-state {
  color: #a06f16;
  border-color: rgba(217, 161, 59, 0.7);
  background: rgba(217, 161, 59, 0.14);
}

.deck-footer {
  padding-top: 18px;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
  .deck-header { flex-wrap: wrap; row-gap: 8px; }
  .deck-title { flex: 1 1 auto; }
  .caddy { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .item { grid-template-columns: 22px 1fr auto; }
  .item-from { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .unlock.is-nudged,
  .deck-led.is-busy,
  .boot-status::before,
  body.is-inserting .fly-disk { animation: none !important; }
}

/* ---------- 3D scene (room3d.js enhancement) ----------
   When WebGL2 is available the room renders as a Three.js diorama in a
   rounded viewport card and the 2D drive + caddy hide. Items and overlays
   stay DOM. */
.deck-scene {
  width: 100%;
  height: clamp(380px, 58vh, 600px);
  touch-action: manipulation;
}
.deck-scene canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
body.has-3d .deck-drive-zone { width: 100%; }
/* must out-specify `.page-deck.state-deck #deck section` (the state machine) */
body.page-deck.has-3d #deck .deck-drive,
body.page-deck.has-3d #deck .deck-stage,
body.page-deck.has-3d #deck .caddy-section { display: none; }
body.has-3d .deck-readout { margin-top: 12px; }
@media (max-width: 720px) {
  .deck-scene { height: clamp(300px, 46vh, 420px); }
}
/* THE BEDROOM is fullscreen — the page becomes a window into it and the UI
   floats on top. (The 2D fallback keeps the normal card layout.) */
.deck-scene.deck-room {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 1;
}
body.page-deck.has-3d #deck { max-width: none; padding: 0; }
body.page-deck.has-3d .deck-drive-zone { width: 100%; margin: 0; }
body.page-deck.has-3d .deck-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  margin: 0;
  padding: 16px 22px;
  pointer-events: none;
}
body.page-deck.has-3d .deck-header > * { pointer-events: auto; }
body.page-deck.has-3d .deck-brandmark { color: rgba(246, 243, 236, 0.95); text-shadow: 0 1px 10px rgba(10, 10, 14, 0.55); }
body.page-deck.has-3d .deck-title { color: rgba(246, 243, 236, 0.6); text-shadow: 0 1px 10px rgba(10, 10, 14, 0.55); }
body.page-deck.has-3d .deck-readout {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 20;
  margin: 0;
  max-width: calc(100% - 32px);
  padding: 9px 18px;
  border-radius: 999px;
  color: rgba(246, 243, 236, 0.85);
  background: rgba(18, 18, 24, 0.42);
  backdrop-filter: blur(8px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.page-deck.has-3d.dock-open .deck-readout { bottom: 104px; }
body.page-deck.has-3d .items-section,
body.page-deck.has-3d .deck-footer { display: none; }
body.page-deck.has-3d.show-items .items-section {
  display: block;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 210;
  width: min(680px, calc(100% - 40px));
  max-height: 70vh;
  overflow-y: auto;
  margin: 0;
  padding: 22px;
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow-2);
  scrollbar-width: thin;
}
.items-open { font-size: 10px; padding: 9px 16px 8px; margin-left: auto; }
.items-open[hidden] { display: none; }
body.page-deck.has-3d .memcard-open { margin-left: 0; }

/* touch thumb-pad (created by world.js on coarse-pointer devices) */
.joy {
  position: fixed;
  left: 22px;
  bottom: 26px;
  z-index: 30;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(18, 18, 24, 0.28);
  backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px rgba(246, 243, 236, 0.18);
  touch-action: none;
  transition: opacity 200ms ease;
  opacity: 0.75;
}
.joy.is-live { opacity: 1; }
.joy-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(246, 243, 236, 0.55);
  box-shadow: 0 2px 10px rgba(10, 10, 14, 0.4);
  pointer-events: none;
}
body.dock-open .joy { bottom: 150px; }
@media (max-width: 860px) { body.dock-open .joy { bottom: 170px; } }
@media (max-width: 720px) {
  body.page-deck.has-3d.dock-open .deck-readout { bottom: 132px; }
}

/* ---------- in-room player dock ----------
   Slides up from the bottom once a disk is inserted; the deck stays on
   screen behind it (the room IS the album page now — "full album →" is the
   way out to /a/<slug>). */
.dock {
  --progress: 0%;
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 0);
  z-index: 150;
  width: min(960px, calc(100% - 28px));
  display: grid;
  grid-template-columns: auto minmax(120px, 0.8fr) auto minmax(180px, 1.2fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-2);
}
.dock[hidden] { display: none; }
.dock.is-open { animation: dockIn 420ms var(--spring) both; }
@keyframes dockIn {
  from { transform: translate(-50%, 130%); opacity: 0.4; }
  to   { transform: translate(-50%, 0);    opacity: 1; }
}
/* keep the page footer reachable behind the dock */
body.dock-open .deck { padding-bottom: 130px; }

.dock-art {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px rgba(25, 26, 29, 0.14);
  animation: disc-spin 4s linear infinite;
  animation-play-state: paused;
}
.dock.is-playing .dock-art { animation-play-state: running; }

.dock-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.dock-title {
  font-weight: 650;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dock-track {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dock.is-playing .dock-track { color: var(--teal-deep); }

.dock-transport {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dock-skip {
  width: 34px;
  height: 34px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: transform 200ms var(--spring), color 150ms ease, border-color 150ms ease;
}
.dock-skip:hover { transform: translateY(-2px); color: var(--cobalt); border-color: var(--cobalt); }
.dock-play {
  width: 44px;
  height: 44px;
  font-size: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--cobalt);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(86, 97, 224, 0.35);
  transition: transform 200ms var(--spring), background 150ms ease;
}
.dock-play:hover { transform: translateY(-2px); background: var(--cobalt-deep); }
.dock-play::before { font-size: 14px; }
.dock.is-playing       .dock-play::before { content: "❚❚"; letter-spacing: -0.05em; }
.dock:not(.is-playing) .dock-play::before { content: "▶"; margin-left: 2px; }

.dock-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.dock-time {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.dock-progress {
  position: relative;
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(25, 26, 29, 0.12);
  cursor: pointer;
}
.dock-progress-fill {
  height: 100%;
  width: var(--progress, 0%);
  border-radius: 999px;
  background: var(--cobalt);
}
.dock-open {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--cobalt);
  white-space: nowrap;
}
.dock-open:hover { text-decoration: underline; }
.dock-eject { font-size: 10px; padding: 9px 14px 8px; }

/* scaffold mode: no remote_base yet — controls sleep, magenta pending note */
.dock.is-pending .dock-transport,
.dock.is-pending .dock-progress-wrap { opacity: 0.35; pointer-events: none; }
.dock.is-pending .dock-track { color: var(--magenta); }

@media (max-width: 860px) {
  .dock {
    grid-template-columns: auto minmax(0, 1fr) auto;
    row-gap: 10px;
    padding: 12px 14px;
    bottom: 10px;
  }
  .dock-transport { grid-column: 3; grid-row: 1; }
  .dock-progress-wrap { grid-column: 1 / 3; grid-row: 2; }
  .dock-eject { grid-column: 3; grid-row: 2; justify-self: end; }
  .dock-open { display: none; }
  body.dock-open .deck { padding-bottom: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  .dock.is-open { animation: none !important; }
  .dock-art { animation: none !important; }
}

/* ---------- listening room: presence + guestbook + collab wall ---------- */
.presence-chip {
  font-size: 10px;
  letter-spacing: 0.18em;
  padding: 7px 13px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--card);
  box-shadow: var(--shadow-1);
}
.presence-chip::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.gb-panel { width: min(560px, 100%); }
.gb-list {
  max-height: 300px;
  overflow-y: auto;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  text-align: left;
  scrollbar-width: thin;
}
.gb-entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 10px 14px 9px;
  border-bottom: 1px solid var(--line);
}
.gb-entry:last-child { border-bottom: 0; }
.gb-entry-name {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cobalt);
  white-space: nowrap;
}
.gb-entry-msg {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  min-width: 0;
  overflow-wrap: break-word;
}
.gb-entry-at {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--ink-faint);
  white-space: nowrap;
}
.gb-entry.gb-empty {
  justify-content: center;
  font-family: var(--f-mono);
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.gb-form {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 8px;
  margin-bottom: 4px;
}
.gb-form .unlock-input {
  width: 100%;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0.04em;
  text-align: left;
  font-family: var(--f-sans);
}
@media (max-width: 560px) { .gb-form { grid-template-columns: 1fr; } }

.wall-panel { width: min(720px, 100%); }
.wall-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  margin: 0 0 14px;
  background: #f4f4f5;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: crosshair;
  touch-action: none;
}
.wall-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.wall-colors { display: flex; gap: 8px; }
.wall-swatch {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(25, 26, 29, 0.15), 0 1px 3px rgba(23, 24, 27, 0.15);
  cursor: pointer;
  transition: transform 180ms var(--spring), box-shadow 150ms ease;
}
.wall-swatch.on {
  transform: translateY(-2px) scale(1.12);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--cobalt);
}
.wall-size { accent-color: var(--cobalt); width: 130px; }

/* ---------- spectrum display (visualizer.js) ---------- */
.viz {
  display: block;
  width: 100%;
  height: 38px;
  margin-bottom: 14px;
  background: rgba(25, 26, 29, 0.05);
  border-radius: var(--r-sm);
}
@media (max-width: 720px) { .viz { height: 32px; } }
@media (prefers-reduced-motion: reduce) { .viz { display: none; } }

/* ---------- cross-document view transitions (progressive) ----------
   deck → album (and back) cross-fades with a slight push instead of a hard
   cut. No-ops in browsers without support. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 0.3s ease both vt-out; }
::view-transition-new(root) { animation: 0.3s ease both vt-in; }
@keyframes vt-out { to   { opacity: 0; transform: scale(1.012); } }
@keyframes vt-in  { from { opacity: 0; transform: scale(0.988); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none !important; }
}
