/* Outil d'évaluation — mise en page paysage */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 3px solid var(--orange);
}
.topbar .brand { color: var(--text); text-decoration: none; font-size: 1.1rem; }

#nav { display: flex; gap: 6px; flex: 1; }
#nav a {
  padding: 8px 16px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 600;
}
#nav a:hover { color: var(--text); background: var(--surface-2); }
#nav a.active { color: #1b1100; background: var(--yellow); }

.status { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); }
.status.online { background: var(--teal); }
.status.offline { background: var(--red); }

main { padding: 24px; }
.view { display: none; }
.view.active { display: block; }
.view h1 { margin: 0 0 16px; font-size: 1.8rem; }
.placeholder {
  padding: 32px; border: 2px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); text-align: center;
}

/* ─── Éléments communs des écrans ─── */
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.view-head h1 { margin: 0; }
.muted { color: var(--muted); margin: 0; }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: .35em .8em; }
button.ghost:hover { color: var(--text); border-color: var(--muted); }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: .4em .6em;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--yellow); border-color: transparent; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { border-radius: 999px; padding: .4em 1em; background: var(--surface); color: var(--muted); font-weight: 600; }
.chip .n { margin-left: 8px; font-size: .8em; opacity: .8; }
.chip.on { background: var(--blue); color: #04121f; }

.panel {
  display: grid; grid-template-columns: 1fr 240px; gap: 16px;
  padding: 16px; margin-bottom: 16px; border-radius: var(--radius);
  background: var(--surface); border: 2px solid var(--orange);
}
.panel textarea { width: 100%; resize: vertical; }
.panel-side { display: flex; flex-direction: column; gap: 10px; }
.panel-side label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: .9em; }

table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; color: var(--muted); font-weight: 600; font-size: .85em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.grid td { padding: 6px 8px; border-bottom: 1px solid var(--surface-2); }
.grid tr.archived { opacity: .5; }
.grid input.name { width: 100%; min-width: 160px; }
.grid input.num { width: 64px; }

.seg { display: inline-flex; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.seg button { border-radius: 0; padding: .35em .8em; background: transparent; color: var(--muted); font-weight: 700; }
.seg button.on { background: var(--orange); color: #1b1100; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--teal); color: #032019; font-weight: 700;
  padding: 10px 20px; border-radius: 999px;
}

/* ─── Écran Cinq ─── */
button:disabled { opacity: .35; cursor: not-allowed; }
.role {
  display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 8px;
  border-radius: 6px; font-size: .8em; font-weight: 800; color: #0b1322;
}
.r-M { background: var(--orange); }
.r-I { background: var(--blue); }
.r-P { background: var(--teal); }
.sig { font-weight: 800; letter-spacing: .03em; color: var(--yellow); }
.sig.big { font-size: 1.4rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.archived { opacity: .55; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-head h2 { margin: 0; font-size: 1.15rem; }
.slots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.slots li { display: flex; align-items: center; }
.slots li.gone { text-decoration: line-through; opacity: .6; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.warn { margin: 0; color: var(--red); font-size: .85em; font-weight: 600; }

.panel.editor { grid-template-columns: 1fr 1.2fr; }
.editor-left { display: flex; flex-direction: column; gap: 12px; }
.lineup-name { font-size: 1.15rem; font-weight: 700; }
.editor-sig { display: flex; align-items: center; justify-content: space-between; }
.count { font-weight: 700; color: var(--muted); }
.count.ok { color: var(--teal); }
.slots.edit li { gap: 10px; padding: 6px 8px; background: var(--bg); border-radius: 10px; }
.slot-name { flex: 1; font-weight: 600; }
button.x { padding: .25em .6em; }
.editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: auto; }
.editor-right { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; max-height: 360px; overflow: auto; }
.pool-group { width: 100%; color: var(--muted); font-size: .8em; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.pick { display: inline-flex; align-items: center; background: var(--bg); border: 2px solid var(--line); padding: .35em .8em .35em .4em; }
.pick.on { border-color: var(--yellow); background: var(--surface-2); }
.num-tag { margin-left: 6px; }

/* ─── Écran Séance ─── */
.title-row { display: flex; align-items: center; gap: 16px; }
.panel.new-session { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.panel.new-session label, .block-head label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: .85em; }
.panel.new-session label.grow { flex: 1; min-width: 240px; }
.date-phase { display: flex; align-items: flex-end; gap: 16px; }
.date-phase input[type="date"] { color-scheme: dark; }
.phase-hint { color: var(--muted); font-size: .85em; padding-bottom: 8px; }
.phase-hint.manual { padding-bottom: 0; }
.phase-hint.manual button { color: var(--yellow); border-color: var(--yellow); font-size: .95em; }

.session-list { display: flex; flex-direction: column; gap: 8px; }
.session-row { display: grid; grid-template-columns: 110px 100px 1fr auto; align-items: center; gap: 16px; text-align: left; background: var(--surface); border: 2px solid transparent; }
.session-row:hover { border-color: var(--orange); }
.session-row .date { font-weight: 800; }
.phase-badge { font-size: .8em; font-weight: 800; padding: .2em .7em; border-radius: 999px; color: #0b1322; justify-self: start; }
.phase-badge.p1 { background: var(--teal); }
.phase-badge.p2 { background: var(--blue); }
.phase-badge.p3 { background: var(--orange); }
.phase-badge.p4 { background: var(--yellow); }

.blocks { display: flex; flex-direction: column; gap: 16px; }
.block { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.block-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.block-n { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--orange); color: #1b1100; font-weight: 800; }
.block-head .sig { padding-bottom: 8px; }
input.num { width: 70px; }
.poss-count { margin-left: auto; color: var(--muted); font-size: .85em; padding-bottom: 8px; }
.label-rows { display: flex; flex-direction: column; gap: 6px; }
.label-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fam { width: 190px; font-size: .85em; font-weight: 700; color: var(--muted); }
.fam .mode { margin-left: 6px; font-weight: 400; opacity: .7; }
.tag { padding: .25em .8em; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); font-size: .9em; }
.tag.on { background: var(--blue); border-color: var(--blue); color: #04121f; font-weight: 700; }
.block-actions { display: flex; gap: 8px; align-items: center; }
.spacer { flex: 1; }
.tested { margin-left: 6px; font-size: .75em; font-weight: 800; color: #1b1100; background: var(--yellow); border-radius: 6px; padding: 0 .4em; }
.dup-panel { border-top: 1px dashed var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
button.ghost.on { border-color: var(--yellow); color: var(--yellow); }

/* ─── Barre du haut : sauvegarde ─── */
.topbar .ghost { padding: .35em .9em; }

/* ─── Écran Saisie ─── */
.chooser { margin-bottom: 16px; }
.chooser h2 { font-size: 1rem; color: var(--muted); margin: 0 0 8px; }
.chooser-blocks { display: flex; gap: 8px; flex-wrap: wrap; }

.saisie-head { display: grid; grid-template-columns: 1fr auto auto; gap: 24px; align-items: center; margin-bottom: 16px; }
.saisie-head h1 { margin: 2px 0 6px; font-size: 1.6rem; display: flex; gap: 14px; align-items: baseline; }
.saisie-head h1 .sig { font-size: 1rem; }
.tags-line { display: flex; gap: 6px; flex-wrap: wrap; }
.counter { text-align: center; padding: 8px 20px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--line); }
.counter .big { font-size: 2.6rem; font-weight: 800; }
.counter-label { font-size: .8em; color: var(--muted); }
.counter.reached { border-color: var(--teal); }
.counter.reached .counter-label { color: var(--teal); font-weight: 700; }
.head-actions { display: flex; flex-direction: column; gap: 8px; }

.judge { background: var(--surface); border: 2px solid var(--orange); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.judge.flash { animation: flash .35s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 6px var(--yellow); } to { box-shadow: 0 0 0 0 transparent; } }
.judge-title { font-weight: 800; text-transform: uppercase; letter-spacing: .06em; display: flex; gap: 16px; align-items: center; }
.pending { color: var(--yellow); font-weight: 700; text-transform: none; letter-spacing: 0; }
.key-grid { display: grid; gap: 10px; }
.key-grid.outcomes { grid-template-columns: repeat(5, 1fr); }
.key-grid.results { grid-template-columns: repeat(3, 1fr) 1.3fr; }
.key-btn { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--bg); border: 2px solid var(--line); font-weight: 700; text-align: left; }
.key-btn:hover:not(:disabled) { border-color: var(--orange); }
.key-btn.dim { opacity: .35; }
.key-btn.ready { border-color: var(--yellow); background: var(--surface-2); }
.key-btn.undo { border-color: var(--red); color: var(--red); }
kbd { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 8px;
  background: var(--text); color: var(--bg); font: 800 1rem var(--font); box-shadow: 0 3px 0 var(--muted); }

.history { margin-top: 16px; }
.history h2 { font-size: 1rem; color: var(--muted); margin: 0 0 8px; }
.hist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hist li { background: var(--surface); border-radius: 10px; padding: 8px 12px; }
.hist li:first-child { outline: 2px solid var(--yellow); }
.hist .seq { color: var(--muted); margin-right: 8px; }
.hist .pts { margin-left: 8px; color: var(--yellow); font-weight: 700; }

.panel.keys-panel { grid-template-columns: 1fr 260px; }
.keys-list { display: flex; flex-direction: column; gap: 6px; }
.key-row { display: grid; grid-template-columns: 1fr 200px auto; align-items: center; gap: 12px; }
.keys-side { display: flex; flex-direction: column; gap: 12px; }

/* ─── T2 : deux juges côte à côte ─── */
.head-actions.row { flex-direction: row; }
.judges { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
#judge-defense { border-color: var(--blue); }
.judge-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.judge-title { flex-direction: column; align-items: flex-start; gap: 4px; }
.counter.small { padding: 4px 14px; }
.counter.small .big { font-size: 1.8rem; }
.key-grid.g3 { grid-template-columns: repeat(3, 1fr); }
.key-grid.g4 { grid-template-columns: repeat(4, 1fr); }
.key-btn { padding: 10px; gap: 8px; font-size: .92rem; }
.chrono-row { display: flex; align-items: center; gap: 16px; }
.chrono-btn { flex: 0 0 auto; }
.chrono { font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--muted); }
.chrono.on { color: var(--yellow); }
.judge .hist { grid-template-columns: repeat(3, 1fr); }
.lineup-panel { display: flex; flex-direction: column; gap: 10px; }

/* ─── Écran Libellés ─── */
.fam-list { display: flex; flex-direction: column; gap: 12px; }
.fam-card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.fam-card.archived { opacity: .5; }
.fam-head { display: flex; align-items: center; gap: 10px; }
.fam-name { font-weight: 800; font-size: 1.05rem; width: 280px; }
.label-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.label-item { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border-radius: 999px; padding: 2px 4px 2px 2px; }
.label-item input { border-radius: 999px; width: auto; border-color: transparent; background: transparent; }
.label-item.archived { opacity: .5; text-decoration: line-through; }
.label-new { width: 180px; border-style: dashed; }
.toast.warn { background: var(--red); color: #2a0509; }
.card-actions button { padding: .3em .7em; font-size: .9em; }
.card-head .sig { white-space: nowrap; }

/* ─── T3 : Stats ─── */
.big-seg button { padding: .5em 1.1em; }
.stats-filters { display: flex; flex-direction: column; gap: 12px; }
.stats-filters > label { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.small { font-size: .85em; }
button.small-btn { align-self: flex-start; font-size: .85em; }
.summary { margin: 0 0 12px; }
.stats-block { margin-bottom: 20px; }
.stats-block h2 { font-size: 1.05rem; margin: 0 0 8px; }
table.stats td, table.stats th { text-align: right; font-variant-numeric: tabular-nums; }
table.stats td.row-name, table.stats th:first-child { text-align: left; font-weight: 700; }
table.stats tr.low td, table.stats td.low-cell { color: var(--muted); }
.sample { margin-left: 8px; font-size: .75em; font-weight: 700; color: var(--bg); background: var(--muted); border-radius: 6px; padding: 0 .4em; }
.diff { font-weight: 800; }
.diff.up { color: var(--teal); }
.diff.down { color: var(--red); }
.verdict { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; font-weight: 700; }
.verdict.ok { background: color-mix(in srgb, var(--teal) 18%, transparent); color: var(--teal); }
.verdict.wait { background: color-mix(in srgb, var(--yellow) 15%, transparent); color: var(--yellow); }
.context-warn { border: 2px solid var(--orange); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.context-warn ul { margin: 6px 0 0; padding-left: 20px; }
.coach-note { border-left: 4px solid var(--yellow); padding: 8px 12px; margin-bottom: 12px; color: var(--muted); background: var(--surface); }

/* ─── Récap de fin de bloc ─── */
.panel.recap { display: flex; flex-direction: column; gap: 12px; border-color: var(--teal); }
.recap h2 { margin: 0; }
.recap h3 { margin: 0 0 8px; font-size: .95rem; color: var(--muted); }
.recap-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { background: var(--bg); border-radius: 10px; padding: 10px; text-align: center; }
.tile-v { font-size: 1.5rem; font-weight: 800; }
.tile-l { font-size: .8em; color: var(--muted); }
