/* Tonewell — dark, touch-friendly styles. Original design. */
@font-face {
  font-family: "TapeHand";
  src: url("../fonts/Caveat-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #101218;
  --bg2: #171a22;
  --panel: #1d2029;
  --line: #2a2e3a;
  --text: #e9ebf1;
  --muted: #9aa1b2;
  --accent: #2dd4bf;
  --accent2: #6366f1;
  --danger: #f87171;
  --heart: #fb7185;
  --radius: 14px;
  --mini-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
button, select, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }

/* ---------- Layout ---------- */
.app { height: 100%; display: grid; grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
.library { min-height: 0; overflow-y: auto; padding: 0 12px calc(var(--mini-h) + 16px + var(--safe-b)); }
.nowplaying {
  position: fixed; inset: 0; z-index: 20; background: linear-gradient(180deg, #161a26 0%, var(--bg) 70%);
  transform: translateY(100%); transition: transform .28s ease; overflow-y: auto;
  padding: 8px 16px calc(16px + var(--safe-b));
}
.app.np-open .nowplaying { transform: none; }
.mini { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; }

@media (min-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr) minmax(380px, 440px); grid-template-rows: 1fr; }
  .library { padding-bottom: 24px; }
  .nowplaying { position: static; transform: none; border-left: 1px solid var(--line); transition: none; }
  .mini, #closeNpBtn { display: none !important; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--panel); cursor: pointer;
}
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; color: #0b0d12; font-weight: 600; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .9rem; }
.btn.danger { color: var(--danger); }
.btn:hover { filter: brightness(1.12); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer; color: var(--text); position: relative;
}
.icon-btn:hover { background: rgba(255,255,255,.06); }
.icon-btn.small { width: 36px; height: 36px; }
.icon-btn.big svg { width: 30px; height: 30px; }
.icon-btn.toggle { color: var(--muted); }
.icon-btn.toggle[aria-pressed="true"], .icon-btn.toggle[data-mode="all"], .icon-btn.toggle[data-mode="one"] { color: var(--accent); }
.icon-btn .one { position: absolute; right: 6px; bottom: 6px; font-size: 10px; font-weight: 700; display: none; }
.icon-btn[data-mode="one"] .one { display: block; }
.play-btn {
  width: 68px; height: 68px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #0b0d12; box-shadow: 0 6px 24px rgba(45,212,191,.25);
}
.play-btn svg { width: 30px; height: 30px; }
.play-btn.small { width: 46px; height: 46px; box-shadow: none; }
.play-btn.small svg { width: 22px; height: 22px; }
.play-btn .i-pause, .playing .play-btn .i-play { display: none; }
.playing .play-btn .i-pause { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Top bar & tabs ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 4px 8px; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 1.25rem; margin: 0; letter-spacing: .3px; }
.add-actions { display: flex; align-items: center; gap: 6px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 4px 8px; scrollbar-width: none; position: sticky; top: 64px; background: var(--bg); z-index: 2; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }

.listbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 4px 10px; }
.listbar-left, .listbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.listbar h2 { font-size: 1.05rem; margin: 0; }
.count { color: var(--muted); font-size: .9rem; }
.sort { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .9rem; }
.sort select { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; min-height: 36px; }

.banner { margin: 0 4px 10px; padding: 10px 12px; border-radius: 12px; background: #2a2414; color: #f5d68a; font-size: .9rem; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ---------- Song list ---------- */
.songlist, .playlistlist { list-style: none; margin: 0; padding: 0; }
.song {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 8px; border-radius: 12px; cursor: pointer; min-height: 64px;
}
.song:hover { background: rgba(255,255,255,.04); }
.song.current { background: rgba(45,212,191,.10); }
.song.current .s-title { color: var(--accent); }
.song.unavailable { opacity: .45; }
.thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--panel); display: grid; place-items: center; color: var(--muted); font-size: 20px; }
.s-text { min-width: 0; }
.s-title, .s-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-title { font-weight: 600; }
.s-sub { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.s-actions { display: flex; align-items: center; }
.fav-btn { color: var(--muted); }
.fav-btn svg { width: 20px; height: 20px; }
.fav-btn[aria-pressed="true"], #npFavBtn[aria-pressed="true"] { color: var(--heart); }
.fav-btn[aria-pressed="true"] .heart, #npFavBtn[aria-pressed="true"] .heart { fill: currentColor; }

.playlist-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; cursor: pointer; }
.playlist-row:hover { background: rgba(255,255,255,.04); }
.pl-icon { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #243b55, #3b2a5a); font-size: 20px; }

.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty-art { font-size: 56px; opacity: .5; }

/* ---------- Now playing ---------- */
.np-head { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.np-label { flex: 1; text-align: center; color: var(--muted); font-size: .85rem; letter-spacing: 1.5px; text-transform: uppercase; }
@media (min-width: 960px) { .np-head { justify-content: space-between; } .np-head::before { content: ""; width: 44px; } }
.np-body { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.art-wrap { width: min(62vw, 300px, 34vh); aspect-ratio: 1; }
.art { width: 100%; height: 100%; border-radius: 16px; object-fit: cover; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.art-fallback { display: grid; place-items: center; background: linear-gradient(135deg, #1f2a3a, #2b2147); }
.art-fallback svg { width: 45%; height: 45%; stroke: rgba(255,255,255,.35); stroke-width: 2; }

.meta { text-align: center; width: 100%; }
.meta .title { font-size: 1.3rem; font-weight: 700; overflow-wrap: anywhere; }
.meta .artist { color: var(--muted); margin-top: 4px; }

.seek { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; width: 100%; }
.time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; text-align: center; }
.controls { display: flex; align-items: center; justify-content: center; gap: 14px; }
.lower { width: 100%; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.volume { display: flex; align-items: center; gap: 6px; width: min(100%, 320px); }
.volume input { flex: 1; }
.muted .waves { display: none; }

.tuning { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.tuning-label { color: var(--muted); font-size: .85rem; margin-right: 4px; }
.seg { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.seg small { opacity: .7; }
.seg[aria-checked="true"] { background: rgba(45,212,191,.15); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* Range inputs */
input[type=range] { -webkit-appearance: none; appearance: none; height: 28px; background: transparent; width: 100%; cursor: pointer; --p: 0%; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--p), #353a48 var(--p)); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: #353a48; }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; margin-top: -6px; border: 0; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; }

/* ---------- Cassette ---------- */
.cassette {
  --u: 3.6px; /* skin patterns are drawn in cassette units */
  position: relative; width: min(100%, 400px); aspect-ratio: 1.58; border-radius: 16px; padding: 6% 6% 0;
  background: var(--shell, linear-gradient(160deg, #2a2d36, #1b1d24 60%, #22252d));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 28px rgba(0,0,0,.45);
}
.screw { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #8b90a0, #3d414d); }
.screw::after { content: ""; position: absolute; left: 2px; right: 2px; top: 4px; height: 2px; background: #2a2d36; transform: rotate(35deg); }
.screw.tl { left: 3%; top: 4%; } .screw.tr { right: 3%; top: 4%; } .screw.bl { left: 3%; bottom: 5%; } .screw.br { right: 3%; bottom: 5%; }
.tape-label {
  position: relative; height: 70%; border-radius: 8px; padding: 2.5% 3% 3%;
  background:
    linear-gradient(180deg, transparent 0 30%, var(--stripe, #e85d4a) 30% 33%, transparent 33%),
    repeating-linear-gradient(180deg, transparent 0 11px, rgba(60,80,140,.16) 11px 12px),
    var(--np-label, #f2ead6);
  display: flex; flex-direction: column; gap: 4%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.label-title {
  height: 26%; min-height: 26px; overflow: hidden; white-space: nowrap; display: flex; align-items: center;
  font-family: var(--title-font, "TapeHand", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive);
  color: var(--ink, #1f2f7a); font-weight: 600; line-height: 1; padding: 0 2px; text-shadow: var(--title-glow, none);
  -webkit-mask-image: none;
}
.label-text { display: inline-block; transform: rotate(-1deg); transform-origin: left center; padding-right: 2px; }
.label-title.fit { justify-content: center; }
.label-title.marquee { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%); }
.label-title.marquee .label-text { animation: marquee var(--marquee-dur, 12s) linear infinite; transform: none; }
.label-title.marquee .label-text .gap { display: inline-block; width: 3em; text-align: center; opacity: .6; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .label-title.marquee .label-text { animation: none; }
  .label-title.marquee { text-overflow: ellipsis; }
}
.label-band { flex: 1; display: flex; align-items: center; gap: 3%; }
.side { font: 700 1.1rem/1 system-ui, sans-serif; color: var(--side, #e85d4a); width: 8%; text-align: center; }
.tuning-tag { font-family: "TapeHand", cursive; color: var(--hz, #1f2f7a); font-size: 1.15rem; width: 10%; text-align: center; transform: rotate(-4deg); }
.tuning-tag::after { content: " Hz"; font-size: .7em; }
.window {
  flex: 1; height: 82%; border-radius: 999px; background: var(--win, #2b2a2f); position: relative; display: flex; align-items: center; justify-content: space-between; padding: 0 7%;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.6);
}
.tape-strip { position: absolute; left: 30%; right: 30%; top: 50%; height: 40%; transform: translateY(-50%); background: linear-gradient(180deg, #3a2a1e, #4a3626); border-radius: 3px; opacity: .85; }
.reel { position: relative; z-index: 1; width: 23%; aspect-ratio: 1; border-radius: 50%; background: var(--reel, #e9e4d8); display: grid; place-items: center; animation: spin 2.4s linear infinite; animation-play-state: paused; }
.reel::after { content: ""; width: 34%; height: 34%; border-radius: 50%; background: var(--hub, #2b2a2f); }
.reel i { position: absolute; width: 10%; height: 30%; background: #2b2a2f; border-radius: 2px; top: 6%; left: 45%; transform-origin: 50% 146%; background: var(--spoke, #2b2a2f); }
.reel i:nth-child(2) { transform: rotate(120deg); } .reel i:nth-child(3) { transform: rotate(240deg); }
.playing .reel { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }
.cassette-foot { position: absolute; left: 20%; right: 20%; bottom: 0; height: 18%; background: #15171d; clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%); display: flex; align-items: center; justify-content: space-around; padding: 0 12%; }
.cassette-foot span { width: 9%; aspect-ratio: 1; border-radius: 50%; background: #0a0b0e; }

/* ---------- Mini player ---------- */
.mini {
  height: calc(var(--mini-h) + var(--safe-b)); padding: 0 8px var(--safe-b); display: flex; align-items: center; gap: 4px;
  background: rgba(23,26,34,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.mini-progress { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: #2a2e3a; }
.mini-progress div { height: 100%; width: 0; background: var(--accent); }
.mini-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; text-align: left; cursor: pointer; padding: 6px; }
.mini-info img, .mini-fallback { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.mini-fallback { display: grid; place-items: center; background: var(--panel); color: var(--muted); }
.mini-text { min-width: 0; display: flex; flex-direction: column; }
.mini-title, .mini-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-title { font-weight: 600; }
.mini-artist { color: var(--muted); font-size: .85rem; }

/* ---------- Dialogs & toast ---------- */
dialog.sheet { border: 1px solid var(--line); border-radius: 18px; background: var(--bg2); color: var(--text); width: min(92vw, 440px); padding: 18px; }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h3 { margin: 0 0 12px; overflow-wrap: anywhere; }
dialog input[type=text] { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); min-height: 44px; }
.dialog-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }
.dialog-actions:has(> :only-child) { justify-content: flex-end; }
.switch-row { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.switch-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }
.hint { color: var(--muted); font-size: .88rem; }
.checklist { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; max-height: 40vh; overflow-y: auto; }
.checklist label { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 6px; border-radius: 8px; cursor: pointer; }
.checklist label:hover { background: rgba(255,255,255,.05); }
.checklist input { width: 18px; height: 18px; accent-color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: calc(var(--mini-h) + 20px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: #2b3040; padding: 10px 16px; border-radius: 999px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 420px) {
  .btn span { display: none; }
  .btn { padding: 0 11px; }
  .controls { gap: 8px; }
}

/* ---------- Walkman mode: the cassette fills the screen while a song plays ---------- */
body.wm-on { overflow: hidden; }
body.wm-on #app { visibility: hidden; }
.walkman {
  position: fixed; inset: 0; z-index: 40; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  background: radial-gradient(120% 90% at 50% 40%, #1c1f27 0%, #0b0c10 70%, #050608 100%);
}
.walkman[hidden] { display: none; }
.wm-stage { position: absolute; inset: 0; }
.wm-cassette {
  --u: 3.8px;
  /* Skin variables (defaults = "Night Shift"); css/skins.css overrides them per [data-skin]. */
  --shell: radial-gradient(circle at 20% 15%, rgba(255,255,255,.06), transparent 40%), repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0 2px, transparent 2px 4px), linear-gradient(160deg, #2c2f39, #1a1c23 55%, #23262f);
  --shell-r: 3.5; --shell-glow: 0 0 0 transparent;
  --screw: radial-gradient(circle at 35% 35%, #9aa0b0, #3d414d); --screw-slot: #22252d;
  --label: #f3ebd7; --label-r: 1.8; --label-edge: rgba(0,0,0,.1);
  --lines: repeating-linear-gradient(180deg, transparent 0 calc(var(--u) * 3.4), rgba(60,80,140,.18) calc(var(--u) * 3.4) calc(var(--u) * 3.55));
  --ink: #1f2f7a; --ink2: #3a4a8a; --title-font: "TapeHand", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  --title-weight: 600; --title-case: none; --title-spacing: normal; --title-glow: none;
  --stripe: #e85d4a; --stripe2: #f2b13a; --side: #e85d4a; --hz: #1f2f7a;
  --win: linear-gradient(180deg, #1d1c21, #2c2a30); --win-r: calc(var(--u) * 9); --win-clip: none; --win-border: 0 0 0 transparent;
  --reel: #ece6d8; --hub: #2a292e; --spoke: #2a292e; --spoke-r: 2px; --reel-ring: 0 0 0 calc(var(--u) * .35) rgba(0,0,0,.35);
  --pack: radial-gradient(circle, #5a4030 0 55%, #3d2b20 56% 100%); --tape: #4a3626;
  --foot: linear-gradient(180deg, #17191f, #121318); --foot-hole: #060709;
  position: absolute; left: 50%; top: 50%; width: var(--wm-w, calc(var(--u) * 100)); height: calc(var(--u) * 63);
  transform: translate(-50%, -50%) rotate(var(--wm-rot, 0deg));
  border-radius: calc(var(--u) * var(--shell-r)); cursor: pointer; outline: none;
  background: var(--shell);
  box-shadow: inset 0 calc(var(--u) * .25) 0 rgba(255,255,255,.08), inset 0 calc(var(--u) * -.4) 0 rgba(0,0,0,.4), 0 calc(var(--u) * 2) calc(var(--u) * 6) rgba(0,0,0,.6), var(--shell-glow);
}
.wm-cassette:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.wm-screw { position: absolute; width: calc(var(--u) * 2.6); height: calc(var(--u) * 2.6); border-radius: 50%; background: var(--screw); z-index: 1; }
.wm-screw::after { content: ""; position: absolute; left: 18%; right: 18%; top: 43%; height: 14%; background: var(--screw-slot); transform: rotate(35deg); }
.wm-screw.s1 { left: calc(var(--u) * 1.6); top: calc(var(--u) * 1.6); } .wm-screw.s2 { right: calc(var(--u) * 1.6); top: calc(var(--u) * 1.6); }
.wm-screw.s3 { left: calc(var(--u) * 1.6); bottom: calc(var(--u) * 1.6); } .wm-screw.s4 { right: calc(var(--u) * 1.6); bottom: calc(var(--u) * 1.6); }
.wm-gears { display: none; position: absolute; inset: 0; pointer-events: none; }
.wm-label {
  position: absolute; left: calc(var(--u) * 5.5); right: calc(var(--u) * 5.5); top: calc(var(--u) * 4.5); height: calc(var(--u) * 42);
  border-radius: calc(var(--u) * var(--label-r)); background: var(--label); overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--label-edge), 0 1px 0 rgba(255,255,255,.1);
}
.wm-label-lines { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--u) * 14.5); background: var(--lines); }
.wm-title {
  position: absolute; left: calc(var(--u) * 4); right: calc(var(--u) * 4); top: calc(var(--u) * 1.2); height: calc(var(--u) * 8.4);
  overflow: hidden; white-space: nowrap; display: flex; align-items: center;
  font-family: var(--title-font); color: var(--ink); font-weight: var(--title-weight); line-height: 1;
  text-transform: var(--title-case); letter-spacing: var(--title-spacing); text-shadow: var(--title-glow);
}
.wm-title-text { display: inline-block; transform: rotate(-1deg); transform-origin: left center; padding-right: 2px; }
.wm-title.fit { justify-content: center; }
.wm-title.marquee { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%); }
.wm-title.marquee .wm-title-text { animation: marquee var(--marquee-dur, 12s) linear infinite; transform: none; }
.wm-title.marquee .gap { display: inline-block; width: 3em; text-align: center; opacity: .6; }
.wm-artist { position: absolute; left: calc(var(--u) * 6); right: calc(var(--u) * 6); top: calc(var(--u) * 9.6); text-align: center;
  font-family: var(--title-font); color: var(--ink2); font-size: calc(var(--u) * 3.4); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: var(--title-glow); }
.wm-stripe { position: absolute; left: 0; right: 0; top: calc(var(--u) * 14.6); height: calc(var(--u) * 1.3); background: var(--stripe); box-shadow: 0 calc(var(--u) * 1.6) 0 var(--stripe2); }
.wm-side { position: absolute; left: calc(var(--u) * 3); top: calc(var(--u) * 24); font: 800 calc(var(--u) * 6)/1 system-ui, sans-serif; color: var(--side); }
.wm-hz { position: absolute; right: calc(var(--u) * 1.6); top: calc(var(--u) * 23.5); font-family: "TapeHand", cursive; color: var(--hz); font-size: calc(var(--u) * 4.4); transform: rotate(-6deg); text-align: center; line-height: .9; }
.wm-hz::after { content: "Hz"; display: block; font-size: .6em; }
.wm-window {
  position: absolute; left: 50%; width: calc(var(--u) * 63); margin-left: calc(var(--u) * -31.5); top: calc(var(--u) * 20); height: calc(var(--u) * 18);
  border-radius: var(--win-r); background: var(--win); overflow: hidden; clip-path: var(--win-clip);
  box-shadow: inset 0 calc(var(--u) * .5) calc(var(--u) * 1.6) rgba(0,0,0,.75), var(--win-border);
}
.wm-pack, .wm-reel { position: absolute; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); }
.wm-pack { background: var(--pack); opacity: .95; transition: width .8s linear, height .8s linear; }
.wm-pack.left { left: 21%; width: calc(var(--u) * var(--pack-l, 15)); height: calc(var(--u) * var(--pack-l, 15)); }
.wm-pack.right { left: 79%; width: calc(var(--u) * var(--pack-r, 9)); height: calc(var(--u) * var(--pack-r, 9)); }
.wm-reel { width: calc(var(--u) * 8.6); height: calc(var(--u) * 8.6); background: var(--reel); display: grid; place-items: center; z-index: 1;
  box-shadow: var(--reel-ring); }
.wm-reel.left { left: 21%; } .wm-reel.right { left: 79%; }
.wm-reel b { width: 36%; height: 36%; border-radius: 50%; background: var(--hub); }
.wm-reel i { position: absolute; width: 11%; height: 28%; background: var(--spoke); border-radius: var(--spoke-r); top: 7%; left: 44.5%; transform-origin: 50% 154%; }
.wm-reel i:nth-child(2) { transform: rotate(120deg); } .wm-reel i:nth-child(3) { transform: rotate(240deg); }
.wm-reel { animation: wmspin 2.2s linear infinite; animation-play-state: paused; }
.wm-playing .wm-reel { animation-play-state: running; }
@keyframes wmspin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
.wm-tape { position: absolute; left: 21%; right: 21%; bottom: 8%; height: calc(var(--u) * 1); background: var(--tape); opacity: .8; }
.wm-foot { position: absolute; left: 50%; width: calc(var(--u) * 58); margin-left: calc(var(--u) * -29); bottom: 0; height: calc(var(--u) * 10.5);
  background: var(--foot); clip-path: polygon(7% 0, 93% 0, 100% 100%, 0 100%);
  display: flex; align-items: center; justify-content: space-around; padding: 0 14%; }
.wm-foot span { width: calc(var(--u) * 3); height: calc(var(--u) * 3); border-radius: 50%; background: var(--foot-hole); box-shadow: inset 0 1px 2px rgba(0,0,0,.8); }

.wm-chip {
  position: absolute; z-index: 2; min-width: 44px; height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(16,18,24,.62); color: #e8eaf0; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font: 600 .9rem/1 system-ui, sans-serif; display: grid; place-items: center; cursor: pointer; transition: opacity .35s;
}
.wm-chip svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.wm-exit { left: calc(12px + env(safe-area-inset-left)); top: calc(12px + env(safe-area-inset-top)); padding: 0; width: 44px; }
.wm-tuning { right: calc(12px + env(safe-area-inset-right)); top: calc(12px + env(safe-area-inset-top)); }
.wm-strip {
  position: absolute; z-index: 2; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(92vw, 460px); padding: 8px 14px 10px; border-radius: 20px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(16,18,24,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: opacity .35s, transform .35s;
}
.wm-seek { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 6px; }
.wm-buttons { display: flex; justify-content: center; align-items: center; gap: 22px; }
.walkman.wm-idle .wm-strip { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(16px); }
.walkman.wm-idle .wm-chip { opacity: .4; }
.wm-playing .play-btn .i-play { display: none; } .wm-playing .play-btn .i-pause { display: block; }
.walkman .wm-hint { display: none; }
@media (prefers-reduced-motion: reduce) { .wm-reel { animation: none; } .wm-title.marquee .wm-title-text { animation: none; } }
