:root {
  --bg: #0b0b0c;
  --panel: #121214;
  --surface: #1a1a1d;
  --surface-2: #232327;
  --hover: #2a2a2f;
  --line: #2c2c31;
  --text: #f3f3f4;
  --muted: #a4a4ab;
  --dim: #6f6f77;
  --accent: #ff7a1a;
  --accent-2: #ff9a4d;
  --danger: #ff5a5f;
  --ok: #3ecf8e;
  --radius: 10px;
  --player-h: 88px;
  --side-w: 260px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input { font: inherit; color: inherit; }
.hidden { display: none !important; }
svg { width: 20px; height: 20px; fill: currentColor; flex: none; display: block; }
i[data-icon] { display: inline-flex; }

/* ---------------- Login */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 20% 0%, #3a1d0a 0%, var(--bg) 60%); }
.login-card { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: grid; gap: 14px; }
.login-card label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.login-error { color: var(--danger); min-height: 1em; margin: 0; font-size: 13px; }

input.field, .login-card input, .modal input { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; outline: none; width: 100%; }
input.field:focus, .login-card input:focus, .modal input:focus { border-color: var(--accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 999px; font-weight: 600; background: var(--surface-2); transition: transform .1s, background .15s; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #1a0d03; }
.btn.primary:hover { background: var(--accent-2); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn:disabled { opacity: .5; cursor: default; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; padding: 4px 8px 18px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand.big { justify-content: center; font-size: 22px; padding-bottom: 8px; }
.brand.big img { width: 44px; height: 44px; }

/* ---------------- Layout */
.app { display: grid; height: 100%; grid-template-columns: var(--side-w) 1fr auto; grid-template-rows: 1fr var(--player-h);
  grid-template-areas: "side main queue" "player player player"; gap: 8px; padding: 8px 8px 0; }
.sidebar { grid-area: side; background: var(--panel); border-radius: var(--radius); padding: 16px 10px; display: flex; flex-direction: column; min-height: 0; }
.nav a, .side-settings { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.nav a:hover, .side-settings:hover { color: var(--text); background: var(--surface); }
.nav a.active, .side-settings.active { color: var(--text); background: var(--surface-2); }
.nav a.active svg { color: var(--accent); }
.badge { margin-left: auto; background: var(--accent); color: #1a0d03; font-size: 11px; border-radius: 999px; padding: 1px 7px; }
.side-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-weight: 700; padding: 18px 12px 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.side-playlists { overflow-y: auto; flex: 1; min-height: 0; }
.side-playlists a { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 8px; color: var(--muted); }
.side-playlists a:hover { background: var(--surface); color: var(--text); }
.side-playlists a.active { color: var(--text); background: var(--surface-2); }
.side-playlists .mini { width: 36px; height: 36px; border-radius: 4px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex: none; }
.side-playlists .mini img { width: 100%; height: 100%; object-fit: cover; }
.side-playlists .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-settings { margin-top: 8px; }

.main { grid-area: main; background: linear-gradient(180deg, var(--surface) 0, var(--panel) 320px); border-radius: var(--radius); overflow-y: auto; min-height: 0; position: relative; scroll-behavior: auto; }
.view { padding: 24px 28px 40px; max-width: 1600px; }

.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--muted); transition: color .15s, background .15s, transform .1s; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.small svg { width: 18px; height: 18px; }
.icon-btn.on { color: var(--accent); }
.icon-btn.big { width: 52px; height: 52px; }
.icon-btn.big svg { width: 30px; height: 30px; }

/* ---------------- Headers */
h1 { font-size: 30px; margin: 4px 0 18px; letter-spacing: -.02em; }
h2 { font-size: 21px; margin: 30px 0 12px; letter-spacing: -.01em; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h2 a { font-size: 13px; color: var(--muted); font-weight: 600; }
h2 a:hover { text-decoration: underline; color: var(--text); }
.muted { color: var(--muted); }
.hero { display: flex; gap: 24px; align-items: flex-end; margin: 8px 0 24px; }
.hero .art { width: 220px; height: 220px; border-radius: 8px; background: var(--surface-2); box-shadow: 0 16px 50px rgba(0,0,0,.5); overflow: hidden; flex: none; display: grid; place-items: center; }
.hero .art img { width: 100%; height: 100%; object-fit: cover; }
.hero .art.round { border-radius: 50%; }
.hero .art svg { width: 72px; height: 72px; color: var(--dim); }
.hero .kind { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hero h1 { font-size: clamp(28px, 5vw, 64px); margin: 6px 0 10px; line-height: 1.05; word-break: break-word; }
.hero .sub { color: var(--muted); }
.hero .sub a { color: var(--text); font-weight: 700; }
.hero .sub a:hover { text-decoration: underline; }
.actions { display: flex; align-items: center; gap: 14px; margin: 8px 0 18px; flex-wrap: wrap; }
.play-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--text); color: #000; display: grid; place-items: center; transition: transform .1s; flex: none; }
.play-btn:hover { transform: scale(1.06); }
.play-btn.accent { background: var(--accent); width: 56px; height: 56px; }
.play-btn.accent svg { width: 26px; height: 26px; }
.play-btn.big { width: 72px; height: 72px; }
.play-btn.big svg { width: 32px; height: 32px; }

.tabs { display: flex; gap: 8px; margin: 0 0 18px; flex-wrap: wrap; }
.tabs button, .tabs a { padding: 7px 14px; border-radius: 999px; background: var(--surface-2); font-weight: 600; font-size: 13px; }
.tabs .on { background: var(--text); color: #000; }

/* ---------------- Cards grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.grid.row { grid-auto-flow: column; grid-auto-columns: 180px; grid-template-columns: none; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.card { background: transparent; padding: 10px; border-radius: 10px; transition: background .2s; cursor: pointer; position: relative; min-width: 0; }
.card:hover { background: var(--surface-2); }
.card .art { aspect-ratio: 1; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-bottom: 10px; position: relative; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.card .art img { width: 100%; height: 100%; object-fit: cover; }
.card .art svg { width: 42px; height: 42px; color: var(--dim); }
.card.round .art { border-radius: 50%; }
.card .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .s { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .hover-play { position: absolute; right: 18px; top: calc(100% - 110px); opacity: 0; transform: translateY(8px); transition: all .2s; background: var(--accent); color: #1a0d03; width: 46px; height: 46px; box-shadow: 0 8px 18px rgba(0,0,0,.4); }
.card:hover .hover-play { opacity: 1; transform: none; }

/* ---------------- Styles */
.genre-art { position: relative; place-items: stretch !important; }
.genre-art .collage { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; opacity: .55; }
.genre-art .collage img, .genre-art img.solo { width: 100%; height: 100%; object-fit: cover; }
.genre-art img.solo { position: absolute; inset: 0; opacity: .5; }
.genre-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.55)); }
.genre-art .gname { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 1; font-weight: 800; font-size: 18px; line-height: 1.15; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.genre-card .s { margin-top: 2px; }
.hero .genre-art.big { width: 220px; height: 220px; border-radius: 8px; overflow: hidden; flex: none; display: block; }
.hero .genre-art.big .gname { font-size: 26px; }

/* ---------------- Track list */
.tracks { width: 100%; }
.trow { display: grid; grid-template-columns: 36px minmax(0, 5fr) minmax(0, 3fr) 40px 56px 36px; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 6px; cursor: default; user-select: none; }
.trow.head { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: 8px; padding-bottom: 8px; }
.trow:not(.head):hover { background: var(--hover); }
.trow.playing .tt { color: var(--accent); }
.trow .num { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; position: relative; }
.trow .num .pi { display: none; }
.trow:not(.head):hover .num .n { display: none; }
.trow:not(.head):hover .num .pi { display: inline-grid; }
.trow .main-col { display: flex; align-items: center; gap: 12px; min-width: 0; }
.trow .thumb { width: 40px; height: 40px; border-radius: 4px; background: var(--surface-2); flex: none; overflow: hidden; }
.trow .thumb img { width: 100%; height: 100%; object-fit: cover; }
.trow .tt { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .ta { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .ta a:hover, .trow .al a:hover { text-decoration: underline; color: var(--text); }
.trow .al { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.trow .dur { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.trow .fav { opacity: 0; }
.trow:hover .fav, .trow .fav.on { opacity: 1; }
.trow .more { opacity: 0; }
.trow:hover .more { opacity: 1; }
.yt-tag { font-size: 10px; font-weight: 800; color: #1a0d03; background: var(--accent); border-radius: 3px; padding: 0 4px; margin-right: 6px; vertical-align: 1px; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq span { width: 3px; background: var(--accent); animation: eq 1s infinite ease-in-out; }
.eq span:nth-child(2) { animation-delay: .2s; } .eq span:nth-child(3) { animation-delay: .4s; }
.eq.paused span { animation: none; height: 4px; }
@keyframes eq { 0%,100% { height: 4px } 50% { height: 14px } }

/* ---------------- YouTube results */
.yt-list { display: grid; gap: 6px; }
.yt-item { display: grid; grid-template-columns: 120px 1fr auto; gap: 14px; align-items: center; padding: 8px; border-radius: 8px; }
.yt-item:hover { background: var(--hover); }
.yt-thumb { width: 120px; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; background: var(--surface-2); position: relative; cursor: pointer; }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.yt-thumb .d { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.8); font-size: 11px; padding: 1px 4px; border-radius: 3px; }
.yt-thumb .pv { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; background: rgba(0,0,0,.4); transition: opacity .2s; }
.yt-thumb:hover .pv { opacity: 1; }
.yt-info { min-width: 0; }
.yt-info .t { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-info .s { color: var(--muted); font-size: 13px; }
.mp3-btn { background: var(--accent); color: #1a0d03; }
.mp3-btn:hover { background: var(--accent-2); }
.state-ok { color: var(--ok); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }

.searchbar { position: relative; max-width: 520px; margin-bottom: 18px; }
.searchbar svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.searchbar input { width: 100%; padding: 13px 16px 13px 44px; border-radius: 999px; border: 1px solid transparent; background: var(--surface-2); outline: none; font-size: 15px; }
.searchbar input:focus { border-color: var(--text); background: var(--hover); }

.yt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.yt-card { background: var(--surface); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; transition: background .2s; }
.yt-card:hover { background: var(--surface-2); }
.yt-card .yt-thumb { width: 100%; border-radius: 0; }
.yt-card .yt-info { padding: 10px 12px 4px; flex: 1; }
.yt-card .yt-act { padding: 8px 12px 12px; }
.yt-btn { width: 100%; }
.yt-btn:disabled { background: var(--surface-2); color: var(--dim); opacity: 1; cursor: default; }
.yt-btn.busy { color: var(--muted); }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; }

/* ---------------- Catalogue */
.src-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.src-tabs svg { width: 16px; height: 16px; }
.cat-list { display: grid; gap: 2px; }
.crow { display: grid; grid-template-columns: 48px minmax(0, 1fr) 56px 150px; gap: 12px; align-items: center; padding: 6px 8px; border-radius: 6px; }
.crow:hover { background: var(--hover); }
.cprev { width: 48px; height: 48px; border-radius: 4px; overflow: hidden; background: var(--surface-2); position: relative; }
.cprev img { width: 100%; height: 100%; object-fit: cover; }
.cprev .pv { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .15s; }
.cprev:hover .pv, .cprev.on .pv { opacity: 1; }
.cprev.on .pv { color: var(--accent); }
.crow .cinfo { min-width: 0; }
.crow .tt { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow .ta { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow .ta a:hover { text-decoration: underline; color: var(--text); }
.crow .dur { color: var(--muted); text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.exp { font-size: 9px; font-weight: 800; background: var(--muted); color: var(--bg); border-radius: 2px; padding: 0 3px; vertical-align: 2px; }

.crow.playing .tt { color: var(--accent); }
.crow .reason { color: var(--dim); }
.hint { font-size: 13px; margin: -4px 0 12px; }
.sim-art { position: relative; }
.sim-badge { position: absolute; right: 10px; bottom: 10px; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #1a0d03; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.sim-badge svg { width: 24px !important; height: 24px !important; color: #1a0d03 !important; }
.steps { color: var(--muted); line-height: 1.8; padding-left: 20px; margin: 0 0 12px; }
.steps a { color: var(--accent); }
.steps code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; color: var(--text); }
.sp-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; max-width: 760px; margin-bottom: 8px; }
@media (max-width: 820px) { .sp-form { grid-template-columns: 1fr; } }

/* ---------------- Downloads */
.dl { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 10px; border-radius: 8px; background: var(--surface); margin-bottom: 8px; }
.dl img { width: 64px; height: 36px; object-fit: cover; border-radius: 4px; background: var(--surface-2); }
.dl .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl .s { color: var(--muted); font-size: 12px; }
.dl .s.err { color: var(--danger); word-break: break-word; }
.dl .pbar { height: 4px; background: var(--surface-2); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.dl .pbar div { height: 100%; background: var(--accent); transition: width .4s; }
.dl .btns { display: flex; gap: 4px; }

.empty { text-align: center; color: var(--muted); padding: 60px 16px; }
.empty svg { width: 56px; height: 56px; margin: 0 auto 12px; color: var(--dim); }
.empty h3 { color: var(--text); margin: 0 0 6px; }
.banner { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; display: flex; gap: 12px; align-items: center; }
.banner .pbar { flex: 1; height: 4px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.banner .pbar div { height: 100%; background: var(--accent); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--surface-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg) } }
.loading { display: grid; place-items: center; padding: 60px; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); margin: -10px 0 8px; }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 10px 16px; background: var(--surface); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.kv div:nth-child(odd) { color: var(--muted); }

/* ---------------- Player */
.player { grid-area: player; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(300px, 2fr) minmax(180px, 1fr); align-items: center; gap: 12px; padding: 0 12px; height: var(--player-h); position: relative; }
.p-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.p-cover { width: 56px; height: 56px; border-radius: 6px; overflow: hidden; background: var(--surface-2); flex: none; }
.p-cover img { width: 100%; height: 100%; object-fit: cover; }
.p-cover img:not([src]), .np-cover img:not([src]) { visibility: hidden; }
.p-meta { min-width: 0; }
.p-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-artist { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-center { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.p-controls { display: flex; align-items: center; gap: 10px; }
.p-controls .play-btn { width: 36px; height: 36px; }
.p-progress { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 640px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.p-progress span { width: 40px; text-align: center; }
.bar { flex: 1; height: 4px; background: #4d4d53; border-radius: 2px; position: relative; cursor: pointer; touch-action: none; }
.bar::before { content: ""; position: absolute; inset: -8px 0; }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--text); border-radius: 2px; z-index: 1; }
.bar .buf { position: absolute; left: 0; top: 0; bottom: 0; background: #6a6a70; border-radius: 2px; }
.bar:hover .fill { background: var(--accent); }
.bar .fill::after { content: ""; position: absolute; right: -6px; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: #fff; transform: translateY(-50%) scale(0); transition: transform .1s; }
.bar:hover .fill::after { transform: translateY(-50%) scale(1); }
.p-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.bar.vol { flex: none; width: 110px; }
.mini-progress { display: none; }

/* ---------------- Queue panel */
.queue-panel { grid-area: queue; width: 320px; background: var(--panel); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; }
.queue-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 4px 18px; }
.queue-head h3 { margin: 0; font-size: 16px; }
.queue-list { overflow-y: auto; padding: 4px 8px 16px; }
.queue-list h4 { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin: 14px 10px 6px; }
.qrow { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.qrow:hover { background: var(--hover); }
.qrow img, .qrow .ph { width: 40px; height: 40px; border-radius: 4px; background: var(--surface-2); object-fit: cover; flex: none; }
.qrow .m { min-width: 0; flex: 1; }
.qrow .tt { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.qrow .ta { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow.cur .tt { color: var(--accent); }

/* ---------------- Menu / Modal / Toast */
.menu { position: fixed; z-index: 50; background: var(--surface-2); border-radius: 8px; padding: 4px; min-width: 220px; max-width: 300px; box-shadow: 0 16px 40px rgba(0,0,0,.6); max-height: 70vh; overflow-y: auto; }
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 4px; }
.menu button:hover { background: var(--hover); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu .danger { color: var(--danger); }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; padding: 22px; width: 100%; max-width: 460px; display: grid; gap: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.6); max-height: 90vh; overflow-y: auto; }
.modal h3 { margin: 0; font-size: 18px; }
.modal label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.modal .row { display: flex; justify-content: flex-end; gap: 10px; }
.modal .yt-prev { display: flex; gap: 12px; align-items: center; }
.modal .yt-prev img { width: 96px; border-radius: 6px; }
.modal iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 8px; }
.modal.wide { max-width: 720px; }
.toasts { position: fixed; left: 50%; bottom: calc(var(--player-h) + 20px); transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; pointer-events: none; }
.toast { background: #3b82f6; background: var(--text); color: #000; padding: 10px 16px; border-radius: 8px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: tin .2s ease-out; max-width: 90vw; }
.toast.err { background: var(--danger); color: #fff; }
@keyframes tin { from { opacity: 0; transform: translateY(10px) } }

/* ---------------- Now playing (mobile / plein écran) */
.nowplaying { position: fixed; inset: 0; z-index: 40; background: linear-gradient(180deg, var(--np-color, #4a2a14) 0%, var(--bg) 75%); display: flex; flex-direction: column; padding: calc(12px + var(--safe-t)) 24px calc(24px + var(--safe-b)); gap: 18px; animation: up .25s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0 } }
.np-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.np-cover { flex: 1; min-height: 0; display: grid; place-items: center; }
.np-cover img { width: min(100%, 60vh, 520px); aspect-ratio: 1; object-fit: cover; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: var(--surface-2); }
.np-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 520px; width: 100%; margin: 0 auto; }
.np-title { font-size: 22px; font-weight: 800; }
.np-artist { color: var(--muted); font-size: 16px; }
.np-progress, .np-controls, .np-bottom { max-width: 520px; width: 100%; margin: 0 auto; }
.np-times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }
.np-controls { display: flex; justify-content: space-between; align-items: center; }
.np-bottom { display: flex; justify-content: flex-end; }

.bottom-nav { display: none; }

/* ---------------- Mobile */
@media (max-width: 820px) {
  :root { --player-h: 64px; }
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto auto; grid-template-areas: "main" "player" "nav"; padding: 0; gap: 0; }
  .sidebar { display: none; }
  .main { border-radius: 0; padding-top: var(--safe-t); }
  .view { padding: 16px 16px 24px; }
  h1 { font-size: 26px; }
  .queue-panel { position: fixed; inset: 0; width: auto; z-index: 45; border-radius: 0; padding-top: var(--safe-t); }
  .player { grid-template-columns: 1fr auto; margin: 0 8px 6px; background: #3a2414; border-radius: 8px; height: 58px; padding: 0 6px 0 6px; gap: 6px; }
  .p-cover { width: 44px; height: 44px; border-radius: 4px; }
  .p-left { cursor: pointer; }
  .p-center { flex-direction: row; }
  .p-controls .icon-btn, .p-progress, .p-right, #p-shuffle, #p-repeat, #p-prev { display: none; }
  .p-controls .play-btn { background: transparent; color: var(--text); }
  .p-controls #p-next { display: inline-grid; }
  .p-fav { display: none; }
  .mini-progress { display: block; position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; background: rgba(255,255,255,.2); border-radius: 1px; overflow: hidden; }
  .mini-progress div { height: 100%; background: var(--text); width: 0; }
  .bottom-nav { display: grid; grid-area: nav; grid-template-columns: repeat(4, 1fr); background: linear-gradient(180deg, rgba(11,11,12,.9), var(--bg)); padding: 6px 0 calc(6px + var(--safe-b)); }
  .bottom-nav a { display: grid; justify-items: center; gap: 2px; font-size: 11px; color: var(--muted); }
  .bottom-nav a.active { color: var(--text); }
  .bottom-nav svg { width: 24px; height: 24px; }
  .hero { flex-direction: column; align-items: center; text-align: center; }
  .hero .art, .hero .genre-art.big { width: 200px; height: 200px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .grid.row { grid-auto-columns: 140px; }
  .card { padding: 6px; }
  .card .hover-play { display: none; }
  .trow { grid-template-columns: minmax(0, 1fr) 36px 36px; padding: 6px 4px; gap: 8px; }
  .trow .num, .trow .al, .trow .dur, .trow.head { display: none; }
  .trow .fav, .trow .more { opacity: 1; }
  .trow .fav:not(.on) { display: none; }
  .trow { grid-template-columns: minmax(0, 1fr) auto 36px; }
  .yt-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .crow { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; padding: 6px 2px; }
  .crow .dur { display: none; }
  .crow .cprev { width: 44px; height: 44px; }
  .crow .yt-btn { padding: 7px 10px; font-size: 12px; }
  .yt-card .yt-info .t { font-size: 13px; }
  .yt-card .yt-btn { padding: 8px 6px; font-size: 12px; }
  .yt-item { grid-template-columns: 96px 1fr; }
  .yt-thumb { width: 96px; }
  .yt-item .yt-act { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv div:nth-child(even) { margin-bottom: 10px; }
  .toasts { bottom: calc(140px + var(--safe-b)); }
}
@media (min-width: 821px) { .nowplaying { display: none !important; } }

/* =====================================================================
   Refonte « moderne » : verre dépoli, teinte dynamique, rayons plus doux
   ===================================================================== */
:root {
  --bg: #08080a;
  --panel: #111114;
  --surface: #17171b;
  --surface-2: #212127;
  --hover: rgba(255,255,255,.07);
  --line: rgba(255,255,255,.08);
  --accent: #ff7a1a;
  --accent-2: #ff9b50;
  --grad: linear-gradient(135deg, #ff9b50 0%, #ff6a1a 55%, #f0460f 100%);
  --radius: 16px;
  --glass: rgba(16,16,19,.86);
}
body { font-feature-settings: "ss01", "cv11"; -webkit-font-smoothing: antialiased; }
::selection { background: rgba(255,122,26,.35); }
.main::-webkit-scrollbar, .side-playlists::-webkit-scrollbar, .queue-list::-webkit-scrollbar { width: 10px; }
.main::-webkit-scrollbar-thumb, .side-playlists::-webkit-scrollbar-thumb, .queue-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

/* Panneaux */
.sidebar, .main, .queue-panel { border: 1px solid var(--line); }
.main { background: linear-gradient(180deg, var(--tint, #1d1d22) 0, var(--panel) 420px); transition: background .6s ease; }
.nav a, .side-settings { border-radius: 10px; }
.nav a.active { background: rgba(255,255,255,.08); }

/* En-tête collant */
.topbar { position: sticky; top: 0; z-index: 5; height: 0; display: flex; align-items: center; gap: 10px; padding: 0 18px; overflow: visible; pointer-events: none; }
.topbar .tb-title, .topbar .tb-back { opacity: 0; transition: opacity .2s; }
.topbar::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 60px; background: var(--glass); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6); border-bottom: 1px solid var(--line); opacity: 0; transition: opacity .2s; }
.topbar.show::before, .topbar.show .tb-title, .topbar.show .tb-back { opacity: 1; }
.topbar.show { pointer-events: auto; }
.topbar > * { position: relative; top: 30px; }
.tb-title { font-weight: 800; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Titres */
h1 { font-weight: 850; letter-spacing: -.03em; }
h2 { font-weight: 800; letter-spacing: -.02em; }
.hero .art { border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.hero h1 { font-weight: 900; letter-spacing: -.04em; }

/* Boutons */
.btn { border-radius: 999px; font-weight: 700; letter-spacing: -.005em; }
.btn.primary, .mp3-btn, .badge { background: var(--grad); color: #1a0b02; }
.btn.primary:hover, .mp3-btn:hover { filter: brightness(1.08); background: var(--grad); }
.btn.ghost { border-color: rgba(255,255,255,.18); }
.play-btn.accent { background: var(--grad); box-shadow: 0 10px 28px rgba(255,106,26,.35); }
.play-btn.accent:hover { transform: scale(1.05); }
.tabs button, .tabs a { background: rgba(255,255,255,.07); border: 1px solid transparent; transition: background .15s; }
.tabs button:hover, .tabs a:hover { background: rgba(255,255,255,.12); }
.tabs .on { background: #fff; color: #000; }

/* Cartes */
.card { border-radius: 14px; transition: background .2s, transform .2s; }
.card .art { border-radius: 10px; }
.card:hover { background: rgba(255,255,255,.06); }
.card:hover .art { transform: translateY(-2px); }
.card .art { transition: transform .25s ease, box-shadow .25s; }
.card .hover-play { background: var(--grad); }

/* Accès rapide (accueil) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 6px 0 10px; }
.tile { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.07); border-radius: 10px; overflow: hidden; height: 60px; font-weight: 700; font-size: 14px; transition: background .15s; min-width: 0; }
.tile:hover { background: rgba(255,255,255,.13); }
.tile span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 10px; }
.tile-art { width: 60px; height: 60px; flex: none; display: grid; place-items: center; background: var(--surface-2); }
.tile-art img { width: 100%; height: 100%; object-fit: cover; }
.fav-art { background: linear-gradient(135deg, #7c5cff, #c86dd7 60%, #ff9b50); }
.fav-art svg { color: #fff; }

/* Listes de titres */
.trow { border-radius: 8px; }
.trow .thumb { border-radius: 6px; }
.crow { border-radius: 10px; }
.cprev { border-radius: 8px; }

/* Lecteur : verre dépoli */
.player { background: var(--glass); backdrop-filter: blur(28px) saturate(1.7); -webkit-backdrop-filter: blur(28px) saturate(1.7); border-top: 1px solid var(--line); margin: 0 -8px; padding: 0 20px; }
.p-cover { border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.18); }
.bar .fill { background: #fff; border-radius: 4px; }
.bar:hover .fill { background: var(--grad); }
.queue-panel { background: var(--panel); }

/* Menus / modales / feuille du bas */
.menu { background: rgba(38,38,44,.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--line); border-radius: 12px; }
.menu button { border-radius: 8px; }
.modal { border-radius: 20px; border: 1px solid var(--line); }
.toast { border-radius: 12px; }
.sheet-bg { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; animation: fade .2s; }
@keyframes fade { from { opacity: 0 } }
.sheet { width: 100%; max-height: 88vh; overflow-y: auto; background: rgba(28,28,33,.97); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-radius: 22px 22px 0 0; border-top: 1px solid var(--line); padding: 8px 14px calc(18px + var(--safe-b)); animation: sheetup .25s cubic-bezier(.2,.9,.3,1); }
@keyframes sheetup { from { transform: translateY(100%) } }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); margin: 4px auto 12px; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 0 4px 12px; border-bottom: 1px solid var(--line); }
.sheet-head img, .sheet-head .ph { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.sheet-head .tt { font-weight: 800; }
.sheet-head .ta { color: var(--muted); font-size: 13px; }
.sheet-sec { display: flex; justify-content: space-between; align-items: center; margin: 14px 4px 6px; font-weight: 800; }
.sheet-sec span { display: inline-flex; align-items: center; gap: 6px; }
.sheet-sec svg { width: 18px; height: 18px; color: var(--accent); }
.sheet-sec small { color: var(--dim); font-weight: 600; font-size: 11px; }
.sheet-sec a { color: var(--accent); font-size: 13px; font-weight: 700; }
.sheet .crow { padding: 6px 4px; }
.sheet-actions { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 6px; }
.sheet-actions button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 6px; font-size: 15px; border-radius: 10px; }
.sheet-actions button:active { background: var(--hover); }
.sheet-actions svg { color: var(--muted); }
.sheet-actions .danger { color: var(--danger); }
.loading.small { padding: 18px; }

/* Mobile */
@media (max-width: 820px) {
  .main { border: 0; }
  .view { padding: 18px 16px 28px; }
  h1 { font-size: 28px; }
  .topbar { padding: 0 8px; }
  .topbar::before { height: calc(52px + var(--safe-t)); }
  .topbar > * { top: calc(26px + var(--safe-t)); }
  .hero { align-items: flex-start; text-align: left; gap: 16px; margin-top: 30px; }
  .hero > .art, .hero .genre-art.big { align-self: center; width: min(62vw, 250px); height: min(62vw, 250px); }
  .hero h1 { font-size: clamp(24px, 7vw, 32px); margin: 4px 0 6px; }
  .hero .kind { font-size: 11px; }
  .actions { gap: 6px; margin: 4px 0 10px; }
  .actions .play-btn.accent { order: 9; margin-left: auto; width: 52px; height: 52px; }
  .actions .play-btn.accent svg { width: 22px; height: 22px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile { height: 52px; font-size: 13px; gap: 10px; }
  .tile-art { width: 52px; height: 52px; }
  .player { margin: 0 8px 6px; padding: 0 6px; border-radius: 12px; border: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--np-color, #3a2414) 80%, #000) 0%, color-mix(in srgb, var(--np-color, #3a2414) 55%, #000) 100%); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .p-cover { border-radius: 6px; }
  .bottom-nav { background: linear-gradient(180deg, rgba(8,8,10,0), rgba(8,8,10,.92) 35%, var(--bg)); backdrop-filter: none; }
  .bottom-nav a.active svg { color: #fff; }
  .trow { padding: 7px 2px; }
  .trow .thumb { width: 48px; height: 48px; }
  .card .art { border-radius: 8px; }
}

/* ---------------- Peyotify : accueil / bibliothèque / radio */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button.tile { color: inherit; text-align: left; font: inherit; font-weight: 700; font-size: 14px; }
.radio-art { position: relative; }
.radio-art img { filter: saturate(1.1) brightness(.8); }
.radio-art b { position: absolute; left: 4px; top: 4px; font-size: 8px; letter-spacing: .08em; background: rgba(0,0,0,.6); color: #fff; padding: 1px 4px; border-radius: 3px; }
.lib-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lib-head h1 { margin-bottom: 12px; }
.lib-icons { display: flex; gap: 4px; }
.lib-icons .icon-btn { position: relative; color: var(--text); }
.lib-icons .badge { position: absolute; top: 0; right: -2px; font-size: 10px; padding: 0 5px; }
.lib-fav { display: flex; align-items: center; gap: 12px; padding: 6px; margin: 0 -6px 14px; border-radius: 10px; }
.lib-fav:hover { background: var(--hover); }
.lib-fav .tile-art { width: 56px; height: 56px; border-radius: 6px; }
.lib-fav small { display: block; color: var(--muted); font-size: 13px; }
.np-dl { align-self: center; margin: -4px auto 0; }
@media (max-width: 820px) {
  .bottom-nav { grid-template-columns: repeat(3, 1fr); }
  .player.ext .p-fav#p-fav { display: inline-grid; color: var(--accent); }
  .tiles { margin-top: 4px; }
  .view > .tiles:first-child, .view > .sr-only + .tiles { margin-top: calc(6px + var(--safe-t)); }
}

/* Noms d'artistes cliquables */
a.alink { color: inherit; text-decoration: none; }
a.alink:hover { color: var(--text, #fff); text-decoration: underline; }

/* Photos d'artistes par-dessus l'icône de repli ; bouton « ajouter l'album » sur les pochettes */
.card .art, .hero .art { position: relative; }
.card.round .art > img, .hero .art.round > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .alb-dl { background: var(--accent, #ff6a00); }
.card .alb-dl:disabled { opacity: .7; }
.src-label { margin-top: 26px; }
@media (max-width: 820px) {
  .card .alb-dl { display: grid; place-items: center; opacity: 1; transform: none; width: 38px; height: 38px; top: auto; bottom: 64px; right: 14px; }
}

/* Paroles */
.lyrics { position: fixed; inset: 0 0 var(--player-h, 90px) 0; z-index: 60; background: linear-gradient(160deg, #3a1d0b, #121212 70%); display: flex; flex-direction: column; }
.lyrics.hidden { display: none; }
.ly-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px 8px; }
.ly-title { font-weight: 800; font-size: 18px; }
.ly-artist { color: var(--muted, #aaa); font-size: 14px; }
.ly-body { position: relative; flex: 1; overflow-y: auto; padding: 10vh 24px 40vh; max-width: 820px; width: 100%; margin: 0 auto; }
.ly-line { font-size: clamp(22px, 3.2vw, 34px); font-weight: 800; line-height: 1.3; margin: 0 0 14px; color: rgba(255,255,255,.38); cursor: pointer; transition: color .25s; }
.ly-line.on { color: #fff; }
.ly-line.plain { color: #fff; cursor: default; font-size: clamp(18px, 2.6vw, 26px); }
.ly-line:not(.plain):hover { color: rgba(255,255,255,.75); }
.ly-empty { color: var(--muted, #aaa); text-align: center; font-size: 18px; margin-top: 20vh; }
.ly-src { color: var(--muted, #888); font-size: 12px; margin-top: 30px; }
@media (max-width: 820px) { .lyrics { inset: 0; z-index: 80; padding-top: env(safe-area-inset-top); } }

/* Bouton « Paroles » (pastille) à côté du cœur et des étoiles */
.ly-pill { flex: none; align-self: center; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.06); color: var(--text, #fff);
  font-family: inherit; font-weight: 700; font-size: 12px; line-height: 1; padding: 7px 12px; border-radius: 999px; cursor: pointer; margin-left: 4px; transition: background .2s, border-color .2s; }
.ly-pill:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.5); }
.ly-pill.on { background: var(--accent, #ff6a00); border-color: transparent; color: #1a0d03; }
.np-meta .ly-pill { margin-right: 4px; }
@media (max-width: 820px) { .player .ly-pill { padding: 6px 10px; font-size: 11px; } }

/* Flèche retour toujours visible sur les pages de détail (album, artiste, playlist…) */
.topbar.has-back .tb-back { opacity: 1; pointer-events: auto; background: rgba(0,0,0,.45); border-radius: 50%; width: 36px; height: 36px; display: grid; place-items: center; }
.topbar.has-back .tb-back:hover { background: rgba(0,0,0,.7); }
.topbar:not(.has-back) .tb-back { display: none; }
@media (min-width: 821px) { .topbar.has-back + .view > .hero:first-child { margin-top: 30px; } }

/* Pastille source : NAS (fichier sur le NAS) / YT (écoute en direct) */
.yt-tag.nas { background: #2bb673; color: #06210f; }

/* Écran « chargement en cours » (radio) */
.busy { position: fixed; inset: 0; z-index: 95; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; }
.busy.hidden { display: none; }
.busy-card { background: var(--surface, #1c1c1f); border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 28px 30px; min-width: 260px; max-width: 86vw; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.spinner.big { width: 46px; height: 46px; border-width: 4px; margin-bottom: 16px; }
.busy-msg { font-weight: 800; font-size: 19px; }
.busy-sub { color: var(--muted, #aaa); font-size: 14px; margin-top: 6px; }
/* Bouton lecture pendant le chargement d'un titre */
.play-btn.loading { position: relative; }
.play-btn.loading svg { opacity: 0; }
.play-btn.loading::after { content: ""; position: absolute; inset: 22%; border: 3px solid rgba(0,0,0,.25); border-top-color: #111; border-radius: 50%; animation: spin .8s linear infinite; }
