/* Playlist Share — "liner notes" style: paper, ink, one accent colour.
   Theme  : html[data-theme] = light | dark | (absent = follow the system)
   Palette: html[data-palette] = shu (朱) | ai (藍) | midori (深緑) | budou (葡萄) | sumi (墨) */
:root {
  --paper: #F2EEE6; --card: #FBF9F4; --ink: #161513; --sub: #6E6A62; --rule: #D6CFC2; --soft: #E8E2D6; --ok: #2F7D4F; --warn: #B26A00; --bad: #C2341D; color-scheme: light;
  --accent: #D8432A; --on-accent: #ffffff;
  --display: "Dela Gothic One", "Zen Kaku Gothic New", sans-serif;
  --body: "Zen Kaku Gothic New", "Hiragino Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
:root { --accent-2: color-mix(in srgb, var(--accent) 62%, var(--paper)); --accent-3: color-mix(in srgb, var(--accent) 36%, var(--paper)); --accent-4: color-mix(in srgb, var(--accent) 18%, var(--paper)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --paper: #141311; --card: #1B1A17; --ink: #EEEAE2; --sub: #9B968C; --rule: #34312C; --soft: #24221F; --ok: #5DBB83; --warn: #E0A040; --bad: #FF7A62; color-scheme: dark; } }
:root[data-theme="dark"] { --paper: #141311; --card: #1B1A17; --ink: #EEEAE2; --sub: #9B968C; --rule: #34312C; --soft: #24221F; --ok: #5DBB83; --warn: #E0A040; --bad: #FF7A62; color-scheme: dark; }

@media (prefers-color-scheme: light) { :root[data-palette="shu"]:not([data-theme="dark"]) { --accent: #D8432A; --paper: #F2EEE6; --card: #FBF9F4; --soft: #E8E2D6; --rule: #D6CFC2; --on-accent: #ffffff; } }
:root[data-palette="shu"][data-theme="light"] { --accent: #D8432A; --paper: #F2EEE6; --card: #FBF9F4; --soft: #E8E2D6; --rule: #D6CFC2; --on-accent: #ffffff; }
@media (prefers-color-scheme: dark) { :root[data-palette="shu"]:not([data-theme="light"]) { --accent: #FF6A4D; --on-accent: #ffffff; } }
:root[data-palette="shu"][data-theme="dark"] { --accent: #FF6A4D; --on-accent: #ffffff; }

@media (prefers-color-scheme: light) { :root[data-palette="ai"]:not([data-theme="dark"]) { --accent: #26457F; --paper: #EDEEEA; --card: #F8F8F5; --soft: #E0E2DD; --rule: #CBCFC8; --on-accent: #ffffff; } }
:root[data-palette="ai"][data-theme="light"] { --accent: #26457F; --paper: #EDEEEA; --card: #F8F8F5; --soft: #E0E2DD; --rule: #CBCFC8; --on-accent: #ffffff; }
@media (prefers-color-scheme: dark) { :root[data-palette="ai"]:not([data-theme="light"]) { --accent: #8FB0F2; --on-accent: #10131a; } }
:root[data-palette="ai"][data-theme="dark"] { --accent: #8FB0F2; --on-accent: #10131a; }

@media (prefers-color-scheme: light) { :root[data-palette="midori"]:not([data-theme="dark"]) { --accent: #2B5D46; --paper: #EEEDE3; --card: #F9F8F1; --soft: #E2E1D3; --rule: #D0CEBE; --on-accent: #ffffff; } }
:root[data-palette="midori"][data-theme="light"] { --accent: #2B5D46; --paper: #EEEDE3; --card: #F9F8F1; --soft: #E2E1D3; --rule: #D0CEBE; --on-accent: #ffffff; }
@media (prefers-color-scheme: dark) { :root[data-palette="midori"]:not([data-theme="light"]) { --accent: #83CFA9; --on-accent: #0f1712; } }
:root[data-palette="midori"][data-theme="dark"] { --accent: #83CFA9; --on-accent: #0f1712; }

@media (prefers-color-scheme: light) { :root[data-palette="budou"]:not([data-theme="dark"]) { --accent: #7C2439; --paper: #F3ECE8; --card: #FBF7F5; --soft: #E9DED9; --rule: #D9CAC4; --on-accent: #ffffff; } }
:root[data-palette="budou"][data-theme="light"] { --accent: #7C2439; --paper: #F3ECE8; --card: #FBF7F5; --soft: #E9DED9; --rule: #D9CAC4; --on-accent: #ffffff; }
@media (prefers-color-scheme: dark) { :root[data-palette="budou"]:not([data-theme="light"]) { --accent: #F293AB; --on-accent: #1a0f12; } }
:root[data-palette="budou"][data-theme="dark"] { --accent: #F293AB; --on-accent: #1a0f12; }

@media (prefers-color-scheme: light) { :root[data-palette="sumi"]:not([data-theme="dark"]) { --accent: #1C1B19; --paper: #F4F3F0; --card: #FCFBF9; --soft: #E7E5E0; --rule: #D4D1CA; --on-accent: #ffffff; --ink: #121110; } }
:root[data-palette="sumi"][data-theme="light"] { --accent: #1C1B19; --paper: #F4F3F0; --card: #FCFBF9; --soft: #E7E5E0; --rule: #D4D1CA; --on-accent: #ffffff; --ink: #121110; }
@media (prefers-color-scheme: dark) { :root[data-palette="sumi"]:not([data-theme="light"]) { --accent: #EDEAE3; --on-accent: #141311; } }
:root[data-palette="sumi"][data-theme="dark"] { --accent: #EDEAE3; --on-accent: #141311; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 15px; line-height: 1.7;
  min-height: 100vh; display: flex; flex-direction: column; font-feature-settings: "palt";
}
body.has-player { padding-bottom: calc(var(--dock-h, 440px) + 20px); }

body.modal-open { overflow: hidden; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
img { display: block; }
::selection { background: var(--accent); color: var(--on-accent); }
[hidden] { display: none !important; }

/* ---------- masthead ---------- */
.mast {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top));
  border-bottom: 2px solid var(--ink); max-width: 760px; width: 100%; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mark { width: 26px; height: 26px; background: var(--accent); border-radius: 4px; display: grid; place-items: center; flex: none; }
.mark i { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle, var(--paper) 0 1.5px, var(--accent) 2px 4.5px, #111 5px); display: block; }
.brand:hover .mark i { animation: spin 1.8s linear infinite; }
.word { font-family: var(--mono); font-weight: 600; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.conn { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--sub); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.conn img { width: 24px; height: 24px; border-radius: 50%; }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 8px 16px 56px; flex: 1; }
.foot {
  max-width: 760px; width: 100%; margin: 0 auto; padding: 16px 16px 28px;
  border-top: 1px solid var(--rule); display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--sub);
}
.foot a { text-decoration: none; letter-spacing: 0; font-family: var(--body); font-size: 12px; }

/* ---------- type ---------- */
h1, h2, h3 { margin: 0; font-weight: 400; }
.display { font-family: var(--display); line-height: 1.25; }
.hero { padding: 40px 0 28px; }
.hero h1 { font-family: var(--display); font-size: clamp(30px, 8vw, 50px); line-height: 1.22; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { margin: 16px 0 0; color: var(--sub); max-width: 32em; }
.eyebrow { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--sub); }
.label {
  display: flex; align-items: baseline; gap: 10px; margin: 32px 0 12px;
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--sub);
}
.label::after { content: ""; flex: 1; border-bottom: 1px solid var(--rule); transform: translateY(-3px); }
.label b { color: var(--accent); font-weight: 600; }
.muted { color: var(--sub); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap-ok { flex-wrap: wrap; }
.spacer { flex: 1; }
.hint { font-size: 12px; color: var(--sub); margin-top: 8px; }

.sheet { background: var(--card); border: 1.5px solid var(--ink); border-radius: 6px; padding: 18px; }
.sheet.flat { border-color: var(--rule); border-width: 1px; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 6px; border: 1.5px solid var(--ink); background: transparent;
  font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.3;
  transition: background .12s ease, transform .06s ease;
}
.btn:hover { background: var(--soft); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: color-mix(in srgb, var(--ink) 85%, var(--paper)); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.accent:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.quiet { border-color: transparent; color: var(--sub); padding-left: 8px; padding-right: 8px; }
.btn.quiet:hover { color: var(--ink); background: transparent; text-decoration: underline; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.lg { padding: 14px 20px; font-size: 16px; width: 100%; white-space: normal; text-align: center; }
.btn svg { width: 17px; height: 17px; flex: none; }
.back { margin: 12px 0 0 -8px; }

/* ---------- inputs ---------- */
.field { display: flex; gap: 8px; }
.input, .textarea {
  width: 100%; min-width: 0; padding: 12px 14px; border-radius: 6px; border: 1.5px solid var(--ink);
  background: var(--card); outline: none;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.input:focus, .textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.mono-input { font-family: var(--mono); font-size: 12px; }

.radios { display: grid; gap: 8px; }
.radio { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 6px; background: var(--card); cursor: pointer; }
.radio:has(input:checked) { border: 1.5px solid var(--ink); box-shadow: inset 4px 0 0 var(--accent); }
.radio input { accent-color: var(--accent); width: 18px; height: 18px; margin: 3px 0 0; }
.radio b { display: block; }
.radio span { font-size: 13px; color: var(--sub); }

/* ---------- privacy badge ---------- */
.priv { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .08em; padding: 1px 6px; border: 1px solid currentColor; border-radius: 3px; white-space: nowrap; }
.priv.private { color: var(--sub); }
.priv.unlisted { color: var(--warn); }
.priv.public { color: var(--ok); }

/* ---------- playlist grid ---------- */
.plgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 14px; }
.pl { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }
.pl .cover { aspect-ratio: 1; border: 1.5px solid var(--ink); border-radius: 4px; overflow: hidden; background: var(--soft); transition: transform .12s ease, box-shadow .12s ease; }
.pl .cover img { width: 100%; height: 100%; object-fit: cover; }
.pl:hover .cover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.pl .name { font-weight: 700; font-size: 14px; margin-top: 8px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pl .meta { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.pl .cnt { font-family: var(--mono); font-size: 11px; color: var(--sub); }

.jcard { width: 100%; height: 100%; background: var(--ink); color: var(--paper); padding: 10% 10% 8%; display: flex; flex-direction: column; justify-content: space-between; }
.jcard .jt { font-family: var(--display); font-size: clamp(13px, 3.4vw, 20px); line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; word-break: break-word; }
.jcard .jb { display: flex; justify-content: space-between; align-items: end; font-family: var(--mono); font-size: 9px; letter-spacing: .12em; }
.jcard .jb span:last-child { width: 14px; height: 14px; background: var(--accent); border-radius: 2px; }

/* ---------- playlist head ---------- */
.plhead { display: grid; grid-template-columns: 148px 1fr; gap: 20px; align-items: end; padding: 28px 0 22px; border-bottom: 2px solid var(--ink); }
.plhead .art { aspect-ratio: 1; border: 1.5px solid var(--ink); border-radius: 4px; overflow: hidden; background: var(--soft); }
.plhead .art img { width: 100%; height: 100%; object-fit: cover; }
.plhead h1 { font-family: var(--display); font-size: clamp(24px, 6vw, 38px); line-height: 1.2; word-break: break-word; margin-top: 6px; }
.plhead .by { color: var(--sub); font-size: 13px; margin-top: 8px; }
.plhead .by b { color: var(--ink); font-weight: 700; }
@media (max-width: 480px) { .plhead { grid-template-columns: 1fr; } .plhead .art { width: 56%; max-width: 220px; } }

.intro { white-space: pre-wrap; word-break: break-word; padding: 18px 0 4px; font-size: 15px; line-height: 1.9; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
@media (max-width: 560px) { .actions { grid-template-columns: 1fr; } }

/* ---------- tracklist ---------- */
.tracks { list-style: none; margin: 0; padding: 0; }
.trk {
  display: grid; grid-template-columns: 28px 48px 1fr auto; gap: 12px; align-items: center;
  padding: 8px 6px; margin: 0 -6px; border-bottom: 1px dashed var(--rule); cursor: pointer; border-radius: 4px;
}
.trk:last-child { border-bottom-color: transparent; }
.trk:hover { background: var(--soft); }
.trk .no { font-family: var(--mono); font-size: 12px; color: var(--sub); text-align: right; font-variant-numeric: tabular-nums; }
.trk .th { width: 48px; height: 48px; border-radius: 3px; overflow: hidden; background: var(--soft); position: relative; }
.trk .th img { width: 100%; height: 100%; object-fit: cover; }
.trk .t { min-width: 0; }
.trk .t b, .trk .t span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trk .t b { font-weight: 500; }
.trk .t span { font-size: 13px; color: var(--sub); }
.trk .dur { font-family: var(--mono); font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; text-align: right; }
.trk .dur a { font-family: var(--body); font-size: 11px; display: block; }
.trk.now { background: var(--soft); }
.trk.now .no { color: var(--accent); }
.trk.now .t b { color: var(--accent); font-weight: 700; }
.trk.noembed { cursor: default; }
.trk.noembed:hover { background: none; }
.eq { display: inline-flex; gap: 2px; align-items: end; height: 12px; }
.eq i { width: 3px; background: var(--accent); animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .2s; } .eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }
.paused .eq i { animation-play-state: paused; }

/* ---------- player dock ----------
   Controls live on the LEFT / TOP so the bottom-right corner stays free
   (hosting badges and the phone's home bar sit there). */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--card); border-top: 2px solid var(--ink);
  padding: 10px 16px max(14px, env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(0,0,0,.08);
}
.player .inner {
  max-width: 760px; margin: 0 auto; display: grid; gap: 8px 18px;
  grid-template-columns: 356px 1fr;
  grid-template-areas: "video top" "video modes" "video seek" "video ctrls";
  align-items: center;
}
.player .ptop { grid-area: top; display: flex; align-items: center; gap: 10px; min-width: 0; align-self: end; }
.player .video { grid-area: video; width: 356px; height: 200px; background: #000; border-radius: 4px; overflow: hidden; }
.player .video iframe, .player .video > div { width: 100%; height: 100%; display: block; }
.player .seekrow { grid-area: seek; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.player .ctrls { grid-area: ctrls; display: flex; gap: 8px; align-items: center; align-self: start; }
.player .ctrls .btn { width: 48px; height: 44px; padding: 0; }
.player .time { font-family: var(--mono); font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; min-width: 34px; }
.player .seekrow .time:last-child { text-align: right; }
.player .np { min-width: 0; flex: 1; }
.player .np b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .np span { display: block; color: var(--sub); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .pclose { width: 40px; height: 40px; padding: 0; flex: none; }
@media (max-width: 640px) {
  .player { padding-top: 8px; }
  .player .inner { grid-template-columns: 1fr; grid-template-areas: "top" "modes" "video" "seek" "ctrls"; gap: 6px; }
  /* keep the button row inside the left ~200px: the bottom-right corner is reserved for the hosting badge */
  .player .video { justify-self: center; width: min(356px, 100%); }
  .player .ctrls .btn { width: 56px; height: 46px; }
  .player .ctrls { gap: 8px; }
}
.seek { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; margin: 0; }
.seek::-webkit-slider-runnable-track { height: 4px; background: var(--rule); border-radius: 2px; }
.seek::-moz-range-track { height: 4px; background: var(--rule); border-radius: 2px; }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); margin-top: -5px; border: 0; }
.seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 0; }

/* mini spinning icon in the dock */
.mini { width: 30px; height: 30px; flex: none; position: relative; display: inline-block; }
.mini.vinyl { border-radius: 50%; background: radial-gradient(circle, var(--paper) 0 2px, var(--accent) 2.5px 7px, #111 7.5px 100%); }
.mini.vinyl::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); border-top-color: rgba(255,255,255,.4); }
.mini.vinyl i { display: none; }
.mini.tape { border-radius: 4px; background: var(--ink); width: 38px; height: 26px; display: flex; align-items: center; justify-content: space-around; padding: 0 3px; }
.mini.tape i { width: 11px; height: 11px; border-radius: 50%; background: repeating-conic-gradient(var(--paper) 0 30deg, var(--ink) 30deg 60deg); border: 2px solid var(--paper); }
.player.playing .mini.vinyl, .player.playing .mini.tape i { animation: spin 1.8s linear infinite; }

/* ---------- viewer head with deck ---------- */
.vhead { display: grid; grid-template-columns: minmax(0, 1.15fr) 1fr; gap: 28px; align-items: end; padding: 28px 0 22px; border-bottom: 2px solid var(--ink); }
.vhead h1 { font-family: var(--display); font-size: clamp(24px, 6vw, 38px); line-height: 1.2; word-break: break-word; margin-top: 6px; }
.vhead .by { color: var(--sub); font-size: 13px; margin-top: 8px; }
.vhead .by b { color: var(--ink); font-weight: 700; }
.deckwrap { overflow: hidden; padding: 4px 0; }
@media (max-width: 600px) { .vhead { grid-template-columns: 1fr; gap: 18px; } }

.looks { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 6px; overflow: hidden; }
.looks button { border: 0; background: none; padding: 5px 10px; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; cursor: pointer; color: var(--sub); }
.looks button + button { border-left: 1.5px solid var(--ink); }
.looks button.on { background: var(--ink); color: var(--paper); }

/* --- record ---
   Sizes are all derived from the deck WIDTH (not height + aspect-ratio on absolutely
   positioned boxes, which Safari resolves inconsistently) so the disc is a perfect
   circle and spins exactly around its centre. */
.deck.vinyl { position: relative; width: 100%; max-width: 420px; aspect-ratio: 3 / 2; }
.deck.vinyl .sleeve {
  position: absolute; left: 0; top: 0; width: 66.6667%; height: 100%; z-index: 2;
  border: 1.5px solid var(--ink); border-radius: 4px; overflow: hidden; background: var(--ink);
  box-shadow: 6px 6px 0 rgba(0,0,0,.14);
  animation: sleeve-in .7s cubic-bezier(.2,.8,.2,1) backwards;
}
.deck.vinyl .sleeve img { width: 100%; height: 100%; object-fit: cover; display: block; }
.deck.vinyl .sleeve::after { /* worn cardboard edge */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.12), transparent 30% 70%, rgba(0,0,0,.18));
  box-shadow: inset 0 0 0 6px rgba(0,0,0,.08);
}
.deck.vinyl .platter {
  position: absolute; z-index: 1; width: 62.6667%; top: 3%; left: 14%;
  transition: left .9s cubic-bezier(.2, .8, .2, 1);
  animation: platter-peek 1.1s .35s cubic-bezier(.2,.8,.2,1) backwards; /* not 'both': the end state must not pin `left` */
}
.deck.vinyl .platter::before { content: ""; display: block; padding-top: 100%; } /* square from width */
.deck.vinyl.playing .platter, .deck.vinyl:hover .platter { left: 33.3333%; }
.deck.vinyl .disc {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%, #121211 0 1.5px, #1c1c1a 1.5px 3px),
    #111;
  box-shadow: 0 8px 20px rgba(0,0,0,.28);
  will-change: transform; /* rotated from JS (Deck.frame) */
}
.deck.vinyl .shine { /* light reflection: sits OUTSIDE the spinning disc so it stays still */
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none; z-index: 1;
  background: conic-gradient(from 30deg at 50% 50%, transparent 0 7%, rgba(255,255,255,.13) 11%, transparent 17% 57%, rgba(255,255,255,.09) 61%, transparent 67%);
  -webkit-mask: radial-gradient(circle, transparent 0 29%, #000 29.5%); mask: radial-gradient(circle, transparent 0 29%, #000 29.5%);
}
.deck.vinyl .label {
  position: absolute; inset: 0; margin: auto; width: 58%; height: 58%;
  border-radius: 50%; overflow: hidden; background: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,0,0,.55), 0 0 0 5px rgba(255,255,255,.06);
}
.deck.vinyl .label img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.deck.vinyl .label img.lb { transform: scale(1.34); }
.deck.vinyl .label i {
  position: absolute; inset: 0; margin: auto; width: 7%; height: 7%; min-width: 5px; min-height: 5px;
  border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 2px rgba(0,0,0,.45);
}
.deck.vinyl .arm {
  position: absolute; z-index: 3; right: 1%; top: 3%; width: 7%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--paper) 0 22%, var(--ink) 26%); box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transform-origin: 50% 50%; transform: rotate(-38deg); transition: transform .8s cubic-bezier(.2, .8, .2, 1) .2s;
}
.deck.vinyl .arm i { position: absolute; left: 50%; top: 50%; width: 3px; height: 560%; margin-left: -1.5px; background: var(--ink); transform-origin: 50% 0; transform: rotate(20deg); border-radius: 2px; }
.deck.vinyl .arm i::after { content: ""; position: absolute; bottom: -6px; left: -4px; width: 11px; height: 14px; background: var(--ink); border-radius: 2px; }
.deck.vinyl.playing .arm { transform: rotate(0deg); }
@keyframes sleeve-in { from { opacity: 0; transform: translateY(14px) rotate(-2deg); } to { opacity: 1; transform: none; } }
@keyframes platter-peek { 0% { left: 2%; opacity: 0; } 55% { left: 30%; opacity: 1; } 100% { left: 14%; } }

/* --- cassette --- */
.deck.tape { width: 100%; max-width: 420px; aspect-ratio: 1.58 / 1; --l: 1; --r: 0; }
.deck.tape .shell {
  position: relative; width: 100%; height: 100%; border-radius: 10px; background: var(--ink); color: var(--ink);
  box-shadow: 6px 6px 0 rgba(0,0,0,.12); padding: 6% 6% 0;
}
.deck.tape .screw { position: absolute; width: 3.2%; aspect-ratio: 1; border-radius: 50%; background: #3a3833; box-shadow: inset 0 0 0 1px #55524b; }
.deck.tape .s1 { left: 2.2%; top: 4%; } .deck.tape .s2 { right: 2.2%; top: 4%; } .deck.tape .s3 { left: 2.2%; bottom: 5%; } .deck.tape .s4 { right: 2.2%; bottom: 5%; }
.deck.tape .strip {
  position: relative; height: 72%; border-radius: 6px; background: #F4EFE4; padding: 4% 5% 0;
  background-image: linear-gradient(var(--accent) 0 0), repeating-linear-gradient(transparent 0 22%, rgba(22,21,19,.18) 22% calc(22% + 1px));
  background-size: 100% 9%, 100% 100%; background-repeat: no-repeat; background-position: 0 100%, 0 0;
}
.deck.tape .side { position: absolute; left: 5%; top: 6%; font-family: var(--display); font-size: clamp(14px, 3.4vw, 20px); color: var(--accent); }
.deck.tape .lt { display: block; margin-left: 9%; font-family: var(--display); font-size: clamp(13px, 3.2vw, 19px); line-height: 1.25; color: #161513; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.deck.tape .lb { display: block; margin-left: 9%; font-family: var(--mono); font-size: 10px; color: #6E6A62; letter-spacing: .06em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.deck.tape .window {
  position: absolute; left: 22%; right: 22%; top: 34%; height: 30%; border-radius: 40px;
  background: #2a2925; border: 2px solid #161513; display: flex; align-items: center; justify-content: space-between; padding: 0 5%;
  overflow: hidden;
}
.deck.tape .window::before { content: ""; position: absolute; left: 30%; right: 30%; top: 22%; bottom: 22%; background: rgba(255,255,255,.05); border-radius: 4px; }
.deck.tape .reel { position: relative; height: 100%; aspect-ratio: 1; display: grid; place-items: center; }
.deck.tape .pack {
  position: absolute; border-radius: 50%; background: radial-gradient(circle, #5a3b2a 0 60%, #3d281c 61%);
  width: calc(46% + 120% * var(--k)); aspect-ratio: 1; transition: width .5s linear;
}
.deck.tape .reel.l .pack { --k: var(--l); }
.deck.tape .reel.r .pack { --k: var(--r); }
.deck.tape .hub {
  position: relative; width: 44%; aspect-ratio: 1; border-radius: 50%; background: #F4EFE4; border: 2px solid #161513;
  will-change: transform; /* rotated from JS */
}
.deck.tape .hub i { position: absolute; left: 50%; top: 50%; width: 22%; height: 34%; margin: -17% 0 0 -11%; background: #161513; border-radius: 2px; transform-origin: 50% 50%; }
.deck.tape .hub i:nth-child(1) { transform: rotate(0deg) translateY(-62%); }
.deck.tape .hub i:nth-child(2) { transform: rotate(120deg) translateY(-62%); }
.deck.tape .hub i:nth-child(3) { transform: rotate(240deg) translateY(-62%); }
.deck.tape .mouth {
  position: absolute; left: 20%; right: 20%; bottom: 0; height: 18%; background: #24231f;
  clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%); display: flex; justify-content: space-around; align-items: center;
}
.deck.tape .mouth i { width: 6%; aspect-ratio: 1; border-radius: 50%; background: #3a3833; }

img.lb { transform: scale(1.34); }

/* ---------- share image modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(10,10,9,.6); display: grid; place-items: center; padding: 16px; }
.modal-card { background: var(--paper); border: 1.5px solid var(--ink); border-radius: 8px; padding: 16px; width: min(420px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.share-preview { width: 100%; max-height: 62vh; object-fit: contain; border: 1px solid var(--rule); border-radius: 4px; background: #fff; }

/* ---------- ticket / notes ---------- */
.ticket { border: 1.5px dashed var(--ink); border-radius: 6px; padding: 16px; background: var(--card); }
.note { padding: 12px 14px; border-left: 3px solid var(--ink); background: var(--soft); font-size: 14px; border-radius: 0 4px 4px 0; }
.note.warn { border-left-color: var(--warn); }
.note.bad { border-left-color: var(--bad); }
.note.accent { border-left-color: var(--accent); }
.note b { font-weight: 700; }

.meter { height: 8px; background: var(--soft); border-radius: 2px; overflow: hidden; }
.meter > div { height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }
.count { font-family: var(--mono); font-size: 40px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.count small { font-size: 18px; color: var(--sub); }
.done-mark { font-family: var(--display); font-size: 52px; color: var(--accent); line-height: 1; }

.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 56px 0; text-align: center; color: var(--sub); font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 4px; font-size: 14px; font-weight: 700;
  transition: all .2s ease; z-index: 50; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.has-player .toast { bottom: 430px; }
@media (min-width: 641px) { body.has-player .toast { bottom: 280px; } }

/* =========================================================
   RETRO LAYER — 70s record-shop vibes: grain, stripes, stickers, print offsets
   ======================================================= */

/* film grain over everything (pointer-events off) */
body::before {
  content: ""; position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(4) infinite;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::before { opacity: .1; filter: invert(1); } }
:root[data-theme="dark"] body::before { opacity: .1; filter: invert(1); }
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-1%, 3%); } 100% { transform: translate(0, 0); } }

/* four-colour stripe band under the masthead */
.stripes { max-width: 760px; width: 100%; margin: 0 auto; display: grid; gap: 2px; padding: 3px 0 0; }
.stripes i { height: 3px; display: block; transform-origin: left; animation: stripe-in .8s cubic-bezier(.2,.8,.2,1) both; }
.stripes i:nth-child(1) { background: var(--accent); }
.stripes i:nth-child(2) { background: var(--accent-2); animation-delay: .08s; }
.stripes i:nth-child(3) { background: var(--accent-3); animation-delay: .16s; }
.stripes i:nth-child(4) { background: var(--accent-4); animation-delay: .24s; }
@keyframes stripe-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* masthead right side: account + help (top-right corner) */
.mast-r { display: flex; align-items: center; gap: 14px; }
.helplink {
  font-family: var(--body); font-weight: 700; font-size: 13px; text-decoration: none;
  padding: 5px 12px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card);
  box-shadow: 2px 2px 0 var(--ink); transition: transform .1s ease, box-shadow .1s ease;
}
.helplink:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.helplink:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }

/* hero: misregistered print + spinning sticker */
.hero { position: relative; }
.hero-title { text-shadow: 3px 3px 0 var(--accent-4); }
.hero-title em { color: var(--accent); text-shadow: 3px 3px 0 var(--accent-3); display: inline-block; animation: wobble 4s ease-in-out infinite; transform-origin: left bottom; }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-1.5deg); } }
.sticker { position: absolute; right: 0; top: 18px; width: 108px; height: 108px; pointer-events: none; }
.sticker svg { width: 100%; height: 100%; animation: spin 14s linear infinite; }
.sticker text { font-family: var(--mono); font-size: 9.6px; font-weight: 600; letter-spacing: .18em; fill: var(--ink); }
.sticker b { position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-family: var(--display); font-size: 18px; box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--ink); }
@media (max-width: 560px) { .sticker { width: 84px; height: 84px; top: 6px; } .sticker b { width: 36px; height: 36px; font-size: 14px; } }

/* tactile retro buttons */
.btn:not(.quiet) { box-shadow: 3px 3px 0 var(--ink); }
.btn:not(.quiet):hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:not(.quiet):active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn.accent:not(.quiet) { box-shadow: 3px 3px 0 var(--ink); }
.btn:disabled { box-shadow: none !important; transform: none !important; }
.player .btn:not(.quiet) { box-shadow: 2px 2px 0 var(--ink); }

/* entrance animations */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
#app > * { animation: rise .55s cubic-bezier(.2,.8,.2,1) backwards; }
#app > *:nth-child(2) { animation-delay: .06s; } #app > *:nth-child(3) { animation-delay: .12s; }
#app > *:nth-child(4) { animation-delay: .18s; } #app > *:nth-child(5) { animation-delay: .24s; }
#app > *:nth-child(6) { animation-delay: .3s; }  #app > *:nth-child(n+7) { animation-delay: .36s; }
.trk { animation: rise .45s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(var(--i, 0) * 35ms + .3s); }
.trk:hover { transform: translateX(3px); }
.trk { transition: background .15s ease, transform .15s ease; }

/* name became Japanese -> little highlight */
.trk .t.flash b, .trk .t.flash span { animation: flash 1.4s ease; }
@keyframes flash { 0% { background: color-mix(in srgb, var(--accent-3) 55%, transparent); } 100% { background: transparent; } }

.mvtag { display: block; font-style: normal; font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .08em; color: var(--accent); margin-top: 2px; }

/* section labels get a tiny record */
.label b { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- player: retro top row ---------- */
.player { border-top: 0; }
.player::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: linear-gradient(var(--accent) 0 2px, var(--paper) 2px 3px, var(--accent-2) 3px 5px, var(--paper) 5px 6px, var(--accent-3) 6px 8px); }
.player .inner { padding-top: 6px; }
.player .np .onair { font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: .16em; color: var(--accent); display: inline-flex; align-items: center; gap: 5px; }
.player .np .onair::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.player.playing .np .onair::before { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.marquee { overflow: hidden; white-space: nowrap; }
.marquee b { display: inline-block; white-space: nowrap; }
.marquee.run b { padding-right: 40px; animation: marquee 12s linear infinite; }
@keyframes marquee { 0%, 12% { transform: translateX(0); } 100% { transform: translateX(-100%); } }
.player .np #pl-artist { display: block; color: var(--sub); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbtn {
  flex: none; height: 32px; min-width: 42px; padding: 0 10px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--card);
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .06em; cursor: pointer; display: inline-grid; place-items: center;
  box-shadow: 2px 2px 0 var(--ink); transition: transform .08s ease, box-shadow .08s ease, background .15s ease;
}
.pbtn:active { transform: translate(2px, 2px); box-shadow: none; }
.pbtn.on { background: var(--accent); border-color: var(--ink); color: var(--on-accent); }
.pbtn.busy { pointer-events: none; }
.pbtn .spinner { width: 12px; height: 12px; }
@media (max-width: 400px) { .player .ptop { gap: 6px; } .pbtn { min-width: 38px; padding: 0 8px; } .player .pclose { width: 32px; } }

/* ---------- lyrics panel ---------- */
.lyrics {
  position: fixed; left: 0; right: 0; bottom: calc(var(--dock-h, 280px) - 2px); z-index: 29;
  max-width: 760px; margin: 0 auto; padding: 0 16px;
  animation: rise .35s cubic-bezier(.2,.8,.2,1) both;
}
.lyrics > * { background: var(--card); }
.lyrics { filter: drop-shadow(0 -6px 18px rgba(0,0,0,.18)); }
.ly-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border: 1.5px solid var(--ink); border-bottom: 1px dashed var(--rule); border-radius: 8px 8px 0 0; }
.ly-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.ly-head .btn { box-shadow: none; }
.ly-body { height: min(34vh, 300px); overflow-y: auto; padding: 14px 18px 18px; border: 1.5px solid var(--ink); border-top: 0; scroll-behavior: smooth; overscroll-behavior: contain; }
@media (max-width: 640px) { .ly-body { height: min(26vh, 220px); } }
.ly-lines p { margin: 0; padding: 5px 0; font-size: 16px; line-height: 1.6; color: var(--sub); opacity: .55; cursor: pointer; transition: color .25s ease, opacity .25s ease, transform .25s ease; transform-origin: left center; }
.ly-lines p:hover { opacity: .9; }
.ly-lines p.on { color: var(--ink); opacity: 1; font-weight: 700; transform: scale(1.06); }
.ly-lines p.on::before { content: "▶ "; color: var(--accent); font-size: .8em; }
.ly-plain { white-space: pre-wrap; font-size: 15px; line-height: 1.9; }
.ly-none { color: var(--sub); font-size: 14px; padding: 18px 0; text-align: center; }
.ly-credit { margin-top: 14px; font-size: 11px; color: var(--sub); font-family: var(--mono); letter-spacing: .04em; }
body.lyrics-open.has-player { padding-bottom: calc(var(--dock-h, 280px) + 320px); }

@media (prefers-reduced-motion: reduce) {
  body::before, .sticker svg, .hero-title em, .marquee.run b, .stripes i, #app > *, .trk { animation: none !important; }
}

/* ---------- display settings ---------- */
.mast-r .gear { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--card); display: grid; place-items: center; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); padding: 0; }
.mast-r .gear svg { width: 18px; height: 18px; }
.mast-r .gear:active { transform: translate(2px, 2px); box-shadow: none; }
.set-sec + .set-sec { margin-top: 18px; }
.set-sec h3 { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .14em; color: var(--sub); margin-bottom: 8px; }
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); border: 1.5px solid var(--ink); border-radius: 8px; overflow: hidden; }
.seg3 button { border: 0; background: var(--card); padding: 10px 6px; font-weight: 700; cursor: pointer; font-size: 13px; }
.seg3 button + button { border-left: 1.5px solid var(--ink); }
.seg3 button.on { background: var(--ink); color: var(--paper); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.swatch { border: 1.5px solid var(--rule); border-radius: 8px; padding: 8px; background: var(--card); cursor: pointer; text-align: left; display: grid; gap: 6px; }
.swatch.on { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.swatch .chips { display: flex; gap: 0; height: 30px; border-radius: 4px; overflow: hidden; border: 1px solid rgba(0,0,0,.12); }
.swatch .chips i { flex: 1; }
.swatch b { font-size: 13px; }
.swatch span { font-size: 11px; color: var(--sub); font-family: var(--mono); letter-spacing: .06em; }

/* ---------- cover editor ---------- */
.cover-stage { position: relative; width: min(100%, 320px); aspect-ratio: 1; margin: 0 auto; border: 1.5px solid var(--ink); border-radius: 6px; overflow: hidden; background: repeating-conic-gradient(var(--soft) 0 25%, var(--card) 0 50%) 0 0 / 20px 20px; }
.cover-stage canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.cover-stage canvas:active { cursor: grabbing; }
.cover-empty { position: absolute; inset: 0; display: grid; place-items: center; }
.cover-empty img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.cover-empty span { position: relative; font-weight: 700; background: var(--card); padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--ink); }
.zoomrow { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--sub); }
.zoomrow input { flex: 1; accent-color: var(--accent); }
.covercard { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.covercard .thumb { width: 96px; height: 96px; border: 1.5px solid var(--ink); border-radius: 4px; overflow: hidden; background: var(--soft); }
.covercard .thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- community ---------- */
.pl .meta { flex-wrap: wrap; }
.bmc { font-family: var(--mono); font-size: 11px; color: var(--accent); font-weight: 600; }
.bmbtn.on { background: var(--accent); border-color: var(--ink); color: var(--on-accent); }
.listed { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--accent); }
.listed::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.hero.compact { padding: 28px 0 8px; }
.hero.compact h1 { font-size: clamp(24px, 6vw, 34px); }
.hero.compact p { display: none; }
.hero.compact .sticker { width: 76px; height: 76px; top: 10px; }
.hero.compact .sticker b { width: 32px; height: 32px; font-size: 13px; }
.section-more { display: flex; justify-content: flex-end; margin-top: 10px; }

/* ---------- my page ---------- */
.mylink { display: inline-flex; align-items: center; gap: 7px; font-family: var(--body); font-size: 13px; font-weight: 700; letter-spacing: 0; color: var(--ink); text-decoration: none; padding: 3px 10px 3px 3px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card); box-shadow: 2px 2px 0 var(--ink); cursor: pointer; }
button.mylink { padding: 5px 12px; }
.mylink img, .mylink .noicon { width: 26px; height: 26px; border-radius: 50%; }
.mylink.on { background: var(--ink); color: var(--paper); }
.mylink:active { transform: translate(2px, 2px); box-shadow: none; }
.noicon { display: inline-block; background: radial-gradient(circle, var(--paper) 0 2px, var(--accent) 2.5px 6px, #111 6.5px); }
@media (max-width: 420px) { .mylink span { display: none; } .mylink { padding: 3px; } button.mylink { padding: 5px 10px; } button.mylink span, .conn button.mylink { font-size: 12px; } .mast .word { font-size: 12px; letter-spacing: .1em; } }

.mehead { display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: center; padding: 28px 0 18px; }
.mehead .avatar { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); background: var(--soft); }
.mehead .avatar img, .mehead .avatar .noicon { width: 100%; height: 100%; object-fit: cover; display: block; }
.mehead h1 { font-family: var(--display); font-size: clamp(22px, 5.6vw, 32px); line-height: 1.2; margin-top: 4px; word-break: break-word; }
.metabs { display: grid; grid-template-columns: repeat(3, 1fr); border: 1.5px solid var(--ink); border-radius: 8px; overflow: hidden; box-shadow: 3px 3px 0 var(--ink); }
.metabs button { border: 0; background: var(--card); padding: 11px 6px; font-weight: 700; cursor: pointer; }
.metabs button + button { border-left: 1.5px solid var(--ink); }
.metabs button.on { background: var(--ink); color: var(--paper); }

.mylist { display: grid; gap: 12px; }
.myrow { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); animation: rise .4s cubic-bezier(.2,.8,.2,1) backwards; }
.myrow .cover { width: 96px; height: 96px; border: 1.5px solid var(--ink); border-radius: 4px; overflow: hidden; background: var(--soft); }
.myrow .cover img { width: 100%; height: 100%; object-fit: cover; }
.myrow .info { min-width: 0; display: grid; gap: 6px; align-content: start; }
.myrow .info b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.myrow .tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.myrow .cnt { font-family: var(--mono); font-size: 11px; color: var(--sub); }
.myrow .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.priv.pub { color: var(--accent); }
@media (max-width: 420px) { .myrow { grid-template-columns: 72px 1fr; } .myrow .cover { width: 72px; height: 72px; } }

/* ---------- player: mode chips (MV / lyrics / shuffle / repeat) ---------- */
.player .pmodes { grid-area: modes; display: flex; gap: 8px; flex-wrap: wrap; }
.pbtn.icon { min-width: 42px; padding: 0 10px; position: relative; }
.pbtn.icon svg { width: 16px; height: 16px; }
.pbtn.icon sup { position: absolute; right: 5px; top: 2px; font-size: 9px; font-weight: 700; }

/* ---------- gallery cards / tools / profile ---------- */
.plcard { min-width: 0; }
.plcard .pl { width: 100%; }
.plcard .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-top: 2px; }
.plcard .owner { font-family: var(--mono); font-size: 11px; color: var(--sub); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.plcard a.owner:hover { color: var(--accent); text-decoration: underline; }
.plcard .cnt { font-family: var(--mono); font-size: 11px; color: var(--sub); }
.owner-link { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.owner-link:hover { color: var(--accent); }
.mehead .owner-link { display: inline-block; margin-top: 4px; font-weight: 500; }
.gtools { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 14px; }
.gtools .input { padding: 10px 12px; }
.gtools select.input { width: auto; cursor: pointer; }
@media (max-width: 420px) { .gtools { grid-template-columns: 1fr; } .gtools select.input { width: 100%; } }

/* header: keep everything on one line on phones */
.word, .helplink, .mylink { white-space: nowrap; }
@media (max-width: 420px) {
  .mast { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .brand { gap: 8px; }
  .word { font-size: 11px; letter-spacing: .08em; }
  .mast-r { gap: 8px; }
  .helplink { padding: 5px 10px; font-size: 12px; }
  .mast-r .gear { width: 30px; height: 30px; }
  .mast-r .gear svg { width: 16px; height: 16px; }
}
@media (max-width: 350px) { .word { display: none; } }

/* =========================================================
   COMMUNITY: home tabs, genres, likes, songs, comments, guide, admin
   ======================================================= */
.hometabs { display: grid; grid-template-columns: 1fr 1fr; margin: 36px 0 14px; border: 1.5px solid var(--ink); border-radius: 8px; overflow: hidden; box-shadow: 3px 3px 0 var(--ink); }
.hometabs button { border: 0; background: var(--card); padding: 12px 8px; font-weight: 700; font-size: 15px; cursor: pointer; }
.hometabs button + button { border-left: 1.5px solid var(--ink); }
.hometabs button.on { background: var(--ink); color: var(--paper); }

.gchips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px 4px; scrollbar-width: thin; }
.gchip { flex: none; border: 1.5px solid var(--rule); background: var(--card); padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--sub); white-space: nowrap; }
.gchip.on { border-color: var(--ink); background: var(--accent); color: var(--on-accent); }
.gtag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--accent-4); color: var(--ink); border: 1px solid var(--accent-3); white-space: nowrap; }
.gtag.oncover { position: absolute; left: 6px; top: 6px; background: var(--card); border-color: var(--ink); }
.pl .cover { position: relative; }

.likebtn { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--ink); background: var(--card); border-radius: 999px; padding: 5px 12px; font-weight: 700; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); font-family: var(--mono); font-size: 13px; color: var(--ink); }
.likebtn .heart { color: var(--accent); font-size: 16px; line-height: 1; }
.likebtn.on { background: var(--accent); color: var(--on-accent); }
.likebtn.on .heart { color: var(--on-accent); }
.likebtn.sm { padding: 3px 10px; font-size: 12px; box-shadow: 1.5px 1.5px 0 var(--ink); }
.likebtn:active { transform: translate(2px, 2px); box-shadow: none; }
.likebtn.pop .heart { animation: heartpop .45s cubic-bezier(.2,.8,.2,1.4); }
@keyframes heartpop { 0% { transform: scale(1); } 40% { transform: scale(1.6); } 100% { transform: scale(1); } }
.likebtn:disabled { opacity: .6; }
.cardfoot { display: flex; align-items: center; gap: 10px; margin-top: 6px; }

details.recent { margin-top: 36px; border-top: 1px solid var(--rule); padding-top: 10px; }
details.recent summary { cursor: pointer; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--sub); list-style: none; padding: 6px 0; }
details.recent summary::-webkit-details-marker { display: none; }
details.recent summary::before { content: "▸ "; }
details.recent[open] summary::before { content: "▾ "; }
details.recent .plgrid { margin-top: 10px; }

/* songs */
.songs { display: grid; gap: 12px; }
.song { display: grid; grid-template-columns: 112px 1fr auto; gap: 14px; align-items: start; padding: 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); animation: rise .4s cubic-bezier(.2,.8,.2,1) backwards; }
.sthumb { position: relative; width: 112px; aspect-ratio: 16 / 9; border: 1.5px solid var(--ink); border-radius: 4px; overflow: hidden; padding: 0; background: #000; cursor: pointer; }
.sthumb img { width: 100%; height: 100%; object-fit: cover; }
.splay { position: absolute; inset: 0; margin: auto; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 13px; box-shadow: 0 0 0 3px rgba(255,255,255,.7); }
.sbody { min-width: 0; }
.stitle { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sartist { font-size: 13px; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sdesc { font-size: 13px; margin-top: 6px; white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
.smeta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.smeta .owner { color: var(--sub); }
.sside { display: grid; gap: 6px; justify-items: end; }
@media (max-width: 560px) {
  .song { grid-template-columns: 96px 1fr; }
  .sthumb { width: 96px; }
  .sside { grid-column: 1 / -1; display: flex; justify-content: flex-start; align-items: center; flex-wrap: wrap; }
}
.modal-card.wide { width: min(640px, 100%); }
.yt-embed { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #000; border: 1.5px solid var(--ink); }
.yt-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* song posting */
.sres { display: grid; gap: 6px; max-height: 360px; overflow: auto; }
.sres-item { display: grid; grid-template-columns: 88px 1fr; gap: 10px; align-items: center; text-align: left; padding: 6px; border: 1px solid var(--rule); border-radius: 6px; background: var(--card); cursor: pointer; }
.sres-item:hover { border-color: var(--ink); }
.sres-item img { width: 88px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; }
.sres-item b { display: block; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sres-item span { min-width: 0; }
.picked { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center; padding: 10px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--soft); }
.picked img { width: 112px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; }
.picked b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
select.input { cursor: pointer; }

/* comments */
.cmt-form { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); margin-bottom: 12px; }
.cmt-form .textarea { min-height: 80px; }
.cmt { padding: 10px 2px; border-bottom: 1px dashed var(--rule); }
.cmt-h { display: flex; gap: 10px; align-items: baseline; }
.cmt-h b { font-size: 14px; }
.cmt-h span { font-family: var(--mono); font-size: 11px; color: var(--sub); }
.cmt-t { font-size: 14px; white-space: pre-wrap; word-break: break-word; margin-top: 2px; }

/* login guide */
.guide-shot { width: 100%; margin: 12px 0; border: 1.5px solid var(--ink); border-radius: 6px; background: #fff; }

/* my page tabs (5) */
.metabs.scroll { display: flex; overflow-x: auto; }
.metabs.scroll button { flex: 1 0 auto; padding: 11px 14px; white-space: nowrap; }
.metabs.cols3 { grid-template-columns: repeat(3, 1fr); }

/* admin */
.admrow { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--card); margin-top: 8px; }
.admrow.hid { opacity: .55; border-style: dashed; }
.btn.danger { color: var(--bad); }
@media (max-width: 560px) { .admrow { grid-template-columns: 1fr; } }
