/* Les trois barbots · appli clients. Charte : Tuffeau, Bleu Loire, Rouille gabare, Jaune lampion. */
:root{
  --bg:#F5EFE3;--card:#FFFCF6;--card2:#EFE6D3;--line:#E2D5B9;--ink:#23404F;--muted:#4E6676;
  --rust:#A9482A;--lamp:#E3B23C;--lamp-soft:#F6E5B8;--ok:#4F6B34;--ok-soft:#E3EBD6;--neg:#B3261E;--neg-soft:#F8DEDA;
  --nav:#23404F;--nav-ink:#F5EFE3;--r:14px;--shadow:0 1px 2px rgba(35,64,79,.08),0 8px 24px rgba(35,64,79,.08);
  --display:"Fraunces",Georgia,serif;--body:"Work Sans",system-ui,-apple-system,sans-serif;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){:root{
  --bg:#11202A;--card:#18303D;--card2:#1F3A49;--line:#2C4655;--ink:#EDE6D6;--muted:#A9B8C0;
  --rust:#E08A6A;--lamp-soft:#4A3B17;--ok:#A8C98A;--ok-soft:#24392A;--neg:#F2867E;--neg-soft:#47201E;
  --nav:#0B171F;--shadow:0 1px 2px rgba(0,0,0,.3);color-scheme:dark;
}}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
html.lock{overflow:hidden}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.5 var(--body);min-height:100vh;min-height:100dvh;display:flex;flex-direction:column}
#app{flex:1;display:flex;flex-direction:column}
a{color:inherit}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
button{font:inherit;color:inherit}

/* En-tête : la guirlande de lampions */
.hd{position:relative;background:var(--nav);color:var(--nav-ink);padding:calc(88px + env(safe-area-inset-top)) 20px 34px;text-align:center;overflow:hidden}
.garland{position:absolute;left:0;right:0;top:env(safe-area-inset-top);width:100%;height:70px;color:rgba(245,239,227,.55);overflow:visible}
.garland .glow{fill:var(--lamp);opacity:.18}
.garland .body{fill:var(--lamp)}
.garland .l1 .body,.garland .l3 .body{fill:#C9673F}
.hd-in{position:relative;max-width:560px;margin:0 auto}
.kicker{margin:0;font-size:12px;letter-spacing:.16em;text-transform:uppercase;color:var(--lamp);font-weight:600}
.hd h1{font:800 clamp(34px,10vw,46px)/1 var(--display);letter-spacing:-.02em;margin:6px 0 0}
.sub{margin:10px auto 0;max-width:34ch;color:rgba(245,239,227,.82);font-size:15.5px}

.main{width:100%;max-width:600px;margin:-18px auto 0;padding:0 16px 24px;position:relative;flex:1}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:20px;box-shadow:var(--shadow);margin:0 0 16px}
.card h2{font:700 24px/1.15 var(--display);margin:0 0 8px}
.card p{margin:0}
.loading{display:flex;align-items:center;gap:10px;justify-content:center;color:var(--muted)}
.welcome p{font-size:17px}
.quiet{color:var(--muted)}
.back{display:inline-block;margin:0 0 10px;color:var(--nav-ink);text-decoration:none;font-weight:600;font-size:14px;position:relative;top:-6px;background:rgba(0,0,0,.18);padding:4px 10px;border-radius:99px}
.notice{margin:0 0 12px;padding:12px 16px;border-radius:var(--r);background:var(--lamp-soft);font-weight:600;text-align:center;box-shadow:var(--shadow)}

/* Accueil à tuiles (plusieurs fonctionnalités) */
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px}
.tile{display:flex;flex-direction:column;gap:4px;padding:18px;border-radius:var(--r);background:var(--card);border:1px solid var(--line);text-decoration:none;box-shadow:var(--shadow);min-height:44px}
.tile b{font:700 20px var(--display)}
.tile small{color:var(--muted)}
.ti svg{width:30px;height:30px;fill:none;stroke:var(--rust);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* En ce moment */
.now{display:flex;align-items:center;gap:14px;background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:12px;box-shadow:var(--shadow);margin:0 0 12px}
.now img{width:64px;height:64px;border-radius:10px;object-fit:cover;flex:none}
.now div{display:flex;flex-direction:column;min-width:0}
.now small{display:flex;align-items:center;gap:6px;font-size:11.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--rust)}
.now b{font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.now span{color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.eq{display:inline-flex;align-items:flex-end;gap:2px;height:11px}
.eq i{width:3px;background:var(--rust);border-radius:1px;animation:eq 1s ease-in-out infinite}
.eq i:nth-child(2){animation-delay:-.4s}.eq i:nth-child(3){animation-delay:-.7s}
@keyframes eq{0%,100%{height:3px}50%{height:11px}}

/* Recherche */
.search{position:sticky;top:calc(8px + env(safe-area-inset-top));z-index:5;display:flex;align-items:center;background:var(--card);border:2px solid var(--ink);border-radius:999px;padding:0 6px 0 16px;box-shadow:var(--shadow);margin:0 0 8px}
.search svg{width:20px;height:20px;fill:none;stroke:var(--muted);stroke-width:2;stroke-linecap:round;flex:none}
.search input{flex:1;min-width:0;border:0;background:transparent;color:var(--ink);font:500 17px var(--body);padding:15px 10px;outline:none;-webkit-appearance:none;appearance:none}
.search input::-webkit-search-cancel-button{display:none}
.search input::placeholder{color:var(--muted);opacity:.85}
.search:focus-within{box-shadow:0 0 0 4px color-mix(in srgb,var(--lamp) 55%,transparent),var(--shadow)}
.clear{width:40px;height:40px;border-radius:50%;border:0;background:var(--card2);font-size:22px;line-height:1;cursor:pointer;flex:none}
.quota{margin:0 4px 14px;font-size:13.5px;color:var(--muted);min-height:1em}
.quota.full{color:var(--rust);font-weight:600}

/* Listes de morceaux */
.rows{list-style:none;margin:0;padding:0;background:var(--card);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);overflow:hidden}
.row{display:flex;align-items:center;gap:12px;padding:10px 12px;border-top:1px solid var(--line);min-height:68px}
.row:first-child{border-top:0}
.results .row[data-pick]{cursor:pointer}
.results .row[data-pick]:active{background:var(--card2)}
.row img,.noimg{width:52px;height:52px;border-radius:8px;object-fit:cover;flex:none;background:var(--card2);display:block}
.rt{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.3}
.rt b{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rt span{color:var(--muted);font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rt small{font-size:12.5px;color:var(--muted)}
.rt .why{color:var(--rust)}
.row.off img{filter:grayscale(.8);opacity:.6}
.row.off .rt b{opacity:.7}
.add{width:46px;height:46px;border-radius:50%;border:0;background:var(--lamp);color:#23404F;flex:none;cursor:pointer;display:grid;place-items:center;box-shadow:0 2px 0 rgba(35,64,79,.25);transition:transform .1s}
.add:active{transform:scale(.92)}
.add svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round}
.add:focus-visible,.btn:focus-visible,.tile:focus-visible,.more:focus-visible{outline:3px solid var(--rust);outline-offset:2px}
.pill{flex:none;font-size:12px;font-weight:600;padding:4px 10px;border-radius:999px;white-space:nowrap;background:var(--card2);color:var(--muted)}
.pill.ok{background:var(--ok-soft);color:var(--ok)}
.pill.lamp{background:var(--lamp-soft);color:#6E4A12}
.pill.neg{background:var(--neg-soft);color:var(--neg)}
@media (prefers-color-scheme:dark){.pill.lamp{color:var(--lamp)}}
.more{display:block;width:100%;margin:10px 0 0;min-height:48px;border-radius:999px;border:1px solid var(--line);background:var(--card);font-weight:600;cursor:pointer}
.searching,.empty{display:flex;align-items:center;gap:10px;justify-content:center;color:var(--muted);text-align:center;padding:18px 8px;margin:0}
.empty.err{color:var(--neg)}
.block{margin:22px 0 0}
.block h2{font:700 20px var(--display);margin:0 0 10px 4px}
.block.hint p{margin:8px 4px 0;color:var(--muted);text-align:center;font-size:15px}

/* Jukebox fermé */
.closed{text-align:center;padding:28px 22px}
.closed p{color:var(--muted);max-width:36ch;margin:0 auto}
.vinyl{width:120px;height:120px;margin:4px auto 16px;border-radius:50%;background:radial-gradient(circle,var(--lamp) 0 16%,#2a2a2a 17% 19%,#111 20% 100%);box-shadow:inset 0 0 0 6px #1d1d1d,inset 0 0 0 14px #111,inset 0 0 0 15px #2a2a2a,inset 0 0 0 26px #111,inset 0 0 0 27px #2a2a2a,0 6px 18px rgba(0,0,0,.25)}

/* Fiche « Proposer » */
.sheet-w{position:fixed;inset:0;z-index:50;background:rgba(17,32,42,0);display:flex;align-items:flex-end;justify-content:center;transition:background .25s}
.sheet-w.on{background:rgba(17,32,42,.55)}
.sheet{width:100%;max-width:520px;background:var(--card);border-radius:22px 22px 0 0;padding:10px 20px calc(20px + env(safe-area-inset-bottom));transform:translateY(100%);transition:transform .25s ease-out}
.sheet-w.on .sheet{transform:none}
@media (min-width:600px){.sheet-w{align-items:center}.sheet{border-radius:22px}}
.grab{width:42px;height:5px;border-radius:9px;background:var(--line);margin:0 auto 16px}
.sh-track{display:flex;gap:16px;align-items:center;margin:0 0 18px}
.sh-track img,.sh-track .noimg{width:96px;height:96px;border-radius:12px;flex:none;object-fit:cover}
.sh-track div{display:flex;flex-direction:column;min-width:0}
.sh-track b{font:700 21px/1.2 var(--display)}
.sh-track span{color:var(--ink)}
.sh-track small{color:var(--muted);font-size:13px}
.sheet label{display:block;font-weight:600;margin:0 0 6px}
.sheet label small{font-weight:400;color:var(--muted)}
.sheet input{width:100%;font:16px var(--body);padding:13px 14px;border-radius:12px;border:1px solid var(--line);background:var(--bg);color:var(--ink);margin:0 0 16px}
.sheet input:focus{outline:2px solid var(--ink);outline-offset:1px}
.btn{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:52px;border-radius:999px;border:0;font:600 17px var(--body);cursor:pointer;background:var(--card2)}
.btn.primary{background:var(--ink);color:var(--bg)}
.btn.ghost{background:transparent;margin-top:6px;color:var(--muted)}
.btn:disabled{opacity:.7}

/* Notifications */
.toasts{position:fixed;left:12px;right:12px;bottom:calc(16px + env(safe-area-inset-bottom));z-index:60;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none}
.toast{max-width:480px;width:100%;padding:14px 18px;border-radius:14px;background:var(--ink);color:var(--bg);font-weight:600;box-shadow:0 10px 30px rgba(0,0,0,.25);animation:up .25s ease-out;transition:opacity .4s,transform .4s}
.toast.ok{background:var(--ok);color:#fff}
.toast.err{background:var(--neg);color:#fff}
.toast.out{opacity:0;transform:translateY(10px)}
@keyframes up{from{opacity:0;transform:translateY(12px)}}
.spin{width:18px;height:18px;border-radius:50%;border:2.5px solid currentColor;border-right-color:transparent;animation:spin .8s linear infinite;display:inline-block;flex:none}
@keyframes spin{to{transform:rotate(360deg)}}

.ft{text-align:center;color:var(--muted);font-size:13px;padding:8px 16px calc(24px + env(safe-area-inset-bottom))}
.ft p{margin:2px 0}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
