/* wintidal — floating, minimal: blurred artwork, hairlines, a few glass surfaces */

@font-face { font-family: "Akzidenz-Grotesk"; font-weight: 300; font-style: normal; font-display: swap; src: url("../fonts/Akzidenz-grotesk-light.ttf") format("truetype"); }
@font-face { font-family: "Akzidenz-Grotesk"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/Akzidenz-grotesk-roman.ttf") format("truetype"); }
@font-face { font-family: "Akzidenz-Grotesk"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/Akzidenz-grotesk-bold.ttf") format("truetype"); }

:root {
  color-scheme: dark;
  --bg: #0b0b0e;
  --fg: #ffffff;
  --fg-2: rgba(255, 255, 255, 0.64);
  --fg-3: rgba(255, 255, 255, 0.42);
  --fg-4: rgba(255, 255, 255, 0.26);
  --accent: #ff3b30;
  --accent-soft: rgba(255, 59, 48, 0.18);
  --danger: #ff453a;
  --atmos: #8ad3ff;

  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --hover: rgba(255, 255, 255, 0.05);
  --hover-2: rgba(255, 255, 255, 0.09);
  --inset: rgba(255, 255, 255, 0.07);

  --glass: rgba(18, 18, 22, 0.6);
  --glass-panel: rgba(12, 12, 16, 0.55);
  --glass-menu: rgba(26, 26, 32, 0.78);
  --glass-blur: 28px;
  --glass-border: 1px solid rgba(255, 255, 255, 0.09);
  --glass-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);

  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 18px;
  --r-pill: 999px;

  --gap: 16px;
  --top-h: 48px;
  --bar-h: 76px;
  --queue-w: 340px;
  --content-max: 1280px;

  --viz-color: #ffffff;
  --viz-bg: #000000;

  --font: "Akzidenz-Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 0.14s;
  --t-med: 0.28s;
  --t-slow: 0.7s;
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 400 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 28px; font-weight: 300; line-height: 1.15; }
h2 { font-size: 15px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { opacity: 0.35; cursor: default; }
input, select { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--inset); padding: 1px 5px; border-radius: var(--r-xs); }
.muted { color: var(--fg-2); }
.small { font-size: 12px; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.55); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

html, .view, .queue-list, .shelf, .menu, .overlay, .login-card { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.24); background-clip: padding-box; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
option { background: #1a1a20; color: #fff; }
::placeholder { color: var(--fg-3); }
[hidden] { display: none !important; }

.app { display: contents; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* ------------------------------------------------------------------ backdrop */
#bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background: var(--bg); pointer-events: none;
  transition: opacity var(--t-med) var(--ease);
}
.bg-layer {
  position: absolute; inset: -10%;
  background: center / cover no-repeat;
  filter: blur(64px) saturate(1.3) brightness(0.5);
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease);
  will-change: opacity;
}
.bg-layer.show { opacity: 1; }
#bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8, 8, 12, 0.42), rgba(8, 8, 12, 0.7));
}
body.is-now #bg { opacity: 0; }

/* ------------------------------------------------------------------ icon & text buttons */
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-2);
  transition: color var(--t-fast), background var(--t-fast);
}
.icon-btn:hover { color: var(--fg); background: var(--hover-2); }
.icon-btn svg { width: 17px; height: 17px; stroke-width: 1.8; display: block; }
.icon-btn .ic { display: flex; }
.icon-btn.accent { color: var(--accent); }
.icon-btn.accent:hover { color: var(--accent); background: var(--accent-soft); }
.icon-btn.accent svg { width: 20px; height: 20px; stroke-width: 2.2; }
.icon-btn.heart.on { color: var(--accent); }
.icon-btn.toggle { position: relative; }
.icon-btn.toggle.on { color: var(--fg); }
.icon-btn.toggle.on::after {
  content: ""; position: absolute; left: 50%; bottom: 2px;
  width: 3px; height: 3px; margin-left: -1.5px; border-radius: 50%; background: var(--fg);
}

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 16px;
  border-radius: var(--r-pill); border: 1px solid var(--line-2);
  font-size: 13px; font-weight: 500; color: var(--fg);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.btn:hover { background: var(--hover); border-color: rgba(255, 255, 255, 0.24); }
.btn svg { width: 14px; height: 14px; }
.btn.primary, .primary { background: var(--fg); color: #000; border-color: transparent; }
.btn.primary:hover, .primary:hover { background: rgba(255, 255, 255, 0.88); }
.primary { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 16px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500; }
.link { color: var(--fg-2); font-size: 12px; }
.link:hover { color: var(--fg); }
.play-circle {
  width: 40px; height: 40px; border-radius: 50%; background: var(--fg); color: #000;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  transition: transform var(--t-fast) var(--ease);
}
.play-circle:hover { transform: scale(1.06); }
.play-circle svg { width: 18px; height: 18px; margin-left: 2px; }

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: fixed; top: var(--gap); left: var(--gap); right: var(--gap);
  height: var(--top-h); z-index: 30; border-radius: 14px;
  display: flex; align-items: center; gap: 8px; padding: 0 8px;
}
.nav-buttons { display: flex; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: 4px; min-width: 0; }
.nav a {
  padding: 6px 10px; border-radius: var(--r-sm); font-size: 13px; font-weight: 500;
  color: var(--fg-2); white-space: nowrap;
  transition: color var(--t-fast), background var(--t-fast);
}
.nav a:hover { color: var(--fg); background: var(--hover); }
.nav a.active { color: var(--fg); }
.nav-sep { width: 1px; height: 14px; background: var(--line-2); margin: 0 6px; flex: none; }
.search { position: relative; margin-left: auto; flex: 0 1 240px; min-width: 120px; }
.search input {
  width: 100%; height: 32px; padding: 0 12px 0 32px; border: 0; border-radius: var(--r-pill);
  background: var(--inset); color: var(--fg); outline: none; font-size: 13px;
  transition: background var(--t-fast);
}
.search input::placeholder { color: var(--fg-3); }
.search input:focus { background: rgba(255, 255, 255, 0.12); }
.search input::-webkit-search-cancel-button { filter: invert(0.7); }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); display: flex; color: var(--fg-3); pointer-events: none; }
.search-icon svg { width: 15px; height: 15px; }
#btnMore[aria-expanded="true"] { color: var(--fg); background: var(--hover-2); }

/* ------------------------------------------------------------------ popover menu */
.menu {
  position: fixed; top: calc(var(--gap) + var(--top-h) + 8px); right: var(--gap);
  width: 300px; z-index: 40; border-radius: var(--r-md); padding: 6px;
  background: var(--glass-menu); transform-origin: top right;
  max-height: calc(100vh - var(--top-h) - 3 * var(--gap) - 8px); overflow-y: auto;
  animation: pop var(--t-fast) var(--ease);
}
.menu[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.menu-user { padding: 8px 12px 6px; font-size: 12px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu .sep { height: 1px; background: var(--line); margin: 4px 6px; }
.menu-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px;
  border-radius: var(--r-sm); font-size: 13px; color: var(--fg); text-align: left; cursor: pointer;
}
.menu-row:hover { background: var(--hover-2); }
.menu-row .ic { display: flex; color: var(--fg-2); }
.menu-row .ic svg { width: 15px; height: 15px; }
.menu-row kbd { margin-left: auto; font: inherit; font-size: 11px; color: var(--fg-3); }
.menu-row.danger { color: var(--danger); }
#btnNowPlaying.active, #btnNowPlaying.active .ic { color: var(--accent); }
.menu-row.field span, .menu-row.check span { flex: 1; color: var(--fg-2); font-size: 12px; }
.menu-row.field { flex-direction: column; align-items: stretch; gap: 6px; }
.menu-row.field select {
  width: 100%; background: var(--inset); border: 0; border-radius: var(--r-sm);
  padding: 6px 8px; color: var(--fg); font-size: 12px; outline: none;
}
.menu-row.field select option { background: #1a1a20; }
.switch {
  appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.18); position: relative; cursor: pointer; margin: 0;
  transition: background var(--t-fast);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform var(--t-fast) var(--ease);
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(14px); }
.menu-nav { display: none; }

/* ------------------------------------------------------------------ scroll view */
.view {
  position: fixed; inset: 0; z-index: 1;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding: calc(var(--top-h) + 2 * var(--gap) + 20px)
    max(clamp(24px, 4vw, 56px), calc(50% - var(--content-max) / 2))
    calc(var(--bar-h) + 2 * var(--gap) + 28px);
}
body.is-now .view { padding: 0; overflow: hidden; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 28px; flex-wrap: wrap; }
.view-head .sub { color: var(--fg-2); font-size: 13px; margin-top: 6px; }
.section { margin-top: 44px; }
.section:first-child, .view-head + .section { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-head a { color: var(--fg-2); font-size: 12px; }
.empty, .loading { color: var(--fg-3); padding: 64px 0; text-align: center; font-size: 13px; font-weight: 300; }
.loading::after {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 10px; vertical-align: middle;
  border-radius: 50%; border: 1.5px solid var(--fg-3); border-top-color: transparent; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sentinel { height: 1px; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar.actions { margin: 0 0 24px; }
.toolbar select {
  appearance: none; -webkit-appearance: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 4px center / 12px;
  border: 0; border-radius: var(--r-sm); padding: 6px 22px 6px 8px;
  color: var(--fg-2); font-size: 13px; cursor: pointer; outline: none;
}
.toolbar select:hover { color: var(--fg); background-color: var(--hover); }
.toolbar select option { background: #1a1a20; color: #fff; }

/* ------------------------------------------------------------------ cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px 16px; }
.shelf { display: flex; gap: 16px; overflow-x: auto; padding: 4px 4px 12px; margin: -4px -4px 0; scroll-snap-type: x proximity; scrollbar-width: thin; }
.shelf .card { flex: 0 0 150px; scroll-snap-align: start; }
.card { display: block; min-width: 0; }
.card-img {
  position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden;
  background: rgba(255, 255, 255, 0.04); margin-bottom: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform var(--t-med) var(--ease);
}
.card:hover .card-img { transform: translateY(-2px); }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card.round .card-img { border-radius: 50%; }
.card-img .play {
  position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); color: #000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(4px);
  transition: opacity var(--t-fast), transform var(--t-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.card:hover .card-img .play { opacity: 1; transform: none; }
.card-img .play svg { width: 15px; height: 15px; margin-left: 1px; }
.card-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--fg-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* ------------------------------------------------------------------ track list: number · title · duration */
.tracklist { display: flex; flex-direction: column; }
.tracklist .row {
  position: relative;
  display: grid; grid-template-columns: 32px minmax(0, 1fr) 56px 64px;
  align-items: center; gap: 12px; min-height: 44px;
  padding: 7px 12px; margin: 0 -12px;
  border-radius: var(--r-sm); cursor: pointer; user-select: none;
  transition: background var(--t-fast);
}
.tracklist .row + .row::before {
  content: ""; position: absolute; left: 56px; right: 12px; top: 0; height: 1px; background: var(--line);
  transition: opacity var(--t-fast);
}
.tracklist .row:hover { background: var(--hover); }
.tracklist .row:hover::before, .tracklist .row:hover + .row::before { opacity: 0; }
.tracklist .row.unavailable { opacity: 0.35; cursor: default; }
.col-num { color: var(--fg-3); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.row.active .col-num { color: var(--accent); font-weight: 500; }
.visual-icon-image { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.col-num.has-visual-icon, .q-num.has-visual-icon { width: 26px; height: 26px; justify-self: center; }
.col-title { min-width: 0; }
.col-title .t { font-size: 14px; line-height: 1.3; display: flex; align-items: center; gap: 8px; min-width: 0; }
.col-title .t > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.col-title .s { color: var(--fg-3); font-size: 12px; line-height: 1.3; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-title .s a:hover { color: var(--fg); }
.col-dur { color: var(--fg-3); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.col-actions { display: flex; justify-content: flex-end; opacity: 0; transition: opacity var(--t-fast); }
.row:hover .col-actions, .row:focus-within .col-actions, .row .col-actions.stay { opacity: 1; }
.col-actions .icon-btn { width: 28px; height: 28px; }
.col-actions .icon-btn svg { width: 15px; height: 15px; }
.e { font-size: 9px; font-weight: 600; color: var(--fg-4); letter-spacing: 0.06em; line-height: 1; flex: none; }
.tag { font-size: 9.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); white-space: nowrap; flex: none; }
.tag.hires { color: var(--fg-2); }
.tag.atmos { color: var(--atmos); }
.q-label { padding: 24px 0 8px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); font-weight: 500; }

/* ------------------------------------------------------------------ detail: cover left, panel right */
.detail { display: grid; grid-template-columns: minmax(260px, 42%) minmax(0, 1fr); gap: 48px; align-items: start; margin-bottom: 48px; }
.detail-side { position: sticky; top: calc(var(--gap) + var(--top-h) + 20px); min-width: 0; }
.detail-cover {
  display: block; width: min(100%, calc(100vh - var(--top-h) - var(--bar-h) - 4 * var(--gap) - 24px)); margin-inline: auto;
  aspect-ratio: 1; object-fit: cover; border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
}
.detail-cover.round { border-radius: 50%; }
.detail-panel {
  background: var(--glass-panel); border: var(--glass-border); border-radius: var(--r-lg);
  padding: 26px 32px 18px; min-width: 0;
}
.detail-meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 18px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.detail-meta > div:first-child { min-width: 0; }
.detail-sub { color: var(--fg-2); font-size: 12.5px; margin-bottom: 4px; }
.detail-sub a:hover { color: var(--fg); }
.detail-meta h1 { font-size: 22px; font-weight: 500; line-height: 1.2; letter-spacing: -0.015em; }
.detail-info { color: var(--fg-3); font-size: 12px; margin-top: 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.detail-desc { color: var(--fg-2); font-size: 13px; margin-top: 10px; max-width: 60ch; font-weight: 300; }
.detail-actions { display: flex; align-items: center; gap: 2px; flex: none; margin-bottom: 2px; }
.detail-actions .play-circle { margin-right: 6px; }
.detail-body .section { margin-top: 24px; }
.detail-body .section-head { margin-bottom: 4px; }

/* ------------------------------------------------------------------ player capsule */
.player {
  position: fixed; left: var(--gap); right: var(--gap); bottom: var(--gap);
  height: var(--bar-h); z-index: 30; border-radius: var(--r-xl);
  display: grid; grid-template-columns: auto auto minmax(200px, 1fr) auto auto;
  align-items: center; gap: 18px; padding: 0 18px 0 14px;
}
.np-cover-btn {
  width: 48px; height: 48px; border-radius: var(--r-xs); overflow: hidden; flex: none;
  background: rgba(255, 255, 255, 0.05); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.np-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-cover:not([src]), .np-cover[src=""] { visibility: hidden; }
.transport { display: flex; align-items: center; gap: 2px; }
.transport .icon-btn { color: var(--fg); }
.transport .icon-btn svg { width: 18px; height: 18px; }
.play-btn { width: 40px; height: 40px; border-radius: 50%; color: var(--fg); display: inline-flex; align-items: center; justify-content: center; }
.play-btn:hover { background: var(--hover-2); }
.play-btn svg { width: 22px; height: 22px; }
.play-btn.loading { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }
.np { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.np-text { min-width: 0; }
.np-title { font-size: 13px; font-weight: 500; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-line { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.np-artist { color: var(--fg-2); font-size: 12px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.np-artist a:hover { color: var(--fg); }
.badge { margin-left: auto; flex: none; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); white-space: nowrap; }
.badge:empty { display: none; }
.badge.hires { color: var(--fg-2); }
.seek { display: flex; align-items: center; gap: 8px; width: 100%; }
.time { font-size: 11px; color: var(--fg-3); min-width: 32px; text-align: center; line-height: 1; font-variant-numeric: tabular-nums; }
.extras { display: flex; align-items: center; gap: 2px; }
.volume { display: flex; align-items: center; gap: 2px; }
.volume input { width: 88px; }
.vol-hi { display: flex; color: var(--fg-3); margin-left: 2px; }
.vol-hi svg { width: 15px; height: 15px; }

/* ranges: hairline + dot */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 16px; background: transparent; cursor: pointer; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 1px; background: linear-gradient(to right, rgba(255, 255, 255, 0.85) var(--p, 0%), var(--line-2) var(--p, 0%)); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 8px; height: 8px; margin-top: -3.5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
  transition: transform var(--t-fast);
}
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:active::-webkit-slider-thumb { transform: scale(1.35); }
#volume::-webkit-slider-thumb { background: #fff; box-shadow: none; opacity: 0; transition: opacity var(--t-fast); }
#volume:hover::-webkit-slider-thumb, #volume:active::-webkit-slider-thumb { opacity: 1; }
input[type=range]::-moz-range-track { height: 1px; background: var(--line-2); }
input[type=range]::-moz-range-progress { height: 1px; background: rgba(255, 255, 255, 0.85); }
input[type=range]::-moz-range-thumb { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--accent); }
#volume::-moz-range-thumb { background: #fff; }

/* ------------------------------------------------------------------ queue */
.queue {
  position: fixed; top: calc(var(--gap) + var(--top-h) + 16px); right: var(--gap);
  bottom: calc(var(--gap) + var(--bar-h) + 16px); width: var(--queue-w); z-index: 20;
  border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 0;
  transform: translateX(calc(100% + 32px)); opacity: 0; visibility: hidden;
  transition: transform var(--t-med) var(--ease), opacity var(--t-med) var(--ease), visibility 0s linear var(--t-med);
}
.queue.open { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
.queue-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 12px 12px 22px; border-bottom: 1px solid var(--line); }
.queue-tools { display: flex; align-items: center; gap: 6px; }
.queue-list { overflow-y: auto; padding: 8px 12px 16px; }
.q-row {
  position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) 28px; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer;
}
.q-row + .q-row::before { content: ""; position: absolute; left: 44px; right: 10px; top: 0; height: 1px; background: var(--line); }
.q-row:hover { background: var(--hover); }
.q-row:hover::before, .q-row:hover + .q-row::before { opacity: 0; }
.q-num { color: var(--fg-3); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.q-row.active .q-num { color: var(--accent); }
.q-row .t { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-row .s { color: var(--fg-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-row .icon-btn { width: 26px; height: 26px; opacity: 0; }
.q-row:hover .icon-btn, .q-row:focus-within .icon-btn { opacity: 1; }
.queue .q-label { padding: 16px 10px 6px; }
.queue .empty { padding: 40px 16px; }

/* ------------------------------------------------------------------ visualizer view */
.now { position: fixed; inset: 0; z-index: 2; background: #000; overflow: hidden; }
.now canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.now-info { position: absolute; left: 32px; bottom: calc(var(--gap) + var(--bar-h) + 24px); display: flex; align-items: center; gap: 16px; pointer-events: none; }
.now-info img { width: 56px; height: 56px; border-radius: var(--r-xs); object-fit: cover; background: #111; }
.now-info img:not([src]), .now-info img[src=""] { visibility: hidden; }
.now-title { font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: 0.02em; }
.now-artist { font-family: var(--mono); font-size: 12px; color: var(--fg-2); margin-top: 2px; }
.now-actions { position: absolute; left: 32px; top: calc(var(--gap) + var(--top-h) + 16px); display: flex; gap: 4px; }
.now-actions .icon-btn { background: rgba(255, 255, 255, 0.06); }
.now-transport {
  position: absolute; right: max(24px, 6vw); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 20px; z-index: 2;
}
.now-transport .icon-btn { width: 56px; height: 56px; color: var(--fg); }
.now-transport .icon-btn svg { width: 24px; height: 24px; }
.now-transport .play-btn { width: 84px; height: 84px; }
.now-transport .play-btn svg { width: 36px; height: 36px; }
@media (max-aspect-ratio: 1/1) {
  .now-transport { right: auto; left: 50%; top: auto; bottom: calc(var(--gap) + var(--bar-h) + 110px); transform: translateX(-50%); flex-direction: row; gap: 28px; }
}
.now:fullscreen .now-info { left: 40px; bottom: 36px; }
.now:fullscreen .now-actions { top: 16px; left: 16px; }

/* ------------------------------------------------------------------ search top hit */
.top-hit { display: flex; gap: 22px; align-items: center; max-width: 520px; cursor: pointer; }
.top-hit:hover .t { color: var(--fg); }
.top-hit img { width: 104px; height: 104px; border-radius: var(--r-sm); object-fit: cover; background: rgba(255, 255, 255, 0.04); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); }
.top-hit.round img { border-radius: 50%; }
.top-hit .kicker { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); font-weight: 500; margin-bottom: 4px; }
.top-hit .t { font-size: 22px; font-weight: 300; letter-spacing: -0.015em; line-height: 1.2; }
.top-hit .muted { font-size: 13px; margin-top: 4px; }

/* ------------------------------------------------------------------ login overlay */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; align-items: safe center; justify-content: center; padding: 20px;
  overflow-y: auto; background: rgba(6, 6, 9, 0.6);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.overlay[hidden] { display: none; }
.login-card {
  width: min(540px, 100%); background: var(--glass-menu);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border); border-radius: 20px; padding: 36px 40px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 300; letter-spacing: -0.02em; }
.brand.big { font-size: 22px; padding: 0 0 12px; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  background: #000 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M4 20c4 0 5-2 7-2s3 2 5 2 3-10 5-10 3 10 7 10' fill='none' stroke='%23fff' stroke-width='1.8'/%3E%3Cpath d='M4 25c4 0 5-1 7-1s3 1 5 1 3-4 5-4 3 4 7 4' fill='none' stroke='%23fff' stroke-width='1.8'/%3E%3C/svg%3E") center / cover;
  border: 1px solid var(--line-2);
}
.login-card p { font-weight: 300; line-height: 1.55; }
.login-tabs { display: flex; gap: 16px; margin: 16px 0 22px; border-bottom: 1px solid var(--line); }
.login-tabs button { padding: 8px 0; color: var(--fg-3); font-size: 13px; font-weight: 500; border-bottom: 1px solid transparent; margin-bottom: -1px; }
.login-tabs button.active { color: var(--fg); border-bottom-color: var(--fg); }
.login-pane[hidden] { display: none; }
.steps { margin: 0 0 16px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--fg-2); font-weight: 300; }
.steps li::marker { color: var(--fg-3); }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; min-width: 0; height: 34px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: var(--inset); color: var(--fg); outline: none; }
.inline-form input:focus { background: rgba(255, 255, 255, 0.12); }
.device-info { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.btn-link { text-decoration: none; }
.error { margin-top: 16px; color: var(--danger); font-size: 13px; }

/* ------------------------------------------------------------------ context menu / toasts */
.ctx {
  position: fixed; z-index: 60; min-width: 224px; background: var(--glass-menu);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border); border-radius: var(--r-md); padding: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); animation: pop var(--t-fast) var(--ease);
}
.ctx[hidden] { display: none; }
.ctx button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border-radius: var(--r-sm); text-align: left; font-size: 13px; color: var(--fg); }
.ctx button:hover { background: var(--hover-2); }
.ctx button svg { width: 15px; height: 15px; color: var(--fg-2); }
.ctx .sep { height: 1px; background: var(--line); margin: 4px 6px; }
.ctx .ctx-title { padding: 6px 12px 8px; font-size: 12px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }

.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--bar-h) + 2 * var(--gap) + 8px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 70; pointer-events: none;
}
.toast {
  background: var(--glass-menu);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border); border-radius: var(--r-pill); padding: 9px 16px; font-size: 13px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); max-width: min(440px, calc(100vw - 32px)); text-align: center;
  animation: toast-in 0.2s var(--ease); pointer-events: auto;
}
.toast.error { border-color: rgba(255, 69, 58, 0.45); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .detail { gap: 32px; grid-template-columns: minmax(220px, 38%) minmax(0, 1fr); }
  .search { flex-basis: 180px; }
  .volume input { width: 72px; }
}
@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; }
  .detail-side { position: static; max-width: 280px; margin: 0 auto 24px; }
  .nav a { font-size: 12px; padding: 6px 8px; }
  .volume input, .vol-hi, .badge { display: none; }
}
@media (max-width: 720px) {
  #nav { display: none; }
  .menu-nav { display: block; }
  .queue { left: var(--gap); width: auto; }
  .player { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; padding: 0 12px; }
  .np-cover-btn { display: none; }
  .extras .icon-btn.toggle:not(#btnQueue) { display: none; }
  .seek .time { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bg-layer, .queue, .card-img, .menu, .ctx, .toast { transition: none; animation: none; }
}

/* ------------------------------------------------------------------ no backdrop-filter: solid surfaces */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .menu, .ctx, .toast, .login-card { background: rgba(20, 20, 24, 0.96); }
  .detail-panel { background: rgba(16, 16, 20, 0.92); }
  .overlay { background: rgba(6, 6, 9, 0.9); }
}
