/* Hallmark · pre-emit critique: P5 H5 E4 S5 R4 V5
 * macrostructure: Workbench · tone: atmospheric · anchor hue: multi-skin
 * theme: studied-DNA (DIZZYLAB, NTS, Apple materials, physical transmission)
 * axes: matte+glass+metal+paper / flat+spatial / warm+cool · contrast: pass (40–41)
 * nav: utility header · footer: player dock · mobile: pass (34, 49, 50–57)
 */
:root {
  --energy: .16;
  --low: .12;
  --mid: .10;
  --high: .08;
  --accent: #c94f3d;
  --ink: #1f1c18;
  --muted: rgba(31, 28, 24, .58);
  --surface: #e8ddc7;
  --surface-2: #f4ecdc;
  --line: rgba(31, 28, 24, .26);
  --shadow: 0 28px 90px rgba(17, 12, 8, .34);
  --stage-pad: clamp(24px, 3.5vw, 64px);
  --ui-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display-font: "Times New Roman", "Songti SC", serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  font-family: var(--ui-font);
  background: #0d0c0b;
  color: var(--ink);
  user-select: none;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-width: 820px;
  min-height: 540px;
  overflow: hidden;
  isolation: isolate;
}

#ambientCanvas,
.background-image,
.background-veil,
.ambient-noise {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#ambientCanvas { z-index: -2; opacity: .72; }
.background-image {
  z-index: -5;
  background-position: center;
  background-size: cover;
  filter: blur(54px) saturate(.72);
  transform: scale(1.16);
  opacity: .4;
  transition: opacity 850ms ease, transform 7s ease;
}
.background-image-b { opacity: 0; }
.background-image.is-active { opacity: .42; transform: scale(1.11); }
.background-veil { z-index: -3; background: rgba(17, 12, 8, .56); }
.ambient-noise {
  z-index: 20;
  pointer-events: none;
  opacity: .055;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.stage {
  position: absolute;
  inset: clamp(16px, 2vw, 30px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: var(--stage-pad);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: background 600ms ease, color 600ms ease, border 600ms ease, clip-path 600ms ease;
}
.stage::before,
.stage::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.stage-header,
.stage-footer,
.composition { position: relative; z-index: 4; }
.stage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.brand-block { display: grid; gap: 4px; }
.eyebrow,
.artist,
.header-meta,
.track-label,
.track-kicker,
.next-track-preview span,
.art-caption,
.footer-note {
  text-transform: uppercase;
  letter-spacing: .16em;
}
.eyebrow { font-size: 10px; opacity: .58; }
.brand-block h1 {
  margin: 0;
  font: 600 clamp(22px, 2.5vw, 40px)/1 var(--display-font);
  letter-spacing: -.02em;
}
.artist { font-size: 10px; opacity: .66; }
.header-meta {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 10px;
  opacity: .7;
}

.composition {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(380px, 1.1fr) minmax(300px, .9fr);
  align-items: center;
  gap: clamp(36px, 5vw, 88px);
  padding: clamp(24px, 4vh, 56px) 0;
}

.art-shell {
  position: relative;
  width: min(56vh, 44vw);
  max-width: 720px;
  aspect-ratio: 1 / 1;
  justify-self: center;
  perspective: 1200px;
}
.art-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  will-change: transform, opacity, filter;
  transform-origin: center;
}
.art-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(calc(1.02 + var(--low) * .055));
  transition: transform 7s cubic-bezier(.2,.7,.2,1), filter 800ms ease;
}
.art-frame-b { opacity: 0; pointer-events: none; }
.art-frame-a { opacity: 1; }
.art-highlight {
  position: absolute;
  inset: -3%;
  pointer-events: none;
  opacity: calc(.08 + var(--high) * .35);
}
.art-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -28px;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  opacity: .58;
}

.track-copy {
  align-self: center;
  display: grid;
  gap: clamp(20px, 3vh, 40px);
  max-width: 620px;
}
.track-index-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.track-label { font-size: 10px; opacity: .55; }
.track-index-wrap strong {
  font: 400 clamp(60px, 7vw, 118px)/.8 var(--display-font);
  letter-spacing: -.07em;
}
.track-index-wrap > span:last-child { font-size: 13px; opacity: .4; }
.track-text-stack { display: grid; gap: 12px; }
.track-kicker { font-size: 10px; opacity: .5; }
.track-copy h2 {
  margin: 0;
  max-width: 12ch;
  font: 500 clamp(34px, 4.6vw, 76px)/.94 var(--display-font);
  letter-spacing: -.045em;
  text-wrap: balance;
}
.track-copy p {
  margin: 0;
  max-width: 42ch;
  font-size: clamp(12px, 1.15vw, 17px);
  line-height: 1.75;
  opacity: .62;
}
.next-track-preview {
  display: grid;
  gap: 7px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.next-track-preview span { font-size: 9px; opacity: .45; }
.next-track-preview strong { font-size: 12px; letter-spacing: .04em; font-weight: 500; opacity: .75; }

.stage-footer {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 28px;
}
.progress-track {
  position: relative;
  /* 全局 box-sizing 是 border-box，这里必须改回 content-box，
     否则 height 1px + padding 26px 会把内容区压成 0，轨道和进度线都不渲染 */
  box-sizing: content-box;
  height: 1px; /* v0.5.8 加粗到 3px，现还原为最初 1px 细线（观感） */
  background: var(--track, rgba(255,255,255,.22));
  overflow: visible;
  /* 触摸/点击热区保持 27px(上下各 13px)，只影响交互不影响观感 */
  padding: 13px 0;
  margin: -13px 0;
  background-clip: content-box;
  touch-action: none;
  cursor: pointer;
}
.progress-track i {
  position: relative;
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 120ms linear;
}
.progress-track i::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,0,0,.4), 0 0 12px rgba(0,0,0,.45);
  /* 末端指针默认隐藏，仅按下/拖动进度条时显示 */
  opacity: 0;
  transition: opacity 150ms ease;
}
.progress-track.is-scrubbing i::after { opacity: 1; }
.progress-track.is-scrubbing i { transition: none; }
.time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font: 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  opacity: .72;
}
.footer-note { font-size: 9px; opacity: .48; }

.stamp-decoration,
.film-perforation,
.glass-grid { display: none; }

/* ─────────────────────────────────────────────
   SKIN 01 · 邮票档案
   ───────────────────────────────────────────── */
body[data-skin="stamp"] {
  --accent: #b94a39;
  --ink: #252019;
  --muted: rgba(37,32,25,.58);
  --surface: #dfd1b8;
  --surface-2: #f1e8d7;
  --line: rgba(37,32,25,.25);
  --track: rgba(60,45,25,.32);
  --display-font: Georgia, "Songti SC", "Times New Roman", serif;
}
body[data-skin="stamp"] .stage {
  background:
    linear-gradient(90deg, rgba(74,55,34,.035) 1px, transparent 1px),
    linear-gradient(rgba(74,55,34,.035) 1px, transparent 1px),
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.7), transparent 40%),
    var(--surface);
  background-size: 22px 22px, 22px 22px, auto, auto;
  border: 1px solid rgba(68,53,33,.24);
  clip-path: polygon(0 8px, 8px 8px, 8px 0, 16px 0, 16px 8px, 24px 8px, 24px 0, calc(100% - 24px) 0, calc(100% - 24px) 8px, calc(100% - 16px) 8px, calc(100% - 16px) 0, calc(100% - 8px) 0, calc(100% - 8px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) calc(100% - 8px), calc(100% - 8px) 100%, calc(100% - 16px) 100%, calc(100% - 16px) calc(100% - 8px), calc(100% - 24px) calc(100% - 8px), calc(100% - 24px) 100%, 24px 100%, 24px calc(100% - 8px), 16px calc(100% - 8px), 16px 100%, 8px 100%, 8px calc(100% - 8px), 0 calc(100% - 8px));
}
body[data-skin="stamp"] .stage::before {
  inset: 18px;
  border: 1px solid rgba(37,32,25,.18);
}
body[data-skin="stamp"] .stage::after {
  width: 88px;
  height: 88px;
  right: 8%;
  top: 10%;
  border: 2px solid rgba(185,74,57,.5);
  border-radius: 50%;
  box-shadow: 0 0 0 7px var(--surface), 0 0 0 9px rgba(185,74,57,.24);
  opacity: .7;
  transform: rotate(-11deg);
}
body[data-skin="stamp"] .stamp-decoration { display: block; position: absolute; z-index: 3; font-size: 8px; letter-spacing: .2em; opacity: .36; }
body[data-skin="stamp"] .stamp-decoration-top { top: 29px; left: 50%; transform: translateX(-50%); }
body[data-skin="stamp"] .stamp-decoration-side { right: 25px; top: 50%; writing-mode: vertical-rl; transform: translateY(-50%); }
body[data-skin="stamp"] .art-shell { transform: rotate(-1.2deg); }
body[data-skin="stamp"] .art-frame {
  padding: clamp(12px, 1.2vw, 22px);
  background: var(--surface-2);
  box-shadow: 0 18px 48px rgba(51,39,25,.22), inset 0 0 0 1px rgba(37,32,25,.15);
}
body[data-skin="stamp"] .art-frame::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed rgba(37,32,25,.25);
  pointer-events: none;
}
body[data-skin="stamp"] .art-highlight {
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 72%);
  transform: translateX(calc(-55% + var(--high) * 24%));
}
body[data-skin="stamp"] .track-index-wrap strong { color: var(--accent); }
body[data-skin="stamp"] .track-copy h2 { text-shadow: 0 1px 0 rgba(255,255,255,.45); }
body[data-skin="stamp"] .background-veil { background: rgba(31,23,15,.62); }

/* ─────────────────────────────────────────────
   SKIN 02 · 夜航胶片
   ───────────────────────────────────────────── */
body[data-skin="film"] {
  --accent: #f2b36b;
  --ink: #f4efe7;
  --muted: rgba(244,239,231,.58);
  --surface: #11100f;
  --surface-2: #191715;
  --line: rgba(244,239,231,.2);
  --track: rgba(255,255,255,.28);
  --display-font: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
}
body[data-skin="film"] .stage {
  background:
    radial-gradient(circle at 18% 22%, rgba(240,149,73,.10), transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(92,119,153,.10), transparent 35%),
    #0e0d0c;
  border: 1px solid rgba(255,255,255,.12);
}
body[data-skin="film"] .stage::before {
  inset: 0;
  background: linear-gradient(90deg, rgba(255,152,70,.08), transparent 16%, transparent 84%, rgba(88,125,170,.08));
  mix-blend-mode: screen;
}
body[data-skin="film"] .stage::after {
  inset: 14px;
  border: 1px solid rgba(255,255,255,.07);
}
body[data-skin="film"] .film-perforation { display: block; position: absolute; top: 0; bottom: 0; width: 22px; opacity: .28; z-index: 2; background: radial-gradient(ellipse 7px 11px at center, transparent 45%, rgba(255,255,255,.65) 48%, rgba(255,255,255,.65) 68%, transparent 71%) center top / 22px 38px repeat-y; }
body[data-skin="film"] .film-perforation-left { left: 8px; }
body[data-skin="film"] .film-perforation-right { right: 8px; }
body[data-skin="film"] .composition { grid-template-columns: minmax(420px, 1.25fr) minmax(280px, .75fr); }
body[data-skin="film"] .art-shell { width: min(62vh, 51vw); aspect-ratio: 4 / 3; }
body[data-skin="film"] .art-frame {
  background: #090909;
  padding: 9px;
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 28px 110px rgba(0,0,0,.65);
}
body[data-skin="film"] .art-frame::after {
  content: "";
  position: absolute;
  inset: 9px;
  box-shadow: inset 0 0 80px rgba(0,0,0,.5);
  pointer-events: none;
}
body[data-skin="film"] .art-frame img { filter: contrast(1.04) saturate(.78) sepia(.08); }
body[data-skin="film"] .art-highlight {
  background: radial-gradient(circle at calc(15% + var(--mid) * 40%) 20%, rgba(255,189,110,.28), transparent 28%);
  mix-blend-mode: screen;
}
body[data-skin="film"] .brand-block h1,
body[data-skin="film"] .track-copy h2 { text-transform: uppercase; font-weight: 700; letter-spacing: -.055em; }
body[data-skin="film"] .track-copy h2 { max-width: 9ch; }
body[data-skin="film"] .track-index-wrap strong { color: transparent; -webkit-text-stroke: 1px rgba(244,239,231,.55); }
body[data-skin="film"] .track-kicker { color: var(--accent); opacity: .9; }
body[data-skin="film"] .background-image { filter: blur(72px) saturate(.7) brightness(.45); opacity: .32; }
body[data-skin="film"] .background-veil { background: rgba(0,0,0,.68); }
body[data-skin="film"] .ambient-noise { mix-blend-mode: screen; opacity: .075; }

/* ─────────────────────────────────────────────
   SKIN 03 · 玻璃潮汐
   ───────────────────────────────────────────── */
body[data-skin="glass"] {
  --accent: #bce7df;
  --ink: #edf6f6;
  --muted: rgba(237,246,246,.58);
  --surface: #101820;
  --surface-2: rgba(255,255,255,.08);
  --line: rgba(220,245,245,.18);
  --track: rgba(220,245,245,.28);
  --display-font: "Helvetica Neue", "PingFang SC", Arial, sans-serif;
}
body[data-skin="glass"] .stage {
  background:
    radial-gradient(circle at 18% 12%, rgba(95,196,191,.16), transparent 33%),
    radial-gradient(circle at 78% 85%, rgba(129,98,190,.18), transparent 34%),
    linear-gradient(135deg, rgba(11,21,29,.90), rgba(15,19,35,.86));
  border: 1px solid rgba(220,245,245,.16);
  border-radius: 26px;
  backdrop-filter: blur(26px) saturate(1.2);
}
body[data-skin="glass"] .stage::before {
  inset: 0;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255,255,255,.15), transparent 21%, transparent 70%, rgba(173,131,255,.08));
  mask: linear-gradient(#000, transparent 45%);
}
body[data-skin="glass"] .stage::after {
  width: 43vw;
  height: 43vw;
  left: -14vw;
  bottom: -28vw;
  border: 1px solid rgba(188,231,223,.14);
  border-radius: 50%;
  box-shadow: 0 0 0 5vw rgba(188,231,223,.025), 0 0 0 10vw rgba(188,231,223,.018), 0 0 0 15vw rgba(188,231,223,.012);
  transform: scale(calc(1 + var(--low) * .08));
}
body[data-skin="glass"] .glass-grid {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: .2;
  background-image: linear-gradient(rgba(220,245,245,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(220,245,245,.08) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at 60% 50%, #000, transparent 75%);
}
body[data-skin="glass"] .composition { grid-template-columns: minmax(360px, .95fr) minmax(360px, 1.05fr); }
body[data-skin="glass"] .art-shell { width: min(54vh, 41vw); }
body[data-skin="glass"] .art-frame {
  border-radius: 30px;
  padding: 12px;
  background: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 34px 120px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.18);
  backdrop-filter: blur(18px);
  transform: rotateY(-4deg) rotateX(2deg);
}
body[data-skin="glass"] .art-frame img { border-radius: 22px; filter: saturate(.92) contrast(1.02); }
body[data-skin="glass"] .art-highlight {
  border-radius: 30px;
  background: linear-gradient(120deg, transparent 26%, rgba(255,255,255,.18) 43%, transparent 58%), radial-gradient(circle at 20% 20%, rgba(108,227,212,.22), transparent 34%);
  transform: translateX(calc(-35% + var(--high) * 30%));
  mix-blend-mode: screen;
}
body[data-skin="glass"] .track-index-wrap strong { font-weight: 200; color: var(--accent); }
body[data-skin="glass"] .track-copy h2 { font-weight: 220; max-width: 11ch; }
body[data-skin="glass"] .track-kicker { color: var(--accent); opacity: .76; }
body[data-skin="glass"] .background-image { filter: blur(62px) saturate(1.25) brightness(.62); opacity: .54; }
body[data-skin="glass"] .background-veil { background: linear-gradient(130deg, rgba(3,13,17,.68), rgba(10,8,26,.58)); }
body[data-skin="glass"] .ambient-noise { opacity: .03; mix-blend-mode: screen; }

/* Track transitions */
body.is-transitioning .art-frame-a { animation: artOut 780ms cubic-bezier(.4,0,.2,1) forwards; }
body.is-transitioning .art-frame-b { animation: artIn 780ms cubic-bezier(.2,.7,.15,1) forwards; }
body.is-transitioning .track-copy { animation: copySwap 780ms ease both; }
body[data-skin="stamp"].is-transitioning .art-frame-a { animation-name: stampOut; }
body[data-skin="stamp"].is-transitioning .art-frame-b { animation-name: stampIn; }
body[data-skin="film"].is-transitioning .art-frame-a { animation-name: filmOut; }
body[data-skin="film"].is-transitioning .art-frame-b { animation-name: filmIn; }
body[data-skin="glass"].is-transitioning .art-frame-a { animation-name: glassOut; }
body[data-skin="glass"].is-transitioning .art-frame-b { animation-name: glassIn; }

@keyframes artOut { to { opacity: 0; transform: scale(.96); filter: blur(12px); } }
@keyframes artIn { from { opacity: 0; transform: scale(1.08); filter: blur(14px); } to { opacity: 1; transform: scale(1); filter: blur(0); } }
@keyframes copySwap { 0%,100% { transform: translateY(0); opacity: 1; } 42% { transform: translateY(-12px); opacity: 0; } 55% { transform: translateY(14px); opacity: 0; } }
@keyframes stampOut { to { opacity: 0; transform: translate(-5%, 3%) rotate(-3deg) scale(.94); filter: sepia(.35) blur(5px); } }
@keyframes stampIn { from { opacity: 0; transform: translate(7%, -5%) rotate(3deg) scale(1.05); filter: sepia(.45) blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes filmOut { 45% { opacity: 1; filter: brightness(1.9) contrast(.7); } to { opacity: 0; transform: translateX(-5%) scale(1.04); filter: brightness(.2) blur(8px); } }
@keyframes filmIn { from { opacity: 0; transform: translateX(5%) scale(1.06); filter: brightness(2.2) blur(7px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes glassOut { to { opacity: 0; transform: rotateY(10deg) translateX(-5%) scale(.92); filter: blur(13px); } }
@keyframes glassIn { from { opacity: 0; transform: rotateY(-12deg) translateX(8%) scale(1.08); filter: blur(16px); } to { opacity: 1; transform: rotateY(-4deg) rotateX(2deg); filter: none; } }

/* Control UI */
.control-dock {
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(950px, calc(100vw - 50px));
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #f4f4f2;
  background: rgba(10,10,10,.78);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,.38);
  backdrop-filter: blur(24px) saturate(1.2);
  transition: opacity 260ms ease, transform 260ms ease;
}
.control-row { display: flex; align-items: center; justify-content: center; gap: 6px; }
.control-dock button {
  min-height: 34px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px;
  padding: 0 12px;
  color: rgba(255,255,255,.74);
  background: rgba(255,255,255,.055);
  cursor: pointer;
  transition: 180ms ease;
}
.control-dock button:hover { color: #fff; background: rgba(255,255,255,.12); transform: translateY(-1px); }
.control-dock button:active { transform: translateY(0) scale(.97); }
.primary-controls .play-button { min-width: 78px; color: #111; background: #f2f0ea; border-color: transparent; font-weight: 700; }
.skin-controls { justify-self: center; }
.skin-controls button.active { color: #fff; background: rgba(255,255,255,.15); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.utility-controls { justify-self: end; }
.shortcut-help { grid-column: 1 / -1; display: flex; justify-content: center; gap: 22px; font-size: 9px; letter-spacing: .08em; color: rgba(255,255,255,.42); }

body[data-clean="true"] .control-dock {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
}
body[data-clean="true"] { cursor: none; }
body[data-clean="true"] .stage { inset: 0; border-radius: 0; }
body[data-clean="true"] .stage-footer { padding-bottom: 0; }

/* Welcome & drop */
.welcome-panel,
.drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(6,7,8,.72);
  backdrop-filter: blur(18px);
  transition: opacity 320ms ease, visibility 320ms ease;
}
.welcome-panel.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.welcome-card {
  width: min(560px, calc(100vw - 48px));
  padding: 42px;
  color: #efefec;
  background: linear-gradient(145deg, rgba(255,255,255,.1), rgba(255,255,255,.045));
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 24px;
  box-shadow: 0 28px 100px rgba(0,0,0,.45);
}
.welcome-eyebrow { font-size: 9px; letter-spacing: .18em; color: rgba(255,255,255,.48); }
.welcome-card h2 { margin: 12px 0 14px; font: 500 42px/1.05 var(--display-font); }
.welcome-card p { margin: 0; line-height: 1.8; color: rgba(255,255,255,.62); }
.welcome-card b { color: #fff; }
.welcome-actions { display: flex; gap: 10px; margin-top: 26px; }
.welcome-actions button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  background: rgba(255,255,255,.08);
  cursor: pointer;
}
.welcome-actions button.primary { color: #121212; background: #f0eee8; border-color: transparent; font-weight: 700; }
.welcome-actions button.danger {
  color: #ff9b88;
  border-color: rgba(255,120,100,.45);
  background: rgba(255,90,70,.1);
}
.welcome-actions button.danger:hover:not(:disabled) { background: rgba(255,90,70,.2); }
.welcome-actions button:disabled { opacity: .4; cursor: default; }
.format-tip { margin-top: 22px; display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.4); font-size: 11px; }
.format-tip code { padding: 6px 8px; border-radius: 7px; background: rgba(0,0,0,.28); color: rgba(255,255,255,.65); }
.drop-overlay { opacity: 0; visibility: hidden; pointer-events: none; color: white; text-align: center; }
.drop-overlay.is-visible { opacity: 1; visibility: visible; }
.drop-overlay strong { font-size: 32px; }
.drop-overlay span { margin-top: 10px; opacity: .6; }

.toast {
  position: absolute;
  z-index: 100;
  top: 24px;
  left: 50%;
  transform: translate(-50%, -14px);
  padding: 10px 14px;
  color: #fff;
  background: rgba(7,7,8,.82);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 10px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: 220ms ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  .control-dock { grid-template-columns: auto 1fr; }
  .shortcut-help { display: none; }
  .composition { gap: 34px; }
  .track-copy h2 { font-size: clamp(32px, 4.4vw, 58px); }
}

@media (max-aspect-ratio: 4/3) {
  .app { min-width: 650px; }
  .composition { grid-template-columns: 1fr 1fr; }
  .art-shell { width: min(48vh, 47vw); }
  body[data-skin="film"] .art-shell { width: min(48vh, 48vw); }
}

/* ─────────────────────────────────────────────
   V1.1 · Audio-reactive performance layer
   ───────────────────────────────────────────── */
:root {
  --impact: 0;
  --flux: 0;
  --motion: 1;
  --track-hue: 0deg;
}

#ambientCanvas {
  z-index: 2;
  opacity: calc(.34 + var(--energy) * .34);
  pointer-events: none;
  mix-blend-mode: normal;
}

.stage-header,
.stage-footer,
.composition { z-index: 5; }

.background-image {
  transform:
    translate3d(calc((var(--mid) - .12) * 18px), calc((var(--high) - .08) * -14px), 0)
    scale(calc(1.105 + var(--low) * .16));
  filter: blur(calc(54px - var(--impact) * 7px)) saturate(calc(.72 + var(--mid) * .62)) hue-rotate(var(--track-hue));
  transition: opacity 850ms ease;
}
.background-image.is-active { transform: translate3d(0,0,0) scale(calc(1.08 + var(--low) * .17)); }

.art-shell {
  transform:
    translate3d(calc(var(--mid) * 7px), calc(var(--energy) * -9px), 0)
    rotate(calc((var(--high) - .1) * .7deg));
  transition: transform 120ms linear;
}
.art-shell::before,
.art-shell::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
  border-radius: 50%;
}
.art-shell::before {
  inset: -8%;
  border: 1px solid color-mix(in srgb, var(--accent) calc(14% + var(--mid) * 22%), transparent);
  transform: scale(calc(.94 + var(--low) * .16)) rotate(calc(var(--high) * 9deg));
  opacity: calc(.18 + var(--energy) * .24);
}
.art-shell::after {
  inset: -16%;
  border: 1px dashed color-mix(in srgb, var(--accent) calc(10% + var(--high) * 18%), transparent);
  transform: scale(calc(.9 + var(--impact) * .2)) rotate(calc(var(--mid) * -14deg));
  opacity: calc(.08 + var(--flux) * .28);
}

.art-frame img {
  --img-x: 0%;
  --img-y: 0%;
  --img-scale: 1.035;
  --img-rotate: 0deg;
  transform:
    translate3d(
      calc(var(--img-x) + var(--mid) * 1.6%),
      calc(var(--img-y) - var(--energy) * 1.2%),
      0
    )
    scale(calc(var(--img-scale) + var(--low) * .075 + var(--impact) * .018))
    rotate(calc(var(--img-rotate) + var(--high) * .35deg));
  filter:
    saturate(calc(.91 + var(--mid) * .34))
    contrast(calc(1.01 + var(--impact) * .08))
    brightness(calc(.98 + var(--energy) * .08));
  transition: object-position 900ms ease, filter 120ms linear;
  will-change: transform, filter;
}

.track-copy {
  transform: translate3d(calc(var(--mid) * 5px), calc(var(--energy) * -3px), 0);
  transition: transform 120ms linear;
}
.track-copy h2 {
  text-shadow: 0 calc(var(--impact) * 5px) calc(10px + var(--impact) * 20px) color-mix(in srgb, var(--accent) 28%, transparent);
  transform: scale(calc(1 + var(--impact) * .012));
  transform-origin: left center;
}
.track-index-wrap strong {
  transform: translateY(calc(var(--low) * -5px));
  filter: drop-shadow(0 0 calc(var(--impact) * 20px) color-mix(in srgb, var(--accent) 42%, transparent));
}
.progress-track i {
  box-shadow: 0 0 calc(4px + var(--high) * 18px) color-mix(in srgb, var(--accent) 72%, transparent);
}

.spectrum-ruler {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(48, minmax(1px, 1fr));
  align-items: end;
  gap: clamp(2px, .25vw, 6px);
  height: clamp(56px, 10vh, 112px);
  opacity: calc(.4 + var(--energy) * .42);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.spectrum-ruler i {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 1px;
  transform: scaleY(.05);
  transform-origin: bottom;
  transition: transform 55ms linear, opacity 70ms linear;
}
.beat-halo,
.scan-glint {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}
.beat-halo {
  width: min(48vw, 720px);
  aspect-ratio: 1;
  left: -12vw;
  bottom: -27vw;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  box-shadow:
    0 0 0 calc(3vw + var(--low) * 2vw) color-mix(in srgb, var(--accent) 5%, transparent),
    0 0 calc(80px + var(--impact) * 150px) color-mix(in srgb, var(--accent) 12%, transparent);
  transform: scale(calc(.84 + var(--low) * .28 + var(--impact) * .08));
  opacity: calc(.14 + var(--energy) * .23);
}
.scan-glint {
  inset: -20%;
  background: linear-gradient(112deg, transparent 38%, color-mix(in srgb, var(--accent) 22%, transparent) 49%, transparent 57%);
  transform: translateX(calc(-48% + var(--high) * 74%));
  opacity: calc(.04 + var(--flux) * .22);
  mix-blend-mode: screen;
}

body[data-skin="stamp"] #ambientCanvas { mix-blend-mode: multiply; opacity: calc(.3 + var(--energy) * .28); }
body[data-skin="stamp"] .spectrum-ruler {
  left: 7%;
  right: 7%;
  bottom: 10%;
  height: clamp(48px, 8vh, 86px);
  transform: rotate(-.7deg);
  opacity: calc(.22 + var(--energy) * .36);
}
body[data-skin="stamp"] .spectrum-ruler i {
  background: repeating-linear-gradient(to top, rgba(63,44,31,.76) 0 1px, transparent 1px 4px);
  border-top: 1px solid rgba(185,74,57,.5);
}
body[data-skin="stamp"] .art-shell {
  transform: translate3d(calc(var(--mid) * 6px), calc(var(--energy) * -8px), 0) rotate(calc(-1.2deg + var(--high) * .8deg));
}
body[data-skin="stamp"] .stamp-decoration-top {
  transform: translateX(-50%) translateY(calc(var(--high) * 4px));
  letter-spacing: calc(.2em + var(--mid) * .05em);
}

body[data-skin="film"] #ambientCanvas { mix-blend-mode: screen; opacity: calc(.42 + var(--energy) * .34); }
body[data-skin="film"] .spectrum-ruler {
  left: 4%;
  right: 4%;
  bottom: 9%;
  height: clamp(72px, 14vh, 150px);
  opacity: calc(.3 + var(--energy) * .48);
  gap: clamp(1px, .18vw, 4px);
}
body[data-skin="film"] .spectrum-ruler i {
  background: linear-gradient(to top, rgba(242,179,107,.1), rgba(242,179,107,.86));
  box-shadow: 0 0 calc(2px + var(--high) * 8px) rgba(242,179,107,.45);
}
body[data-skin="film"] .stage {
  filter: brightness(calc(.96 + var(--impact) * .08));
}
body[data-skin="film"] .art-frame {
  transform: translate3d(calc(var(--mid) * -4px), calc(var(--energy) * -5px), 0) rotate(calc(var(--high) * -.35deg));
}
body[data-skin="film"] .film-perforation {
  background-position-y: calc(var(--energy) * 34px);
  filter: brightness(calc(.8 + var(--high) * .8));
}
body[data-skin="film"] .scan-glint { opacity: calc(.06 + var(--flux) * .34 + var(--impact) * .1); }

body[data-skin="glass"] #ambientCanvas { mix-blend-mode: screen; opacity: calc(.48 + var(--energy) * .32); }
body[data-skin="glass"] .spectrum-ruler {
  width: min(38vw, 640px);
  right: 5%;
  bottom: 15%;
  height: clamp(90px, 17vh, 190px);
  transform: skewX(-8deg) perspective(600px) rotateX(12deg);
  opacity: calc(.26 + var(--energy) * .48);
}
body[data-skin="glass"] .spectrum-ruler i {
  border-radius: 999px 999px 0 0;
  background: linear-gradient(to top, rgba(188,231,223,.04), rgba(188,231,223,.88));
  box-shadow: 0 0 calc(3px + var(--high) * 12px) rgba(188,231,223,.38);
}
body[data-skin="glass"] .glass-grid {
  background-position: calc(var(--mid) * 18px) calc(var(--energy) * -14px);
  background-size: calc(54px + var(--low) * 12px) calc(54px + var(--low) * 12px);
  opacity: calc(.14 + var(--high) * .22);
}
body[data-skin="glass"] .art-frame {
  transform:
    rotateY(calc(-4deg + var(--mid) * 5deg))
    rotateX(calc(2deg + var(--energy) * 2deg))
    translateY(calc(var(--low) * -6px));
}
body[data-skin="glass"] .beat-halo {
  left: -8vw;
  bottom: -20vw;
  opacity: calc(.2 + var(--energy) * .32);
}

body.is-shared-art-transition .art-frame-a { animation-duration: 650ms; }
body.is-shared-art-transition .art-frame-b { animation-duration: 650ms; }
body[data-skin="stamp"].is-shared-art-transition .art-frame-a { animation-name: sharedStampOut; }
body[data-skin="stamp"].is-shared-art-transition .art-frame-b { animation-name: sharedStampIn; }
body[data-skin="film"].is-shared-art-transition .art-frame-a { animation-name: sharedFilmOut; }
body[data-skin="film"].is-shared-art-transition .art-frame-b { animation-name: sharedFilmIn; }
body[data-skin="glass"].is-shared-art-transition .art-frame-a { animation-name: sharedGlassOut; }
body[data-skin="glass"].is-shared-art-transition .art-frame-b { animation-name: sharedGlassIn; }

@keyframes sharedStampOut {
  0% { opacity: 1; filter: none; }
  58% { opacity: .16; transform: scale(.98) rotate(-1.8deg); filter: sepia(.4) contrast(1.2); }
  100% { opacity: 0; transform: scale(.96) rotate(-2.2deg); }
}
@keyframes sharedStampIn {
  0% { opacity: 0; transform: scale(1.13) rotate(1.1deg); filter: sepia(.35) blur(3px); }
  52% { opacity: .18; }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes sharedFilmOut {
  0% { opacity: 1; filter: none; }
  42% { opacity: 1; filter: brightness(2.35) contrast(.62); }
  100% { opacity: 0; transform: scale(1.07); filter: brightness(.2) blur(4px); }
}
@keyframes sharedFilmIn {
  0% { opacity: 0; transform: scale(1.18); filter: brightness(2.5) blur(5px); }
  55% { opacity: .35; }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes sharedGlassOut {
  to { opacity: 0; transform: translateX(-4%) rotateY(13deg) scale(.94); filter: blur(12px) saturate(1.4); }
}
@keyframes sharedGlassIn {
  from { opacity: 0; transform: translateX(7%) rotateY(-15deg) scale(1.12); filter: blur(15px) hue-rotate(18deg); }
  to { opacity: 1; transform: rotateY(-4deg) rotateX(2deg); filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .spectrum-ruler i { transition: none; }
}

/* Control panel stays readable after adding motion controls. */
.control-dock {
  width: min(1280px, calc(100vw - 36px));
  grid-template-columns: auto auto 1fr;
}
.control-dock button,
.skin-controls button,
.utility-controls button { white-space: nowrap; }
.utility-controls { justify-self: end; flex-wrap: nowrap; }
.spectrum-ruler::before {
  content: "LIVE FFT · 48 LOG BANDS";
  position: absolute;
  top: -17px;
  left: 0;
  font: 8px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .16em;
  opacity: calc(.34 + var(--high) * .32);
  white-space: nowrap;
}
body[data-skin="stamp"] .spectrum-ruler {
  left: 58%;
  right: 7%;
  bottom: 12%;
  height: clamp(62px, 11vh, 116px);
}
body[data-skin="film"] .spectrum-ruler::before { color: rgba(242,179,107,.82); }
body[data-skin="glass"] .spectrum-ruler::before { color: rgba(188,231,223,.82); }

@media (max-width: 1280px) {
  .control-dock { grid-template-columns: auto 1fr; width: min(1040px, calc(100vw - 30px)); }
}

/* ─────────────────────────────────────────────
   V1.2 · Flat sleeve + rotating vinyl + mapping editor
   ───────────────────────────────────────────── */
.composition {
  grid-template-columns: minmax(520px, 1.18fr) minmax(320px, .82fr);
  gap: clamp(42px, 5vw, 92px);
}

.art-shell,
body[data-skin="stamp"] .art-shell,
body[data-skin="film"] .art-shell,
body[data-skin="glass"] .art-shell {
  width: min(61vh, 52vw);
  max-width: 820px;
  aspect-ratio: 1.34 / 1;
  transform: none !important;
  perspective: none;
  transition: none;
}

.art-shell::before,
.art-shell::after { display: none !important; }

.vinyl-record {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 0;
  width: 69%;
  aspect-ratio: 1;
  transform: translateY(-50%);
  border-radius: 50%;
  filter: drop-shadow(0 30px 44px rgba(0,0,0,.34));
}
.vinyl-disc-spin {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, transparent 0 17%, rgba(7,7,8,.98) 17.3% 18%, transparent 18.3%),
    repeating-radial-gradient(circle at center, rgba(255,255,255,.055) 0 1px, rgba(7,7,8,.98) 1.5px 4px),
    radial-gradient(circle at 33% 28%, #45464a 0, #191a1d 28%, #070708 72%, #1a1a1d 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.18),
    inset 0 0 46px rgba(255,255,255,.045),
    0 0 0 1px rgba(0,0,0,.7);
  animation: vinylSpin 8.2s linear infinite;
  animation-play-state: paused;
  will-change: transform;
}
body.is-playing .vinyl-disc-spin { animation-play-state: running; }
@keyframes vinylSpin { to { transform: rotate(360deg); } }

.vinyl-grooves,
.vinyl-reflection,
.vinyl-label,
.vinyl-spindle { position: absolute; border-radius: 50%; }
.vinyl-grooves {
  inset: 4.5%;
  border: 1px solid rgba(255,255,255,.055);
  box-shadow:
    0 0 0 11px rgba(255,255,255,.018),
    0 0 0 22px rgba(255,255,255,.014),
    0 0 0 35px rgba(255,255,255,.012),
    0 0 0 49px rgba(255,255,255,.01),
    0 0 0 66px rgba(255,255,255,.009);
}
.vinyl-reflection {
  inset: -6%;
  background:
    conic-gradient(from 18deg,
      transparent 0 7%, rgba(255,255,255,.18) 10%, transparent 15% 36%,
      rgba(255,255,255,.075) 42%, transparent 48% 68%,
      rgba(255,255,255,.13) 73%, transparent 79% 100%);
  mask: radial-gradient(circle, transparent 0 24%, #000 25% 92%, transparent 93%);
  opacity: .72;
  mix-blend-mode: screen;
}
.vinyl-label {
  z-index: 3;
  width: 35%;
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  background: var(--accent);
  border: 3px solid rgba(238,235,225,.78);
  box-shadow: 0 0 0 1px rgba(0,0,0,.48), 0 4px 16px rgba(0,0,0,.28);
}
.vinyl-label img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.04);
}
.vinyl-label::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 34% 24%, rgba(255,255,255,.2), transparent 38%);
  pointer-events: none;
}
.vinyl-spindle {
  z-index: 4;
  width: 3.4%;
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #ece9df;
  border: 1px solid rgba(0,0,0,.45);
  box-shadow: 0 1px 4px rgba(0,0,0,.5);
}

.sleeve-shadow {
  position: absolute;
  z-index: 2;
  left: 1.5%;
  top: 50%;
  width: 74%;
  aspect-ratio: 1;
  transform: translateY(-48%);
  background: rgba(0,0,0,.35);
  filter: blur(24px);
  opacity: .55;
}

.art-frame,
body[data-skin="stamp"] .art-frame,
body[data-skin="film"] .art-frame,
body[data-skin="glass"] .art-frame {
  inset: auto;
  z-index: 4;
  left: 0;
  top: 50%;
  width: 74%;
  height: auto;
  aspect-ratio: 1;
  transform: translateY(-50%) !important;
  transform-origin: center;
  border-radius: 0;
}
.art-frame img,
body[data-skin="film"] .art-frame img,
body[data-skin="glass"] .art-frame img {
  --img-x: 0%;
  --img-y: 0%;
  --img-scale: 1;
  --img-rotate: 0deg;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none !important;
  filter: none;
  transition: object-position 420ms ease, filter 420ms ease;
  will-change: opacity, filter;
}
body[data-skin="film"] .art-frame img { filter: contrast(1.035) saturate(.88); }
body[data-skin="glass"] .art-frame img { border-radius: 19px; filter: saturate(.96) contrast(1.025); }
body[data-skin="glass"] .art-frame { border-radius: 25px; }
body[data-skin="stamp"] .art-frame { padding: clamp(9px, .85vw, 15px); }
body[data-skin="stamp"] .art-frame::before { inset: 5px; }

.sleeve-edge {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  left: 74%;
  top: 50%;
  width: 9px;
  height: 72%;
  transform: translate(-100%, -50%);
  background: linear-gradient(90deg, rgba(0,0,0,.2), rgba(255,255,255,.13), transparent);
  opacity: .55;
}
.art-highlight {
  z-index: 6;
  inset: auto;
  left: 0;
  top: 50%;
  width: 74%;
  aspect-ratio: 1;
  transform: translateY(-50%) !important;
  opacity: calc(.035 + var(--high) * .12);
}
.art-caption { right: 26%; bottom: -25px; }

/* Skin-specific record treatment. */
body[data-skin="stamp"] .vinyl-disc-spin {
  background:
    radial-gradient(circle at center, transparent 0 17%, #17120f 17.4% 18.2%, transparent 18.5%),
    repeating-radial-gradient(circle at center, rgba(228,205,168,.07) 0 1px, rgba(21,16,13,.98) 1.5px 4px),
    radial-gradient(circle at 34% 28%, #56473d 0, #231b17 28%, #0b0908 74%, #2b211c 100%);
}
body[data-skin="stamp"] .vinyl-label { border-color: #e8d9bd; }
body[data-skin="film"] .vinyl-disc-spin { animation-duration: 6.8s; }
body[data-skin="film"] .vinyl-reflection { opacity: .9; }
body[data-skin="glass"] .vinyl-disc-spin {
  background:
    radial-gradient(circle at center, transparent 0 17%, #112426 17.4% 18.2%, transparent 18.5%),
    repeating-radial-gradient(circle at center, rgba(188,231,223,.08) 0 1px, rgba(4,12,16,.98) 1.5px 4px),
    radial-gradient(circle at 33% 27%, #284b50 0, #10232a 28%, #050b10 72%, #142f36 100%);
  box-shadow: inset 0 0 0 1px rgba(188,231,223,.3), 0 0 45px rgba(116,225,215,.12);
}
body[data-skin="glass"] .vinyl-label { border-color: rgba(220,249,244,.88); }

/* Keep artwork visually stable: FFT remains in the background, waveform and ruler. */
body[data-skin="stamp"] .art-shell,
body[data-skin="film"] .art-shell,
body[data-skin="glass"] .art-shell,
body[data-skin="film"] .art-frame,
body[data-skin="glass"] .art-frame { transform: none !important; }
body[data-skin="stamp"] .art-frame,
body[data-skin="film"] .art-frame,
body[data-skin="glass"] .art-frame { transform: translateY(-50%) !important; }

/* Fast decoded image crossfade; no tilt or FFT-driven shake. */
body[data-skin="stamp"].is-transitioning .art-frame-a,
body[data-skin="film"].is-transitioning .art-frame-a,
body[data-skin="glass"].is-transitioning .art-frame-a,
body[data-skin="stamp"].is-shared-art-transition .art-frame-a,
body[data-skin="film"].is-shared-art-transition .art-frame-a,
body[data-skin="glass"].is-shared-art-transition .art-frame-a {
  animation: sleeveFadeOut 580ms cubic-bezier(.22,.7,.25,1) both !important;
}
body[data-skin="stamp"].is-transitioning .art-frame-b,
body[data-skin="film"].is-transitioning .art-frame-b,
body[data-skin="glass"].is-transitioning .art-frame-b,
body[data-skin="stamp"].is-shared-art-transition .art-frame-b,
body[data-skin="film"].is-shared-art-transition .art-frame-b,
body[data-skin="glass"].is-shared-art-transition .art-frame-b {
  animation: sleeveFadeIn 580ms cubic-bezier(.22,.7,.25,1) both !important;
}
@keyframes sleeveFadeOut {
  0% { opacity: 1; filter: none; }
  52% { opacity: .18; filter: blur(2px) brightness(1.08); }
  100% { opacity: 0; filter: blur(5px); }
}
@keyframes sleeveFadeIn {
  0% { opacity: 0; filter: blur(6px) brightness(1.12); }
  46% { opacity: .42; }
  100% { opacity: 1; filter: none; }
}

/* Mapping editor */
.mapping-panel {
  position: absolute;
  inset: 0;
  z-index: 92;
  display: grid;
  place-items: center;
  padding: 28px;
  color: #f4f3ef;
  background: rgba(5,6,8,.76);
  backdrop-filter: blur(22px) saturate(1.1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
}
.mapping-panel.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.mapping-card {
  width: min(1020px, calc(100vw - 56px));
  max-height: min(790px, calc(100vh - 56px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(28,30,34,.97), rgba(10,11,14,.97));
  box-shadow: 0 34px 120px rgba(0,0,0,.58);
}
.mapping-header {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 28px 30px 22px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.mapping-eyebrow { font-size: 9px; letter-spacing: .2em; color: rgba(255,255,255,.42); }
.mapping-header h2 { margin: 8px 0 8px; font-size: 27px; font-weight: 540; letter-spacing: -.03em; }
.mapping-header p { margin: 0; color: rgba(255,255,255,.55); font-size: 12px; line-height: 1.7; }
.mapping-header code { padding: 3px 6px; border-radius: 5px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.84); }
.mapping-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
  color: #fff;
  background: rgba(255,255,255,.055);
  font-size: 25px;
  cursor: pointer;
}
.mapping-list { overflow: auto; padding: 10px 18px 18px; }
.mapping-row {
  display: grid;
  grid-template-columns: 44px 58px minmax(180px, 1fr) minmax(240px, .75fr);
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255,255,255,.075);
}
.mapping-number { font: 18px/1 ui-monospace, SFMono-Regular, Consolas, monospace; color: rgba(255,255,255,.42); }
.mapping-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(255,255,255,.14); }
.mapping-copy { min-width: 0; display: grid; gap: 5px; }
.mapping-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 560; }
.mapping-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(255,255,255,.4); font-size: 10px; }
.mapping-row select {
  width: 100%;
  min-height: 39px;
  padding: 0 36px 0 12px;
  color: #f5f4ef;
  background: #1c1e23;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 9px;
}
.mapping-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 30px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.mapping-footer button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 9px;
  color: #f4f3ef;
  background: rgba(255,255,255,.07);
  cursor: pointer;
}
.mapping-footer button:first-child { color: #151515; background: #f0eee8; border-color: transparent; font-weight: 680; }
.mapping-footer span { margin-left: auto; color: rgba(255,255,255,.34); font-size: 10px; }
body[data-clean="true"] .mapping-panel { cursor: auto; }

@media (max-width: 1100px) {
  .composition { grid-template-columns: minmax(430px, 1.1fr) minmax(280px, .9fr); }
  .art-shell,
  body[data-skin="film"] .art-shell,
  body[data-skin="glass"] .art-shell { width: min(54vh, 52vw); }
}
@media (max-aspect-ratio: 4/3) {
  .art-shell,
  body[data-skin="film"] .art-shell,
  body[data-skin="glass"] .art-shell { width: min(48vh, 52vw); }
}


/* ─────────────────────────────────────────────
   V1.3 · synchronized switching + visible center label
   ───────────────────────────────────────────── */
#trackSubtitle[hidden] { display: none !important; }

/* Move the record center beyond the sleeve edge so the artwork label is readable. */
.vinyl-record {
  right: -12%;
  width: 72%;
}
.vinyl-label {
  width: 43%;
  border-width: 4px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,.58),
    0 0 0 7px rgba(255,255,255,.035),
    0 6px 18px rgba(0,0,0,.34);
}
.vinyl-label img {
  transform: scale(1.015);
  transition: object-position 220ms ease;
}
.vinyl-label::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 7%;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.34);
  box-shadow: 0 0 0 1px rgba(0,0,0,.16);
  pointer-events: none;
}
.vinyl-spindle { width: 2.6%; }

/* Large CSS blur filters can stall the first frame of a 4K/8K PNG. Use a short,
   GPU-cheap opacity/scale crossfade; the image is already decoded and resized. */
body[data-skin="stamp"].is-transitioning .art-frame-a,
body[data-skin="film"].is-transitioning .art-frame-a,
body[data-skin="glass"].is-transitioning .art-frame-a,
body[data-skin="stamp"].is-shared-art-transition .art-frame-a,
body[data-skin="film"].is-shared-art-transition .art-frame-a,
body[data-skin="glass"].is-shared-art-transition .art-frame-a {
  animation: sleeveFadeOutV13 300ms cubic-bezier(.22,.72,.25,1) both !important;
}
body[data-skin="stamp"].is-transitioning .art-frame-b,
body[data-skin="film"].is-transitioning .art-frame-b,
body[data-skin="glass"].is-transitioning .art-frame-b,
body[data-skin="stamp"].is-shared-art-transition .art-frame-b,
body[data-skin="film"].is-shared-art-transition .art-frame-b,
body[data-skin="glass"].is-shared-art-transition .art-frame-b {
  animation: sleeveFadeInV13 300ms cubic-bezier(.22,.72,.25,1) both !important;
}
@keyframes sleeveFadeOutV13 {
  from { opacity: 1; transform: translateY(-50%) scale(1); }
  to { opacity: 0; transform: translateY(-50%) scale(.992); }
}
@keyframes sleeveFadeInV13 {
  from { opacity: .08; transform: translateY(-50%) scale(1.008); }
  to { opacity: 1; transform: translateY(-50%) scale(1); }
}
.background-image { transition-duration: 320ms; }

@media (max-width: 900px) {
  .vinyl-record { right: -9%; width: 69%; }
  .vinyl-label { width: 41%; }
}


/* ─────────────────────────────────────────────
   V1.4 · single-pass artwork transition + skin hotkeys
   ───────────────────────────────────────────── */
body { --art-switch-x: 14px; }
body[data-direction="prev"] { --art-switch-x: -14px; }

/* Only the frame performs the entrance. The image itself stays locked to its final crop. */
body.is-transitioning .art-frame img,
body.is-shared-art-transition .art-frame img {
  transition: none !important;
}

body[data-skin="stamp"].is-transitioning .art-frame-a,
body[data-skin="film"].is-transitioning .art-frame-a,
body[data-skin="glass"].is-transitioning .art-frame-a,
body[data-skin="stamp"].is-shared-art-transition .art-frame-a,
body[data-skin="film"].is-shared-art-transition .art-frame-a,
body[data-skin="glass"].is-shared-art-transition .art-frame-a {
  animation: sleeveOutV14 360ms cubic-bezier(.22,.72,.25,1) both !important;
}
body[data-skin="stamp"].is-transitioning .art-frame-b,
body[data-skin="film"].is-transitioning .art-frame-b,
body[data-skin="glass"].is-transitioning .art-frame-b,
body[data-skin="stamp"].is-shared-art-transition .art-frame-b,
body[data-skin="film"].is-shared-art-transition .art-frame-b,
body[data-skin="glass"].is-shared-art-transition .art-frame-b {
  animation: sleeveInV14 360ms cubic-bezier(.18,.78,.22,1) both !important;
}
@keyframes sleeveOutV14 {
  from { opacity: 1; translate: 0 0; scale: 1; }
  to { opacity: 0; translate: calc(var(--art-switch-x) * -.35) 0; scale: .996; }
}
@keyframes sleeveInV14 {
  from { opacity: 0; translate: var(--art-switch-x) 0; scale: 1.006; }
  to { opacity: 1; translate: 0 0; scale: 1; }
}


/* ─────────────────────────────────────────────
   V1.5 · per-track listening start editor
   ───────────────────────────────────────────── */
.mapping-card {
  width: min(1160px, calc(100vw - 56px));
}
.mapping-row {
  grid-template-columns: 44px 58px minmax(190px, .78fr) minmax(430px, 1.42fr);
  grid-template-rows: auto auto;
  align-items: center;
  min-height: 126px;
  padding: 14px 12px;
}
.mapping-number,
.mapping-thumb {
  grid-row: 1 / span 2;
}
.mapping-copy {
  align-self: end;
  padding-bottom: 5px;
}
.mapping-row > select {
  align-self: end;
  margin-bottom: 5px;
}
.start-editor {
  grid-column: 3 / 5;
  display: grid;
  grid-template-columns: auto auto minmax(220px, 1fr) 82px auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 11px 8px;
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.045), rgba(255,255,255,.018)),
    rgba(0,0,0,.14);
}
.start-label {
  color: rgba(255,255,255,.48);
  font-size: 10px;
  letter-spacing: .12em;
  white-space: nowrap;
}
.start-preview-button,
.start-nudge button {
  height: 31px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 8px;
  color: rgba(255,255,255,.78);
  background: rgba(255,255,255,.055);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.start-preview-button {
  min-width: 54px;
  padding: 0 11px;
}
.start-preview-button::before {
  content: "▶";
  display: inline-block;
  margin-right: 6px;
  font-size: 8px;
  transform: translateY(-.5px);
}
.start-preview-button.is-playing {
  color: #131416;
  border-color: transparent;
  background: #f1eee6;
}
.start-preview-button.is-playing::before { content: "■"; }
.start-preview-button:hover,
.start-nudge button:hover {
  color: #fff;
  border-color: rgba(255,255,255,.25);
  background: rgba(255,255,255,.10);
  transform: translateY(-1px);
}
.start-timeline {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.start-range {
  --start-pct: 0%;
  width: 100%;
  height: 20px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
.start-range:disabled { cursor: wait; opacity: .42; }
.start-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background:
    linear-gradient(90deg,
      rgba(240,236,226,.92) 0 var(--start-pct),
      rgba(255,255,255,.13) var(--start-pct) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035);
}
.start-range::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid #16171a;
  border-radius: 50%;
  background: #f2efe7;
  box-shadow: 0 0 0 1px rgba(255,255,255,.35), 0 4px 12px rgba(0,0,0,.38);
}
.start-range::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.13);
}
.start-range::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(240,236,226,.92);
}
.start-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid #16171a;
  border-radius: 50%;
  background: #f2efe7;
}
.start-scale {
  display: flex;
  justify-content: space-between;
  color: rgba(255,255,255,.28);
  font: 8px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.start-time-input {
  width: 82px;
  height: 34px;
  box-sizing: border-box;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 8px;
  outline: none;
  color: #f2efe7;
  background: rgba(0,0,0,.20);
  text-align: center;
  font: 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.start-time-input:focus {
  border-color: rgba(255,255,255,.42);
  box-shadow: 0 0 0 3px rgba(255,255,255,.055);
}
.start-nudge {
  display: grid;
  grid-template-columns: repeat(2, 42px);
  gap: 5px;
}
.start-nudge button {
  width: 42px;
  padding: 0;
  font-size: 9px;
}
.mapping-footer button:disabled {
  opacity: .32;
  cursor: not-allowed;
}

@media (max-width: 930px) {
  .mapping-card { width: calc(100vw - 28px); }
  .mapping-panel { padding: 14px; }
  .mapping-row {
    grid-template-columns: 40px 52px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
  }
  .mapping-number,
  .mapping-thumb { grid-row: 1 / span 2; }
  .mapping-row > select { grid-column: 3; }
  .start-editor {
    grid-column: 1 / -1;
    grid-template-columns: auto auto minmax(150px, 1fr) 82px;
  }
  .start-nudge { display: none; }
}


/* ─────────────────────────────────────────────
   MELODIO TOUCH SHOWCASE OVERRIDES
   右侧完整曲目列表 + 横屏触摸现场展示
   ───────────────────────────────────────────── */
:root {
  --touch-row-height: clamp(48px, 6.3vh, 72px);
}
html, body { overscroll-behavior: none; touch-action: manipulation; }
body { user-select: none; -webkit-user-select: none; }
.app { min-width: 760px; min-height: 420px; }
.stage { inset: clamp(8px, 1.35vw, 22px); padding: clamp(22px, 2.6vw, 46px); }
.stage-header { align-items: center; }
.stage-header .brand-block h1 { font-size: clamp(16px, 1.65vw, 27px); opacity: .78; }
.stage-header .artist { opacity: .46; }
.composition {
  grid-template-columns: minmax(420px, 1.08fr) minmax(360px, .92fr) !important;
  gap: clamp(34px, 4.2vw, 78px);
  padding: clamp(18px, 2.8vh, 36px) 0;
}
.art-shell {
  width: min(68vh, 50vw) !important;
  max-width: 760px;
  cursor: pointer;
  touch-action: pan-y;
}
.touch-album-panel {
  align-self: center;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(12px, 1.5vh, 20px);
  max-height: min(72vh, 690px);
}
.touch-album-heading { display: grid; gap: 4px; }
.touch-album-kicker,
.touch-hint {
  text-transform: uppercase;
  letter-spacing: .17em;
  font-size: clamp(8px, .7vw, 11px);
  opacity: .45;
}
.touch-album-heading h2 {
  margin: 0;
  font: 500 clamp(34px, 4vw, 68px)/1 var(--display-font);
  letter-spacing: -.045em;
}
.touch-now-playing {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-top: 7px;
  font-size: clamp(10px, .9vw, 14px);
  opacity: .62;
}
.touch-now-playing span { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.touch-track-list {
  min-height: 0;
  overflow: auto;
  scrollbar-width: none;
  display: grid;
  align-content: start;
  gap: clamp(5px, .7vh, 9px);
  padding: 2px;
}
.touch-track-list::-webkit-scrollbar { display: none; }
.touch-track-row {
  position: relative;
  width: 100%;
  min-height: var(--touch-row-height);
  border: 0;
  padding: 0 clamp(14px, 1.7vw, 26px);
  display: grid;
  grid-template-columns: 3.4em minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(10px, 1.4vw, 24px);
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 160ms ease, background 180ms ease, color 180ms ease, opacity 180ms ease;
}
.touch-track-row::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scaleX(.94);
  transition: opacity 180ms ease, transform 220ms cubic-bezier(.2,.8,.2,1);
}
.touch-track-row > * { position: relative; z-index: 1; }
.touch-track-row:active { transform: scale(.985); }
.touch-track-row:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 2px var(--color-focus);
}
.touch-track-row .number {
  font: 500 clamp(13px, 1.3vw, 22px)/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  opacity: .52;
}
.touch-track-row .title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 500 clamp(18px, 2vw, 34px)/1.1 var(--display-font);
  letter-spacing: -.025em;
}
.touch-track-row .state-mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: .38;
}
.touch-track-row.is-active::before { opacity: 1; transform: scaleX(1); }
.touch-track-row.is-active .number { opacity: .95; }
.touch-track-row.is-active .state-mark { background: currentColor; opacity: .9; animation: touchPulse 1.4s ease-in-out infinite; }
.touch-track-row[aria-selected="false"] { opacity: .72; }
.touch-track-row[aria-selected="false"]:hover { opacity: 1; }
.touch-hint { line-height: 1.7; }
.legacy-track-copy { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

body[data-skin="stamp"] .touch-track-row::before {
  background: #b94a39;
  box-shadow: inset 0 0 0 1px rgba(37,32,25,.13), 0 7px 20px rgba(96,47,35,.15);
}
body[data-skin="stamp"] .touch-track-row.is-active { color: #fff8e9; }
body[data-skin="stamp"] .touch-album-panel { border-left: 1px dashed rgba(37,32,25,.22); padding-left: clamp(20px, 2.5vw, 42px); }

body[data-skin="film"] .touch-track-row::before {
  background: linear-gradient(90deg, rgba(243,151,77,.94), rgba(196,84,48,.78));
  box-shadow: 0 0 34px rgba(241,142,68,.2);
}
body[data-skin="film"] .touch-track-row.is-active { color: #160f0b; }
body[data-skin="film"] .touch-album-panel { border-left: 1px solid rgba(255,255,255,.12); padding-left: clamp(20px, 2.5vw, 42px); }

body[data-skin="glass"] .touch-track-row::before {
  background: linear-gradient(90deg, rgba(166,224,237,.23), rgba(114,159,188,.14));
  border: 1px solid rgba(195,238,248,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 16px 46px rgba(0,0,0,.24);
  backdrop-filter: blur(16px);
}
body[data-skin="glass"] .touch-track-row.is-active { color: #e9fbff; }
body[data-skin="glass"] .touch-album-panel { border-left: 1px solid rgba(197,236,244,.13); padding-left: clamp(20px, 2.5vw, 42px); }

@keyframes touchPulse { 0%,100% { transform: scale(.76); opacity: .55; } 50% { transform: scale(1); opacity: 1; } }

/* 现场展示默认保留极简底部控制；欢迎层（专辑选择面板）由 is-hidden 控制显隐 */
/* 底部控制面板默认完全不可见，点左下/右下隐形热区（.dock-corner）显隐 */
.control-dock { transform: translateX(-50%) translateY(16px) scale(.88); opacity: 0; pointer-events: none; transition: opacity 220ms ease, transform 220ms ease; }
.control-dock.is-visible { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0) scale(1); }
body[data-clean="true"] .control-dock { display: none !important; }

/* 左下/右下隐形显隐热区（完全透明；按钮布局已居中，角标不压任何按钮，故置于面板之上） */
.dock-corner {
  position: absolute;
  bottom: 0;
  width: 84px;
  height: 84px;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  z-index: 60;
  cursor: pointer;
}
.dock-corner-left { left: 0; }
.dock-corner-right { right: 0; }

@media (max-aspect-ratio: 1.45/1) {
  .composition { grid-template-columns: minmax(350px, .95fr) minmax(340px, 1.05fr) !important; gap: 26px; }
  .art-shell { width: min(61vh, 47vw) !important; }
  .touch-track-row { min-height: clamp(43px, 5.7vh, 62px); }
}
@media (max-height: 620px) {
  .stage { padding: 22px 34px; }
  .stage-header .eyebrow, .stage-header .artist { display: none; }
  .touch-album-heading h2 { font-size: clamp(30px, 3.2vw, 48px); }
  .touch-track-row .title { font-size: clamp(17px, 1.7vw, 27px); }
  .touch-hint { display: none; }
}

/* Web shell: controls stay visible and layout follows viewport, not kiosk aspect ratio. */
:root {
  --web-bg: #090909;
  --web-fg: #eeeae3;
  --web-muted: #8b8985;
  --web-line: rgba(238, 234, 227, .22);
  --web-accent: #ef573f;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html, body { min-width: 0; min-height: 100%; overflow-x: hidden; }
body,
body[data-skin="stamp"],
body[data-skin="film"],
body[data-skin="glass"] {
  color: var(--web-fg);
  background: var(--web-bg);
  cursor: auto;
}

.app {
  min-width: 0;
  min-height: 100dvh;
  overflow: visible;
  padding: 82px 0 112px;
}

.background-image,
.background-veil,
.ambient-noise { opacity: .12 !important; }
.background-veil { background: rgba(0, 0, 0, .86) !important; }
#ambientCanvas { opacity: .16 !important; }

.stage,
body[data-skin="stamp"] .stage,
body[data-skin="film"] .stage,
body[data-skin="glass"] .stage {
  position: relative;
  inset: auto;
  width: 100%;
  min-height: calc(100dvh - 194px);
  padding: clamp(38px, 4vw, 68px) clamp(32px, 4vw, 76px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
  overflow: visible;
}

.stage::before,
.stage::after,
.stamp-decoration,
.film-perforation,
.glass-grid,
.scan-glint { display: none !important; }

.stage-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: 82px;
  padding: 0 clamp(28px, 3vw, 52px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--web-line);
  background: rgba(9, 9, 9, .94);
  backdrop-filter: blur(16px);
}

.wordmark {
  color: inherit;
  font: 600 18px/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .28em;
  text-decoration: none;
}

.stage-header .brand-block { align-items: center; text-align: center; gap: 2px; }
.stage-header .brand-block h1 {
  margin: 0;
  max-width: 28vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--web-fg);
  font: 500 clamp(17px, 1.55vw, 26px)/1.1 var(--display-font);
  opacity: 1;
}
.stage-header .eyebrow { order: 2; color: var(--web-muted); font-size: 9px; letter-spacing: .32em; }
.stage-header .artist { display: none; }
.header-meta { justify-self: end; }
.header-skins { display: flex; gap: 12px; }
.header-skins button,
.mobile-skins button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--web-line);
  border-radius: 2px;
  color: var(--web-fg);
  background: transparent;
  font: 500 13px/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .08em;
  cursor: pointer;
}
.header-skins button span { margin-right: 7px; font-size: 18px; }
.header-skins button.active,
.header-skins button:hover { border-color: rgba(238, 234, 227, .66); background: rgba(255, 255, 255, .06); }

.composition,
body[data-skin="film"] .composition,
body[data-skin="glass"] .composition {
  width: min(1480px, 100%);
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(360px, .98fr) minmax(390px, 1.02fr) !important;
  align-items: center;
  gap: clamp(70px, 8vw, 144px);
}

.art-shell,
body[data-skin="stamp"] .art-shell,
body[data-skin="film"] .art-shell,
body[data-skin="glass"] .art-shell {
  width: min(39vw, 590px) !important;
  max-width: 100%;
  aspect-ratio: 1;
  margin-left: 0;
  transform: none !important;
}
.vinyl-record { right: -36%; width: 92%; height: 92%; }
.art-caption { display: none; }
body[data-skin="stamp"] .art-frame,
body[data-skin="film"] .art-frame,
body[data-skin="glass"] .art-frame {
  border-radius: 2px;
  transform: translateY(-50%) !important;
}
body[data-skin="stamp"] .art-frame { padding: 8px; }
body[data-skin="stamp"] .art-frame::before { display: none; }
body[data-skin="glass"] .art-frame img { border-radius: 0; }

.mobile-skins { display: none; }
.touch-album-panel,
body[data-skin="stamp"] .touch-album-panel,
body[data-skin="film"] .touch-album-panel,
body[data-skin="glass"] .touch-album-panel {
  max-height: none;
  padding-left: 0;
  border-left: 0;
  gap: 16px;
}
.touch-album-kicker,
.touch-now-playing,
.touch-hint { display: none; }
.touch-album-heading h2 {
  margin-bottom: 4px;
  color: var(--web-muted);
  font: 500 17px/1.2 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
}
.touch-track-list { display: block; overflow: auto; max-height: min(61vh, 620px); padding: 0; }
.touch-track-row {
  min-height: clamp(66px, 8vh, 92px);
  padding: 0 18px;
  grid-template-columns: 48px 1px minmax(0, 1fr) auto;
  gap: 22px;
  border-top: 1px solid var(--web-line);
  border-radius: 0;
}
.touch-track-row:last-child { border-bottom: 1px solid var(--web-line); }
.touch-track-row::after {
  content: "";
  width: 1px;
  height: 30%;
  grid-column: 2;
  grid-row: 1;
  background: currentColor;
  opacity: .75;
}
.touch-track-row::before { display: none; }
.touch-track-row .number { grid-column: 1; font: 400 20px/1 ui-monospace, monospace; opacity: .95; }
.touch-track-row .title { grid-column: 3; font: 400 clamp(18px, 1.55vw, 25px)/1.2 var(--display-font); letter-spacing: 0; }
.touch-track-row .state-mark {
  grid-column: 4;
  width: 24px;
  height: 20px;
  border: 0;
  border-radius: 0;
  background: radial-gradient(circle, currentColor 2px, transparent 3px) 0 50% / 8px 8px repeat-x;
  opacity: .9;
}
.touch-track-row.is-active,
body[data-skin="stamp"] .touch-track-row.is-active,
body[data-skin="film"] .touch-track-row.is-active,
body[data-skin="glass"] .touch-track-row.is-active { color: var(--web-accent); }
.touch-track-row.is-active .state-mark {
  width: 28px;
  background: linear-gradient(to top, currentColor 0 55%, transparent 55%) 0 100% / 4px 55% repeat-x;
  animation: meter 850ms ease-in-out infinite alternate;
}
@keyframes meter { to { transform: scaleY(.55); } }

.stage-footer {
  position: fixed;
  z-index: 53;
  left: 330px;
  right: 500px;
  bottom: 0;
  height: 112px;
  padding: 0;
  display: flex;
  align-items: center;
  background: transparent;
  pointer-events: none;
}
.progress-block { width: 100%; pointer-events: auto; }
.progress-track { height: 5px; background: rgba(255, 255, 255, .25); cursor: pointer; }
.progress-track i { background: var(--web-fg); }
.time-row { font: 400 14px/1 ui-monospace, monospace; }
.footer-note { display: none; }

.dock-corner { display: none; }
.control-dock,
.control-dock.is-visible {
  position: fixed;
  inset: auto 0 0;
  z-index: 52;
  width: 100%;
  height: 112px;
  padding: 0 clamp(28px, 3vw, 52px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--web-line);
  border-radius: 0;
  background: rgba(9, 9, 9, .96);
  backdrop-filter: blur(18px);
  box-shadow: none;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.control-dock .primary-controls { gap: 20px; }
.control-dock button,
.control-dock .app-repo-link {
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid var(--web-line);
  border-radius: 2px;
  color: var(--web-fg);
  background: transparent;
  font-size: 14px;
}
.control-dock .app-repo-link { display: inline-flex; align-items: center; text-decoration: none; }
.control-dock .primary-controls button { min-width: 52px; padding: 0 12px; border: 0; font-size: 17px; }
.control-dock .primary-controls .play-button {
  min-width: 68px;
  height: 68px;
  border: 1px solid var(--web-fg);
  border-radius: 50%;
  color: var(--web-fg);
  background: transparent;
  font-size: 21px;
}
.control-dock > .skin-controls { display: none; }
.utility-controls { gap: 14px; }
.utility-controls #motionBtn,
.utility-controls #cleanBtn { display: none; }
.volume-control { display: flex; align-items: center; gap: 10px; margin-right: 8px; }
.volume-control input { width: 100px; accent-color: var(--web-fg); }
.shortcut-help { display: none; }
body[data-clean="true"] .control-dock,
body[data-clean="true"] .stage-footer { display: none !important; }

.welcome-panel,
.mapping-panel { z-index: 100; background: rgba(0, 0, 0, .78); backdrop-filter: blur(12px); }
.welcome-card,
.mapping-card { border-radius: 4px; }

@media (max-width: 1100px) {
  .stage-header { grid-template-columns: auto 1fr; }
  .stage-header .brand-block { display: none; }
  .header-meta { justify-self: end; }
  .header-skins button { padding: 0 12px; font-size: 11px; }
  .composition { gap: 54px; }
  .stage-footer { left: 280px; right: 400px; }
  .control-dock { padding-inline: 22px; }
  .control-dock .primary-controls { gap: 8px; }
  .utility-controls { gap: 8px; }
  .volume-control { display: none; }
}

@media (max-width: 720px) {
  html, body { height: auto; min-height: 100%; overflow: auto; }
  .app { height: auto; min-height: 100dvh; padding: 0 0 224px; }
  .stage,
  body[data-skin="stamp"] .stage,
  body[data-skin="film"] .stage,
  body[data-skin="glass"] .stage {
    min-height: auto;
    padding: 0 22px 48px;
  }
  .stage-header {
    position: relative;
    height: 92px;
    padding: 0;
    display: flex;
    border: 0;
    background: transparent;
    backdrop-filter: none;
  }
  .wordmark { font-size: 17px; }
  .header-meta { display: none; }
  .composition,
  body[data-skin="film"] .composition,
  body[data-skin="glass"] .composition {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 28px;
  }
  .art-shell,
  body[data-skin="stamp"] .art-shell,
  body[data-skin="film"] .art-shell,
  body[data-skin="glass"] .art-shell {
    width: calc(100vw - 68px) !important;
    max-width: 620px;
    justify-self: start;
  }
  .vinyl-record { right: -21%; width: 92%; height: 92%; }
  .mobile-skins {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .mobile-skins button {
    min-width: 0;
    height: 54px;
    padding: 5px;
    display: grid;
    place-items: center;
    gap: 3px;
    font-size: 10px;
  }
  .mobile-skins button > span:first-child { font-size: 20px; }
  .mobile-skins button.active { color: var(--web-accent); border-color: var(--web-accent); }
  .touch-album-panel { gap: 8px; }
  .touch-album-heading h2 { margin: 0 0 5px; font-size: 17px; }
  .touch-track-list { max-height: none; overflow: visible; }
  .touch-track-row {
    min-height: 72px;
    padding: 0 5px;
    grid-template-columns: 44px minmax(0, 1fr) 24px;
    gap: 10px;
  }
  .touch-track-row::after { display: none; }
  .touch-track-row .number { grid-column: 1; font-size: 18px; }
  .touch-track-row .title { grid-column: 2; font-size: clamp(17px, 5.3vw, 23px); white-space: normal; overflow-wrap: anywhere; }
  .touch-track-row .state-mark { grid-column: 3; }
  .stage-footer {
    left: 22px;
    right: 22px;
    bottom: 55px;
    height: 62px;
  }
  .time-row { font-size: 13px; }
  .control-dock,
  .control-dock.is-visible {
    height: 224px;
    padding: 16px 22px 12px;
    display: grid;
    grid-template-rows: 86px 1fr;
    grid-template-columns: 1fr auto;
    align-items: start;
  }
  .control-dock .primary-controls {
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
  .control-dock .primary-controls button,
  .control-dock .primary-controls .play-button {
    justify-self: center;
    width: 64px;
    height: 64px;
    min-width: 64px;
    border: 1px solid var(--web-line);
    border-radius: 2px;
  }
  .control-dock .primary-controls .play-button { color: var(--web-accent); border-color: var(--web-accent); }
  .utility-controls { grid-column: 1 / -1; align-self: end; justify-content: space-between; width: 100%; }
  .utility-controls #loadFolderBtn,
  .utility-controls #mappingBtn { width: 56px; height: 50px; padding: 0; font-size: 0; }
  .utility-controls #loadFolderBtn span,
  .utility-controls #mappingBtn span { font-size: 24px; }
  .welcome-card,
  .mapping-card { width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
}

@media (max-width: 390px) {
  .stage { padding-inline: 18px !important; }
  .art-shell,
  body[data-skin="stamp"] .art-shell,
  body[data-skin="film"] .art-shell,
  body[data-skin="glass"] .art-shell { width: calc(100vw - 54px) !important; }
  .touch-track-row .title { font-size: 18px; }
}


/* --------------------------------------------------------------------------
   Android / WebView performance profile
   Enabled automatically on Android, or manually with ?performance=mobile.
   This keeps the layout, vinyl, track interaction and audio response while
   avoiding the large live blur / blend / repaint costs that overwhelm older
   WebView renderers and emulator GPUs.
   -------------------------------------------------------------------------- */
html[data-performance="mobile"] body {
  --performance-profile: 1;
}

html[data-performance="mobile"] .ambient-noise {
  display: none !important;
}

html[data-performance="mobile"] .control-dock,
html[data-performance="mobile"] .welcome-panel,
html[data-performance="mobile"] .drop-overlay,
html[data-performance="mobile"] .mapping-panel,
html[data-performance="mobile"] body[data-skin="glass"] .stage,
html[data-performance="mobile"] body[data-skin="glass"] .art-frame,
html[data-performance="mobile"] body[data-skin="glass"] .touch-track-row::before {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html[data-performance="mobile"] .control-dock {
  background: rgba(10,10,10,.94);
  box-shadow: 0 12px 34px rgba(0,0,0,.3);
}

html[data-performance="mobile"] .mapping-panel,
html[data-performance="mobile"] .welcome-panel,
html[data-performance="mobile"] .drop-overlay {
  background: rgba(5,6,8,.94);
}

html[data-performance="mobile"] .background-image {
  transform: translate3d(0,0,0) scale(1.12) !important;
  transition: opacity 420ms ease !important;
  will-change: opacity;
}

html[data-performance="mobile"] .background-image.is-active {
  transform: translate3d(0,0,0) scale(1.12) !important;
}

html[data-performance="mobile"] .scan-glint {
  display: none !important;
}

html[data-performance="mobile"] .beat-halo {
  transform: scale(.94) !important;
  opacity: .17 !important;
  box-shadow:
    0 0 0 3.6vw color-mix(in srgb, var(--accent) 5%, transparent),
    0 0 72px color-mix(in srgb, var(--accent) 11%, transparent) !important;
}

html[data-performance="mobile"] body[data-skin="stamp"] #ambientCanvas,
html[data-performance="mobile"] body[data-skin="film"] #ambientCanvas,
html[data-performance="mobile"] body[data-skin="glass"] #ambientCanvas {
  mix-blend-mode: normal !important;
}

html[data-performance="mobile"] body[data-skin="stamp"] #ambientCanvas { opacity: .28 !important; }
html[data-performance="mobile"] body[data-skin="film"] #ambientCanvas { opacity: .42 !important; }
html[data-performance="mobile"] body[data-skin="glass"] #ambientCanvas { opacity: .48 !important; }

html[data-performance="mobile"] body[data-skin="film"] .stage {
  filter: none !important;
}

html[data-performance="mobile"] body[data-skin="film"] .film-perforation {
  filter: none !important;
  background-position-y: 0 !important;
}

html[data-performance="mobile"] body[data-skin="film"] .spectrum-ruler i,
html[data-performance="mobile"] body[data-skin="glass"] .spectrum-ruler i {
  box-shadow: none !important;
}

html[data-performance="mobile"] body[data-skin="glass"] {
  background:
    radial-gradient(circle at 18% 78%, rgba(99,191,186,.14), transparent 38%),
    radial-gradient(circle at 82% 12%, rgba(101,110,190,.16), transparent 42%),
    #071015;
}

html[data-performance="mobile"] body[data-skin="glass"] .stage {
  background:
    linear-gradient(132deg, rgba(12,31,37,.94), rgba(12,13,31,.92)),
    rgba(8,15,20,.96) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 24px 70px rgba(0,0,0,.32) !important;
}

html[data-performance="mobile"] body[data-skin="glass"] .stage::before {
  opacity: .42 !important;
}

html[data-performance="mobile"] body[data-skin="glass"] .stage::after {
  transform: none !important;
  opacity: .28 !important;
}

html[data-performance="mobile"] body[data-skin="glass"] .background-image {
  filter: saturate(.9) brightness(.34) contrast(1.06) !important;
  opacity: .34 !important;
}

html[data-performance="mobile"] body[data-skin="glass"] .glass-grid {
  background-position: 0 0 !important;
  background-size: 64px 64px !important;
  opacity: .12 !important;
}

html[data-performance="mobile"] body[data-skin="glass"] .art-frame {
  background:
    linear-gradient(145deg, rgba(204,246,244,.12), rgba(88,108,145,.09)),
    rgba(9,24,30,.9) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.13),
    0 22px 52px rgba(0,0,0,.34) !important;
  transform: translateY(-50%) !important;
}

html[data-performance="mobile"] body[data-skin="glass"] .art-highlight {
  transform: translateX(-12%) !important;
  opacity: .12 !important;
}

html[data-performance="mobile"] body[data-skin="glass"] .touch-track-row::before {
  background:
    linear-gradient(90deg, rgba(166,224,237,.25), rgba(114,159,188,.15)),
    rgba(35,70,82,.38) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.1),
    0 8px 24px rgba(0,0,0,.2) !important;
}

html[data-performance="mobile"] body[data-skin="glass"] .spectrum-ruler {
  opacity: .46 !important;
}

html[data-performance="mobile"] body.is-transitioning .art-frame-a,
html[data-performance="mobile"] body.is-shared-art-transition .art-frame-a {
  animation-name: performanceArtworkOut !important;
  animation-duration: 360ms !important;
}

html[data-performance="mobile"] body.is-transitioning .art-frame-b,
html[data-performance="mobile"] body.is-shared-art-transition .art-frame-b {
  animation-name: performanceArtworkIn !important;
  animation-duration: 360ms !important;
}

@keyframes performanceArtworkOut {
  from { opacity: 1; transform: translateY(-50%) translate3d(0,0,0) scale(1); }
  to { opacity: 0; transform: translateY(-50%) translate3d(-2.5%,0,0) scale(.985); }
}

@keyframes performanceArtworkIn {
  from { opacity: 0; transform: translateY(-50%) translate3d(3%,0,0) scale(1.02); }
  to { opacity: 1; transform: translateY(-50%) translate3d(0,0,0) scale(1); }
}

html[data-performance="mobile"] body:not(.is-playing) .vinyl-disc-spin {
  animation-play-state: paused !important;
}

html[data-performance="mobile"] body:not(.is-playing) .touch-track-row.is-active .state-mark {
  animation-play-state: paused !important;
}

/* 专辑选择器（外部导入的专辑显示在欢迎面板） */
.album-picker { display: flex; flex-direction: column; gap: 10px; margin: 0 0 4px; }
.album-empty {
  padding: 24px 18px;
  border: 1px dashed rgba(255,255,255,.2);
  border-radius: 13px;
  text-align: center;
  color: rgba(255,255,255,.52);
  font-size: 13px;
  line-height: 1.7;
}
.album-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  background: rgba(255,255,255,.08);
  cursor: pointer;
  text-align: left;
  transition: background .18s ease, transform .18s ease;
}
.album-option:hover { background: rgba(255,255,255,.16); transform: translateY(-1px); }
.album-option.is-selected { outline: 2px solid rgba(255,255,255,.85); background: rgba(255,255,255,.18); }
.album-option-title { font: 600 20px/1.2 var(--display-font); letter-spacing: .04em; }
.album-option-meta { font-size: 11px; letter-spacing: .08em; color: rgba(255,255,255,.5); }

/* 专辑总览里的“导入的专辑”卡片 */
.album-option.is-imported { border-style: dashed; border-color: rgba(255,255,255,.3); }
.album-option.is-imported .album-option-title::before { content: "▣ "; opacity: .55; }

/* 专辑总览选择/删除提示 */
.album-hint { margin-top: 20px; color: rgba(255,255,255,.45); font-size: 11px; letter-spacing: .06em; }

/* 专辑总览关闭按钮 */
.welcome-card { position: relative; }
.welcome-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.75);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.welcome-close:hover { background: rgba(255,255,255,.16); color: #fff; }

/* Final cascade guards for rules inherited from original kiosk stylesheet. */
.app > #ambientCanvas,
.app > .ambient-noise,
.app > .background-image,
.app > .background-veil { pointer-events: none; }
.stage { z-index: 3; }
.control-dock,
.control-dock.is-visible { flex-direction: row; }
.progress-track {
  background-color: rgba(255, 255, 255, .25);
  background-clip: content-box;
}

@media (max-width: 720px) {
  .control-dock,
  .control-dock.is-visible { display: grid; }
}

/* Hallmark UI refinement: one theme control, one dock flow, restrained type. */
html,
body {
  overflow-x: clip;
}

body {
  color: var(--color-ink);
  background: var(--color-canvas);
  font-family: var(--font-body);
}

body[data-skin] {
  --web-bg: var(--color-surface);
  --web-fg: var(--color-ink);
  --web-muted: var(--color-muted);
  --web-line: var(--color-rule);
  --web-accent: var(--color-accent);
  --ui-font: var(--font-body);
  --display-font: var(--font-display);
}

body[data-skin] .stage {
  color: var(--color-ink);
  background: var(--color-surface);
  border-color: var(--color-rule);
  transition:
    background-color var(--dur-medium) var(--ease-out),
    color var(--dur-medium) var(--ease-out),
    border-color var(--dur-medium) var(--ease-out);
}

body[data-skin="stamp"] .stage {
  background-image: repeating-linear-gradient(
    0deg,
    color-mix(in oklch, var(--color-rule) 18%, transparent) 0,
    color-mix(in oklch, var(--color-rule) 18%, transparent) 1px,
    transparent 1px,
    transparent 5px
  );
}

body[data-skin="film"] .stage {
  border-radius: 0;
  border-top: 0;
  border-bottom: 0;
}

body[data-skin="film"] .brand-block h1,
body[data-skin="film"] .touch-album-heading h2,
body[data-skin="film"] .touch-track-row .title,
body[data-skin="terminal"] .brand-block h1,
body[data-skin="terminal"] .touch-album-heading h2,
body[data-skin="terminal"] .touch-track-row .title {
  text-transform: uppercase;
  letter-spacing: 0;
}

body[data-skin="glass"] .stage {
  background-image: linear-gradient(145deg, var(--color-surface), var(--color-surface-2));
  border-radius: 0;
}

.stage-header {
  color: var(--color-dock-ink);
}

body[data-skin] .stage-header .brand-block h1,
body[data-skin] .stage-header .eyebrow,
body[data-skin] .stage-header .artist {
  color: var(--color-dock-ink) !important;
}

body[data-skin] .stage-header .brand-block h1 {
  font: 700 var(--text-md)/1.2 var(--font-display);
  opacity: 1 !important;
}

body[data-skin] .stage-header .eyebrow {
  display: none;
}

.brand-block h1,
.touch-album-heading h2,
.touch-track-row .title,
.mapping-header h2,
.welcome-card h2 {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-style: normal;
  letter-spacing: 0;
}

.theme-menu {
  position: relative;
  color: var(--color-dock-ink);
  font-family: var(--font-body);
}

.theme-menu summary {
  width: 11rem;
  min-height: 2.75rem;
  padding: 0 var(--space-xs);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2xs);
  color: var(--color-dock-ink);
  background: var(--color-dock);
  border: var(--rule-thin) solid color-mix(in oklch, var(--color-dock-ink) 24%, transparent);
  border-radius: var(--radius-control);
  list-style: none;
  cursor: pointer;
}

.theme-menu summary::-webkit-details-marker {
  display: none;
}

.theme-menu-label {
  color: var(--color-dock-muted);
  font-size: var(--text-xs);
}

.theme-menu summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-dock-ink);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.theme-menu-chevron {
  color: var(--color-dock-muted);
  transition: transform var(--dur-short) var(--ease-out);
}

.theme-menu[open] .theme-menu-chevron {
  transform: rotate(180deg);
}

.theme-menu-list {
  position: absolute;
  top: calc(100% + var(--space-2xs));
  right: 0;
  z-index: 5;
  width: 19rem;
  max-height: min(60vh, 30rem);
  padding: var(--space-2xs);
  display: grid;
  gap: var(--space-3xs);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  color: var(--color-dock-ink);
  background: var(--color-dock);
  border: var(--rule-thin) solid color-mix(in oklch, var(--color-dock-ink) 24%, transparent);
  border-radius: var(--radius-panel);
  box-shadow: 0 1rem 2.5rem var(--color-shadow);
}

.theme-menu-list button {
  width: 100%;
  min-height: 3.75rem;
  padding: var(--space-2xs);
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-dock-ink);
  background: transparent;
  border: var(--rule-thin) solid transparent;
  border-radius: var(--radius-control);
  text-align: left;
  cursor: pointer;
}

.theme-menu-list button:hover,
.theme-menu-list button.active {
  background: color-mix(in oklch, var(--color-dock-ink) 10%, transparent);
  border-color: color-mix(in oklch, var(--color-dock-ink) 18%, transparent);
}

.theme-menu-list button > span:last-child {
  min-width: 0;
  display: grid;
  gap: var(--space-3xs);
}

.theme-menu-list button strong {
  font-size: var(--text-sm);
}

.theme-menu-list button small {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-dock-muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.theme-swatch {
  width: 2rem;
  height: 2rem;
  border: var(--rule-thin) solid color-mix(in oklch, var(--color-dock-ink) 24%, transparent);
  border-radius: 50%;
}

.theme-swatch-stamp {
  background: linear-gradient(135deg, var(--swatch-stamp-paper) 0 68%, var(--swatch-stamp-accent) 68%);
}

.theme-swatch-film {
  background: linear-gradient(135deg, var(--swatch-film-paper) 0 68%, var(--swatch-film-accent) 68%);
}

.theme-swatch-glass {
  background: linear-gradient(135deg, var(--swatch-glass-paper) 0 68%, var(--swatch-glass-accent) 68%);
}

.theme-swatch-terminal {
  background: linear-gradient(135deg, var(--swatch-terminal-paper) 0 68%, var(--swatch-terminal-accent) 68%);
}

.theme-swatch-riso {
  background: linear-gradient(135deg, var(--swatch-riso-paper) 0 68%, var(--swatch-riso-accent) 68%);
}

.theme-swatch-carbon {
  background: linear-gradient(135deg, var(--swatch-carbon-paper) 0 68%, var(--swatch-carbon-accent) 68%);
}

.theme-swatch-instrument {
  background: linear-gradient(135deg, var(--swatch-instrument-paper) 0 68%, var(--swatch-instrument-accent) 68%);
}

.theme-swatch-pulse {
  background: linear-gradient(135deg, var(--swatch-pulse-paper) 0 68%, var(--swatch-pulse-accent) 68%);
}

.theme-swatch-prism {
  background:
    radial-gradient(circle at 35% 28%, white 0 8%, transparent 9%),
    conic-gradient(from 210deg, var(--swatch-prism-paper), var(--swatch-prism-accent), var(--swatch-prism-paper));
}

.header-skins,
.mobile-skins,
.skin-controls {
  display: none !important;
}

.control-dock,
.control-dock.is-visible {
  min-height: 6.5rem;
  height: auto;
  padding: var(--space-sm) clamp(1.25rem, 3vw, 3.25rem);
  display: grid;
  grid-template-columns: auto minmax(16rem, 1fr) auto;
  grid-template-areas: "transport timeline utilities";
  align-items: center;
  gap: clamp(1.25rem, 2.5vw, 3rem);
  color: var(--color-dock-ink);
  background: var(--color-dock);
  border-top: var(--rule-thin) solid color-mix(in oklch, var(--color-dock-ink) 18%, transparent);
  backdrop-filter: none;
}

.control-dock .primary-controls {
  grid-area: transport;
  display: grid;
  grid-template-columns: repeat(3, 3rem);
  gap: var(--space-2xs);
}

.control-dock .primary-controls button,
.control-dock .primary-controls .play-button {
  width: 3rem;
  min-width: 3rem;
  height: 3rem;
  min-height: 3rem;
  padding: 0;
  border: var(--rule-thin) solid transparent;
  border-radius: 50%;
  color: var(--color-dock-ink);
  background: transparent;
  font-size: var(--text-md);
  line-height: 1;
  display: grid;
  place-items: center;
}

.control-dock .primary-controls .play-button {
  border-color: var(--color-dock-ink);
  color: var(--color-dock);
  background: var(--color-dock-ink);
  font-size: 0;
}

.control-dock .primary-controls .play-button::before {
  content: none;
}

body:not(.is-playing) .control-dock .primary-controls .play-icon {
  width: 0;
  height: 0;
  border-top: 0.55rem solid transparent;
  border-bottom: 0.55rem solid transparent;
  border-left: 0.9rem solid currentColor;
  transform: translateX(0.16rem);
}

body.is-playing .control-dock .primary-controls .play-icon {
  width: 0.95rem;
  height: 1.1rem;
  background: linear-gradient(90deg, currentColor 0 31%, transparent 31% 69%, currentColor 69%);
}

@media (min-width: 51.3125rem) {
  .app {
    padding-bottom: 6.5rem;
  }

  .stage,
  body[data-skin="stamp"] .stage,
  body[data-skin="film"] .stage,
  body[data-skin="glass"] .stage {
    height: calc(100dvh - 82px - 6.5rem);
    min-height: calc(100dvh - 82px - 6.5rem);
    grid-template-rows: minmax(0, 1fr);
  }

  .composition {
    align-self: center;
  }
}

@media (min-width: 51.3125rem) and (max-aspect-ratio: 6 / 5) {
  .composition,
  body[data-skin="film"] .composition,
  body[data-skin="glass"] .composition {
    grid-template-columns: minmax(26rem, 1.04fr) minmax(24rem, 0.96fr) !important;
    gap: clamp(3rem, 6vw, 6rem);
  }

  .art-shell,
  body[data-skin="stamp"] .art-shell,
  body[data-skin="film"] .art-shell,
  body[data-skin="glass"] .art-shell {
    width: min(46vw, 58dvh, 40rem) !important;
  }

  .touch-album-panel,
  body[data-skin="stamp"] .touch-album-panel,
  body[data-skin="film"] .touch-album-panel,
  body[data-skin="glass"] .touch-album-panel {
    max-height: min(72dvh, 47.5rem);
  }

  .touch-track-list {
    max-height: min(65dvh, 45rem);
  }
}

.stage-footer {
  position: static;
  grid-area: timeline;
  width: 100%;
  height: auto;
  min-width: 0;
  padding: 0;
  display: block;
  color: var(--color-dock-ink);
  background: transparent;
  pointer-events: auto;
}

.progress-block {
  width: 100%;
}

.progress-track {
  height: 3px;
  color: var(--color-dock-ink);
  background-color: color-mix(in oklch, var(--color-dock-ink) 25%, transparent);
}

.progress-track i {
  background: var(--color-accent);
}

.time-row {
  margin-top: var(--space-2xs);
  color: var(--color-dock-muted);
  font: 500 var(--text-xs)/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.footer-note {
  display: none;
}

.utility-controls {
  grid-area: utilities;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2xs);
  min-width: 0;
}

.control-dock button,
.control-dock .app-repo-link,
.more-controls summary {
  min-height: 2.75rem;
  padding: 0 var(--space-xs);
  border: var(--rule-thin) solid color-mix(in oklch, var(--color-dock-ink) 22%, transparent);
  border-radius: var(--radius-control);
  color: var(--color-dock-ink);
  background: transparent;
  font: 600 var(--text-xs)/1 var(--font-body);
  white-space: nowrap;
}

.control-dock .app-repo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  text-decoration: none;
}

.volume-control {
  gap: var(--space-2xs);
  margin-right: var(--space-2xs);
  color: var(--color-dock-muted);
}

.volume-control input {
  width: 5.5rem;
  accent-color: var(--color-accent);
}

.more-controls {
  position: relative;
}

.more-controls summary {
  width: 2.75rem;
  padding: 0;
  display: grid;
  place-items: center;
  list-style: none;
  cursor: pointer;
  font-size: var(--text-md);
}

.more-controls summary::-webkit-details-marker {
  display: none;
}

.more-controls-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + var(--space-2xs));
  width: 15rem;
  padding: var(--space-2xs);
  display: grid;
  gap: var(--space-2xs);
  color: var(--color-dock-ink);
  background: var(--color-dock);
  border: var(--rule-thin) solid color-mix(in oklch, var(--color-dock-ink) 22%, transparent);
  border-radius: var(--radius-panel);
}

.more-controls-menu button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.more-controls-menu .setting-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 1.5rem;
  align-items: center;
  gap: var(--space-2xs);
}

.toggle-track {
  width: 2rem;
  height: 1.125rem;
  padding: 2px;
  display: block;
  border: var(--rule-thin) solid color-mix(in oklch, var(--color-dock-ink) 28%, transparent);
  border-radius: 999px;
  background: color-mix(in oklch, var(--color-dock-ink) 8%, transparent);
}

.toggle-track i {
  width: 0.75rem;
  height: 0.75rem;
  display: block;
  border-radius: 50%;
  background: var(--color-dock-muted);
  transition: transform var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out);
}

.setting-toggle[aria-pressed="true"] .toggle-track {
  border-color: var(--color-accent);
  background: color-mix(in oklch, var(--color-accent) 24%, transparent);
}

.setting-toggle[aria-pressed="true"] .toggle-track i {
  background: var(--color-accent);
  transform: translateX(0.875rem);
}

.toggle-state {
  color: var(--color-dock-muted);
  text-align: right;
}

.shortcut-help {
  padding: var(--space-2xs);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3xs) var(--space-2xs);
  color: var(--color-dock-muted);
  font: 500 0.6875rem/1.35 var(--font-mono);
}

.control-dock button:hover,
.control-dock .app-repo-link:hover,
.more-controls summary:hover {
  color: var(--color-dock-ink);
  background: color-mix(in oklch, var(--color-dock-ink) 10%, transparent);
  transform: none;
}

.control-dock button:active,
.control-dock .app-repo-link:active,
.more-controls summary:active {
  transform: translateY(1px);
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.mapping-panel,
.welcome-panel {
  position: fixed;
  inset: 0;
  color: var(--color-dock-ink);
  background: var(--color-overlay);
  backdrop-filter: none;
}

.mapping-card,
.welcome-card {
  color: var(--color-dock-ink);
  background: var(--color-modal);
  border: var(--rule-thin) solid color-mix(in oklch, var(--color-dock-ink) 18%, transparent);
  border-radius: var(--radius-panel);
  box-shadow: 0 2rem 6rem var(--color-shadow);
  font-family: var(--font-body);
}

.mapping-card {
  width: min(74rem, calc(100% - 3rem));
  max-height: min(52rem, calc(100dvh - 3rem));
}

.mapping-panel {
  place-items: center;
  overflow: hidden;
}

.mapping-list {
  overscroll-behavior: contain;
  touch-action: pan-y;
}

body[data-skin="glass"] .spectrum-ruler {
  left: 6%;
  right: 6%;
  bottom: 7%;
  width: auto;
  height: 6rem;
  align-items: center;
  gap: 3px;
  transform: none;
  opacity: calc(0.42 + var(--energy) * 0.42);
  mask-image: linear-gradient(90deg, transparent, var(--color-ink) 10%, var(--color-ink) 90%, transparent);
}

body[data-skin="glass"] .spectrum-ruler::before {
  content: "";
}

body[data-skin="glass"] .spectrum-ruler i {
  border-radius: 2px;
  background: color-mix(in oklch, var(--color-accent) 78%, var(--color-ink));
  box-shadow: none;
  transform-origin: center;
  opacity: 0.7;
}

/* Glass Tides: local translucency, refracted edges, separate luminous depth plane. */
body[data-skin="glass"] .stage {
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 14%, color-mix(in oklch, white 42%, transparent), transparent 30%),
    radial-gradient(circle at 82% 72%, color-mix(in oklch, var(--color-accent) 22%, transparent), transparent 38%),
    linear-gradient(145deg, color-mix(in oklch, var(--color-surface) 82%, transparent), color-mix(in oklch, var(--color-surface-2) 72%, transparent));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.7), inset 0 -1px 0 rgb(29 112 135 / 0.35);
  backdrop-filter: blur(28px) saturate(1.35);
}

body[data-skin="glass"] .stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(112deg, transparent 5% 37%, rgb(255 255 255 / 0.28) 44%, transparent 51% 100%);
  mix-blend-mode: soft-light;
}

body[data-skin="glass"] .art-frame {
  border: 1px solid rgb(255 255 255 / 0.72);
  background: rgb(221 249 255 / 0.2);
  box-shadow:
    inset 0 0 0 1px rgb(80 180 205 / 0.2),
    inset 0 1px 0 rgb(255 255 255 / 0.8),
    0 2rem 5rem rgb(0 48 68 / 0.28),
    0 0 2.5rem color-mix(in oklch, var(--color-accent) 18%, transparent);
  backdrop-filter: blur(18px) saturate(1.28);
}

body[data-skin="glass"] .art-highlight {
  display: block;
  background:
    linear-gradient(118deg, rgb(255 255 255 / 0.48), transparent 22% 68%, rgb(100 220 245 / 0.2)),
    radial-gradient(circle at 78% 18%, rgb(255 255 255 / 0.36), transparent 24%);
  mix-blend-mode: screen;
  opacity: 0.72;
}

body[data-skin="glass"] .spectrum-ruler {
  z-index: 4;
  padding: 0.7rem 1rem;
  border-top: 1px solid rgb(255 255 255 / 0.5);
  border-bottom: 1px solid rgb(50 160 190 / 0.28);
  background: rgb(202 244 252 / 0.12);
  box-shadow: 0 1.2rem 3rem rgb(0 57 77 / 0.16), inset 0 1px 0 rgb(255 255 255 / 0.28);
  backdrop-filter: blur(14px) saturate(1.45);
}

body[data-skin="glass"] .control-dock,
body[data-skin="glass"] .theme-menu-list,
body[data-skin="glass"] .more-controls-menu {
  background: color-mix(in oklch, var(--color-dock) 78%, transparent);
  border-color: rgb(210 249 255 / 0.28);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.16), 0 -1rem 3rem rgb(0 35 54 / 0.2);
  backdrop-filter: blur(24px) saturate(1.35);
}

/* Black Frequency: one matte field, artwork and two signal colors carry state. */
body[data-skin="carbon"] .stage {
  background: var(--color-surface);
  border: 0;
  border-radius: 0;
}

body[data-skin="carbon"] .art-frame {
  padding: 0;
  border: 1px solid rgb(255 255 255 / 0.68);
  border-radius: 0;
  box-shadow: none;
}

body[data-skin="carbon"] .touch-track-row {
  border-color: rgb(255 255 255 / 0.13);
}

body[data-skin="carbon"] .touch-track-row::before {
  display: none;
}

body[data-skin="carbon"] .touch-track-row.is-active {
  color: oklch(14% 0.02 135) !important;
  background: var(--color-accent);
}

body[data-skin="carbon"] .touch-track-row.is-active .number,
body[data-skin="carbon"] .touch-track-row.is-active .title,
body[data-skin="carbon"] .touch-track-row.is-active .state-mark {
  color: inherit;
  opacity: 1;
}

body[data-skin="carbon"] .spectrum-ruler {
  left: 4%;
  right: 4%;
  bottom: 5%;
  width: auto;
  height: 5rem;
  transform: none;
}

body[data-skin="carbon"] .spectrum-ruler i {
  border-radius: 0;
  background: var(--color-accent);
  box-shadow: none;
}

/* Precision Instrument: brushed alloy, machined edges, physical controls. */
body[data-skin="instrument"] .stage {
  background:
    repeating-linear-gradient(90deg, rgb(255 255 255 / 0.08) 0 1px, transparent 1px 4px),
    linear-gradient(160deg, var(--color-surface), var(--color-surface-2));
  box-shadow: inset 0 1px 0 white, inset 0 -1px 0 rgb(40 50 60 / 0.35);
}

body[data-skin="instrument"] .art-frame {
  padding: 0.45rem;
  border: 1px solid rgb(255 255 255 / 0.82);
  border-radius: 4px;
  background: linear-gradient(145deg, rgb(255 255 255 / 0.65), rgb(80 90 100 / 0.18));
  box-shadow: inset 0 0 0 1px rgb(30 40 55 / 0.25), 0 1.25rem 2.5rem rgb(20 30 40 / 0.24);
}

body[data-skin="instrument"] .control-dock button,
body[data-skin="instrument"] .control-dock .app-repo-link,
body[data-skin="instrument"] .more-controls summary {
  border-color: rgb(255 255 255 / 0.24);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.1), rgb(0 0 0 / 0.1));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.16), 0 1px 2px rgb(0 0 0 / 0.34);
}

body[data-skin="instrument"] .touch-track-row.is-active::before {
  opacity: 1;
  background: color-mix(in oklch, var(--color-accent) 16%, transparent);
  border-left: 4px solid var(--color-accent);
}

/* Warm Pulse: waveform is content, orange stays a single high-energy signal. */
body[data-skin="pulse"] .stage {
  background: var(--color-surface);
  border-radius: 0;
}

body[data-skin="pulse"] .art-frame {
  border: 0;
  border-radius: 0;
  box-shadow: 0 1.5rem 3.5rem rgb(71 45 24 / 0.2);
}

body[data-skin="pulse"] .spectrum-ruler {
  left: 3%;
  right: 3%;
  bottom: 4%;
  width: auto;
  height: 8rem;
  transform: none;
  opacity: calc(0.7 + var(--energy) * 0.3);
}

body[data-skin="pulse"] .spectrum-ruler i {
  border-radius: 999px;
  background: var(--color-accent);
  box-shadow: none;
}

body[data-skin="pulse"] .touch-track-row.is-active::before {
  display: none;
}

body[data-skin="pulse"] .touch-track-row.is-active {
  color: white !important;
  background: var(--color-accent);
}

body[data-skin="pulse"] .touch-track-row.is-active .number,
body[data-skin="pulse"] .touch-track-row.is-active .title,
body[data-skin="pulse"] .touch-track-row.is-active .state-mark {
  color: inherit;
  opacity: 1;
}

/* Liquid Prism: real perspective hierarchy using existing record geometry. */
body[data-skin="prism"] .stage {
  overflow: hidden;
  perspective: 1200px;
  background:
    radial-gradient(circle at 23% 28%, color-mix(in oklch, var(--color-accent) 24%, transparent), transparent 30%),
    radial-gradient(circle at 78% 66%, oklch(66% 0.18 310 / 0.18), transparent 34%),
    linear-gradient(145deg, var(--color-surface), var(--color-canvas));
  border: 0;
  border-radius: 0;
}

body[data-skin="prism"] .composition {
  perspective: 1000px;
  transform-style: preserve-3d;
}

body[data-skin="prism"] .art-shell {
  perspective: 900px;
  transform-style: preserve-3d;
  transform: rotateX(4deg) rotateY(-12deg) !important;
  transition: transform 500ms var(--ease-out);
}

body[data-skin="prism"] .art-frame {
  overflow: visible;
  transform: translateY(-50%) translateZ(3rem) !important;
  border: 1px solid rgb(220 255 255 / 0.58);
  border-radius: 10px;
  background: rgb(180 240 255 / 0.1);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.7),
    inset -1rem -1rem 2.5rem rgb(25 175 190 / 0.12),
    1.8rem 2.2rem 5rem rgb(0 0 0 / 0.5),
    0 0 3rem color-mix(in oklch, var(--color-accent) 20%, transparent);
  backdrop-filter: blur(8px) saturate(1.3);
}

body[data-skin="prism"] .art-frame img {
  border-radius: 8px;
  filter: saturate(1.12) contrast(1.04);
}

body[data-skin="prism"] .vinyl-record {
  transform: translateY(-50%) translateZ(-2rem) rotateY(10deg);
  filter: drop-shadow(1.5rem 2rem 2rem rgb(0 0 0 / 0.55));
}

body[data-skin="prism"] .vinyl-disc-spin {
  background:
    radial-gradient(circle at center, transparent 0 16%, rgb(6 10 20 / 0.95) 16.5% 18%, transparent 18.5%),
    repeating-radial-gradient(circle, rgb(210 255 255 / 0.08) 0 1px, rgb(4 8 16 / 0.96) 1.5px 4px),
    conic-gradient(from 20deg, #03050b, #59d9db 14%, #07111d 25%, #9f82d8 43%, #03050b 58%, #62dde1 76%, #03050b);
  box-shadow: inset 0 0 2rem rgb(199 255 255 / 0.16), 0 0 0 1px rgb(220 255 255 / 0.32);
}

body[data-skin="prism"] .glass-grid {
  display: block;
  inset: 6%;
  opacity: 0.34;
  transform: rotateX(64deg) translateY(35%);
  transform-origin: center bottom;
  background-image:
    linear-gradient(color-mix(in oklch, var(--color-accent) 18%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in oklch, var(--color-accent) 18%, transparent) 1px, transparent 1px);
  background-size: 3rem 3rem;
}

body[data-skin="prism"] .spectrum-ruler {
  left: 52%;
  right: 6%;
  bottom: 8%;
  width: auto;
  height: 7rem;
  transform: perspective(500px) rotateX(18deg) rotateY(-8deg);
  filter: drop-shadow(0 0 0.8rem color-mix(in oklch, var(--color-accent) 48%, transparent));
}

body[data-skin="prism"] .spectrum-ruler i {
  border-radius: 999px;
  background: var(--color-accent);
  box-shadow: 0 0 0.75rem color-mix(in oklch, var(--color-accent) 55%, transparent);
}

body[data-skin="prism"] .touch-track-row.is-active::before {
  background: color-mix(in oklch, var(--color-accent) 18%, transparent);
  border: 1px solid color-mix(in oklch, var(--color-accent) 48%, transparent);
  backdrop-filter: blur(10px);
}

@media (hover: hover) and (pointer: fine) {
  body[data-skin="prism"] .art-shell:hover {
    transform: rotateX(1deg) rotateY(-6deg) translateY(-0.3rem) !important;
  }
}

body[data-skin="terminal"] .stage {
  background-image: repeating-linear-gradient(
    0deg,
    color-mix(in oklch, var(--color-accent) 8%, transparent) 0,
    color-mix(in oklch, var(--color-accent) 8%, transparent) 1px,
    transparent 1px,
    transparent 4px
  );
}

body[data-skin="terminal"] .spectrum-ruler {
  left: 4%;
  right: 4%;
  bottom: 6%;
  width: auto;
  height: 7rem;
  transform: none;
  opacity: calc(0.48 + var(--energy) * 0.42);
}

body[data-skin="terminal"] .spectrum-ruler::before {
  content: "FFT::LIVE";
  color: var(--color-accent);
  font-family: var(--font-mono);
}

body[data-skin="terminal"] .spectrum-ruler i {
  border-radius: 0;
  background: var(--color-accent);
  box-shadow: none;
}

body[data-skin="riso"] .stage {
  background-image: radial-gradient(
    circle,
    color-mix(in oklch, var(--color-accent) 10%, transparent) 0 1px,
    transparent 1.5px
  );
  background-size: 7px 7px;
}

body[data-skin="riso"] .art-frame {
  filter: contrast(1.08) saturate(0.82);
  box-shadow: 10px 10px 0 color-mix(in oklch, var(--color-accent) 38%, transparent);
}

body[data-skin="riso"] .spectrum-ruler {
  left: 56%;
  right: 5%;
  bottom: 8%;
  width: auto;
  height: 6rem;
  transform: rotate(-1deg);
}

body[data-skin="riso"] .spectrum-ruler i {
  border-radius: 0;
  background: var(--color-accent);
  opacity: 0.55;
}

.mapping-header {
  align-items: flex-start;
  padding: var(--space-lg);
  border-bottom-color: color-mix(in oklch, var(--color-dock-ink) 14%, transparent);
}

.mapping-eyebrow,
.welcome-eyebrow {
  display: none;
}

.mapping-header h2 {
  margin: 0 0 var(--space-2xs);
  font-size: var(--text-xl);
  font-weight: 650;
  line-height: 1.15;
}

.mapping-header p {
  max-width: 58rem;
  margin: 0;
  color: var(--color-dock-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.mapping-header code,
.format-tip code {
  color: var(--color-dock-ink);
  background: var(--color-modal-2);
  font-family: var(--font-mono);
}

.mapping-close,
.welcome-close {
  width: 2.75rem;
  height: 2.75rem;
  color: var(--color-dock-ink);
  background: transparent;
  border-color: color-mix(in oklch, var(--color-dock-ink) 18%, transparent);
  font-size: var(--text-lg);
}

.mapping-list {
  padding: var(--space-xs) var(--space-md) var(--space-md);
}

.mapping-row {
  min-height: 0;
  padding: var(--space-sm) 0;
  display: grid;
  grid-template-columns: 2.25rem 3rem minmax(10rem, 0.65fr) minmax(18rem, 1.35fr);
  gap: var(--space-xs);
  border-bottom-color: color-mix(in oklch, var(--color-dock-ink) 12%, transparent);
}

.mapping-number {
  color: var(--color-dock-muted);
  font: 500 var(--text-sm)/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.mapping-thumb {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-control);
  border-color: color-mix(in oklch, var(--color-dock-ink) 18%, transparent);
}

.mapping-copy {
  gap: var(--space-3xs);
}

.mapping-copy strong {
  font-size: var(--text-sm);
  font-weight: 650;
}

.mapping-copy span {
  color: var(--color-dock-muted);
  font: 500 var(--text-xs)/1.35 var(--font-mono);
}

.mapping-row > select {
  min-height: 2.75rem;
  padding: 0 2.25rem 0 var(--space-xs);
  color: var(--color-dock-ink);
  background: var(--color-modal-2);
  border-color: color-mix(in oklch, var(--color-dock-ink) 18%, transparent);
  border-radius: var(--radius-control);
  font: 600 var(--text-sm)/1 var(--font-body);
}

.mapping-row > .start-editor {
  grid-column: 3 / -1;
  min-width: 0;
  padding: var(--space-xs);
  display: grid;
  grid-template-columns: auto auto minmax(10rem, 1fr) 7rem auto;
  align-items: center;
  gap: var(--space-2xs);
  color: var(--color-dock-muted);
  background: var(--color-modal-2);
  border-color: color-mix(in oklch, var(--color-dock-ink) 14%, transparent);
  border-radius: var(--radius-control);
}

.start-label,
.start-scale {
  color: var(--color-dock-muted);
  font-size: var(--text-xs);
}

.start-preview-button,
.start-nudge button,
.mapping-footer button {
  min-height: 2.5rem;
  white-space: nowrap;
  color: var(--color-dock-ink);
  background: transparent;
  border-color: color-mix(in oklch, var(--color-dock-ink) 18%, transparent);
  border-radius: var(--radius-control);
  font: 600 var(--text-xs)/1 var(--font-body);
}

.start-time-input {
  min-width: 0;
  height: 2.5rem;
  color: var(--color-dock-ink);
  background: var(--color-modal);
  border-color: color-mix(in oklch, var(--color-dock-ink) 18%, transparent);
  border-radius: var(--radius-control);
  font: 600 var(--text-sm)/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.start-range {
  accent-color: var(--color-accent);
}

.mapping-footer {
  padding: var(--space-sm) var(--space-lg);
  gap: var(--space-2xs);
  border-top-color: color-mix(in oklch, var(--color-dock-ink) 14%, transparent);
}

.mapping-footer button:first-child {
  color: var(--color-dock);
  background: var(--color-dock-ink);
  border-color: transparent;
}

.mapping-footer span {
  color: var(--color-dock-muted);
  font-size: var(--text-xs);
}

.welcome-card {
  padding: var(--space-lg);
}

.welcome-card h2 {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-xl);
  line-height: 1.15;
}

.welcome-card > p {
  color: var(--color-dock-muted);
  font-size: var(--text-sm);
  line-height: 1.65;
}

.art-frame img:not([src]),
.art-frame img[src=""] {
  visibility: hidden;
}

@media (max-width: 80rem) {
  .control-label,
  .volume-control > span {
    display: none;
  }

  .volume-control input {
    width: 4.5rem;
  }

  .control-dock,
  .control-dock.is-visible {
    grid-template-columns: auto minmax(12rem, 1fr) auto;
    gap: var(--space-sm);
  }
}

@media (max-width: 51.25rem) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: clip !important;
    overscroll-behavior-y: auto !important;
    touch-action: pan-y !important;
  }

  html {
    overflow-y: auto !important;
  }

  body {
    overflow-y: visible !important;
  }

  .app {
    position: relative;
    height: auto;
    min-height: 100dvh;
    min-width: 0;
    overflow: visible !important;
    padding-bottom: 11rem;
    touch-action: pan-y;
  }

  .stage,
  body[data-skin="stamp"] .stage,
  body[data-skin="film"] .stage,
  body[data-skin="glass"] .stage,
  .composition,
  .touch-album-panel,
  .touch-track-list {
    position: relative;
    inset: auto;
    max-height: none !important;
    overflow: visible !important;
    touch-action: pan-y;
  }

  .stage-header {
    height: 4.5rem;
    padding: 0 var(--space-sm);
    display: flex;
    align-items: center;
  }

  body[data-skin="prism"] .art-shell {
    transform: rotateY(-4deg) !important;
  }

  body[data-skin="prism"] .art-frame {
    transform: translateY(-50%) translateZ(1rem) !important;
  }

  .header-meta {
    display: block;
    margin-left: auto;
  }

  .theme-menu-label {
    display: none;
  }

  .theme-menu summary {
    width: 8.75rem;
  }

  .theme-menu-list {
    position: fixed;
    top: 4.25rem;
    right: var(--space-sm);
    width: min(19rem, calc(100vw - 2rem));
  }

  .control-dock,
  .control-dock.is-visible {
    min-height: 0;
    padding: var(--space-xs) var(--space-sm);
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "timeline"
      "transport"
      "utilities";
    gap: var(--space-2xs);
  }

  .control-dock .primary-controls {
    justify-self: center;
    grid-template-columns: repeat(3, 3rem);
  }

  .stage-footer {
    width: 100%;
  }

  .utility-controls {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .volume-control {
    display: none;
  }

  .utility-controls #loadFolderBtn,
  .utility-controls #mappingBtn,
  .utility-controls .app-repo-link,
  .utility-controls .more-controls summary {
    width: 100%;
    min-width: 0;
    height: 2.75rem;
    padding: 0 var(--space-2xs);
    justify-content: center;
  }

  .utility-controls #loadFolderBtn,
  .utility-controls #mappingBtn {
    font-size: 0;
  }

  .utility-controls #loadFolderBtn span,
  .utility-controls #mappingBtn span,
  .utility-controls .app-repo-link > span:first-child {
    font-size: var(--text-lg);
  }

  .more-controls-menu {
    right: 0;
    width: min(15rem, calc(100vw - 2rem));
  }

  .mapping-panel {
    padding: var(--space-2xs);
  }

  .mapping-card {
    width: calc(100% - var(--space-2xs));
    max-height: calc(100dvh - var(--space-sm));
  }

  .mapping-header {
    padding: var(--space-sm);
    gap: var(--space-xs);
  }

  .mapping-header h2 {
    font-size: var(--text-lg);
  }

  .mapping-header p {
    font-size: var(--text-xs);
  }

  .mapping-list {
    padding: var(--space-2xs) var(--space-sm) var(--space-sm);
  }

  .mapping-row {
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: var(--space-2xs) var(--space-xs);
  }

  .mapping-number {
    grid-column: 1;
  }

  .mapping-thumb {
    display: none;
  }

  .mapping-copy {
    grid-column: 2;
  }

  .mapping-row > select,
  .mapping-row > .start-editor {
    grid-column: 1 / -1;
  }

  .mapping-row > .start-editor {
    grid-template-columns: auto minmax(0, 1fr) 6.5rem;
  }

  .start-label {
    display: none;
  }

  .start-preview-button {
    grid-column: 1;
  }

  .start-timeline {
    grid-column: 2;
  }

  .start-time-input {
    grid-column: 3;
  }

  .start-nudge {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .mapping-footer {
    padding: var(--space-xs) var(--space-sm);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mapping-footer span {
    display: none;
  }

  .mapping-footer button {
    width: 100%;
    padding: 0 var(--space-2xs);
  }
}

@media (max-width: 26rem) {
  .stage {
    padding-inline: var(--space-sm) !important;
  }

  .wordmark {
    font-size: var(--text-sm);
  }

  .theme-menu summary {
    width: 7.75rem;
    min-height: 2.25rem;
  }

  .app {
    padding-bottom: 10.5rem;
  }

  .mapping-header p {
    display: none;
  }

  .mapping-row > .start-editor {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .start-time-input {
    grid-column: 1 / -1;
  }

  .mapping-footer {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .control-dock *,
  .mapping-panel *,
  .welcome-panel * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
