/* ============================================================
   Pokémon Sound Ark — styles
   Concept: a record shelf. Every album is a disc in its two
   version colors (--a / --b); the selected album tints the page.
   ============================================================ */
:root {
  --sans: "Pretendard Variable", Pretendard, "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Unbounded", "Pretendard Variable", Pretendard, "Noto Sans JP", sans-serif;
  --mono: "JetBrains Mono", "Pretendard Variable", Pretendard, "Noto Sans JP", ui-monospace, Consolas, monospace;

  --bg: #0c0d11;
  --surface: #13151b;
  --surface-2: #1a1d25;
  --surface-3: #252935;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --ink: #eef0f4;
  --ink-2: #a4a9b6;
  --ink-3: #6d7282;

  /* album colors — overwritten by app.js on album change */
  --a: #e3350d;
  --b: #4dad5b;
  --accent: #ff6a45;

  --bar-h: 64px;
  --gutter: clamp(16px, 3vw, 40px);
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* category accents (tuned for the dark background) */
  --c-event: #d98bcb;
  --c-route: #52d86a;
  --c-town: #72a9ea;
  --c-facilities: #ffa066;
  --c-locations: #40c4e4;
  --c-battle: #ff5c3a;
  --c-villan: #a99fc2;
  --c-character: #f3c62e;
}
:root[lang="ja"] { --sans: "Noto Sans JP", "Pretendard Variable", Pretendard, system-ui, sans-serif; }

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/* ambient album glow behind everything */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(50% 40% at 10% 0%, color-mix(in srgb, var(--a) 16%, transparent), transparent 70%),
    radial-gradient(45% 35% at 95% 5%, color-mix(in srgb, var(--b) 12%, transparent), transparent 70%);
}
body.has-player { padding-bottom: 120px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ===== Disc (shared) ===== */
.disc {
  --size: 64px;
  --hole: var(--bg);
  position: relative;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--hole) 0 6%, rgba(255, 255, 255, .6) 6.5% 7.6%, transparent 8%),
    radial-gradient(circle, transparent 0 29%, rgba(0, 0, 0, .22) 29.5% 31%, transparent 31.5%),
    repeating-radial-gradient(circle, transparent 0 1.6px, rgba(0, 0, 0, .1) 1.6px 2.6px),
    linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 10px 24px -12px rgba(0, 0, 0, .8);
}
.disc::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 200deg, transparent 0 8%, rgba(255, 255, 255, .26) 15%, transparent 23%,
                             transparent 58%, rgba(255, 255, 255, .16) 65%, transparent 73%);
}
.spin { animation: spin 3.6s linear infinite; animation-play-state: paused; }
.is-audio-playing .spin.is-live { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Intro ===== */
.intro {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center;
  background: var(--bg);
  overflow: hidden;
  transition: opacity .6s var(--ease), visibility .6s;
}
.intro.hidden { opacity: 0; visibility: hidden; }
.intro__disc {
  --size: min(120vmin, 1100px);
  position: absolute; top: 50%; right: calc(var(--size) * -.36);
  margin-top: calc(var(--size) / -2);
  animation: spin 60s linear infinite;
}
.intro::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--bg) 25%, color-mix(in srgb, var(--bg) 55%, transparent) 55%, transparent 80%);
}
.intro__inner { position: relative; z-index: 1; padding: 0 var(--gutter); max-width: 760px; }
.intro__kicker {
  margin: 0 0 18px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-2);
}
.intro__logo {
  margin: 0;
  font-family: var(--display); font-weight: 800;
  font-size: clamp(64px, 12vw, 168px); line-height: .88; letter-spacing: -.03em;
  text-transform: uppercase;
}
.intro__lead { margin: 28px 0 8px; max-width: 30em; font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-2); }
.intro__note { margin: 0 0 32px; font-size: 13px; color: var(--ink-3); }
.intro__btn {
  height: 52px; padding: 0 28px;
  border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-weight: 700; font-size: 15px;
  transition: transform .2s var(--ease), background .2s;
}
.intro__btn:hover { transform: translateY(-2px); background: #fff; }

/* ===== Top bar ===== */
.bar {
  position: sticky; top: 0; z-index: 30;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; color: inherit; text-decoration: none; }
.brand__mark { --size: 28px; --a: #e3350d; --b: #2a5fd0; }
.brand__name { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.brand__sub { font-family: var(--mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.search { position: relative; width: min(340px, 30vw); }
.search svg { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search input {
  width: 100%; height: 38px;
  padding: 0 34px 0 38px;
  text-overflow: ellipsis;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); }
.search kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  min-width: 20px; height: 20px; display: grid; place-items: center;
  border-radius: 5px; border: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  pointer-events: none;
}
.search input:focus ~ kbd, .search input:not(:placeholder-shown) ~ kbd { display: none; }

.seg { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.seg button {
  display: flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 11px;
  border-radius: 999px;
  color: var(--ink-3); font-size: 12px; font-weight: 600;
  transition: background .2s, color .2s;
}
.seg button:hover { color: var(--ink); }
.seg button.is-active { background: var(--surface-3); color: var(--ink); }
.seg .ico { width: 16px; height: 16px; fill: currentColor; }
.flag { width: 18px; height: 12px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .18); }
.seg--lang button:not(.is-active) .flag { filter: saturate(.4) brightness(.85); }

/* wide-tracked mono labels read badly in Hangul / kana */
:root:not([lang="en"]) :is(.shelf__label, .disc-head, .list-head) { letter-spacing: .04em; }

/* ===== Shelf ===== */
.shelf { padding: 22px var(--gutter) 4px; }
.shelf__label {
  display: flex; justify-content: space-between;
  margin-bottom: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3);
}
.shelf__tabs { display: flex; gap: 18px; }
.shelf__tabs button {
  position: relative; padding: 4px 0;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--ink-3);
  transition: color .2s;
}
.shelf__tabs button:hover { color: var(--ink-2); }
.shelf__tabs button.is-active { color: var(--ink); }
.shelf__tabs button.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px; background: var(--accent);
}
.shelf__label { align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line-2);
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-2);
  transition: border-color .2s, color .2s, background .2s;
}
.pill svg { width: 14px; height: 14px; fill: currentColor; }
.pill:hover { border-color: var(--accent); color: var(--ink); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.album__code svg { display: inline-block; width: 11px; height: 11px; vertical-align: -1px; fill: currentColor; }
.album--likes .album__code { color: #ff7a9a; }
.disc__icon {
  position: absolute; inset: 27%; z-index: 1;
  width: 46%; height: 46%; padding: 7%;
  border-radius: 50%; background: var(--bg); fill: var(--cat);
}
.disc--new {
  display: grid; place-items: center;
  background: none; border: 1.5px dashed var(--line-2); box-shadow: none;
  color: var(--ink-3);
}
.disc--new::after { display: none; }
.disc--new svg { width: 40%; height: 40%; fill: currentColor; }
.album--new:hover .disc--new, .album--tool:hover .disc--new { color: var(--ink); border-color: var(--ink-3); }
.album--new:hover .disc, .album--tool:hover .disc { transform: none; }
.shelf__list {
  position: relative;
  list-style: none; margin: 0 -6px; padding: 6px 0 10px;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(84px, 1fr); gap: 4px;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.album {
  width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 6px 10px;
  border-radius: 14px;
  text-align: center;
  scroll-snap-align: start;
  transition: background .2s;
}
.album .disc { --size: 58px; transition: transform .45s var(--ease), box-shadow .3s; }
.album:hover { background: var(--surface); }
.album:hover .disc { transform: rotate(-24deg); }
.album.is-active { background: var(--surface-2); }
.album.is-active .disc { transform: scale(1.08); box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--accent), 0 12px 24px -10px rgba(0, 0, 0, .8); }
.album__code { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--ink-3); }
.album.is-active .album__code { color: var(--accent); }
.album__name {
  width: 100%; height: 2.6em;
  font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--ink-2);
  overflow: hidden;
}
.album__name span {
  display: inline-block; max-width: 100%; vertical-align: top;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.album.is-active .album__name { color: var(--ink); }

/* ===== Hero ===== */
.hero {
  position: relative;
  margin: 10px var(--gutter) 0;
  padding: clamp(22px, 3.4vw, 44px);
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(24px, 4vw, 60px); align-items: center;
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    radial-gradient(70% 140% at 0% 100%, color-mix(in srgb, var(--a) 26%, transparent), transparent 62%),
    radial-gradient(60% 120% at 100% 0%, color-mix(in srgb, var(--b) 20%, transparent), transparent 60%),
    var(--surface);
  overflow: hidden;
}
.hero__art { --w: clamp(140px, 17vw, 220px); position: relative; width: calc(var(--w) * 1.34); height: var(--w); }
.sleeve {
  position: absolute; inset: 0 auto 0 0; z-index: 1;
  width: var(--w);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 14px;
  border-radius: 10px;
  background:
    linear-gradient(to top, rgba(0, 0, 0, .55), transparent 55%),
    linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 24px 40px -18px rgba(0, 0, 0, .9);
  color: #fff;
}
.sleeve__top { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .85; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.sleeve__code { display: block; white-space: nowrap; font-family: var(--display); font-weight: 800; font-size: calc(var(--w) * .16); line-height: .95; letter-spacing: -.02em; }
.sleeve__year { display: block; margin-top: 6px; font-family: var(--mono); font-size: 11px; opacity: .8; }
.hero__disc {
  --size: calc(var(--w) * .94);
  --hole: var(--surface);
  position: absolute; top: calc(var(--w) * .03); left: calc(var(--w) * .34);
  transition: left .6s var(--ease);
}
.hero.is-current .hero__disc { left: calc(var(--w) * .4); }
.hero__body { min-width: 0; }
.hero__kicker {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .03em; color: var(--ink-2);
}
.hero__kicker b { color: var(--accent); font-weight: 600; }
.hero__title {
  margin: 12px 0 8px;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(30px, 4.4vw, 62px); line-height: 1.05; letter-spacing: -.015em;
  text-wrap: balance; overflow-wrap: break-word;
}
:root:not([lang="en"]) .hero__title { font-family: var(--sans); font-weight: 800; letter-spacing: -.035em; }
.hero__alt { margin: 0; font-size: 15px; color: var(--ink-2); }
.hero__alt span { color: var(--ink-3); }
.hero__stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.act {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .04);
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  transition: background .2s, border-color .2s, transform .2s, opacity .2s;
}
.act svg { width: 17px; height: 17px; fill: currentColor; flex: none; }
.act:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.act--primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.act--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.act--icon { width: 40px; padding: 0; color: var(--ink-2); }
.act--danger { border-color: color-mix(in srgb, #ff6b6b 60%, transparent); color: #ff8a8a; }
.act--danger:hover { background: color-mix(in srgb, #ff6b6b 16%, transparent); border-color: #ff6b6b; }
.act:disabled { opacity: .4; pointer-events: none; }
.sleeve__icon { display: grid; place-items: center; flex: 1; }
.sleeve__icon .i-heart { fill: #fff !important; stroke: none; }
.sheet__panel:focus { outline: none; }
.sleeve__icon svg { width: 44%; height: auto; aspect-ratio: 1; fill: #fff; opacity: .92; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35)); }
.stat { margin: 0; min-width: 92px; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.stat dt { margin-bottom: 2px; font-size: 11px; color: var(--ink-3); }
.stat dd { margin: 0; font-family: var(--mono); font-size: 18px; font-weight: 600; }
.stat--link { display: flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600; transition: border-color .2s, background .2s; }
.stat--link:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* ===== Toolbar / filters ===== */
.toolbar {
  position: sticky; top: var(--bar-h); z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 16px var(--gutter) 14px;
  background: linear-gradient(var(--bg) 72%, transparent);
}
.filters { flex: 1; min-width: 0; display: flex; gap: 8px; padding: 2px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s;
}
.chip svg { width: 16px; height: 16px; fill: var(--cat); }
.chip__count { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.chip:hover { color: var(--ink); border-color: color-mix(in srgb, var(--cat) 55%, transparent); }
.chip.is-active { background: color-mix(in srgb, var(--cat) 18%, var(--surface)); border-color: var(--cat); color: var(--ink); }
.chip.is-active .chip__count { color: var(--cat); }
.chip--all { padding-left: 14px; }
.scope { flex: none; }
.scope[hidden] { display: none; }
.scope button { height: 28px; }
.seg__n { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.scope button.is-active .seg__n { color: var(--accent); }
.toolbar__count { flex: none; font-family: var(--mono); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.toolbar__count b { color: var(--ink); font-weight: 600; }

/* ===== Tracks ===== */
.tracks { padding: 2px var(--gutter) 48px; }
.empty { margin: 40px 0 80px; text-align: center; color: var(--ink-3); }

/* whole-series search: one header per album */
.group-head {
  display: flex; align-items: center; gap: 12px;
  margin: 28px 0 10px; padding: 0 14px 10px;
  border-bottom: 1px solid var(--line);
}
.group-head:first-child, .list-head + .group-head { margin-top: 10px; }
.group-head .disc { --size: 34px; }
.group-head__name { min-width: 0; display: flex; flex-direction: column; }
.group-head__name b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-head__name small { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.group-head__open {
  flex: none; margin-left: auto;
  height: 30px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line-2);
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  transition: border-color .2s, color .2s;
}
.group-head__open:hover { border-color: var(--accent); color: var(--ink); }

/* list view */
.list-head, .row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 150px minmax(0, 200px) 52px 70px;
  gap: 16px; align-items: center;
}
.list-head {
  padding: 0 14px 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
}
.list-head span:nth-child(5) { text-align: right; }
.disc-head {
  display: flex; align-items: center; gap: 12px;
  margin: 26px 0 6px; padding: 0 14px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2);
}
.disc-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.disc-head small { color: var(--ink-3); letter-spacing: .04em; }
.row { padding: 9px 14px; border-radius: 12px; cursor: pointer; transition: background .15s; }
.row:hover { background: var(--surface); }
.row__no { position: relative; height: 20px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); }
.row__no > * { position: absolute; left: 0; top: 50%; transform: translateY(-50%); }
.row__no .glyph { width: 16px; height: 16px; fill: var(--ink); opacity: 0; }
.row:hover .row__no .num { opacity: 0; }
.row:hover .row__no .glyph { opacity: 1; }
.row__title { min-width: 0; }
.row__title b, .row__title small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__title b { font-size: 14.5px; font-weight: 600; }
.row__title small { font-size: 12px; color: var(--ink-3); }
.tag { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.tag svg { flex: none; width: 15px; height: 15px; fill: var(--cat); }
.tag span { overflow: hidden; text-overflow: ellipsis; }
.row__composer { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__dur { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); text-align: right; }
.row.is-playing { background: color-mix(in srgb, var(--accent) 11%, var(--surface)); }
.row.is-playing .row__title b { color: var(--accent); }
.row.is-playing .row__no .num, .row.is-playing .row__no .glyph { opacity: 0; }

/* per-track actions: ♥ and ⋯ */
.tacts { display: flex; justify-content: flex-end; gap: 2px; }
.tact {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; color: var(--ink-3);
  transition: background .15s, color .15s, transform .15s;
}
.tact svg { width: 17px; height: 17px; fill: currentColor; }
.tact:hover { background: var(--surface-3); color: var(--ink); }
.i-heart { fill: none !important; stroke: currentColor; stroke-width: 1.9; }
.is-on > .i-heart, .is-on .i-heart { fill: currentColor !important; }
.tact--like.is-on { color: #ff5c86; }
.tact--like.is-on:active { transform: scale(.85); }
.mini-disc {
  display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px;
  border-radius: 50%; background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}

/* equalizer (playing indicator) */
.eq { display: none; gap: 2px; align-items: flex-end; height: 14px; }
.is-playing .eq { display: flex; }
.eq i { width: 3px; height: 100%; border-radius: 1px; background: var(--accent); transform-origin: bottom; transform: scaleY(.35); }
.is-audio-playing .eq i { animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; }
.eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* box view */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 14px; }
.tile {
  padding: 8px 8px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: transform .25s var(--ease), border-color .2s, background .2s;
}
.tile:hover { transform: translateY(-3px); background: var(--surface-2); border-color: color-mix(in srgb, var(--cat) 45%, transparent); }
.tile__art {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid; place-items: center;
  border-radius: 10px;
  background:
    radial-gradient(90% 90% at 25% 15%, color-mix(in srgb, var(--cat) 30%, transparent), transparent 70%),
    color-mix(in srgb, var(--cat) 9%, var(--bg));
  overflow: hidden;
}
.tile__art .cat-icon { width: 44%; height: 44%; fill: var(--cat); transition: transform .35s var(--ease); }
.tile:hover .cat-icon { transform: scale(1.07) rotate(-5deg); }
.tile__no { position: absolute; top: 8px; left: 10px; font-family: var(--mono); font-size: 11px; color: rgba(255, 255, 255, .6); }
.tile__play {
  position: absolute; right: 8px; bottom: 8px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--ink); color: var(--bg);
  opacity: 0; transform: translateY(6px);
  transition: opacity .2s, transform .25s var(--ease);
}
.tile__play svg { width: 16px; height: 16px; fill: currentColor; }
.tile__art .tacts { position: absolute; top: 4px; right: 4px; z-index: 1; opacity: 0; transition: opacity .2s; }
.tile__art .tact { width: 30px; height: 30px; color: rgba(255, 255, 255, .85); background: rgba(0, 0, 0, .28); }
.tile__art .tact:hover { background: rgba(0, 0, 0, .5); color: #fff; }
.tile__art .tact--like.is-on { color: #ff6f94; }
.tile:hover .tacts, .tile:focus-within .tacts, .tile__art .tacts:has(.is-on) { opacity: 1; }
@media (hover: none) { .tile__art .tacts { opacity: 1; } }
.tile:hover .tile__play, .tile.is-playing .tile__play { opacity: 1; transform: none; }
.tile.is-playing { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tile.is-playing .tile__play { background: var(--accent); }
.tile.is-playing .tile__play svg { display: none; }
.tile.is-playing .tile__play .eq i { background: var(--bg); }
.tile__title {
  margin: 10px 4px 3px;
  font-size: 13.5px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tile.is-playing .tile__title { color: var(--accent); }
.tile__meta { display: flex; justify-content: space-between; gap: 8px; margin: 0 4px; font-size: 11.5px; color: var(--ink-3); }
.tile__meta span:last-child { font-family: var(--mono); }

/* ===== Player ===== */
.player {
  position: fixed; left: 50%; bottom: 16px; z-index: 40;
  width: min(1120px, calc(100% - 32px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto minmax(0, 1.1fr) auto;
  grid-template-areas: "disc meta acts controls progress close";
  align-items: center; gap: 18px;
  padding: 10px 12px 10px 10px;
  border-radius: 22px;
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .85);
  animation: rise .45s var(--ease);
}
.player[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 16px); } }
.player__disc { --size: 52px; --hole: var(--surface-2); grid-area: disc; }
.player__meta { grid-area: meta; min-width: 0; }
.player__title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__sub { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__acts { grid-area: acts; display: flex; gap: 2px; }
.ctrl--toggle.is-on { color: var(--accent); }
.ctrl--toggle.is-on::after { content: ""; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.ctrl { position: relative; }
.player__controls { grid-area: controls; display: flex; align-items: center; gap: 4px; }
.ctrl { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); transition: background .2s, color .2s, transform .2s; }
.ctrl svg { width: 18px; height: 18px; fill: currentColor; }
.ctrl:hover { background: var(--surface-3); color: var(--ink); }
.ctrl--play { width: 46px; height: 46px; background: var(--ink); color: var(--bg); }
.ctrl--play svg { width: 20px; height: 20px; }
.ctrl--play:hover { background: var(--accent); color: var(--bg); transform: scale(1.05); }
.ctrl--play.is-disabled { background: var(--surface-3); color: var(--ink-3); cursor: not-allowed; transform: none; }
.player__close { grid-area: close; }
.player__progress { grid-area: progress; min-width: 0; }
.player__bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.player__path { margin-top: 3px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .75; }
.player__path b { color: var(--accent); font-weight: 600; margin-right: 6px; }

input[type="range"] {
  --p: 0%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 16px; margin: 0;
  background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent) var(--p), var(--surface-3) var(--p));
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--surface-3); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; margin-top: -4px;
  border-radius: 50%; background: var(--ink); border: 0;
}
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 0; }

/* ===== Sheet (dialogs) ===== */
.sheet {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(4, 5, 8, .6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .2s;
}
.sheet.is-open { opacity: 1; }
.sheet[hidden] { display: none; }
.sheet__panel {
  width: min(460px, 100%); max-height: min(80vh, 640px); overflow: auto;
  padding: 18px;
  border-radius: 22px; border: 1px solid var(--line-2);
  background: var(--surface-2);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9);
  transform: translateY(10px) scale(.98); transition: transform .25s var(--ease);
}
.sheet.is-open .sheet__panel { transform: none; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sheet__head h2 { margin: 0; font-size: 16px; font-weight: 700; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet__text { margin: 0 0 14px; font-size: 13.5px; color: var(--ink-2); }
.sheet__note { margin: 10px 0; padding: 10px 12px; border-radius: 12px; font-size: 12.5px; color: #ffd27a; background: rgba(255, 196, 77, .08); border: 1px solid rgba(255, 196, 77, .25); }
.sheet__track { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 10px; border-radius: 14px; background: var(--surface); }
.sheet__track .disc { --size: 40px; --hole: var(--surface); }
.sheet__track b, .sheet__track small { display: block; }
.sheet__track b { font-size: 14px; }
.sheet__track small { font-size: 12px; color: var(--ink-3); }
.sheet__row { display: flex; justify-content: flex-end; gap: 8px; }
.sheet__form, .sheet__link { display: flex; gap: 8px; margin-top: 12px; }
.sheet__form input, .sheet__link input {
  flex: 1; min-width: 0; height: 42px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-size: 14px;
}
.sheet__link input { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.sheet__form input:focus, .sheet__link input:focus { outline: none; border-color: var(--accent); }
.menu { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.menu__item {
  display: flex; align-items: center; gap: 12px;
  min-height: 46px; padding: 0 12px;
  border-radius: 12px; text-align: left;
  font-size: 14px; font-weight: 500; color: var(--ink);
  transition: background .15s;
}
.menu__item:hover { background: var(--surface-3); }
.menu__item svg { width: 19px; height: 19px; flex: none; fill: currentColor; color: var(--ink-2); }
.menu__item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu__item.is-on svg { color: var(--accent); }
.menu__item.is-on .i-heart { color: #ff5c86; }
.menu__item--danger, .menu__item--danger svg { color: #ff8a8a; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 95;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-size: 13.5px; font-weight: 600;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .7);
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .25s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
body.has-player .toast { bottom: 108px; }

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .list-head, .row { grid-template-columns: 52px minmax(0, 1fr) 130px 52px 70px; }
  .row__composer, .list-head .col-composer { display: none; }
}
@media (max-width: 760px) {
  /* intro: text on top, disc rising from the bottom so the copy stays readable */
  .intro { align-items: flex-start; padding-top: 14vh; }
  .intro__disc { --size: 125vmin; top: auto; bottom: calc(var(--size) * -.45); right: calc(var(--size) * -.3); margin-top: 0; }
  .intro::after { background: linear-gradient(180deg, var(--bg) 50%, color-mix(in srgb, var(--bg) 40%, transparent) 72%, transparent 90%); }
  .bar { height: auto; flex-wrap: wrap; row-gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .brand__sub { display: none; }
  .search { order: 5; flex: 1 1 60%; min-width: 0; width: auto; }
  .seg--view { order: 6; }
  .search kbd { display: none; }
  .seg--lang .lang-code { display: none; }
  .seg--lang button { padding: 0 9px; }
  .shelf { padding-top: 16px; }
  .shelf__list { grid-auto-columns: 80px; }
  .hero { grid-template-columns: 1fr; gap: 22px; border-radius: 20px; }
  .hero__art { --w: 128px; }
  .toolbar { position: static; padding-top: 14px; flex-wrap: wrap; row-gap: 10px; }
  .scope { width: 100%; }
  .scope button { flex: 1; justify-content: center; }
  .toolbar__count { display: none; }
  .list-head { display: none; }
  .row { grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 8px; padding: 9px 6px 9px 10px; }
  .row .tact { width: 30px; height: 30px; }
  .shelf__tabs { gap: 14px; }
  .pill span { display: none; }
  .pill { width: 30px; padding: 0; justify-content: center; }
  .hero__actions .act:not(.act--primary) span { display: none; }
  .hero__actions .act:not(.act--primary) { width: 40px; padding: 0; }
  .sheet { align-items: flex-end; padding: 0; }
  .sheet__panel { width: 100%; max-height: 85vh; border-radius: 22px 22px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateY(30px); }
  body.has-player .toast { bottom: 160px; }
  .row .tag { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .tile__play { opacity: 1; transform: none; width: 30px; height: 30px; }
  body.has-player { padding-bottom: 200px; }
  .player__controls { justify-content: center; gap: 10px; }
  .player {
    bottom: 10px; width: calc(100% - 20px);
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "disc meta acts close" "controls controls controls controls" "progress progress progress progress";
    gap: 8px 10px; padding: 10px; border-radius: 18px;
  }
  .player__disc { --size: 42px; }
  .ctrl { width: 34px; height: 34px; }
  .ctrl--play { width: 40px; height: 40px; }
  .player__path { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
