@font-face { font-family: 'Oswald'; src: url('/fonts/Oswald.ttf') format('truetype'); font-weight: 200 700; font-display: swap; }
:root {
  --bg: #0b0c0e; --fg: #f3f3f1; --dim: #a4a6aa; --line: rgba(255,255,255,.16); --red: #d7262e;
  --display: 'Oswald', 'Arial Narrow', 'Bahnschrift', Impact, sans-serif;
  --text: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font-family: var(--text); overflow: hidden; -webkit-tap-highlight-color: transparent; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--fg); }
[hidden] { display: none !important; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 55%, transparent 55%, rgba(0,0,0,.55) 100%), linear-gradient(to bottom, rgba(0,0,0,.55), transparent 22%, transparent 70%, rgba(0,0,0,.65)); }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; }

/* ------------------------------------------------------------ haut ---- */
#top { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: calc(10px + var(--sat)) 14px 0; z-index: 5; }
.badge { font: 600 13px/1 var(--display); letter-spacing: .12em; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); background: rgba(0,0,0,.35); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.top-actions { display: flex; gap: 8px; }
.chip { font: 500 12px/1 var(--display); letter-spacing: .12em; padding: 8px 11px; background: rgba(0,0,0,.4); border: 1px solid var(--line); }
.chip[aria-pressed="true"] { background: var(--fg); color: #000; }
#simbanner { position: fixed; top: calc(48px + var(--sat)); left: 0; right: 0; z-index: 6; text-align: center; font: 500 13px/1.3 var(--display); letter-spacing: .08em; background: var(--red); color: #fff; padding: 6px 10px; text-transform: uppercase; }
#simbanner b { font-weight: 700; letter-spacing: .18em; }
#phasebanner { position: fixed; top: calc(48px + var(--sat)); left: 0; right: 0; z-index: 6; text-align: center; font: 500 11.5px/1.3 var(--display); letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #e9e9e6; color: #111; padding: 5px 10px; text-transform: uppercase; }
#phasebanner b { font-weight: 700; letter-spacing: .18em; color: var(--red); }
body.phase-avant #counter { top: calc(78px + var(--sat)); }
#hud-phase { margin-top: 6px; font: 600 13px/1.2 var(--display); letter-spacing: .14em; color: var(--fg); }
#hud-phase.live { color: #fff; background: var(--red); display: inline-block; padding: 4px 10px; }
.edate { font: 700 clamp(20px, 6.2vw, 34px)/1 var(--display); letter-spacing: .12em; color: var(--red); }
.subtitle { font: 500 clamp(17px, 5vw, 22px)/1.25 var(--display); letter-spacing: .04em; margin: -4px 0 0; }
.rule { font: 600 16px/1.3 var(--display); letter-spacing: .06em; margin: 0; }
.countdown { font: 600 clamp(17px, 5.2vw, 26px)/1.1 var(--display); letter-spacing: .05em; font-variant-numeric: tabular-nums; border: 1px solid var(--line); padding: 8px; }
.countdown.live { background: var(--red); border-color: var(--red); color: #fff; }
.note { font-size: 13.5px; line-height: 1.45; color: #cfcfcc; margin: -4px 0 0; }
#landing .landing-inner { gap: 11px; padding: 4px 0; }
#landing h1 { font-size: clamp(38px, 11.5vw, 76px); }
#landing .lead { font-size: 15px; line-height: 1.4; }
#landing { align-items: flex-start; }
@media (min-height: 860px) { #landing { align-items: center; } }
body.sim .badge { border-color: var(--red); }
body.landing #counter, body.landing #bottom, body.landing #me-label, body.landing #phasebanner, body.landing #top { visibility: hidden; }
#landing { background: linear-gradient(to bottom, rgba(5,6,8,.9), rgba(5,6,8,.72) 45%, rgba(5,6,8,.95)); }

/* ------------------------------------------------------- compteur ---- */
#counter { position: fixed; top: calc(52px + var(--sat)); left: 0; right: 0; text-align: center; z-index: 4; pointer-events: none; text-shadow: 0 2px 18px rgba(0,0,0,.8); }
body.sim #counter { top: calc(86px + var(--sat)); }
.lbl { font: 500 12px/1 var(--display); letter-spacing: .22em; color: var(--dim); }
.big { font: 600 clamp(56px, 17vw, 108px)/1 var(--display); letter-spacing: .01em; font-variant-numeric: tabular-nums; margin: 6px 0 4px; transition: transform .25s; }
.big.bump { transform: scale(1.06); }
#counter .sub { font: 500 16px/1 var(--display); letter-spacing: .06em; }
#counter .sub b { font-weight: 600; font-variant-numeric: tabular-nums; }

#me-label { position: fixed; left: 0; top: 0; z-index: 3; pointer-events: none; font: 700 13px/1 var(--display); letter-spacing: .2em; background: var(--red); color: #fff; padding: 5px 8px; transform: translate(-50%, -100%); white-space: nowrap; }
#me-label::after { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--red); }

/* ------------------------------------------------------------ bas ---- */
#bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 0 14px calc(14px + var(--sab)); display: flex; flex-direction: column; gap: 10px; align-items: stretch; max-width: 560px; margin: 0 auto; }
#legend { font: 400 12px/1.3 var(--text); color: var(--dim); text-align: center; text-shadow: 0 1px 8px #000; }
#camrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
#camlabel { font: 500 12px/1.2 var(--display); letter-spacing: .14em; color: var(--fg); text-shadow: 0 1px 8px #000; }
#cams { display: flex; gap: 5px; }
#cams button { min-width: 36px; height: 36px; padding: 0 8px; font: 600 13px/1 var(--display); letter-spacing: .08em; background: rgba(0,0,0,.45); border: 1px solid var(--line); }
#cams button.on { background: var(--fg); color: #000; }
.primary { background: var(--fg); color: #000; border: 0; font: 700 20px/1 var(--display); letter-spacing: .16em; padding: 18px 20px; width: 100%; transition: transform .1s, background .2s; }
.primary:active { transform: scale(.98); }
.primary:hover { background: #fff; }
.primary[disabled] { opacity: .5; }
.ghost { background: transparent; border: 1px solid rgba(255,255,255,.45); color: var(--fg); font: 500 14px/1 var(--display); letter-spacing: .12em; padding: 13px 16px; text-align: center; text-decoration: none; }
#joined { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: rgba(0,0,0,.6); border: 1px solid var(--red); padding: 8px 8px 8px 14px; }
.joined-txt { font: 600 15px/1.2 var(--display); letter-spacing: .1em; display: flex; align-items: center; gap: 9px; }
.reddot { width: 10px; height: 10px; background: var(--red); border-radius: 50%; box-shadow: 0 0 12px var(--red); flex: none; }
#simctl { display: flex; flex-direction: column; gap: 6px; }
.simrow { display: flex; gap: 5px; flex-wrap: wrap; }
.simrow button, .simrow a { flex: 1 1 auto; font: 600 12px/1 var(--display); letter-spacing: .04em; padding: 8px 5px; background: rgba(0,0,0,.55); border: 1px solid var(--red); color: var(--fg); text-align: center; text-decoration: none; }
.simrow .wide { flex-basis: 45%; }
.simrow button.on { background: var(--red); }

/* ------------------------------------------------------- panneaux ---- */
.overlay { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: calc(20px + var(--sat)) 20px calc(20px + var(--sab)); background: linear-gradient(to bottom, rgba(5,6,8,.72), rgba(5,6,8,.5) 45%, rgba(5,6,8,.9)); overflow-y: auto; }
.landing-inner { max-width: 520px; width: 100%; display: flex; flex-direction: column; gap: 16px; text-align: center; }
h1 { font: 700 clamp(44px, 13vw, 76px)/.95 var(--display); letter-spacing: .03em; margin: 0; }
h2 { font: 600 24px/1 var(--display); letter-spacing: .12em; margin: 0 0 12px; }
h3 { font: 500 14px/1.2 var(--display); letter-spacing: .12em; color: var(--dim); margin: 16px 0 6px; }
.lead { font: 400 17px/1.45 var(--text); color: #dcdcda; margin: 0; }
.landing-counts { display: flex; justify-content: center; gap: 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; }
.mid { font: 600 40px/1.1 var(--display); font-variant-numeric: tabular-nums; margin-top: 4px; }
.big-btn { font-size: 24px; padding: 22px; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: 14px; }
.links a { color: var(--dim); }
.links.col { flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 16px; }
.fine { font-size: 12.5px; color: var(--dim); line-height: 1.45; margin: 0; }
.sheet { position: fixed; inset: 0; z-index: 12; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet-inner { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: #111214; border-top: 3px solid var(--fg); padding: 22px 18px calc(18px + var(--sab)); display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-inner { border: 1px solid var(--line); border-top: 3px solid var(--fg); } }
.close { position: absolute; right: 10px; top: 8px; background: none; border: 0; font-size: 30px; line-height: 1; color: var(--dim); padding: 6px 10px; }
.or { text-align: center; color: var(--dim); font-size: 13px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.two { flex-direction: row; gap: 10px; }
.field.two label { flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.flbl { font: 500 12px/1.2 var(--display); letter-spacing: .16em; color: var(--dim); text-transform: uppercase; }
.flbl small { text-transform: none; letter-spacing: 0; font-family: var(--text); }
select { -webkit-appearance: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #aaa 50%), linear-gradient(135deg, #aaa 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px !important; }
select, input { background-color: #1b1c1f; color: var(--fg); border: 1px solid var(--line); padding: 11px 10px; width: 100%; border-radius: 0; font-size: 16px; }
.choices { display: flex; gap: 6px; flex-wrap: wrap; }
.choices button { background: #1b1c1f; border: 1px solid var(--line); padding: 8px 10px; font: 500 13px/1.1 var(--display); letter-spacing: .06em; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.choices button svg { width: 34px; height: 44px; }
.choices button.on { border-color: var(--fg); background: #2a2b2f; box-shadow: inset 0 0 0 1px var(--fg); }
.signs button { flex: 1 1 30%; font-weight: 700; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#j-progress { display: flex; align-items: center; gap: 12px; justify-content: center; font: 500 15px/1 var(--display); letter-spacing: .08em; padding: 10px; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--fg); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: #ff8a8f; font-size: 14px; margin: 0; text-align: center; }
.stats { margin: 0; display: grid; gap: 8px; }
.stats div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 7px; }
.stats dt { color: var(--dim); font-size: 14px; }
.stats dd { margin: 0; font: 600 18px/1 var(--display); font-variant-numeric: tabular-nums; }
#m-regions { list-style: none; padding: 0; margin: 0; font-size: 14px; display: grid; gap: 4px; }
#m-regions li { display: flex; justify-content: space-between; }

#toast { white-space: pre-line; position: fixed; left: 50%; top: calc(180px + var(--sat)); transform: translateX(-50%); font-size: 15px; padding: 10px 14px; z-index: 15; background: rgba(0,0,0,.85); border: 1px solid var(--line); padding: 14px 18px; font: 500 16px/1.35 var(--display); letter-spacing: .05em; text-align: center; max-width: 88vw; }
#netstatus { position: fixed; top: calc(52px + var(--sat)); right: 14px; z-index: 6; background: #3a1113; color: #fff; font-size: 12px; padding: 6px 9px; }

/* ------------------------------------------------- capture vidéo ---- */
body.capture #top .top-actions, body.capture #bottom, body.capture #landing { display: none !important; }
#caption { position: fixed; left: 7%; right: 7%; top: 56%; z-index: 7; text-align: center; font: 700 38px/1.08 var(--display); letter-spacing: .02em; text-transform: uppercase; text-shadow: 0 4px 30px rgba(0,0,0,.95), 0 0 2px #000; opacity: 0; transition: none; }
#caption em { font-style: normal; color: var(--red); }
#endcard { position: fixed; inset: 0; z-index: 20; background: #070809; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; padding: 8%; }
#endcard .ec-date { font: 700 30px/1 var(--display); letter-spacing: .14em; color: var(--red); }
#endcard .ec-title { font: 700 60px/.95 var(--display); letter-spacing: .02em; }
#endcard .ec-line { width: 80px; height: 4px; background: var(--red); }
#endcard .ec-sub { font: 500 25px/1.2 var(--display); letter-spacing: .06em; color: #dcdcda; }
#endcard .ec-url { font: 600 21px/1.2 var(--display); letter-spacing: .02em; background: var(--fg); color: #000; padding: 12px 16px; word-break: break-all; }
#endcard .ec-fine { font: 400 13px/1.4 var(--text); color: var(--dim); max-width: 440px; }
