:root{--bg:#12141c;--bg2:#1a1d29;--bg3:#222636;--fg:#e8eaf2;--dim:#8b90a5;--acc:#e8457a;--acc2:#7c5cff;--r:10px}
*{box-sizing:border-box;margin:0}
a{color:inherit;text-decoration:none}
html,body{height:100%;overflow:hidden}
body{background:var(--bg);color:var(--fg);font:15px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif;display:flex;flex-direction:column}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
input{font:inherit;color:var(--fg);background:var(--bg3);border:1px solid transparent;border-radius:8px;padding:.45em .7em;outline:none}
input:focus{border-color:var(--acc2)}
.dim{color:var(--dim)}
.ic{font-size:1.15em;padding:.35em;border-radius:8px;opacity:.85}
.ic:hover{background:var(--bg3);opacity:1}
.spin{animation:sp 1s linear infinite}@keyframes sp{to{transform:rotate(360deg)}}

.top{display:flex;align-items:center;gap:10px;padding:8px 12px;background:var(--bg2);border-bottom:1px solid #0003;flex-wrap:wrap}
.logo{font-weight:700;font-size:1.1em;display:flex;align-items:center;gap:6px}
.logo img{width:24px;height:24px;border-radius:6px}
.login-logo{width:56px;height:56px;border-radius:14px;vertical-align:-16px}
.tabs{display:flex;gap:4px}
.tab{padding:.4em .9em;border-radius:8px;color:var(--dim)}
.tab.on{background:var(--bg3);color:var(--fg);font-weight:600}
.badge{background:var(--acc);color:#fff;border-radius:10px;padding:0 .45em;font-size:.75em;margin-left:.3em}
.dl-live{display:flex;flex-direction:column;gap:.35em;padding:.5em 0}
.prog{height:6px;background:var(--bg3);border-radius:3px;overflow:hidden}
.prog i{display:block;height:100%;background:var(--acc);transition:width .5s}
.pulse{display:inline-block;animation:pl 1s infinite}
@keyframes pl{50%{opacity:.3}}
#shuf.on{color:var(--acc)}
.tk-cov{width:32px;height:32px;flex:none;border-radius:4px;background:var(--bg3);display:grid;place-items:center;overflow:hidden}
.tk-cov img,#np-art img{width:100%;height:100%;object-fit:cover}
#np-art{overflow:hidden}
.top-act{margin-left:auto;display:flex;gap:6px;align-items:center}
#q{width:150px}

#main{flex:1;overflow-y:auto;padding:6px 0 8px}
.view{display:none}.view.on{display:block}
ul{list-style:none;padding:0}
.tracks li,.pl li{display:flex;align-items:center;gap:8px;padding:7px 12px;border-radius:8px;cursor:pointer}
.tracks li:hover,.pl li:hover{background:var(--bg2)}
.tk-play{opacity:.4;font-size:.85em}
.tk-more,.tk-up,.tk-dn{display:none}
#tracks.inpl .tk-up,#tracks.inpl .tk-dn{display:inline-block}
#sleep.on{color:var(--acc)}
.tracks li.on{background:var(--bg2)}
.tracks li.on .tk-play{opacity:1;color:var(--acc);animation:pl 1.2s infinite}
#sort{width:auto;padding:.35em .5em}
.lib-head{display:flex;gap:8px;justify-content:space-between}
.tracks li:hover .tk-play{opacity:1;color:var(--acc)}
.tk-t{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.25}
.tk-t b,.pl-n b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tk-t i,.pl-n i{font-style:normal;font-size:.85em}
.pl-n{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.25}
.pl-open{background:var(--bg3);padding:.35em .8em;border-radius:8px}
.pl-open:hover{background:var(--acc2)}
.empty{padding:30px;text-align:center;display:block}
.pl-head{padding:8px 12px}

#bar{background:var(--bg2);border-top:1px solid #0003;padding:8px 12px calc(8px + env(safe-area-inset-bottom))}
.np{display:flex;align-items:center;gap:10px;margin-bottom:4px}
.art{width:38px;height:38px;border-radius:8px;background:var(--bg3);display:grid;place-items:center;font-size:1.2em}
.np-t{flex:1;min-width:0}
#np-title{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#np-artist{font-size:.85em}
.ctl{display:flex;align-items:center;gap:8px}
.big{font-size:0;background:var(--acc);border-radius:50%;width:44px;height:44px;display:grid;place-items:center;color:#fff;box-shadow:0 4px 14px rgba(232,69,122,.4);transition:transform .12s,box-shadow .2s}
.big:active{transform:scale(.9);box-shadow:0 2px 6px rgba(232,69,122,.5)}
.big::before{content:'';width:18px;height:18px;margin-left:1px;background:#fff;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") center/contain no-repeat}
.big.pause::before{margin-left:0;
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='5' width='14' height='14' rx='2'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='5' width='14' height='14' rx='2'/%3E%3C/svg%3E")}
#seek{flex:1;accent-color:var(--acc)}
#vol{width:80px;accent-color:var(--acc2)}
#time{font-size:.8em;min-width:80px;text-align:center}

.pop{position:fixed;z-index:50;background:var(--bg3);border-radius:var(--r);box-shadow:0 8px 30px #000a;max-height:60vh;overflow-y:auto;display:flex;flex-direction:column;min-width:200px}
.pop button{text-align:left;padding:.55em .9em}
.pop button:hover,.pop button.on{background:var(--acc2)}
.pop h3{padding:.6em .9em .3em;font-size:.8em;color:var(--dim)}
#queue{top:auto;bottom:96px;right:8px;display:none}
#queue.on{display:flex}

.mw{position:fixed;inset:0;background:#000a;display:grid;place-items:center;z-index:60}
.modal{background:var(--bg2);border-radius:var(--r);padding:18px;width:min(360px,92vw);display:flex;flex-direction:column;gap:12px}
.mact{display:flex;gap:8px;justify-content:flex-end}
.mact .ok{background:var(--acc);color:#fff;padding:.4em 1em;border-radius:8px}
.mact .cancel{padding:.4em 1em;border-radius:8px;background:var(--bg3)}

#toasts{position:fixed;bottom:110px;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;gap:6px;z-index:70;pointer-events:none}
.toast{background:var(--bg3);padding:.5em 1em;border-radius:20px;box-shadow:0 4px 16px #0008;font-size:.9em}

.login{display:grid;place-items:center}
.login-card{background:var(--bg2);padding:28px;border-radius:var(--r);display:flex;flex-direction:column;gap:14px;width:min(320px,92vw)}
.login-card h1{text-align:center}
.login-card button{background:var(--acc);color:#fff;padding:.5em;border-radius:8px;font-weight:600}
.err{color:#ff6b8a;font-size:.9em;text-align:center}

@media (max-width:600px){#vol{display:none}#q{width:110px}#time{min-width:60px}}

/* Mobile (Pixel 8a ~412px) : cibles tactiles, header compact, seek utilisable au pouce */
@media (max-width:480px){
  body{overscroll-behavior:none}
  button{-webkit-tap-highlight-color:transparent;touch-action:manipulation}
  .top{gap:6px;padding:7px 10px 8px}
  .logo{order:1;font-style:normal}
  .logo i{display:none}
  .tabs{order:2;flex:1}
  .tab{padding:.45em .55em;font-size:.88em;white-space:nowrap}
  .top-act{order:3;width:100%;margin-left:0;gap:4px}
  #q{flex:1;width:0;min-width:0}
  .ic{padding:.5em}
  .tracks li,.pl li{padding:11px 10px;gap:8px}
  .tk-cov{width:40px;height:40px}
  .tk-t b,.pl-n b{font-size:1em}
  .tk-t i,.pl-n i{font-size:.8em}
  .tracks .ic,.pl .ic{padding:.45em}
  .tk-add,.tk-ren,.tk-del,.tk-up,.tk-dn,.tk-queue{display:none !important}
  .tk-more{display:inline-block;font-size:1.3em}
  .pl-open{padding:.5em .7em}
  .pl-head{padding:8px 10px}
  #bar{padding:8px 10px calc(10px + env(safe-area-inset-bottom))}
  .art{width:44px;height:44px}
  .ctl{gap:6px}
  .big{width:52px;height:52px;font-size:1.6em}
  #seek{height:28px}
  #time{min-width:0;font-size:.72em;white-space:nowrap}
  #queue{bottom:112px;left:8px}
  .modal{width:calc(100vw - 32px)}
  #toasts{bottom:120px;left:8px;right:8px;transform:none}
  .toast{text-align:center}
}
