/* ─────────────────────────────────────────────
   profile-panel.css — panneau PROFIL (src/ui/profile-panel.js, 2026-10-04).
   Même carcasse que DRUMS BANK (drum-panel.css), à GAUCHE de la machine, même
   place : ouvrir l'un ferme l'autre. Caché tant que html.sd-pp-open n'est pas
   posé. html.sd-pp-dock : collé à gauche de la machine (qui ne bouge pas) ;
   sinon tiroir par-dessus son bord gauche ; téléphone : plein écran.
   ───────────────────────────────────────────── */
.pp-panel {
  position: fixed; top: 10px; left: 12px; bottom: 10px;
  width: 340px; max-width: calc(100vw - 24px);
  z-index: 9999;   /* comme .dp-panel / .sp-panel : > bulles (9998) */
  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-pp-open .pp-panel { transform: none; visibility: visible; }
html.sd-pp-dock .pp-panel { transform: none; opacity: 0; transition: opacity .18s ease; }
html.sd-pp-dock.sd-pp-open .pp-panel { opacity: 1; }
.pp-panel button { font-family: inherit; cursor: pointer; }
html.sd-skin-dark .pp-panel {
  background: linear-gradient(180deg, var(--surface-light, #3e3f45) 0%, #393a40 8%, var(--surface-light2, #34353b) 100%);
}
html:not(.sd-skin-dark) .pp-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) .pp-x { background: #dcd8d0; border-color: #a8a49e; color: #3a342a; }

/* Bouton PROFIL du header allumé tant que le panneau est ouvert. */
#account-btn.pp-on { outline: 2px solid var(--accent-light, #ffaa44); outline-offset: 1px; }

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

/* Colonne défilante : tout le contenu sous l'en-tête. */
.pp-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 8px; padding-right: 2px;
  scrollbar-width: thin; scrollbar-color: #4a4d55 transparent;
}
.pp-scroll:hover { scrollbar-color: #ff7a1a transparent; }
.pp-scroll::-webkit-scrollbar { width: 6px; }
.pp-scroll::-webkit-scrollbar-track { background: transparent; }
.pp-scroll::-webkit-scrollbar-thumb { background: #4a4d55; border-radius: 3px; }
.pp-scroll::-webkit-scrollbar-thumb:hover { background: #ff7a1a; }

/* Compartiments encastrés (comme IN THE MIX de DRUMS BANK). */
.pp-card, .pp-sec {
  flex: none;
  background: #17181c; 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);
}
.pp-sec { padding: 9px 11px 11px; }
.pp-cap {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 8px; color: #c4beb2; font-size: 10.5px; font-weight: 700; letter-spacing: .2em;
}
.pp-badge-n { color: #ffaa44; letter-spacing: .1em; }

/* ── Carte d'identité ── */
.pp-card { padding: 12px 12px 8px; }
.pp-id { display: flex; align-items: center; gap: 12px; }
.pp-avatar {
  flex: none; width: 76px; height: 76px; border-radius: 50%;
  background: #fff; border: 3px solid rgba(255,122,26,.45);
  box-shadow: 0 0 18px rgba(255,122,26,.3), 0 6px 14px rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pp-avatar img { height: 62px; width: auto; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.pp-id-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pp-name {
  width: 100%; box-sizing: border-box; min-width: 0;
  background: transparent; border: 0; border-bottom: 1px dashed rgba(255,148,64,.4);
  border-radius: 0; padding: 2px 0 3px; outline: none;
  color: #fff; font-family: inherit; font-size: 19px; font-weight: 700; letter-spacing: .06em;
  text-overflow: ellipsis;
}
.pp-name::placeholder { color: #6a645a; font-weight: 400; }
.pp-name:hover { border-bottom-color: rgba(255,148,64,.8); }
.pp-name:focus { border-bottom: 1px solid #ff9440; }
.pp-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.pp-member {
  height: 26px; display: inline-flex; align-items: center; padding: 0 11px; border-radius: 5px;
  background: linear-gradient(180deg, #ffb255, #ff7a1a); border: 1px solid #ffd09a; color: #000;
  font-size: 16px; font-weight: 400; letter-spacing: .14em; -webkit-font-smoothing: antialiased; cursor: help;
  box-shadow: 0 0 10px rgba(255,122,26,.35), inset 0 1px 0 rgba(255,255,255,.35);
}
.pp-grade {
  height: 20px; display: inline-flex; align-items: center; padding: 0 9px; border-radius: 999px;
  background: rgba(255,122,26,.13); border: 1px solid rgba(255,122,26,.38);
  color: var(--accent-light, #ffaa44); font-size: 9.5px; font-weight: 700; letter-spacing: .18em; cursor: help;
}
.pp-since { color: #bdb7ab; font-size: 10px; letter-spacing: .16em; min-height: 11px; }
.pp-gauge { margin: 8px 2px 0; }
.pp-narrow .pp-gauge { zoom: .84; }

/* ── STATS ── */
.pp-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; }
.pp-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 4px 6px; border-radius: 7px; cursor: help;
  background: #1f2025; border: 1px solid #2f3137;
}
.pp-stat-ico { display: block; width: 22px; height: 22px; line-height: 0; }
.pp-stat-ico svg, .pp-badge-ico svg { width: 100%; height: 100%; display: block; }
.pp-stat-val { color: #ffaa44; font-size: 17px; line-height: 1.15; font-weight: 700; letter-spacing: .04em; }
.pp-stat-lbl { color: #c9c3b7; font-size: 9px; letter-spacing: .12em; white-space: nowrap; }
.pp-usage { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; cursor: help; }
.pp-usage-cap { color: #9ff0b6; font-size: 9.5px; font-weight: 700; letter-spacing: .16em; margin-bottom: 1px; }
.pp-usage-none { color: #c4beb2; font-size: 10px; line-height: 1.5; }
.pp-usage-row { display: flex; align-items: center; gap: 7px; }
.pp-usage-lbl { flex: none; width: 86px; color: #d4cec2; font-size: 9.5px; letter-spacing: .1em; }
.pp-usage-bar { flex: 1; height: 5px; border-radius: 3px; background: #2c2e34; position: relative; overflow: hidden; }
.pp-usage-bar::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: calc(var(--f, 0) * 100%); background: linear-gradient(90deg, #c85a0e, #ffaa44);
}
.pp-usage-pct { flex: none; width: 30px; text-align: right; color: #cfcac0; font-size: 9.5px; }

/* ── BADGES ── */
.pp-badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pp-narrow .pp-badges { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); }
.pp-badge {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px;
  padding: 7px 2px 6px; border-radius: 8px; min-width: 0; cursor: help; text-align: center;
  background: #1c1d21; border: 1px solid #2a2c32; opacity: .92;
}
.pp-badge-ico { width: 30px; height: 30px; line-height: 0; }
.pp-badge-name { color: #cfc9bd; font-size: 8.5px; line-height: 1.25; letter-spacing: .08em; font-weight: 700; word-break: break-word; }
.pp-badge-prog { color: #ffc27a; font-size: 9.5px; letter-spacing: .06em; }
.pp-badge.on {
  opacity: 1; border-color: rgba(255,194,58,.55);
  background: linear-gradient(180deg, rgba(255,194,58,.14), rgba(255,122,26,.06));
  box-shadow: 0 0 10px rgba(255,170,68,.18);
}
.pp-badge.on .pp-badge-ico { filter: none; opacity: 1; }
.pp-badge:not(.on) .pp-badge-ico { filter: grayscale(.9) brightness(.9); }
.pp-badge-ico { display: inline-flex; align-items: center; justify-content: center; }
/* Chat en OR : le chat de la mascotte passé en gris puis teinté or, avec un halo. */
.pp-gold {
  height: 30px; width: auto; object-fit: contain;
  filter: grayscale(1) sepia(1) saturate(6) hue-rotate(-12deg) brightness(1.18) contrast(1.05) drop-shadow(0 0 5px rgba(255,200,60,.75));
}
.pp-badge.on .pp-badge-name { color: #ffd77a; }
.pp-badge.new { animation: ppBadgeNew 1.4s ease-out 3; }
@keyframes ppBadgeNew {
  0%, 100% { box-shadow: 0 0 10px rgba(255,170,68,.18); }
  40% { box-shadow: 0 0 0 3px #ffd77a, 0 0 24px rgba(255,194,58,.75); }
}

/* ── MY BEATS ── */
.pp-beats { display: flex; flex-direction: column; gap: 5px; }
.pp-beat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  padding: 7px 10px; border-radius: 7px; text-align: left;
  background: #1f2025; border: 1px solid #2f3137; color: #d8d4cc;
}
.pp-beat:hover { border-color: #ff7a1a; }
.pp-beat:hover .pp-beat-title { color: #ffc27a; text-decoration: underline; }
.pp-beat-title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 700; letter-spacing: .05em; color: #ffaa44; line-height: 1.2; }
.pp-beat-meta { color: #d4cec2; font-size: 13px; letter-spacing: .06em; }
.pp-more { color: #c4beb2; font-size: 9.5px; letter-spacing: .1em; padding: 2px 2px 0; }
.pp-empty { color: #c4beb2; font-size: 11px; line-height: 1.55; }

/* ── MY KITS ── */
.pp-kit-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pp-kit {
  display: flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 4px 9px 4px 4px; border-radius: 8px; cursor: help;
  border: 1px solid rgba(127,227,156,.45); background: rgba(63,191,106,.1);
  color: #9ff0b6; font-size: 10px; font-weight: 700; letter-spacing: .1em;
}
.pp-kit img { width: 26px; height: 26px; object-fit: cover; border-radius: 5px; flex: none; }
.pp-kit span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-link {
  margin-top: 8px; height: 28px; width: 100%; border-radius: 5px;
  background: rgba(255,122,26,.08); border: 1px solid rgba(255,122,26,.55); color: #ffaa44;
  font-size: 10px; font-weight: 700; letter-spacing: .14em;
}
.pp-link:hover { background: #3a2a14; border-color: #ff7a1a; color: #ffc27a; }
.pp-kit-chips + .pp-link { margin-top: 0; }
/* Kit payant en vente, pas encore acheté : mini-carte cliquable → DRUMS BANK sur le kit. */
.pp-promo {
  display: block; width: 100%; padding: 0; margin-bottom: 8px; overflow: hidden; text-align: left;
  border-radius: 8px; border: 1px solid rgba(255,122,26,.55); background: #17181c; cursor: pointer;
  font-family: inherit; transition: border-color .15s;
}
.pp-promo:hover { border-color: #ff7a1a; }
.pp-promo img { display: block; width: 100%; height: 74px; object-fit: cover; }
.pp-promo-body { display: flex; flex-direction: column; gap: 3px; padding: 7px 9px 8px; }
.pp-promo-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pp-promo-top b { color: #f4efe6; font-size: 11px; letter-spacing: .12em; }
.pp-promo-price { color: #ff7a1a; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.pp-promo-off { color: #c4beb2; font-size: 10px; letter-spacing: .06em; }
.pp-promo-off b { color: #ff7a1a; }
.pp-promo-cta { margin-top: 3px; color: #ffaa44; font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.pp-promo:hover .pp-promo-cta { color: #ffc27a; }

/* ── NOTES + LOG OUT ── */
.pp-notes {
  width: 100%; box-sizing: border-box; min-height: 92px; resize: vertical;
  background: #1f2025; border: 1px solid #2f3137; border-radius: 7px;
  color: #e8ddd0; font-family: inherit; font-size: 12px; line-height: 1.5; letter-spacing: .02em;
  padding: 8px 10px; outline: none;
}
.pp-notes::placeholder { color: #5a5248; }
.pp-notes:focus { border-color: #ff9440; box-shadow: 0 0 0 3px rgba(255,148,64,.15); }
.pp-logout {
  flex: none; width: 100%; height: 34px; border-radius: 6px; margin-bottom: 2px;
  background: none; border: 1px solid #7a6a56; color: #5a4a36;
  font-size: 11px; font-weight: 700; letter-spacing: .16em;
}
.pp-logout:hover { border-color: #a0402a; color: #a0402a; }
html.sd-skin-dark .pp-logout { border-color: #5a5248; color: #a89a86; }
html.sd-skin-dark .pp-logout:hover { border-color: #ff8a6a; color: #ff8a6a; }

/* Cadre étroit (240–300 px, collé à la machine sur un écran ~1440 px). */
.pp-panel.pp-narrow { padding: 6px 7px 8px; }
.pp-narrow .pp-title { font-size: 15px; letter-spacing: .2em; }
.pp-narrow .pp-avatar { width: 62px; height: 62px; }
.pp-narrow .pp-avatar img { height: 50px; }
.pp-narrow .pp-name { font-size: 16px; }
.pp-narrow .pp-member { height: 24px; font-size: 14.5px; padding: 0 9px; }
.pp-narrow .pp-sec { padding: 8px 8px 9px; }

/* Téléphone : plein écran (aucun défilement horizontal). */
html.sd-mobile .pp-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 .pp-scroll { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 6px); }

/* « +N NEW » sous LIKES / COMMENTS (arrivés depuis la dernière visite). */
.pp-stat { position: relative; }
.pp-stat-new {
  margin-top: 2px; padding: 0 6px; border-radius: 8px;
  background: #ff3b30; color: #fff; font-size: 9px; font-weight: 700; letter-spacing: .08em;
}

/* Pastille de notification sur le bouton du pseudo (nouveau 👍, commentaire ou badge). */
#account-btn { position: relative; overflow: visible; }
#account-btn[data-notif]::after {
  content: attr(data-notif);
  position: absolute; top: -8px; right: -8px; z-index: 2;
  min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box;
  border-radius: 9px; background: #e5231a; border: 1.5px solid #fff;
  color: #fff; font-family: 'Share Tech Mono', 'OCR B', 'Courier New', monospace;
  font-size: 11px; font-weight: 700; line-height: 15px; text-align: center;
  box-shadow: 0 0 8px rgba(229,35,26,.7);
  animation: ppNotifPulse 1.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ppNotifPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); }
}

/* Beat avec du neuf (👍 / 💬 depuis la dernière visite) : clignotement doux + pastille. */
.pp-beat { position: relative; }
.pp-beat.fresh { border-color: #ff7a1a; animation: ppBeatBlink 1.9s ease-in-out infinite; }
@keyframes ppBeatBlink {
  0%, 100% { background: #1f2025; box-shadow: 0 0 0 0 rgba(255,122,26,0); }
  50% { background: rgba(255,122,26,.2); box-shadow: 0 0 12px 1px rgba(255,122,26,.55); }
}
.pp-beat-pill {
  position: absolute; top: -8px; right: -6px; z-index: 2;
  min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box;
  border-radius: 9px; background: #e5231a; border: 1.5px solid #fff;
  color: #fff; font-size: 11px; font-weight: 700; line-height: 15px; text-align: center;
  box-shadow: 0 0 8px rgba(229,35,26,.7); pointer-events: none;
  animation: ppNotifPulse 1.8s ease-in-out infinite;
}

/* Toast à l'arrivée : nouveaux 👍 / commentaires / badges (cliquable → profil). */
.pp-toast {
  position: fixed; left: 16px; bottom: 16px; z-index: 10001;
  display: flex; align-items: center; gap: 12px; max-width: min(340px, calc(100vw - 32px));
  padding: 10px 12px; border-radius: 12px; cursor: pointer;
  background: #1a1814; border: 1px solid #ff9440aa; box-shadow: 0 10px 34px rgba(0,0,0,.6);
  font-family: 'Share Tech Mono', 'OCR B', 'Courier New', monospace; color: #e8ddd0;
  transform: translateY(30px); opacity: 0; transition: transform .35s ease, opacity .35s ease;
}
.pp-toast.show { transform: none; opacity: 1; }
.pp-toast:hover { border-color: #ff7a1a; }
.pp-toast-ico { flex: none; width: 34px; height: 34px; line-height: 0; }
.pp-toast-ico svg { width: 100%; height: 100%; display: block; }
.pp-toast-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pp-toast-txt b { color: #ffaa44; font-size: 11px; letter-spacing: .16em; }
.pp-toast-txt span { font-size: 13px; letter-spacing: .04em; }
.pp-toast-x { flex: none; width: 22px; height: 22px; border-radius: 50%; background: none; border: 1px solid #4a4d55; color: #aaa; font-size: 11px; cursor: pointer; }
.pp-toast-x:hover { color: #fff; border-color: #ff7a1a; }
html.sd-mobile .pp-toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 74px); left: 8px; }
