@font-face { font-family: "Frank Ruhl Libre"; src: url("FrankRuhlLibre.ttf") format("truetype"); font-weight: 300 900; font-display: swap; }

:root {
  --ink: #0c0906; --panel: #15100b; --cream: #f6ecd6; --muted: rgba(246,236,214,.58); --faint: rgba(246,236,214,.32);
  --gold: #dbb35c; --gold-light: #fde8ad; --gold-deep: #8f6524;
  --gold-grad: linear-gradient(135deg, #fde8ad 0%, #dbb35c 45%, #b8862f 75%, #eed08a 100%);
  --serif: "Frank Ruhl Libre", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --player-h: 92px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--cream); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(800px 500px at 90% -10%, rgba(219,179,92,.14), transparent 70%),
    radial-gradient(700px 500px at 0% 110%, rgba(115,46,26,.18), transparent 70%),
    var(--ink);
  background-attachment: fixed;
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.he { font-family: var(--serif); font-weight: 700; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Écran du mot de passe ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login-logo { width: 112px; height: 112px; border-radius: 26px; box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 40px rgba(219,179,92,.18); }
.login h1 { font-size: 54px; margin: 18px 0 0; line-height: 1.1; }
.login-sub { margin: 2px 0 28px; letter-spacing: .18em; text-transform: uppercase; font-size: 12px; color: var(--muted); font-weight: 600; }
.login input {
  width: 100%; height: 54px; border-radius: 14px; border: 1px solid rgba(219,179,92,.35); background: rgba(255,255,255,.06);
  color: var(--cream); font-size: 17px; padding: 0 18px; outline: none; transition: border-color .2s;
}
.login input:focus { border-color: var(--gold); }
.login .btn-gold { width: 100%; margin-top: 12px; }
.login-error { min-height: 20px; color: #f0a38f; font-size: 14px; margin: 10px 0 0; }
.login-note { color: var(--faint); font-size: 13px; margin-top: 26px; }

.btn-gold {
  height: 50px; padding: 0 24px; border-radius: 999px; background: var(--gold-grad); color: #2a1a08; font-weight: 700; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 6px 20px rgba(219,179,92,.3);
  transition: transform .15s ease;
}
.btn-gold:active, .btn-ghost:active, .p-play:active, .card:active { transform: scale(.96); }
.btn-ghost {
  height: 50px; padding: 0 20px; border-radius: 999px; border: 1px solid rgba(219,179,92,.35); background: rgba(255,255,255,.06);
  font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; transition: transform .15s ease;
}
.btn-gold svg, .btn-ghost svg { width: 18px; height: 18px; }
.btn-gold svg { fill: currentColor; stroke: none; }
.btn-gold svg.s { fill: none; stroke: currentColor; stroke-width: 2.2; }

/* ---------- En-tête ---------- */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(12,9,6,.78); backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%); border-bottom: 1px solid rgba(219,179,92,.12);
}
.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand .he { font-size: 24px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); background: rgba(255,255,255,.05); white-space: nowrap; }
.tab.on { background: var(--gold-grad); color: #2a1a08; }
.search-btn { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.06); color: var(--gold); }

/* ---------- Vues ---------- */
.view { padding: 18px 16px calc(var(--player-h) + 40px + env(safe-area-inset-bottom)); max-width: 1280px; margin: 0 auto; }
.greet .he { font-size: clamp(38px, 9vw, 60px); line-height: 1.1; display: block; }
.greet .fr { font-size: 17px; font-weight: 600; color: rgba(246,236,214,.85); margin-top: 2px; }
.h-cat { font-size: clamp(40px, 10vw, 64px); line-height: 1.05; margin: 6px 0 4px; display: block; }
.h-sub { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 18px 0 4px; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; background: rgba(255,255,255,.07); }
.chip.on { background: var(--gold-grad); color: #2a1a08; }
.sec-title { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 0 12px; }
.sec-title h2 { font-size: 20px; margin: 0; }
.sec-title a { color: var(--gold); font-size: 14px; font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px 12px; }
@media (max-width: 420px) { .grid { grid-template-columns: repeat(2, 1fr); } }
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(140px, 168px); gap: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.shelf::-webkit-scrollbar { display: none; }
.card { display: block; transition: transform .15s ease; }
.cover { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #241a10; box-shadow: 0 8px 22px rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.07); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 64px;
  background: radial-gradient(circle, rgba(219,179,92,.22), transparent 70%), linear-gradient(135deg, #3a1d14, #120806); }
.ph span { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card-t { font-size: 14px; font-weight: 600; margin-top: 8px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-s { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Page d'album */
.album-head { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; margin-top: 6px; }
.album-head .cover { width: min(230px, 60vw); flex: none; }
.album-head .kicker { color: var(--gold); font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.album-head h1 { font-family: var(--serif); font-size: clamp(28px, 6vw, 44px); line-height: 1.1; margin: 6px 0; }
.album-head .meta { color: var(--muted); font-size: 14px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.back svg { width: 18px; height: 18px; }

.tracks { margin-top: 22px; display: flex; flex-direction: column; gap: 2px; }
.tr { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 10px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.tr:hover { background: rgba(255,255,255,.06); }
.tr.on { background: rgba(219,179,92,.1); }
.tr .n { width: 26px; text-align: center; color: var(--faint); font-variant-numeric: tabular-nums; font-size: 14px; flex: none; }
.tr.on .n { color: var(--gold); }
.tr .tt { flex: 1; min-width: 0; }
.tr .t1 { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr.on .t1 { color: var(--gold-light); }
.tr .t2 { font-family: var(--serif); font-size: 13.5px; color: var(--muted); direction: rtl; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr .mini { width: 42px; height: 42px; border-radius: 6px; flex: none; }

.search-box { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 16px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(219,179,92,.25); max-width: 640px; }
.search-box svg { color: var(--gold); flex: none; }
.search-box input { flex: 1; background: none; border: 0; outline: none; color: var(--cream); font-size: 17px; }
.empty { text-align: center; color: var(--muted); padding: 60px 10px; }

/* ---------- Lecteur ---------- */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 0 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(12,9,6,.86); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-top: 1px solid rgba(219,179,92,.25);
}
.p-progress { margin: 0 -12px; }
#seek { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; background: rgba(255,255,255,.14); outline: none; margin: 0; display: block; cursor: pointer; }
#seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--gold-light); box-shadow: 0 1px 4px rgba(0,0,0,.5); }
#seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--gold-light); border: 0; }
.p-row { display: flex; align-items: center; gap: 12px; height: var(--player-h); max-width: 1280px; margin: 0 auto; }
.p-cover { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #241a10; flex: none; }
.p-info { flex: 1; min-width: 0; }
.p-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-album { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.p-btn { width: 44px; height: 44px; display: grid; place-items: center; color: var(--cream); flex: none; }
.p-btn svg { fill: currentColor; }
.p-play { width: 52px; height: 52px; border-radius: 50%; background: var(--gold-grad); color: #2a1a08; display: grid; place-items: center; flex: none; box-shadow: 0 4px 16px rgba(219,179,92,.35); transition: transform .15s; }
.p-play svg { fill: currentColor; stroke: none; width: 24px; height: 24px; }
@media (max-width: 560px) { .p-time, #p-prev { display: none; } .p-cover { width: 48px; height: 48px; } }

.quote { margin: 18px 0 6px; padding: 2px 0 2px 16px; border-left: 3px solid var(--gold); max-width: 760px; }
.quote p { margin: 0; font-family: var(--serif); font-size: 19px; line-height: 1.4; color: rgba(246,236,214,.92); }
.quote .q-he { direction: rtl; text-align: right; font-size: 16px; color: var(--muted); margin-top: 6px; }
.quote cite { display: block; margin-top: 8px; font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--gold); }

/* ---------- Comptes et playlists ---------- */
.search-btn + .search-btn { margin-left: -4px; }
.acc { max-width: 420px; }
.acc .seg { display: flex; gap: 6px; background: rgba(255,255,255,.06); padding: 4px; border-radius: 999px; margin: 18px 0; }
.acc .seg button { flex: 1; height: 40px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); }
.acc .seg button.on { background: var(--gold-grad); color: #2a1a08; }
.field { width: 100%; height: 52px; border-radius: 14px; border: 1px solid rgba(219,179,92,.3); background: rgba(255,255,255,.06);
  color: var(--cream); font-size: 17px; padding: 0 16px; outline: none; margin-bottom: 10px; }
.field:focus { border-color: var(--gold); }
.form-error { color: #f0a38f; font-size: 14px; min-height: 20px; margin: 4px 0 8px; }
.help { color: var(--faint); font-size: 13px; line-height: 1.5; }
.pl-row { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.04); margin-bottom: 8px; }
.pl-row .pl-ico { width: 52px; height: 52px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg,#3a2612,#140b05); color: var(--gold); flex: none; }
.pl-row .pl-t { font-weight: 600; }
.pl-row .pl-s { font-size: 13px; color: var(--muted); }
.add { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--gold); flex: none; }
.add svg { width: 20px; height: 20px; }
.rm { width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); flex: none; }
.link-btn { color: var(--gold); font-weight: 600; font-size: 14px; }
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { width: 100%; max-width: 480px; max-height: 75dvh; overflow: auto; background: #18110a; border: 1px solid rgba(219,179,92,.25);
  border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: up .28s cubic-bezier(.2,.8,.2,1); }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-card { border-radius: 22px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-card h3 { margin: 0 0 4px; font-size: 18px; }
.sheet-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 12px; border-radius: 12px; text-align: left; font-size: 16px; }
.opt:hover, .opt:active { background: rgba(255,255,255,.07); }
.opt .pl-ico { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: rgba(219,179,92,.14); color: var(--gold); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--player-h) + 30px + env(safe-area-inset-bottom)); z-index: 50;
  background: var(--gold-grad); color: #2a1a08; font-weight: 700; font-size: 14px; padding: 10px 18px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
