:root {
  --bg: #0f1218;
  --surface: #171b23;
  --surface-2: #1f2430;
  --border: #2a3040;
  --text: #e6e8ee;
  --muted: #8b93a7;
  --accent: #d4a85a;
  --good: #4fbf7f;
  --warn: #e0a53b;
  --bad: #e2574c;
  --tank: #4f7fd9;
  --healer: #4fb36b;
  --dps: #c9504b;
  --radius: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 Inter, system-ui, sans-serif;
}
code, .mono { font-family: "JetBrains Mono", monospace; font-size: 12px; }
h2 { margin: 8px 0 16px; font-size: 20px; }
h3 { margin: 0 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
h3 small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.hidden { display: none !important; }

.top {
  display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap;
  padding: 20px 24px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.brand { font-size: 22px; font-weight: 700; padding-top: 4px; }
.brand span { color: var(--accent); }
.input-card { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: 8px; }
.input-card > label { color: var(--muted); font-size: 13px; }
textarea {
  width: 100%; resize: vertical; padding: 10px; border-radius: var(--radius);
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  font: 13px "JetBrains Mono", monospace;
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
button {
  background: var(--accent); color: #1a1408; border: 0; border-radius: 8px;
  padding: 8px 18px; font-weight: 600; cursor: pointer; font-family: inherit;
}
button:disabled { opacity: .5; cursor: wait; }
select {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px;
}

main { max-width: 1400px; margin: 0 auto; padding: 24px 16px; }
/* page d'analyse : le replay prend toute la largeur de l'écran ; le reste garde une largeur de lecture */
main#app { max-width: none; }
main#app > #status, #results > :not(.replay-card) { max-width: 1400px; margin-left: auto; margin-right: auto; }
.status { padding: 12px 16px; border-radius: var(--radius); background: var(--surface-2); margin-bottom: 16px; }
.status.error { background: #3a1d1d; color: #ffb4ad; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; min-width: 0;
}
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .card { margin-top: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.chart-box { position: relative; height: 280px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 22px; font-weight: 700; }
.kpi .sub { color: var(--muted); font-size: 12px; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; cursor: pointer; user-select: none; }
th:first-child, td:first-child { text-align: left; }
td.left, th.left { text-align: left; }
tr:hover td { background: var(--surface-2); }

.job {
  display: inline-block; min-width: 34px; text-align: center; padding: 1px 6px; border-radius: 4px;
  font: 600 11px "JetBrains Mono", monospace; color: #fff; margin-right: 8px;
}
.role-tank { background: var(--tank); }
.role-healer { background: var(--healer); }
.role-melee, .role-ranged, .role-caster, .role-dps { background: var(--dps); }

.flag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; margin: 1px 2px; }
.flag.bad { background: rgba(226, 87, 76, .18); color: #ff9c93; }
.flag.warn { background: rgba(224, 165, 59, .18); color: #f3c57a; }
.flag.good { background: rgba(79, 191, 127, .18); color: #8de0b0; }

.bars { list-style: none; margin: 0 0 16px; padding: 0; }
.bars li { position: relative; padding: 4px 8px; margin-bottom: 4px; border-radius: 6px; overflow: hidden; display: flex; justify-content: space-between; gap: 8px; }
.bars li .fill { position: absolute; inset: 0 auto 0 0; background: rgba(226, 87, 76, .22); z-index: 0; }
.bars li span { position: relative; z-index: 1; }
.empty { color: var(--muted); font-style: italic; }

.matrix td.cell { text-align: center; min-width: 48px; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tab {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  padding: 4px 10px; font-weight: 500; font-size: 12px;
}
.tab.kill { border-color: var(--good); }
.tab.active { background: var(--accent); color: #1a1408; }

.pull-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: baseline; margin-bottom: 12px; }
.pull-head .result { font-weight: 700; font-size: 18px; }
.result.kill { color: var(--good); }
.result.wipe { color: var(--bad); }

.timeline-deaths { position: relative; height: 34px; background: var(--surface-2); border-radius: 6px; margin: 8px 0 16px; }
.timeline-deaths .mark {
  position: absolute; top: 4px; width: 2px; height: 26px; background: var(--bad);
}
.timeline-deaths .mark::after {
  content: attr(data-label); position: absolute; top: -2px; left: 4px; font-size: 11px; white-space: nowrap; color: #ff9c93;
}

.positions { display: grid; grid-template-columns: minmax(0, 640px) 1fr; gap: 16px; margin-top: 16px; align-items: start; }
@media (max-width: 1000px) { .positions { grid-template-columns: minmax(0, 1fr); } }
.pos-canvas-wrap { position: relative; background: #0b0d12; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pos-canvas { width: 100%; height: auto; display: block; aspect-ratio: 1; cursor: grab; touch-action: none; }
.pos-canvas.dragging { cursor: grabbing; }
.zoom-controls { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.zoom-controls button {
  width: 30px; height: 30px; padding: 0; font-size: 16px; line-height: 1;
  background: rgba(31, 36, 48, .9); color: var(--text); border: 1px solid var(--border);
}
.zoom-controls button:hover { border-color: var(--accent); }
.zoom-level { color: var(--muted); font-size: 11px; }
.zoom-hint { position: absolute; bottom: 6px; right: 10px; color: var(--muted); font-size: 11px; pointer-events: none; }
.pos-controls { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.pos-controls .timeline-wrap { flex: 1; position: relative; display: flex; flex-direction: column; }
.pos-controls .timeline { width: 100%; accent-color: var(--accent); margin: 0; }
.chapter-strip { position: relative; height: 10px; margin-top: 2px; }
.chapter-strip .tick {
  position: absolute; top: 0; width: 3px; height: 10px; margin-left: -1px; border-radius: 1px;
  background: rgba(212, 168, 90, .55); cursor: pointer;
}
.chapter-strip .tick:hover, .chapter-strip .tick.current { background: var(--accent); width: 5px; margin-left: -2px; }
.pos-controls .prev-ch, .pos-controls .next-ch { background: var(--surface-2); color: var(--text); padding: 6px 8px; }
.pos-controls .play { width: 40px; padding: 6px; }
.pos-deaths { margin-bottom: 12px; font-size: 12px; }
.pos-deaths button { background: var(--surface-2); color: var(--text); padding: 2px 8px; font-size: 12px; margin: 2px; font-weight: 400; }

.checks { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); padding: 4px 12px; font-weight: 500; }
button.small { padding: 2px 10px; font-size: 12px; }
button.danger { background: transparent; color: #ff9c93; border: 1px solid rgba(226, 87, 76, .5); }

.logs-panel { max-width: 1400px; margin: 16px auto 0; padding: 0 16px; }
.logs-panel .card { margin-bottom: 0; }
.logs-panel .row { margin-bottom: 12px; align-items: flex-start; }
.upload input { display: none; }
.upload span {
  display: inline-block; padding: 8px 16px; border: 1px dashed var(--border); border-radius: 8px;
  cursor: pointer; color: var(--text); background: var(--surface-2);
}
.upload span:hover { border-color: var(--accent); }
.remote { color: var(--muted); font-size: 13px; text-align: right; }
.remote b { color: var(--text); font-weight: 500; }
.remote .err { color: #ff9c93; }

.boss-timeline { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; max-height: 160px; overflow-y: auto; }
.boss-timeline span { background: var(--surface-2); border-radius: 4px; padding: 1px 8px; font-size: 12px; }
.boss-timeline span b { font-family: "JetBrains Mono", monospace; font-weight: 500; color: var(--muted); margin-right: 6px; }
.death-ctx td { white-space: normal; vertical-align: top; }
.death-ctx .muted, .muted { color: var(--muted); }
.replay-source { color: var(--muted); font-size: 12px; margin: 0 0 4px; }

/* ---------- icônes de job ---------- */
.job-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 26px; height: 26px; border-radius: 50%; vertical-align: middle;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .28), 0 1px 2px rgba(0, 0, 0, .4);
}
.job-icon img { width: 20px; height: 20px; display: block; }
.job-icon span { font: 700 9px Inter, sans-serif; color: #fff; }
.job-icon.role-tank { background: #2f5bb0; }
.job-icon.role-healer { background: #2f8a4c; }
.job-icon.role-dps { background: #a63a35; }
.pcell { display: inline-flex; align-items: center; gap: 10px; }
.pname { font-weight: 500; }
th.phead {
  white-space: normal; text-align: center; vertical-align: bottom; cursor: default;
  min-width: 76px; max-width: 96px; font-size: 11px; line-height: 1.25; color: var(--text);
}
th.phead .job-icon { display: flex; margin: 0 auto 6px; }
.names-toggle { font-size: 12px; color: var(--muted); gap: 4px; }

/* ---------- options du replay ---------- */
.pos-options { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 12px; font-size: 13px; }
.pos-options .follow { max-width: 220px; }
.pos-live { background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; }
.pos-live h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 500; }
.live-row {
  display: grid; grid-template-columns: 26px minmax(80px, 1fr) minmax(110px, 1.4fr) minmax(50px, .8fr) 40px 78px;
  align-items: center; gap: 8px; padding: 3px 4px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.live-row:hover { background: rgba(255, 255, 255, .05); }
.live-row.following { background: rgba(212, 168, 90, .16); box-shadow: inset 2px 0 0 var(--accent); }
.live-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-bar { height: 6px; background: rgba(255, 255, 255, .08); border-radius: 3px; overflow: hidden; }
.live-bar span { display: block; height: 100%; border-radius: 3px; transition: width .15s linear; }
.live-bar span.good { background: var(--good); }
.live-bar span.warn { background: var(--warn); }
.live-bar span.bad { background: var(--bad); }
.live-pct { text-align: right; }
.live-state { font-size: 11px; text-align: right; }
.live-state.on { color: #8de0b0; }
.live-state.off { color: var(--warn); }
.live-state.dead { color: #ff9c93; }

.live-hp { position: relative; height: 16px; background: rgba(255, 255, 255, .08); border-radius: 4px; overflow: hidden; }
.live-hp-fill { position: absolute; inset: 0 auto 0 0; border-radius: 4px; transition: width .1s linear; }
.live-hp-shield { position: absolute; left: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .85); }
.live-hp-text { position: relative; display: block; text-align: center; font-size: 10.5px; line-height: 16px; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.pos-busters { margin-bottom: 12px; font-size: 12px; }
.pos-busters button { padding: 2px 8px; font-size: 12px; margin: 2px; font-weight: 500; color: #fff; }
.pos-busters button.raidwide { background: rgba(226, 87, 76, .35); }
.pos-busters button.stacks { background: rgba(224, 165, 59, .35); }
.pos-busters button.tankbuster { background: rgba(79, 127, 217, .4); }

.pos-chapters { margin-bottom: 12px; font-size: 12px; }
.pos-chapters button { background: var(--surface-2); color: var(--text); padding: 2px 8px; font-size: 12px; margin: 2px; font-weight: 400; border: 1px solid transparent; }
.pos-chapters button.current { border-color: var(--accent); color: var(--accent); }
.boss-timeline .seekable { cursor: pointer; }
.boss-timeline .seekable:hover { background: rgba(212, 168, 90, .2); }

/* ---------- édition de strat ---------- */
.pos-controls .edit-toggle { background: var(--surface-2); color: var(--accent); border: 1px solid var(--accent); padding: 5px 10px; font-size: 12px; white-space: nowrap; }
.pos-controls .edit-toggle.active { background: var(--accent); color: #1a1408; }
.positions.editing .pos-canvas-wrap, .editing .pos-canvas-wrap { box-shadow: 0 0 0 2px var(--accent); }
.key-strip { position: relative; height: 8px; margin-top: 2px; }
.key-strip .tick { position: absolute; top: 0; width: 2px; height: 8px; margin-left: -1px; background: #f3c57a; border-radius: 1px; }
.pos-strat { background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.pos-strat h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.pos-strat h5 { margin: 12px 0 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.strat-help { font-size: 12px; margin: 0 0 8px; line-height: 1.45; }
.strat-help kbd { font: 11px "JetBrains Mono", monospace; background: var(--bg); border: 1px solid var(--border); border-radius: 3px; padding: 0 4px; }
.strat-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.strat-actions button.small, .strat-import-btn { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.strat-import-btn { padding: 2px 10px; font-size: 12px; border-radius: 8px; cursor: pointer; }
.strat-save-state { font-size: 11px; }
.strat-keys { max-height: 150px; overflow-y: auto; }
.key-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.key-row .key-go { background: var(--surface); color: #f3c57a; border: 1px solid var(--border); font-family: "JetBrains Mono", monospace; }
.key-row .key-names { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strat-issues { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.strat-issues .issue { text-align: left; background: transparent; color: var(--text); font-weight: 400; font-size: 12px; padding: 3px 6px; border-left: 3px solid var(--bad); border-radius: 4px; }
.strat-issues .issue:hover { background: rgba(255,255,255,.05); }
.strat-issues .issue-tower, .strat-issues .issue-stack { border-left-color: var(--warn); }
.strat-issues .issue-orb { border-left-color: #b05cc9; }

/* ---------- rotation ---------- */
.rotation { margin-top: 16px; background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; }
.rotation h4 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 500; }
.rot-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 10px; }
.rot-player { max-width: 280px; }
.kind-damage { --kind: #e8875a; } .kind-heal { --kind: #5fc98a; } .kind-defense { --kind: #5fa8e8; } .kind-buff { --kind: #d4a85a; }
.rot-kinds { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.rot-kinds .check { color: var(--text); gap: 5px; }
.rot-kinds input { accent-color: var(--kind); }
.rot-live { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.rot-live b { color: var(--text); font-weight: 600; }
.rot-live .good { color: var(--good); } .rot-live .warn { color: var(--warn); } .rot-live .bad { color: var(--bad); }
.rot-buffs { display: inline-flex; align-items: center; gap: 3px; }
.rot-buffs img { width: 18px; height: 18px; border-radius: 3px; }
.rot-timeline { margin-bottom: 10px; }
.rot-canvas { display: block; width: 100%; border-radius: 6px; cursor: pointer; }
.rot-legend { font-size: 11px; margin-top: 4px; }
.rot-cds { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.cd-group { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 10px; padding-left: 8px; border-left: 2px solid var(--kind); }
.cd-group-name { flex: 0 0 72px; padding-top: 11px; font-size: 11px; font-weight: 600; text-transform: uppercase;
                 letter-spacing: .04em; color: var(--kind); }
.cd-list { flex: 1 1 300px; display: flex; flex-wrap: wrap; gap: 8px; }
.cd { display: grid; grid-template-columns: 34px auto; grid-template-rows: auto auto; column-gap: 7px; align-items: center;
      background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px 4px 4px; min-width: 120px; }
.cd-icon { grid-row: span 2; position: relative; width: 34px; height: 34px; }
.cd-icon img { width: 34px; height: 34px; border-radius: 5px; display: block; }
.cd-sweep { position: absolute; inset: 0; border-radius: 5px; }
.cd-time { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700;
           font-size: 13px; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.cd-charges { position: absolute; right: -3px; bottom: -3px; background: #10131a; border: 1px solid var(--border);
              border-radius: 7px; padding: 0 4px; font-size: 10px; line-height: 14px; }
.cd-name { font-size: 12px; white-space: nowrap; }
.cd-uses { font-size: 11px; }
.cd.ready .cd-icon img { box-shadow: 0 0 0 2px rgba(79,191,127,.55); }
.cd.late { border-color: var(--bad); }
.cd.late .cd-icon img { box-shadow: 0 0 0 2px var(--bad); }
.cd.late .cd-time { color: #ffb4ad; font-size: 12px; }
.cd-uses.good, .rot-table .good { color: var(--good); } .cd-uses.warn, .rot-table .warn { color: var(--warn); }
.cd-uses.bad, .rot-table .bad { color: var(--bad); }
.rot-opener { background: rgba(0,0,0,.18); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.op-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 8px; font-size: 13px; }
.op-head a { color: var(--accent); }
.op-score { font: 700 15px "JetBrains Mono", monospace; }
.op-score.good { color: var(--good); } .op-score.warn { color: var(--warn); } .op-score.bad { color: var(--bad); }
.op-pre { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 8px; font-size: 12px; }
.op-grid { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px; }
.op-col { display: grid; grid-template-rows: 14px 54px 40px auto auto; justify-items: center; align-items: end;
          align-content: start; gap: 3px; min-width: 42px; padding: 4px 2px; border-radius: 6px; }
.op-col[data-t] { cursor: pointer; } .op-col[data-t]:hover { background: rgba(255,255,255,.05); }
.op-col.inserted { min-width: 34px; background: rgba(139,147,167,.08); }
.op-o, .op-x { display: flex; flex-wrap: wrap-reverse; justify-content: center; gap: 2px; max-width: 54px; }
.op-x { align-items: flex-start; align-self: start; }
.op-g .op-icon { width: 36px; height: 36px; }
.op-n { font-size: 10px; color: var(--muted); align-self: start; }
.op-p:empty, .op-x:empty { display: none; }
.op-pull { font-size: 11px; color: var(--muted); }
.op-icon { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 5px;
           overflow: hidden; background: #2a3040; border: 2px solid transparent; vertical-align: middle; }
.op-icon img { width: 100%; height: 100%; display: block; }
.op-icon .op-txt { font-size: 9px; color: var(--text); }
.op-icon.ok { border-color: var(--good); }
.op-icon.shifted { border-color: var(--warn); }
.op-icon.missing { border-color: var(--bad); opacity: .55; }
.op-icon.played { border-color: var(--bad); width: 28px; height: 28px; }
.op-icon.extra { border-color: #6b7386; opacity: .8; width: 20px; height: 20px; }
.op-icon.unseen { border-color: #6b7386; opacity: .45; }
.op-legend { font-size: 11px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; }
.op-legend .op-icon { width: 14px; height: 14px; }
.rot-sub { margin: 6px 0 6px !important; }
.rot-table tbody tr { cursor: pointer; }
.rot-table tbody tr:hover { background: rgba(255,255,255,.04); }
.rot-table tbody tr.selected { background: rgba(212,168,90,.14); }

/* ---------- espace de replay de la page principale : plan, frise et compétences sur un écran ---------- */
.replay-card { --ws-h: calc(100vh - 96px); padding: 12px 14px; scroll-margin-top: 8px; }
.replay-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-bottom: 10px; }
.replay-bar .tabs { flex: 1 1 360px; min-width: 0; flex-wrap: nowrap; overflow-x: auto; margin: 0; padding-bottom: 2px; scrollbar-width: thin; }
.replay-bar .tab { flex: none; }
.replay-bar .pull-head { margin: 0; gap: 12px; font-size: 13px; }
.replay-bar .pull-head .result { font-size: 15px; }
/* le plan prend toute la hauteur disponible (carré), le reste va dans la colonne de droite qui défile seule */
.replay-card .positions { display: flex; gap: 14px; margin-top: 0; height: var(--ws-h); min-height: 520px; }
.replay-card .pos-canvas-wrap { flex: none; align-self: flex-start; width: min(var(--ws-h), 62vw); max-width: 100%; }
.replay-card .pos-side { flex: 1; min-width: 0; height: 100%; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.replay-card .rotation-live { margin: 0 0 10px; padding: 10px 12px; }
.replay-card .rotation-live .rot-legend { display: none; }
.replay-card .pos-controls, .replay-card .pos-options { margin-bottom: 8px; }
.replay-card .pos-options { gap: 6px 12px; }
.replay-card .replay-source { margin: 6px 0 0; }
.pos-controls .fullscreen { background: var(--surface-2); color: var(--text); padding: 5px 9px; font-size: 14px; line-height: 1; }
.replay-card:fullscreen { --ws-h: calc(100vh - 74px); overflow: auto; background: var(--bg); border-radius: 0; padding: 12px 16px; }
@media (max-width: 1000px) {
  .replay-card .positions { flex-direction: column; height: auto; min-height: 0; }
  .replay-card .pos-canvas-wrap { width: 100%; }
  .replay-card .pos-side { height: auto; overflow: visible; }
}

/* ---------- replay compact (étapes de la page de strat) ---------- */
.compact .rotation,
.compact .pos-live, .compact .pos-deaths, .compact .pos-busters, .compact .pos-chapters,
.compact .pos-stats, .compact .replay-source, .compact .strat-help { display: none !important; }
.compact .positions { grid-template-columns: minmax(0, 1fr); margin-top: 0; }
.compact .strat-issues { max-height: 140px; }
.compact .strat-keys { max-height: 90px; }

/* ---------- page de strat ---------- */
.top-nav { font-size: 12px; font-weight: 500; margin-top: 4px; }
.top-nav a, a.brand { color: inherit; text-decoration: none; }
.top-nav a { color: var(--accent); }
.strat-top { align-items: center; }
.strat-head h1 { margin: 0; font-size: 20px; }
.strat-head p { margin: 2px 0 0; }
.strat-controls .row { margin-bottom: 8px; justify-content: flex-start; }
.strat-controls input[type=text] {
  flex: 1; min-width: 260px; padding: 6px 10px; border-radius: 8px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); font: 12px "JetBrains Mono", monospace;
}
.strat-controls a, .step-points a { color: var(--accent); }
.strat-toc { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.strat-toc a { color: var(--text); text-decoration: none; }
.strat-toc a:hover { color: var(--accent); }
.strat-toc a.muted { color: var(--muted); }
#stratLegend .job-icon { margin: 0 2px 0 10px; width: 20px; height: 20px; }
#stratLegend .job-icon img { width: 15px; height: 15px; }
.strat-step { scroll-margin-top: 12px; }
.step-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 12px; }
.step-head h2 { margin: 0; font-size: 17px; }
.step-grid { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .step-grid { grid-template-columns: minmax(0, 1fr); } }
.step-summary { margin: 0 0 8px; font-weight: 500; }
.step-points { margin: 0 0 12px; padding-left: 18px; line-height: 1.55; font-size: 13px; }
.step-points li { margin-bottom: 4px; }
.step-text h5 { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 500; }
.step-moments { display: flex; flex-wrap: wrap; gap: 4px; }
.step-moments button { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); font-weight: 400; }
.step-moments button:hover { border-color: var(--accent); }
.step-assign td { padding: 3px 8px; }
.step-effects img { width: 18px; height: 24px; margin-right: 2px; vertical-align: middle; }
.step-effects .flag { font-size: 10px; }

.cache-info { font-size: 12px; margin: 10px 0 0; }

/* ---------- accueil des guides (static/guides.html, racine de m12s.delfini.fr) ---------- */
.guide-card h2 { margin: 0 0 4px; }
.guide-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 14px; }
.guide-link { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
              background: var(--surface-2); color: var(--text); text-decoration: none; }
.guide-link:hover { border-color: var(--accent); }
.guide-link b { color: var(--accent); font-size: 16px; }
.guide-link span { color: var(--muted); font-size: 13px; }

/* ---------- site public des guides (m12s.delfini.fr) : pull de référence imposé ---------- */
.public-site #sourceForm { display: none !important; }

/* ---------- écrans tactiles et mobiles ---------- */
/* au doigt, un glissement vertical sur le plan fait défiler la page (zoom : boutons + et −) */
@media (pointer: coarse) { .pos-canvas { touch-action: pan-y; } }
@media (hover: none) { .zoom-hint { display: none; } }
@media (max-width: 640px) {
  .top { padding: 14px 14px; gap: 6px 16px; }
  .brand { font-size: 19px; }
  .strat-head h1 { font-size: 18px; }
  main { padding: 12px 8px; }
  .card { padding: 12px; border-radius: 10px; }
  .strat-controls input[type=text] { min-width: 0; }
  .step-head h2 { font-size: 16px; }
  .step-points { padding-left: 16px; }
  /* barre de lecture : la timeline sur toute la largeur, les boutons en dessous */
  .pos-controls { flex-wrap: wrap; gap: 6px; }
  .pos-controls .timeline-wrap { order: -1; flex: 1 1 100%; }
  .pos-controls .clock { margin-right: auto; }
  .pos-options { gap: 4px 12px; }
  .zoom-controls button { width: 34px; height: 34px; }
  .step-moments button { white-space: normal; text-align: left; }
  /* tableau « Dans ce pull » : prénom seul, colonnes resserrées, pour tenir sans défilement */
  .step-assign { font-size: 12px; }
  .step-assign th, .step-assign td { padding: 4px 5px; }
  .step-assign .pcell { gap: 6px; }
  .step-assign .pname { display: inline-block; max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
  .step-assign .job-icon { width: 22px; height: 22px; }
  .step-assign .job-icon img { width: 16px; height: 16px; }
  .guide-link { padding: 12px 14px; }
}
