:root {
  --bg: #050505;
  --panel: rgba(18,18,20,.92);
  --panel-2: rgba(28,28,31,.94);
  --line: rgba(255,255,255,.10);
  --text: #f8f8f6;
  --muted: rgba(248,248,246,.62);
  --accent: #ffb000;
  --accent-2: #ff8a00;
  --danger: #f51414;
  --shadow: 0 24px 70px rgba(0,0,0,.55);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at 70% 0%, rgba(255,176,0,.10), transparent 34%), var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { overflow-x: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; color: inherit; }
.app-shell { width: min(100%, 1180px); min-height: 100vh; margin: 0 auto; }
.page { display: none; padding: 14px 14px 110px; }
.page.is-active { display: block; }

.library-topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 2px 14px; position: sticky; top: 0; z-index: 20; background: linear-gradient(180deg, rgba(5,5,5,.98), rgba(5,5,5,.72)); backdrop-filter: blur(14px); }
.brand-logo { display: block; width: auto; height: auto; max-width: min(260px, 48vw); max-height: 54px; object-fit: contain; }
.top-icons { display: flex; align-items: center; gap: 8px; }
.round-icon, .nav-icon { min-width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.06); display: grid; place-items: center; font-weight: 900; font-size: 1.05rem; box-shadow: inset 0 1px 0 rgba(255,255,255,.07); }
.round-icon.active, .round-icon[aria-pressed="true"] { background: var(--accent); color: #111; border-color: var(--accent); }

.genre-chips { display: flex; gap: 12px; overflow-x: auto; padding: 8px 2px 16px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.genre-chips::-webkit-scrollbar, .folder-cards::-webkit-scrollbar, .playlist::-webkit-scrollbar { height: 8px; width: 8px; }
.genre-chips::-webkit-scrollbar-thumb, .folder-cards::-webkit-scrollbar-thumb, .playlist::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 999px; }
.genre-chip { flex: 0 0 auto; min-width: 96px; height: 54px; padding: 0 20px; border-radius: 999px; border: 2px solid rgba(255,255,255,.16); background: rgba(255,255,255,.035); color: #fff; font-weight: 900; font-size: 1rem; scroll-snap-align: start; }
.genre-chip:hover { border-color: rgba(255,176,0,.6); background: rgba(255,176,0,.10); }
.genre-chip.active { background: var(--accent); color: #111; border-color: var(--accent); box-shadow: 0 10px 30px rgba(255,176,0,.18); }

.search-section, .compact-card { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 22px; padding: 10px; display: grid; gap: 8px; box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.search-section { grid-template-columns: 1fr minmax(170px, 260px); align-items: center; }
input, select { width: 100%; min-height: 46px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); background: #18181b; color: var(--text); padding: 0 16px; outline: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
input::placeholder { color: rgba(255,255,255,.42); }
input:focus, select:focus { border-color: rgba(255,176,0,.7); box-shadow: 0 0 0 3px rgba(255,176,0,.16), inset 0 1px 0 rgba(255,255,255,.06); }
select { color: #fff; background: #18181b; accent-color: var(--accent); }
select option { background: #101012; color: #fff; }
select option:checked, select option:hover { background: var(--accent); color: #111; }

.playlist-manager { margin-top: 12px; }
.manager-left { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; }
.manager-left label { color: var(--accent); font-weight: 950; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.manager-actions { display: grid; grid-template-columns: 1fr 46px 46px 46px; gap: 8px; }
.small-button { width: 46px; height: 46px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.07); font-weight: 950; }
.small-button:hover { background: rgba(255,176,0,.18); border-color: rgba(255,176,0,.55); }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 26px 0 14px; }
.section-heading h2 { margin: 0; font-size: clamp(1.35rem, 5vw, 2rem); line-height: 1; text-transform: uppercase; letter-spacing: -.04em; }
.section-heading p { margin: 6px 0 0; color: var(--muted); }
.section-heading button { border: 0; background: transparent; color: var(--muted); font-size: 3rem; line-height: .7; }
#songCount { color: var(--accent); font-weight: 950; white-space: nowrap; }
.folder-cards { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 270px); gap: 14px; overflow-x: auto; padding: 2px 2px 8px; }
.folder-card { height: 172px; padding: 18px; border-radius: 18px; border: 1px solid rgba(255,255,255,.12); background: linear-gradient(145deg, rgba(255,176,0,.12), rgba(255,255,255,.04) 50%, rgba(0,0,0,.18)); color: #fff; text-align: left; display: flex; flex-direction: column; justify-content: end; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.folder-card:before { content: ""; position: absolute; inset: 16px 18px auto auto; width: 76px; height: 32px; background: url('assets/logo-web.png') center/contain no-repeat; opacity: .9; filter: drop-shadow(0 10px 20px rgba(0,0,0,.4)); }
.folder-card strong { font-size: 1.2rem; }
.folder-card span { color: var(--muted); margin-top: 8px; }
.folder-card.active { outline: 2px solid var(--accent); background: linear-gradient(145deg, rgba(255,176,0,.28), rgba(255,255,255,.05)); }

.playlist-panel { margin-top: 10px; }
.playlist { background: rgba(0,0,0,.30); border: 1px solid var(--line); border-radius: 20px; overflow: auto; max-height: calc(100vh - 430px); min-height: 220px; }
.song-row { display: grid; grid-template-columns: 56px 1fr 38px 38px auto; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.08); background: transparent; }
.song-row:last-child { border-bottom: 0; }
.song-row:hover { background: rgba(255,255,255,.05); }
.song-row.active { background: linear-gradient(90deg, rgba(255,176,0,.18), rgba(255,176,0,.04)); }
.thumb, .mini-thumb { display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, #2a2a30, #111); color: var(--accent); border: 1px solid rgba(255,255,255,.12); }
.thumb { width: 56px; height: 56px; border-radius: 12px; }
.thumb img, .mini-thumb img { width: 100%; height: 100%; object-fit: cover; display: none; }
.thumb span, .mini-thumb span { display: grid; place-items: center; font-weight: 950; }
.song-main { min-width: 0; }
.song-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
.song-meta { display: block; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.row-star, .add-to-playlist { width: 36px; height: 36px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); display: grid; place-items: center; font-weight: 950; }
.row-star { color: #fff; }
.row-star.is-favorite, .star-btn.is-favorite { color: var(--accent); }
.add-to-playlist:hover, .row-star:hover { border-color: rgba(255,176,0,.65); background: rgba(255,176,0,.12); }
.song-duration { color: var(--muted); font-size: .78rem; min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.empty-state { padding: 24px; text-align: center; color: var(--muted); }

.mini-player { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; height: 86px; background: rgba(10,10,11,.96); backdrop-filter: blur(18px); border-top: 1px solid rgba(255,255,255,.10); display: grid; grid-template-columns: minmax(0, 1fr) 46px 46px; align-items: center; gap: 10px; padding: 10px 14px 12px; box-shadow: 0 -18px 50px rgba(0,0,0,.48); --mini-progress: 0%; }
.mini-progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: rgba(255,255,255,.12); }
.mini-progress span { display: block; width: var(--mini-progress); height: 100%; background: var(--accent); }
.mini-track { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: center; border: 0; background: transparent; text-align: left; min-width: 0; }
.mini-thumb { width: 54px; height: 54px; border-radius: 10px; }
.mini-text { min-width: 0; }
.mini-text strong, .mini-text span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-text span { color: var(--muted); margin-top: 3px; }
.mini-play, .mini-more { border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(255,255,255,.07); height: 42px; display: inline-flex; align-items: center; justify-content: center; font-weight: 950; color: #fff; }
.mini-control { width: 38px; height: 38px; }
.mini-control svg, .mini-play svg, .control-button svg, .round-icon svg, .nav-icon svg, .action-row svg, .star-btn svg, .row-star svg, .mini-more svg { width: 24px; height: 24px; display: block; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.mini-control svg .fill, .mini-play svg .fill, .control-button svg .fill, .round-icon svg .fill, .nav-icon svg .fill, .action-row svg .fill, .star-btn svg .fill, .row-star svg .fill, .mini-more svg .fill { fill: currentColor; stroke: none; }
.mini-play { width: 42px; height: 42px; background: var(--accent); color: #111; border-color: var(--accent); }
.mini-more { width: 46px; font-size: 1.6rem; }

.player-page { min-height: 100vh; padding-bottom: 28px; background: radial-gradient(circle at 50% 30%, rgba(255,176,0,.15), transparent 35%), radial-gradient(circle at 15% 5%, rgba(255,255,255,.10), transparent 28%), #050505; }
.player-topbar { display: grid; grid-template-columns: 52px 1fr 64px; align-items: center; gap: 10px; padding: 14px 2px 20px; }
.nav-icon { border: 0; background: transparent; box-shadow: none; font-size: 2.2rem; color: #fff; }
#queueBtn { font-size: 1.4rem; }
.playing-from { text-align: center; text-transform: none; }
.playing-from span { display: block; color: rgba(255,255,255,.72); font-weight: 850; text-transform: uppercase; letter-spacing: .05em; font-size: .86rem; }
.playing-from strong { display: block; font-size: clamp(1.35rem, 6vw, 2rem); line-height: 1.05; }
.cover-stage { display: grid; place-items: center; }
.cover-wrap { width: min(82vw, 620px); aspect-ratio: 1 / 1; border-radius: 18px; overflow: hidden; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); box-shadow: var(--shadow); display: grid; place-items: center; }
.cover-wrap > img { width: 100%; height: 100%; object-fit: cover; display: none; }
.cover-fallback { width: 100%; height: 100%; display: grid; place-items: center; background: radial-gradient(circle, rgba(255,176,0,.18), transparent 36%), linear-gradient(145deg, #1c1c21, #080809); }
.cover-fallback img { width: min(58%, 280px); height: auto; object-fit: contain; filter: drop-shadow(0 18px 30px rgba(0,0,0,.48)); }
.now-info { text-align: center; margin: 28px auto 0; width: min(92vw, 680px); }
.now-info p { margin: 0; color: rgba(255,255,255,.82); font-size: clamp(1.1rem, 5vw, 2rem); }
.now-info h1 { margin: 8px 0 0; font-size: clamp(1.55rem, 6.5vw, 3rem); line-height: 1.05; letter-spacing: -.05em; }
.now-title-line { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.now-title-line h1 { justify-self: center; padding-left: 44px; }
.star-btn.large { width: 44px; height: 44px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); font-size: 1.5rem; }
.muted { color: var(--muted)!important; font-size: 1rem!important; margin-top: 8px!important; }
.action-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: min(92vw, 720px); margin: 34px auto 20px; }
.action-row button { border: 0; background: transparent; color: #fff; display: grid; place-items: center; gap: 4px; }
.action-row span { font-size: clamp(1.55rem, 7vw, 2.4rem); line-height: 1; }
.action-row small { color: var(--muted); font-size: .82rem; font-weight: 800; }
.controls-card { width: min(94vw, 760px); margin: 0 auto; }
.wave-seeker { width: 100%; height: 86px; padding: 2px 0; touch-action: manipulation; cursor: pointer; }
.wave-seeker canvas { width: 100%; height: 86px; display: block; }
.time-row { display: flex; justify-content: space-between; font-weight: 950; font-size: 1rem; margin-top: -6px; font-variant-numeric: tabular-nums; }
.main-controls { margin-top: 28px; display: grid; grid-template-columns: 54px 70px 112px 70px 54px; align-items: center; justify-content: center; gap: clamp(10px, 4vw, 26px); }
.control-button { height: 62px; min-width: 54px; border: 0; background: transparent; color: #fff; font-size: 2.1rem; font-weight: 950; display: grid; place-items: center; }
.control-button.primary { width: 112px; height: 112px; border: 5px solid #fff; border-radius: 999px; font-size: 3.2rem; padding-left: 0; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.control-button.mode-button { width: 54px; min-width: 54px; padding: 0; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); color: rgba(255,255,255,.78); }
.control-button.mode-button svg, .mini-control.mode-button svg { width: 28px; height: 28px; display: block; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.control-button.mode-button text, .mini-control.mode-button text { fill: currentColor; stroke: none; font-size: 9px; font-weight: 950; font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.control-button[aria-pressed="true"] { color: var(--accent); }
.control-button.mode-button[aria-pressed="true"], .mini-control.mode-button[aria-pressed="true"] { color: var(--accent); background: rgba(255,176,0,.12); border-color: rgba(255,176,0,.48); }
.control-button.ghost { color: rgba(255,255,255,.75); }

@media (min-width: 900px) {
  .page { padding-left: 24px; padding-right: 24px; }
  .library-page { max-width: 1180px; margin: 0 auto; }
  .search-section { max-width: 760px; }
  .playlist { max-height: 56vh; }
  .song-row { grid-template-columns: 56px 1fr 38px 38px 52px; }
  .mini-player { left: 50%; transform: translateX(-50%); width: min(100%, 1180px); border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 18px 18px 0 0; }
}
@media (max-width: 720px) {
  .search-section { grid-template-columns: 1fr; }
  #genreSelect { display: none; }
  .manager-left { grid-template-columns: 1fr; }
  .manager-actions { grid-template-columns: 1fr 44px 44px 44px; }
  .song-row { grid-template-columns: 52px 1fr 36px 36px; }
  .song-duration { display: none; }
  .brand-logo { max-width: min(190px, 44vw); max-height: 42px; }
  .round-icon { min-width: 38px; height: 38px; }
  .genre-chip { min-width: 88px; height: 48px; padding: 0 16px; font-size: .94rem; }
  .folder-cards { grid-auto-columns: minmax(190px, 75vw); }
  .player-topbar { grid-template-columns: 48px 1fr 56px; }
  .cover-wrap { width: min(82vw, 560px); }
  .main-controls { grid-template-columns: 38px 56px 92px 56px 38px; gap: 8px; }
  .control-button { min-width: 38px; height: 54px; font-size: 1.75rem; }
  .control-button.primary { width: 92px; height: 92px; font-size: 2.7rem; border-width: 4px; }
}
@media (max-width: 420px) {
  .page { padding-left: 10px; padding-right: 10px; }
  .section-heading h2 { font-size: 1.25rem; }
  .song-row { grid-template-columns: 48px 1fr 34px 34px; gap: 9px; padding: 10px; }
  .thumb { width: 48px; height: 48px; }
  .song-title { font-size: .92rem; }
  .song-meta { font-size: .76rem; }
  .row-star, .add-to-playlist { width: 34px; height: 34px; }
  .mini-player { grid-template-columns: minmax(0, 1fr) 38px 38px; height: 80px; padding: 9px 10px 10px; gap: 6px; }
  .mini-track { grid-template-columns: 48px 1fr; gap: 10px; }
  .mini-thumb { width: 48px; height: 48px; }
  .mini-text span { display: none; }
  .mini-control { width: 32px; height: 32px; }
  .mini-control svg, .mini-play svg { width: 22px; height: 22px; }
  .mini-play { width: 34px; height: 34px; }
  .mini-more { width: 38px; height: 38px; }
  .action-row small { font-size: .72rem; }
  .wave-seeker, .wave-seeker canvas { height: 74px; }
}


/* v10: genre chips only, fixed seek layer, smaller cover art */
.search-section { grid-template-columns: 1fr !important; }
#genreSelect { display: none !important; }
.category-showcase { display: none !important; }
.playlist { max-height: calc(100vh - 285px); }
.genre-chips { padding-top: 10px; padding-bottom: 12px; }
.genre-chip { color: #fff; }
.genre-chip:hover, .genre-chip:focus-visible { color: #111; background: var(--accent); border-color: var(--accent); outline: none; }
.cover-wrap { width: min(41vw, 310px) !important; max-width: 310px; }
.cover-fallback img { width: min(58%, 160px); }
.wave-seeker { position: relative; touch-action: none; user-select: none; }
.seek-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.001; cursor: pointer; margin: 0; padding: 0; border: 0; background: transparent; appearance: none; -webkit-appearance: none; }
.seek-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 34px; height: 86px; border: 0; background: transparent; }
.seek-range::-moz-range-thumb { width: 34px; height: 86px; border: 0; background: transparent; }
.seek-range::-webkit-slider-runnable-track { background: transparent; border: 0; }
.seek-range::-moz-range-track { background: transparent; border: 0; }
@media (max-width: 720px) {
  .cover-wrap { width: min(46vw, 280px) !important; max-width: 280px; }
  .cover-stage { margin-top: 10px; }
  .now-info { margin-top: 18px; }
  .playlist { max-height: calc(100vh - 255px); }
}
@media (max-width: 420px) {
  .cover-wrap { width: min(48vw, 220px) !important; max-width: 220px; }
}


/* v11: light gray theme option + safe custom seek (no native range seeking) */
.theme-toggle-note { display:none; }
.seek-range {
  pointer-events: none !important;
  opacity: 0 !important;
}
.wave-seeker {
  position: relative;
  touch-action: none !important;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}
.wave-seeker:active canvas { filter: brightness(1.15); }

html[data-theme="light"] {
  --bg: #f3f4f6;
  --panel: rgba(255,255,255,.92);
  --panel-2: rgba(249,250,251,.96);
  --line: rgba(17,24,39,.12);
  --text: #111827;
  --muted: rgba(17,24,39,.58);
  --accent: #ffb000;
  --accent-2: #f59e0b;
  --shadow: 0 22px 60px rgba(15,23,42,.14);
  color-scheme: light;
}
html[data-theme="light"] body {
  background: radial-gradient(circle at 70% 0%, rgba(255,176,0,.18), transparent 35%), #f3f4f6;
  color: var(--text);
}
html[data-theme="light"] .library-topbar {
  background: linear-gradient(180deg, rgba(243,244,246,.98), rgba(243,244,246,.72));
}
html[data-theme="light"] .round-icon,
html[data-theme="light"] .small-button,
html[data-theme="light"] .mini-play,
html[data-theme="light"] .mini-more,
html[data-theme="light"] .row-star,
html[data-theme="light"] .add-to-playlist,
html[data-theme="light"] .star-btn.large {
  background: rgba(255,255,255,.82);
  color: #111827;
  border-color: rgba(17,24,39,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 8px 18px rgba(15,23,42,.08);
}
html[data-theme="light"] .round-icon.active,
html[data-theme="light"] .round-icon[aria-pressed="true"] {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
}
html[data-theme="light"] input,
html[data-theme="light"] select {
  background: rgba(255,255,255,.92);
  color: #111827;
  border-color: rgba(17,24,39,.14);
}
html[data-theme="light"] input::placeholder { color: rgba(17,24,39,.42); }
html[data-theme="light"] .genre-chip {
  background: rgba(255,255,255,.74);
  color: #111827;
  border-color: rgba(17,24,39,.16);
}
html[data-theme="light"] .genre-chip.active,
html[data-theme="light"] .genre-chip:hover,
html[data-theme="light"] .genre-chip:focus-visible {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
}
html[data-theme="light"] .search-section,
html[data-theme="light"] .compact-card,
html[data-theme="light"] .playlist {
  background: rgba(255,255,255,.74);
  border-color: rgba(17,24,39,.12);
}
html[data-theme="light"] .song-row { border-bottom-color: rgba(17,24,39,.08); }
html[data-theme="light"] .song-row:hover { background: rgba(17,24,39,.035); }
html[data-theme="light"] .song-row.active { background: linear-gradient(90deg, rgba(255,176,0,.24), rgba(255,176,0,.08)); }
html[data-theme="light"] .thumb,
html[data-theme="light"] .mini-thumb {
  background: linear-gradient(145deg, #ffffff, #e5e7eb);
  color: var(--accent);
  border-color: rgba(17,24,39,.12);
}
html[data-theme="light"] .mini-player {
  background: rgba(255,255,255,.94);
  border-top-color: rgba(17,24,39,.12);
  box-shadow: 0 -16px 44px rgba(15,23,42,.14);
}
html[data-theme="light"] .player-page {
  background: radial-gradient(circle at 50% 30%, rgba(255,176,0,.20), transparent 35%), radial-gradient(circle at 15% 5%, rgba(0,0,0,.04), transparent 28%), #f3f4f6;
}
html[data-theme="light"] .nav-icon,
html[data-theme="light"] .action-row button,
html[data-theme="light"] .control-button,
html[data-theme="light"] .mini-control,
html[data-theme="light"] .mini-more { color: #111827; }
html[data-theme="light"] .mini-play { color: #111; }
html[data-theme="light"] .control-button.primary { border-color: #111827; }
html[data-theme="light"] .playing-from span,
html[data-theme="light"] .now-info p { color: rgba(17,24,39,.70); }
html[data-theme="light"] .cover-wrap {
  background: rgba(255,255,255,.70);
  border-color: rgba(17,24,39,.12);
}
html[data-theme="light"] .cover-fallback {
  background: radial-gradient(circle, rgba(255,176,0,.22), transparent 36%), linear-gradient(145deg, #ffffff, #e5e7eb);
}
html[data-theme="light"] .mini-progress { background: rgba(17,24,39,.12); }

/* v12: same-tab return link to main TBC website */
.site-return-bar {
  width: min(1180px, calc(100vw - 28px));
  margin: 10px auto 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  z-index: 20;
}
.site-return-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #fff);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
}
.site-return-link:hover,
.site-return-link:focus-visible {
  color: #111;
  background: var(--accent, #ffb000);
  border-color: var(--accent, #ffb000);
  outline: none;
}
body.light-theme .site-return-link,
body.theme-light .site-return-link,
:root.light-theme .site-return-link {
  background: rgba(255, 255, 255, 0.84);
  color: #171717;
  border-color: rgba(0, 0, 0, 0.10);
}
body.light-theme .site-return-link:hover,
body.light-theme .site-return-link:focus-visible,
body.theme-light .site-return-link:hover,
body.theme-light .site-return-link:focus-visible,
:root.light-theme .site-return-link:hover,
:root.light-theme .site-return-link:focus-visible {
  background: var(--accent, #ffb000);
  border-color: var(--accent, #ffb000);
}
@media (max-width: 720px) {
  .site-return-bar {
    width: calc(100vw - 20px);
    margin-top: 8px;
  }
  .site-return-link {
    min-height: 30px;
    padding: 7px 11px;
    font-size: 0.68rem;
  }
}

/* v13: generic seek slider, visual waveform only, opener-window switch button */
.wave-seeker.visual-only,
.wave-seeker.visual-only canvas {
  height: 58px !important;
  cursor: default !important;
  touch-action: auto !important;
}
.wave-seeker.visual-only { pointer-events: none; margin-bottom: 4px; }
.generic-seek {
  display: block;
  width: 100%;
  min-height: 34px;
  height: 34px;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
  pointer-events: auto !important;
  opacity: 1 !important;
  box-shadow: none;
}
.generic-seek::-webkit-slider-runnable-track {
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--progress, 0%), rgba(255,255,255,.22) var(--progress, 0%));
}
.generic-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -7.5px;
  border-radius: 999px;
  border: 3px solid #111;
  background: var(--accent);
  box-shadow: 0 6px 18px rgba(0,0,0,.32);
}
.generic-seek::-moz-range-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
}
.generic-seek::-moz-range-progress {
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}
.generic-seek::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 3px solid #111;
  background: var(--accent);
  box-shadow: 0 6px 18px rgba(0,0,0,.32);
}
.site-return-link {
  border: 1px solid rgba(255, 255, 255, 0.14);
}
button.site-return-link { appearance: none; -webkit-appearance: none; }
.site-return-link.unavailable {
  color: rgba(255,255,255,.72) !important;
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.16) !important;
}
html[data-theme="light"] .generic-seek::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, var(--accent) var(--progress, 0%), rgba(17,24,39,.18) var(--progress, 0%));
}
html[data-theme="light"] .generic-seek::-moz-range-track { background: rgba(17,24,39,.18); }
html[data-theme="light"] .generic-seek::-webkit-slider-thumb,
html[data-theme="light"] .generic-seek::-moz-range-thumb { border-color: #fff; }
html[data-theme="light"] .site-return-link.unavailable {
  color: rgba(17,24,39,.64) !important;
  background: rgba(255,255,255,.80) !important;
  border-color: rgba(17,24,39,.10) !important;
}

/* v14 simplification: no return bar, no visible playlist manager, no waveform */
.site-return-bar,
.playlist-manager,
.wave-seeker,
#playlistActionBtn,
.add-to-playlist {
  display: none !important;
}
.controls-card {
  gap: 8px;
}
.generic-seek {
  margin-top: 8px !important;
  touch-action: pan-x !important;
}


/* v15 reliable custom slider: no waveform and no native range interaction */
.generic-seek { display: none !important; }
.generic-seek-slider {
  position: relative;
  width: 100%;
  height: 34px;
  margin: 8px 0 2px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}
.generic-seek-slider:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 999px; }
.seek-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 7px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  overflow: hidden;
}
.seek-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}
.seek-thumb {
  position: absolute;
  left: 0%;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 3px solid #111;
  background: var(--accent);
  box-shadow: 0 6px 18px rgba(0,0,0,.32);
  pointer-events: none;
}
html[data-theme="light"] .seek-track { background: rgba(17,24,39,.18); }
html[data-theme="light"] .seek-thumb { border-color: #fff; }

/* v20 compact full-player refinements */
.player-topbar { padding: 10px 2px 12px; }
.playing-from span { font-size: .72rem; letter-spacing: .045em; }
.playing-from strong { font-size: clamp(1.0rem, 4.2vw, 1.35rem); }
.cover-wrap { width: min(50vw, 310px); border-radius: 16px; }
.now-info { margin: 12px auto 0; width: min(92vw, 620px); }
.now-info p { font-size: clamp(.92rem, 3.8vw, 1.18rem); }
.now-info h1 { margin: 4px 0 0; font-size: clamp(1.0rem, 4.2vw, 1.35rem); line-height: 1.12; letter-spacing: -.025em; }
.now-title-line { grid-template-columns: 40px 1fr 40px; gap: 6px; }
.now-title-line h1 { grid-column: 2; justify-self: center; padding-left: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.star-btn.large { grid-column: 3; width: 38px; height: 38px; font-size: 1.22rem; }
#nowAlbum { display: none !important; }
.action-row { margin: 14px auto 12px; gap: 4px; width: min(88vw, 560px); }
.action-row span { font-size: clamp(1.25rem, 5.2vw, 1.72rem); }
.action-row small { font-size: .74rem; }
.controls-card { width: min(90vw, 560px); }
.time-row { font-size: .88rem; margin-top: 0; }
.main-controls { margin-top: 16px; grid-template-columns: 54px 54px 86px 54px 54px; gap: clamp(6px, 2.6vw, 14px); }
.control-button { height: 48px; min-width: 42px; font-size: 1.55rem; }
.control-button.primary { width: 86px; height: 86px; border-width: 4px; font-size: 2.25rem; padding-left: 0; display: inline-flex; align-items: center; justify-content: center; }

@media (max-width: 560px) {
  .player-page { padding-bottom: 12px; }
  .player-topbar { grid-template-columns: 42px 1fr 48px; padding: 8px 0 10px; }
  .nav-icon { font-size: 1.8rem; min-width: 38px; height: 38px; }
  #queueBtn { font-size: 1.1rem; }
  .cover-wrap { width: min(46vw, 220px); }
  .now-info { margin-top: 10px; }
  .action-row { margin-top: 12px; margin-bottom: 10px; }
  .main-controls { margin-top: 14px; grid-template-columns: 44px 48px 76px 48px 44px; }
  .control-button { height: 44px; min-width: 38px; font-size: 1.35rem; }
  .control-button.primary { width: 76px; height: 76px; font-size: 2rem; }
}

/* v21 full-height locked player layout */
html, body {
  height: 100%;
  overscroll-behavior: none;
}
.app-shell {
  min-height: 100dvh;
}
.player-page.is-active {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding: clamp(6px, 1.8dvh, 14px) clamp(10px, 3vw, 22px) clamp(8px, 1.8dvh, 16px);
}
.player-page .player-topbar {
  align-self: start;
  padding: 0 0 clamp(4px, 1.2dvh, 10px);
}
.player-page .cover-stage {
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(2px, 1dvh, 8px) 0;
}
.player-page .cover-wrap {
  width: min(90vw, 54dvh, 620px) !important;
  max-width: none;
  max-height: 100%;
  border-radius: clamp(16px, 4vw, 28px);
}
.player-page .now-info {
  margin-top: clamp(4px, 1dvh, 10px);
  flex: none;
}
.player-page .now-info p {
  font-size: clamp(.78rem, 2.5vw, 1rem);
}
.player-page .now-info h1 {
  font-size: clamp(.96rem, 3.8vw, 1.3rem);
  line-height: 1.1;
}
.player-page .action-row {
  margin-top: clamp(6px, 1.4dvh, 12px);
  margin-bottom: clamp(6px, 1.4dvh, 12px);
  flex: none;
}
.player-page .action-row span {
  font-size: clamp(1.15rem, 4.5vw, 1.55rem);
}
.player-page .action-row small {
  font-size: clamp(.64rem, 2.2vw, .74rem);
}
.player-page .controls-card {
  align-self: end;
  width: min(94vw, 640px);
  margin: 0 auto;
  flex: none;
}
.player-page .generic-seek-slider {
  height: clamp(26px, 4.3dvh, 34px);
  margin-top: clamp(4px, 1dvh, 8px);
}
.player-page .main-controls {
  margin-top: clamp(8px, 1.8dvh, 14px);
}
.player-page .control-button.primary {
  width: clamp(64px, 11dvh, 82px);
  height: clamp(64px, 11dvh, 82px);
  font-size: clamp(1.75rem, 5.2dvh, 2.18rem);
}
.player-page .control-button {
  height: clamp(38px, 6.8dvh, 48px);
}

@media (orientation: landscape) and (max-height: 560px) {
  .player-page.is-active {
    grid-template-columns: minmax(220px, 42vw) 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    column-gap: clamp(14px, 3vw, 30px);
    padding: 8px 14px;
  }
  .player-page .player-topbar {
    grid-column: 1 / -1;
    padding-bottom: 4px;
  }
  .player-page .cover-stage {
    grid-column: 1;
    grid-row: 2 / 4;
    padding: 0;
  }
  .player-page .cover-wrap {
    width: min(40vw, 76dvh, 420px) !important;
  }
  .player-page .now-info,
  .player-page .action-row,
  .player-page .controls-card {
    grid-column: 2;
  }
  .player-page .now-info {
    align-self: end;
    margin-top: 0;
  }
  .player-page .action-row {
    align-self: center;
    margin: 8px auto;
  }
  .player-page .controls-card {
    align-self: end;
  }
}

@media (max-width: 560px) and (orientation: portrait) {
  .player-page.is-active {
    padding-left: 10px;
    padding-right: 10px;
  }
  .player-page .cover-wrap {
    width: min(92vw, 50dvh, 460px) !important;
  }
  .player-page .playing-from strong {
    font-size: clamp(.92rem, 4vw, 1.1rem);
  }
  .player-page .action-row {
    width: min(94vw, 520px);
  }
  .player-page .main-controls {
    grid-template-columns: 40px 44px minmax(62px, 74px) 44px 40px;
    gap: clamp(5px, 2.2vw, 10px);
  }
  .player-page .control-button.mode-button {
    width: 40px;
    min-width: 40px;
  }
  .player-page .control-button.mode-button svg { width: 24px; height: 24px; }
}

@media (max-height: 650px) and (orientation: portrait) {
  .player-page .cover-wrap {
    width: min(82vw, 42dvh, 360px) !important;
  }
  .player-page .action-row small {
    display: none;
  }
  .player-page .action-row {
    margin-top: 5px;
    margin-bottom: 5px;
  }
  .player-page .main-controls {
    margin-top: 6px;
  }
}
