/* ═══════════════════════════════════════
   CINEBEAT — main.css
═══════════════════════════════════════ */
:root {
  --bg:      #07070d;
  --surface: #0f0f1a;
  --border:  #1e1e30;
  --beat1:   #e8c84a;
  --beat:    #4a9eff;
  --accent:  #ff4a6e;
  --green:   #4aff8c;
  --purple:  #c084fc;
  --text:    #e8e8f0;
  --muted:   #5a5a7a;
  --tl-h:    130px;
  --fs:      1;
}

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { height:100%; overflow:hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  user-select: none;
}

/* ── FLASH ── */
#flash { display: none; } /* remplacé par pulse sur le playhead */

/* ── BUTTONS ── */
.btn {
  padding: 10px 18px; border: none; border-radius: 5px; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 12px; letter-spacing: 2px; transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--beat1); color: #000; }
.btn-primary:active { filter: brightness(1.2); }
.btn-danger  { background: var(--accent); color: #fff; }
.btn-danger:active { opacity: .8; }
.btn-ghost   { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:active { border-color: var(--beat); color: var(--beat); }
.btn-blue    { background: var(--beat); color: #000; }
.btn-sm   { padding: 6px 12px; font-size: 11px; }
.btn-xs   { padding: 4px 8px;  font-size: 10px; }
.btn-huge { flex:1; padding: 16px; font-size: 16px; letter-spacing: 3px; border-radius: 6px; }

/* ── INPUTS ── */
input[type="number"], input[type="text"], select {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: 4px; padding: 6px 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  width: 100%; outline: none; transition: border-color .15s;
}
input:focus, select:focus { border-color: var(--beat); }
select option { background: var(--bg); }

/* ══════════════════════════════════════
   EDITOR
══════════════════════════════════════ */
#editor-screen {
  display: flex; flex-direction: column;
  height: 100dvh; overflow: hidden;
}

.editor-header {
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.editor-header h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 25px; letter-spacing: 3px; color: var(--beat1); flex: 1;
}
.editor-header .sub {
  font-size: 9px; color: var(--muted); letter-spacing: 2px;
  display: block; margin-top: -3px;
}

/* TABS */
.tab-bar {
  display: flex; border-bottom: 1px solid var(--border);
  background: var(--surface); overflow-x: auto; flex-shrink: 0;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab {
  padding: 8px 14px; font-size: 11px; letter-spacing: 1px; cursor: pointer;
  color: var(--muted); border: none; border-bottom: 2px solid transparent;
  background: none; font-family: 'JetBrains Mono', monospace;
  font-weight: 700; transition: all .15s; white-space: nowrap; flex-shrink: 0;
}
.tab.active { color: var(--beat1); border-bottom-color: var(--beat1); }
.tab-panel  { display: none; flex: 1; overflow: hidden; flex-direction: column; }
.tab-panel.active { display: flex; }

/* TOOLBAR */
.editor-toolbar {
  padding: 7px 16px; display: flex; gap: 7px; align-items: center;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.editor-toolbar label { font-size: 10px; color: var(--muted); letter-spacing: 1px; }

/* MEASURES LIST */
.measures-container { flex: 1; overflow-y: auto; padding: 8px 16px 14px; }
.measures-container::-webkit-scrollbar { width: 3px; }
.measures-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.mrow {
  display: grid;
  /* N° | BPM | MESURE | NOM | TEMPO | ANNOTATIONS | TYPE | CIBLE | COURBE | ✕ */
  grid-template-columns: 32px 58px 62px 220px 180px 1fr 130px 68px 80px 26px;
  gap: 3px; align-items: stretch;
  padding: 4px 5px; border-radius: 5px; margin-bottom: 3px;
  background: var(--surface); border: 1px solid var(--border);
}

/* Cellule générique : label empilé au-dessus du champ */
.mcell {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0; overflow: hidden;  /* crucial pour que la grille contraigne */
}
.mlbl {
  font-size: 8px; color: var(--muted); letter-spacing: 1px;
  white-space: nowrap; line-height: 1; flex-shrink: 0;
}
/* Tous les champs dans les cellules */
.mfield {
  width: 100%; height: 28px; min-width: 0; padding: 0 6px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: 3px; box-sizing: border-box;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  outline: none; transition: border-color .15s;
}
.mfield:focus { border-color: var(--beat); }
.mfield-notes  { color: #8a8ab8; }
.mfield-notes::placeholder { color: #4a4a6a; }
.mrow input, .mrow select, .mrow button {
  min-width: 0; box-sizing: border-box;
}
.mrow:hover { border-color: #2e2e50; }
.mrow.ev-scene   { border-left: 3px solid var(--green); }
.mrow.ev-rit     { border-left: 3px solid var(--accent); }
.mrow.ev-accel   { border-left: 3px solid var(--beat); }
.mrow.ev-silence { border-left: 3px solid var(--beat1); }
.mrow.ev-pause   { border-left: 3px solid var(--purple); }

.mnum { font-family: 'Bebas Neue', sans-serif; font-size: 18px; color: var(--beat1); text-align: center; line-height: 1; }

/* IO BAR */
.io-bar {
  padding: 7px 16px; display: flex; gap: 8px; align-items: center;
  border-top: 1px solid var(--border); background: var(--surface);
}
.io-bar .stats { font-size: 10px; color: var(--muted); flex: 1; }

/* ══════════════════════════════════════
   IMPORT PANELS
══════════════════════════════════════ */
.import-panel { flex: 1; overflow-y: auto; padding: 18px 16px; }

.drop-zone {
  border: 2px dashed var(--border); border-radius: 8px;
  padding: 32px 20px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s; margin-bottom: 14px;
}
.drop-zone:hover, .drop-zone.drag {
  border-color: var(--beat); background: rgba(74,158,255,.04);
}
.drop-zone h3 {
  font-family: 'Bebas Neue', sans-serif; font-size: 22px;
  letter-spacing: 3px; margin-bottom: 8px;
}
.drop-zone.mscz h3 { color: var(--green); }
.drop-zone.midi h3 { color: var(--beat); }
.drop-zone p { font-size: 11px; color: var(--muted); line-height: 1.9; }
.drop-zone .ext-badge {
  display: inline-block; padding: 3px 10px; border-radius: 3px;
  font-size: 11px; font-weight: 700; letter-spacing: 2px; margin-bottom: 10px;
}
.mscz .ext-badge { background: rgba(74,255,140,.12); color: var(--green); border: 1px solid var(--green); }
.midi .ext-badge  { background: rgba(74,158,255,.12); color: var(--beat);  border: 1px solid var(--beat); }

.import-result {
  font-size: 11px; color: var(--muted); margin-top: 10px; line-height: 1.9;
  padding: 10px 12px; border-radius: 5px; background: var(--surface);
  border: 1px solid var(--border);
}
.import-result strong { color: var(--green); }
.import-result .warn  { color: var(--beat1); }
.import-result .err   { color: var(--accent); }

/* ══════════════════════════════════════
   SETTINGS
══════════════════════════════════════ */
.settings-panel { flex: 1; overflow-y: auto; padding: 18px 16px; }
.sg   { margin-bottom: 22px; }
.sg h3 {
  font-size: 10px; color: var(--muted); letter-spacing: 2px;
  margin-bottom: 8px; border-bottom: 1px solid var(--border); padding-bottom: 5px;
}
.sr { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.sr label { font-size: 11px; color: var(--text); flex: 1; }
.sr input[type="range"] { flex: 2; accent-color: var(--beat1); }
.sr .val { font-size: 11px; color: var(--beat1); min-width: 44px; text-align: right; }

/* ══════════════════════════════════════
   COUNTDOWN
══════════════════════════════════════ */
#countdown-overlay {
  display: none; position: fixed; inset: 0; z-index: 500; background: var(--bg);
  align-items: center; justify-content: center; flex-direction: column; gap: 14px;
}
#countdown-overlay.visible { display: flex; }
#cdown-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: min(48vw, 280px); color: var(--beat1); line-height: 1;
  animation: cpulse .92s ease-in-out infinite;
}
@keyframes cpulse {
  0%   { transform: scale(1.08); opacity: 1; }
  80%  { transform: scale(.82);  opacity: .65; }
  100% { transform: scale(1.08); opacity: 1; }
}
#cdown-label { font-size: 13px; color: var(--muted); letter-spacing: 4px; }

/* ══════════════════════════════════════
   CONDUCTOR SCREEN
══════════════════════════════════════ */
#conductor-screen {
  display: none; flex-direction: column;
  height: 100dvh; overflow: hidden;
}

.progress-bar  { height: 3px; background: var(--border); flex-shrink: 0; }
.progress-fill { height: 100%; background: var(--beat1); transition: width .1s linear; width: 0; }

.conductor-top {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 10px 14px 4px; position: relative; min-height: 0;
}

/* Silence banner */
#sil-banner {
  display: none; position: absolute; inset: 0;
  background: rgba(7,7,13,.93); z-index: 10;
  align-items: center; justify-content: center; flex-direction: column; gap: 6px;
}
#sil-banner.on { display: flex; }
.sil-lbl { font-family: 'Bebas Neue'; font-size: clamp(38px,11vw,76px); color: var(--beat1); letter-spacing: 8px; }
.sil-sub { font-size: clamp(14px,3.5vw,22px); color: var(--muted); letter-spacing: 3px; }

/* Beat dots */
.beat-arc { display: flex; gap: 9px; margin-bottom: 4px; flex-wrap: wrap; justify-content: center; }
.beat-dot { border-radius: 50%; background: var(--border); transition: background .01s, transform .01s; }
.beat-dot.on-b1 { background: var(--beat1); transform: scale(1.5); box-shadow: 0 0 14px var(--beat1); }
.beat-dot.on    { background: var(--beat);  transform: scale(1.3); box-shadow: 0 0 10px var(--beat); }

/* Measure display */
.measure-display {
  font-family: 'Bebas Neue', sans-serif;
  font-size: calc(clamp(88px, 25vw, 185px) * var(--fs));
  line-height: .87; color: var(--text); letter-spacing: -2px; text-align: center;
}
.measure-display .ml {
  font-family: 'JetBrains Mono'; font-size: 10px; letter-spacing: 3px;
  color: var(--muted); display: block; margin-bottom: 2px;
}

.meta-row { display: flex; gap: 18px; align-items: baseline; margin-top: 6px; }
.bpm-d {
  font-family: 'Bebas Neue';
  font-size: calc(clamp(30px, 8.5vw, 55px) * var(--fs));
  color: var(--beat1); line-height: 1;
}
.bpm-d small { font-size: 12px; color: var(--muted); letter-spacing: 2px; margin-left: 3px; }
.sig-d {
  font-family: 'Bebas Neue';
  font-size: calc(clamp(24px, 6.5vw, 42px) * var(--fs));
  color: var(--muted); line-height: 1;
}

.scene-lbl {
  margin-top: 7px; font-family: 'Crimson Pro', serif; font-style: italic;
  font-size: calc(clamp(13px, 3.2vw, 21px) * var(--fs));
  color: var(--green); text-align: center; min-height: 26px; transition: color .3s;
}
.scene-lbl.ev-rit     { color: var(--accent); }
.scene-lbl.ev-accel   { color: var(--beat); }
.scene-lbl.ev-silence { color: var(--beat1); }
.scene-lbl.ev-pause   { color: var(--purple); }

.next-sec { font-size: 10px; color: #48486a; letter-spacing: 1px; margin-top: 3px; min-height: 14px; text-align: center; }
.next-sec em { color: #68688a; font-style: normal; }
.next-items { display: none; }
.timecode { font-size: calc(11px * var(--fs)); color: var(--muted); letter-spacing: 3px; margin-top: 3px; }

/* Timeline */

#tl-canvas { width: 100%; height: 100%; display: block; }

/* Controls */
.ctrls {
  padding: 7px 12px; display: flex; gap: 7px; align-items: center;
  border-top: 1px solid var(--border); flex-shrink: 0;
}

/* Pause */
#pause-ov {
  display: none; position: fixed; inset: 0; background: rgba(7,7,13,.94);
  z-index: 300; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
}
#pause-ov.on { display: flex; }
#pause-ov h2 { font-family: 'Bebas Neue'; font-size: 50px; letter-spacing: 8px; color: var(--purple); }
#pause-ov p  { font-size: 11px; color: var(--muted); letter-spacing: 3px; }



}


  .mnum {
    grid-column: 1 / -1;
    text-align: left;
    font-size: 13px;
    color: var(--beat1);
    padding-bottom: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2px;
  }
}

/* ── BEAT DOTS — variantes ── */
/* Dot de subdivision (petits, mesures composées) */
.beat-dot.dot-sub {
  opacity: 0.25;
  background: var(--border);
  transition: background .06s, transform .06s, opacity .06s;
}
/* Dot simple /8 (plus petit que /4) */
.beat-dot.dot-small {
  opacity: 0.7;
}
/* États actifs */
.beat-dot.on-b1 {
  background: var(--beat1); transform: scale(1.5);
  box-shadow: 0 0 14px var(--beat1); opacity: 1;
}
.beat-dot.on {
  background: var(--beat); transform: scale(1.3);
  box-shadow: 0 0 10px var(--beat); opacity: 1;
}
.beat-dot.on-sub {
  background: var(--beat);
  opacity: 0.55;
  transform: scale(1.15);
}
/* Espacement : léger gap supplémentaire entre groupes (avant chaque gros dot sauf le 1er) */
.beat-arc .beat-dot:not(.dot-sub) + .beat-dot:not(.dot-sub) {
  margin-left: 6px;
}

/* ── CHAMPS ÉDITEUR v2 ── */
.interp-cell input, .interp-cell select {
  font-size: 10px; padding: 4px 4px;
}

/* Indication de tempo sous le nom de scène */
.tempo-indication {
  font-family: 'Crimson Pro', serif;
  font-size: calc(clamp(11px, 2.5vw, 16px) * var(--fs));
  color: var(--beat1); letter-spacing: 1px;
  text-align: center; min-height: 18px; margin-top: 2px;
  font-style: italic;
}

/* Bouton interpoler */
.btn-blue { background: var(--beat); color: #000; }
.btn-blue:active { filter: brightness(1.2); }

/* ── INPUT MESURE DE DÉPART ── */
.start-from-wrap {
  display: flex; align-items: center; gap: 4px;
}
.start-from-label {
  font-size: 10px; color: var(--muted); letter-spacing: 1px;
  font-family: 'JetBrains Mono', monospace;
}
.start-from-input {
  width: 52px; padding: 8px 6px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--beat1); border-radius: 4px;
  font-family: 'Bebas Neue', sans-serif; font-size: 18px;
  text-align: center; outline: none;
}
.start-from-input:focus { border-color: var(--beat1); }

/* ── BULLE TIMELINE ── */
.tl-bubble {
  position: absolute;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  background: var(--bg);
  border: 1px solid var(--beat1);
  border-radius: 6px;
  padding: 5px 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .1s;
  white-space: nowrap;
  z-index: 50;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: 0 0 12px rgba(232,200,74,.25);
}
.tl-bubble::after {
  content: '';
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--beat1);
}
.tl-bubble.visible { opacity: 1; }
#tl-bubble-num {
  font-family: 'Bebas Neue'; font-size: 22px; color: var(--beat1); line-height: 1;
}
.tl-bubble-name {
  font-size: 10px; color: var(--muted); letter-spacing: 1px; max-width: 120px;
  overflow: hidden; text-overflow: ellipsis; text-align: center;
}

/* ── VUE CONDENSÉE — groupes de mesures ── */
.mrow-group {
  background: #0a0a14;
  border: 1px dashed #252540;
  cursor: pointer;
  grid-template-columns: 36px 1fr 1fr 1fr 1fr 1fr 110px 56px 48px 26px;
}
.mrow-group:hover { border-color: #3a3a60; }
.mrow-group.expanded { border-color: #2a2a50; border-style: solid; }

.group-badge {
  display: inline-block;
  padding: 2px 8px; border-radius: 3px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  background: #1a1a2e; color: var(--muted);
  border: 1px solid #2a2a40;
}
.group-toggle {
  font-size: 10px !important;
  color: var(--muted) !important;
}

/* Mesures enfants (dépliées) */
.mrow.group-child {
  background: #0c0c18;
  border-left: 2px solid #2a2a45 !important;
  margin-left: 8px;
}
.mrow.group-child:hover { border-color: #3a3a60 !important; }

/* ═══════════════════════════════════════
   DRUM ROLL PICKER — roue de sélection
═══════════════════════════════════════ */
.picker-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,.6);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.picker-overlay.open {
  opacity: 1; pointer-events: all;
}
.picker-sheet {
  width: 100%; max-width: 480px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.32,1,.56,1);
}
.picker-overlay.open .picker-sheet {
  transform: translateY(0);
}
.picker-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border);
}
.picker-header .picker-title {
  font-family: 'Bebas Neue'; font-size: 18px; letter-spacing: 2px; color: var(--beat1);
}
.picker-header .picker-confirm {
  font-family: 'JetBrains Mono'; font-size: 12px; font-weight: 700;
  color: var(--beat1); background: none; border: none; cursor: pointer; letter-spacing: 1px;
}
.picker-wheels {
  display: flex; justify-content: center; gap: 0;
  padding: 0 18px 8px;
}
.picker-wheel-wrap {
  flex: 1; display: flex; flex-direction: column; align-items: center;
}
.picker-wheel-label {
  font-size: 9px; color: var(--muted); letter-spacing: 2px;
  margin-bottom: 4px; text-align: center;
}
.picker-wheel {
  position: relative; height: 180px; overflow: hidden;
  width: 100%; cursor: grab;
}
.picker-wheel:active { cursor: grabbing; }
/* Ligne de sélection centrale */
.picker-wheel::before,
.picker-wheel::after {
  content: ''; position: absolute; left: 0; right: 0; z-index: 2; pointer-events: none;
}
.picker-wheel::before {
  top: calc(50% - 18px); height: 36px;
  border-top: 1px solid var(--beat1);
  border-bottom: 1px solid var(--beat1);
  background: rgba(232,200,74,.06);
}
.picker-wheel::after {
  top: 0; height: 60px;
  background: linear-gradient(to bottom, var(--surface) 0%, transparent 100%);
}
.picker-wheel-inner {
  position: absolute; width: 100%;
  transition: transform .15s ease-out;
  will-change: transform;
}
.picker-item {
  height: 36px; display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue'; font-size: 22px; color: var(--muted);
  letter-spacing: 1px; transition: color .1s, font-size .1s;
  user-select: none;
}
.picker-item.selected { color: var(--text); font-size: 26px; }
/* Fondu bas */
.picker-fade-bottom {
  position: absolute; bottom: 0; left: 0; right: 0; height: 60px;
  background: linear-gradient(to top, var(--surface) 0%, transparent 100%);
  pointer-events: none; z-index: 2;
}
.picker-sep {
  display: flex; align-items: center; justify-content: center;
  width: 20px; font-family: 'Bebas Neue'; font-size: 28px; color: var(--muted);
  padding-top: 14px;
}

/* ── BOUTONS PICKER dans l'éditeur ── */
.picker-btn {
  width: 100%; height: 28px; padding: 0 6px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: 3px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700;
  letter-spacing: 1px; cursor: pointer; text-align: center;
  transition: border-color .15s, color .15s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.picker-btn:active  { border-color: var(--beat1); color: var(--beat1); }
.picker-btn-empty   { color: var(--muted); }

.picker-btn-type { font-size: 12px; }

/* ═══════════════════════════════════════
   BARRE DE PROGRESSION DE MESURE
═══════════════════════════════════════ */
.measure-progress-bar {
  height: 2px; background: transparent; flex-shrink: 0; position: relative;
  direction: rtl;  /* la barre vient de droite */
}
.measure-progress-fill {
  height: 100%; width: 0%;
  background: rgba(255,255,255,0.7);
  transition: none;
  box-shadow: 0 0 4px rgba(255,255,255,0.4);
}

/* ═══════════════════════════════════════
   ZONE NEXT ANTICIPÉE
═══════════════════════════════════════ */
.next-zone {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; margin-top: 6px; min-height: 44px; width: 100%;
}

/* Prochain événement immédiat — plus grand */
.next-upcoming {
  font-size: calc(11px * var(--fs));
  color: #6a6a8a; letter-spacing: 1px; text-align: center;
  min-height: 16px; transition: color .3s, font-size .3s;
}
.next-upcoming.near-1 { color: #c0c0e0; font-size: calc(13px * var(--fs)); }
.next-upcoming.near-2 { color: #9090b8; font-size: calc(12px * var(--fs)); }
.next-upcoming.near-3 { color: #7070a0; }

/* Couleur selon le type de l'événement qui approche */
.next-upcoming.evt-scene   { color: #4aff8c; }
.next-upcoming.evt-rit     { color: #ff6a8a; }
.next-upcoming.evt-accel   { color: #6ab8ff; }
.next-upcoming.evt-silence { color: #e8c84a; }
.next-upcoming.evt-pause   { color: #c084fc; }

/* Liste des événements à venir — plus petits */
.next-items {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  max-width: 100%;
}
.next-item {
  font-size: calc(9px * var(--fs)); letter-spacing: 1px;
  color: #3a3a5a; padding: 2px 7px; border-radius: 3px;
  border: 1px solid #2a2a40; white-space: nowrap;
  transition: color .3s, border-color .3s;
}
.next-item.near { color: #5a5a8a; border-color: #3a3a60; }

/* ═══════════════════════════════════════
   VERSION C — Layout conducteur
═══════════════════════════════════════ */
#conductor-screen {
  display: none;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  position: relative;
  background: var(--bg);
}

/* Timeline — flex:1 pour prendre tout l'espace entre info et controls */
#conductor-screen .tl-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Barre info compacte */
.cond-info-bar {
  display: flex; flex-direction: row;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  height: clamp(70px, 12dvh, 100px);
}

.cond-col {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px 10px; gap: 2px;
  border-right: 1px solid var(--border);
}
.cond-col:last-child { border-right: none; }

.cond-col-measure { min-width: 80px; flex-shrink: 0; }
.cond-col-bpm     { min-width: 90px; flex-shrink: 0; }
.cond-col-main    { flex: 1; }
.cond-col-next    { min-width: 160px; flex-shrink: 0; align-items: flex-start; padding: 8px 12px; }

.cond-label {
  font-size: 9px; color: var(--muted); letter-spacing: 2px;
  font-family: 'JetBrains Mono', monospace;
}
.cond-big {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(28px, 6dvh, 48px);
  color: var(--text); line-height: 1;
}
.cond-sig {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(14px, 3dvh, 22px);
  color: var(--muted); line-height: 1;
}
.cond-sublbl {
  font-family: 'Crimson Pro', serif; font-style: italic;
  font-size: clamp(11px, 2.5dvh, 16px);
  color: var(--beat1); text-align: center;
}

/* Silence banner — superposé sur la timeline */
#sil-banner {
  position: absolute; /* par rapport au conductor-screen */
  top: 3px; left: 0; right: 0;
  bottom: calc(clamp(80px,18dvh,130px) + 38px); /* au-dessus de la barre info + ctrls */
  z-index: 10;
}



/* ═══════════════════════════════════════
   OVERLAYS COINS DE LA TIMELINE
═══════════════════════════════════════ */
.tl-overlay {
  position: absolute; top: 8px;
  display: flex; flex-direction: column;
  pointer-events: none; z-index: 5;
  line-height: 1;
}
.tl-overlay-tl { left: 10px; align-items: flex-start; }
.tl-overlay-tr { right: 10px; align-items: flex-end; }

.tl-big-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: 2px; color: var(--muted);
  margin-bottom: 2px;
}
.tl-big-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(48px, 10dvh, 80px);
  color: var(--text); line-height: 1;
  text-shadow: 0 0 20px rgba(232,200,74,.15);
}
.tl-big-bpm {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(48px, 10dvh, 80px);
  color: var(--beat1); line-height: 1;
  text-shadow: 0 0 20px rgba(232,200,74,.2);
}
.tl-big-tempo {
  font-family: 'Crimson Pro', serif; font-style: italic;
  font-size: clamp(13px, 2.5dvh, 18px);
  color: #c0c0d8; text-align: right; margin-top: 2px;
}

.tl-big-sig {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(16px, 3dvh, 24px);
  color: var(--muted); line-height: 1; margin-top: 2px;
}

/* ── Barre scène pleine largeur ── */
.scene-bar {
  padding: 6px 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  flex-shrink: 0;
  background: rgba(255,255,255,.02);
}
.scene-bar .scene-lbl {
  font-size: clamp(16px, 3dvh, 26px);
  margin-top: 0; min-height: auto;
}

/* ── Chiffrage courant sur la timeline ── */
.tl-timesig {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.85;
  pointer-events: none;
  transition: left 0.0s, opacity 0.3s;
}
.tl-timesig.slide-in {
  transition: left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s;
}
.tl-timesig.fade-out {
  opacity: 0 !important;
  transition: opacity 0.5s;
}
#tl-sig-num, #tl-sig-den {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 52px;
  color: #7070a0;
  display: block;
}