/* Direction artistique inspirée des planches « variants » : fond gris perle, titres d'album fins en capitales,
   tuiles blanches avec la pochette et le disque coloré qui dépasse. */
:root {
  --bg:#ecebef; --surface:#fff; --ink:#24202a; --muted:#6f6a78; --line:#dcd9e1; --accent:#7d4fa3; --accent-soft:#efe7f6;
  --title:#8a5bb0; --ok:#1f7a35; --okbg:#dff3e3; --bad:#b3261e; --badbg:#fde3e1; --shadow: 0 1px 2px rgba(30,20,40,.08), 0 6px 18px rgba(30,20,40,.08);
  --display: "Didot", "Bodoni 72", "Bodoni MT", "Playfair Display", "Times New Roman", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#17151b; --surface:#221f27; --ink:#ece8f1; --muted:#a49eae; --line:#35303d; --accent:#c09ae3; --accent-soft:#33283f;
          --title:#cfa9ef; --ok:#7fdc95; --okbg:#173a21; --bad:#ff8a80; --badbg:#42201d; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35); }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
.wrap { max-width: 1180px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 18px 56px; display: flex; flex-direction: column; gap: 18px; }
a { color: inherit; }
h1 { font-size: 1.5rem; margin: 0; } h2 { font-size: 1.05rem; margin: 0; }
.display { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .06em; color: var(--title); font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.1; }
code { background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); } .small { font-size: .85rem; margin: 0; } .center { text-align: center; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-family: var(--display); text-transform: uppercase; letter-spacing: .12em; font-size: 1.2rem; }
.who { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; } .who form { margin: 0; }
.who > a { text-decoration: none; color: var(--muted); padding: 4px 0; border-bottom: 2px solid transparent; } .who > a.on { color: var(--ink); border-color: var(--accent); }
.crumb { margin: 0; } .crumb a { color: var(--muted); text-decoration: none; }
button, .btn { font: inherit; font-weight: 500; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; min-height: 40px; }
button:hover, .btn:hover { border-color: var(--accent); }
button:disabled { opacity: .6; cursor: progress; }
.primary { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }
.ghost { background: transparent; } .bad { color: var(--bad); }
.linklike { border: 0; background: none; padding: 0; min-height: 0; color: inherit; text-decoration: underline; font-weight: 400; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; }
select { width: auto; border-radius: 999px; padding: 8px 12px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label { display: grid; gap: 4px; font-weight: 500; }
label.check { display: flex; align-items: center; gap: 8px; }
label.check input, .have input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
label.big { font-size: 1.05rem; }
.stack { display: grid; gap: 14px; }
.cols { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cols.c4 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 12px; }
.panel.narrow { max-width: 420px; width: 100%; margin: 40px auto; }
.panel.empty { text-align: center; justify-items: center; padding: 40px 18px; } .panel.empty p { margin: 0; }
.flash { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.flash.ok { background: var(--okbg); color: var(--ok); } .flash.error { background: var(--badbg); color: var(--bad); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; } .actions form { margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 10px; margin: 0; }
legend { padding: 0 6px; font-weight: 600; }
.coverbox img.current { width: 120px; height: 120px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.danger { margin: 0; }

/* ---- compteurs, filtres */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats div { background: var(--surface); border-radius: 12px; padding: 12px 16px; display: grid; box-shadow: var(--shadow); }
.stats b { font-family: var(--display); font-weight: 400; font-size: 2rem; line-height: 1.05; font-variant-numeric: lining-nums tabular-nums; } .stats span { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.stats .own b { color: var(--title); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.toolbar input[type=search] { flex: 1 1 260px; width: auto; border-radius: 999px; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.selects { display: flex; gap: 8px; margin: 0; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tabs a { text-decoration: none; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.tabs a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tabs a.right { margin-left: auto; } .tabs a.plain { border: 0; background: none; }
/* ---- barre des albums : défilement horizontal sans barre système, flèches, bords en fondu, collante en haut */
.albumbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px; margin: 0 -18px; padding: 10px 18px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.chips { display: flex; gap: 8px; flex: 1; min-width: 0; overflow-x: auto; scroll-behavior: smooth; scroll-snap-type: x proximity;
  scrollbar-width: none; padding: 4px 2px; cursor: grab; user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%); }
.chips::-webkit-scrollbar { display: none; }
.chips.dragging { cursor: grabbing; scroll-behavior: auto; } .chips.dragging a { pointer-events: none; }
.chips a { scroll-snap-align: center; flex: none; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap;
  padding: 6px 8px 6px 6px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-family: var(--display);
  text-transform: uppercase; letter-spacing: .05em; font-size: .9rem; color: var(--ink); transition: transform .15s, background .15s; }
.chips a:hover { transform: translateY(-1px); }
.chips a span { font-family: system-ui, sans-serif; font-size: .72rem; letter-spacing: 0; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--title); }
.chips a span:empty { display: none; }
.chips a.on { background: var(--accent); color: #fff; } .chips a.on span { background: rgba(255,255,255,.25); color: #fff; }
.mini { width: 22px; height: 22px; border-radius: 50%; flex: none; background: #161311; position: relative; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); transition: transform .4s; }
.mini::after { content: ""; position: absolute; inset: 36%; border-radius: 50%; background: #f2efe9; }
.mini.all { background: conic-gradient(#a9c6dc 0 25%, #8b1020 0 50%, #1f7a5c 0 75%, #b39ddb 0); }
.mini.picture { background: conic-gradient(#e6b9c8, #b7d3e9, #f2dfa0, #e6b9c8); }
.chips a:hover .mini, .chips a.on .mini { transform: rotate(120deg); }
.albumbar .nav { flex: none; width: 34px; height: 34px; min-height: 0; padding: 0; justify-content: center; border-radius: 50%; font-size: 1.3rem; line-height: 1; box-shadow: var(--shadow); border: 0; }
.albumbar .nav:hover { background: var(--accent); color: #fff; }

/* ---- filtres par caractéristiques */
.facets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.facet { display: inline-flex; align-items: center; gap: 0; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow); padding-left: 14px; font-weight: 500; }
.facet span { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.facet select { border: 0; background: transparent; box-shadow: none; padding: 7px 12px 7px 8px; max-width: 220px; cursor: pointer; }
.facet select:focus { outline: none; }
.facet.on { background: var(--accent); } .facet.on span, .facet.on select { color: #fff; } .facet.on select option { color: var(--ink); }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; font-size: .9rem; }
.pill { text-decoration: none; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--title); }
.pill b { margin-left: 4px; } .plain { text-decoration: underline; }
@media (max-width: 560px) { .albumbar { margin: 0 -12px; padding: 8px 12px; } .albumbar .nav { display: none; } .facet select { max-width: 150px; } }

/* ---- sections d'album, à la manière des planches de variantes */
.artist-head { display: grid; gap: 8px; justify-items: start; }
.album { display: grid; gap: 6px; padding-top: 18px; }
.album-title { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .08em; color: var(--title); font-size: clamp(1.6rem, 4.2vw, 2.6rem); text-align: center; line-height: 1.15; }
.album-sub { text-align: center; color: var(--muted); margin: 0 0 8px; font-size: .85rem; letter-spacing: .04em; }
.section-title { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .08em; color: var(--title); font-size: 1.6rem; }

/* ---- tuile : pochette + disque qui dépasse */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.tile { background: var(--surface); border-radius: 4px; box-shadow: var(--shadow); display: flex; flex-direction: column; scroll-margin-top: 20px; transition: transform .15s; }
.tile:target { outline: 3px solid var(--accent); outline-offset: 2px; }
.art { position: relative; display: block; aspect-ratio: 1.32; margin: 14px 14px 0; }
.sleeve { position: absolute; left: 0; top: 0; height: 100%; aspect-ratio: 1; z-index: 2; background: #e9e6ec; box-shadow: 2px 0 6px rgba(0,0,0,.18); overflow: hidden; }
.sleeve img { width: 100%; height: 100%; object-fit: cover; display: block; position: relative; z-index: 1; }
.sleeve .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; text-align: center; font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; color: #6f6a78; font-size: .95rem; background: linear-gradient(135deg, #f4f2f6, #dcd8e2); }
.disc { position: absolute; right: 0; top: 3%; height: 94%; aspect-ratio: 1; border-radius: 50%; background: #161311; z-index: 1;
        box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: transform .35s ease; }
.disc::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: repeating-radial-gradient(circle, rgba(0,0,0,0) 0 3px, rgba(0,0,0,.07) 3px 4px), radial-gradient(circle at 30% 25%, rgba(255,255,255,.28), rgba(255,255,255,0) 45%); }
.disc::after { content: ""; position: absolute; inset: 36%; border-radius: 50%; background: radial-gradient(circle, #1b1714 0 6%, #f2efe9 7% 100%); box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.disc.picture { background-size: cover; background-position: center; } .disc.picture::after { inset: 46%; }
.tile:hover .disc, .artists a:hover .disc { transform: translateX(6%) rotate(25deg); }
.tile:not(.owned) .sleeve img { filter: grayscale(.55); opacity: .82; }
.tile:not(.owned) .disc { filter: saturate(.6); opacity: .85; }
.cap { padding: 10px 14px 2px; display: grid; gap: 1px; flex: 1; min-width: 0; }
.cap strong { font-weight: 600; overflow-wrap: anywhere; }
.cap .artist { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--title); }
.cap .ttl { font-size: .9rem; } .cap small { color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.cap .notes { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.have { display: flex; align-items: center; gap: 8px; padding: 8px 14px 12px; cursor: pointer; font-weight: 500; color: var(--muted); }
.tile.owned .have { color: var(--title); font-weight: 700; }
.tile.owned { box-shadow: var(--shadow), inset 0 -3px 0 var(--accent); }
.have.busy { opacity: .5; }

/* ---- accueil : choisir un artiste */
.pick { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 26px 0 8px; }
.pick p { margin: 0; max-width: 560px; }
.pick .mbsearch { width: 100%; max-width: 560px; } .pick input { border-radius: 999px; padding-left: 18px; }
.artist-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; width: 100%; max-width: 560px; text-align: left; }
.artist-results li { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--surface); border-radius: 12px; padding: 8px 8px 8px 16px; box-shadow: var(--shadow); }
.artist-results span { display: grid; min-width: 0; } .artist-results small { color: var(--muted); }
.artists { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.artists a { display: grid; gap: 4px; text-decoration: none; background: var(--surface); border-radius: 4px; box-shadow: var(--shadow); padding: 14px; }
.artists .art { margin: 0 0 6px; }
.artists strong { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .05em; font-size: 1.15rem; color: var(--title); }
.bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--accent); }

/* ---- formulaire : recherche MusicBrainz */
.mbsearch { display: flex; gap: 8px; } .mbsearch input { flex: 1; }
.mbresults { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 460px; overflow: auto; }
.mbresults li button { width: 100%; text-align: left; display: flex; gap: 10px; align-items: center; padding: 6px; background: var(--bg); border-radius: 10px; }
.mbresults img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; flex: none; background: var(--line); }
.mbresults span { display: grid; min-width: 0; } .mbresults small { color: var(--muted); }

@media (max-width: 560px) {
  .wrap { padding-left: 12px; padding-right: 12px; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .art { margin: 8px 8px 0; } .cap { padding: 8px 8px 0; } .have { padding: 6px 8px 10px; }
  .stats b { font-size: 1.5rem; }
  .artists { grid-template-columns: repeat(2, 1fr); gap: 10px; } .artists a { padding: 8px; }
}

/* ---- listes importées */
.cap .color { font-size: .85rem; color: var(--title); }
.cap .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.cap .tags span { border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-size: .72rem; }
.cap .tags .rarity { border-color: var(--accent); color: var(--title); }
.addlist .included { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .addlist .included form { margin: 0; } .addlist .included p { margin: 0; }
.addlist .actions { margin: 0; }
details.panel summary { cursor: pointer; list-style: none; } details.panel summary::-webkit-details-marker { display: none; }
details.panel summary h2::after { content: " ▾"; color: var(--muted); } details[open].panel summary h2::after { content: " ▴"; }
.display.center { text-align: center; }

/* ---- pied de page : installation de l'appli */
.foot { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .85rem; }
.foot summary { cursor: pointer; display: inline; } .foot p { margin: 8px auto 0; max-width: 520px; }

/* ---- téléphone */
@media (max-width: 560px) {
  body { font-size: 14px; }
  .wrap { gap: 14px; padding-bottom: max(32px, env(safe-area-inset-bottom)); }
  .top { gap: 8px; padding-bottom: 8px; }
  .brand { font-size: 1.05rem; }
  .who { gap: 10px; font-size: .9rem; } .who .ghost { padding: 6px 10px; min-height: 34px; font-size: .85rem; }
  .display { font-size: 1.9rem; }
  .album-title { font-size: 1.6rem; }
  .stats { gap: 6px; } .stats div { padding: 8px 10px; } .stats span { font-size: .7rem; }
  .controls { gap: 8px; } .tabs a { padding: 6px 11px; }
  .facets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 2px 12px 6px; }
  .facets::-webkit-scrollbar { display: none; }
  .facet { flex: none; }
  .chips a { font-size: .82rem; }
  .cap strong { font-size: .92rem; } .cap .color { font-size: .78rem; }
  .cap small { font-size: .72rem; }
  .have { min-height: 40px; }
  .tile:hover .disc { transform: none; }
  .panel { padding: 14px; }
  .actions .btn, .actions button { flex: 1 1 auto; justify-content: center; }
}
@media (display-mode: standalone) { .top { padding-top: env(safe-area-inset-top); } }
