/* ─────────────────────────────────────────────
   drum-panel.css — panneau DRUMS BANK (src/ui/drum-panel.js, 2026-10-02).
   Même carcasse que le panneau SHARE BEAT (share-panel.css), en miroir à
   GAUCHE de la machine. Caché tant que html.sd-dp-open n'est pas posé.
   html.sd-dp-dock : collé à gauche de la machine (qui ne bouge pas) ; sinon
   tiroir par-dessus son bord gauche ; téléphone : plein écran.
   ───────────────────────────────────────────── */
.dp-panel {
  position: fixed; top: 10px; left: 12px; bottom: 10px;
  width: 340px; max-width: calc(100vw - 24px);
  z-index: 9999;   /* comme .sp-panel : > bulles (9998), < modale de compte (10000) */
  display: flex; flex-direction: column; gap: 8px;
  padding: 7px 10px 10px;
  background: linear-gradient(180deg, var(--surface-light, #cac6be) 0%, #bfbbb3 8%, var(--surface-light2, #b4b0a8) 100%);
  border: 1px solid var(--border-color, #52545c);
  border-radius: var(--border-radius-machine, 16px);
  box-shadow: 0 26px 70px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
  color: #d8d4cc;
  font-family: 'Share Tech Mono', 'OCR B', 'Courier New', monospace;
  font-size: 12px; letter-spacing: .04em;
  transform: translateX(calc(-100% - 24px));
  transition: transform .22s ease;
  visibility: hidden;
}
html.sd-dp-open .dp-panel { transform: none; visibility: visible; }
html.sd-dp-dock .dp-panel { transform: none; opacity: 0; transition: opacity .18s ease; }
html.sd-dp-dock.sd-dp-open .dp-panel { opacity: 1; }
.dp-panel button { font-family: inherit; cursor: pointer; }
html.sd-skin-dark .dp-panel {
  background: linear-gradient(180deg, var(--surface-light, #3e3f45) 0%, #393a40 8%, var(--surface-light2, #34353b) 100%);
}
html:not(.sd-skin-dark) .dp-panel { box-shadow: 0 26px 70px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.3); }
html:not(.sd-skin-dark) .dp-x { background: #dcd8d0; border-color: #a8a49e; color: #3a342a; }
html:not(.sd-skin-dark) .dp-filters button:not(.on) {
  background: linear-gradient(180deg, #e2ded6, #c9c5bd); border-color: #a8a49e; color: #3a342a;
  box-shadow: 0 2px 0 #969290;
}
html:not(.sd-skin-dark) .dp-filters button:not(.on):hover { border-color: #ff7a1a; color: #000; }
html:not(.sd-skin-dark) .dp-filters button:not(.on) .dp-n { color: #6a645a; }
/* Thème CLAIR : IN THE MIX dans le gris du panneau du haut de la machine
   (.top = --surface-mid), vert plus foncé pour rester lisible. */
html:not(.sd-skin-dark) .dp-mix {
  background: var(--surface-mid, #a8a49c);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.18);
}
html:not(.sd-skin-dark) .dp-mix-cap { color: #17692f; }
html:not(.sd-skin-dark) .dp-mix.silent .dp-mix-cap { color: #5a544a; }
html:not(.sd-skin-dark) .dp-mix.silent .dp-mix-cap .dp-led { background: #8a867e; }
html:not(.sd-skin-dark) .dp-chip { background: rgba(47,170,90,.2); border-color: #23894a; color: #10501f; }
html:not(.sd-skin-dark) .dp-chip:hover { background: rgba(47,170,90,.34); color: #08300f; }
html:not(.sd-skin-dark) .dp-mix-sum { color: #4a453c; }
html:not(.sd-skin-dark) .dp-mix-none { color: #9a2a14; }

/* Bouton DRUMS BANK de la machine allumé tant que le panneau est ouvert. */
#drumbank-btn.dp-on { outline: 2px solid var(--accent-light, #ffaa44); outline-offset: 1px; }

.dp-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 2px; }
.dp-title { font-size: 17px; letter-spacing: .26em; color: var(--accent, #ff7a1a); }
.dp-title b { color: var(--text-primary, #eeede8); font-weight: 700; }
.dp-x {
  width: 26px; height: 26px; border-radius: 50%;
  background: #2a2c31; border: 1px solid #3a3d43; color: #ccc; font-size: 12px;
}
.dp-x:hover { color: #fff; border-color: #ff7a1a; }

/* Panneaux encastrés (comme le compartiment SAMPLER de la machine). */
.dp-mix, .dp-kits {
  background: #0f1012; border: 1px solid var(--border-color, #52545c);
  border-radius: var(--border-radius-panel, 10px);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.5);
}

/* Diode rouge — même pastille que les boutons ACTIVE de la machine. */
.dp-led {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: #cc2200; box-shadow: 0 0 5px #ff3300; margin-right: 7px; vertical-align: 1px;
}

/* ── IN THE MIX ── */
.dp-mix { padding: 9px 11px 10px; display: flex; flex-direction: column; gap: 7px; }
/* Vert = « dans le mix » partout dans le panneau (demande user 2026-10-02) ;
   l'orange reste pour les actions (ADD TO MIX, filtres). */
.dp-mix-cap { display: flex; align-items: center; color: #7fe39c; font-size: 10px; font-weight: 700; letter-spacing: .2em; }
.dp-led.go { background: #2fd864; box-shadow: 0 0 6px #3fff7a; }
/* Sur fond vert (badge, bouton) : diode blanche, sinon invisible. */
.dp-state.on .dp-led, .dp-act.on .dp-led { background: #f2fff5; box-shadow: 0 0 5px #fff; }
.dp-mix.silent .dp-mix-cap .dp-led { background: #24302a; box-shadow: none; }
.dp-mix.silent .dp-mix-cap { color: #8a857c; }
.dp-mix-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.dp-chip {
  height: 24px; padding: 0 10px; border-radius: 12px;
  background: rgba(63,191,106,.14); border: 1px solid #3fbf6a; color: #9ff0b6;
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.dp-chip:hover { background: rgba(63,191,106,.28); color: #fff; }
.dp-mix-none { color: #ff8a6a; font-size: 11px; letter-spacing: .06em; }
.dp-mix-sum { color: #8a857c; font-size: 10px; letter-spacing: .14em; }

/* ── Filtre ALL / BOOM BAP / TRAP (touches façon machine) ── */
.dp-filters { display: flex; flex-wrap: wrap; gap: 6px; }   /* ALL pleine largeur en haut, les 4 styles en grille 2x2 dessous (meme taille) */
.dp-filters button.dp-f-all { flex: 1 0 100%; }
.dp-filters button:not(.dp-f-all) { flex: 1 1 calc(50% - 3px); }
.dp-filters button {
  flex: 1; height: 30px; border-radius: 4px; padding: 0 6px;
  background: #26282c; border: 1px solid #3a3d43; color: #cfcac0;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; white-space: nowrap;
}
.dp-filters button:hover { border-color: #ff7a1a; color: #fff; }
.dp-filters button.on { background: #ff7a1a; border-color: #ff7a1a; color: #1b1c1f; }
.dp-n { font-size: 9.5px; opacity: .7; margin-left: 3px; }
/* Couleur par style (mêmes teintes que les badges des cartes) :
   BOOM BAP orange, TRAP violet, LOFI rose, ELECTRO cyan ; ALL neutre pour ne
   pas se confondre avec BOOM BAP. Éteint = barre de couleur sous le libellé. */
.dp-f-all     { --sc: #e6e2da; --sc-ink: #1b1c1f; }
.dp-f-boombap { --sc: #ff8a1f; --sc-ink: #1f1000; }
.dp-f-trap    { --sc: #9b5cff; --sc-ink: #fff; }
.dp-f-lofi    { --sc: #ff5fa8; --sc-ink: #fff; }
.dp-f-electro { --sc: #1fd6e8; --sc-ink: #00252a; }
.dp-filters button[class*="dp-f-"]:not(.on) { box-shadow: inset 0 -3px 0 var(--sc); }
.dp-filters button[class*="dp-f-"]:not(.dp-f-all):not(.on) { color: var(--sc); }
.dp-filters button[class*="dp-f-"]:hover { border-color: var(--sc); }
.dp-filters button[class*="dp-f-"].on { background: var(--sc); border-color: var(--sc); color: var(--sc-ink); }
html:not(.sd-skin-dark) .dp-filters button[class*="dp-f-"]:not(.on) { box-shadow: 0 2px 0 #969290, inset 0 -3px 0 var(--sc); color: #3a342a; }
html:not(.sd-skin-dark) .dp-filters button[class*="dp-f-"]:not(.on):hover { border-color: var(--sc); color: #000; }
html:not(.sd-skin-dark) .dp-filters button.dp-f-all { --sc: #3a342a; --sc-ink: #fff; }

/* ── Liste des kits ── */
.dp-kits { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background-color: #23252d; }
.dp-list {
  flex: 1; min-height: 0; overflow-y: auto; padding: 10px 9px 4px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin; scrollbar-color: #4a4d55 transparent;
}
.dp-list:hover { scrollbar-color: #ff7a1a transparent; }
.dp-list::-webkit-scrollbar { width: 6px; }
.dp-list::-webkit-scrollbar-track { background: transparent; }
.dp-list::-webkit-scrollbar-thumb { background: #4a4d55; border-radius: 3px; }
.dp-list::-webkit-scrollbar-thumb:hover { background: #ff7a1a; }
.dp-empty { padding: 18px 8px; color: #8a857c; line-height: 1.6; }
.dp-foot {
  flex: none; padding: 8px 12px 10px; border-top: 1px solid rgba(255,255,255,.06);
  color: #7d786f; font-size: 10px; line-height: 1.5; letter-spacing: .03em;
}

/* ── Carte d'un kit ── */
.dp-card {
  flex: none; border-radius: 9px; overflow: hidden;
  background: #17181c; border: 1px solid #34363d;
  transition: border-color .15s, box-shadow .15s;
}
.dp-card:hover { border-color: #4a4d56; }
.dp-card.active { border-color: #3fbf6a; box-shadow: 0 0 0 1px rgba(63,191,106,.35), 0 0 18px rgba(63,191,106,.2); }
.dp-card.soon { filter: grayscale(.85); opacity: .55; }
.dp-card.flash { animation: dpFlash .9s ease; }
@keyframes dpFlash { 0%, 100% { box-shadow: 0 0 0 1px rgba(63,191,106,.35), 0 0 18px rgba(63,191,106,.2); } 35% { box-shadow: 0 0 0 3px #7fe39c, 0 0 28px rgba(63,191,106,.6); } }

/* Pochette : image plein cadre, nom en surimpression sur un dégradé. */
.dp-cover { position: relative; height: 118px; background: #2a221a; overflow: hidden; }
.dp-cover img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .25s ease, transform .4s ease;
}
.dp-cover.loaded img { opacity: 1; }
.dp-card:hover .dp-cover img { transform: scale(1.03); }
.dp-cover-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; opacity: .35; }
.dp-cover::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 34%, rgba(0,0,0,0) 48%, rgba(10,10,12,.92) 100%);
}
.dp-card.locked .dp-cover img { filter: saturate(.55) brightness(.8); }
.dp-name {
  position: absolute; left: 10px; right: 10px; bottom: 7px; z-index: 1;
  display: flex; flex-direction: column; gap: 2px;
}
.dp-name-txt {
  color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .14em; line-height: 1.15;
  text-shadow: 0 1px 6px rgba(0,0,0,.8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dp-card.active .dp-name-txt { color: #b6ffc9; }
.dp-editors { color: #ffaa44; font-size: 9px; letter-spacing: .16em; }
.dp-style, .dp-state {
  position: absolute; top: 7px; z-index: 1;
  height: 19px; display: inline-flex; align-items: center; padding: 0 7px; border-radius: 3px;
  font-size: 9px; font-weight: 700; letter-spacing: .16em; white-space: nowrap;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.dp-style { left: 7px; background: rgba(15,16,18,.72); border: 1px solid rgba(255,255,255,.22); color: #e8e3da; }
.dp-style-boombap { background: rgba(255,138,31,.94); border-color: #ffb066; color: #1f1000; }
.dp-style-trap    { background: rgba(155,92,255,.94); border-color: #c9a8ff; color: #fff; }
.dp-style-lofi    { background: rgba(255,95,168,.94); border-color: #ffa6cf; color: #fff; }
.dp-style-electro { background: rgba(31,214,232,.94); border-color: #8eeaf4; color: #00252a; }
.dp-state { right: 7px; background: rgba(15,16,18,.72); border: 1px solid rgba(255,255,255,.18); color: #cfcac0; }
.dp-state.on { background: rgba(47,170,90,.92); border-color: #7fe39c; color: #0c1f12; }
.dp-state.on .dp-led { margin-right: 5px; }

.dp-body { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 8px; }

/* ADN sonore : 6 colonnes façon vumètre. */
.dp-dna { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.dp-dna-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.dp-dna-cell b { color: #ffaa44; font-size: 13px; line-height: 1; font-weight: 700; }
.dp-dna-cell i {
  display: block; width: 100%; height: 3px; border-radius: 2px; background: #2c2e34; position: relative; overflow: hidden;
}
.dp-dna-cell i::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: calc(var(--f, 0) * 100%); background: linear-gradient(90deg, #c85a0e, #ffaa44);
}
.dp-dna-cell span { color: #7d786f; font-size: 8.5px; letter-spacing: .08em; }
.dp-meta { color: #8a857c; font-size: 10px; letter-spacing: .14em; text-align: center; }

/* Pré-écoute : mini pads façon MPC. */
.dp-preview { display: flex; align-items: center; gap: 5px; }
/* Libellé + pads éclaircis (2026-10-10, « trop gris, on le lit mal ») :
   orange = action, comme le reste du panneau. */
.dp-preview-cap { flex: none; color: #ffaa44; font-size: 9.5px; font-weight: 700; letter-spacing: .16em; margin-right: 1px; }
.dp-pad {
  flex: 1; min-width: 0; height: 32px; border-radius: 5px; padding: 0 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: linear-gradient(180deg, #3a3c42, #2c2e33);
  border: 1px solid rgba(255,122,26,.45); box-shadow: 0 2px 0 #121316, inset 0 1px 0 rgba(255,255,255,.08);
  color: #f4f1ea; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.dp-pad:hover { border-color: #ff7a1a; background: linear-gradient(180deg, #44403a, #33302c); }
.dp-pad:active { transform: translateY(1px); box-shadow: 0 1px 0 #121316; }
.dp-pad-lbl { font-size: 9.5px; font-weight: 700; letter-spacing: .1em; }
.dp-pad-n { font-size: 8.5px; color: #c4bdb1; min-height: 9px; line-height: 9px; }
.dp-pad.hit { animation: dpHit .35s ease-out; }
.dp-pad.wait .dp-pad-n { color: #ffaa44; }
@keyframes dpHit {
  0% { background: #ff7a1a; border-color: #ffaa44; color: #1b1c1f; box-shadow: 0 0 14px rgba(255,122,26,.7); }
  100% { }
}

/* Bouton principal. */
.dp-act {
  height: 34px; border-radius: 5px; width: 100%;
  font-size: 11px; font-weight: 700; letter-spacing: .14em;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.1); color: #6f6a62;
}
.dp-act:disabled { cursor: default; }
.dp-act.add { background: rgba(255,122,26,.08); border-color: rgba(255,122,26,.55); color: #ffaa44; }
.dp-act.add:hover { background: #3a2a14; border-color: #ff7a1a; color: #ffc27a; box-shadow: 0 0 12px rgba(255,122,26,.35); }
.dp-act.on {
  border-color: #7fe39c; color: #0c1f12;
  background: linear-gradient(180deg, #5fd889, #2a9a52); box-shadow: 0 0 10px rgba(63,191,106,.4);
}
.dp-act.on .dp-act-off { display: none; }
.dp-act.on:hover { background: #2a1512; border-color: #a0402a; color: #ff8a6a; box-shadow: none; }
.dp-act.on:hover .dp-act-on { display: none; }
.dp-act.on:hover .dp-act-off { display: inline; }
.dp-act.acct { background: rgba(255,122,26,.12); border-color: #ffaa44; color: #ffaa44; letter-spacing: .08em; }
.dp-act.acct:hover { background: #3a2a14; color: #ffc27a; }
.dp-act.busy { color: #ffaa44; border-color: rgba(255,122,26,.4); cursor: wait; }

/* ── Kits PAYANTS ── */
.dp-state.price { background: #ff7a1a; border-color: #c85500; color: #120800; font-size: 11.5px; font-weight: 800; letter-spacing: .05em; }
.dp-state.owned { background: rgba(15,16,18,.78); border-color: rgba(127,227,156,.6); color: #9ff0b6; }
.dp-card.paid { border-color: rgba(255,122,26,.45); }
.dp-card.paid:hover { border-color: rgba(255,122,26,.8); }
/* BUY : touche pleine orange machine, texte noir (contraste ~7:1), pas de dégradé ni de halo. */
.dp-act.buy {
  height: 38px; background: #ff7a1a; border: 1px solid #c85500; color: #120800;
  font-size: 12.5px; font-weight: 800; letter-spacing: .05em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 2px 0 #8a3a00;
}
.dp-act.buy:hover { background: #ff8f3a; }
.dp-act.buy:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 0 #8a3a00; }
.dp-act.buy:disabled { opacity: .75; background: rgba(255,122,26,.14); border-color: rgba(255,122,26,.55); color: #ffaa44; box-shadow: none; transform: none; }
.dp-dl {
  height: 26px; border-radius: 5px; width: 100%;
  background: none; border: 1px dashed rgba(127,227,156,.45); color: #9ff0b6;
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
}
.dp-dl:hover { border-style: solid; background: rgba(63,191,106,.1); }
.dp-dl:disabled { cursor: wait; opacity: .8; }
/* Kit payant pas encore acheté : le téléchargement WAV montré GRISÉ au-dessus de BUY (= inclus à l'achat). */
.dp-dl.locked, .dp-dl.locked:hover { cursor: default; border: 1px dashed rgba(255,255,255,.22); color: #8f8a82; background: none; }

/* Cadre étroit (240–300 px, collé à la machine sur un écran ~1440 px). */
.dp-panel.dp-narrow { padding: 6px 7px 8px; }
.dp-narrow .dp-title { font-size: 15px; letter-spacing: .2em; }
.dp-narrow .dp-list { padding: 8px 6px 4px; }
.dp-narrow .dp-filters button { letter-spacing: .06em; font-size: 10px; }
.dp-narrow .dp-cover { height: 100px; }
.dp-narrow .dp-name-txt { font-size: 14px; letter-spacing: .1em; }
.dp-narrow .dp-preview-cap { display: none; }
.dp-narrow .dp-act { letter-spacing: .06em; font-size: 10px; }
.dp-narrow .dp-dl { letter-spacing: .06em; }

/* Téléphone : plein écran (aucun défilement horizontal). */
html.sd-mobile .dp-panel {
  top: 0; left: 0; bottom: 0; width: 100vw; max-width: 100vw;
  border: none; border-radius: 0;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
}
html.sd-mobile .dp-list { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); }

/* Extraits de patterns (kits avec PREVIEW/*.mp3) : le pad qui joue reste allumé. */
.dp-demo-pad.playing {
  background: linear-gradient(180deg, #ff8a2a, #e0640f); border-color: #ffaa44; color: #1b1c1f;
  box-shadow: 0 2px 0 #7a3608, 0 0 12px rgba(255,122,26,.55);
}
.dp-demo-pad.playing .dp-pad-n { color: #3a1c06; }

/* Pochette avec le nom du kit DESSINÉ dedans (manifest `coverTitle`) :
   - ratio fixe 8:3 (format des pochettes, 1024x384) au lieu de la hauteur
     fixe → l'image est toujours entière, le titre jamais rogné (tiroir
     étroit comme plein écran mobile) ;
   - ni dégradé ni nom incrusté par-dessus (doublon du titre dessiné) ; le
     nom reste lisible par les lecteurs d'écran ;
   - le badge de style passe en bas à droite pour ne pas masquer le titre,
     la mention éditeurs se range juste au-dessus. */
.dp-card .dp-cover.dp-titled { height: auto; aspect-ratio: 1024 / 384; }
.dp-card .dp-cover.dp-titled::after { display: none; }
.dp-card .dp-cover.dp-titled .dp-name-txt {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.dp-card .dp-cover.dp-titled .dp-name { left: auto; right: 7px; bottom: 31px; align-items: flex-end; }
.dp-card .dp-cover.dp-titled .dp-editors {
  background: rgba(15,16,18,.78); padding: 3px 6px; border-radius: 3px;
}
.dp-card .dp-cover.dp-titled .dp-style { left: auto; top: auto; right: 7px; bottom: 7px; }
