/* Rise of Academies — mise en page du jeu et intégration des composants FAB-07. */
:root {
  --bg: #0a0f24;
  --bg2: #0e1530;
  --surface: #141c3b;
  --surface2: #1b2550;
  --line: #2b366b;
  --text: #e9ecf6;
  --muted: #98a3c7;
  --gold: #e3b84f;
  --gold2: #f6d77a;
  --on-gold: #1a1405;
  --ok: #4cc38a;
  --bad: #ef6b74;
  --warn: #f0a74b;
  --focus: #8ec5ff;
  --r-common: #9aa7c4;
  --r-special: #4cc7d8;
  --r-rare: #6c9dff;
  --r-ultra: #b783ff;
  --r-mega: #ffb04a;
  --radius: 14px;
  --gutter: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -10%, #1a2656 0%, var(--bg) 60%) fixed;
  color: var(--text);
  font: 16px/1.45 system-ui, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; letter-spacing: .02em; margin: 0 0 .4em; }
h2 { font-size: 1.25rem; color: var(--gold2); }
h3 { font-size: 1.05rem; }
p { margin: .3em 0 .7em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden, [hidden] { display: none !important; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter) 96px; }

/* En-tête / identité (hiérarchie validée n°41) */
.brand { display: flex; align-items: center; gap: 12px; padding: 12px var(--gutter); max-width: 1280px; margin: 0 auto; }
.brand img { width: 44px; height: 44px; flex: none; }
.brand .stack { display: flex; flex-direction: column; line-height: 1.1; }
.brand .fns { font-size: .75rem; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); }
.brand .title { font-family: Georgia, serif; font-size: 1.25rem; color: var(--gold2); letter-spacing: .06em; text-transform: uppercase; }
.brand .rule { height: 1px; width: 100%; background: linear-gradient(90deg, var(--gold), transparent); margin: 4px 0 2px; }
.brand .ls4u { font-size: .75rem; letter-spacing: .3em; color: var(--muted); }
.splash { text-align: center; padding: 26px var(--gutter) 6px; }
.splash img { width: 92px; height: 92px; }
.splash .fns { letter-spacing: .4em; text-transform: uppercase; color: var(--muted); font-size: .85rem; margin-top: 6px; }
.splash h1 { font-size: clamp(1.9rem, 7vw, 3rem); color: var(--gold2); text-transform: uppercase; letter-spacing: .08em; margin: .1em 0; }
.splash .rule { height: 1px; max-width: 260px; margin: 8px auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.splash .ls4u { letter-spacing: .5em; color: var(--text); font-size: .9rem; }
.splash .tag { margin-top: 10px; color: var(--gold); letter-spacing: .18em; font-size: .85rem; }
.provisional { text-align: center; font-size: .8rem; color: var(--warn); border: 1px dashed var(--warn); border-radius: 10px; padding: 6px 10px; margin: 10px 0; }

/* Barre de ressources */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
:root { --header-height: 60px; }
.header-row { display: flex; align-items: center; gap: 6px; min-height: calc(var(--header-height) - 1px); padding: 5px 8px; }
/* Bouton marche/arrêt du village : petit, rond, rouge en relief, discret au repos. */
.header-quitter { margin-left: auto; flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  color: #fff6f2; background: radial-gradient(circle at 35% 30%, #f0605a, #c4221f 58%, #8d1212); box-shadow: 0 3px 0 #6e0d0d, 0 4px 10px #0007, inset 0 1px 1px #ffffff55;
  opacity: 0.78; transition: opacity 0.15s, transform 0.15s; }
.header-quitter svg { width: 18px; height: 18px; }
.header-quitter:hover, .header-quitter:focus-visible { opacity: 1; transform: translateY(-1px); }
.header-quitter:active { transform: translateY(2px); box-shadow: 0 1px 0 #6e0d0d, 0 2px 6px #0007; }
.header-quitter:focus-visible { outline: 2px solid #fff3d4; outline-offset: 3px; }
.quit-confirm { display: inline-flex; align-items: center; gap: 0.45em; }
.quit-confirm svg { width: 1.1em; height: 1.1em; }
.header-avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; padding: 0; background: none; border: 0; cursor: pointer; }
.res { min-width: 0; display: flex; flex: 1; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: .8rem; white-space: nowrap; }
.chip b { color: var(--gold2); font-variant-numeric: tabular-nums; }
.res button.chip { min-width: 44px; min-height: 44px; flex: 1 1 auto; justify-content: center; }

/* Navigation principale */
.nav.fi-nav--pose { position: sticky; top: calc(var(--header-height) + env(safe-area-inset-top)); z-index: 20; padding: 0 6px; }
.nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.nav button:focus-visible { outline-offset: -2px; }
.dot { position: absolute; top: 8px; right: calc(50% - 22px); width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }

/* Cartes, boutons */
.card { background: linear-gradient(180deg, var(--surface), var(--bg2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.btn { min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--gold); }
.btn.primary { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: var(--on-gold); border-color: transparent; font-weight: 700; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .9rem; }
select, input { min-height: 44px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; max-width: 100%; }
input::placeholder { color: var(--muted); opacity: 1; }
.auth-fields label { display: block; margin-bottom: 3px; }
.non-affiliation { margin-top: 16px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; border: 1px solid currentColor; }
.b-FREE { color: var(--ok); } .b-RECOVERING { color: var(--warn); } .b-TRAINING { color: var(--r-rare); } .b-MISSION { color: var(--r-ultra); } .b-GARRISON { color: var(--r-special); }
.rar-COMMON { --rc: var(--r-common); } .rar-SPECIAL { --rc: var(--r-special); } .rar-RARE { --rc: var(--r-rare); } .rar-ULTRA_RARE { --rc: var(--r-ultra); } .rar-MEGA_RARE { --rc: var(--r-mega); }
.fcard { border-left: 5px solid var(--rc, var(--line)); text-align: left; width: 100%; }
button.fcard { cursor: pointer; }
.fcard .name { font-weight: 700; }
.fcard .epi { color: var(--muted); font-size: .85rem; }
.rtag { color: var(--rc); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.sel { box-shadow: inset 0 0 0 2px var(--gold); }

.bars { display: grid; gap: 3px; margin: 8px 0; }
.bar { display: grid; grid-template-columns: 86px 1fr 52px; gap: 8px; align-items: center; font-size: .8rem; }
.bar .track { height: 7px; background: #0a1030; border-radius: 4px; overflow: hidden; }
.bar .fill { height: 100%; background: linear-gradient(90deg, #4b6fd6, var(--gold)); }
.bar .num { text-align: right; font-variant-numeric: tabular-nums; }
.bonus { color: var(--ok); }
.fat { height: 8px; background: #0a1030; border-radius: 4px; overflow: hidden; }
.fat > div { height: 100%; background: var(--ok); }
.fat.high > div { background: var(--warn); }
.fat.lock > div { background: var(--bad); }

/* SUMA (forme élémentaire) */
.suma { display: flex; gap: 12px; align-items: flex-start; background: #101a3f; border: 1px solid var(--gold); border-radius: var(--radius); padding: 12px; margin: 12px 0; }
.suma .badge-s { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, var(--gold2), var(--gold)); color: var(--on-gold); font-weight: 800; font-family: Georgia, serif; }
/* SUMA 3D (flag ?suma3d=1) : même médaillon, plus grand ; le « S » reste tant que ni modèle ni image officielle ne sont affichés. */
.suma .badge-s.suma3d-host { width: 72px; height: 72px; position: relative; overflow: hidden; }
.suma .badge-s.suma3d-host.has-suma { background: #1a2350; color: transparent; }
.suma .who { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold2); }
.suma ul { margin: .4em 0 0; padding-left: 1.1em; color: var(--muted); font-size: .9rem; }

/* Académie */
.scene { background: linear-gradient(180deg, #14275a 0%, #0d1a40 55%, #12301f 55%, #0c2316 100%); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.scene svg { width: 100%; height: auto; display: block; }
.bld { cursor: pointer; }
.bld text { font-size: 16px; pointer-events: none; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .9rem; }
.steps li::before { content: "○ "; color: var(--muted); }
.steps li.done::before { content: "✔ "; color: var(--ok); }
.steps li.done { color: var(--muted); }
.progress { height: 8px; background: #0a1030; border-radius: 4px; overflow: hidden; }
.progress > div { height: 100%; background: var(--gold); }

/* Dominion */
.map svg { width: 100%; min-width: 590px; max-height: 570px; height: auto; display: block; }
.hex { stroke: var(--line); stroke-width: 1.5; fill: #0f1736; }
.hex.t { cursor: pointer; }
/* Secteurs neutres : fond gris identique quelle que soit la difficulté (pastille de couleur à part) ; seuls les secteurs tenus sont colorés, du même ton que leur QG. */
.hex.LOW, .hex.NORMAL, .hex.HIGH { fill: #262e44; stroke: #4a5578; }
.hex.held { fill: color-mix(in srgb, var(--owner-color) 35%, var(--bg)); stroke: var(--owner-color); stroke-width: 2; }
.hex.chosen { stroke-dasharray: 3 2; stroke-width: 3; }
.hex.t:focus-visible { outline: none; stroke: var(--focus); stroke-width: 3; }
.hexlabel { fill: var(--text); font-size: 10px; text-anchor: middle; pointer-events: none; }
.hex-art, .hex-difficulty { pointer-events: none; }
.hex-art { opacity: 0; }
.hex-difficulty { stroke: var(--bg); stroke-width: .8; }
.hex-art-label { display: none; font-size: 8.5px; font-weight: 700; }
.map-tile.with-art .hex-art { opacity: 1; }
.map-tile.with-art .hex-art-label { display: inline; }
.map-tile.with-art .hex-fallback { display: none; }
.dominion-picture, .dominion-picture img { display: block; width: 100%; height: 100%; }
.dominion-family-icon { display: inline-grid; place-items: center; width: 32px; height: 32px; vertical-align: middle; }
.dominion-family-icon > * { grid-area: 1 / 1; }
.dominion-family-icon .dominion-picture, .dominion-family-icon.with-art > span { opacity: 0; }
.dominion-family-icon.with-art .dominion-picture { opacity: 1; }
.map-legend { display: grid; gap: 8px; margin-top: 10px; }
.map-scroll-help { display: none; }
@media (max-width: 660px), (min-width: 1000px) and (max-width: 1190px) {
  .map-scroll-help { display: block; }
}
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.duel-plan { min-width: 0; margin: 12px 0; }
.duel-plan ol { list-style: none; padding: 0; margin: 0; }
.duel-plan .slot { grid-template-columns: minmax(0, 1fr); }
.duel-plan .slot > .small b, .duel-plan select { display: block; }
.slot { min-height: 84px; border: 2px dashed var(--line); border-radius: 12px; padding: 8px; background: var(--bg2); cursor: pointer; text-align: left; }
.slot.filled { border-style: solid; border-color: var(--rc, var(--gold)); }
.effopt { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); }
.effopt.on { border-color: var(--gold); }

/* Rapports */
.res-WIN { color: var(--ok); } .res-LOSS { color: var(--bad); } .res-DRAW { color: var(--warn); }
.duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.duel .side { font-size: .9rem; }
.duel .val { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; }
.duel .winner { color: var(--ok); }

/* Combat animé (non passable, non accélérable) */
#overlay { position: fixed; inset: 0; z-index: 100; background: radial-gradient(900px 500px at 50% 0, #1b2a68, #070a1a 70%); display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: var(--gutter); overflow: hidden; }
body:has(#overlay:not([hidden]), dialog.about[open]) { overflow: hidden; }
.arena { width: min(760px, 100%); max-height: 100%; min-height: 0; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.arena .battle-detail { display: grid; gap: 10px; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.arena .head, .arena .score, .arena .final, .arena #see-report { flex: none; }
.arena #see-report { align-self: center; }
.arena .head { color: var(--gold2); letter-spacing: .18em; text-transform: uppercase; font-size: .85rem; }
.arena .vs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: stretch; }
.fighter { background: var(--surface); border: 2px solid var(--rc, var(--line)); border-radius: 14px; padding: 14px 8px; opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .5s, box-shadow .5s; }
.fighter.in { opacity: 1; transform: none; }
.fighter.win { box-shadow: 0 0 28px 4px rgba(76,195,138,.55); }
.fighter.lose { opacity: .55; }
.fighter .who { font-size: .75rem; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
.fighter .nm { font-weight: 800; font-size: 1.1rem; overflow-wrap: anywhere; }
.fighter .vl { font-size: 2.4rem; font-weight: 900; min-height: 1.2em; font-variant-numeric: tabular-nums; color: var(--gold2); }
.arena .mid { align-self: center; font-family: Georgia, serif; color: var(--gold); font-size: 1.4rem; }
.arena .idx { min-height: 2em; font-size: 1.15rem; opacity: 0; transition: opacity .5s; }
.arena .idx.in { opacity: 1; }
.arena .fx { min-height: 3em; display: grid; gap: 4px; }
.arena .fx div { background: #1d2a5e; border: 1px solid var(--gold); border-radius: 10px; padding: 6px 10px; font-size: .9rem; animation: pop .4s ease both; }
.arena .score { letter-spacing: .3em; color: var(--muted); }
.arena .final { font-family: Georgia, serif; font-size: 2.2rem; }
@media (orientation: landscape) and (max-height: 480px) {
  #overlay { padding: 8px var(--gutter); }
  .arena, .arena .battle-detail { gap: 6px; }
  .arena .fighter { padding: 6px 8px; }
  .arena .fighter img.art { max-height: 88px; }
  .arena .fighter .vl { font-size: 1.65rem; }
  .arena .idx, .arena .fx, .arena .bdslot { min-height: 0; }
}
@keyframes pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .fighter, .arena .idx { transition: none; transform: none; }
  .arena .fx div { animation: none; }
}

#toast { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); background: #2a1620; border: 1px solid var(--bad); color: var(--text); padding: 10px 16px; border-radius: 12px; z-index: 200; max-width: min(520px, 92vw); opacity: 0; pointer-events: none; transition: opacity .25s; }
#toast.show { opacity: 1; }
#toast.okk { background: #10261c; border-color: var(--ok); }

.modal { position: fixed; inset: 0; z-index: 60; background: rgba(4,6,16,.78); display: grid; place-items: center; padding: var(--gutter); overflow-y: auto; }
.modal .card { width: min(640px, 100%); max-height: 92vh; overflow-y: auto; }
dialog.about { margin: 0; width: 100%; height: 100%; max-width: none; max-height: none; border: 0; color: var(--text); }
dialog.about:not([open]) { display: none; }
dialog.about > .card { max-height: calc(100dvh - 2 * var(--gutter)); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); }

/* ---------- Chantier ergonomie (habillage fonctionnel provisoire) ---------- */
.grow { flex: 1; min-width: 0; }
.btn.tiny { min-height: 32px; padding: 4px 10px; font-size: .8rem; border-radius: 9px; }
.btn.ghost { background: transparent; }
.btn.busy { border-color: var(--ok); }
.warnline { color: var(--warn); }
.malus { color: var(--bad); }
.bonus { color: var(--ok); }
.locked { opacity: .78; }
.cols { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .cols { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; } }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }

/* Navigation : barre basse sur mobile (espace réservé, ne masque rien), intégrée à l'en-tête collant sur ordinateur. */
@media (max-width: 659px) {
  :root { --nav-height: calc(var(--fi-nav-h) + env(safe-area-inset-bottom)); }
  .nav.fi-nav--pose { position: fixed; inset: auto 0 0; z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .res .lbl { display: none; }
  body:has(.nav) .wrap { padding-bottom: calc(var(--nav-height) + 12px); }
  #toast { bottom: calc(var(--nav-height) + 8px); }
}
@media (min-width: 1000px) {
  .wrap { padding-bottom: 40px; }
  .dot { position: static; display: inline-block; }
}

/* SUMA */
.suma .tips { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; color: var(--text); font-size: .92rem; }
.tip { border-left: 3px solid var(--line); padding: 4px 8px; background: rgba(255,255,255,.02); border-radius: 6px; }
.tip .lvl { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tip.lv-CRITICAL { border-left-color: var(--bad); }
.tip.lv-CRITICAL .lvl { color: var(--bad); }
.tip.lv-SUGGESTION { border-left-color: var(--gold); }
.tip-actions { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; vertical-align: middle; }

/* Filtres et tableaux : défilement interne, jamais de défilement horizontal de la page */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.search-field { display: grid; gap: 3px; flex: 1 1 200px; }
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; max-width: 100%; }
.tscroll table { min-width: 100%; }
table.roster td, table.roster th, table.targets td, table.targets th, table.cmp td, table.cmp th { white-space: nowrap; }
table.roster tbody tr, table.targets tbody tr { cursor: pointer; }
table.roster tbody tr:hover, table.targets tbody tr:hover, table.roster tbody tr:focus-visible, table.targets tbody tr:focus-visible { background: var(--surface2); }
table.roster tr.off { opacity: .7; }
table.roster td.nm { border-left: 4px solid var(--rc, var(--line)); position: sticky; left: 0; background: var(--bg2); white-space: normal; min-width: 150px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.sorted { color: var(--gold2); font-weight: 700; }
.fat-lock { color: var(--bad); }
.fat-high { color: var(--warn); }
.thbtn { background: none; border: 0; color: var(--gold2); cursor: pointer; padding: 4px 2px; font-weight: 700; min-height: 32px; }
.target-btn { background: none; border: 0; cursor: pointer; font-weight: 700; padding: 0 4px; }
table.cmp td.best { color: var(--ok); font-weight: 700; }
table.targets tr.own td:first-child { box-shadow: inset 4px 0 0 var(--gold); }
table.targets tr.held-row td:first-child { box-shadow: inset 4px 0 0 var(--owner-color); }
table.targets tr.chosen { outline: 2px solid #fff; outline-offset: -2px; }
.dot-d { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }

/* Barres d'indices */
.bar { grid-template-columns: 86px 1fr 64px; }
.bar.hl span:first-child { color: var(--gold2); font-weight: 700; }
.bar.hl .fill { background: linear-gradient(90deg, var(--gold), var(--gold2)); }
.bar .num { white-space: nowrap; }
.fatrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin: 6px 0; }

/* Progression des chantiers */
.jobprog { display: grid; gap: 4px; margin: 4px 0 8px; }
.jobprog .progress > div { background: linear-gradient(90deg, var(--ok), var(--gold)); transition: width 1s linear; }

/* Recrutement et offre initiale */
.rcard { border-left: 5px solid var(--rc); }
.rcard.owned { opacity: .8; }
.b-AVAIL { color: var(--r-special); }
.optcard { text-align: left; cursor: pointer; display: grid; gap: 4px; }
.optcard .pro { color: var(--ok); }
.optcard .con { color: var(--warn); }
/* Recrutement initial : étapes numérotées et choix unique entre les trois offres. */
.offer-step { display: flex; align-items: center; gap: 12px; margin: 14px 0 8px; padding: 10px 14px; border-radius: 14px; background: linear-gradient(90deg, rgba(232,192,96,.16), rgba(232,192,96,0)); border-left: 3px solid var(--gold, #e8c060); }
.offer-step-num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #1a1408; background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold, #e8c060) 60%, #a77d23); box-shadow: 0 0 12px rgba(232,192,96,.5); }
.offer-choices .optcard { position: relative; }
.offer-choices .optcard.sel { box-shadow: 0 0 0 2px var(--gold, #e8c060), 0 0 18px rgba(232,192,96,.35); }
.offer-badge { justify-self: start; font-size: .78rem; font-weight: 700; letter-spacing: .04em; padding: 2px 10px; border-radius: 999px; border: 1px solid rgba(232,192,96,.6); color: var(--gold, #e8c060); }
.optcard.sel .offer-badge { background: var(--gold, #e8c060); color: #1a1408; }
.offer-or { position: absolute; right: -22px; top: 50%; transform: translateY(-50%); z-index: 1; font-size: .75rem; font-weight: 800; text-transform: uppercase; color: var(--gold, #e8c060); background: var(--bg, #0b1024); border: 1px solid rgba(232,192,96,.5); border-radius: 999px; padding: 3px 7px; }
@media (max-width: 640px) { .offer-or { right: 50%; top: auto; bottom: -19px; transform: translateX(50%); } }
@media (orientation: landscape) and (min-width: 641px) and (max-width: 760px) and (max-height: 540px) {
  /* Le rail laisse deux colonnes : le second « ou » sépare les deux rangées. */
  .offer-choices > :nth-child(2) .offer-or { right: 50%; top: auto; bottom: -19px; transform: translateX(50%); }
}
.garant { border-left: 4px solid var(--rc); padding-left: 8px; }
.counter { font-weight: 700; color: var(--gold2); }

/* Barre d'action : en flux normal ; version collante opaque, au-dessus de la navigation mobile, sans recouvrir le contenu */
.actionbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; padding: 10px 0; }
.actionbar.sticky { position: sticky; bottom: 0; z-index: 15; background: rgba(10,15,36,.96); border-top: 1px solid var(--line); padding: 10px var(--gutter); margin: 14px calc(-1 * var(--gutter)) 0; }

/* Cartes Effet */
.effcard { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-left-width: 5px; border-radius: 12px; background: var(--bg2); }
.effcard.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.effcard.notowned { opacity: .7; }
.effcard.n-index { border-left-color: var(--r-ultra); }
.effcard.n-cond { border-left-color: var(--warn); }
.effcard.n-value { border-left-color: var(--r-special); }
.effcard .etext { font-size: .95rem; }
.econd { margin: 0; padding-left: 1.1em; color: var(--muted); }
.ntag { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.chk { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; }
.rules { background: #101a3f; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 6px 0 10px; color: var(--muted); }
.warnbox { margin-top: 10px; border: 1px solid var(--warn); border-radius: 12px; padding: 8px 12px; background: #2a210f; }
.warnbox ul { margin: 4px 0 0; padding-left: 1.2em; }
.conseq { margin: 8px 0; }
.conseq summary { cursor: pointer; color: var(--gold2); }
.conseq ul { margin: 6px 0; padding-left: 1.2em; }

/* Préparation : emplacements de duel */
.slot { cursor: default; display: grid; gap: 2px; align-content: start; }
.slotname { font-size: 1rem; }
.slotbtns { gap: 4px; margin-top: 4px; }
@media (max-width: 480px) { .slots { grid-template-columns: 1fr; } }
.fcard.pick:disabled { opacity: .5; cursor: not-allowed; }

/* Dominion : quatre catégories */
.famlegend { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.fam { display: inline-block; border-radius: 10px; padding: 2px 8px; border: 1px solid var(--line); }
.f-eco { border-color: #d6a63c; }
.f-cry { border-color: #4cc7d8; }
.f-rec { border-color: #4cc38a; }
.f-str { border-color: #b783ff; }

/* Bilan */
.summary { text-align: center; }
.summary .final { font-family: Georgia, serif; font-size: 2rem; }
.summary ul { text-align: left; margin: 8px auto 0; max-width: 700px; }
.duelx { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--bg2); display: grid; gap: 6px; }
.dgrid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; }
.dgrid .mid { align-self: center; color: var(--gold); font-family: Georgia, serif; }
.dside { border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-width: 0; }
.dside.winner { border-color: var(--ok); }
.dside .final-v { font-size: 1.6rem; font-weight: 800; color: var(--gold2); font-variant-numeric: tabular-nums; }
.bd { display: grid; gap: 1px; margin: 4px 0; }
.fxlist { margin: 0; padding-left: 1.2em; }
.noinc { opacity: .7; font-style: italic; }
.factor { color: var(--gold2); }
.advice { border-color: var(--gold); }
details.dev { margin-top: 14px; border: 1px dashed var(--line); border-radius: 10px; padding: 6px 10px; }
details.dev summary { cursor: pointer; color: var(--muted); font-size: .8rem; }
.devzone { border: 1px dashed var(--warn); border-radius: 12px; padding: 8px 12px; margin-top: 10px; }
.arena .bdslot { min-height: 3.2em; }
.arena .fx div.noinc { border-style: dashed; }

/* Scène de l’académie : hauteur bornée pour laisser voir le reste de l’écran */
.scene svg { max-height: 340px; }
.fcard:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 759px) { .quick { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; } .quick .btn { flex: none; } }
.cols { grid-template-columns: minmax(0, 1fr); }
.cols > *, .grid > * { min-width: 0; }
@media (min-width: 1000px) { .cols { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }

/* ---------- Lot JOU : cartes originales, Arène, aides ---------- */
img.art { display: block; width: 100%; height: auto; aspect-ratio: 3264 / 4440; object-fit: contain; border-radius: 10px; background: #0b1128; margin: 0 auto 6px; }
img.art.xs { width: 34px; border-radius: 4px; margin: 0; display: inline-block; vertical-align: middle; }
img.art.sm { max-width: 140px; }
img.art.md { max-width: 200px; }
img.art.lg { max-width: 300px; }
.artzoom { display: block; cursor: zoom-in; border-radius: 10px; }
.artzoom:focus-visible { outline: 3px solid var(--focus); }
.pside .artzoom, .played .artzoom, .choice .artzoom { display: inline-block; }
.modal.cardview { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(5, 8, 20, .92); padding: 12px; cursor: zoom-out; }
.modal.cardview img { max-width: min(96vw, 620px); max-height: 84vh; width: auto; height: auto; border-radius: 14px; box-shadow: 0 10px 40px #000a; }
.help { margin-left: 4px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface2); color: var(--gold2); font-size: .75rem; font-weight: 700; line-height: 1; cursor: pointer; padding: 0; }
.pillars { margin: 10px 0; }
.pillars .who { color: var(--gold2); margin-bottom: 6px; }
.pillar .pico { font-size: 1.6rem; }
.pillar h3 { margin: 4px 0; }
.dtag { white-space: nowrap; padding: 2px 6px; border-radius: 8px; border: 1px solid var(--line); }
.dtag.ai { color: #9fd6ff; }
.dtag.held-tag { color: var(--text); border-color: var(--owner-color, var(--muted)); background: color-mix(in srgb, var(--owner-color, var(--muted)) 20%, var(--bg)); }
.map-legend .dtag { white-space: normal; }
.unavail { margin: 8px 0; }
.unavail li { margin: 4px 0; }
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0; }
.acard { background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.acard.sel { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.acard .noart { min-height: 80px; display: grid; place-items: center; font-weight: 700; color: var(--gold2); }
.acard.back { width: 52px; min-height: 72px; padding: 3px; }
.acard.back .backface { flex: 1; border-radius: 8px; display: grid; place-items: center; font-weight: 800; letter-spacing: .1em; color: var(--gold2); background: repeating-linear-gradient(45deg, #1b2550 0 6px, #141c3b 6px 12px); }
.acard.reveal, .flipin { animation: flipin .7s ease-out both; }
@keyframes flipin { from { transform: perspective(600px) rotateY(90deg); opacity: .2; } to { transform: none; opacity: 1; } }
.foezone { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px dashed var(--line); border-radius: 10px; margin: 8px 0; }
.foezone .played { text-align: center; max-width: 70px; }
.lead { padding: 10px; border-radius: 10px; margin: 8px 0; background: var(--surface2); }
.lead.ai { display: grid; grid-template-columns: 1fr minmax(140px, 200px); gap: 10px; align-items: start; border-left: 4px solid var(--bad); }
.lead.you { border-left: 4px solid var(--ok); }
.scoreline { font-weight: 800; color: var(--gold2); }
.board .final { font-size: 1.6rem; font-weight: 800; text-align: center; }
.plis { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.pli { border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.pli.fresh { border-color: var(--gold); }
.pvs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-top: 4px; }
.pvs .mid { color: var(--muted); font-weight: 700; }
.pside { padding: 6px; border-radius: 8px; }
.pside.win { background: rgba(76, 195, 138, .15); }
.pside.lose { opacity: .75; }
.choice { margin: 8px 0; }
@media (max-width: 520px) {
  .lead.ai { grid-template-columns: 1fr; }
  .agrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .acard.reveal, .flipin { animation: none; } }
.minidx { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; font-size: .75rem; }
.minidx span { display: flex; justify-content: space-between; gap: 2px; padding: 2px 4px; border-radius: 5px; background: var(--bg2); }
.minidx i { font-style: normal; color: var(--muted); }
.minidx .hl { background: var(--gold); color: var(--on-gold); }
.minidx .hl i { color: var(--on-gold); }

/* JOU-26 : choix par carte avec agrandissement séparé */
.pickwrap { position: relative; min-width: 0; }
.pickwrap > .fcard { width: 100%; }
.zoombtn { position: absolute; top: 6px; right: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 8px; min-width: 36px; min-height: 36px; cursor: zoom-in; }
.zoombtn:focus-visible { outline: 3px solid var(--focus); }

/* JOU-04 : indicateurs cliquables */
button.chip { font: inherit; color: inherit; cursor: pointer; min-height: 36px; }
button.chip:hover, button.chip:focus-visible { border-color: var(--gold); outline: none; }
button.chip:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
.rule > summary { cursor: pointer; min-height: 32px; }
.effline { margin-top: 2px; }

.repopen { all: unset; cursor: pointer; display: block; width: 100%; }
.repopen:focus-visible { outline: 3px solid var(--focus); }

.priority-picker { display: grid; justify-items: start; gap: 4px; margin: 6px 0; }
#planner, #battle-report-title, .academy-details [tabindex] { scroll-margin-block: calc(var(--header-height) + 60px) 56px; }
@media (max-width: 659px) {
  #planner, #battle-report-title, .academy-details [tabindex] { scroll-margin-top: calc(var(--header-height) + 8px); }
}
@media (max-width: 844px), (hover: none) and (pointer: coarse) {
  button, select, input:not([type="checkbox"]):not([type="radio"]), summary, .artzoom, .repopen, .chk, label:has(> input:is([type="checkbox"], [type="radio"])) {
    min-width: 44px;
    min-height: 44px;
  }
  .btn.small, .btn.tiny, button.chip, .rule > summary, .thbtn { min-height: 44px; }
  summary { align-content: center; }
  label:has(> input:is([type="checkbox"], [type="radio"])) { cursor: pointer; }
  input:is([type="checkbox"], [type="radio"]) { min-height: 0; width: 18px; height: 18px; flex: none; }
  table.roster tbody tr[tabindex] { height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .jobprog .progress > div, #toast { transition: none; }
}

/* JOU-18 : vue de combat dédiée (structure seulement ; la mise en scène artistique relève de la direction artistique) */
.combatview { position: fixed; inset: 0; z-index: 40; overflow-y: auto; background: var(--bg, #0a0f24); padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); }
.combatview .board { margin-top: 8px; }
.combatbar { position: sticky; top: 0; background: inherit; padding: 6px 0; z-index: 1; }

/* PERS-01B — portraits, silhouettes de repli et choix de l'apparence. */
.character-portrait {
  --portrait-size: 88px;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--portrait-size);
  height: var(--portrait-size);
  overflow: hidden;
  border: 2px solid var(--portrait-grade, var(--line));
  border-radius: 12px;
  background: var(--bg2);
}
.character-portrait > svg { width: 86%; height: 86%; }
.character-portrait picture { position: absolute; inset: 0; visibility: hidden; }
.character-portrait img { display: block; width: 100%; height: 100%; object-fit: contain; }
.character-portrait.has-portrait picture { visibility: visible; }
.character-portrait.has-portrait > svg { visibility: hidden; }
.character-portrait.compact { --portrait-size: 36px; border-radius: 8px; }
.personal-card-heading, .ranking-player { display: flex; align-items: center; gap: 10px; }
.personal-card-heading > div { min-width: 0; overflow-wrap: anywhere; }
.character-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 92px), 1fr)); gap: 8px; }
.btn.character-choice {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 6px;
  padding: 8px 4px;
  font-size: .82rem;
  text-align: center;
  overflow-wrap: anywhere;
}
.character-choice .character-portrait { --portrait-size: 60px; }
.btn.character-choice[aria-pressed="true"] { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); font-weight: 700; }
@media (min-width: 1000px) {
  .personal-card-heading .character-portrait { --portrait-size: 112px; }
}

/* Le bouton SUMA occupe une place dans l’en-tête. */
.suma-mini { position: relative; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; border-radius: 50%; overflow: hidden; border: 2px solid #c9a227; background: #1c2540; cursor: pointer; }
.suma-mini img { width: 100%; height: 180%; object-fit: cover; object-position: 50% 4%; display: block; }
.suma-mini .suma-dot { position: absolute; top: 4px; right: 4px; width: 12px; height: 12px; border-radius: 50%; background: #e04a3a; border: 2px solid #1c2540; }
.suma-mini.urgent { border-color: #e0a030; box-shadow: 0 0 0 3px rgba(224,160,48,.45), 0 4px 14px rgba(0,0,0,.45); }
.suma-mini:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.suma-mini-fallback { display: grid; place-items: center; width: 100%; height: 100%; font-weight: 700; color: #c9a227; font-size: 20px; }

/* Navigation secondaire et fenêtres communes */
.dot[hidden] { display: none; }
.profile-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(155px, 100%), 1fr)); gap: 8px; }
.profile-menu .btn { position: relative; justify-content: flex-start; min-height: 44px; }
.profile-menu .dot { display: inline-block; position: static; margin-left: 6px; }
.sous-onglets-liste { margin: 10px 0 12px; }
.sous-onglets [role="tabpanel"] { min-width: 0; }
.info-line { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: .85rem; color: var(--muted); }
.info { flex: none; min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--text); cursor: pointer; font-weight: 700; text-decoration: underline; }
.indicator-list { display: grid; gap: 8px; }
.indicator-list button { justify-content: space-between; }
.academy-more { margin-bottom: 8px; }
.academy-more .quick { margin-top: 6px; }
.academy-details { margin-top: 12px; }
#selected-building:empty { display: none; }
.mercenary-preview { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.portrait-zoom { width: fit-content; border: none; padding: 0; background: none; cursor: zoom-in; }

body:has(.ui-dialog[open]) { overflow: hidden; }
.modal.ui-dialog, .modal.ui-dialog.cardview {
  display: block; inset: 0; margin: auto; padding: 0;
  width: min(640px, calc(100% - 2 * var(--gutter)));
  max-width: none; max-height: calc(100dvh - 2 * var(--gutter));
  border: 0; background: transparent; color: var(--text); cursor: auto;
}
.modal.ui-dialog:not([open]) { display: none; }
.ui-dialog::backdrop { background: rgba(4,6,16,.78); }
.modal.ui-dialog > .card { width: 100%; max-height: calc(100dvh - 2 * var(--gutter)); }
.dialog-heading { flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.dialog-heading h2 { margin: 0; }
.dialog-toast { position: absolute; inset: auto 12px 12px; pointer-events: none; }
.dialog-toast:not(.show) { opacity: 0; }
.dialog-toast.show { padding: 8px 12px; border: 1px solid var(--warn); background: var(--bg); }
.dialog-toast.okk { border-color: var(--ok); }
.modal.ui-dialog.tiroir { inset: auto 0 0; width: min(720px, 100%); max-height: 85dvh; animation: tiroir-entree .22s ease-out; }
.modal.ui-dialog.tiroir > .dialog-panel { max-height: 85dvh; padding-bottom: max(12px, env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.tiroir-poignee { display: grid; place-items: center; height: 32px; touch-action: none; cursor: grab; }
.tiroir-poignee::before { content: ""; width: 42px; height: 3px; background: var(--muted); }
.modal.ui-dialog.cardview img { display: block; max-width: 100%; max-height: 75dvh; margin: auto; }
@keyframes tiroir-entree { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .modal.ui-dialog.tiroir { animation: none; } }

/* FAB-02 : académie 3D. La scène 2D (svg) reste dessous pendant le chargement et comme repli. */
.scene.scene3d { position: relative; padding: 0; overflow: hidden; height: clamp(340px, 46vw, 600px); }
.scene.scene3d .scene3d-stage { position: absolute; inset: 0; border-radius: inherit; }
.scene.scene3d:not(.ready) .scene3d-stage { visibility: hidden; }
.scene-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: radial-gradient(ellipse at 50% 45%, #62584b 0%, #233570 24%, #101b48 55%, #070c2a 100%);
  color: #f8e6b7; text-align: center; font: 700 .9rem var(--fi-titre, Georgia, serif); pointer-events: none; }
.scene-loading::before { content: ''; width: 34px; aspect-ratio: 1; border-radius: 50%; border: 2px solid #f0c86e55; border-top-color: #f0c86e;
  box-shadow: 0 0 24px #f0c86e35; animation: roa-attente-3d 1s linear infinite; }
.scene3d.ready > .scene-loading, .dom3d-wrap.ready > .scene-loading,
.arene3d-hote:not([data-mode="attente"]) > .scene-loading { display: none; }
.arene3d-hote[data-mode="attente"] > canvas { visibility: hidden; }
@keyframes roa-attente-3d { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .scene-loading::before { animation: none; } }
@media (max-width: 700px) { .scene.scene3d { height: min(120vw, 68vh); } }

/* Salon des copains */
.salon .salon-content, .salon .salon-group { display: grid; gap: 12px; min-width: 0; }
.salon .salon-content { justify-items: start; margin-top: 12px; }
.salon .salon-group, .salon .salon-forms { width: 100%; }
.salon .salon-group { padding-top: 12px; border-top: 1px solid var(--line); }
.salon .salon-group h4, .salon .salon-group p { margin: 0; }
.salon .salon-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.salon .salon-forms[hidden] { display: none; }
.salon .salon-form { display: grid; gap: 8px; }
.salon .salon-form input, .salon .salon-form select { width: 100%; }
.salon .salon-list { display: grid; gap: 8px; margin: 0; padding-inline-start: 1.25em; }
.salon .salon-list li { overflow-wrap: anywhere; }
.salon .salon-list .btn { margin-inline-start: 8px; }
.salon .salon-actions { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.salon .salon-code { font-family: monospace; letter-spacing: .12em; user-select: all; }
.salon .btn, .salon input, .salon select { min-height: 44px; }
.salon .btn[aria-pressed="true"] { border-color: var(--gold2); box-shadow: inset 0 0 0 1px var(--gold2); }
.salon .btn[aria-disabled="true"] { opacity: .65; cursor: default; }
.salon :focus-visible { outline: 2px solid var(--gold2); outline-offset: 3px; }
.salon .salon-duel { overflow-wrap: anywhere; }
.salon .salon-timer { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--gold2); }
.salon .salon-duel .agrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 155px), 1fr)); margin: 0; }
.salon .salon-duel .pvs { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.salon .salon-duel .minidx span { min-width: 0; }
.salon .salon-duel .minidx i { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.salon .salon-duel .pside .art { display: block; max-width: 100%; }
.salon .salon-duel .salon-actions { max-width: 100%; }
.salon .salon-winner { color: var(--gold2); font-weight: 800; overflow-wrap: anywhere; }
.salon .salon-winner:empty { margin: 0; }
.salon .salon-standings { width: 100%; border-collapse: collapse; table-layout: fixed; }
.salon .salon-standings caption { text-align: start; font-weight: 800; margin-bottom: 6px; }
.salon .salon-standings th, .salon .salon-standings td { padding: 6px 3px; border-bottom: 1px solid var(--line); text-align: center; overflow-wrap: anywhere; }
.salon .salon-standings th:first-child { width: 42%; text-align: start; }
.salon .salon-schedule, .salon .salon-bracket { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.salon .salon-round { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.salon .salon-round h5 { margin: 0 0 8px; font-size: 1rem; }
.salon .salon-round li + li { border-top: 1px solid var(--line); padding-top: 8px; }
.salon .salon-round .btn { margin: 4px 0 0; }
.salon .salon-reactions span { white-space: nowrap; }
.salon [aria-label="Réactions rapides"] .btn { min-width: 44px; }

/* FAB-07 dans les écrans du jeu */
.ui-fable {
  --text: var(--fi-texte);
  --muted: var(--fi-texte-doux);
  --ok: var(--fi-ok);
  --bad: var(--fi-erreur);
  --warn: var(--fi-alerte);
  --focus: var(--fi-focus);
  --parchemin: #e6d4a9;
  --parchemin-ombre: #cdb78b;
  --parchemin-encre: #2b1d10;
}
.ui-fable .wrap { padding-top: 12px; }
.fi-barre.topbar { border: 0; }
.header-row .fi-avatar-rond { width: 44px; height: 44px; }
.header-row .fi-avatar-rond .character-portrait { --portrait-size: 40px; border-radius: 50%; }
.header-row .suma-mini { box-shadow: 0 0 0 3px #0e1538, 0 0 0 4px #6f5423; }
.header-row .suma-mini.urgent { box-shadow: 0 0 0 3px #c58f36, 0 0 16px #ffcf70aa; }
.header-row .fi-ressources { justify-content: start; align-items: center; }
.res button.fi-res, .indicator-list button.fi-res {
  gap: 4px; padding: 0 6px 0 0; border-radius: 24px 8px 8px 24px;
  border-color: #6471a0; background: linear-gradient(180deg, #0c1233, #162050);
  color: var(--fi-texte);
}
.res .fi-res-ico { width: 25px; height: 25px; margin: 0; }
.res .fi-res-ico .fi-ico { width: 15px; height: 15px; }
.res .fi-res-val { flex: 0 0 auto; min-width: max-content; font-size: clamp(.6875rem, 3.12vw, 1rem); }
.res button[data-res="energy"] { flex-shrink: 0; }
.res button.chip:is(:focus-visible, :hover), .indicator-list button.chip:is(:focus-visible, :hover) { border-color: var(--fi-or); }
.res button.chip:focus-visible, .indicator-list button.chip:focus-visible { outline: 3px solid var(--fi-focus); outline-offset: 1px; }
.indicator-list .fi-res { min-height: 44px; max-width: none; justify-content: start; gap: 10px; }
.indicator-list .fi-res-val { text-align: right; }
.nav .fi-pastille { position: absolute; }
.nav .fi-onglet[aria-disabled="true"] .fi-onglet-plaque {
  filter: grayscale(1);
  color: #e0e0e0;
  background: linear-gradient(180deg, #777, #414141);
}
.nav.fi-nav--pose .fi-onglet .fi-onglet-cadenas {
  position: absolute;
  display: block;
  inset: 24px 8px auto auto;
  width: 13px;
  height: 13px;
}
.fi-nav-repli { display: none; }
@media (forced-colors: active) {
  .fi-onglet-plaque > .fi-ico, .profile-entry > .fi-ico:has(+ .fi-nav-repli) { display: none; }
  .fi-nav-repli { position: relative; display: block; }
  .fi-onglet[aria-current="page"] .fi-onglet-nom { text-decoration: underline; }
}
@media (min-width: 660px) {
  .res .fi-res-val { font-size: 1rem; }
  .res .fi-res-ico { width: 32px; height: 32px; }
  .res .fi-res-ico .fi-ico { width: 19px; height: 19px; }
  .nav.fi-nav--pose {
    gap: 8px; padding-inline: max(12px, calc((100% - 850px) / 2));
    background: var(--fi-grain), linear-gradient(180deg, #151f4b, #101738);
  }
  .nav .fi-onglet-nom { font-size: .875rem; }
  .ui-fable .wrap { padding-top: 18px; }
}
@media (max-width: 365px) {
  .header-row { gap: 4px; padding-inline: 6px; }
  .res button.fi-res { gap: 3px; padding-right: 4px; }
  .res .fi-res-ico { width: 19px; height: 19px; border-width: 1px; }
  .res .fi-res-ico .fi-ico { width: 12px; height: 12px; }
  .nav .fi-onglet-nom { font-size: .6875rem; }
}
.sous-onglets-liste .fi-banniere { min-width: 44px; }
.fi-bannieres .fi-banniere:focus-visible { outline-offset: -3px; border-radius: 10px; }
#academie-tabs .fi-banniere { padding-inline: 8px; font-size: clamp(.75rem, 3.12vw, .9375rem); }
.academy-more { margin-top: 12px; }
.salon-countdown:empty, .salon-winner:empty { display: none; }
.ui-fable .info {
  display: grid; place-items: center; border: 1px solid var(--fi-or-profond); border-radius: 50%; width: 44px;
  background: radial-gradient(circle at 35% 25%, #46548f, #151d48 80%); color: var(--fi-or-clair);
}
.info .fi-ico { width: 21px; height: 21px; }
.ui-fable .info:hover { border-color: var(--fi-or-clair); }
.ui-fable .btn:is([aria-disabled="true"], :disabled) { opacity: 1; color: #c0c7dc; background: #222840; border-color: #686b7c; }
.ui-fable .btn.ghost.danger { text-decoration: underline; text-decoration-color: currentColor; }
.ui-fable .btn:focus-visible, .ui-fable .info:focus-visible { outline: 3px solid var(--fi-focus); }
.ui-fable :is(.wrap, .ui-dialog) :is(summary, .artzoom, .zoombtn, .portrait-zoom) { min-height: 44px; min-width: 44px; }
.fi-vide { padding: 8px; grid-template-columns: minmax(64px, 100px) minmax(0, 1fr); }
.fi-vide > .fi-vide-image { width: 100%; grid-row: auto; color: var(--fi-or-clair); }
.fi-vide .fi-vide-titre { align-self: center; }
/* Titre et texte toujours dans la colonne large, à côté de l'illustration (le texte tombait sous l'image, un mot par ligne). */
.fi-vide > .fi-vide-titre, .fi-vide > .fi-vide-texte { grid-column: 2; }
.fi-vide > .fi-vide-image { grid-row: 1 / span 2; }
.ui-fable .fi-panneau-titre { justify-content: start; margin-bottom: 10px; color: var(--fi-encre); }
.ui-fable .fi-panneau-titre .fi-ico { width: 24px; height: 24px; --i2: #e4d9c0; }
.ui-fable .fi-screen-title {
  border: 1px solid var(--fi-or-profond);
  border-radius: 3px 3px 10px 10px;
  padding-block: 10px;
}
.fi-fiches { display: grid; gap: 8px; list-style: none; margin: 8px 0; padding: 0; }
.fi-fiches > li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; min-width: 0;
  overflow-wrap: anywhere; background: var(--fi-grain), linear-gradient(160deg, #29366a, #17204b);
  border: 1px solid #80735a; border-radius: 8px 8px 14px 8px; box-shadow: inset 0 1px 0 #fff2, 0 3px 8px #0004;
}
.fi-fiches > li > .fi-ico { color: var(--fi-or-clair); }
.fi-jetons { column-gap: 4px; row-gap: 4px; }
.fi-jeton { max-width: 100%; min-width: 44px; text-align: left; padding-right: 3px; }
.fi-jeton-nom { padding-block: 5px; line-height: 1.2; }
.fi-jeton:focus-visible { outline: 3px solid var(--fi-focus); }

.modal.ui-dialog > .dialog-panel { padding: 6px 8px 12px; }
.ui-fable .modal.ui-dialog .dialog-heading { justify-content: space-between; }
.ui-fable .dialog-heading h2 { flex: 1; min-width: 0; color: var(--fi-encre); text-shadow: 0 1px #fff8; overflow-wrap: anywhere; }
.ui-fable .dialog-heading .btn.ghost { color: #382609; text-decoration: none; padding-inline: 6px; }
.ui-fable .dialog-heading .btn .fi-ico { width: 16px; height: 16px; }
.modal.ui-dialog.tiroir > .dialog-panel { animation: none; overflow-y: auto; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.modal.ui-dialog.tiroir > .dialog-panel > * { flex-shrink: 0; }
.tiroir-poignee.fi-tiroir-poignee { height: 44px; margin-bottom: 4px; }
.dialog-toast.fi-toast { position: absolute; inset: auto 12px 12px; max-width: none; transform: none; }
#toast.fi-toast { background: linear-gradient(180deg, #f3ead4, #cfc2a3); color: var(--fi-encre); border-color: var(--fi-or-profond); }
#toast.fi-toast.toast-error, .dialog-toast.fi-toast.toast-error { background: #2a1620; color: var(--fi-erreur); border-color: var(--fi-erreur); }
#toast.fi-toast.okk, .dialog-toast.fi-toast.okk { background: #10261c; color: #e3f9e9; border-color: var(--fi-ok); }
.modal.ui-dialog.suma-dialog {
  inset: calc(var(--header-height) + env(safe-area-inset-top)) max(8px, calc((100vw - 1280px) / 2 + 8px)) auto auto;
  margin: 0; padding-top: 14px; width: min(580px, calc(100% - 16px)); overflow: visible;
}
.suma-dialog::before {
  content: ""; position: absolute; top: 0; right: 12px; width: 22px; height: 16px;
  background: var(--fi-or); clip-path: polygon(55% 0, 100% 100%, 0 100%);
}
.ui-dialog.suma-dialog:has(.fi-conseil)::backdrop { background: #04061081; }
.modal.ui-dialog.suma-dialog > .fi-conseil {
  position: relative; inset: auto; z-index: auto; max-height: calc(100dvh - 100px); overflow-y: auto;
  color: var(--text); border: 12px solid transparent;
  border-image: url("interface/cadre.svg") 24 / 12px stretch;
  border-radius: 0; background: var(--fi-grain), linear-gradient(160deg, #243362, #101738) padding-box;
}
.suma-dialog .fi-conseil::after { content: none; }
.app-loading { max-width: min(calc(100% - 24px), 520px); margin: 32px auto; }
.scene-loading.app-loading { position: fixed; max-width: none; margin: 0; }
.app-loading > .fi-ico { color: var(--fi-or); }

/* Archives, cartes personnelles et livre */
.fi-parchemin {
  color: var(--parchemin-encre); border: 1px solid #a6814c; border-radius: 8px 8px 14px 14px;
  background: var(--fi-grain), linear-gradient(90deg, #ad8855, transparent 5% 95%, #ad8855),
    radial-gradient(ellipse at 50% 12%, #faedcb 10%, var(--parchemin) 62%, var(--parchemin-ombre));
  box-shadow: inset 0 0 0 3px #e9cb8cb3, inset 0 -8px 17px #57391c38, 0 8px 18px #06061265;
  padding: 13px clamp(12px, 4vw, 32px);
}
.fi-parchemin .muted, .fi-parchemin .info-line, .fi-parchemin .steps li.done { color: #4e3924; }
.fi-parchemin .steps li.done::before, .fi-parchemin .res-WIN { color: #21513a; }
.fi-parchemin .res-LOSS { color: #7e2631; }
.fi-parchemin .res-DRAW { color: #573b10; }
.fi-parchemin .btn.ghost.danger { color: #7e2631; }
.fi-parchemin .btn.ghost.danger:hover { background: #6a2a2020; }
.fi-parchemin :is(.repopen, .fi-jeton, .btn, summary):focus-visible { outline: 3px solid #123c66; }
.fi-parchemin .fi-filet { color: #674717; }
.fi-archives > .btn, .fi-archives > .info-line { margin-block: 6px; }
.fi-parchemin.rep { position: relative; }
.fi-parchemin.rep.sel { border: 3px solid #a75233; }
.repopen:hover { text-decoration: underline; text-underline-offset: .15em; }
.report-seal { display: flex; align-items: center; gap: 8px; font: 700 1.28rem var(--fi-titre); }
.report-hero { text-align: center; margin: 10px 0 16px; }
.report-hero > .fi-ico { width: 40px; height: 40px; margin: 0 auto; color: #684915; }
.report-hero .final { font: 700 clamp(2rem, 8vw, 3.25rem)/1.1 var(--fi-titre); }
.report-hero .score { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.report-hero .steps { text-align: left; }
.report-vignette {
  padding: 6px 10px; border: 1px solid #8b754d; border-radius: 7px 7px 16px 16px; text-align: center;
  background: var(--fi-grain), radial-gradient(ellipse at top, #303e72 5%, #131d42 80%); box-shadow: inset 0 1px 0 #ffeea060, 0 5px 10px #0005;
}
.report-vignette .info-line { font-weight: 700; text-align: left; color: var(--fi-or-clair); }
.report-duel-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: center; }
.report-duel-pair > .fi-ico { color: var(--fi-or-clair); }
.report-fighter { display: grid; justify-items: center; align-self: stretch; align-content: start; gap: 4px; overflow-wrap: anywhere; }
.report-fighter .art { width: auto; max-width: 56px; max-height: 76px; margin: 0; }
.report-fighter > .fi-ico { width: 44px; height: 44px; color: #e3ca8b; }
.report-fighter b { font: 700 1.25rem var(--fi-titre); }
.report-body .card .steps > li, .report-body .advice li {
  padding: 5px 8px; border: 1px solid #6e6249; border-radius: 4px 8px 8px 4px;
  background: var(--fi-grain), linear-gradient(160deg, #29366a, #17204b); color: var(--fi-texte);
}
.report-body .advice ul { display: grid; gap: 5px; padding: 0; list-style: none; }

.profile-gate, .salon-foyer {
  display: grid; grid-template-columns: auto minmax(0,1fr); gap: 14px; align-items: center; padding: 12px;
  background: var(--fi-grain), radial-gradient(ellipse at 15% 4%, #b592514d, transparent 65%),
    repeating-linear-gradient(90deg, #ffffff0e 0 3px, transparent 3px 21%, #0003 21% 22%),
    linear-gradient(180deg, #303a64 0 76%, #81745a 76% 78%, #151a36 78%);
  border: 1px solid #a38856; border-radius: 10px 10px 4px 4px; overflow-wrap: anywhere;
}
.profile-gate { margin-bottom: 12px; }
.profile-gate .character-portrait { --portrait-size: clamp(74px, 20vw, 128px); }
.profile-gate .brand { padding: 0; }
.ui-fable .profile-entry.btn {
  min-height: 62px; justify-content: start; border-radius: 8px 8px 14px 14px; text-align: left; padding-inline: 8px;
}
.profile-entry .fi-ico { color: var(--fi-or-clair); }
.about-book .splash { padding: 4px 0; }
.ui-fable .about-book .splash :is(h1, .fns, .ls4u, .tag) { color: var(--parchemin-encre); text-shadow: none; }
.about-book { overflow-wrap: anywhere; }
.about-note summary { display: flex; align-items: center; gap: 8px; justify-content: space-between; min-height: 44px; cursor: pointer; font-weight: 700; }
.about-note summary .fi-ico { width: 22px; height: 22px; }
.about-archive .fi-panneau-titre { margin-top: 10px; }
.fi-book { max-width: 1000px; margin: auto; }
.fi-book .fi-jetons { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); }
.fi-book .fi-screen-title { margin-top: 0; }
.rule-chapter { margin: 10px 0; padding: 12px; border-left: 3px solid #8b6438; overflow-wrap: anywhere; }
.rule-chapter ul { padding: 0; list-style: none; display: grid; gap: 6px; }
.rule-chapter li { background: #f7e7bd; border: 1px solid #97774f; border-radius: 3px 9px 9px 3px; padding: 7px 10px; }
.fi-parchemin h3 { color: var(--parchemin-encre); }
.ui-fable .player-card {
  background: var(--fi-grain), radial-gradient(ellipse at 18% 0, #775d35 0, #282944 35%, #111938 74%) padding-box;
  box-shadow: inset 0 0 0 2px var(--player-frame);
}
.player-card .personal-card-heading { display: grid; grid-template-columns: minmax(100px,.75fr) minmax(0,1.25fr); align-items: center; }
.player-card .character-portrait { --portrait-size: auto; width: 100%; height: auto; aspect-ratio: 5 / 7; background: radial-gradient(ellipse, #494885, #141935); }
.player-card .character-portrait > svg { max-width: 100%; }
.player-medal { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--fi-or-clair); }
.grade-emblem { object-fit: contain; max-width: 100%; filter: drop-shadow(0 4px 7px #0009); }
.stat-shields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 90px), 1fr)); gap: 6px; margin: 12px 0; }
.fi-shield {
  position: relative; isolation: isolate; color: var(--fi-texte); display: grid; justify-items: center;
  gap: 4px; padding: 8px 4px 16px; text-align: center; min-width: 0; overflow-wrap: anywhere;
}
.fi-shield::before, .fi-shield::after {
  --shield: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%);
  content: ""; position: absolute; z-index: -2; inset: 0; clip-path: var(--shield);
  background: linear-gradient(135deg, #f7df9c, #977444 65%, #d7b36b);
}
.fi-shield::after { z-index: -1; inset: 2px; background: var(--fi-grain), linear-gradient(160deg, #303d77, #151e46 75%); }
.fi-shield .fi-ico { color: var(--fi-or-clair); }
.fi-shield dd { margin: 0; font: 700 1.3rem var(--fi-titre); color: var(--fi-or-clair); }
.fi-shield dt { font-size: .82rem; }
.fi-appearance { margin-top: 12px; }
.appearance-name, .trade-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.appearance-name > b { flex: 1; }
.fi-entry-form { display: grid; gap: 8px; }
.prestige-gallery .prestige-current {
  display: grid; justify-items: center; color: var(--fi-or-clair); font: 700 1.4rem var(--fi-titre);
  background: radial-gradient(ellipse at 50% 40%, #bb97515e, transparent 66%); padding-block: 5px 12px;
}
.prestige-medals { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 86px), 1fr)); gap: 6px; margin: 6px 0; }
.prestige-medals [data-locked="true"] img { filter: saturate(.55) drop-shadow(0 2px 4px #0008); }
.prestige-medals .fi-shield .small { font-size: .75rem; }

.fx-settings { border: 0; padding: 0; margin: 0; min-width: 0; }
.fx-settings legend { font: 700 1.1rem var(--fi-titre); color: var(--fi-or-clair); }
.fx-choices { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 5px; margin-top: 10px; }
.fi-choice { position: relative; display: grid; align-items: stretch; cursor: pointer; }
.fi-choice > input { position: absolute; inset: 0 auto auto 0; opacity: 0; }
.fi-choice .fi-shield { min-height: 95px; align-content: start; padding: 8px 2px 20px; font-size: .8125rem; }
.fi-choice .fi-shield .fi-ico { width: 28px; height: 28px; }
.fi-choice input:checked + .fi-shield, .fi-choice input:checked + .fi-shield .fi-ico { color: var(--fi-encre); }
.fi-choice input:checked + .fi-shield::after { background: linear-gradient(150deg, #fff3c4, #d5a749); }
.fi-choice input:focus-visible + .fi-shield { outline: 3px solid var(--fi-focus); outline-offset: -2px; }

.trial-gallery { margin-top: 12px; }
.trial-path { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.trial-stop {
  position: relative; display: grid; justify-items: start; gap: 5px; min-width: 0; padding: 8px 8px 8px 58px;
  background: var(--fi-grain), linear-gradient(145deg, #344171, #19234c 75%);
  border: 1px solid #887451; border-radius: 20px 10px 10px 20px;
}
.trial-stop:not(:last-child)::before { content: ""; position: absolute; width: 4px; top: 38px; bottom: -11px; left: 28px; background: linear-gradient(90deg, #765924, #ebc16b); }
.trial-medallion {
  position: absolute; left: 6px; top: 6px; display: grid; place-items: center; width: 46px; height: 46px;
  border: 2px solid #a38a5d; border-radius: 50%; color: var(--fi-or-clair);
  background: radial-gradient(circle at 40% 30%, #6e603b, #202950 70%); box-shadow: 0 4px 8px #0007;
}
.trial-stop h4 { margin: 0; }
.trial-stop[data-state="passed"] .trial-medallion { color: #eafae0; border-color: var(--fi-ok); background: radial-gradient(circle, #405f4d, #182a35); }
.trial-stop[data-state="locked"] .trial-medallion { color: #c7c9d5; background: radial-gradient(circle, #465176, #222944); }

.rank-hall .fi-jetons + .fi-jetons { margin-top: 6px; }
.ranking-cards > li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; }
.ranking-cards .own { border-color: var(--fi-or); }
.rank-medal { padding-block: 8px; border: 1px solid #9b7b39; text-align: center; border-radius: 50%; color: var(--fi-or-clair); background: #1b2247; }
.ranking-player { flex-wrap: wrap; }
.rank-score { display: grid; justify-items: end; }
.rank-score b { font-variant-numeric: tabular-nums; color: var(--fi-or-clair); }
.season-winners { margin: 5px 0 0; }
.season-winners > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.season-winners dd { margin: 0; }
.trade-pick { margin: 8px 0; }
.trade-offer { overflow-wrap: anywhere; }

.salon .salon-form, .salon .salon-list > li, .salon-standings-cards > li {
  padding: 10px; border: 1px solid #8a7654; border-radius: 8px 8px 16px 16px;
  background: var(--fi-grain), radial-gradient(ellipse at 30% 0, #414067, #222b56 48%, #141d3f 95%);
  box-shadow: inset 0 1px 0 #eedca057, 0 4px 8px #0006;
}
.salon .salon-form { align-content: start; justify-items: stretch; }
.salon .salon-form > .fi-ico, .salon-foyer > .fi-ico { width: 40px; height: 40px; color: var(--fi-or-clair); }
.salon .salon-form > label { font: 700 1.1rem var(--fi-titre); color: var(--fi-or-clair); }
.salon input#salon-code {
  font: 700 1.15rem ui-monospace, monospace; letter-spacing: .2em; text-transform: uppercase;
  border-color: #b48c4c; background: var(--fi-grain), linear-gradient(180deg, #f4e4bc, #d5c093); color: var(--fi-encre);
}
.salon-foyer p { margin: 0; font-weight: 700; }
.salon .salon-list { list-style: none; padding: 0; }
.salon-player { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-weight: 700; }
.salon-player > .fi-ico { color: var(--fi-or-clair); }
.salon .salon-list > li .btn { margin: 4px 0 0; }
.salon .salon-standings-cards > li { display: grid; }
.salon-metrics { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0; }
.salon-metrics > div { display: grid; justify-items: start; }
.salon-metrics dt { font-size: .75rem; color: var(--muted); }
.salon-metrics dd { margin: 0; font-weight: 700; color: var(--fi-or-clair); }
.salon .salon-reactions { color: var(--fi-or-clair); }
.salon .salon-countdown { color: var(--fi-alerte); }
.profile-gate > .character-portrait, .salon-foyer > .fi-ico, .prestige-current .grade-emblem {
  animation: fi-reflet-veille 7s ease-in-out infinite alternate;
}
@keyframes fi-reflet-veille { to { filter: drop-shadow(0 0 10px #edc66c77); } }
@media (min-width: 760px) {
  .trial-path { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trial-stop:nth-last-child(2)::before { display: none; }
  .player-card .personal-card-heading { grid-template-columns: minmax(160px, 260px) minmax(0,1fr); gap: 20px; }
}
/* Intégration des scènes Fable. */
.dom3d-wrap { position: relative; height: clamp(360px, 50vw, 640px); border-radius: 12px; overflow: hidden; }
.dom3d-wrap .dom3d-stage { position: absolute; inset: 0; visibility: hidden; }
.dom3d-wrap.ready .dom3d-stage { visibility: visible; }
.dom3d-stage .d3d, .dom3d-stage canvas { width: 100%; height: 100%; display: block; }
.dom3d-stage .d3d { position: relative; }
.dom3d-stage canvas { touch-action: none; }
.dom3d-stage .d3d-buttons, .dom3d-stage .d3d-controls { position: absolute; inset: auto 8px 10px auto; display: flex; gap: 6px; }
.dominion-board.with-sector { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 8px; align-items: start; }
.dominion-tools { display: flex; gap: 8px; margin-top: 6px; }
.dominion-map { scroll-margin-top: 60px; }
.dominion-sector { padding: 12px; color: #fff; background: linear-gradient(140deg, #293a70, #0b122b); border: 1px solid #dec176; }
.dominion-sector-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.dominion-sector-head h3 { margin: 0; }
.dominion-sector-picture, .dominion-list-picture { display: inline-grid; place-items: center; width: 56px; height: 56px; border: 1px solid #d6b763; border-radius: 50%; overflow: hidden; vertical-align: middle; }
.dominion-sector-picture picture, .dominion-list-picture picture, .dominion-sector-picture img, .dominion-list-picture img { width: 100%; height: 100%; object-fit: contain; }
.dominion-list-picture { width: 32px; height: 32px; margin-right: 5px; }
.dominion-sector-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; margin: 8px 0; }
.dominion-sector-facts dt { color: #d1d9f4; font-size: .85rem; }
.dominion-sector-facts dd { margin: 0; font-weight: 700; }
#app .dominion-strategy.card { background: linear-gradient(115deg, #32201b, #141a32 62%); border-color: #cba856; }
.dominion-strategy .duel-plan .slot { border-color: #b89c60; box-shadow: inset 0 0 16px #dab87130; }
.dominion-strategy .slot .character-portrait { --portrait-size: 48px; }
.profile-brand { min-width: 0; }
.profile-brand .brand { min-width: 0; flex-wrap: wrap; }
.profile-brand .profile-tagline { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .dominion-board.with-sector { display: block; }
  .dom3d-wrap { height: min(112vw, 56dvh); }
  .dominion-board.with-sector .dom3d-wrap { height: min(90vw, 42dvh); }
  .dominion-sector { position: fixed; bottom: var(--nav-height, 0px); left: 0; right: 0; z-index: 32; max-height: 44dvh; overflow: auto; border-radius: 16px 16px 0 0; }
  .dominion-sector .btn.primary { width: 100%; }
}
.dominion-tools .fi-ico { width: 20px; height: 20px; min-width: 0; }
/* Fenêtre « Ton personnage » compacte, sans défilement (retour du propriétaire, 30/11/2026). */
.commander-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.commander-stat { display: flex; flex-direction: column; gap: 4px; padding: 6px 10px; }
.commander-val { font-weight: 700; color: var(--gold, #e8c060); }
.commander-add { gap: 4px; flex-wrap: nowrap; }
.commander-add .btn { min-width: 44px; padding: 4px 6px; }

/* ENTR-01 : valeurs entraînées en surimpression des six bandes d'une carte (voir cartes-entrainees.js ; image jamais modifiée). */
.artwrap { position: relative; display: block; width: 100%; margin: 0 auto 6px; }
.artwrap.sm { max-width: 140px; }
.artwrap.md { max-width: 200px; }
.artwrap.lg { max-width: 300px; }
.artwrap > img.art { margin: 0; max-width: none; }
.art-train { position: absolute; inset: 0; container-type: inline-size; pointer-events: none; font-family: "Palatino Linotype", Palatino, Georgia, serif; }
.art-train-ligne { position: absolute; left: 64%; right: 7.5%; top: calc((274 + 27 * var(--r)) / 468 * 100% - .2%); height: 5.5%;
  display: flex; align-items: center; justify-content: flex-end; gap: 1.4cqw; padding-right: 2.6cqw; box-sizing: border-box;
  background: rgba(14, 8, 2, .84); border-radius: 1.2cqw; box-shadow: inset 0 0 0 1px rgba(255, 210, 90, .5); }
.art-train-ligne.large { left: 54%; }
.art-train-ligne b { color: #ffd25a; font-size: 7cqw; line-height: 1; font-weight: 800; text-shadow: 0 0 1cqw #000; }
.art-train-ligne i { color: #ffe9a8; font: 700 3.9cqw/1 system-ui, "Segoe UI", sans-serif; }
@container (max-width: 96px) { .art-train-ligne { display: none; } }
.fe-carte > .art-train { inset: 3px; }
.fe-gain { margin: 2px 0 6px; }
.fe-gain-detail { display: block; margin-top: 2px; }
.gainline b, .fe-gain-resume { color: var(--gold, #ffd25a); }
.warnline.chantier { color: #ffd9a0; }

/* ───────────── ACAD-01 — L'académie en plein écran : ressources et navigation en surimpression, aucune page qui défile ───────────── */
html.acad-plein, html.acad-plein body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.acad-plein .wrap { position: absolute; inset: 0; max-width: none; margin: 0; padding: 0; }
html.acad-plein .wrap > .fe { position: absolute; inset: 0; }
html.acad-plein .topbar.fi-barre { position: fixed; left: 0; right: 0; top: 0; background: linear-gradient(180deg, rgba(10, 16, 48, .9) 0%, rgba(10, 16, 48, .62) 62%, rgba(10, 16, 48, 0) 100%); box-shadow: none; }
html.acad-plein .fi-barre.topbar::after { display: none; }
html.acad-plein #pending-actions { position: fixed; z-index: 25; left: 8px; right: 8px; top: calc(var(--header-height) + env(safe-area-inset-top) + 8px); }
html.acad-plein #pending-actions:empty { display: none; }
html.acad-plein .scene.scene3d { height: auto; }
@media (min-width: 660px) {
  html.acad-plein .nav.fi-nav--pose { position: fixed; left: 0; right: 0; top: calc(var(--header-height) + env(safe-area-inset-top)); background: none; }
  html.acad-plein .nav.fi-nav--pose::before { display: none; }
}

/* Premiers pas dans le panneau de SUMA (propriétaire, 02/12). */
.suma-pas { margin-top: 12px; padding-top: 10px; border-top: 2px solid rgba(168, 121, 31, .45); }
.suma-pas h3 { margin: 0 0 6px; font: 700 .95rem/1.2 var(--fi-titre, serif); color: #fdf0bb; }
.suma-pas ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.suma-pas li { display: grid; grid-template-columns: 26px 1fr; align-items: center; gap: 8px; font-size: .875rem; opacity: .75; }
.suma-pas li.suivant { opacity: 1; font-weight: 700; color: #fff6dc; }
.suma-pas li.fait { opacity: .6; }
.suma-pas-borne { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; background: #1b2870; border: 1.5px solid var(--fi-or, #e3b84f); }
.suma-pas li.fait .suma-pas-borne { background: #2e6b3e; }
.suma-pas li.suivant .suma-pas-borne { background: var(--fi-or, #e3b84f); color: #241a06; }

/* SUMA-VIE-01 : dans son panneau, SUMA prend la pose de son conseil (image dessinée, chargée à la demande). */
.suma-dialog .suma { align-items: stretch; }
.suma-pose { --pose-h: 164px; position: relative; flex: none; align-self: flex-end; width: 84px; height: var(--pose-h); display: flex; align-items: flex-end; justify-content: center; }
.suma-pose::before { content: ""; position: absolute; inset: auto 4px 0; height: 14px; border-radius: 50%; background: radial-gradient(closest-side, #05081aa8, transparent); }
.suma-pose img { position: relative; flex: none; height: var(--pose-h); width: auto; max-width: none; filter: drop-shadow(0 4px 6px #05081a8c); animation: suma-pose-entre .24s ease-out both; }
.suma-pose img[hidden] { display: none; }
@keyframes suma-pose-entre { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .suma-pose img { animation: none; } }
@media (max-height: 480px), (max-width: 420px) { .suma-pose { --pose-h: 112px; width: 58px; } }

/* COMPTE-SECOURS-01 : code de secours (4 mots) et réglages du mot de passe. */
.rescue-sheet { z-index: 2100; }
.rescue-sheet .card { display: grid; gap: 10px; }
.rescue-parchment { padding: 12px 10px; border-radius: 12px; text-align: center; border: 3px solid var(--fi-or, #e3b84f); background: linear-gradient(180deg, #f3e3b0, #dcc27c); box-shadow: inset 0 0 18px rgba(120, 80, 10, .35), 0 0 22px rgba(246, 201, 106, .35); }
.rescue-words { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 10px; font: 800 clamp(1.3rem, 5.5vw, 1.9rem)/1.2 var(--fi-corps, system-ui, sans-serif); color: #3a2606; }
.rescue-dot { color: #8a5c10; }
.sec-block { display: grid; gap: 4px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid rgba(227, 184, 79, .3); }
.sec-block h3 { margin: 0; }
.sec-block input { width: 100%; }
.pf-secours { margin: 4px 0 0; }
.okline { color: var(--fi-ok, #6fdba6); font-weight: 600; }
@media (orientation: landscape) and (max-height: 540px) {
  .rescue-sheet .card { gap: 6px; padding: 8px 12px; }
  .rescue-words { font-size: 1.25rem; }
}

/* ── LS4U-RAPPELS-01 — Le club présent dans chaque lieu (Dominion, Collection, Profil) ──
 * Rappels discrets, tous dessinés avec le fichier officiel `intro/ls4u-logo.svg` (jamais redessiné, proportions et couleurs
 * d'origine), posé sur un médaillon bleu nuit cerclé d'or. Décor seulement : aucun de ces rappels n'est une cible.
 * Les scènes 3D portent leurs propres rappels (fanions, clef de voûte, frise) ; ceux-ci valent aussi pour le repli sans 3D. */
:root {
  --ls4u-logo: url("intro/ls4u-logo.svg");
  --ls4u-rose: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='41' fill='%230d1330' fill-opacity='.8' stroke='%23e3b84f' stroke-width='1.5'/%3E%3Ccircle cx='50' cy='50' r='36.5' fill='none' stroke='%23e3b84f' stroke-opacity='.55' stroke-width='1' stroke-dasharray='1 4.73'/%3E%3Cg id='d'%3E%3Cpath d='M50 13 44 44 50 50Z' fill='%23d9a93f'/%3E%3Cpath d='M50 13 56 44 50 50Z' fill='%237c5914'/%3E%3C/g%3E%3Cg transform='rotate(45 50 50)'%3E%3Cpath d='M50 13 44 44 50 50Z' fill='%23d9a93f'/%3E%3Cpath d='M50 13 56 44 50 50Z' fill='%237c5914'/%3E%3C/g%3E%3Cg transform='rotate(135 50 50)'%3E%3Cpath d='M50 13 44 44 50 50Z' fill='%23d9a93f'/%3E%3Cpath d='M50 13 56 44 50 50Z' fill='%237c5914'/%3E%3C/g%3E%3Cg transform='rotate(225 50 50)'%3E%3Cpath d='M50 13 44 44 50 50Z' fill='%23d9a93f'/%3E%3Cpath d='M50 13 56 44 50 50Z' fill='%237c5914'/%3E%3C/g%3E%3Cg transform='rotate(315 50 50)'%3E%3Cpath d='M50 13 44 44 50 50Z' fill='%23d9a93f'/%3E%3Cpath d='M50 13 56 44 50 50Z' fill='%237c5914'/%3E%3C/g%3E%3Cg transform='rotate(90 50 50)'%3E%3Cpath d='M50 1 42 42 50 50Z' fill='%23f6d77a'/%3E%3Cpath d='M50 1 58 42 50 50Z' fill='%23a8791f'/%3E%3C/g%3E%3Cg transform='rotate(180 50 50)'%3E%3Cpath d='M50 1 42 42 50 50Z' fill='%23f6d77a'/%3E%3Cpath d='M50 1 58 42 50 50Z' fill='%23a8791f'/%3E%3C/g%3E%3Cg transform='rotate(270 50 50)'%3E%3Cpath d='M50 1 42 42 50 50Z' fill='%23f6d77a'/%3E%3Cpath d='M50 1 58 42 50 50Z' fill='%23a8791f'/%3E%3C/g%3E%3Cpath d='M50 1 42 42 50 50Z' fill='%23d8323a'/%3E%3Cpath d='M50 1 58 42 50 50Z' fill='%238f1a22'/%3E%3Ccircle cx='50' cy='50' r='30' fill='%23171c30' stroke='%23e3b84f' stroke-width='2'/%3E%3Ccircle cx='50' cy='50' r='26.5' fill='none' stroke='%23000' stroke-opacity='.45' stroke-width='1'/%3E%3C/svg%3E");
  --ls4u-rose-taille: 84px;
}
/* Sceau : médaillon rond, pour les petits rappels. */
.ls4u-sceau, .cl-aile::before, .pl-scene > .pf-scene[data-etat="repli"]::before, .pl-feuille[data-feuille="registre"] .fi-panneau-titre > span:first-child::before {
  content: ""; box-sizing: border-box; display: block; flex: none; width: var(--ls4u-sceau, 26px); height: var(--ls4u-sceau, 26px); border-radius: 50%;
  border: 2px solid #e3b84f; background: var(--ls4u-logo) center / 70% auto no-repeat, radial-gradient(circle at 38% 30%, #2a3260, #171c30 68%);
  box-shadow: 0 2px 5px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(0, 0, 0, .45); pointer-events: none;
}
/* Rose des vents du Dominion : la pointe du nord au rouge du club, le logo au cœur. */
.ls4u-rose, .dl-scene:has(> .map-scroll)::after {
  content: ""; display: block; width: var(--ls4u-rose-taille); height: var(--ls4u-rose-taille); pointer-events: none;
  background: var(--ls4u-logo) center / 45% auto no-repeat, var(--ls4u-rose) center / contain no-repeat; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .5));
}
.d3d > .ls4u-rose { position: absolute; top: calc(var(--d3d-haut, 0px) + 12px); right: calc(max(12px, env(safe-area-inset-right, 0px)) + var(--d3d-droite, 0px)); transition: right .3s; }
/* Repli sans 3D : la rose se pose au coin bas de la carte 2D, sous les feuilles et hors des jetons. */
.dl-scene:has(> .map-scroll)::after { position: absolute; z-index: 1; right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(var(--acad-bas, 0px) + 12px); }
/* Collection : un sceau au-dessus de l'entrée de chaque aile, serti entre les deux chaînes de l'enseigne. */
.cl-aile::before { --ls4u-sceau: 28px; position: absolute; z-index: 1; left: 50%; top: -8px; margin-left: -14px; }
/* Profil, repli sans 3D : le blason du club au coin de la salle dessinée. */
.pl-scene > .pf-scene[data-etat="repli"]::before { --ls4u-sceau: 40px; position: absolute; z-index: 1; top: 10px; right: 10px; }
.pl--3d .pl-scene > .pf-scene[data-etat="repli"]::before { top: calc(var(--acad-haut, 0px) + 10px); }
/* Registre : le logo frappé sur la couverture (à la place du petit fanion rouge du titre). */
.pl-feuille[data-feuille="registre"] .fi-panneau-titre > span:first-child::before { --ls4u-sceau: 30px; border-width: 2px; }
@media (max-height: 540px), (max-width: 700px) {
  :root { --ls4u-rose-taille: 56px; }
  .d3d > .ls4u-rose { top: calc(var(--d3d-haut, 0px) + 8px); right: calc(max(8px, env(safe-area-inset-right, 0px)) + var(--d3d-droite, 0px)); }
  .cl-aile::before { --ls4u-sceau: 20px; margin-left: -10px; top: -3px; }
  .pl-scene > .pf-scene[data-etat="repli"]::before { --ls4u-sceau: 32px; top: 6px; right: 6px; }
  .pl-feuille[data-feuille="registre"] .fi-panneau-titre > span:first-child::before { --ls4u-sceau: 26px; }
}
@media (max-height: 300px) { :root { --ls4u-rose-taille: 46px; } }
/* VITRINES-01 : repli sans 3D — la place du club en enseignes (Panthéon, Bourse, Salon des copains), sous l’académie dessinée. */
.vitrines2d { width: fit-content; max-width: 100%; margin-inline: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; margin-top: 10px; padding: 8px 12px; border-radius: 16px; background: linear-gradient(180deg, rgba(20, 12, 28, .5), rgba(20, 12, 28, .72)); border: 1px solid rgba(251, 233, 168, .35); }
.vitrines2d-titre { flex-basis: 100%; text-align: center; font-size: 12.5px; font-weight: 700; color: #fbe9a8; }
.vitrines2d-enseigne { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px 16px 6px 10px; border-radius: 999px; border: 2px solid #fbe9a8; background: linear-gradient(180deg, #a81a30, #540a1a); color: #fff3d6; font: 800 14px/1.15 system-ui, -apple-system, "Segoe UI", sans-serif; cursor: pointer; box-shadow: 0 4px 10px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .2); touch-action: manipulation; }
.scene.scene3d + .vitrines2d { display: none; }
.fe-acad-scene > .vitrines2d { position: absolute; z-index: 2; left: 50%; transform: translateX(-50%); top: calc(var(--acad-haut, 0px) + 4px); margin: 0; padding: 3px 8px; width: max-content; max-width: calc(100% - 24px); }
.fe-acad-scene > .vitrines2d .vitrines2d-titre { display: none; }
@media (max-width: 480px) { .fe-acad-scene > .vitrines2d { gap: 6px; } .fe-acad-scene > .vitrines2d .vitrines2d-enseigne { padding: 4px 10px 4px 6px; gap: 5px; font-size: 12.5px; } }
.vitrines2d .vitrines2d-enseigne svg { width: 22px; height: 22px; max-height: none; flex: none; color: #fbe9a8; }
.vitrines2d-enseigne em { font-style: normal; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: linear-gradient(180deg, #fff6cf, #e3b84f); color: #241a06; }
.vitrines2d-enseigne.fermee { background: linear-gradient(180deg, #4a5278, #262e58); border-color: #8f97b8; color: #dfe3f1; }
.vitrines2d .vitrines2d-enseigne.fermee svg { color: #c9cede; }
.vitrines2d-enseigne.fermee em { background: rgba(255, 255, 255, .14); color: #dfe3f1; }
.vitrines2d-enseigne:focus-visible { outline: 3px solid #9fd4ff; outline-offset: 3px; }
@media (max-height: 420px) { .vitrines2d { margin-top: 4px; padding: 4px 8px; } .vitrines2d-titre { display: none; } }

@media (orientation: portrait) and (max-width: 659px) {
  /* Les fanions actifs dépassent légèrement de la barre d'onglets. */
  html:has(.nav.fi-nav--pose) {
    scroll-padding-block: calc(var(--header-height) + env(safe-area-inset-top) + 8px) calc(var(--nav-height) + 12px);
  }
  .nav.fi-nav--pose ~ .wrap .actionbar.sticky { bottom: calc(var(--nav-height) + 12px); }
  html:not(.acad-plein) body:has(.nav.fi-nav--pose) .wrap { padding-bottom: calc(var(--nav-height) + 24px); }

  .header-row:has(.header-quitter) .res button.fi-res { gap: 2px; padding-inline: 0 3px; }
  .header-row:has(.header-quitter) .res .fi-res-ico { width: 18px; height: 18px; }
  .header-row:has(.header-quitter) .res .fi-res-ico .fi-ico { width: 12px; height: 12px; }
  .header-row:has(.header-quitter) .res .fi-res-val { font-size: clamp(.625rem, 3vw, .875rem); }

}

/* Essai à deux comptes (04/12) : bandeau pour revenir à une partie WOL entre copains en cours. */
.wol-reprise {
  position: fixed; z-index: 60; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: calc(100vw - 24px);
  padding: 10px 22px; border: 2px solid #f4d27a; border-radius: 16px; cursor: pointer;
  background: linear-gradient(180deg, #7a1f1f, #4a0f14); color: #fff6dc; font: inherit; font-weight: 700;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .45), 0 0 18px rgba(244, 210, 122, .55);
  animation: wol-reprise-pulse 1.6s ease-in-out infinite;
}
.wol-reprise-titre { font-size: 1.05rem; color: #f4d27a; letter-spacing: .02em; }
.wol-reprise:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@keyframes wol-reprise-pulse { 50% { box-shadow: 0 6px 22px rgba(0, 0, 0, .45), 0 0 30px rgba(244, 210, 122, .9); } }
@media (prefers-reduced-motion: reduce) { .wol-reprise { animation: none; } }
