/* =====================================================================
   Dilemme — feuille de style (charte Cog'X : IBM Plex, navy #230F46, teal #28D2C3)
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[v-cloak] { display: none; }
[hidden] { display: none !important; }

:root {
  --bg: #F0F1F1; --surface: #FFFFFF; --surface-2: #F7F7F8; --border: #D8DADB; --border-strong: #B0B4B6;
  --text: #230F46; --text-muted: #6B6880; --text-soft: #8E8BA3;
  --teal: #28D2C3; --teal-light: #E6FAF8; --teal-dark: #0D7A72;
  --red: #C94040; --red-light: #FCEBEB; --red-dark: #7A2020;
  --amber: #FFC33C; --amber-light: #FFF6DC; --amber-dark: #8A6200;
  --navy: #230F46; --navy-light: #EDE9F5; --navy-dark: #120828;
  --blue: #2F6FD6; --blue-light: #EAF1FC; --blue-dark: #1B4494;
  --team-a: #230F46; --team-a-light: #EDE9F5; --team-a-dark: #120828; --team-a-text: #fff;
  --team-b: #28D2C3; --team-b-light: #E6FAF8; --team-b-dark: #0D7A72; --team-b-text: #072E2B;
  --team-c: #FFC33C; --team-c-light: #FFF6DC; --team-c-dark: #8A6200; --team-c-text: #3A2A00;
  --team-d: #E8735A; --team-d-light: #FCEAE5; --team-d-dark: #8F3A26; --team-d-text: #fff;
  --radius: 10px; --radius-lg: 14px; --radius-sm: 6px;
  --shadow: 0 8px 32px rgba(35,15,70,0.12);
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: 16px;
}
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.5; font-size: 15px;
  padding-block: env(safe-area-inset-top, 0px) env(safe-area-inset-bottom, 0px); }
a { color: var(--teal-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--navy-light); padding: 1px 5px; border-radius: 4px; }
.noscript { padding: 2rem; text-align: center; }

/* ---------- layout ---------- */
.app { width: 100%; max-width: 680px; margin: 0 auto; padding: 1rem var(--gutter) 3rem; }
.app.narrow { max-width: 520px; }
.app.wide { max-width: 1140px; }
.app.full { max-width: none; }
.center { text-align: center; }
.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); }
.small { font-size: 13px; }
.tiny { font-size: 11px; }
.mono { font-family: var(--mono); }
.h1 { font-size: 28px; font-weight: 700; line-height: 1.2; margin-bottom: .25rem; }
.h2 { font-size: 20px; font-weight: 600; line-height: 1.3; }
.h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: .6rem; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 1rem; } .mt-s { margin-top: .5rem; } .mt-l { margin-top: 1.5rem; } .mb { margin-bottom: 1rem; } .mb-s { margin-bottom: .5rem; }
.logo-img { height: 32px; width: auto; display: block; margin-bottom: 1rem; }

/* ---------- topbar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: .5rem 0 1rem; flex-wrap: wrap; }
.topbar .brand { display: flex; align-items: center; gap: 10px; }
.topbar .brand img { height: 26px; width: auto; }
.topbar .brand .name { font-family: var(--mono); font-size: 14px; letter-spacing: .05em; color: var(--text); }
.topbar .brand .name span { color: var(--teal); }
.topbar nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.topbar nav a { color: var(--text-muted); text-decoration: none; font-size: 13px; padding: 6px 10px; border-radius: var(--radius-sm); }
.topbar nav a:hover, .topbar nav a.active { background: var(--navy-light); color: var(--text); }
.session-code { font-family: var(--mono); font-size: 15px; letter-spacing: .12em; background: var(--surface); border: 1px solid var(--border); padding: 5px 10px; border-radius: var(--radius-sm); }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius); font-size: 14px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); text-decoration: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--navy-light); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-teal { background: var(--teal); border-color: var(--teal); color: var(--team-b-text); }
.btn-teal:hover { background: #1FB8AB; }
.btn-danger { background: var(--red-light); border-color: var(--red); color: var(--red-dark); }
.btn-danger:hover { background: #F7D6D6; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--border); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-xs { padding: 3px 8px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-team-a { background: var(--team-a); border-color: var(--team-a); color: var(--team-a-text); }
.btn-team-b { background: var(--team-b); border-color: var(--team-b); color: var(--team-b-text); }
.btn-team-c { background: var(--team-c); border-color: var(--team-c); color: var(--team-c-text); }
.btn-team-d { background: var(--team-d); border-color: var(--team-d); color: var(--team-d-text); }
.btn-team-a:hover { background: var(--team-a-dark); } .btn-team-b:hover { background: #1FB8AB; } .btn-team-c:hover { background: #E8AE2A; } .btn-team-d:hover { background: #D45F45; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: .75rem; }

/* ---------- formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=url], .field select, .field textarea, .input {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; background: var(--surface); color: var(--text); font-size: 15px; }
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-light); }
.field .hint { font-size: 12px; color: var(--text-soft); }
.input-code { font-family: var(--mono); font-size: 26px !important; letter-spacing: .3em; text-transform: uppercase; text-align: center; padding: 12px !important; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--teal-dark); }
.check .desc { display: block; font-size: 12px; color: var(--text-soft); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6880' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px !important; }

/* ---------- cartes / notices ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: .75rem; }
.card.tight { padding: 1rem; }
.card-meta { font-size: 11px; color: var(--text-muted); font-family: var(--mono); margin-bottom: .6rem; letter-spacing: .04em; text-transform: uppercase; display: flex; justify-content: space-between; gap: 8px; }
.card-question { font-size: 16px; line-height: 1.6; color: var(--text); margin-bottom: 1rem; }
.notice { border-radius: var(--radius); padding: 10px 14px; font-size: 14px; border: 1px solid transparent; }
.notice-ok { background: var(--teal-light); border-color: var(--teal); color: var(--teal-dark); }
.notice-warn { background: var(--amber-light); border-color: var(--amber); color: var(--amber-dark); }
.notice-err { background: var(--red-light); border-color: var(--red); color: var(--red-dark); }
.notice-info { background: var(--blue-light); border-color: #B5D4F4; color: var(--blue-dark); }
.notice ul { padding-left: 1.2rem; margin-top: .4rem; }

/* ---------- badges ---------- */
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; letter-spacing: .03em; white-space: nowrap; }
.badge-concentration { background: var(--teal-light); color: var(--teal-dark); }
.badge-planification { background: var(--amber-light); color: var(--amber-dark); }
.badge-recuperation { background: var(--navy-light); color: var(--navy); }
.badge-quiz { background: var(--amber-light); color: var(--amber-dark); border: 1px solid var(--amber); }
.badge-neutral { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.badge-status-lobby { background: var(--blue-light); color: var(--blue-dark); }
.badge-status-playing { background: var(--teal-light); color: var(--teal-dark); }
.badge-status-ended { background: var(--surface-2); color: var(--text-muted); }
.badge-role { background: var(--navy-light); color: var(--navy); }

/* ---------- équipes / gemmes / scores ---------- */
.team-a { --tc: var(--team-a); --tc-light: var(--team-a-light); --tc-dark: var(--team-a-dark); --tc-text: var(--team-a-text); }
.team-b { --tc: var(--team-b); --tc-light: var(--team-b-light); --tc-dark: var(--team-b-dark); --tc-text: var(--team-b-text); }
.team-c { --tc: var(--team-c); --tc-light: var(--team-c-light); --tc-dark: var(--team-c-dark); --tc-text: var(--team-c-text); }
.team-d { --tc: var(--team-d); --tc-light: var(--team-d-light); --tc-dark: var(--team-d-dark); --tc-text: var(--team-d-text); }
.gems { display: flex; gap: 3px; flex-wrap: wrap; max-width: 140px; }
.gem { width: 11px; height: 11px; border-radius: 50%; background: var(--border); transition: background .3s, transform .3s; }
.gem.on { background: var(--tc); }
.gem.lost { animation: gemLost .6s ease-out; }
@keyframes gemLost { 0% { transform: scale(1.4); background: var(--red); } 100% { transform: scale(1); } }
.gems.lg .gem { width: 18px; height: 18px; }
.scores-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 1rem; }
.score-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; transition: border-color .2s, background .2s; min-width: 0; }
.score-card.active { border-color: var(--tc); background: var(--tc-light); }
.score-card .sc-left { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.score-card .sc-team { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-card.active .sc-team { color: var(--tc-dark); }
.score-card .sc-members { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-card .sc-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.score-num { font-family: var(--mono); font-size: 18px; font-weight: 500; }
.score-card.active .score-num { color: var(--tc-dark); }
.team-banner { border-radius: var(--radius-lg); padding: 12px 16px; margin-bottom: .75rem; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--tc-light); border: 1.5px solid var(--tc); }
.team-banner .tb-turn { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--tc-dark); }
.team-banner .tb-name { font-size: 16px; font-weight: 700; }
.team-banner .tb-sub { font-size: 13px; color: var(--text-muted); }
.team-banner.mine { box-shadow: 0 0 0 3px var(--tc-light); }

/* ---------- chrono ---------- */
.chrono { font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; letter-spacing: .04em; white-space: nowrap; }
.chrono.warning { color: var(--red); border-color: var(--red); background: var(--red-light); }
.chrono.paused { color: var(--amber-dark); border-color: var(--amber); background: var(--amber-light); }
.chrono.over { color: #fff; background: var(--red); border-color: var(--red); }

/* ---------- options ---------- */
.progress-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; gap: 8px; }
.progress-text { font-size: 12px; color: var(--text-muted); font-family: var(--mono); }
.options { display: flex; flex-direction: column; gap: 8px; }
.option { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--bg);
  font-size: 15px; color: var(--text); cursor: pointer; text-align: left; line-height: 1.45; transition: border-color .15s, background .15s; width: 100%; overflow: hidden; }
.option:hover:not(:disabled):not(.static) { border-color: var(--border-strong); background: #E9E9EB; }
.option:disabled, .option.static { cursor: default; }
.option .opt-num { font-family: var(--mono); font-size: 12px; color: var(--text-muted); flex-shrink: 0; width: 18px; }
.option .opt-text { flex: 1; position: relative; }
.option .opt-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; position: relative; }
.option.selected { border-color: var(--tc); background: var(--tc-light); color: var(--tc-dark); font-weight: 500; }
.option.selected .opt-num { color: var(--tc-dark); }
.option.rev-pos { border-color: var(--teal); background: var(--teal-light); color: var(--teal-dark); }
.option.rev-neg { border-color: var(--red); background: var(--red-light); color: var(--red-dark); }
.option.rev-zero { border-color: var(--amber); background: var(--amber-light); color: var(--amber-dark); }
.option.chosen { border-width: 3px; font-weight: 600; }
.option.tie { border-color: var(--amber); background: var(--amber-light); border-style: dashed; }
.option.correct { border-color: var(--teal); background: var(--teal-light); color: var(--teal-dark); border-width: 3px; font-weight: 600; }
.option.wrong { border-color: var(--red); background: var(--red-light); color: var(--red-dark); border-width: 3px; }
.option .tally-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(35,15,70,0.07); transition: width .4s ease; pointer-events: none; }
.option.rev-pos .tally-fill { background: rgba(13,122,114,0.10); }
.option.rev-neg .tally-fill { background: rgba(201,64,64,0.10); }
.option.rev-zero .tally-fill { background: rgba(138,98,0,0.10); }
.score-pill { font-family: var(--mono); font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 6px; min-width: 38px; text-align: center; }
.score-pill.pos { background: var(--teal-dark); color: #BFF3EC; }
.score-pill.neg { background: var(--red-dark); color: #F7C1C1; }
.score-pill.zero { background: var(--amber-dark); color: #FFE7A8; }
.tally-count { font-family: var(--mono); font-size: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1px 8px; color: var(--text-muted); }
.vote-check { font-size: 14px; color: var(--tc-dark); }
.result-phrase { font-size: 15px; line-height: 1.6; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); font-weight: 500; }
.result-phrase.gain { color: var(--teal-dark); }
.result-phrase.perte { color: var(--red-dark); }
.result-phrase.neutre { color: var(--amber-dark); }
.explication { margin-top: .75rem; padding: .875rem 1rem; background: var(--bg); border-radius: var(--radius); font-size: 14px; color: var(--text-muted); line-height: 1.65; }
.disc-box { background: var(--blue-light); border: 1px solid #B5D4F4; border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin-bottom: .75rem; }
.disc-label { font-size: 11px; font-weight: 600; color: var(--blue); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .35rem; }
.disc-q { font-size: 15px; color: var(--blue-dark); line-height: 1.6; }
.quiz-notice { background: var(--amber-light); border: 1px solid var(--amber); border-radius: var(--radius); padding: 10px 14px; font-size: 14px; color: var(--amber-dark); margin-bottom: .75rem; }
.quiz-img { width: 100%; height: 150px; object-fit: cover; display: block; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.card.quiz-card { padding: 0; overflow: hidden; border-color: #E8D9A0; }
.quiz-card-body { padding: 1.25rem; }
.vote-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin-top: .75rem; flex-wrap: wrap; }
.voter-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 8px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); }
.voter-chip.voted { background: var(--teal-light); border-color: var(--teal); color: var(--teal-dark); }
.voter-chip.off { opacity: .55; }
.waiting { text-align: center; padding: 2rem 1rem; color: var(--text-muted); }
.waiting .pulse { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); animation: pulse 1.2s infinite; margin-right: 8px; }
@keyframes pulse { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }

/* ---------- overlays ---------- */
.countdown-overlay { position: fixed; inset: 0; background: rgba(35,15,70,0.88); display: flex; align-items: center; justify-content: center; z-index: 200; text-align: center; padding: 1rem; }
.countdown-overlay .co-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--teal); margin-bottom: .5rem; }
.countdown-overlay .co-name { font-size: 26px; font-weight: 700; color: #fff; margin-bottom: .25rem; }
.countdown-overlay .co-sub { font-size: 14px; color: rgba(255,255,255,.65); margin-bottom: 1.25rem; }
.countdown-num { font-family: var(--mono); font-size: 110px; font-weight: 700; color: var(--teal); line-height: 1; animation: countPop .4s ease-out; }
@keyframes countPop { from { transform: scale(1.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-overlay { position: fixed; inset: 0; background: rgba(18,8,40,0.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 1rem; }
.modal { background: var(--surface); border-radius: var(--radius-lg); padding: 1.75rem; max-width: 440px; width: 100%; box-shadow: var(--shadow); max-height: 90vh; overflow: auto; }
.modal.wide { max-width: 720px; }
.modal h3 { font-size: 18px; font-weight: 600; margin-bottom: .5rem; }
.modal p { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 1rem; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 30px; font-size: 14px; box-shadow: var(--shadow); z-index: 300; max-width: calc(100% - 32px); text-align: center; }
.toast.err { background: var(--red); }

/* ---------- lobby / joueurs ---------- */
.lobby-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.lobby-team { background: var(--surface); border: 1.5px solid var(--tc); border-radius: var(--radius); padding: 12px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; }
.lobby-team.drop-target { background: var(--tc-light); }
.lobby-team .lt-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.lobby-team .lt-name { font-weight: 700; color: var(--tc-dark); display: flex; align-items: center; gap: 6px; min-width: 0; }
.lobby-team .lt-name input { border: none; border-bottom: 1px dashed var(--border-strong); background: transparent; font-weight: 700; width: 100%; padding: 2px 0; color: var(--tc-dark); }
.lobby-team .lt-name input:focus { outline: none; border-bottom-color: var(--tc); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tc); display: inline-block; flex-shrink: 0; }
.players { display: flex; flex-wrap: wrap; gap: 6px; }
.player-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; padding: 4px 10px 4px 8px; font-size: 13px; }
.player-chip .presence { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.player-chip.on .presence { background: var(--teal); }
.player-chip.me { border-color: var(--navy); background: var(--navy-light); }
.player-chip .cap { font-size: 11px; }
.player-chip select { border: none; background: transparent; font-size: 12px; color: var(--text-muted); padding: 0 14px 0 2px; background-position: right 0 center; cursor: pointer; }
.player-chip button { border: none; background: none; cursor: pointer; color: var(--text-soft); font-size: 14px; line-height: 1; padding: 0 2px; }
.player-chip button:hover { color: var(--red); }
.join-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.join-box .qr { width: 120px; height: 120px; flex-shrink: 0; }
.join-box .qr img, .join-box .qr canvas { width: 120px !important; height: 120px !important; }
.join-box .code-big { font-family: var(--mono); font-size: 34px; letter-spacing: .2em; font-weight: 500; }
.join-box .link { font-size: 13px; word-break: break-all; }
.rules { display: flex; flex-direction: column; gap: 8px; }
.rule { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; font-size: 14px; line-height: 1.5; }
.rule-num { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--teal-dark); background: var(--teal-light); border-radius: 6px; padding: 2px 7px; flex-shrink: 0; margin-top: 1px; }

/* ---------- régie animateur ---------- */
.host-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .host-layout { grid-template-columns: 1fr; } }
.side { position: sticky; top: 8px; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 900px) { .side { position: static; } }
.control-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px 12px; margin-bottom: .75rem; }
.control-bar .sep { width: 1px; height: 22px; background: var(--border); }
.kv { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.kv:last-child { border-bottom: none; }
.theme-scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: .5rem; }
.theme-score { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 8px; text-align: center; }
.theme-score .ts-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.theme-score .ts-val { font-family: var(--mono); font-size: 14px; font-weight: 500; }
.history { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.history-item { display: flex; gap: 8px; align-items: center; font-size: 12px; padding: 6px 8px; background: var(--surface-2); border-radius: var(--radius-sm); }
.history-item .hi-n { font-family: var(--mono); color: var(--text-soft); width: 20px; }
.history-item .hi-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- fin de partie ---------- */
.end-screen { text-align: center; padding: 1.5rem .25rem; }
.end-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 1.25rem 0; }
.end-score-card { border-radius: var(--radius-lg); padding: 1.25rem .75rem; border: 2px solid var(--tc); background: var(--tc-light); position: relative; }
.end-score-card .esc-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--tc-dark); margin-bottom: 4px; }
.end-score-card .esc-members { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; min-height: 18px; }
.end-score-card .esc-score { font-family: var(--mono); font-size: 44px; font-weight: 500; line-height: 1; color: var(--tc-dark); }
.esc-score small { font-size: 18px; color: var(--text-muted); }
.winner-badge { display: inline-block; font-size: 11px; font-weight: 600; background: var(--teal); color: var(--team-b-text); border-radius: 20px; padding: 2px 10px; margin-top: 8px; }
.end-themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 1rem 0; }
@media (max-width: 480px) { .end-themes { grid-template-columns: 1fr; } }
.end-theme { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.end-theme .et-label { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.end-theme .et-scores { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.end-theme .et-score { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--tc-dark); }
.end-msg { font-size: 15px; color: var(--text-muted); max-width: 420px; margin: 0 auto 1rem; line-height: 1.6; }

/* ---------- tableaux (admin) ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); background: var(--surface-2); white-space: nowrap; }
.table tr:last-child td { border-bottom: none; }
.table td.actions { white-space: nowrap; text-align: right; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs button { background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 14px; cursor: pointer; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.tabs button.active { color: var(--text); border-bottom-color: var(--teal); }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat-tile .st-val { font-family: var(--mono); font-size: 26px; font-weight: 500; }
.stat-tile .st-label { font-size: 12px; color: var(--text-muted); }
.option-editor { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.option-editor input[type=text] { flex: 1; }
.option-editor input[type=number] { width: 72px; }
.option-editor input[type=radio] { accent-color: var(--teal-dark); }
.session-list { display: flex; flex-direction: column; gap: 8px; }
.session-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.session-item .si-title { font-weight: 600; }
.session-item .si-meta { font-size: 12px; color: var(--text-muted); }

/* ---------- écran de projection ---------- */
body.page-screen { background: #150A2E; color: #fff;
  /* l'équipe A (navy) doit rester lisible sur fond sombre */
  --team-a: #A08BE6; --team-a-light: rgba(160,139,230,.18); --team-a-dark: #CDBFF7; --team-a-text: #120828;
  --team-b-dark: #7FEBDF; --team-c-dark: #FFD980; --team-d-dark: #FFB3A1; }
.screen { max-width: 1200px; margin: 0 auto; padding: 1rem var(--gutter) 2rem; min-height: 100vh; display: flex; flex-direction: column; gap: 16px; }
.screen .topbar nav a { color: rgba(255,255,255,.7); }
.screen .brand .name { color: #fff; }
.screen .session-code { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; font-size: 20px; }
.screen .chrono { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; font-size: 22px; padding: 6px 14px; }
.screen .chrono.warning { background: var(--red); color: #fff; }
.screen .chrono.paused { background: var(--amber); color: #3A2A00; }
.screen-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 16px; align-items: start; flex: 1; }
@media (max-width: 800px) { .screen-grid { grid-template-columns: 1fr; } }
.screen .card { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #fff; }
.screen .card-question { font-size: clamp(17px, 2vw, 22px); color: #fff; }
.screen .card-meta { color: rgba(255,255,255,.6); }
.screen .option { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.15); color: #fff; font-size: clamp(15px, 1.6vw, 19px); }
.screen .option .opt-num { color: rgba(255,255,255,.6); }
.screen .option.rev-pos { background: rgba(40,210,195,.18); border-color: var(--teal); color: #BFF3EC; }
.screen .option.rev-neg { background: rgba(201,64,64,.2); border-color: #E86A6A; color: #FFD0D0; }
.screen .option.rev-zero { background: rgba(255,195,60,.18); border-color: var(--amber); color: #FFE7A8; }
.screen .option.correct { background: rgba(40,210,195,.2); border-color: var(--teal); color: #BFF3EC; }
.screen .option.wrong { background: rgba(201,64,64,.2); border-color: #E86A6A; color: #FFD0D0; }
.screen .option .tally-fill { background: rgba(255,255,255,.10); }
.screen .tally-count { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.screen .explication { background: rgba(255,255,255,.06); color: rgba(255,255,255,.85); }
.screen .disc-box { background: rgba(47,111,214,.18); border-color: rgba(47,111,214,.5); }
.screen .disc-label { color: #9CC1FF; }
.screen .disc-q { color: #fff; }
.screen .result-phrase { border-top-color: rgba(255,255,255,.15); }
.screen .result-phrase.gain { color: #7FEBDF; } .screen .result-phrase.perte { color: #FF9F9F; } .screen .result-phrase.neutre { color: #FFD980; }
.screen .quiz-notice { background: rgba(255,195,60,.15); color: #FFE7A8; }
.screen .team-banner { background: rgba(255,255,255,.06); }
.screen .team-banner .tb-turn { color: var(--tc); }
.screen .team-banner .tb-sub { color: rgba(255,255,255,.6); }
.screen .score-card { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }
.screen .score-card.active { background: rgba(255,255,255,.12); border-color: var(--tc); }
.screen .score-card .sc-team, .screen .score-card .sc-members { color: rgba(255,255,255,.7); }
.screen .score-card.active .sc-team { color: #fff; }
.screen .score-card.active .score-num { color: #fff; }
.screen .score-num { font-size: 26px; }
.screen .gem { background: rgba(255,255,255,.15); }
.screen .gem.on { background: var(--tc); }
.screen .gems { max-width: 200px; }
.screen .gems .gem { width: 14px; height: 14px; }
.screen .voter-chip { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.15); color: rgba(255,255,255,.7); }
.screen .voter-chip.voted { background: rgba(40,210,195,.2); border-color: var(--teal); color: #BFF3EC; }
.screen .vote-status { color: rgba(255,255,255,.7); }
.screen .waiting { color: rgba(255,255,255,.7); }
.screen .end-score-card { background: rgba(255,255,255,.06); }
.screen .end-score-card .esc-score { color: #fff; }
.screen .end-score-card .esc-label { color: var(--tc); }
.screen .end-theme { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }
.screen .end-theme .et-score { color: var(--tc); }
.screen .end-msg, .screen .muted { color: rgba(255,255,255,.7); }
.screen .join-hint { text-align: center; font-size: 14px; color: rgba(255,255,255,.6); }
.screen .join-hint strong { color: #fff; font-family: var(--mono); letter-spacing: .15em; font-size: 18px; }
.screen .lobby-team { background: rgba(255,255,255,.06); }
.screen .lobby-team .lt-name { color: var(--tc); }
.screen .player-chip { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); color: #fff; }
.screen .badge-neutral { background: rgba(255,255,255,.1); color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.2); }
.screen .h1, .screen .h2 { color: #fff; }

/* ---------- divers ---------- */
.fade-enter-active, .fade-leave-active { transition: opacity .25s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.offline-bar { position: fixed; top: 0; left: 0; right: 0; background: var(--red); color: #fff; text-align: center; font-size: 13px; padding: 6px; z-index: 400; }
@media (max-width: 480px) {
  body { font-size: 14px; }
  .app { padding-top: .5rem; }
  .card { padding: 1rem; }
  .h1 { font-size: 24px; }
  .btn { padding: 10px 14px; }
  .countdown-num { font-size: 84px; }
}

/* ---------- ajustements : panneaux latéraux étroits ---------- */
.side .scores-panel, .screen-grid > div:last-child .scores-panel { grid-template-columns: 1fr; }
.side .score-card .sc-members { max-width: 150px; }
.score-card .sc-left { flex: 1; }
@media (max-width: 560px) {
  .scores-panel { grid-template-columns: 1fr; gap: 6px; }
  .score-card { padding: 8px 12px; }
}
.voter-names { display: block; margin-top: 4px; }
.voter-name { display: inline-block; font-size: 11px; font-weight: 500; background: rgba(35,15,70,0.08); border-radius: 10px; padding: 1px 7px; margin: 2px 4px 0 0; color: var(--text-muted); }
.screen .voter-name { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.8); }
@media (max-width: 480px) {
  /* sur téléphone, le score et le compteur de votes passent sous le texte de l'option */
  .option { flex-wrap: wrap; row-gap: 4px; }
  .option .opt-text { flex: 1 1 calc(100% - 32px); }
  .option .opt-right { width: 100%; justify-content: flex-end; }
}
.gem-extra { font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-left: 3px; align-self: center; }
.screen .gem-extra { color: rgba(255,255,255,.7); }
/* actions secondaires du pilotage, repliées derrière « ⋯ » pour éviter les clics accidentels */
.control-more { flex-basis: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 10px; }
