/* Cap Intégrité — charte AGL. Thème clair par défaut (accent bleu AGL, textes noirs), sombre « tour de contrôle » (or + turquoise).
   Mise en page : une colonne éditoriale large, panneaux en verre dépoli sur un fond portuaire animé. */
:root {
  --agl-marine: #0a2240; --agl-bleu: #14467c; --agl-bleu-vif: #1f5fa8; --agl-or: #d4af37;
  --bg: #f2f5f9; --panel: #ffffff; --panel2: #f7fafd; --line: #dde5ef; --chip: #e7edf4; --hl: #e2ecf7;
  --ink: #000000; --mut: #1a1a1a;
  --acc: var(--agl-bleu); --acc-ink: #ffffff; --marque: var(--agl-bleu);
  --btn: var(--agl-marine); --btn-ink: #ffffff; --th: var(--agl-marine); --th-ink: #ffffff;
  --ok: #146314; --warn: #8a5f00; --bad: #a3121f; --info: #14467c;
  --ok-bg: #e5f2e5; --warn-bg: #fbf1dc; --bad-bg: #fbe6e8;
  --verre: rgba(255,255,255,.66); --verre-line: rgba(20,70,124,.18);
  --st-bg: #0a2240; --st-ink: #ffffff; --st-acc: #8fc1f0; --st-acc2: #b9d7f5;
  --o1: #14467c; --o2: #0f7c8c; --o3: #6b3fa0; --o4: #8a5f00;
  --shadow: 0 1px 2px #0a22400f, 0 8px 28px #0a224014;
  --r: 12px; --font: Arial, Helvetica, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #091521; --panel: #102030; --panel2: #0c1a28; --line: #233344; --chip: #18304a; --hl: #16304d;
  --ink: #e3ecf3; --mut: #8da1b4; --acc: #d4af37; --acc-ink: #0a2240; --marque: var(--agl-or);
  --btn: #d4af37; --btn-ink: #0a2240; --th: #0c1a28; --th-ink: #95adbf;
  --ok: #3fbf6b; --warn: #fab219; --bad: #ff5a6e; --info: #3987e5; --ok-bg: #12301f; --warn-bg: #33280c; --bad-bg: #3a1720;
  --verre: rgba(15,31,48,.9); --verre-line: #233344; --st-acc: #d4af37; --st-acc2: #e8c95a;
  --o1: #1f5fa8; --o2: #138a9b; --o3: #7d52b8; --o4: #a5781a; --shadow: none; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #091521; --panel: #102030; --panel2: #0c1a28; --line: #233344; --chip: #18304a; --hl: #16304d;
  --ink: #e3ecf3; --mut: #8da1b4; --acc: #d4af37; --acc-ink: #0a2240; --marque: var(--agl-or);
  --btn: #d4af37; --btn-ink: #0a2240; --th: #0c1a28; --th-ink: #95adbf;
  --ok: #3fbf6b; --warn: #fab219; --bad: #ff5a6e; --info: #3987e5; --ok-bg: #12301f; --warn-bg: #33280c; --bad-bg: #3a1720;
  --verre: rgba(15,31,48,.9); --verre-line: #233344; --st-acc: #d4af37; --st-acc2: #e8c95a;
  --o1: #1f5fa8; --o2: #138a9b; --o3: #7d52b8; --o4: #a5781a; --shadow: none; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; }
a { color: var(--acc); }
h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.12; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* Fond portuaire animé (léger) */
.fond { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.fond svg { position: absolute; bottom: 0; left: 0; width: 200%; height: 46vh; opacity: .09; color: var(--acc); animation: derive 60s linear infinite; }
.fond::before { content: ""; position: absolute; inset: 0; background: radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--acc) 16%, transparent), transparent 60%), radial-gradient(800px 420px at -5% 30%, color-mix(in srgb, var(--agl-bleu-vif) 10%, transparent), transparent 60%); }
@keyframes derive { to { transform: translateX(-50%); } }

/* En-tête */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--verre); }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 18px; padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--verre); backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2); border-bottom: 1px solid var(--verre-line); }
.top-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.top-logo img { height: 38px; width: auto; }
.top-logo span { font-size: 17px; letter-spacing: .3px; border-left: 1px solid var(--line); padding-left: 12px; }
.top-logo b { color: var(--acc); }
@media (max-width: 480px) { .top-logo span { display: none; } }   /* 360 px : logo seul, le nom ne tient pas à côté des boutons */
.top-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.top-nav a { text-decoration: none; color: var(--ink); text-transform: uppercase; font-size: 12px; letter-spacing: 1px; padding: 8px 10px; border-radius: 8px; }
.top-nav a:hover { background: var(--hl); }
.top-nav a[aria-current] { color: var(--acc); box-shadow: inset 0 -2px 0 var(--acc); border-radius: 0; }
.top-r { display: flex; gap: 6px; align-items: center; }
.btn-ico { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.btn-ico svg { width: 19px; height: 19px; fill: currentColor; }
.btn-ico.off { opacity: .45; }
@media (max-width: 860px) { .top-nav { display: none; } .top-r { margin-left: auto; } }

/* Mise en page */
.wrap { max-width: 1240px; margin: 0 auto; padding-block: 28px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.eyebrow { text-transform: uppercase; letter-spacing: 2.5px; font-size: 12px; font-weight: 700; color: var(--acc); }
.h1 { font-size: clamp(34px, 6vw, 64px); font-weight: 800; letter-spacing: -1px; margin-top: 8px; }
.h1 .acc, .h2 .acc { color: var(--acc); }
.h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; }
.h3 { font-size: 18px; font-weight: 700; }
.liser { display: block; width: 48px; height: 5px; background: var(--acc); transform: skew(-25deg); margin: 14px 0 0; }
.lead { font-size: 18px; max-width: 62ch; margin: 14px 0 0; }
.small { font-size: 13px; }
.mut { color: var(--mut); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.grid > *, .row > * { min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.verre { background: var(--verre); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border: 1px solid var(--verre-line); border-radius: var(--r); box-shadow: var(--shadow); }
.sep { height: 1px; background: var(--line); border: 0; margin: 8px 0; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 10px; border: 2px solid var(--btn); background: var(--btn); color: var(--btn-ink); font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px color-mix(in srgb, var(--btn) 30%, transparent); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn.sec { background: transparent; color: var(--acc); border-color: var(--acc); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.big { padding: 16px 26px; font-size: 18px; border-radius: 12px; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* Badges, pastilles, bandeaux */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1.5px solid currentColor; font-weight: 700; font-size: 12px; white-space: nowrap; }
.pill svg { width: 14px; height: 14px; fill: currentColor; }
.v-ok { color: var(--ok); } .v-risque { color: var(--warn); } .v-grave { color: var(--bad); }
.bandeau { padding: 12px 14px; border-radius: 10px; border: 1px solid; font-weight: 600; display: flex; gap: 10px; align-items: flex-start; }
.bandeau svg { width: 22px; height: 22px; flex: none; fill: currentColor; }
.b-ok { color: var(--ok); background: var(--ok-bg); } .b-warn { color: var(--warn); background: var(--warn-bg); } .b-bad { color: var(--bad); background: var(--bad-bg); }
.b-ok p, .b-warn p, .b-bad p { color: var(--ink); font-weight: 400; margin: 4px 0 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--chip); font-size: 13px; font-weight: 600; }
.emb { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--c); color: #fff; flex: none; }
.emb svg { width: 22px; height: 22px; }

/* Indicateurs */
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; position: relative; overflow: hidden; }
.kpi-l { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; display: flex; gap: 6px; align-items: center; }
.kpi-l svg { width: 16px; height: 16px; color: var(--acc); }
.kpi-v { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bar { height: 7px; border-radius: 99px; background: var(--chip); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--acc); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.bar.lo > i { background: var(--bad); } .bar.mid > i { background: var(--warn); } .bar.hi > i { background: var(--ok); }
.delta { position: absolute; right: 10px; top: 8px; font-weight: 800; font-size: 14px; animation: monte 1.6s ease-out forwards; }
.delta.p { color: var(--ok); } .delta.m { color: var(--bad); }
@keyframes monte { 0% { opacity: 0; transform: translateY(10px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-18px); } }

/* Anneau de chrono */
.ring .ring-bg { fill: none; stroke: var(--chip); stroke-width: 6; }
.ring .ring-fg { fill: none; stroke: var(--acc); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.ring.warn .ring-fg { stroke: var(--bad); }
.ring text { fill: var(--ink); font: 700 16px var(--font); }

/* Dé 3D */
.die-scene { width: var(--s); height: var(--s); perspective: calc(var(--s) * 5); display: inline-block; }
.die { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transform: rotateX(-20deg) rotateY(30deg); }
.die-f { position: absolute; inset: 0; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 14%; gap: 4%; background: linear-gradient(145deg, #ffffff, #e4ebf3); border: 2px solid #c9d5e3; border-radius: 18%; box-shadow: inset 0 0 12px rgba(10,34,64,.15); }
.die-f i { border-radius: 50%; }
.die-f i.on { background: radial-gradient(circle at 35% 35%, #2a5c97, #0a2240); }
.f1 { transform: translateZ(calc(var(--s) / 2)); } .f6 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.f3 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); } .f4 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.f5 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); } .f2 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }

/* Cartes de jeu à retourner */
.gcard { perspective: 1400px; }
.gcard .in { position: relative; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.2,.8,.2,1); min-height: 100%; }
.gcard.flip .in { transform: rotateY(180deg); }
.gcard .fa, .gcard .fb { backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 16px; }
.gcard .fb { position: absolute; inset: 0; transform: rotateY(180deg); overflow: auto; }
.carte { border-radius: 16px; padding: 22px; color: #fff; background: linear-gradient(160deg, #0a2240, #14467c 70%, #1f5fa8); box-shadow: 0 18px 40px rgba(10,34,64,.28); position: relative; overflow: hidden; }
.carte::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255,255,255,.05) 0 18px, transparent 18px 60px); pointer-events: none; }
.carte.consequence { background: linear-gradient(160deg, #3a0a12, #a3121f 70%, #c9353f); }
.carte.choc { background: linear-gradient(160deg, #1d1032, #6b3fa0 70%, #8a5cc4); }
.carte .ct { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; font-weight: 700; opacity: .9; display: flex; gap: 8px; align-items: center; }
.carte h3 { font-size: 24px; margin-top: 8px; }
.carte p { margin: 10px 0 0; font-size: 16px; }
.carte .cav { position: absolute; right: 12px; bottom: -8px; width: 110px; opacity: .95; }
.deal { animation: deal .7s cubic-bezier(.2,.9,.2,1.1) both; }
@keyframes deal { from { opacity: 0; transform: translate(40px, -60px) rotate(12deg) scale(.85); } to { opacity: 1; transform: none; } }

/* Options de décision (tablette et écran) */
.opts { display: grid; gap: 12px; }
.opt { display: flex; gap: 14px; align-items: flex-start; text-align: left; padding: 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); cursor: pointer; font-size: 16px; transition: transform .15s, border-color .15s, background .15s; }
.opt:hover { border-color: var(--acc); transform: translateY(-1px); }
.opt .l { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; }
.opt:nth-child(1) .l { background: var(--o1); } .opt:nth-child(2) .l { background: var(--o2); } .opt:nth-child(3) .l { background: var(--o3); } .opt:nth-child(4) .l { background: var(--o4); }
.opt.sel { border-color: var(--acc); background: var(--hl); }
.opt.ok { border-color: var(--ok); background: var(--ok-bg); } .opt.risque { border-color: var(--warn); background: var(--warn-bg); } .opt.grave { border-color: var(--bad); background: var(--bad-bg); }
.opt[disabled] { cursor: default; transform: none; }

/* Plateau et écrans de salle */
.salle { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) 330px; }
@media (max-width: 1080px) { .salle { grid-template-columns: 1fr; } }
.code-big { font-size: clamp(48px, 7vw, 96px); font-weight: 800; letter-spacing: 10px; color: var(--acc); font-variant-numeric: tabular-nums; line-height: 1; }
.qr { background: #fff; padding: 10px; border-radius: 14px; width: min(240px, 60vw); aspect-ratio: 1; }
.qr img, .qr svg { width: 100%; height: 100%; display: block; }
.equipe { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.equipe .nm { font-weight: 800; }
.equipe .st { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }
.pop { animation: pop .5s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.controls { position: sticky; bottom: 0; z-index: 15; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-block: 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--verre); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--verre-line); }
.phase-tag { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; }
.lb { display: grid; gap: 8px; }
.lb-row { display: grid; grid-template-columns: 30px 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); transition: transform .6s; }
.lb-row .rk { font-weight: 800; font-size: 18px; text-align: center; }
.lb-row .sc { font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.up { color: var(--ok); font-weight: 800; } .down { color: var(--bad); font-weight: 800; }

/* Podium */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 14px; min-height: 300px; }
.pod { width: min(30%, 200px); display: flex; flex-direction: column; align-items: center; gap: 8px; animation: pop .6s both; }
.pod .socle { width: 100%; border-radius: 12px 12px 0 0; display: grid; place-items: start center; padding-top: 10px; color: #fff; font-size: 40px; font-weight: 800; background: linear-gradient(180deg, var(--agl-bleu-vif), var(--agl-marine)); }
.pod.p1 .socle { height: 190px; } .pod.p2 .socle { height: 140px; } .pod.p3 .socle { height: 100px; }
:root[data-theme="dark"] .pod.p1 .socle { background: linear-gradient(180deg, var(--agl-or), #8a6d14); }

/* Cascade : chaîne de dominos */
.chaine { width: 100%; overflow-x: auto; }
.chaine svg { min-width: 640px; width: 100%; display: block; }
.chaine .n { cursor: default; }
.chaine text { font: 600 12px var(--font); fill: var(--ink); }
.jauges { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
.jauge { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); position: relative; }
.jauge .g { width: 54px; height: 54px; flex: none; }
.jauge .g circle { fill: none; stroke-width: 7; }
.jauge .g .bg { stroke: var(--chip); }
.jauge .g .fg { stroke: var(--ok); stroke-linecap: round; transition: stroke-dashoffset .9s cubic-bezier(.2,.8,.2,1), stroke .4s; }
.jauge.mid .g .fg { stroke: var(--warn); } .jauge.lo .g .fg { stroke: var(--bad); }
.jauge.lo { animation: alarme 1.2s ease-in-out infinite; }
@keyframes alarme { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 30%, transparent); } }
.jauge .g text { font: 800 15px var(--font); fill: var(--ink); }
.jauge .jl { font-size: 12px; font-weight: 700; line-height: 1.25; }
.jauge .jl svg { width: 16px; height: 16px; color: var(--acc); display: block; margin-bottom: 3px; }
.jokers { display: flex; gap: 10px; flex-wrap: wrap; }
.joker { display: flex; gap: 8px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 12px; border: 2px dashed var(--acc); background: var(--panel); cursor: pointer; font-weight: 700; color: var(--ink); }
.joker svg { width: 20px; height: 20px; color: var(--acc); }
.joker:hover { background: var(--hl); }
.catastrophe { text-align: center; padding: 36px 20px; border-radius: 18px; color: #fff; background: radial-gradient(circle at 50% 0%, #c9353f, #3a0a12 70%); animation: seisme .6s; }
@keyframes seisme { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* Tablette */
.tab-body { min-height: 100vh; display: flex; flex-direction: column; }
.tab-main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding-block: 18px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 16px; }
.tab-head { display: flex; gap: 12px; align-items: center; }
.qbtns { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.qbtn { min-height: 110px; border-radius: 16px; border: 0; color: #fff; font-size: 20px; font-weight: 800; cursor: pointer; display: flex; gap: 12px; align-items: center; padding: 16px; text-align: left; box-shadow: 0 8px 0 rgba(0,0,0,.2); transition: transform .1s, box-shadow .1s; }
.qbtn:active { transform: translateY(6px); box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.qbtn:nth-child(1) { background: var(--o1); } .qbtn:nth-child(2) { background: var(--o2); } .qbtn:nth-child(3) { background: var(--o3); } .qbtn:nth-child(4) { background: var(--o4); }
.qbtn .sh { width: 34px; height: 34px; flex: none; fill: #fff; }
.qbtn.dim { opacity: .3; } .qbtn.good { outline: 5px solid var(--ok); }
.attente { text-align: center; padding: 40px 16px; }
.attente .pulse { width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 16px; background: var(--acc); animation: pulse 1.6s infinite; display: grid; place-items: center; color: var(--acc-ink); }
.attente .pulse svg { width: 34px; height: 34px; fill: currentColor; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--acc) 50%, transparent); } 100% { box-shadow: 0 0 0 26px transparent; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.field input, .field select, .field textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; }
.field textarea { min-height: 80px; resize: vertical; }
.embs { display: flex; gap: 8px; flex-wrap: wrap; }
.embs button { border: 2px solid transparent; background: none; padding: 2px; border-radius: 13px; cursor: pointer; }
.embs button[aria-pressed="true"] { border-color: var(--acc); }

/* Lecteur vidéo (moteur d'animation) */
.pl { display: flex; flex-direction: column; gap: 0; border-radius: 14px; overflow: hidden; background: var(--st-bg); box-shadow: 0 20px 50px rgba(10,34,64,.25); }
.pl-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: var(--st-bg); max-width: 100%; }
.stage { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; color: var(--st-ink); font-family: var(--font); overflow: hidden; background: var(--st-bg); }
.st-layer, .st-scene { position: absolute; inset: 0; }
.st-decor { position: absolute; inset: 0; width: 100%; height: 100%; }
.st-cam { position: absolute; inset: 0; transform-origin: 50% 60%; }
.st-obj { position: absolute; z-index: 3; filter: drop-shadow(0 12px 18px rgba(0,0,0,.35)); }
.st-obj svg { width: 100%; height: auto; display: block; }
.st-nuit { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(3,8,30,.55), rgba(3,8,30,.15)); }
.st-etoile { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; }
.st-poussiere { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: rgba(214,170,110,.35); }
.st-wipe { position: absolute; top: -10%; bottom: -10%; left: -40%; width: 60%; background: linear-gradient(90deg, transparent, var(--st-acc) 30%, #0a2240 50%, var(--st-acc) 70%, transparent); opacity: .9; z-index: 9; pointer-events: none; }
.st-bars { position: absolute; inset: 0 -200px; background: repeating-linear-gradient(115deg, rgba(255,255,255,.035) 0 26px, transparent 26px 80px); }
.st-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 120px; }
.st-eyebrow { font-size: 20px; font-weight: 700; color: var(--st-acc); text-transform: uppercase; letter-spacing: 4px; }
.st-h1 { font-size: 88px; font-weight: 800; line-height: 1.05; margin: 18px 0 0; letter-spacing: -1.5px; }
.st-w { display: inline-block; }
.st-w.acc { color: var(--st-acc); }
.st-liser { display: block; height: 9px; background: var(--st-acc); transform: skew(-25deg); margin-top: 26px; }
.st-h2 { font-size: 48px; font-weight: 800; line-height: 1.12; margin: 12px 0 0; }
.st-h2.c { text-align: center; }
.st-sub { font-size: 28px; color: var(--st-acc2); margin-top: 18px; max-width: 900px; }
.st-big { font-size: 190px; font-weight: 800; line-height: 1; color: var(--st-acc); font-variant-numeric: tabular-nums; }
.st-big small { font-size: 90px; }
.st-lieu { position: absolute; left: 48px; top: 40px; padding: 8px 16px; border-radius: 8px; background: rgba(255,255,255,.12); font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.st-av { position: absolute; bottom: 0; width: 300px; text-align: center; }
.st-av.l { left: 70px; } .st-av.r { right: 70px; }
.st-av.c { left: 50%; margin-left: -90px; width: 180px; top: 34px; bottom: auto; }
.st-av .avatar { width: 300px; height: 375px; filter: drop-shadow(0 20px 30px rgba(0,0,0,.35)); }
.st-av.c .avatar { width: 180px; height: 225px; }
.st-av.c .st-name { display: none; }
.st-av:not(.on) .avatar { filter: brightness(.75) drop-shadow(0 20px 30px rgba(0,0,0,.35)); }
.st-name { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); white-space: nowrap; padding: 8px 16px; border-radius: 10px; background: rgba(10,34,64,.88); border: 2px solid var(--st-acc); }
.st-name b { display: block; font-size: 22px; } .st-name span { font-size: 16px; color: var(--st-acc2); }

.st-bubble { position: absolute; top: 120px; width: 560px; padding: 24px 28px; border-radius: 22px; background: #fff; color: #000; font-size: 30px; line-height: 1.32; box-shadow: 0 20px 40px rgba(0,0,0,.3); transform-origin: bottom center; }
.st-bubble b { display: block; font-size: 18px; color: #14467c; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px; }
.st-bubble p { margin: 0; }
.st-bubble.l { left: 330px; } .st-bubble.r { right: 330px; } .st-bubble.c { left: 360px; top: 280px; }
.st-bubble.l::after, .st-bubble.r::after { content: ""; position: absolute; bottom: -18px; width: 0; height: 0; border: 18px solid transparent; border-top-color: #fff; }
.st-bubble.l::after { left: 40px; } .st-bubble.r::after { right: 40px; }
.st-caret { display: inline-block; width: 3px; height: 28px; background: #14467c; margin-left: 3px; vertical-align: -4px; animation: clig .7s steps(1) infinite; }
@keyframes clig { 50% { opacity: 0; } }
.st-quiz, .st-rule, .st-carte { position: absolute; inset: 60px 90px; display: flex; flex-direction: column; }
.st-opts { display: flex; flex-direction: column; gap: 14px; margin-top: 30px; }
.st-opt { display: flex; gap: 18px; align-items: center; padding: 16px 22px; border-radius: 16px; background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.18); color: #fff; font: 600 25px/1.3 var(--font); text-align: left; position: relative; }
.st-opt.clic { cursor: pointer; } .st-opt.clic:hover { background: rgba(255,255,255,.2); }
.st-opt .st-l { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--st-acc); color: #0a2240; font-weight: 800; }
.st-opt.ok { background: rgba(63,191,107,.25); border-color: #3fbf6b; } .st-opt.ko { background: rgba(255,90,110,.22); border-color: #ff5a6e; } .st-opt.dim { opacity: .45; }
.st-opt em { position: absolute; right: 16px; top: -12px; font-style: normal; font-size: 15px; padding: 2px 10px; border-radius: 6px; background: #fff; color: #0a2240; font-weight: 700; }
.st-opt.v-ok { border-color: #3fbf6b; } .st-opt.v-risque { border-color: #fab219; } .st-opt.v-grave { border-color: #ff5a6e; }
.st-pill { flex: none; padding: 6px 12px; border-radius: 999px; font-size: 17px; font-weight: 800; background: #fff; color: #0a2240; min-width: 150px; text-align: center; }
.v-ok .st-pill { background: #3fbf6b; color: #062a12; } .v-risque .st-pill { background: #fab219; color: #2e2000; } .v-grave .st-pill { background: #ff5a6e; color: #3a0710; }
.st-expl { margin-top: 26px; padding: 18px 22px; border-radius: 14px; background: rgba(255,255,255,.95); color: #000; font-size: 26px; border-left: 10px solid #3fbf6b; }
.st-hint { margin-top: 22px; font-size: 22px; color: var(--st-acc2); }
.st-rule ul, .st-liste { list-style: none; padding: 0; margin: 34px 0 0; display: flex; flex-direction: column; gap: 22px; }
.st-rule li { display: flex; gap: 22px; align-items: center; font-size: 36px; font-weight: 600; }
.st-rule li svg { width: 56px; height: 56px; flex: none; }
.st-rule li svg circle { fill: var(--st-acc); }
.st-rule li svg path { fill: none; stroke: #0a2240; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 34; }
.st-foot { margin-top: auto; font-size: 24px; padding: 14px 20px; border-radius: 12px; background: rgba(255,255,255,.12); }
.st-liste li { display: flex; gap: 18px; align-items: center; font-size: 30px; font-weight: 600; }
.st-liste li b { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--st-acc); color: #0a2240; font-size: 24px; }
.st-carte { justify-content: flex-end; padding-bottom: 40px; }
.st-carte p { font-size: 28px; line-height: 1.4; max-width: 900px; margin: 18px 0 0; }
.st-logo { height: 120px; width: auto; }
.st-sign { margin-top: 40px; font-size: 18px; letter-spacing: 4px; color: var(--st-acc); }
.st-cap { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); max-width: 1000px; padding: 10px 20px; border-radius: 10px; background: rgba(0,0,0,.72); color: #fff; font-size: 24px; text-align: center; }
.st-cap b { color: var(--st-acc); margin-right: 6px; }
.pl-bar { display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: #08192f; color: #fff; flex-wrap: wrap; }
.pl-btn { width: 40px; height: 40px; border-radius: 10px; border: 0; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; cursor: pointer; }
.pl-btn svg { width: 20px; height: 20px; fill: currentColor; }
.pl-time { font-variant-numeric: tabular-nums; font-size: 13px; min-width: 86px; }
.pl-track { position: relative; flex: 1; min-width: 120px; }
.pl-seek { width: 100%; accent-color: #8fc1f0; }
.pl-marks { position: absolute; inset: 0; pointer-events: none; }
.pl-marks i { position: absolute; top: 2px; width: 2px; height: 6px; background: rgba(255,255,255,.5); }
.pl-tog { border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; }
.pl-tog[aria-pressed="true"] { background: #fff; color: #0a2240; }
.pl-frame:fullscreen { aspect-ratio: auto; }

/* Cartes de jeu (accueil, vidéothèque) */
.tuile { display: flex; flex-direction: column; gap: 10px; padding: 0; overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .2s, box-shadow .2s; }
.tuile:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(10,34,64,.18); }
.tuile .vis { aspect-ratio: 16 / 9; background: var(--st-bg); position: relative; overflow: hidden; }
.tuile .vis svg.illu { position: absolute; inset: 0; width: 100%; height: 100%; }
.tuile .tx { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.niv { display: inline-flex; gap: 3px; } .niv i { width: 8px; height: 8px; border-radius: 2px; background: var(--chip); transform: skew(-20deg); } .niv i.on { background: var(--acc); }

/* Collection de cartes « Règle d'or » */
.collection { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); }
.regle-or { aspect-ratio: 5 / 7; border-radius: 14px; padding: 14px; color: #fff; display: flex; flex-direction: column; gap: 8px; background: linear-gradient(160deg, #0a2240, #14467c); border: 3px solid #8fc1f0; font-size: 13px; position: relative; overflow: hidden; }
:root[data-theme="dark"] .regle-or { border-color: var(--agl-or); }
.regle-or b { font-size: 15px; }
.regle-or.vide { background: var(--chip); border: 2px dashed var(--line); color: var(--ink); justify-content: center; align-items: center; text-align: center; }
.regle-or .rk { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; opacity: .85; }
.badge-g { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.badge-g .md { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #4f8fd6, #14467c); color: #fff; flex: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); }
:root[data-theme="dark"] .badge-g .md { background: radial-gradient(circle at 35% 30%, #f1d97a, #a5781a); color: #2b1f00; }
.badge-g .md svg { width: 24px; height: 24px; fill: currentColor; }
.badge-g.off { opacity: .4; filter: grayscale(1); }

/* Administration (inspirée de la console Translead) */
.adm { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .adm { grid-template-columns: 1fr; } }
.adm-side { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 4px; }
.adm-side button { text-align: left; padding: 10px 12px; border-radius: 10px; border: 0; background: none; cursor: pointer; font-weight: 600; display: flex; gap: 10px; align-items: center; color: var(--ink); }
.adm-side button svg { width: 18px; height: 18px; color: var(--acc); }
.adm-side button[aria-current="true"] { background: var(--hl); color: var(--acc); }
@media (max-width: 900px) { .adm-side { position: static; flex-direction: row; overflow-x: auto; } .adm-side button { white-space: nowrap; } }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.tile { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-align: left; }
.tile .v { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile.alerte { border-color: var(--warn); background: var(--warn-bg); }
.set-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.set-card .o { margin-top: auto; color: var(--acc); font-weight: 700; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs button { padding: 10px 14px; border: 0; background: none; cursor: pointer; font-weight: 700; color: var(--ink); border-bottom: 3px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--acc); border-color: var(--acc); }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { padding: 8px 12px; border: 0; background: var(--panel); cursor: pointer; font-weight: 600; color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check input { width: 20px; height: 20px; accent-color: var(--acc); margin-top: 2px; flex: none; }
.tbl-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: var(--th); color: var(--th-ink); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; text-align: left; padding: 10px; }
td { padding: 10px; border-top: 1px solid var(--line); vertical-align: top; }
tr.clic { cursor: pointer; } tr.clic:hover td { background: var(--hl); }
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(10,34,64,.45); display: grid; place-items: center; padding: 16px; }
.modal { width: min(560px, 100%); max-height: 90vh; overflow: auto; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; padding: 12px 18px; border-radius: 12px; background: var(--agl-marine); color: #fff; font-weight: 700; box-shadow: 0 12px 30px rgba(0,0,0,.25); transition: opacity .5s, transform .5s; }
.toast.bad { background: var(--bad); } .toast.out { opacity: 0; transform: translate(-50%, 20px); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }
details.pli { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
details.pli > summary { cursor: pointer; padding: 14px 16px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
details.pli > summary::after { content: "+"; font-size: 20px; color: var(--acc); }
details.pli[open] > summary::after { content: "–"; }
details.pli > div { padding: 0 16px 16px; }
.hero-vis { border-radius: 18px; overflow: hidden; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Compte connecté (en-tête) */
.moi { position: relative; }
.moi-b { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; color: var(--ink); }
.moi-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--btn); color: var(--btn-ink); font-weight: 800; font-size: 12px; }
.moi-t { font-size: 13px; white-space: nowrap; } .moi-t b { color: var(--acc); }
.moi-m { position: absolute; right: 0; top: calc(100% + 8px); width: min(300px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(10,34,64,.2); padding: 14px; display: flex; flex-direction: column; gap: 10px; z-index: 40; }
.moi-id { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.moi-m nav { display: none; flex-direction: column; }
.moi-l { display: flex; flex-direction: column; }
.moi-m nav a, .moi-l a { padding: 8px 6px; text-decoration: none; color: var(--ink); border-radius: 8px; font-weight: 600; }
.moi-m nav a:hover, .moi-m nav a[aria-current], .moi-l a:hover, .moi-l a[aria-current] { background: var(--hl); color: var(--acc); }
@media (max-width: 860px) { .moi-m nav { display: flex; } .moi-t { display: none; } .moi-b { padding: 0 4px; } }
/* Avancement */
.etat { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1.5px solid currentColor; white-space: nowrap; }
.etat.termine { color: var(--ok); } .etat.en_cours { color: var(--acc); } .etat.a_faire { color: var(--ink); border-color: var(--line); } .etat.retard { color: var(--bad); }
.mod-l { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.mod-l:first-child { border-top: 0; }
.mod-l .act { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.prog { display: flex; align-items: center; gap: 10px; } .prog .bar { flex: 1; height: 9px; } .prog b { min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
tr.clic { cursor: pointer; } tr.clic:hover td { background: var(--hl); }

/* Thème sombre : l'accent est l'or AGL (marque), sur les surfaces marine. */
:root[data-theme="dark"] .cx-g h1 .acc, :root[data-theme="dark"] .cx-g .eyebrow { color: var(--agl-or); }
:root[data-theme="dark"] .cx-g .liser { background: var(--agl-or); }
:root[data-theme="dark"] .reprise .eyebrow { color: var(--agl-or); }
:root[data-theme="dark"] .reprise .btn { background: var(--agl-or); border-color: var(--agl-or); color: var(--agl-marine); }
