:root { --bg: #0E1726; --card: #16243A; --line: #2A3B55; --fg: #EEF2F7; --muted: #A9B6C8; --gold: #F2C14E; --ok: #3BC48A; --ko: #EF6461; --accent: #4C8DF6; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
[hidden] { display: none !important; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px max(18px, env(safe-area-inset-right, 0px)) 14px max(18px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 20px; letter-spacing: .01em; }
.brand span { color: var(--gold); }
.who { color: var(--muted); font-size: 14px; text-align: right; }
.who b { color: var(--fg); }
main { max-width: 860px; margin: 0 auto; padding: 20px max(18px, env(safe-area-inset-right, 0px)) 40px max(18px, env(safe-area-inset-left, 0px)); }
h1 { font-size: 24px; margin: 6px 0 8px; text-wrap: balance; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lab { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.row.between { justify-content: space-between; }
.row.gap { margin-top: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--fg); border-radius: 999px; padding: 10px 16px; font: inherit; font-size: 15px; cursor: pointer; }
.chip.on { background: var(--gold); border-color: var(--gold); color: #1B2533; font-weight: 700; }
.btn { border: 0; background: var(--gold); color: #1B2533; font: inherit; font-weight: 800; border-radius: 12px; padding: 13px 20px; cursor: pointer; font-size: 16px; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); font-weight: 600; }
.btn.small { padding: 9px 14px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.code { font: 800 64px/1.1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 26px 10px; margin: 18px 0; color: var(--gold); }
.list { display: grid; gap: 12px; margin-top: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card h2 { font-size: 18px; margin: 0; }
.card .short { color: var(--gold); font-size: 14px; font-weight: 600; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }
.card .how { color: var(--fg); font-size: 14px; background: rgba(255,255,255,.05); border-radius: 10px; padding: 8px 10px; }
.best { font-size: 13px; color: var(--muted); white-space: nowrap; }
.best b { color: var(--fg); font-size: 16px; }
.card .btn { justify-self: start; }
.card.off { opacity: .55; }
.foot { margin-top: 18px; }
.score { font-size: 72px; font-weight: 800; line-height: 1; margin: 6px 0; }
.score small { font-size: 24px; color: var(--muted); font-weight: 600; }
.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 14px 0; }
.details div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.details span { display: block; font-size: 12px; color: var(--muted); }
.details b { font-size: 18px; }
.log { display: grid; gap: 4px; font-size: 14px; max-height: 260px; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.log .ok { color: var(--ok); }
.log .ko { color: var(--ko); }
#stage { position: fixed; inset: 0; background: #000; z-index: 10; touch-action: none; }
#stage canvas { display: block; width: 100%; height: 100%; }
.quit { position: absolute; top: max(10px, env(safe-area-inset-top, 0px)); left: max(10px, env(safe-area-inset-left, 0px)); width: 44px; height: 44px; border-radius: 22px; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 20px; cursor: pointer; }
.pad { position: absolute; bottom: max(14px, env(safe-area-inset-bottom, 0px)); left: 0; right: 0; display: flex; justify-content: center; gap: 12px; pointer-events: none; }
.pad button { pointer-events: auto; border: 0; border-radius: 14px; background: rgba(0,0,0,.6); color: #fff; font: 700 18px system-ui, sans-serif; padding: 14px 22px; min-width: 64px; cursor: pointer; }
.prep { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8,14,24,.92); }
.prep-box { text-align: center; max-width: 520px; padding: 20px; }
.prep-title { font-size: 22px; font-weight: 800; }
.prep-count { font-size: 96px; font-weight: 800; color: var(--gold); line-height: 1.1; }
.prep p { color: var(--muted); }

/* Casque à téléphone : réglage de l'image (11/11/2026) */
.carton-box { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 12px 14px; margin: 10px 0 16px; }
.carton-box .lab { margin-bottom: 8px; }
.carton-box .chips { margin-bottom: 10px; }
.carton-box p { margin: 6px 0 0; }
.carton-box .warn { color: #F2C14E; }

/* Revivre une action du Pad */
.pad-box { margin-bottom: 14px; border-color: var(--gold); }
.pad-box select { width: 100%; margin: 10px 0; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); font: inherit; font-size: 16px; }
.pad-box .lab { margin-top: 10px; }
.pad-box .chips { margin-bottom: 4px; }
.pad-box .chip.away { border-style: dashed; }
.pad-box .btn { margin-top: 12px; }

/* Joueurs réalistes / simples */
.look-box { margin-top: 14px; }
.look-box .lab { margin-top: 0; }

/* Réglage de l'image au doigt (casque à téléphone) */
.calib-touch { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 30; background: rgba(8, 14, 26, .92); border: 1px solid rgba(242, 193, 78, .7); border-radius: 16px; padding: 8px 12px 10px; max-width: 96vw; }
.calib-touch .ct-tip { color: #cfd8ea; font-size: 12px; text-align: center; margin-bottom: 6px; }
.calib-touch .ct-row { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.calib-touch .ct-g { display: flex; align-items: center; gap: 6px; color: #fff; font-size: 13px; font-weight: 700; }
.calib-touch button { min-width: 46px; height: 42px; border-radius: 12px; border: 0; background: #1c3157; color: #fff; font-size: 22px; font-weight: 800; }
.calib-touch .ct-done { background: #c8742a; font-size: 15px; padding: 0 16px; }

/* Casque à téléphone : téléphone en portrait, capteurs inactifs (13/11/2026) */
.carton-hint { position: absolute; z-index: 40; left: 50%; transform: translateX(-50%); background: rgba(8, 14, 26, .94); color: #fff; border: 1px solid rgba(242, 193, 78, .8); border-radius: 16px; padding: 12px 16px; font-size: 14px; line-height: 1.4; max-width: min(92vw, 640px); }
.rotate-hint { top: 50%; transform: translate(-50%, -50%); text-align: center; font-size: 18px; }
.rotate-hint .ch-icon { font-size: 54px; line-height: 1; margin-bottom: 8px; }
.sensor-hint { top: 10px; }
.sensor-hint .ch-row { display: flex; gap: 10px; margin-top: 10px; justify-content: flex-end; }
.sensor-hint button { height: 40px; padding: 0 16px; border-radius: 12px; border: 0; background: #1c3157; color: #fff; font-weight: 800; font-size: 14px; }
.sensor-hint #sensor-retry { background: #c8742a; }
.chip.next { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.teambar { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: rgba(242,193,78,.12); border: 1px solid var(--gold); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }

/* Les trois temps d'une stratégie + plan de la situation (20/11/2026) */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.step { text-align: left; border: 1px solid var(--line); background: var(--card); color: var(--fg); border-radius: 14px; padding: 12px 14px; display: grid; gap: 4px; font: inherit; cursor: pointer; align-content: start; min-width: 0; }
.step.on { border-color: var(--gold); background: rgba(242,193,78,.12); }
.step.next { box-shadow: inset 0 0 0 1px var(--gold); border-color: var(--gold); }
.step .n { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .06em; }
.step b { font-size: 17px; }
.step .d { font-size: 13.5px; color: var(--muted); }
.step .st { font-size: 13px; font-weight: 700; color: var(--muted); }
.step .st.ok { color: var(--ok); } .step .st.done { color: var(--gold); }
.place-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.place-col { flex: 1 1 260px; min-width: 0; display: grid; gap: 8px; }
.pad-plan { flex: 0 1 340px; width: 100%; max-width: 340px; max-height: 240px; border-radius: 12px; border: 1px solid var(--line); background: #1F6F4A; }
.pad-plan .pp.can { cursor: pointer; }
.pad-plan text { pointer-events: none; font-family: system-ui, sans-serif; }
.evalbox { display: grid; gap: 6px; margin: 10px 0; }
.evalrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) 90px 70px; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 15px; }
.evalrow .l { font-weight: 800; color: var(--gold); }
.evalrow .bar { height: 8px; border-radius: 4px; background: #243550; overflow: hidden; }
.evalrow .bar i { display: block; height: 100%; background: var(--ok); } .evalrow .bar i.k { background: var(--ko); }
@media (max-width: 620px) { .steps { grid-template-columns: 1fr; } }
