:root{
  --bg-main: #231e1c;
  --text:    #e7d6a9;
  --muted:   rgba(231,214,169,.72);
  --line:    rgba(231,214,169,.18);

  --c-petrol-dark: #26605f;
  --c-petrol:      #326a67;
  --c-teal:        #50938d;
  --c-sage:        #a9c3ad;
  --c-cream:       #e7d6a9;
  --c-yellow:      #eeb340;
  --c-orange:      #d46728;
  --c-orange2:     #e36f23;
  --c-red:         #bf4629;

  --dir-lvl1: var(--c-petrol-dark);
  --dir-lvl2: var(--c-teal);
  --dir-lvl3: var(--c-cream);

  --track-hover-bg:  var(--c-orange2);
  --track-hover-text:#231e1c;

  --track-active-bg: var(--c-red);
  --track-active-text:#ffffff;

  --btn-active-bg:  var(--c-yellow);
  --btn-active-text:#231e1c;

  --panel:   rgba(35,30,28,.92);
  --panel-2: rgba(35,30,28,.82);

  --pad:     12px;
  --topbar-h:56px;
  --nowbar-h:108px;
  --nowcover-h: 190px;

  /* ✅ largeur fixe colonne cover */
  --cover-col: clamp(280px, 38vw, 560px);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Arial, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background:var(--bg-main);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  overflow-x:hidden;
}

/* Topbar */
.topbar{
  position:fixed; inset:0 0 auto 0;
  height:var(--topbar-h);
  display:flex; align-items:center; gap:10px;
  padding:10px calc(var(--pad) + env(safe-area-inset-right)) 10px calc(var(--pad) + env(safe-area-inset-left));
  border-bottom:1px solid var(--line);
  background:var(--panel);
  backdrop-filter:saturate(140%) blur(10px);
  z-index:20;
}
.brand{font-weight:800;letter-spacing:.2px}
.tools{display:flex; gap:8px; align-items:center; flex:1; justify-content:flex-end}

.search{
  width:min(520px, 100%);
  border:1px solid var(--line);
  border-radius:2rem;
  padding:10px 12px;
  background:rgba(255,255,255,.03);
  color:var(--text);
  outline:none;
}
.search::placeholder{color:rgba(231,214,169,.55)}

/* Buttons */
.btn{
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px;
  background:rgba(255,255,255,.03);
  color:var(--text);
  cursor:pointer;
  touch-action:manipulation;
}
.btn:hover{background:rgba(255,255,255,.06)}
.btn:active{transform:translateY(1px)}
.btn.on{
  background:var(--btn-active-bg);
  color:var(--btn-active-text);
  border-color:rgba(238,179,64,.55);
  animation:breathe 2.2s ease-in-out infinite;
}

/* Nowbar */
.nowbar{
  position:fixed; inset:var(--topbar-h) 0 auto 0;
  min-height:var(--nowbar-h);
  display:grid;
  grid-template-columns: 72px 1fr auto;
  align-items:center;
  gap:10px;
  padding:10px calc(var(--pad) + env(safe-area-inset-right)) 10px calc(var(--pad) + env(safe-area-inset-left));
  border-bottom:1px solid var(--line);
  background:var(--panel-2);
  backdrop-filter:saturate(140%) blur(10px);
  z-index:15;
}


/* Pochette grand format (dans le flux, scrollable) */
.nowbarCoverInMain{
  width:100%;
  height: calc(100vh - (var(--topbar-h) + var(--nowbar-h)));
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background: rgba(0,0,0,.08);
}
.nowbarCoverInMain.is-hidden{display:none}
.nowCoverMain{
  width:100%;
  height:100%;
  max-width:100vw;
  max-height:100%;
  object-fit:contain;
  border-radius:0;
  border:1px solid rgba(231,214,169,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 12px 30px rgba(0,0,0,.45);
  background:rgba(255,255,255,.04);
}
.cover{
  width:72px; height:72px;
  border-radius:10px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  object-fit:cover;
}

.meta{min-width:0;text-align:center}
.title{font-weight:900;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sub{color:var(--c-sage);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px;cursor:pointer}

.progressRow{
  display:grid;
  grid-template-columns: 44px 1fr 44px;
  align-items:center;
  gap:8px;
  margin-top:8px;
}
.time{font-size:12px;color:var(--muted)}
.seek{width:100%; accent-color: var(--c-yellow);}

.controls{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}

.a-hidden{
  position:absolute; left:-9999px; top:-9999px;
  width:1px;height:1px; opacity:0; pointer-events:none;
}

/* MAIN full width */
.main{
  padding: calc(var(--topbar-h) + var(--nowbar-h) + var(--nowcover-h) + 10px) 0 calc(18px + env(safe-area-inset-bottom)) 0;
}

.status{color:var(--muted);font-size:12px;margin: 6px 2px 12px 2px}
.albums{display:flex;flex-direction:column;gap:10px}

/* Node header */
.nodeHeader{
  cursor:pointer;
  padding:10px 10px;
  display:grid;
  grid-template-columns: 1fr;
  align-items:center;
  user-select:none;
  font-weight:900;
  font-size:14px;
  background:rgba(255,255,255,.02);
  border:1px solid rgba(231,214,169,.10);
  border-radius:12px;
}
.nodeHeader .label{display:flex;align-items:center;gap:8px;min-width:0}
.nodeHeader .chev{width:18px;text-align:center;color:rgba(231,214,169,.7)}
.nodeHeader .name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nodeHeader .count{color:rgba(231,214,169,.6);font-size:12px}
.nodeHeader .nodeLeft{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0}

/* Depth border */
.node > .nodeHeader{border-left:6px solid var(--dir-lvl1)}
.node .node > .nodeHeader{border-left-color:var(--dir-lvl2)}
.node .node .node > .nodeHeader{border-left-color:var(--dir-lvl3)}

/* Open header background */
.node.is-open > .nodeHeader{background:var(--dir-lvl1);border-color:rgba(38,96,95,.65);animation:breathe 2.4s ease-in-out infinite}
.node .node.is-open > .nodeHeader{background:var(--dir-lvl2);color:#231e1c;border-color:rgba(80,147,141,.65)}
.node .node .node.is-open > .nodeHeader{background:var(--dir-lvl3);color:#231e1c;border-color:rgba(231,214,169,.65)}
.node.is-open > .nodeHeader .chev,
.node.is-open > .nodeHeader .count{color:inherit}

/* NodeBody */
.nodeBody{
  overflow:hidden;
  max-height:0;
  transition:max-height 300ms cubic-bezier(.2,1.35,.2,1);
  margin-top:6px;
  padding:12px 12px 8px 12px;
  border-radius:16px;
  border:1px solid rgba(231,214,169,.22);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    inset 0 0 0 1px rgba(0,0,0,.22),
    0 10px 26px rgba(0,0,0,.45);
}

/* ✅ Ordre imposé : .nodeList puis .albumCoverBlock */
.nodeBody .nodeInner{
  display:block;
  width:100%;
}
.nodeBody .nodeInner::after{
  content:"";
  display:block;
  clear:both;
}

/* 1) la liste passe en premier et flotte à gauche */
.nodeBody .nodeList{
  float:left;
  /*width:50%;*/
  min-width:0;
  overflow:hidden;
}

/* 2) bloc cover après la liste : il occupe l'espace restant */
.nodeBody .albumCoverBlock{
  display:flex;
  align-items:center;
  justify-content:center;
  margin: 0;
  overflow:hidden;
}

.nodeBody .albumCoverBlock.noCover{ display:none; }

/* Empêche les titres/rows de pousser la grille horizontalement */
.nodeBody .nodeList .track,
.nodeBody .nodeList .node{
  min-width:0;
}

.nodeBody .nodeList .track .t{
  display:block;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.nodeBody .albumCoverLarge{
  width:100%;
  max-width: 50vw;
  height:auto;
  max-height: min(62vh, 620px);
  object-fit:contain;
  border-radius:16px;
  border:1px solid rgba(231,214,169,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 12px 30px rgba(0,0,0,.45);
  background:rgba(255,255,255,.04);
}

/* Dossiers imbriqués ouverts : forcer un vrai 100vw (breakout viewport) */
.nodeBody .nodeList .node.is-open{
  position:relative;
  /*width:100vw;
  left:50%;
  right:50%;
  margin-left:-50vw;
  margin-right:-50vw;*/
}

/* 8 stripes background */
.node > .nodeBody,
.node .node > .nodeBody,
.node .node .node > .nodeBody,
.node .node .node .node > .nodeBody{
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.18)),
    linear-gradient(
      135deg,
      var(--c-petrol-dark) 0%,
      var(--c-petrol-dark) 12.5%,
      var(--c-teal) 12.5%,
      var(--c-teal) 25%,
      var(--c-sage) 25%,
      var(--c-sage) 37.5%,
      var(--c-cream) 37.5%,
      var(--c-cream) 50%,
      var(--c-yellow) 50%,
      var(--c-yellow) 62.5%,
      var(--c-orange) 62.5%,
      var(--c-orange) 75%,
      var(--c-orange2) 75%,
      var(--c-orange2) 87.5%,
      var(--c-red) 87.5%,
      var(--c-red) 100%
    ),
    linear-gradient(135deg, #1f1a18 0%, #231e1c 100%);
}

/* Tracks */
.nodeBody .track{
  background:rgba(35,30,28,.62);
  border-radius:10px;
  margin:4px 0;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
.track{
  border-left:6px solid rgba(231,214,169,.10);
  border-bottom:1px solid rgba(231,214,169,.08);
  padding:8px 10px;
  cursor:pointer;
  font-weight:850;
  font-size:12.5px;
  background:rgba(255,255,255,.02);
  border-radius:12px;
  margin:6px 0;
}
.track .t{
  white-space:nowrap;
  overflow-x:auto;
  overflow-y:hidden;
  text-overflow:clip;
  scrollbar-width:none;
}
.track .t::-webkit-scrollbar{display:none}
.track:hover{background:var(--track-hover-bg);color:var(--track-hover-text)}
.track.playing{background:var(--track-active-bg);color:var(--track-active-text);animation:breathe 2.0s ease-in-out infinite}

@keyframes breathe{0%,100%{filter:brightness(1)}50%{filter:brightness(1.07)}}

/* Responsive */
@media (max-width: 980px){
  :root{ --pad:0px; --nowbar-h:132px; --cover-col: 320px;  --nowcover-h: 140px; }

  .topbar{padding:6px 0}
  .nowbar{
    padding:8px 0;
    gap:8px;
    grid-template-columns:64px 1fr;
    grid-template-rows:auto auto;
    align-items:start;
  }
  .cover{width:64px;height:64px}
  .meta{text-align:left;grid-column:2/3}
  .title{font-size:15px}
  .progressRow{grid-template-columns:40px 1fr 40px;gap:6px;margin-top:6px}
  .controls{grid-column:1/-1;justify-content:center;gap:8px;padding:0}
  .main{padding: calc(var(--topbar-h) + var(--nowbar-h) + 6px) 0 12px 0}

  .nodeBody .albumCoverLarge{ max-height:46vh; width:min(96vw, 520px); }

}

/* Petit mobile : empilement */
@media (max-width: 560px){
  :root{ --cover-col: 1fr;  --nowcover-h: 120px; }
  .nodeBody .albumCoverLarge{ max-height:42vh; }
  .nowCoverMain{ width: 100%; height:100%; }

}

/* Closed nodeBody = 0 */
.node:not(.is-open) > .nodeBody{
  max-height:0 !important;
  padding:0 !important;
  margin:0 !important;
  border:0 !important;
  box-shadow:none !important;
  background:transparent !important;
  overflow:hidden !important;
  height:0 !important;
  min-height:0 !important;
}
.node.is-open > .nodeBody{height:auto}
