/* ZION PROTOCOL — interface sobre et lisible.
   Code couleur FIXE des ressources, partout (barre du haut, coûts, gains) :
   Ferraille = orange · Code = bleu · Cellules = vert citron · Énergie = jaune · Humains = violet · Bits = rose */
:root {
  --bg: #0a0e13;
  --panel: #111821;
  --panel2: #161f2b;
  --line: #243040;
  --line2: #2f3d52;
  --txt: #e7edf5;
  --mut: #8b99ac;
  --dim: #5c6a7d;

  --scrap: #d9813a;
  --code: #4fa3e0;
  --cells: #9fc23a;
  --energy: #e8c13a;
  --pop: #a98be0;
  --bits: #d35fd0;

  --acc: #6cc46a;      /* accent du mode courant */
  --ok: #6cc46a;
  --warn: #e3a23a;
  --bad: #e5534b;
  --r: 10px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { background: radial-gradient(1200px 600px at 80% -10%, rgba(108, 196, 106, .06), transparent 60%), var(--bg); color: var(--txt); font: 14px/1.5 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
[hidden] { display: none !important; }
.new-player { display: inline-flex; align-items: center; gap: 4px; color: #75caff; text-shadow: none; }
.new-player .ic { width: 14px; height: 14px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.ot-hint, .ot-why { margin: 8px 0; font-size: 12px; line-height: 1.5; }
.ot-why { color: var(--mut); }
.ot-why summary { cursor: pointer; }
.up-cat:not(:has(.card:not([hidden]))) { display: none; }
#app { height: 100%; display: flex; flex-direction: column; padding: 12px; gap: 10px; }
button { font: inherit; color: inherit; cursor: pointer; }
b { font-weight: 600; }
.mut { color: var(--mut); }
.small { font-size: 12px; }
.okc { color: var(--ok); } .badc { color: var(--bad); }

.glass { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.ic { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.22em; flex: none; }
h3 { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); margin-bottom: 10px; }
.hint { color: var(--mut); font-size: 13px; margin-bottom: 14px; max-width: 80ch; }

/* ---------- Barre du haut ---------- */
.topbar { display: flex; align-items: center; gap: 14px 18px; padding: 10px 14px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 15px; letter-spacing: .12em; }
.brand span { color: var(--acc); margin-left: 4px; }
.resbar { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.chip { --c: var(--acc); position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 12px 10px 8px; border-radius: var(--r); background: var(--panel2); border: 1px solid var(--line); min-width: 108px; }
.chip .tile { width: 30px; height: 30px; border-radius: var(--r); display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.chip .v { display: flex; flex-direction: column; line-height: 1.2; }
.chip b { font-size: 16px; font-weight: 700; }
.chip small { color: var(--mut); font-size: 11px; }
.chip small i { font-style: normal; color: var(--c); font-weight: 600; }
.chip .bar { position: absolute; left: 8px; right: 8px; bottom: 3px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.chip .bar u { display: block; height: 100%; width: 0; background: var(--c); transition: width .3s; }
.chip.full b { color: var(--warn); }
.chip.neg b { color: var(--warn); }
.tools { display: flex; gap: 6px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.who { display: inline-flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 12px; color: var(--txt); font-size: 13px; margin-right: 4px; cursor: pointer; transition: .15s; }
.who:hover { border-color: var(--acc); }
.who .lvl { margin-left: 6px; }
.ghost { background: none; border: 1px solid var(--line); border-radius: var(--r); padding: 5px 11px; color: var(--mut); font-size: 12px; transition: .15s; }
.ghost:hover { color: var(--txt); border-color: var(--line2); background: var(--panel2); }
.ghost.danger:hover { border-color: var(--bad); color: var(--bad); }

/* ---------- Objectif ---------- */
.obj-tag { font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--acc); }

/* ---------- Layout ---------- */
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 10px; }
.col { min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.center { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.block { padding: 14px; flex: none; }
.block.grow { flex: 1; min-height: 120px; display: flex; flex-direction: column; }
.panel { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.panel h3:not(:first-child) { margin-top: 22px; }

/* ---------- Coûts / gains : couleurs de ressources ---------- */
.cost { display: inline-flex; gap: 5px; align-items: center; padding: 2px 8px; border-radius: var(--r); font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--rc, var(--mut)) 13%, transparent); color: var(--rc, var(--txt)); }
.cost .ic { width: 1em; height: 1em; }
.cost.scrap { --rc: var(--scrap); } .cost.code { --rc: var(--code); } .cost.cells { --rc: var(--cells); }
.cost.energy { --rc: var(--energy); } .cost.pop { --rc: var(--pop); } .cost.bits { --rc: var(--bits); }
.cost.lack { color: var(--bad); background: rgba(229, 83, 75, .12); box-shadow: inset 0 0 0 1px rgba(229, 83, 75, .45); }
.cost.lack .ic { color: var(--rc); }
.cost.war { --rc: #d9483b; }
.cost.neutral { --rc: var(--mut); }
.gain { display: inline-flex; gap: 5px; align-items: center; padding: 2px 8px; border-radius: var(--r); font-size: 12px; font-weight: 600; color: var(--rc, var(--ok)); background: color-mix(in srgb, var(--rc, var(--ok)) 13%, transparent); } /* même famille que .cost : une pastille teintée, rouge/neutre côté coût, verte ou colorée côté gain */
.gain .ic { width: 1em; height: 1em; }
.gain.scrap { --rc: var(--scrap); } .gain.code { --rc: var(--code); } .gain.cells { --rc: var(--cells); } .gain.energy { --rc: var(--energy); } .gain.pop { --rc: var(--pop); } .gain.neutral { --rc: var(--txt); } .gain.minus { --rc: var(--mut); }
.gain .arrow { color: var(--dim); font-weight: 400; }
.gain .delta { opacity: .75; font-weight: 500; }
.row-lbl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; }
.row-lbl > span:first-child { color: var(--dim); min-width: 44px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Cartes (verticales, toutes identiques) ---------- */
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 18px; border-radius: var(--r); background: var(--panel2); border: 1px solid var(--line); transition: border-color .15s; }
.card:hover { border-color: var(--line2); }
.card header { display: flex; gap: 12px; align-items: center; }
.card .ico { width: 40px; height: 40px; border-radius: var(--r); display: grid; place-items: center; flex: none; color: var(--acc); background: color-mix(in srgb, var(--acc) 13%, transparent); }
.card .ico .ic { width: 21px; height: 21px; }
.card .ttl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.card h4 { font-weight: 600; font-size: 14px; line-height: 1.25; }
.lvl { font-size: 10px; font-weight: 700; color: var(--mut); background: var(--bg); border: 1px solid var(--line); padding: 1px 7px; border-radius: var(--r); letter-spacing: .04em; white-space: nowrap; }
.lvl:empty { display: none; }
.card-info { display: contents; }
.card-info > p { color: var(--mut); font-size: 12.5px; line-height: 1.45; }
.card .body { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .body:empty { display: none; }
.fx { font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.fx:empty { display: none; }
.costs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.costs:empty { display: none; }
.costs .lbl { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; min-width: 44px; }
.req { font-size: 12px; color: var(--warn); }
.req:empty { display: none; }
.act { display: flex; flex-direction: row; gap: 8px; margin-top: auto; }
.act .btn { flex: 1; }
.act .btn.sm { flex: 0 0 auto; }
.card.row { flex-direction: row; align-items: center; gap: 14px; }
.card.row .ico { width: 40px; height: 40px; }
.card.row .body { gap: 2px; } .card.row .body p { color: var(--mut); font-size: 12px; margin: 0; }
.btn { background: var(--acc); border: 1px solid transparent; color: #04110c; padding: 8px 16px; border-radius: var(--r); font-size: 13px; font-weight: 600; transition: filter .15s, background .15s; white-space: nowrap; }
.btn:hover:not(:disabled, [aria-disabled="true"]) { filter: brightness(1.1); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--panel2); border-color: var(--line); color: var(--dim); cursor: not-allowed; }
.btn.sm { padding: 5px 11px; font-size: 12px; }
.btn.alt { background: transparent; border-color: var(--line2); color: var(--txt); }
.btn.alt:hover:not(:disabled) { background: var(--panel2); filter: none; border-color: var(--acc); }
.btn.alt:disabled { background: transparent; }
.btn.danger { background: transparent; border-color: rgba(229, 83, 75, .5); color: var(--bad); }
.btn.danger:hover:not(:disabled) { background: rgba(229, 83, 75, .12); filter: none; }
.prog { position: absolute; left: 12px; right: 12px; bottom: 6px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .06); overflow: hidden; display: none; }
.prog u { display: block; height: 100%; width: 0; background: var(--acc); border-radius: 2px; }
.card.busy .prog { display: block; }
.card.busy { border-color: color-mix(in srgb, var(--acc) 50%, var(--line)); }
/* tuile en cours : même habillage que les salles en chantier (rayures, minuteur, barre pleine largeur en bas) */
.tcard.busy::after, .rs.busy::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2; background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0 8px, transparent 8px 16px); }
.tcard .prog { left: 0; right: 0; bottom: 0; height: 4px; border-radius: 0; z-index: 3; } .tcard .prog u { border-radius: 0; }
.tcard .r-timer, .rs-job .sl-time { top: auto; bottom: 8px; right: 8px; z-index: 3; padding: 2px 7px; border-radius: 3px; background: rgba(6, 9, 8, .82); } .tcard .r-timer:empty { display: none; }
.rs-job { position: absolute; inset: 0; z-index: 3; pointer-events: none; } .rs-job .sl-time { position: absolute; top: 4px; bottom: auto; right: 6px; font-size: 10px; font-weight: 600; color: var(--acc); }
.rs-job .r-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .06); overflow: hidden; border-radius: 0 0 var(--r) var(--r); } .rs-job .r-prog u { display: block; height: 100%; width: 0; background: var(--acc); }
.card.done { opacity: .65; }

/* ---------- Pastilles, listes ---------- */
.pill { padding: 3px 10px; border: 1px solid var(--line); background: var(--panel2); border-radius: var(--r); font-size: 12px; color: var(--mut); }
.pill b { color: var(--txt); }
.pill.warn { color: var(--warn); border-color: rgba(227, 162, 58, .4); }
.pill.bad { color: var(--bad); border-color: rgba(229, 83, 75, .4); }
.pill.busy { color: var(--acc); border-color: color-mix(in srgb, var(--acc) 45%, transparent); }
.pill.bits { color: var(--bits); }
.rows { display: grid; gap: 6px; }
.row-i { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--line); background: var(--panel2); border-radius: var(--r); flex-wrap: wrap; }
.row-i .mut { margin-left: auto; }
.row-i .mut + .btn, .row-i b + .btn { margin-left: auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.on { background: var(--ok); }
.rk { color: var(--warn); min-width: 34px; }
.empty { color: var(--mut); padding: 8px 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; margin-top: 4px; }
.mchip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); color: var(--mut); }
.mchip.lack { color: var(--bad); border-color: rgba(229, 83, 75, .4); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { padding: 12px 14px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r); }
.stat small { color: var(--mut); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.stat b { font-size: 20px; }
.mission-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px 14px; position: relative; border: 1px solid var(--line); background: var(--panel2); border-radius: var(--r); margin-bottom: 8px; }
.mission-row .prog { display: block; }
.mission-row .mt { margin-left: auto; font-weight: 600; }
.crew-top { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.crew-big { font-size: 26px; font-weight: 700; color: var(--pop); }
.crew-big small { font-size: 13px; font-weight: 400; color: var(--mut); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 32px; height: 32px; padding: 0; font-size: 16px; line-height: 1; }
.stepper b { min-width: 28px; text-align: center; font-size: 16px; }

/* ---------- Guerre ---------- */
.war-big { padding: 18px; border: 1px solid var(--line); background: var(--panel2); border-radius: var(--r); margin-bottom: 8px; }
.war-big h2 { font-size: 20px; font-weight: 700; }
.war-big .lore { color: var(--mut); margin: 2px 0 12px; }
.bigbar { height: 12px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); position: relative; overflow: hidden; }
.bigbar u { display: block; height: 100%; width: 0; background: #d9483b; border-radius: var(--r); transition: width .4s; }
.bigbar.thin { height: 6px; margin: 4px 0; border-radius: 3px; }
.war-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.donate { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.phases { display: flex; gap: 4px; margin-top: 12px; }
.phases i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.phases i.on { background: var(--ok); } .phases i.cur { background: #d9483b; }

/* ---------- Social ---------- */
.subtabs, .chan { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.sub { background: var(--panel2); border: 1px solid var(--line); padding: 5px 14px; color: var(--mut); border-radius: var(--r); }
.sub.on { color: var(--txt); border-color: var(--acc); }
.chatlog { height: 320px; overflow-y: auto; border: 1px solid var(--line); background: var(--bg); border-radius: var(--r); padding: 10px 12px; margin-bottom: 8px; font-size: 13px; scrollbar-width: thin; }
.msg { padding: 2px 0; word-break: break-word; }
.msg time { color: var(--dim); font-size: 11px; margin-right: 8px; }
.msg b { color: var(--acc); margin-right: 4px; }
.chat-title { margin: 0 0 12px; font-size: 14px; }
.chat-tabs { width: fit-content; border-bottom: 1px solid var(--line2); gap: 4px; }
.chat-tabs .sub { display: inline-flex; align-items: center; gap: 7px; border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 8px 12px; }
.chat-tabs .sub.on { color: var(--acc); border-bottom-color: var(--acc); }
.chat-tabs .ic { width: 15px; height: 15px; }
#chatPanel { touch-action: pan-y pinch-zoom; }
.chat-older { margin-bottom: 8px; }
.msg.me b { color: var(--txt); }
.pm { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 10px; }
.pm-list { display: flex; flex-direction: column; gap: 4px; max-height: 372px; overflow-y: auto; scrollbar-width: thin; }
.pm-sidebar { min-width: 0; }
.pm-pages { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; font-size: 11px; color: var(--mut); }
.pm-pages:empty { display: none; }
.pm-pages .btn { padding: 5px 7px; }
.pm-i { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; text-align: left; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); cursor: pointer; }
.pm-i:hover, .pm-i.on { border-color: var(--acc); } .pm-i.on { background: color-mix(in srgb, var(--acc) 10%, var(--panel2)); }
.pm-t { flex: 1; min-width: 0; } .pm-t b { display: block; font-size: 13px; } .pm-t small { display: block; color: var(--dim); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-i .badge { position: static; flex: none; }
.pm-conv { min-width: 0; } .pm-conv > .empty { height: 100%; display: grid; place-items: center; border: 1px dashed var(--line2); }
.pm-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; } .pm-head .ic { width: 15px; height: 15px; color: var(--acc); }
@media (max-width: 700px) { .pm { grid-template-columns: minmax(0, 1fr); } .pm-list { max-height: 180px; } }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input, select { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 11px; color: var(--txt); font: inherit; }
input:focus, select:focus { outline: none; border-color: var(--acc); }
.inline input:not([type]), .inline input[type=text] { flex: 1; min-width: 120px; }

/* ---------- Journal ---------- */
.log { list-style: none; padding: 0; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.log li { padding: 6px 0 6px 10px; border-left: 2px solid var(--line); margin-bottom: 6px; font-size: 12px; color: var(--mut); }
.log li.good { border-color: var(--ok); color: var(--txt); } .log li.warn { border-color: var(--warn); color: var(--txt); }
.log li time { display: block; font-size: 10px; color: var(--dim); }
.buff { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; }
.buff.good b { color: var(--ok); } .buff.bad b { color: var(--bad); }

/* ---------- Connexion ---------- */
.auth { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px 16px; overflow-y: auto; background: var(--bg); isolation: isolate; }
.auth::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: url('../assets/img/login/underground-war.png') center / cover no-repeat; opacity: .55; }
.auth::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at center, rgba(14, 11, 9, .12), rgba(14, 11, 9, .65)); }
.auth-logo { display: block; width: min(280px, 100%); height: auto; margin: 0 auto 18px; }
.brand img { display: block; width: 156px; height: auto; }
.auth-box { width: min(400px, 100%); padding: 30px; text-align: center; }
.auth-box h1 { font-size: 24px; font-weight: 800; letter-spacing: .12em; margin-bottom: 6px; }
.auth-box .sub { color: var(--mut); margin-bottom: 22px; font-size: 13px; background: none; border: 0; padding: 0; }
.auth-box form { display: grid; gap: 10px; }
.auth-box .row { display: flex; gap: 8px; } .auth-box .row .btn { flex: 1; }
.auth-box .err { color: var(--bad); min-height: 20px; margin: 10px 0; font-size: 13px; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 95; align-items: center; pointer-events: none; }
.toast { padding: 10px 16px; background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: toast 3.6s ease forwards; font-size: 13px; max-width: 90vw; }
.toast.good { border-left: 3px solid var(--ok); } .toast.warn { border-left: 3px solid var(--warn); }
@keyframes toast { 0% { opacity: 0; transform: translateY(10px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes toast-top { 0% { opacity: 0; transform: translateY(-10px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------- ZION : coupe de la base ---------- */
.base { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.base-side { border: 1px solid var(--line); background: var(--panel2); border-radius: var(--r); padding: 14px; position: sticky; top: 0; max-height: calc(100vh - 250px); overflow-y: auto; scrollbar-width: thin; }
.base-side h3 { margin-top: 14px; }
.base-side h3:first-child { margin-top: 0; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.lg { font-size: 11px; padding: 2px 9px; border-radius: var(--r); color: var(--rc); background: color-mix(in srgb, var(--rc) 13%, transparent); }
.g-prod { --rc: #6cc46a; } .g-infra { --rc: #5b9bd5; } .g-def { --rc: #d9483b; }
.income { display: grid; gap: 8px; margin-top: 4px; }
.inc { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); }
.inc .tile { width: 26px; height: 26px; border-radius: var(--r); display: grid; place-items: center; color: var(--rc); background: color-mix(in srgb, var(--rc) 16%, transparent); }
.inc b { color: var(--rc); font-size: 15px; }
.inc small { grid-column: 2 / 4; color: var(--mut); font-size: 11px; margin-top: -4px; }
.inc.scrap { --rc: var(--scrap); } .inc.code { --rc: var(--code); } .inc.cells { --rc: var(--cells); }

.cutaway { border: 1px solid var(--line); border-radius: var(--r); background: #0d1218; overflow: hidden; }
.floor { position: relative; padding: 4px 10px 8px; border-bottom: 2px solid #1a2431; }
.flabel { display: block; font-size: 11px; color: var(--dim); padding: 4px 4px 4px; }
.rooms { display: grid; grid-template-columns: 1fr 1fr 34px 1fr 1fr; gap: 8px; }
.shaft { background: repeating-linear-gradient(0deg, #151e29 0 3px, transparent 3px 9px); border-radius: var(--r); }
.room { position: relative; height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center; padding: 6px 6px 10px; color: var(--txt); cursor: pointer; border-radius: var(--r); transition: border-color .15s, background .15s; overflow: hidden; background: #131b25; border: 1px solid var(--line); }
.room.empty { background: transparent; border: 1px dashed var(--line2); color: var(--dim); }
.room.empty:hover { border-color: var(--acc); color: var(--acc); background: color-mix(in srgb, var(--acc) 6%, transparent); }
.room.empty .plus { font-size: 24px; font-weight: 300; line-height: 1; }
.room.empty small { font-size: 11px; } .room.empty { cursor: pointer; }
.room.built { border-top: 3px solid var(--rc); }
.room.built:hover { border-color: var(--rc); }
.room .ic { width: 22px; height: 22px; color: var(--rc); }
.room b { font-size: 12px; font-weight: 600; line-height: 1.15; }
.room em { font-size: 10px; font-weight: 700; font-style: normal; color: var(--mut); letter-spacing: .04em; }
/* Manque d'énergie : rendement réduit (tuile du bâtiment, en-tête des ressources) */
.low-e { display: inline-flex; align-items: center; gap: 2px; margin-left: 5px; color: var(--bad); font-style: normal; font-weight: 700; } .low-e .ic { width: 1em; height: 1em; }
:is(.room, .fi-out) .out.low-e { --oc: var(--bad); margin-left: 0; }
:is(.room, .fi-out) .out { font-size: 11px; font-weight: 700; color: var(--oc, var(--ok)); } :is(.room, .fi-out) .out .ic { width: 1em; height: 1em; vertical-align: -2px; margin-right: 3px; }
:is(.room, .fi-out) .out.neutral { --oc: var(--txt); } :is(.room, .fi-out) .out.scrap { --oc: var(--scrap); } :is(.room, .fi-out) .out.code { --oc: var(--code); } :is(.room, .fi-out) .out.cells { --oc: var(--cells); } :is(.room, .fi-out) .out.energy { --oc: var(--energy); } :is(.room, .fi-out) .out.pop { --oc: var(--pop); } .room .out.def { --oc: #d9483b; }
.room.sel { outline: 2px solid var(--acc); outline-offset: 1px; }
.room .r-main { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.room .r-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .06); display: none; }
.room .r-prog u { display: block; height: 100%; width: 0; background: var(--acc); }
.room.busy .r-prog { display: block; }
.room.busy { background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .03) 0 8px, transparent 8px 16px); }
.r-timer { position: absolute; top: 4px; right: 6px; font-size: 10px; color: var(--acc); font-weight: 600; }
.digrow { display: flex; gap: 12px; align-items: center; padding: 10px 14px; flex-wrap: wrap; border-top: 1px solid var(--line); background: #0f151c; }

/* ---------- MATRICE ---------- */
.lastrun { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px; font-size: 13px; background: var(--panel2); }
.lastrun.dead { border-left: 3px solid var(--bad); } .lastrun.clear, .lastrun.extract { border-left: 3px solid var(--ok); }
.runbox { display: grid; gap: 14px; }
.run-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 17px; font-weight: 700; }
.run-me, .run-en { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; align-items: center; font-size: 12px; color: var(--mut); }
.run-en { grid-template-columns: minmax(150px, 1fr) 2fr auto; color: var(--bad); }
.hpbar { height: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.hpbar u { display: block; height: 100%; width: 100%; background: var(--ok); transition: width .3s; }
.hpbar.en u { background: var(--bad); }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.opt { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left; padding: 16px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .15s; }
.opt:hover { border-color: var(--acc); }
.opt .ic { width: 26px; height: 26px; color: var(--acc); }
.opt b { font-size: 14px; } .opt small { color: var(--mut); font-size: 12px; }
.opt.elite, .opt.boss { border-color: rgba(229, 83, 75, .5); } .opt.elite .ic, .opt.boss .ic { color: var(--bad); }
.opt.pod { border-color: rgba(192, 132, 252, .6); } .opt.pod .ic { color: var(--pop); }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }
.acts .btn { padding: 12px 20px; }
.term { height: 190px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); padding: 10px 12px; font: 12px/1.6 ui-monospace, 'SF Mono', Menlo, monospace; color: var(--mut); white-space: pre-wrap; scrollbar-width: thin; }
.avatar-top { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.av-fig { text-align: center; }
.av-glyph { width: 72px; height: 72px; display: grid; place-items: center; border-radius: var(--r); color: var(--acc); background: color-mix(in srgb, var(--acc) 14%, transparent); }
.av-glyph .ic { width: 34px; height: 34px; }
.av-fig b { display: block; margin-top: 6px; font-size: 12px; color: var(--acc); }
.av-stats, .squad { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .base { grid-template-columns: 1fr; }
  .base-side { position: static; max-height: none; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .col.right { display: none; }
  .col.right.open { display: flex; position: fixed; right: 12px; top: 70px; bottom: 12px; width: min(340px, calc(100vw - 24px)); z-index: 60; background: var(--bg); }
}
@media (max-width: 800px) {
  html, body { height: auto; }
  #app { height: auto; padding: 8px; }
  .col, .center { overflow: visible; }
  .panel { overflow: visible; min-height: 60vh; padding: 12px; }
  .cards { grid-template-columns: 1fr; }
  .chip { min-width: 0; flex: 1 1 42%; }
  .tools { margin-left: 0; }
  .card { flex-wrap: wrap; }
  .run-me, .run-en { grid-template-columns: 1fr; }
}

/* ---------- En-têtes de vue, infobulles, encadrés ---------- */
.vhead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.vhead h2 { font-size: 18px; font-weight: 700; }
.vhead .vright { margin-left: auto; display: flex; align-items: center; gap: 8px; }
span.info { position: relative; display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--line2); color: var(--mut); font: 700 10px/1 var(--font); font-style: normal; cursor: help; vertical-align: middle; flex: none; text-transform: none; letter-spacing: 0; }
span.info:hover, span.info:focus { color: var(--txt); border-color: var(--acc); outline: none; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel2); font-size: 13px; margin-bottom: 12px; }
.callout .ic { margin-top: 2px; }
.callout.ok { border-color: rgba(108, 196, 106, .4); color: #b6f3dc; } .callout.ok .ic { color: var(--ok); }
.callout.bad { border-color: rgba(229, 83, 75, .45); color: #fecaca; } .callout.bad .ic { color: var(--bad); }
.callout.warn { border-color: rgba(227, 162, 58, .4); color: #f2d28b; } .callout.warn .ic { color: var(--warn); }
.gate { display: flex; gap: 16px; align-items: center; padding: 20px; border: 1px dashed var(--line2); border-radius: var(--r); background: var(--panel2); flex-wrap: wrap; }
.gate .ic { width: 30px; height: 30px; color: var(--acc); }
.gate p { color: var(--mut); font-size: 13px; }
.gate > div { flex: 1; min-width: 200px; }

/* ---------- Effets actifs (barre d'objectif) ---------- */
.obj-fx { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 46%; }
.fxpill { position: relative; display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border-radius: var(--r); font-size: 12px; font-weight: 500; cursor: help; border: 1px solid; }
.fxpill i { font-style: normal; font-size: 9px; }
.fxpill b { font-variant-numeric: tabular-nums; opacity: .8; font-weight: 600; }
.fxpill.good { color: #9ad68f; background: rgba(108, 196, 106, .1); border-color: rgba(108, 196, 106, .4); }
.fxpill.bad { color: #f0a39c; background: rgba(229, 83, 75, .1); border-color: rgba(229, 83, 75, .45); }

/* ---------- Dialogue ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(5, 8, 12, .72); backdrop-filter: blur(3px); }
.dlg { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); padding: 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
.dlg h3 { font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--txt); margin-bottom: 8px; }
.dtext { color: var(--mut); font-size: 13px; margin-bottom: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dlg form { display: grid; gap: 12px; }
.fld { display: grid; gap: 5px; font-size: 12px; color: var(--mut); }
.fld input, .fld select { width: 100%; }
.dact { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

/* ---------- Réseau + carte de la galaxie ---------- */
.ghost.sm { padding: 3px 10px; }
.pill.coord { font-variant-numeric: tabular-nums; color: var(--txt); }
.netcols { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; align-items: start; }
.netgraph { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); }
.netgraph line { stroke-width: 2; } .netgraph line.lk { stroke: var(--ok); } .netgraph line.ul { stroke: var(--dim); stroke-dasharray: 4 4; }
.netgraph .nd circle { stroke: var(--bg); stroke-width: 3; opacity: .45; } .netgraph .nd.on circle { opacity: 1; }
.netgraph text { fill: var(--mut); font-size: 10px; text-anchor: middle; }
.sdot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.galctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.galctl input[type=number] { width: 76px; } .galctl .grow { flex: 1; }
.joined { display: inline-flex; align-items: stretch; } .joined > input { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
.joined > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 0 10px; } .joined > .btn .ic { width: 15px; height: 15px; }
.galctl input[type=number] { appearance: textfield; -moz-appearance: textfield; } .galctl input[type=number]::-webkit-inner-spin-button, .galctl input[type=number]::-webkit-outer-spin-button { appearance: none; margin: 0; } /* pas de petit menu défilant : le champ est tapé, ▶ ◀ et la loupe font le reste */
.galtable { display: grid; gap: 4px; }
.grow-r { display: grid; grid-template-columns: 30px 12px minmax(130px, 1.2fr) minmax(110px, 1fr) auto; gap: 10px; align-items: center; padding: 6px 12px; border-radius: var(--r); background: var(--panel2); border: 1px solid var(--line); }
.grow-r.empty { background: transparent; border-style: dashed; color: var(--dim); grid-template-columns: 30px 1fr; padding: 4px 12px; }
.grow-r.me { border-color: color-mix(in srgb, var(--acc) 60%, var(--line)); background: color-mix(in srgb, var(--acc) 8%, var(--panel2)); }
.gp { color: var(--dim); font-weight: 600; font-size: 12px; }
.gn { display: flex; flex-direction: column; line-height: 1.25; } .gn small { color: var(--dim); font-size: 11px; }
.go { font-size: 13px; } .ga { display: flex; gap: 6px; justify-content: flex-end; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 1px 6px; border-radius: var(--r); background: color-mix(in srgb, var(--acc) 18%, transparent); color: var(--acc); margin-right: 6px; }
.tag.big { font-size: 13px; padding: 3px 9px; }

/* ---------- Social ---------- */
.ally-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; } .ally-head h2 { font-size: 20px; }
.create-ally { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); margin-bottom: 8px; flex-wrap: wrap; }
.create-ally h3 { margin-bottom: 8px; }
.offer { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--mut); font-size: 12px; margin-left: 8px; }
.offer .arrow { color: var(--dim); }
.offerform input[type=number] { width: 92px; }
.mk-new { display: grid; grid-template-columns: minmax(0, 1fr) 190px minmax(0, 1fr); gap: 12px; margin-bottom: 16px; }
.mk-side { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--panel2); border: 1px solid var(--line); } .mk-side.dest { border-color: var(--acc); }
.mk-res { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.mk-r { --c: var(--mut); display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 4px; background: var(--bg); border: 1px solid var(--line); color: var(--mut); font-size: 12px; font-weight: 600; cursor: pointer; }
.mk-r.scrap, .mk-amt.scrap, .mk-o-r.scrap { --c: var(--scrap); } .mk-r.cells, .mk-amt.cells, .mk-o-r.cells { --c: var(--cells); } .mk-r.code, .mk-amt.code, .mk-o-r.code { --c: var(--code); }
.mk-r .ic { width: 15px; height: 15px; color: var(--c); } .mk-r:hover { border-color: var(--c); } .mk-r.on { color: var(--txt); border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--bg)); }
.mk-amt { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--bg); border: 1px solid var(--c); } .mk-amt .ic { width: 18px; height: 18px; color: var(--c); }
.mk-amt input { flex: 1; min-width: 0; border: 0; background: none; font: 700 18px/1.2 var(--fd); color: var(--txt); text-align: right; } .mk-amt input:focus { outline: none; }
.mk-amt input[type=number] { appearance: textfield; -moz-appearance: textfield; }
.mk-amt input::-webkit-inner-spin-button, .mk-amt input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.mk-new .rl-mid .btn { margin-top: 8px; }
.mk-offers { display: grid; gap: 6px; }
.mk-o { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 1fr) 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; background: var(--panel2); border: 1px solid var(--line); }
.mk-who small, .mk-o-r small { display: block; color: var(--dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; } .mk-who b { font-size: 13px; }
.mk-o-r { padding-left: 8px; border-left: 2px solid var(--c); } .mk-x { color: var(--acc); text-align: center; } .mk-x .ic { width: 18px; height: 18px; }
@media (max-width: 800px) { .mk-new { grid-template-columns: minmax(0, 1fr); } .mk-o { grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); } .mk-who { grid-column: 1 / -1; } .mk-o .btn { grid-column: 1 / -1; } }
.row-i.me { border-color: color-mix(in srgb, var(--acc) 60%, var(--line)); }
.row-i .score { margin-left: 8px; min-width: 70px; text-align: right; }
.addfriend { margin-bottom: 8px; }
.xpwrap { margin: 10px 0 2px; }
.av-name { font-size: 20px; font-weight: 700; margin-bottom: 8px; }

@media (max-width: 800px) {
  .netcols { grid-template-columns: 1fr; }
  .grow-r { grid-template-columns: 24px 10px 1fr auto; } .grow-r .go { display: none; }
  .obj-fx { max-width: none; justify-content: flex-start; }
  .objective { flex-wrap: wrap; }
}

/* ---------- Colonie : en-tête lisible ---------- */
button.flabel { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--mut); font-size: 12px; font-weight: 500; padding: 4px 6px; border-radius: var(--r); }
button.flabel .ic { width: 11px; height: 11px; opacity: 0; transition: opacity .15s; }
button.flabel:hover { color: var(--txt); background: var(--panel2); } button.flabel:hover .ic { opacity: 1; }

/* ---------- Sélecteur de construction ---------- */
.dlg.wide { width: min(780px, 100%); }
.pk-tab { background: var(--panel2); border: 1px solid var(--line); color: var(--mut); padding: 6px 16px; border-radius: var(--r); font-weight: 500; }
.pk-tab:hover { color: var(--txt); } .pk-tab.on { color: var(--txt); border-color: var(--rc); background: color-mix(in srgb, var(--rc) 14%, transparent); }
.pk-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .pk-name b { font-size: 13px; }
.pk-cost { display: flex; gap: 4px; flex-wrap: wrap; } .pk-cost .cost { font-size: 11px; padding: 1px 6px; }
.sect { display: inline-flex; align-items: center; gap: 8px; color: var(--mut); font-size: 13px; }

/* ---------- En-tête : ligne 1 = marque, modes, compte ; ligne 2 = ressources ---------- */
.topbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px 18px; }
.topbar .tools { margin-left: 0; grid-column: 3; grid-row: 1; justify-self: end; }
.resbar { grid-row: 2; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.chip { min-width: 0; }
.chip .v { min-width: 0; } .chip small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Menu compte ---------- */
.usermenu { position: relative; }
.who .caret { font-size: 10px; color: var(--mut); margin-left: 2px; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; padding: 6px; background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: 0 14px 34px rgba(0, 0, 0, .55); z-index: 75; display: flex; flex-direction: column; }
.menu button { background: none; border: 0; text-align: left; padding: 8px 12px; border-radius: var(--r); color: var(--txt); font-size: 13px; }
.menu button:hover { background: var(--bg); }
.menu button.danger { color: var(--bad); }

/* ---------- Panneau latéral vide ---------- */
.side-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 18px 8px 8px; color: var(--mut); font-size: 13px; }
.side-empty .ic { width: 28px; height: 28px; color: var(--dim); }
.side-empty b { color: var(--txt); font-size: 14px; }

@media (max-width: 1000px) { .resbar { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Pastilles de notification, terrains ---------- */
.badge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: var(--r); background: var(--bad); color: #fff; font: 700 10px/17px var(--font); font-style: normal; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.tbonus { display: inline-flex; gap: 6px; margin-left: 6px; vertical-align: middle; }
.row-i .gain { font-size: 11.5px; }
.base-side > .btn { width: 100%; margin-top: 4px; }

/* ---------- Journal rétractable ---------- */

/* ---------- Colonie pleine largeur + modale de détail ---------- */
.base { display: block; }
.dt-desc { color: var(--mut); font-size: 13px; margin: 6px 0 10px; }
#dtBody { display: flex; flex-direction: column; gap: 8px; }
#dtBody h3 { margin: 14px 0 6px; }
#dtBody > .btn.alt { align-self: flex-start; margin-top: 6px; }
.dt-prog small { color: var(--acc); font-size: 12px; }
.eq-list { display: flex; flex-direction: column; gap: 6px; }
.eq-row { display: grid; grid-template-columns: 32px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); }
.eq-row .ico { width: 32px; height: 32px; border-radius: var(--r); display: grid; place-items: center; color: var(--acc); background: color-mix(in srgb, var(--acc) 13%, transparent); }

/* ---------- Carte : mondes libres ---------- */
button.grow-r.free { width: 100%; text-align: left; color: var(--txt); cursor: pointer; border-style: dashed; background: transparent; transition: border-color .12s, background .12s; }
button.grow-r.free:hover { border-color: var(--acc); border-style: solid; background: color-mix(in srgb, var(--acc) 6%, transparent); }
button.grow-r.free .gn b { color: var(--mut); font-weight: 500; }
#fdBody { display: flex; flex-direction: column; gap: 8px; }
#fdBody .btn.alt.sm { align-self: flex-start; }
.callout.cta { align-items: center; margin-top: 16px; } .callout.cta span { flex: 1; }

/* ---------- Journal : se réduit en bandeau, se rouvre sur place ---------- */

/* ---------- Navigation à 7 modes ---------- */

/* ---------- Objectif : bouton « Y aller » ---------- */
.obj-go { margin-left: 4px; padding: 3px 10px; }

/* ---------- Hangar : quantité ---------- */
.qty { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qty .qin { width: 64px; text-align: center; padding: 5px 6px; }
.qty .btn.sm { min-width: 32px; }
.act .qty { flex: none; flex-wrap: nowrap; gap: 4px; } .act .qty .qin { width: 46px; } /* compteur collé au bouton d'achat */

/* ---------- Habitants ---------- */
.stepper { gap: 6px; } .stepper .btn.sm { min-width: 0; padding: 5px 9px; }

/* ---------- Sélecteur : construire en un clic ---------- */

/* ---------- Réseau ---------- */
.pill.ok { color: var(--ok); border-color: rgba(108, 196, 106, .45); }
.vhead.sub { margin: 22px 0 10px; } .vhead.sub h3 { margin: 0; }

.opt { position: relative; }
.lastrun .btn { margin-left: 10px; }

/* ---------- Vignettes illustrées des cartes ---------- */
.card.has-thumb { padding-top: 0; overflow: hidden; }
.card.has-thumb header .ico { display: none; }
.thumb { position: relative; height: 86px; margin: 0 -14px 2px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 140% at 50% 120%, color-mix(in srgb, var(--tc, var(--acc)) 38%, transparent), transparent 70%), linear-gradient(180deg, #0f1722, #131c28);
  border-bottom: 1px solid var(--line); }
.thumb .ic { width: 42px; height: 42px; color: var(--tc, var(--acc)); filter: drop-shadow(0 0 14px color-mix(in srgb, var(--tc, var(--acc)) 70%, transparent)); position: relative; }
.th-grid { position: absolute; inset: 0; opacity: .35; background-image: linear-gradient(color-mix(in srgb, var(--tc, var(--acc)) 25%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--tc, var(--acc)) 25%, transparent) 1px, transparent 1px); background-size: 18px 18px; mask-image: radial-gradient(circle at 50% 70%, #000 20%, transparent 75%); }
.t-ship { --tc: #5b9bd5; } .t-mission { --tc: #e3a23a; } .t-sector { --tc: #3ddc84; } .t-tech { --tc: #9b7fd4; } .t-up { --tc: #d35fd0; } .t-job { --tc: #6cc46a; } .t-def { --tc: #e5534b; }

/* ---------- En cours ---------- */
.act-box { flex: none; }
.acts-list { display: flex; flex-direction: column; gap: 6px; }
.acts-list:empty::after { content: 'Rien en construction pour l’instant.'; color: var(--dim); font-size: 12px; }
.actrow { position: relative; display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; text-align: left; padding: 7px 9px 9px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel2); color: var(--txt); font-size: 12px; overflow: hidden; }
.actrow:hover { border-color: var(--acc); }
.actrow .ic { color: var(--mut); }
.ar-t { display: flex; flex-direction: column; min-width: 0; } .ar-t b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ar-t small { color: var(--dim); font-size: 11px; }
.ar-time { color: var(--acc); font-weight: 600; font-size: 11px; }
.ar-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .05); } .ar-bar u { display: block; height: 100%; width: 0; background: var(--acc); }
.actrow.alert { border-color: rgba(61, 220, 132, .55); } .actrow.alert .ic { color: #3ddc84; }
.actrow.warn .ar-time, .actrow.warn .ic { color: var(--bad); }

/* ---------- Habitants ---------- */
.cards.jobs { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.jobcard header { display: flex; gap: 12px; align-items: center; }
/* Habitants : bonus actif sous le nom, en petite étiquette sombre (comme le rôle des bâtiments) */
.jobfx { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.jobfx .gain { padding: 3px 8px; background: rgba(6, 9, 8, .86); border: 1px solid var(--line2); }
.jobcard .jobn { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; } .jobcard .jobn .ic { width: 12px; height: 12px; color: var(--pop); }
.jobcard p { color: var(--mut); font-size: 12px; }
.jobcard .stepper { display: grid; grid-template-columns: auto 1fr 1fr auto; gap: 6px; margin-top: auto; }
.jobcard .stepper .btn { width: auto; height: 34px; }

/* ---------- Colonies autonomes ---------- */

/* ---------- Défense ---------- */
.raidcard { padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.big { font-size: 26px; font-weight: 700; }
.verdict { padding: 5px 12px; border-radius: var(--r); font-size: 13px; font-weight: 600; border: 1px solid; }
.verdict.ok { color: var(--ok); border-color: rgba(108, 196, 106, .5); background: rgba(108, 196, 106, .08); }
.verdict.warn { color: var(--warn); border-color: rgba(227, 162, 58, .5); background: rgba(227, 162, 58, .08); }
.verdict.bad { color: var(--bad); border-color: rgba(229, 83, 75, .5); background: rgba(229, 83, 75, .08); }
.versus { display: flex; justify-content: space-between; font-size: 13px; color: var(--mut); } .versus b { color: var(--txt); font-size: 15px; margin-left: 4px; }
.vsbar { height: 10px; border-radius: var(--r); background: rgba(229, 83, 75, .55); overflow: hidden; } .vsbar u { display: block; height: 100%; background: var(--ok); }
.defparts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; } .dp-note { grid-column: 1 / -1; }
.dpart { gap: 8px; }
.dp-head { display: flex; gap: 10px; align-items: baseline; } .dp-v { margin-left: auto; font-size: 20px; }
.dpbar { height: 5px; border-radius: 3px; background: var(--bg); overflow: hidden; } .dpbar u { display: block; height: 100%; background: var(--acc); }
.dpart .btn { margin-top: auto; }

/* ---------- Effort de guerre ---------- */
.war-hero { padding: 18px; border: 1px solid rgba(217, 72, 59, .35); border-radius: var(--r); background: linear-gradient(180deg, rgba(217, 72, 59, .08), transparent), var(--panel2); display: flex; flex-direction: column; gap: 12px; }
.wh-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; } .wh-top small { color: var(--mut); font-size: 12px; } .wh-top h2 { font-size: 22px; }
.wh-hp { text-align: right; } .wh-hp b { display: block; font-size: 24px; color: #d9483b; } .wh-hp small { color: var(--mut); }
.wsteps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.wstep { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 11px; color: var(--dim); }
.wstep i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; border: 1px solid var(--line2); background: var(--bg); }
.wstep.done { color: var(--mut); } .wstep.done i { background: var(--ok); color: #04110c; border-color: var(--ok); }
.wstep.cur { color: var(--txt); } .wstep.cur i { background: #d9483b; color: #fff; border-color: #d9483b; }
.war-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.war-grid h3 { margin-top: 0 !important; } .war-grid > div > h3 ~ h3 { margin-top: 18px !important; }
.ways { display: flex; flex-direction: column; gap: 8px; }
.way { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); }
.way > .ic { color: var(--acc); width: 20px; height: 20px; margin-top: 2px; }
.way b { display: block; font-size: 13px; } .way span { color: var(--mut); font-size: 12px; }
.way .donate { grid-column: 1 / -1; margin-top: 6px; } .way > div { min-width: 0; }

/* ---------- Matrice : arène ---------- */
.result { padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.result.dead { border-color: rgba(229, 83, 75, .4); } .result.clear, .result.extract { border-color: rgba(108, 196, 106, .4); }
.rs-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .rs-head small { display: block; color: var(--mut); font-size: 12px; } .rs-head b { font-size: 16px; }
.rs-head .btn { margin-left: auto; }
.rs-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.rs-stats > div { padding: 8px 10px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); } .rs-stats small { display: block; color: var(--dim); font-size: 11px; } .rs-stats b { font-size: 16px; }
.c-bits { color: var(--bits); } .c-code { color: var(--code); } .c-pop { color: var(--pop); }
.arena { display: flex; flex-direction: column; gap: 14px; }
.arena-top { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); }
.arena-top small { display: block; color: var(--dim); font-size: 11px; } .arena-top b { font-size: 14px; }
.route { display: flex; align-items: center; justify-content: center; }
.rn { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; border: 1px solid var(--line2); background: var(--bg); color: var(--dim); flex: none; }
.rn .ic { width: 13px; height: 13px; } .rn.done { background: var(--acc); border-color: var(--acc); color: #04110c; } .rn.cur { border-color: var(--acc); color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 25%, transparent); }
.rn.boss { color: var(--bad); } .rl { flex: 1; max-width: 34px; height: 2px; background: var(--line2); }
.loot .chips { margin-top: 2px; }
.turn { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; } .turn b { font-size: 17px; color: var(--acc); }
.fighter { padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); display: flex; flex-direction: column; gap: 8px; }
.fighter.me { border-color: color-mix(in srgb, var(--acc) 45%, var(--line)); }
.fighter.foe { border-color: rgba(229, 83, 75, .4); } .fighter.foe.boss, .fighter.foe.elite { border-color: rgba(229, 83, 75, .7); box-shadow: 0 0 24px rgba(229, 83, 75, .12); }
.fighter.foe.pod { border-color: rgba(192, 132, 252, .6); }
.f-name { display: flex; align-items: center; gap: 8px; } .f-name .lvl { margin-left: auto; }
.hpbar.big { height: 16px; border-radius: var(--r); }
.f-meta { display: flex; justify-content: space-between; color: var(--mut); font-size: 12px; }
.lastmoves { min-height: 40px; padding: 8px 12px; border-left: 3px solid var(--acc); background: var(--panel2); border-radius: 0 8px 8px 0; font-size: 13px; color: var(--mut); }
.lastmoves div:last-child { color: var(--txt); }
.actgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.up-cat { margin-top: 18px; }
.actbtn { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 12px; border-radius: var(--r); border: 1px solid var(--line2); background: var(--panel2); color: var(--txt); transition: border-color .12s, background .12s; }
/* survol réservé aux souris : sur mobile, l'état :hover restait collé au dernier bouton touché (le bouton principal semblait grisé) */
@media (hover: hover) { .actbtn:not(.main):hover:not(:disabled) { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 8%, var(--panel2)); } .actbtn.main:hover:not(:disabled) { filter: brightness(1.1); } }
.actbtn.main { background: var(--acc); color: #04110c; border-color: var(--acc); } .actbtn.main small { color: rgba(4, 17, 12, .7); }
.actbtn b { font-size: 14px; } .actbtn small { color: var(--mut); font-size: 11px; }
.actbtn:disabled { opacity: .45; cursor: not-allowed; }
.extract { display: flex; justify-content: flex-end; }
@media (max-width: 900px) { .duel { grid-template-columns: 1fr; } .vs { display: none; } .actgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .arena-top { grid-template-columns: 1fr; } .rs-stats { grid-template-columns: repeat(2, 1fr); } .war-grid { grid-template-columns: 1fr; } }

/* ---------- Ordres / quêtes (lignes, distinctes des cartes) ---------- */
.quests { display: flex; flex-direction: column; gap: 8px; }
.quest { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid #e3a23a; border-radius: var(--r); background: var(--panel2); }
.quest.done { opacity: .55; border-left-color: var(--ok); }
.q-badge { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #e3a23a; background: rgba(227, 162, 58, .1); border: 1px dashed rgba(227, 162, 58, .5); }
.q-main h4 { font-size: 14px; } .q-main p { color: var(--mut); font-size: 12px; margin: 2px 0 6px; }
.q-bar { display: flex; align-items: center; gap: 10px; }
.q-bar .prog { position: static; display: block; flex: 1; height: 6px; transition: opacity .2s; } .q-bar .fx { font-size: 11px; color: var(--mut); white-space: nowrap; }
.quest .costs { justify-content: flex-end; } .quest .costs .lbl { min-width: 0; }
@media (max-width: 800px) { .quest { grid-template-columns: 44px 1fr; } .quest .costs, .quest .act { grid-column: 1 / -1; } }
/* Succès sur desktop : deux colonnes ; dans chaque carte, la prime passe sous la jauge et le bouton reste à droite */
@media (min-width: 1100px) {
  .ord .quests { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .ord .quest { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .ord .quest .costs { grid-column: 2; grid-row: 2; justify-content: flex-start; }
  .ord .quest .act { grid-column: 3; grid-row: 1 / 3; }
}

/* ---------- Cartes verrouillées (niveau manquant) : grisées + filigrane ---------- */
.card.locked { position: relative; filter: grayscale(1); opacity: .5; }
.card.locked::after { content: attr(data-lock); position: absolute; top: 10px; right: 10px; padding: 3px 9px; pointer-events: none; background: rgba(0, 0, 0, .6); border: 1px solid var(--line2);
  font: 700 11px/1.3 var(--fd); letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .85); } /* étiquette en coin : le filigrane ne recouvre plus les bonus */
.card.locked:hover { border-color: var(--line); }
.callout.need { align-items: center; } .callout.need .btn { margin-left: auto; }

/* ---------- Dons à l'effort de guerre ---------- */
.donate-box { margin-top: 18px; }
.dn-list { display: flex; flex-direction: column; gap: 8px; }
.dn { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); }
.dn-ico { width: 40px; height: 40px; border-radius: var(--r); display: grid; place-items: center; background: rgba(255, 255, 255, .05); } .dn-ico .ic { width: 20px; height: 20px; }
.dn-ico.scrap { color: var(--scrap, #d9813a); } .dn-ico.code { color: var(--code); } .dn-ico.cells { color: var(--cells, #9fc23a); }
.dn-mid { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dn-top { display: flex; justify-content: space-between; gap: 8px; } .dn-top small { color: var(--mut); font-size: 12px; }
.dn-range { width: 100%; accent-color: #d9483b; }
.dn-presets { display: flex; gap: 6px; align-items: center; } .dn-rate { margin-left: auto; color: var(--dim); font-size: 11px; }
.dn-chip { padding: 2px 10px; border-radius: var(--r); border: 1px solid var(--line2); background: transparent; color: var(--mut); font-size: 11px; } .dn-chip:hover { border-color: #d9483b; color: var(--txt); }
.dn-go { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; font-size: 12px; } .dn-go .c-war { color: #d9483b; font-weight: 700; }
.c-war { color: #d9483b; }

/* ---------- Guide (surbrillance) et annonces de déblocage ---------- */
@keyframes hlpulse { 0%, 100% { box-shadow: 0 0 0 2px #e3a23a, 0 0 0 0 rgba(227, 162, 58, .55); } 50% { box-shadow: 0 0 0 2px #e3a23a, 0 0 0 9px rgba(227, 162, 58, 0); } }
.hl { animation: hlpulse 1.4s infinite; position: relative; z-index: 5; border-radius: var(--r); }
#guideTip { position: fixed; z-index: 60; padding: 9px 12px; border-radius: var(--r); background: #e3a23a; color: #1a1300; font-size: 12.5px; font-weight: 600; line-height: 1.4; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); pointer-events: none; }
#guideTip::before { content: ""; position: absolute; width: 10px; height: 10px; background: inherit; transform: rotate(45deg); }
#guideTip[data-dir=left]::before { left: -5px; top: clamp(6px, calc(var(--ax) - 5px), calc(100% - 16px)); }
#guideTip[data-dir=up]::before { top: -5px; left: clamp(8px, calc(var(--ax) - 5px), calc(100% - 18px)); }
#guideTip[data-dir=down]::before { bottom: -5px; left: clamp(8px, calc(var(--ax) - 5px), calc(100% - 18px)); }
/* menu : le menu latéral (overflow) et les angles coupés (clip-path) rognent un halo extérieur, on entoure donc l'entrée par l'intérieur */
@keyframes hlpulse-in { 0%, 100% { box-shadow: inset 0 0 0 2px #e3a23a, inset 0 0 0 0 rgba(227, 162, 58, .3); } 50% { box-shadow: inset 0 0 0 2px #e3a23a, inset 0 0 16px 2px rgba(227, 162, 58, .3); } }
.side .hl { animation-name: hlpulse-in; color: var(--txt); background: rgba(227, 162, 58, .1); }
.obj-guide.on { color: #e3a23a; border-color: rgba(227, 162, 58, .5); }
.unlock { padding: 10px 0; border-bottom: 1px solid var(--line); } .unlock p { color: var(--mut); font-size: 13px; margin-top: 4px; line-height: 1.45; }

/* ---------- Accueil (première connexion) ---------- */
.welcome .lead { color: var(--mut); margin: 4px 0 12px; }
.wsteps2 { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; padding: 0; counter-reset: w; }
.wsteps2 li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; font-size: 13px; line-height: 1.4; }
.wsteps2 .ic { width: 34px; height: 34px; padding: 7px; border-radius: var(--r); color: var(--acc); background: color-mix(in srgb, var(--acc) 12%, transparent); }

/* ---------- Effort de guerre : version compacte ---------- */
.wstep em { font-style: normal; font-size: 10px; color: var(--dim); line-height: 1.3; }
/* mobile : les cinq étapes en liste, les noms ne se chevauchent plus */
@media (max-width: 800px) { .wsteps { grid-template-columns: 1fr; gap: 4px; } .wstep { flex-direction: row; text-align: left; gap: 8px; } .wstep i { flex: none; } .wstep em { margin-left: auto; text-align: right; } }
.fr-dd { position: relative; } .fr-dd .btn.on { border-color: var(--acc); color: var(--acc); } .fr-dd .btn.on .caret { display: inline-block; transform: rotate(180deg); }
.fr-cols { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; min-width: 240px; max-width: min(340px, 90vw); display: flex; flex-direction: column; gap: 2px; padding: 6px; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.fr-col { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r); } .fr-col:hover { background: var(--panel2); } .fr-col .ic { width: 14px; height: 14px; color: var(--acc); flex: none; } .fr-col b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.wstep.done em { color: var(--ok); } .wstep.cur em { color: #ef8a7c; }
.wh-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--mut); }
.wh-stats b { color: var(--txt); margin-left: 4px; }
.ways-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 4px; }
.way-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r); border: 1px solid var(--line2); background: var(--panel2); color: var(--txt); font-size: 12px; }
.way-chip .ic { width: 14px; height: 14px; color: #d9483b; } .way-chip:hover { border-color: #d9483b; }
.war-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.donate-box { margin-top: 0; }
.dn-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dn { display: flex; flex-direction: column; gap: 8px; }
.dn-top { display: flex; align-items: center; gap: 8px; } .dn-top small { margin-left: auto; }
.dn-ico { width: 28px; height: 28px; border-radius: var(--r); } .dn-ico .ic { width: 16px; height: 16px; }
.dn-go { flex-direction: row; align-items: center; justify-content: space-between; text-align: left; }
.quest.ready { border-left-color: var(--ok); }
.admin-tools { margin-top: 14px; padding: 10px 12px; border: 1px dashed rgba(229, 83, 75, .4); border-radius: var(--r); }
.admin-tools summary { cursor: pointer; color: var(--bad); font-size: 12px; font-weight: 600; } .admin-tools p { margin: 8px 0 0; }
@media (max-width: 900px) { .dn-list { grid-template-columns: 1fr; } .wsteps em { display: none; } }

/* ---------- Classements ---------- */
.rank-tabs { flex-wrap: wrap; margin-bottom: 6px; }
.rank-help { color: var(--mut); font-size: 12.5px; margin: 0 0 12px; }
.hall { display: grid; grid-template-columns: 80px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid #e3a23a; border-radius: var(--r); background: var(--panel2); }
.hall-n { font-weight: 800; color: #e3a23a; } .hall-b { display: flex; flex-direction: column; gap: 2px; } .hall-b .ic { width: 14px; height: 14px; vertical-align: -2px; color: #d9483b; }
.dn-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; } .dn-chip { white-space: nowrap; padding: 3px 0; }
.dn-top b { white-space: nowrap; } .dn-top small { white-space: nowrap; }
.dn-go { gap: 8px; font-size: 11.5px; }
.quest.ready { order: -1; }
#guideTip { z-index: 200; }

/* ---------- Expéditions : destination, difficulté, flotte, suivi ---------- */
/* Expéditions, Matrice : les cartes de sélection seules, l'assistant en étapes s'ouvre au clic */
.exp.off { opacity: .55; }
.ep-head .ico, .ep-ship .ico, .er-head .ico { width: 34px; height: 34px; border-radius: var(--r); display: grid; place-items: center; color: #e3a23a; background: rgba(227, 162, 58, .1); }
.tcard.on { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.exp-plan { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); }
.ep-head { display: flex; gap: 12px; align-items: center; } .ep-head h4 { font-size: 15px; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 3px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); }
.seg button { padding: 7px 4px; border-radius: var(--r); border: 0; background: transparent; color: var(--mut); font-size: 12px; font-weight: 600; }
.seg button.on { color: #04110c; } .seg .d0.on { background: var(--ok); } .seg .d1.on { background: #e3a23a; } .seg .d2.on { background: #d9813a; } .seg .d3.on { background: var(--bad); }
.ep-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ep-stats > div { padding: 8px 10px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); } .ep-stats small { display: block; color: var(--dim); font-size: 11px; } .ep-stats b { font-size: 17px; }
.ep-stats .ok { color: var(--ok); } .ep-stats .warn { color: var(--warn); } .ep-stats .bad { color: var(--bad); }
.ep-fleet { display: flex; flex-direction: column; gap: 6px; }
.ep-fh { display: flex; align-items: center; gap: 8px; } .ep-fh b { margin-right: auto; }
.ep-ship { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); }
.ep-sn { display: flex; flex-direction: column; min-width: 0; } .ep-sn b { font-size: 12.5px; } .ep-sn small { color: var(--mut); font-size: 11px; }
.ep-q { display: flex; align-items: center; gap: 4px; } .ep-q b { min-width: 46px; text-align: center; font-size: 14px; } .ep-q b small { color: var(--dim); font-size: 11px; font-weight: 500; }
.ep-go { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.exp-run { display: flex; flex-direction: column; gap: 10px; padding: 14px; margin-bottom: 14px; border: 1px solid rgba(227, 162, 58, .45); border-radius: var(--r); background: linear-gradient(180deg, rgba(227, 162, 58, .07), transparent), var(--panel2); }
.er-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .er-head small { display: block; color: var(--mut); font-size: 12px; } .er-head b { font-size: 16px; }
.er-sum { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .er-sum > span:not(.cost):not(.mchip) { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin-left: 6px; }
.er-fleet { display: flex; flex-wrap: wrap; gap: 6px; }
.tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl li { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding-bottom: 12px; }
.tl li::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line2); } .tl li:last-child::before { display: none; }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line2); color: var(--mut); }
.tl-dot .ic { width: 14px; height: 14px; }
.tl time { color: var(--dim); font-size: 11px; } .tl p { font-size: 13px; margin: 2px 0 4px; line-height: 1.4; }
.tl-fight .tl-dot { color: #d9813a; border-color: rgba(251, 146, 60, .5); } .tl-retreat .tl-dot { color: var(--bad); border-color: rgba(229, 83, 75, .6); }
.tl-cache .tl-dot { color: var(--ok); border-color: rgba(108, 196, 106, .5); } .tl-hazard .tl-dot { color: #9b7fd4; } .tl-end .tl-dot { color: var(--acc); border-color: var(--acc); }
.tl-wait .tl-dot { border-style: dashed; animation: hlpulse 1.6s infinite; }
.exp-last { margin-top: 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); }
.exp-last summary { cursor: pointer; font-size: 13px; color: var(--mut); margin-bottom: 8px; }
@media (max-width: 900px) { .ep-stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Loadout de l'avatar ---------- */
.lo { display: flex; flex-direction: column; gap: 8px; padding: 14px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); }
.lo-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; } .lo-head h3 { margin: 0 0 2px !important; }
.lo-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.lo-bar u { background: var(--acc); }
.lo-cat { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.lo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.lo-i { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: center; text-align: left; padding: 8px 10px 8px 8px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); color: var(--txt); }
.lo-i .ico { width: 30px; height: 30px; border-radius: var(--r); display: grid; place-items: center; color: var(--mut); background: rgba(255, 255, 255, .04); }
.lo-i:hover:not(:disabled) { border-color: var(--line2); }
.lo-i.on { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 9%, var(--bg)); } .lo-i.on .ico { color: var(--acc); background: color-mix(in srgb, var(--acc) 15%, transparent); }
.lo-i.off:not(.on) { opacity: .45; cursor: not-allowed; }
.lo-t { display: flex; flex-direction: column; min-width: 0; } .lo-t b { font-size: 12.5px; } .lo-t small { font-size: 11px; line-height: 1.3; }
.lo-t .up { color: var(--ok); } .lo-t .down { color: var(--bad); }
.lo-c { position: absolute; top: 6px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r); display: grid; place-items: center; font-size: 10px; font-weight: 800; color: var(--mut); border: 1px solid var(--line2); }
.lo-i.on .lo-c { color: #04110c; background: var(--acc); border-color: var(--acc); }
.c-bad { color: var(--bad); }

/* ---------- Loadout v2 : base / équipement / modules facultatifs ---------- */
.lo-head { align-items: center; }
.lo-bw { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mut); } .lo-bw .bigbar { width: 140px; } .lo-bw .bigbar u { background: var(--acc); }
.lo-sum { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); overflow-x: auto; }
.lo-sum table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.lo-sum th, .lo-sum td { padding: 4px 8px; text-align: right; white-space: nowrap; } .lo-sum thead th { color: var(--dim); font-weight: 600; font-size: 11px; }
.lo-sum tbody th { text-align: left; color: var(--mut); font-weight: 600; } .lo-sum td:last-child, .lo-sum th:last-child { border-left: 1px solid var(--line); }
.lo-sum td b { font-size: 14px; } .lo-sum em { font-style: normal; font-weight: 700; } .lo-sum .up { color: var(--ok); } .lo-sum .down { color: var(--bad); }
.lo-sec { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.lo-st { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; } .lo-st b { font-size: 13px; }
/* Squelette : encadrés vides montrés tant que rien n'est choisi (Expéditions, Matrice) */
.wz-steps { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.wz-steps button { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; font-size: 11.5px; color: var(--mut); background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r); white-space: nowrap; }
.wz-steps i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font: 700 10px/1 var(--fd); font-style: normal; border: 1px solid var(--line2); }
.wz-steps .on { color: var(--txt); border-color: var(--acc); background: color-mix(in srgb, var(--acc) 10%, var(--panel2)); } .wz-steps .on i { color: #04110c; background: var(--acc); border-color: var(--acc); }
.wz-steps .done i { color: var(--acc); border-color: var(--acc); }
@media (max-width: 800px) { .wz-steps button:not(.on) { flex: 0 0 auto; } .wz-steps button:not(.on) span { display: none; } } /* mobile : le nom de l'étape en cours, des numéros pour les autres */
.wz-body .fi-hero { margin: 0; } .fi-name .ic { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }
.wz-steps .ic { width: 14px; height: 14px; } .wz-steps .on .ic { color: var(--acc); }
.wz-body { display: flex; flex-direction: column; gap: 12px; }
.rc { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); }
.rc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; } .rc-t { display: inline-flex; align-items: center; gap: 6px; min-width: 120px; font-size: 12px; color: var(--mut); }
.wz-body > .thumb { margin: 0; border: 1px solid var(--line); border-radius: var(--r); }
.wz-body > .thumb.has-img { height: clamp(110px, 16vw, 170px); } .wz-body > .thumb img { width: 100%; height: 100%; object-fit: cover; }
.wz-nav { position: sticky; bottom: calc(-24px - env(safe-area-inset-bottom)); display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); z-index: 5; } /* au-dessus des cartes (z-index 2) qui défilent dessous */
.wz-nav .btn { flex: 1; justify-content: center; }
.lo-pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.lo-p { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; gap: 6px 8px; align-items: center; padding: 8px 10px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); }
.lo-p .ico { width: 30px; height: 30px; border-radius: var(--r); display: grid; place-items: center; color: var(--mut); background: rgba(255, 255, 255, .04); }
.lo-p.on { border-color: var(--acc); } .lo-p.on .ico { color: var(--acc); background: color-mix(in srgb, var(--acc) 15%, transparent); }
.lo-p.none .lo-t b { color: var(--mut); }
.lo-p .lo-t small .up { color: var(--ok); }
.lo-pa { grid-column: 1 / -1; display: flex; gap: 6px; } .lo-pa .btn { display: inline-flex; align-items: center; gap: 6px; }
.lo-pa .lo-c { position: static; }
.lo-pc { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.btn.alt:disabled { color: var(--dim); border-color: var(--line); }
.lo-pa .lo-c { background: rgba(0, 0, 0, .25); color: inherit; border-color: transparent; }
.lo-pa .btn.alt .lo-c { background: rgba(255, 255, 255, .06); }

/* ---------- Loadout v3 : tuiles de stats, équipement en quantité, équipement Avatar en ligne ---------- */
.lo-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lo-tile { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); }
.lo-tile small { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; } .lo-tile b { font-size: 22px; line-height: 1.2; }
.lo-tile span { font-size: 11.5px; color: var(--mut); } .lo-tile .up { color: var(--ok); } .lo-tile .down { color: var(--bad); }
.lo-pieces { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.lo-q, .lo-craft { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lo-q b { min-width: 22px; text-align: center; font-size: 15px; } .lo-q .lo-c { position: static; }
.lo-stock { margin-left: auto; font-size: 11.5px; color: var(--mut); }
.lo-craft .lo-pc { margin-left: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.eq-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
@media (max-width: 700px) { .lo-tiles { grid-template-columns: repeat(2, 1fr); } }
.eq-list .eq-row { grid-template-columns: 32px 1fr auto; } .eq-list .pk-cost { grid-column: 2; grid-row: 2; justify-content: flex-start; } .eq-list .eq-row .btn { grid-column: 3; grid-row: 1 / 3; }

.exp-last .rs-stats { margin-bottom: 8px; } .exp-last .term { height: auto; max-height: 240px; margin-top: 8px; }

/* ---------- Colonie : salles illustrées ---------- */
.art { position: relative; display: grid; place-items: center; overflow: hidden; color: var(--rc);
  background: radial-gradient(120% 120% at 70% 110%, color-mix(in srgb, var(--rc) 35%, transparent), transparent 70%), linear-gradient(160deg, #1a140f, #120e0a); }
.art .ic { position: relative; filter: drop-shadow(0 0 12px color-mix(in srgb, var(--rc) 70%, transparent)); }
.art-grid { position: absolute; inset: 0; opacity: .3; background-image: linear-gradient(color-mix(in srgb, var(--rc) 25%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--rc) 25%, transparent) 1px, transparent 1px); background-size: 14px 14px; mask-image: radial-gradient(circle at 70% 80%, #000 15%, transparent 70%); }
.art.has-img .ic, .art.has-img .art-grid { display: none; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.room .r-art.has-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 9, 8, .78), rgba(6, 9, 8, .12) 34%, rgba(6, 9, 8, .72) 68%, rgba(6, 9, 8, .94)); }
.room.built { height: 104px; justify-content: flex-end; padding-bottom: 12px; }
.room .r-art { position: absolute; inset: 0; z-index: 0; }
.room .r-art { place-items: start end; padding: 8px 10px; } .room .r-art .ic { width: 40px; height: 40px; opacity: .5; }
.room.built .r-main { position: static; text-shadow: 0 1px 6px #000; } .room.built .r-main > :not(.r-art) { position: relative; z-index: 1; }
.room.built:hover .r-art .ic { opacity: .55; }
.r-role { display: inline-block; padding: 1px 7px; border-radius: var(--r); font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--rc); background: color-mix(in srgb, var(--rc) 16%, rgba(0, 0, 0, .45)); }

/* ---------- Réseau : cases de colonies ---------- */

/* ---------- Défense : duel animé, sources compactes, historique ---------- */
.clash { position: relative; height: 54px; border-radius: var(--r); overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.clash u { position: absolute; top: 0; bottom: 0; transition: width .6s ease; }
.clash .c-me { left: 0; width: var(--p); background: linear-gradient(90deg, rgba(108, 196, 106, .15), rgba(108, 196, 106, .55)); }
.clash .c-foe { right: 0; width: calc(100% - var(--p)); background: linear-gradient(270deg, rgba(229, 83, 75, .15), rgba(229, 83, 75, .55)); }
.clash .c-front { position: absolute; top: -4px; bottom: -4px; left: var(--p); width: 3px; margin-left: -1.5px; background: #f2d28b; box-shadow: 0 0 14px 4px rgba(253, 230, 138, .55); animation: front 1.6s ease-in-out infinite; }
@keyframes front { 0%, 100% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
.c-sents, .c-guards { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; gap: 2px; }
.c-sents { left: calc(var(--p) + 6px); } .c-guards { right: calc(100% - var(--p) + 6px); }
.sent, .guard { display: grid; place-items: center; animation: push 1.2s ease-in-out infinite; animation-delay: calc(var(--i) * -.35s); }
.sent .ic { width: 22px; height: 22px; color: #f0a39c; filter: drop-shadow(0 0 6px rgba(229, 83, 75, .8)); }
.guard .ic { width: 20px; height: 20px; color: #6ee7b7; filter: drop-shadow(0 0 6px rgba(108, 196, 106, .8)); }
.sent { --dir: -1; } .guard { --dir: 1; }
@keyframes push { 0%, 100% { transform: translateX(0) translateY(0); } 40% { transform: translateX(calc(var(--dir) * 6px)) translateY(-2px); } 60% { transform: translateX(calc(var(--dir) * 4px)) translateY(2px); } }
.clash.win .c-sents { opacity: .7; } .clash.lose .c-guards { opacity: .7; }
@media (prefers-reduced-motion: reduce) { .sent, .guard, .c-front { animation: none; } }
/* compte à rebours au-dessus : la jauge se remplit depuis le raid précédent */
.rc-when { display: flex; align-items: center; gap: 8px; } .rc-when > .ic { width: 16px; height: 16px; color: #f2d28b; flex: none; }
.rc-when small { color: var(--mut); font-size: 12px; } .rc-when b { font: 700 18px/1 var(--fd); color: #f2d28b; min-width: 64px; }
.rw-bar { flex: 1; height: 6px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.rw-bar u { display: block; height: 100%; background: linear-gradient(90deg, rgba(242, 210, 139, .25), #f2d28b); box-shadow: 0 0 8px rgba(253, 230, 138, .5); transition: width 1s linear; }
/* forces écrites aux deux bouts de la barre */
.clash .c-lbl { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 9px; background: rgba(0, 0, 0, .55); border: 1px solid var(--line2); font-size: 12px; }
.clash .c-lbl .ic { width: 15px; height: 15px; align-self: center; } .clash .c-lbl b { font: 700 16px/1 var(--fd); } .clash .c-lbl small { color: var(--mut); }
.clash .c-lbl.me { left: 8px; } .clash .c-lbl.me .ic { color: var(--ok); } .clash .c-lbl.foe { right: 8px; } .clash .c-lbl.foe .ic { color: var(--bad); }
/* verdict sous la barre : ce qu'il manque (ou la marge), et le multiplicateur de défense */
.rc-verdict { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--mut); }
.rc-verdict > .ic { width: 18px; height: 18px; flex: none; } .rc-verdict > span:first-of-type { flex: 1; min-width: 200px; } .rc-verdict b { font: 700 15px/1.2 var(--fd); }
.rc-verdict.ok > .ic, .rc-verdict.ok b { color: var(--ok); } .rc-verdict.warn > .ic, .rc-verdict.warn b { color: var(--warn); } .rc-verdict.bad > .ic, .rc-verdict.bad b { color: var(--bad); }
.def-mul { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; color: var(--mut); font-size: 12px; }
.def-mul > span { display: inline-flex; align-items: center; gap: 5px; } .def-mul .ic { width: 14px; height: 14px; color: #d9483b; } .rc-verdict .def-mul b { font: 700 12.5px/1 var(--fd); color: var(--txt); }
.def-mul .dm-plus { font-style: normal; font-weight: 700; color: var(--dim); }
/* sources : une bande de trois cases, la petite barre donne leur part dans la défense */
.def-src { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: var(--bg); }
.def-chip { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 12px 11px; border: 0; border-left: 1px solid var(--line); background: none; color: var(--txt); text-align: left; min-width: 0; }
.def-chip:first-child { border-left: 0; } .def-chip:hover { background: rgba(217, 72, 59, .08); }
.def-chip .dc-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; background: rgba(217, 72, 59, .14); } .def-chip .dc-ic .ic { width: 16px; height: 16px; color: #d9483b; }
.def-chip .dc-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .def-chip .dc-t b { font: 700 17px/1 var(--fd); } .def-chip .dc-t small { color: var(--mut); font-size: 11px; }
.def-chip .dc-bar { position: absolute; left: 0; bottom: 0; height: 2px; background: #d9483b; transition: width .6s ease; }
.def-alerts:has(> div:not(:empty)) { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; margin-top: 10px; }
.def-alerts .price small { margin-left: -3px; color: var(--dim); font-size: 10px; } /* ramassé / total du champ */
.def-alerts .callout[data-end] { position: relative; overflow: hidden; } .def-alerts .sl-time { font: 700 13px/1 var(--fd); color: var(--acc); }
.def-alerts > div:empty { display: none; } .def-alerts .callout { margin: 0; height: 100%; align-items: center; }
/* historique : rabattu par défaut, une ligne par raid */
.raid-box { padding: 0; } .raid-box summary { margin: 0; padding: 10px 14px; } .raid-box[open] summary { border-bottom: 1px solid var(--line); }
.c-ok { color: var(--ok); }
.raid-hist { display: flex; flex-direction: column; }
.rh { display: grid; grid-template-columns: 104px 44px minmax(70px, 140px) 120px 1fr; align-items: center; gap: 10px; padding: 7px 12px; border-top: 1px solid var(--line); font-size: 12px; }
.rh:first-child { border-top: 0; }
.rh-v { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; } .rh-v .ic { width: 14px; height: 14px; }
.rh.win .rh-v { color: var(--ok); } .rh.lose .rh-v { color: var(--bad); }
.rh time { color: var(--dim); font-size: 11px; } .rh-col { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-f { color: var(--mut); font-variant-numeric: tabular-nums; } .rh-f i { font-style: normal; color: var(--dim); font-size: 11px; }
.rh-x { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
@media (max-width: 640px) {
  .def-chip { padding: 8px 10px 10px; } .def-chip .dc-ic { display: none; }
  .rh { grid-template-columns: auto auto 1fr auto; gap: 4px 8px; } .rh-x { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- Hangar : inventaire de la flotte ---------- */

/* ---------- Panthéon : podium par cycle ---------- */
.hall { grid-template-columns: 110px 1fr; }
.hall-n { display: flex; flex-direction: column; } .hall-n small { color: var(--dim); font-weight: 500; font-size: 11px; }
.podium { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 4px; }
.pd { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mut); }
.pd i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800; color: #1a1300; }
.pd.or i { background: #e3a23a; } .pd.argent i { background: #cbd5e1; } .pd.bronze i { background: #d97706; }
.pd.or { font-size: 16px; color: var(--txt); } .pd.or b { color: #e3a23a; }

/* ---------- Avatar : stats en avant ; Armurerie ---------- */
.av-main { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; } .av-main .xpwrap { margin: 0; }
.av-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 14px 0 4px; } .av-tiles .lo-tile b { font-size: 26px; }
@media (max-width: 800px) { .av-tiles { grid-template-columns: repeat(2, 1fr); } }
.lo-more { align-self: flex-start; }

/* ---------- Carte : joueurs en avant, failles discrètes, failles profondes ---------- */
.grow-r.free { border-style: dashed !important; background: transparent !important; opacity: .7; } .grow-r.free:hover { opacity: 1; }
.grow-r.free .go { opacity: .6; transform: scale(.92); transform-origin: left center; }
.grow-r.player { border: 1px solid var(--line2) !important; border-left: 3px solid #f59e0b !important; background: color-mix(in srgb, #f59e0b 6%, var(--panel2)) !important; }
.grow-r.player.ally { border-left-color: var(--ok) !important; } .grow-r.player.me { border-left-color: var(--acc) !important; }
.grow-r.deep { background-image: repeating-linear-gradient(135deg, rgba(120, 90, 60, .12) 0 6px, transparent 6px 14px) !important; }
.grow-r.deep .gp { color: #d6a46b; }

/* ---------- Alliance : description, gestion, candidatures ---------- */
.ally-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ally-descr { margin: 8px 0 4px; color: var(--txt); font-size: 13px; line-height: 1.5; white-space: normal; }
.ally-manage { margin: 12px 0; padding: 12px 14px; border: 1px dashed var(--line2); border-radius: var(--r); background: var(--panel2); }
.ally-manage h3 { margin-top: 0 !important; } .ally-manage h3 ~ h3 { margin-top: 14px !important; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--mut); }
.fld textarea { width: 100%; resize: vertical; padding: 8px 10px; border-radius: var(--r); border: 1px solid var(--line2); background: var(--bg); color: var(--txt); font: inherit; font-size: 13px; }
.ally-opts { display: flex; align-items: center; gap: 12px; margin-top: 8px; } .ally-opts .btn { margin-left: auto; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.ally-ra { margin-left: auto; display: flex; gap: 6px; }
.ally-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.ally-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel2); }
.ac-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .ac-head .pill { margin-left: auto; }
.ac-act { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: auto; }

/* ======================================================================
   Thème « roche » : on vit caché sous terre. Tons bruns, strates, pierre.
   (surcouche : redéfinit les couleurs de base et les fonds bleutés d'origine)
   ====================================================================== */
:root {
  --bg: #0e0b09;
  --panel: #17120e;
  --panel2: #1e1813;
  --line: #33281f;
  --line2: #47392c;
  --txt: #f1e8dd;
  --mut: #ab9b8a;
  --dim: #77685a;
}
body {
  background:
    radial-gradient(900px 500px at 85% -10%, color-mix(in srgb, var(--acc) 7%, transparent), transparent 60%),
    radial-gradient(700px 420px at 0% 110%, rgba(120, 72, 36, .18), transparent 65%),
    repeating-linear-gradient(172deg, rgba(255, 220, 180, .018) 0 2px, transparent 2px 38px),
    repeating-linear-gradient(8deg, rgba(0, 0, 0, .18) 0 1px, transparent 1px 23px),
    var(--bg);
  background-attachment: fixed;
}
.glass { background: linear-gradient(180deg, rgba(255, 230, 200, .025), transparent 40%), var(--panel); box-shadow: inset 0 1px 0 rgba(255, 230, 200, .04), 0 10px 30px rgba(0, 0, 0, .35); }
.cutaway { background: linear-gradient(180deg, #1a130e, #120d09); }
.shaft { background: repeating-linear-gradient(0deg, #2a2017 0 3px, transparent 3px 9px); }
.room { background: #1d1712; }
.room.empty { background: rgba(0, 0, 0, .18); }
.thumb { background: radial-gradient(120% 140% at 50% 120%, color-mix(in srgb, var(--tc, var(--acc)) 38%, transparent), transparent 70%), linear-gradient(180deg, #1b1510, #221a13); }
.art { background: radial-gradient(120% 120% at 70% 110%, color-mix(in srgb, var(--rc) 35%, transparent), transparent 70%), linear-gradient(160deg, #241b14, #15100c); }
.modal { background: rgba(10, 7, 5, .72); }
.dlg { background: var(--panel); border-color: var(--line2); }
input, select, textarea { background: #120e0b; border-color: var(--line2); color: var(--txt); }
.floor { border-bottom-color: #2a2017; }
.raid-hist .empty { grid-column: 1 / -1; padding: 10px 14px; } /* pas collé à la bordure (raids, rapports de convoi) */

/* ======================================================================
   Refonte UX : objectifs séparés, noms de ressources, Matrice, profil, compte
   ====================================================================== */

/* ---------- En-tête : nom des ressources ---------- */
.chip .cn { font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--c); opacity: .85; line-height: 1.1; }

/* ---------- Noms au survol (ressources, atouts, badges) : petite bulle qui descend ---------- */

/* ---------- Objectifs : tutoriel | objectif commun ---------- */
.objective { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 10px; padding: 0; border: 0; background: none; align-items: stretch; }
.objective.solo { grid-template-columns: minmax(0, 1fr); }
.obj-tuto { padding: 10px 14px; border-left: 3px solid #e3a23a; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ot-head { display: flex; align-items: center; gap: 10px; }
.ot-head .obj-tag { color: #e3a23a; } .ot-fold { display: none; }
.ot-ch { font-size: 11px; color: var(--mut); text-transform: uppercase; letter-spacing: .06em; }
.ot-bar { flex: 1; max-width: 160px; height: 4px; border-radius: 2px; background: var(--bg); overflow: hidden; } .ot-bar u { display: block; height: 100%; background: #e3a23a; }
.ot-head .obj-guide { margin-left: auto; }
.ot-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .ot-text { font-size: 15px; }
.ot-prog { font-size: 12px; font-weight: 700; color: #e3a23a; padding: 1px 8px; border-radius: var(--r); background: rgba(227, 162, 58, .12); }
.ot-why { color: var(--mut); font-size: 12.5px; line-height: 1.45; }
.ot-why i { font-style: normal; font-weight: 700; color: var(--txt); margin-right: 2px; }
.obj-goal { padding: 10px 14px; border-left: 3px solid #d9483b; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 6px 16px; align-content: center; }
.objective.solo .obj-goal { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
.og { cursor: pointer; min-width: 0; font-size: 11px; color: var(--mut); border-radius: var(--r); }
.og .obj-tag { color: #d9483b; } .og .mw-name { color: var(--txt); font-weight: 600; font-size: 13px; } .og .mw-name.warn { color: var(--bad); }
.og:hover .mw-name { color: #ef8a7c; }
.obj-goal .obj-fx { grid-column: 1 / -1; max-width: none; justify-content: flex-start; }
.objective.solo .obj-goal .obj-fx { grid-column: auto; justify-content: flex-end; }
.obj-fx:empty { display: none; }
@media (max-width: 1000px) { .objective, .objective.solo .obj-goal { grid-template-columns: minmax(0, 1fr); } .obj-goal { grid-template-columns: 1fr 1fr; } .ot-why { font-size: 12px; } }

/* ---------- Butin, atouts ---------- */
.cost.lg { font-size: 14px; padding: 5px 11px; border-radius: var(--r); gap: 7px; } .cost.lg .ic { width: 1.2em; height: 1.2em; }
.mchip.lg { font-size: 13px; padding: 5px 10px; }
.loot-box { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); }
.lb-t { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.lb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-row { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.sc { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: var(--r); font-size: 11.5px; font-weight: 700; color: var(--scc, var(--txt)); background: color-mix(in srgb, var(--scc, var(--mut)) 14%, transparent); cursor: help; }
.sc .ic { width: 12px; height: 12px; }
.sc.atk { --scc: #d9813a; } .sc.def { --scc: #5b9bd5; } .sc.cargo { --scc: #e3a23a; } .sc.scout { --scc: #6cc46a; } .sc.hp { --scc: #e5534b; }
.ep-sn .sc-row { margin-top: 3px; }

/* ---------- Statistiques RPG ---------- */
.rpg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.rpg.big { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.lo .rpg { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rs { --sc: var(--txt); position: relative; display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: var(--r); background: linear-gradient(135deg, color-mix(in srgb, var(--sc) 12%, transparent), transparent 70%), var(--bg); border: 1px solid color-mix(in srgb, var(--sc) 30%, var(--line)); cursor: default; }
.rs-i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--sc); background: color-mix(in srgb, var(--sc) 18%, transparent); box-shadow: 0 0 12px color-mix(in srgb, var(--sc) 25%, transparent); }
.rs-i .ic { width: 16px; height: 16px; }
.rs-v { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; } .rs-v b { font-size: 18px; font-weight: 800; } .rs-v small { font-size: 10px; color: var(--mut); text-transform: uppercase; letter-spacing: .06em; }
.rs em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; } .rs em.up { color: var(--ok); } .rs em.down { color: var(--bad); }
.rs.hp { --sc: #e5534b; } .rs.atk { --sc: #d9813a; } .rs.def { --sc: #5b9bd5; } .rs.patch { --sc: #6cc46a; } .rs.bw { --sc: #3ddc84; } .rs.dodge { --sc: #58c7bd; }
.rpg.big .rs { flex-wrap: wrap; padding: 10px 12px; } .rpg.big .rs-i { width: 40px; height: 40px; } .rpg.big .rs-i .ic { width: 20px; height: 20px; } .rpg.big .rs-v b { font-size: 24px; }
.rs-up { flex-basis: 100%; display: flex; flex-direction: column; gap: 3px; } .rs-up small { color: var(--dim); font-size: 10.5px; }
.rs-bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .06); overflow: hidden; } .rs-bar u { display: block; height: 100%; background: var(--sc); }
@media (max-width: 900px) { .rpg, .rpg.big { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .lo .rpg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Bande passante en emplacements ---------- */
.bw { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); }
.bw-l { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mut); } .bw-l .ic { color: #3ddc84; } .bw-l b { color: var(--txt); }
.bw-slots { display: flex; flex-wrap: wrap; gap: 3px; flex: 1; }
.bw-slots i { width: 14px; height: 14px; border-radius: var(--r); border: 1px dashed var(--line2); background: transparent; }
.bw-slots i.eq { border: 0; background: #3ddc84; box-shadow: 0 0 6px rgba(61, 220, 132, .5); }
.bw-slots i.mod { border: 0; background: #9b7fd4; box-shadow: 0 0 6px rgba(167, 139, 250, .5); }

/* ---------- Missions de la Matrice : brancher en bas ---------- */
.foes { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foe-c { display: inline-flex; align-items: center; gap: 6px; } .foe-c small { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.m-go-in { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--acc) 50%, var(--line)); background: linear-gradient(0deg, color-mix(in srgb, var(--acc) 10%, var(--panel)), var(--panel)); box-shadow: 0 -10px 24px rgba(0, 0, 0, .35); }
.m-go-in > span { flex: 1; }
.btn.big { padding: 12px 26px; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.run-last { margin: 0 0 12px; } .run-last summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; color: var(--txt); }
.run-last summary .chips { margin: 0 0 0 auto; } .run-last.dead { border-color: rgba(229, 83, 75, .45); }
.run-last[open] summary { margin-bottom: 8px; }

/* ---------- Carte du run ---------- */
.nmap-wrap { overflow-x: auto; scrollbar-width: thin; }
.nmap { position: relative; height: 200px; min-width: calc(var(--n) * 58px); border-radius: var(--r); border: 1px solid var(--line);
  background: radial-gradient(80% 120% at 50% 50%, color-mix(in srgb, var(--acc) 8%, transparent), transparent 70%),
    linear-gradient(color-mix(in srgb, var(--acc) 7%, transparent) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, color-mix(in srgb, var(--acc) 7%, transparent) 1px, transparent 1px) 0 0 / 22px 22px, #0b0f12; }
.nmap line { stroke-width: 2; vector-effect: non-scaling-stroke; }
.nmap line.done { stroke: var(--acc); } .nmap line.todo { stroke: var(--line2); stroke-dasharray: 4 5; }
.nmap line.next { stroke: var(--acc); stroke-dasharray: 6 4; animation: dash 1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -20; } }
.nm-n { position: absolute; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line2); background: #0e1216; color: var(--dim); font-weight: 700; font-size: 13px; }
.nm-n .ic { width: 16px; height: 16px; }
.nm-n.done { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 22%, #0e1216); color: var(--acc); }
.nm-n.cur { width: 44px; height: 44px; border-color: var(--acc); color: var(--acc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--acc) 25%, transparent), 0 0 18px color-mix(in srgb, var(--acc) 40%, transparent); }
.nm-n.boss { width: 42px; height: 42px; border-color: rgba(229, 83, 75, .6); color: var(--bad); }
.nm-n.opt { --kc: var(--acc); width: 54px; height: 54px; border: 2px solid var(--kc); color: var(--kc); background: color-mix(in srgb, var(--kc) 16%, #0e1216); cursor: pointer; animation: optpulse 1.6s ease-in-out infinite; transition: transform .12s; }
@media (hover: hover) { .nm-n.opt:hover { transform: translate(-50%, -50%) scale(1.12); } }
.nm-n.opt .ic { width: 24px; height: 24px; }
.nm-l { position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 700; color: var(--kc); text-shadow: 0 1px 4px #000; }
@keyframes optpulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--kc) 45%, transparent); } 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--kc) 0%, transparent); } }
.nm-n.k-elite, .nm-n.k-boss { --kc: #e5534b; } .nm-n.k-pod { --kc: #a98be0; } .nm-n.k-cache { --kc: #4fa3e0; } .nm-n.k-rest { --kc: #6cc46a; }
.nm-n.done.k-pod { color: #a98be0; } .nm-n.done.k-elite { color: #e5534b; }
@media (prefers-reduced-motion: reduce) { .nm-n.opt, .nmap line.next { animation: none; } }

/* ---------- Avatar : fiche de personnage ---------- */
.av-card { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; padding: 16px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--acc) 35%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--acc) 8%, transparent), transparent 60%), var(--panel2); margin-bottom: 8px; }
.av-card .av-glyph { width: 88px; height: 88px; border-radius: 50%; box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 40%, transparent), 0 0 30px color-mix(in srgb, var(--acc) 25%, transparent); }
.av-card .av-main { min-width: 260px; }

/* ---------- Armurerie : Boutique / Atelier ---------- */
.seg.two { grid-template-columns: repeat(2, auto); }
.seg.two button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; }
.seg.two button.on { background: var(--acc); color: #04110c; }

/* ---------- Liens vers les profils ---------- */
.plink { background: none; border: 0; padding: 0; font-weight: 600; color: var(--txt); text-align: left; }
.plink:hover { color: var(--acc); text-decoration: underline; }

/* ---------- Réseau : places verrouillées cliquables ---------- */

/* ---------- Connexion ---------- */
.auth-box { text-align: left; } .auth-box h1, .auth-box .sub { text-align: center; }
#authBody form { display: grid; gap: 10px; margin-top: 12px; }
#authBody form .btn { margin-top: 2px; }
.auth-tabs { grid-template-columns: 1fr 1fr; }
.auth-tabs button.on { background: var(--acc); color: #04110c; }
.linkbtn { background: none; border: 0; color: var(--mut); font-size: 12.5px; padding: 8px 0 0; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--acc); }
.auth-h { font-size: 16px; margin-bottom: 6px; }
.auth-note { color: var(--mut); font-size: 12.5px; margin-top: 8px; line-height: 1.45; } .auth-note.ok { color: #b6f3dc; } .auth-note a { color: var(--acc); }

/* ---------- Profil ---------- */
.pf { display: flex; flex-direction: column; gap: 12px; }
.pf { display: grid; gap: 12px; max-width: 900px; margin: 0 auto; }
.pf-head { display: flex; gap: 16px; align-items: flex-start; padding-right: 38px; } /* laisse la place à la croix de fermeture */
.pf-glyph { position: relative; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; flex: none; overflow: hidden; font-size: 30px; font-weight: 800; color: var(--acc); background: color-mix(in srgb, var(--acc) 15%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--acc) 40%, transparent); }
.pf-glyph img, .av-glyph img.pic, .f-av img.pic { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.av-glyph, .f-av { overflow: hidden; }
/* survol de sa propre image : changer / retirer (masqué = non cliquable, pour qu'un premier toucher sur mobile ne déclenche rien) */
.pf-pic { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 4px; background: rgba(5, 8, 12, .72); opacity: 0; visibility: hidden; transition: opacity .15s, visibility .15s; }
.pf-glyph:hover .pf-pic, .pf-glyph:focus-within .pf-pic { opacity: 1; visibility: visible; }
.pf-pic label, .pf-pic button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--line2); border-radius: 50%; background: rgba(23, 18, 14, .85); color: var(--txt); cursor: pointer; }
.pf-pic label:hover { color: var(--acc); border-color: var(--acc); } .pf-pic button:hover { color: var(--bad); border-color: var(--bad); } .pf-pic .ic { width: 14px; height: 14px; }
.pf-id { flex: 1; min-width: 0; } .pf-id h3 { display: flex; align-items: center; gap: 8px; font-size: 18px; text-transform: none; letter-spacing: 0; color: var(--txt); margin: 0 0 2px; }
.pf-bio { margin-top: 6px; font-size: 13px; font-style: italic; color: var(--txt); }
.pf-bio.ed { display: block; width: 100%; min-height: 32px; max-height: 120px; field-sizing: content; padding: 6px 9px; resize: none; border: 1px dashed var(--line2); border-radius: var(--r); background: transparent; font: inherit; font-size: 13px; font-style: italic; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; transition: min-height .15s; }
.pf-bio.ed:hover { border-color: var(--acc); } .pf-bio.ed:focus { min-height: 64px; font-style: normal; border-style: solid; border-color: var(--acc); background: var(--bg); outline: none; }
.pf-tabs { grid-template-columns: repeat(2, auto); justify-self: start; } .pf-tabs button { padding: 7px 16px; } .pf-tabs button.on { background: var(--acc); color: #04110c; }
.pf-h { margin: 4px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); display: flex; gap: 8px; align-items: baseline; }
.pf-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 6px; }
.pf-k { display: grid; grid-template-columns: 16px minmax(0, 1fr); column-gap: 9px; align-items: center; padding: 6px 10px; border-radius: var(--r); background: var(--panel2); border: 1px solid var(--line); }
.pf-k > .ic { grid-row: span 2; width: 16px; height: 16px; color: var(--acc); }
.pf-k b { font-size: 14px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pf-k b .mut { font-size: 11.5px; font-weight: 500; }
.pf-k small { color: var(--dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-k.zero b, .pf-k.zero > .ic { color: var(--dim); }
.pf-k.elu { border-color: color-mix(in srgb, var(--elu) 50%, transparent); } .pf-k.elu b, .pf-k.elu > .ic { color: var(--elu); }
.pf-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 5px; }
.pf-b { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: var(--r); border: 1px dashed var(--line2); color: var(--dim); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .55; filter: grayscale(1); cursor: help; }
.pf-b .ic { width: 14px; height: 14px; flex: none; }
.pf-b.on { opacity: 1; filter: none; border: 1px solid rgba(227, 162, 58, .55); color: #f2d28b; background: rgba(227, 162, 58, .1); } .pf-b.on .ic { color: #e3a23a; }
.pf-hid { display: flex; align-items: center; gap: 6px; }
.pf-priv { display: grid; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.pp-r { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 104px); align-items: center; padding: 7px 12px; font-size: 13px; } .pp-r + .pp-r { border-top: 1px solid var(--line); }
.pp-r > label, .pp-r > b { text-align: center; } .pp-r input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--acc); } .pp-r input:disabled { cursor: default; opacity: .45; }
.pp-h { background: var(--panel2); } .pp-h b { font-size: 11px; color: var(--mut); text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 600px) { .pp-r { grid-template-columns: minmax(0, 1fr) repeat(3, 64px); padding: 7px 8px; } .pp-h b { font-size: 9.5px; } }
.acc { display: grid; gap: 12px; max-width: 560px; margin: 0 auto; } .acc form { display: grid; gap: 12px; }

/* ---------- Mon compte ---------- */
#acc { display: flex; flex-direction: column; gap: 10px; }
#acc form { display: grid; gap: 10px; }
.acc-id { display: grid; gap: 8px; padding: 10px 12px; border-radius: var(--r); background: var(--panel2); border: 1px solid var(--line); }
.acc-id > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; } .acc-id small { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; min-width: 110px; }
.acc-id small.warn { color: var(--warn); text-transform: none; letter-spacing: 0; flex-basis: 100%; min-width: 0; }
.acc-links { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.err { color: var(--bad); font-size: 13px; }
.dlg { max-height: calc(100dvh - 32px); overflow-y: auto; scrollbar-width: thin; }

/* ======================================================================
   Effort de guerre compact, flottes à rôles, trajet animé, carte de run lisible, combat animé, mobile
   ====================================================================== */

/* ---------- Dons : une ligne par ressource ---------- */
.dn-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; } .dn-head h3 { margin: 0 !important; }
.dn-rate { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; color: var(--dim); font-size: 11px; } .dn-rate .cost { padding: 1px 6px; font-size: 11px; }
.dn-list { display: flex; flex-direction: column; gap: 6px; }
.dn { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(92px, auto) auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: var(--r); }
.dn-pts { font-size: 12px; text-align: right; white-space: nowrap; } .dn-pts .arrow { color: var(--dim); }
.dn-range { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #d9483b var(--v, 0%), var(--bg) var(--v, 0%)); border: 1px solid var(--line); }
.dn-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #d9483b; border: 2px solid var(--panel); box-shadow: 0 0 0 1px #d9483b; cursor: pointer; }
.dn-range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #d9483b; border: 2px solid var(--panel); cursor: pointer; }
.wstep em { color: var(--mut); }

/* ---------- Atouts : axes d'expédition, défense des colonies ---------- */
.sc.assault { --scc: #d9813a; } .sc.escort { --scc: #d35fd0; } .sc.hull { --scc: #5b9bd5; } .sc.fast { --scc: #6cc46a; } .sc.slow { --scc: #a8a29e; }
.sc.colatk { --scc: #f0a39c; } .sc.coldef { --scc: #9ad68f; }

.ep-trait { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 10px; border-radius: var(--r); background: rgba(229, 83, 75, .06); border: 1px solid rgba(229, 83, 75, .25); font-size: 13px; }
.ep-trait .sc-row { margin: 0 0 0 auto; }
.ep-axes { display: flex; flex-direction: column; gap: 6px; }
.ax { display: grid; grid-template-columns: minmax(150px, auto) 1fr auto; gap: 10px; align-items: center; font-size: 12px; }
.ax-n { display: flex; align-items: center; gap: 6px; } .ax-n small { color: var(--dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.ax-bar { position: relative; height: 8px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.ax-bar u { display: block; height: 100%; border-radius: var(--r); transition: width .3s; }
.ax-bar em { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: var(--txt); opacity: .5; }
.ax.ok .ax-bar u { background: var(--ok); } .ax.warn .ax-bar u { background: var(--warn); } .ax.bad .ax-bar u { background: var(--bad); }
.ax.ok .ax-n .ic { color: var(--ok); } .ax.warn .ax-n .ic { color: var(--warn); } .ax.bad .ax-n .ic { color: var(--bad); }
.ax-v { color: var(--mut); white-space: nowrap; } .ax-v b { color: var(--txt); }
.ep-stats > div small + small { margin-top: 2px; }
.ep-sn small { color: var(--dim); }
.btn .ic { margin-right: 4px; }

/* ---------- Trajet d'expédition animé ---------- */
.voy { display: grid; grid-template-columns: 54px 1fr 54px; gap: 8px; align-items: center; padding: 18px 8px 8px; }
.voy-end { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ok); text-align: center; } .voy-end.dest { color: #e3a23a; }
.voy-end .ic { width: 26px; height: 26px; filter: drop-shadow(0 0 8px currentColor); } .voy-end small { font-size: 10px; color: var(--mut); line-height: 1.15; }
.voy-track { position: relative; height: 40px; }
.voy-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed var(--line2); }
.voy-trail { position: absolute; left: 0; top: calc(50% - 1px); height: 2px; background: linear-gradient(90deg, transparent, #e3a23a); transition: width .4s linear; }
.voy.back .voy-trail { background: linear-gradient(90deg, var(--ok), transparent); }
.voy-ev { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line2); color: var(--mut); z-index: 1; }
.voy-ev .ic { width: 12px; height: 12px; }
.voy-ev.tl-fight, .voy-ev.tl-assault { color: #d9813a; border-color: rgba(251, 146, 60, .6); } .voy-ev.tl-retreat { color: var(--bad); border-color: var(--bad); }
.voy-ev.tl-cache { color: var(--ok); border-color: rgba(108, 196, 106, .6); } .voy-ev.tl-hazard { color: #9b7fd4; border-color: rgba(167, 139, 250, .6); }
.voy-fleet { position: absolute; top: 50%; transform: translate(-50%, -50%); display: flex; gap: 1px; z-index: 2; transition: left .4s linear; color: #f2d28b; filter: drop-shadow(0 0 6px rgba(227, 162, 58, .7)); }
.voy-fleet i { display: grid; animation: bob 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * -.3s); }
.voy-fleet .ic { width: 20px; height: 20px; transform: rotate(90deg); }
.voy.back .voy-fleet { flex-direction: row-reverse; } .voy.back .voy-fleet .ic { transform: rotate(-90deg); }
.voy-fleet::after { content: ""; position: absolute; right: 100%; top: 50%; width: 26px; height: 2px; margin-top: -1px; background: linear-gradient(270deg, rgba(227, 162, 58, .8), transparent); animation: thrust .5s linear infinite; }
.voy.back .voy-fleet::after { right: auto; left: 100%; background: linear-gradient(90deg, rgba(227, 162, 58, .8), transparent); }
@keyframes bob { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(3px); } }
@keyframes thrust { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.voy-cap { display: flex; justify-content: space-between; gap: 8px; padding: 0 8px 4px; font-size: 12px; } .voy-cap b { color: #e3a23a; }
.exp-run .tl { margin-top: 6px; } .exp-run .fi-hero { min-height: 180px; margin: 0; }
@media (prefers-reduced-motion: reduce) { .voy-fleet i, .voy-fleet::after { animation: none; } }

/* ---------- Bande passante : coût explicite ---------- */
.lo-c { display: inline-flex; align-items: center; gap: 2px; width: auto; color: #3ddc84; border-color: rgba(61, 220, 132, .45); background: rgba(61, 220, 132, .08); }
.lo-c .ic { width: 10px; height: 10px; }
.lo-i.on .lo-c { color: #04110c; background: #3ddc84; border-color: #3ddc84; }
.lo-i .lo-c, .nmap .nm-n, .voy-track .voy-ev { position: absolute; } /* l'infobulle [data-rt] les remettait dans le flux */
.lo-q .lo-c { padding: 0 6px; height: 20px; font-size: 11px; }

/* ---------- Carte du run : marges intérieures, libellés, cartes de choix ---------- */
.nmap-wrap { overflow-x: auto; overflow-y: hidden; }
.nm-l { display: flex; flex-direction: column; align-items: center; line-height: 1.15; text-align: center; }
.nm-l b { font-size: 11px; } .nm-l small { font-size: 10px; font-weight: 500; color: var(--mut); }
.nm-n.done.k-cache { color: #4fa3e0; } .nm-n.done.k-rest { color: #6cc46a; }

/* ---------- Combat : avatars, dégâts flottants, secousses ---------- */
.fighter { position: relative; flex-direction: row; align-items: center; gap: 12px; overflow: visible; }
.f-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.f-av { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--acc); background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--acc) 30%, transparent), transparent 70%), var(--bg); border: 2px solid color-mix(in srgb, var(--acc) 60%, transparent); box-shadow: 0 0 18px color-mix(in srgb, var(--acc) 25%, transparent); }
.f-av .ic { width: 28px; height: 28px; }
.fighter.foe .f-av { color: var(--bad); border-color: rgba(229, 83, 75, .6); background: radial-gradient(circle at 40% 35%, rgba(229, 83, 75, .3), transparent 70%), var(--bg); box-shadow: 0 0 18px rgba(229, 83, 75, .25); animation: idle 2.4s ease-in-out infinite; }
.fighter.foe.pod .f-av { color: #a98be0; border-color: rgba(192, 132, 252, .6); }
.fighter.foe.boss .f-av, .fighter.foe.elite .f-av { width: 62px; height: 62px; }
.fighter.me.low .f-av { animation: lowhp 1s ease-in-out infinite; }
@keyframes idle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes lowhp { 0%, 100% { box-shadow: 0 0 0 0 rgba(229, 83, 75, .6); } 50% { box-shadow: 0 0 0 8px rgba(229, 83, 75, 0); } }
.hpbar { position: relative; }
.hpbar u { position: relative; z-index: 1; }
.hpbar u.ghost { position: absolute; inset: 0 auto 0 0; z-index: 0; background: rgba(253, 230, 138, .55) !important; transition: width .7s ease .25s; }
.fighter.hit { animation: hit .35s ease; } .fighter.crit-hit { animation: hit .5s ease; box-shadow: 0 0 0 2px #f2d28b, 0 0 30px rgba(253, 230, 138, .45); }
.fighter.hurt { animation: hurt .35s ease; }
@keyframes hit { 0%, 100% { transform: none; } 20% { transform: translateX(6px); } 45% { transform: translateX(-5px); } 70% { transform: translateX(3px); } }
@keyframes hurt { 0%, 100% { transform: none; background-color: var(--panel2); } 25% { transform: translateX(-5px); background-color: rgba(229, 83, 75, .18); } 60% { transform: translateX(4px); } }
.fdmg { position: absolute; left: calc(50% + var(--dx, 0px)); top: 10px; z-index: 5; pointer-events: none; font-weight: 800; font-size: 20px; text-shadow: 0 2px 8px #000; white-space: nowrap; animation: float 1.1s ease-out forwards; }
.fdmg.hit { color: #f2d28b; } .fdmg.crit { color: #e3a23a; font-size: 26px; } .fdmg.hurt { color: var(--bad); } .fdmg.heal { color: var(--ok); }
.fdmg.dodge, .fdmg.shield { color: #7fd8a8; font-size: 15px; letter-spacing: .08em; top: 34px; }
@keyframes float { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.7); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -42px) scale(1); } }
.actbtn { position: relative; overflow: hidden; display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; }
.ab-i { grid-row: 1 / 3; width: 30px; height: 30px; border-radius: var(--r); display: grid; place-items: center; background: rgba(255, 255, 255, .06); } .ab-i .ic { width: 17px; height: 17px; }
.actbtn.main .ab-i { background: rgba(4, 17, 12, .15); }
.ab-cd { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; } .ab-cd u { display: block; height: 100%; width: 0; background: #3ddc84; }
.actbtn:active:not(:disabled) { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { .fighter, .f-av, .fdmg { animation: none !important; } }

/* ---------- Tutoriel : bouton du guide bien visible ---------- */
.obj-guide { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: var(--r); border: 1px solid rgba(227, 162, 58, .55); background: rgba(227, 162, 58, .08); color: #f2d28b; font-size: 13px; font-weight: 600; cursor: pointer; }
.obj-guide:hover { background: rgba(227, 162, 58, .16); }
.obj-guide.on { background: #e3a23a; border-color: #e3a23a; color: #1a1300; }
.og-sw { position: relative; width: 26px; height: 14px; border-radius: var(--r); background: rgba(0, 0, 0, .35); flex: none; }
.og-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #f2d28b; transition: left .15s; }
.obj-guide.on .og-sw { background: rgba(26, 19, 0, .35); } .obj-guide.on .og-sw::after { left: 14px; background: #1a1300; }

/* ---------- Mobile : une vraie application (onglets en bas, en-tête compact) ---------- */
@media (max-width: 800px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  #app { padding: 6px 6px 0; gap: 6px; }
  .topbar { padding: 8px 10px; gap: 8px; border-radius: 0 0 12px 12px; margin: -6px -6px 0; }
  .topbar .tools { flex-wrap: nowrap; gap: 4px; } .who { margin-right: 0; }
  .brand { font-size: 13px; }
  .badge { top: 0; right: calc(50% - 22px); }
  .resbar { grid-row: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .chip { padding: 4px 6px 7px; gap: 6px; border-radius: var(--r); }
  .chip .tile { width: 22px; height: 22px; border-radius: var(--r); } .chip .tile .ic { width: 13px; height: 13px; }
  .chip b { font-size: 13px; } .chip small { font-size: 9.5px; } .chip .cn { display: none; }
  .chip .bar { left: 6px; right: 6px; bottom: 2px; height: 2px; }
  .who { padding: 3px 9px; font-size: 12px; } #logToggle { padding: 4px 9px; }
  .objective { gap: 6px; }
  .obj-tuto, .obj-goal { padding: 8px 10px; }
  .ot-head { flex-wrap: wrap; gap: 6px 8px; } .ot-bar { order: 5; flex-basis: 100%; max-width: none; }
  /* tutoriel en bulle : ne pousse plus la page vers le bas, se replie en une pastille */
  #objTuto { position: fixed; left: 10px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 30; width: min(340px, calc(100vw - 20px)); max-height: 55dvh; overflow-y: auto; background: var(--panel); box-shadow: 0 12px 34px rgba(0, 0, 0, .65); }
  #objTuto .ot-head { cursor: pointer; } .ot-fold { display: inline; margin-left: auto; color: #e3a23a; }
  #objTuto.min { width: auto; padding: 8px 12px; } #objTuto.min > :not(.ot-head) { display: none; }
  .ot-why { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .obj-goal { grid-template-columns: 1fr 1fr !important; }
  .center { border-radius: var(--r); }
  .panel { padding: 10px; }
  .vhead h2 { font-size: 16px; }
  .btn { padding: 9px 14px; } .btn.sm { padding: 7px 11px; }
  .ax { grid-template-columns: 1fr auto; } .ax-bar { grid-column: 1 / -1; grid-row: 2; }
  .ep-trait .sc-row { margin: 0; }
  .ep-ship { grid-template-columns: 34px 1fr; } .ep-q { grid-column: 1 / -1; justify-content: flex-end; }
  .dn { grid-template-columns: 26px minmax(0, 1fr) auto; } .dn-pts { grid-column: 2; grid-row: 2; text-align: left; } .dn .btn { grid-column: 3; grid-row: 1 / 3; }
  .voy { grid-template-columns: 40px 1fr 40px; padding: 14px 0 6px; } .voy-end small { display: none; }
  .duel { gap: 8px; } .fighter { padding: 10px; } .f-av { width: 44px; height: 44px; } .f-av .ic { width: 22px; height: 22px; }
  .actgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .actbtn.main { grid-column: 1 / -1; }
  .actbtn { padding: 10px; } .actbtn small { font-size: 10.5px; }
  /* carte du run : tient dans la largeur de l'écran, sans défilement horizontal ; les choix détaillés sont dans les cartes dessous */
  .arena-top .btn { width: 100%; }
  .m-go-in { flex-wrap: wrap; } .m-go-in .btn { width: 100%; justify-content: center; }
  .col.right.open { top: auto; bottom: calc(70px + env(safe-area-inset-bottom)); left: 6px; right: 6px; width: auto; max-height: 70vh; box-shadow: 0 -12px 40px rgba(0, 0, 0, .6); border-radius: var(--r); }
  #toasts { bottom: auto; top: calc(10px + env(safe-area-inset-top)); } /* en haut : ne masque pas le menu du bas */
  .toast { animation-name: toast-top; }
  .modal { align-items: end; padding: 0; } .dlg { width: 100%; border-radius: var(--r) 16px 0 0; max-height: calc(var(--vvh, 100dvh) * .88); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .quest { gap: 8px 12px; padding: 10px 12px; } .quest .act .btn { width: 100%; }
  .wsteps { gap: 2px; } .wstep span { font-size: 10px; }
  .war-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Infobulles : rendues seulement au survol (invisibles mais présentes, elles élargissaient la page sur mobile) */

/* ======================================================================
   Identité « résistance souterraine » : typo technique, angles vifs, coins de HUD,
   boutons biseautés, palette rouille / ambre / phosphore. Pas de liserés colorés ni d'arrondis.
   ====================================================================== */
:root {
  --r: 3px;
  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fd: 'Chakra Petch', 'Barlow', system-ui, sans-serif; /* titres, boutons, chiffres */
  --scrap: #d9813a; --code: #4fa3e0; --cells: #9fc23a; --energy: #e8c13a; --pop: #a98be0; --bits: #d35fd0; --war: #e5534b;
  --ok: #6cc46a; --warn: #e3a23a; --bad: #e5534b;
}
body[data-mode=zion] { --acc: #e09a3a; }
body[data-mode=war] { --acc: #d9483b; }
body[data-mode=matrix] { --acc: #3ddc84; }
body[data-mode=map] { --acc: #7aa7c7; }
body[data-mode=alliance] { --acc: #9b7fd4; }
body[data-mode=friends] { --acc: #d97aa5; }
body[data-mode=rank] { --acc: #d4b24c; }
body { font-size: 14.5px; }
/* téléphones en mode sombre forcé (Chrome, Samsung Internet) : le jeu est déjà sombre, sans ceci ses couleurs étaient inversées (jaunes affichés rouges) */
:root { color-scheme: dark; }
h2, h3, h4, .brand, .navi, .big, .lvl, .obj-tag, .stat b, .verdict, .chip b, .chip .cn, .crew-big, .rs-v b, .auth-box h1, .tag, .pill, .ot-text, .mw-name, .ar-time { font-family: var(--fd); }
h3 { letter-spacing: .1em; color: var(--dim); }
h2 { letter-spacing: .02em; }

/* Panneaux : coins de HUD à la couleur du mode, au lieu de bords arrondis et lumineux */
.glass { position: relative; border-radius: 0; box-shadow: inset 0 1px 0 rgba(255, 230, 200, .05), 0 8px 24px rgba(0, 0, 0, .4); }
.glass::before { content: ''; position: absolute; inset: -1px; pointer-events: none; opacity: .75;
  background:
    linear-gradient(var(--acc), var(--acc)) top left / 12px 2px, linear-gradient(var(--acc), var(--acc)) top left / 2px 12px,
    linear-gradient(var(--acc), var(--acc)) top right / 12px 2px, linear-gradient(var(--acc), var(--acc)) top right / 2px 12px,
    linear-gradient(var(--acc), var(--acc)) bottom left / 12px 2px, linear-gradient(var(--acc), var(--acc)) bottom left / 2px 12px,
    linear-gradient(var(--acc), var(--acc)) bottom right / 12px 2px, linear-gradient(var(--acc), var(--acc)) bottom right / 2px 12px;
  background-repeat: no-repeat; }
.obj-tuto.glass::before { --acc: #e3a23a; }

/* Boutons biseautés, libellés en capitales */
.btn { font-family: var(--fd); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; border-radius: 0;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.btn.sm { clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px); }
.btn.alt { background: rgba(255, 230, 200, .04); }
.btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--txt); }
/* Bande de prix au-dessus du bouton : une case par ressource + la durée, sur une ou deux lignes selon la largeur */
.price { display: grid; grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)); gap: 2px; padding: 2px; background: rgba(0, 0, 0, .5); border: 1px solid var(--line); }
.price:empty { display: none; }
.dtext .price { width: 100%; margin: 4px 0 10px; }
.price .cost, .price .mchip { justify-content: center; padding: 4px 2px; gap: 4px; font: 600 11px/1 var(--fd); letter-spacing: .02em; background: rgba(255, 255, 255, .03); border: 0; border-radius: 0; white-space: nowrap; }
.price .mchip { color: var(--txt); } .price .ic { flex: none; }
.ghost { border-radius: 0; font-family: var(--fd); text-transform: uppercase; letter-spacing: .05em; }

/* Plus de liserés colorés à gauche : la couleur passe dans une étiquette ou un fond */
.objective, .obj-tuto, .obj-goal, .quest, .hall, .grow-r.player, .toast.good, .toast.warn, .lastrun { border-left-width: 1px !important; }
.quest, .hall, .obj-tuto, .obj-goal { border-left-color: var(--line) !important; }
.quest.ready { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)) !important; background: linear-gradient(90deg, color-mix(in srgb, var(--ok) 9%, transparent), transparent 60%), var(--panel2); }
.room.built { border-top-width: 1px; border-top-color: var(--line); }
.room.built::after { content: ''; position: absolute; top: 0; left: 0; border: 6px solid transparent; border-top-color: var(--rc); border-left-color: var(--rc); }
.rs-i { border-radius: var(--r); box-shadow: none; }
.thumb .ic { filter: none; opacity: .8; }
.dot, .sdot { border-radius: 0; transform: rotate(45deg); }

/* ---------- Illustrations (bandeaux 4:1, fournis dans assets/img/<type>/<id>) ---------- */
.thumb { height: auto; aspect-ratio: 4 / 1; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb.has-img .ic, .thumb.has-img .th-grid { display: none; }
:not(.card) > .thumb:not(.has-img) { display: none; } /* hors des cartes, rien tant que l'image n'est pas fournie */
:not(.card) > .thumb.has-img { border: 1px solid var(--line); margin: 0 0 10px; }
.t-ship { --tc: #5b9bd5; } .t-tech { --tc: #9b7fd4; } .t-up { --tc: #3ddc84; } .t-job { --tc: #a98be0; }

/* ---------- Défense ---------- */
.def-alerts .callout { flex-wrap: wrap; } .def-alerts .callout > span:nth-of-type(1) { flex: 1; min-width: 110px; } /* EMP et débris : texte, ressources, bouton à droite */
.room.off { background: repeating-linear-gradient(135deg, rgba(229, 83, 75, .09) 0 6px, transparent 6px 12px), #1d1712; }
.room.off .out { color: var(--bad); }
.cost.war, .gain.war { --rc: var(--war); } .c-war, .dn-go .c-war { color: var(--war); }

/* Rôle des vaisseaux */
.pill.role { cursor: help; color: var(--txt); padding: 1px 8px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.ep-sn .pill.role { align-self: flex-start; margin-top: 2px; }

/* ---------- En cours : événements (bonus et incidents) ---------- */
.actrow.ev { padding-top: 22px; cursor: default; }
.ev-tag { position: absolute; top: 5px; left: 9px; font: 700 9.5px var(--fd); letter-spacing: .12em; text-transform: uppercase; }
.actrow.ev-good { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: linear-gradient(90deg, color-mix(in srgb, var(--ok) 10%, transparent), transparent 70%), var(--panel2); }
.actrow.ev-bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: linear-gradient(90deg, color-mix(in srgb, var(--bad) 10%, transparent), transparent 70%), var(--panel2); }
.actrow.ev-good .ic, .actrow.ev-good .ev-tag, .actrow.ev-good .ar-time { color: var(--ok); } .actrow.ev-good .ar-bar u { background: var(--ok); }
.actrow.ev-bad .ic, .actrow.ev-bad .ev-tag, .actrow.ev-bad .ar-time { color: var(--bad); } .actrow.ev-bad .ar-bar u { background: var(--bad); }
.actrow.ev:hover { border-color: inherit; }
.actrow.ev-good:hover { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); } .actrow.ev-bad:hover { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }


/* ---------- Sous-sol : front de taille ---------- */
.digrow { position: relative; display: block; padding: 0; background: none; border-top: 2px solid #2a2017; min-height: 78px; overflow: hidden; }
.dig-scene { position: absolute; inset: 0; }
.drill { position: absolute; right: 36px; top: 50%; transform: translateY(-50%) rotate(-90deg); color: #e3a23a; }
.drill .ic { width: 34px; height: 34px; }
.digrow.busy .drill { animation: drillshake .16s linear infinite; }
.digrow.busy .dig-scene::after { content: ''; position: absolute; right: 18px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: #f2d28b; box-shadow: 0 0 12px 6px rgba(242, 210, 139, .5); animation: thrust .3s linear infinite; }
@keyframes drillshake { 0%, 100% { transform: translateY(-50%) rotate(-90deg) translateX(0); } 50% { transform: translateY(-50%) rotate(-90deg) translateX(2px); } }
.dig-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0, 0, 0, .45); } .dig-prog u { display: block; height: 100%; width: 0; background: #e3a23a; }
.dig-ctl { position: relative; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 90px 18px 14px; background: linear-gradient(90deg, rgba(14, 10, 7, .85), rgba(14, 10, 7, .55) 55%, transparent); }

/* ---------- Carte : coupe du secteur ---------- */
.galtable { display: block; }
.sector { border: 1px solid var(--line); overflow: hidden; background: #120d09; }
/* --heat : 0 (strate 1) → 3 (roche dure), la bande se réchauffe avec la profondeur */
.sec-layer { --hc: color-mix(in srgb, var(--energy) calc(25% + var(--heat) * 25%), var(--dim)); border-bottom: 2px solid #2a2017; background: repeating-linear-gradient(176deg, rgba(160, 110, 70, .05) 0 3px, transparent 3px 16px); }
.sec-hd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 12px; border-bottom: 1px solid #2a2017;
  background: linear-gradient(90deg, color-mix(in srgb, var(--hc) calc(6% + var(--heat) * 6%), transparent), transparent 70%); box-shadow: inset 3px 0 0 var(--hc); }
.sec-hd b { font: 600 11px var(--fd); letter-spacing: .16em; text-transform: uppercase; color: var(--mut); }
.sec-e { display: inline-flex; align-items: center; gap: 4px; font: 600 11.5px var(--fd); color: var(--hc); } .sec-e .ic { width: 13px; height: 13px; }
.sec-x { font-size: 11.5px; color: var(--mut); }
.sec-layer.deep { background: linear-gradient(180deg, #1a130e, #2e1c11); border-bottom: 0; } .sec-layer.deep .sec-hd b { color: #d6a46b; }
.cavs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 10px; }
.sec-layer.deep .cavs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cav { position: relative; display: flex; flex-direction: column; gap: 3px; min-height: 124px; padding: 10px 10px 8px; text-align: left; color: var(--txt); border: 1px solid var(--line); border-radius: var(--r);
  background: radial-gradient(120% 90% at 50% 125%, color-mix(in srgb, var(--tc) 20%, transparent), transparent 70%), #1d1712; background-size: cover; background-position: center; }
.cav-n { position: absolute; top: 4px; right: 8px; font: 700 20px var(--fd); color: rgba(255, 230, 200, .1); }
.cav b { font-size: 13.5px; padding-right: 26px; line-height: 1.2; overflow-wrap: anywhere; }
.cav small { color: var(--mut); font-size: 12px; } .cav small::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; background: var(--tc); transform: rotate(45deg); }
.cav-b { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; } .cav-b .gain { font-size: 11.5px; }
.cav-go { font: 600 11px var(--fd); text-transform: uppercase; letter-spacing: .07em; color: var(--acc); }
.cav.free { cursor: pointer; border-style: dashed; background-color: rgba(0, 0, 0, .25); opacity: .55; filter: grayscale(.75) brightness(.8); transition: border-color .12s, opacity .12s, filter .12s; }
.cav.free b { color: var(--mut); font-weight: 500; } .cav.free:hover { border-color: var(--acc); border-style: solid; opacity: 1; filter: none; }
.cav.free.shut { opacity: .3; } .cav.free.shut .cav-go { color: var(--dim); }
.cav.player, .cav.pending { box-shadow: inset 3px 0 0 var(--tc), 0 6px 16px rgba(0, 0, 0, .45); }
.cav.player { border-color: var(--line2); } .cav-hab { color: var(--tc); } .cav-hab .ic { width: 18px; height: 18px; }
.cav.player.me { border-color: color-mix(in srgb, var(--acc) 70%, var(--line)); background-color: color-mix(in srgb, var(--acc) 8%, #1d1712); }
.cav.player.ally { border-color: color-mix(in srgb, var(--ok) 60%, var(--line)); }
.cav.pending { border-style: dashed; }
.cav-own { font-size: 12px; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.cav-who { position: absolute; top: 7px; right: 7px; z-index: 1; padding: 1px 8px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.cav-who:not(.ok) { color: var(--acc); border-color: color-mix(in srgb, var(--acc) 50%, transparent); }
.cav-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--tc); box-shadow: 0 0 6px var(--tc); vertical-align: 1px; }
.cav-act { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; }
.cav-act .btn, .cav-intel { white-space: normal; max-width: 100%; line-height: 1.4; text-align: left; }
.cav-intel { align-self: flex-start; color: var(--acc); }
.cav.player b + .cav-own { margin-top: auto; } .cav-act + .cav-own { margin-top: 2px; }

/* ---------- Matrice : libellés au bord de la carte, espace avant le dernier run ---------- */
.exp + .run-last, .exp-dest + .run-last { margin-top: 24px; }
.run-last { margin-top: 24px; }

@media (max-width: 800px) {
  .cavs, .sec-layer.deep .cavs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dig-ctl { padding-right: 70px; } .drill { right: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .digrow.busy .drill, .digrow.busy .dig-scene::after, .r-sheet, .r-dest { animation: none; }
}

/* Journal : un repère en losange au lieu d'un liseré coloré ; accent par défaut (écran de connexion) */
:root { --acc: #e09a3a; }
.log li { border-left: 0; padding-left: 14px; position: relative; }
.log li::before { content: ''; position: absolute; left: 2px; top: 11px; width: 6px; height: 6px; background: var(--line2); transform: rotate(45deg); }
.log li.good::before { background: var(--ok); } .log li.warn::before { background: var(--warn); }

/* Alerte : serveur lancé avec un code plus ancien que l'interface */
.stale-srv { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 200; width: min(640px, calc(100vw - 24px)); padding: 12px 16px; background: #3a1512; border: 1px solid var(--bad); color: var(--txt); font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.stale-srv b { color: var(--bad); font-family: var(--fd); text-transform: uppercase; letter-spacing: .05em; margin-right: 6px; }

/* ======================================================================
   Disposition HUD : ressources en haut, menu à gauche, jeu au centre, infos à droite.
   Tout le menu est de premier niveau (plus de sous-onglets) ; les couleurs disent le royaume :
   ambre = colonies, rouge = guerre, vert = Matrice, violet = social.
   ====================================================================== */
:root { --navw: 226px; --rightw: 296px; }
body[data-mode=orders] { --acc: #d4b24c; }
.navi[data-mode=zion] { --acc: #e09a3a; } .navi[data-mode=map] { --acc: #7aa7c7; } .navi[data-mode=war] { --acc: #d9483b; } .navi[data-mode=matrix] { --acc: #3ddc84; }
.navi[data-mode=orders], .navi[data-mode=rank] { --acc: #d4b24c; } .navi[data-mode=alliance] { --acc: #9b7fd4; } .navi[data-mode=friends] { --acc: #d97aa5; }

#app { padding: 10px; gap: 10px; }

/* En-tête : marque | ressources | compte, sur une seule ligne */
.topbar { display: grid; grid-template-columns: calc(var(--navw) - 16px) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 14px; }
.topbar .brand { font-size: 18px; letter-spacing: .14em; white-space: nowrap; }
.topbar .resbar { grid-row: 1; grid-column: 2; }
.topbar .tools { grid-row: 1; grid-column: 3; }
.chip { padding: 5px 10px 9px 7px; gap: 8px; }

/* Grille : menu | jeu | objectifs puis informations */
.layout { display: grid; gap: 0 10px; grid-template-columns: var(--navw) minmax(0, 1fr) var(--rightw); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "nav center obj" "nav center right"; }
.side { grid-area: nav; } .center { grid-area: center; } .objective { grid-area: obj; } .right { grid-area: right; }
.panel { padding: 18px 22px 26px; }

/* Menu de gauche */
.side { display: flex; flex-direction: column; padding: 12px 8px; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
/* Le menu défile : ses coins de HUD sont dans son fond (fixe, sous les entrées), pas dans le ::before qui défilait par-dessus le menu */
.side::before { display: none; }
.side { --cc: color-mix(in srgb, var(--acc) 75%, transparent);
  background: linear-gradient(var(--cc), var(--cc)) top left / 12px 2px no-repeat border-box, linear-gradient(var(--cc), var(--cc)) top left / 2px 12px no-repeat border-box,
    linear-gradient(var(--cc), var(--cc)) top right / 12px 2px no-repeat border-box, linear-gradient(var(--cc), var(--cc)) top right / 2px 12px no-repeat border-box,
    linear-gradient(var(--cc), var(--cc)) bottom left / 12px 2px no-repeat border-box, linear-gradient(var(--cc), var(--cc)) bottom left / 2px 12px no-repeat border-box,
    linear-gradient(var(--cc), var(--cc)) bottom right / 12px 2px no-repeat border-box, linear-gradient(var(--cc), var(--cc)) bottom right / 2px 12px no-repeat border-box,
    linear-gradient(180deg, rgba(255, 230, 200, .025), transparent 40%), var(--panel); }
.nav-sec { display: flex; flex-direction: column; gap: 1px; }
.nav-sec + .nav-sec { margin-top: 12px; }
.nav-sec h4 { display: flex; align-items: center; gap: 8px; padding: 0 10px 5px; font: 700 10px/1 var(--fd); letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
.nav-sec h4::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.navi { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; background: none; border: 0; border-radius: 0; color: var(--mut); text-align: left; font: 600 13px/1.2 var(--fd); letter-spacing: .05em; text-transform: uppercase; transition: background .12s, color .12s; }
.navi .ic { width: 18px; height: 18px; color: var(--acc); opacity: .8; }
.navi span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navi:hover { background: rgba(255, 230, 200, .05); color: var(--txt); }
.navi.locked { opacity: .45; filter: grayscale(1); cursor: help; }
.navi.on { background: var(--acc); color: #130d07; }
.navi.on .ic { color: inherit; opacity: 1; }
.navi .badge { position: static; margin-left: auto; box-shadow: none; flex: none; }
.navi[data-mode=zion] .badge { background: #6cc46a; color: #04110c; }
.navi.on .badge { background: #130d07; color: var(--acc); }
.nav-caret { margin-left: auto; }
.nav-chat { margin: 3px 0 6px 18px; padding-left: 8px; border-left: 1px solid var(--line2); }
.nav-chat .navi { padding: 7px 6px; font-size: 11px; text-transform: none; letter-spacing: 0; }
.nav-chat .navi .ic { width: 14px; height: 14px; }
.nav-chat .navi.on { background: transparent; color: var(--acc); font-weight: 700; }
.nav-chat .navi.on .ic { color: var(--acc); }
.nav-chat .navi.on .badge { background: color-mix(in srgb, var(--acc) 18%, transparent); color: var(--acc); }
/* Bloc épinglé en haut du menu : Colonies et la liste des colonies (un clic change de colonie sans quitter la page) */
.nav-home { position: sticky; top: -10px; z-index: 2; margin: -10px -6px 12px; padding: 10px 6px; /* laisse voir les coins du menu */ background: var(--panel); border-bottom: 1px solid var(--line2); box-shadow: 0 8px 16px -10px rgba(0, 0, 0, .7); }
.nav-cols { display: flex; flex-direction: column; gap: 3px; }
.navcol { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--panel2); border: 1px solid var(--line); color: var(--mut); font-size: 13px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navcol:hover { color: var(--txt); background: rgba(255, 230, 200, .05); }
.navcol.on { color: var(--txt); border-color: var(--acc); background: color-mix(in srgb, var(--acc) 12%, var(--panel2)); }
.navcol .dot { width: 7px; height: 7px; }

/* Colonne de droite : objectifs en haut, puis ce qui est en cours et le journal */
.objective { display: flex; flex-direction: column; gap: 10px; align-self: start; }
.objective:not([hidden]) { margin-bottom: 10px; }
.obj-tuto { padding: 12px 14px; gap: 6px; }
.ot-head { justify-content: space-between; }
.ot-bar { width: 100%; max-width: none; flex: none; }
.ot-text { font-size: 15px; line-height: 1.3; }
.ot-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.ot-row .obj-go { margin-left: auto; }
.obj-guide { padding: 3px 10px; font-size: 11px; gap: 6px; }
.obj-goal { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }
.og + .og { padding-top: 10px; border-top: 1px solid var(--line); }
.right .block { padding: 12px 14px; }

/* Volet de droite (objectifs, en cours, journal) : une barre au-dessus de la colonne le replie ; replié, il ne reste qu’un rail fin qui le rouvre (grand écran) */
.side-tog { display: none; }
@media (min-width: 1181px) {
  .layout { transition: grid-template-columns .22s ease; grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "nav center tog" "nav center obj" "nav center right"; }
  .side-tog { grid-area: tog; display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 8px; padding: 5px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2);
    color: var(--dim); font: 700 10px/1 var(--fd); letter-spacing: .14em; text-transform: uppercase; }
  .side-tog::before { content: 'Réduire le volet'; } .side-tog::after { content: '»'; font-size: 15px; line-height: 10px; color: var(--acc); }
  .side-tog:hover { color: var(--txt); border-color: var(--acc); }
  body.side-closed .layout { grid-template-columns: var(--navw) minmax(0, 1fr) 30px; grid-template-areas: "nav center tog" "nav center tog" "nav center tog"; }
  body.side-closed .side-tog { flex-direction: row; justify-content: center; margin: 0; padding: 10px 0; writing-mode: vertical-rl; }
  body.side-closed .side-tog::before { content: 'Objectifs · En cours · Journal'; } body.side-closed .side-tog::after { content: '«'; writing-mode: horizontal-tb; }
  body.side-closed :is(.objective, .right) { display: none !important; }
}
@media (min-width: 1181px) { #logToggle { display: none; } }

/* Écrans moyens : le menu reste à gauche, objectifs et « En cours » côte à côte au-dessus du jeu, le journal seul monte du bas (bouton avec icône) ;
   les ressources passent sur leur propre ligne, sous la marque, pour ne plus être écrasées entre la marque et les outils */
@media (max-width: 1180px) {
  .layout { grid-template-columns: var(--navw) minmax(0, 1fr); grid-template-areas: "nav obj" "nav center"; }
  .objective { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-self: stretch; }
  .objective:not([hidden]) .obj-goal { flex-direction: row; }
  .objective .block { padding: 10px 12px; } .objective .act-box h3 { margin-bottom: 6px; }
  .og + .og { padding: 0 0 0 10px; border: 0; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .topbar .tools { grid-column: 2; }
  .topbar .resbar { grid-row: 2; grid-column: 1 / -1; }
  .col.right.open { display: flex; top: auto; bottom: 12px; left: calc(var(--navw) + 22px); right: 12px; width: auto; max-height: 60vh; padding: 10px; background: var(--panel); border: 1px solid var(--line2); box-shadow: 0 -12px 40px rgba(0, 0, 0, .6); border-radius: var(--r); animation: sheetUp .26s cubic-bezier(.2, .8, .2, 1); }
  #logToggle { display: inline-flex; align-items: center; } #logToggle .ic { width: 18px; height: 18px; }
  .col.right.open { padding-top: 46px; } .col.right.open #logClose { top: 8px; right: 8px; }
}
#logClose { display: none; } @media (max-width: 1180px) { .col.right.open #logClose { display: grid; } }
@media (max-width: 1000px) {
  .topbar .resbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .objective { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .obj-tuto { grid-column: 1 / -1; }
  .obj-goal[hidden] + .act-box { grid-column: 1 / -1; }
}

/* Mobile : le menu devient une barre en bas, les objectifs restent au-dessus du jeu */
@media (max-width: 800px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; grid-template-areas: "obj" "center"; }
  .panel { padding: 12px 8px 20px; } .floor { padding: 4px 4px 8px; } /* téléphone : la largeur va aux cartes, pas aux marges */
  .side { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; flex-direction: row; gap: 0; padding: 4px 2px calc(4px + env(safe-area-inset-bottom)); overflow-x: auto; overflow-y: hidden;
    border: 0; border-top: 1px solid var(--line2); background: rgba(23, 18, 14, .97); backdrop-filter: blur(8px); box-shadow: 0 -8px 24px rgba(0, 0, 0, .45); }
  .side::before { display: none; }
  .nav-sec { flex-direction: row; } .nav-sec + .nav-sec { margin-top: 0; }
  .nav-sec h4, .nav-cols { display: none; }
  .nav-home { display: none; } /* mobile : la liste des colonies est masquée, on change de colonie depuis les tuiles des pages */
  .navi { flex: 1 0 58px; flex-direction: column; justify-content: center; gap: 2px; width: auto; padding: 6px 2px; font-size: 9.5px; letter-spacing: .02em; text-align: center; }
  .navi .ic { width: 22px; height: 22px; }
  .navi.on { background: color-mix(in srgb, var(--acc) 16%, transparent); color: var(--acc); }
  .navi .badge { position: absolute; top: 0; right: calc(50% - 22px); margin: 0; }
  .nav-chat { display: flex; gap: 2px; margin: 0; padding: 0; border-left: 0; }
  .nav-chat .navi { flex-basis: 74px; padding: 6px 3px; font-size: 9.5px; }
  .nav-chat .navi .ic { width: 20px; height: 20px; }
  .nav-caret { display: none; }
  .topbar { padding: 8px 10px; gap: 8px; }
  .topbar .brand { font-size: 12px; letter-spacing: .08em; }
  .topbar .tools { flex-wrap: nowrap; gap: 4px; }
  .objective { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .objective:not([hidden]) { margin-bottom: 6px; }
  .objective:not(:has(.obj-tuto:not([hidden]))) { display: none; margin: 0; } /* sans tutoriel, il ne reste rien dans la page : tout est dans le panneau du journal */
  .col.right.open { left: 6px; right: 6px; bottom: calc(70px + env(safe-area-inset-bottom)); max-height: 72vh; overflow-y: auto; }
  .right .obj-goal { flex: none; } .right .obj-goal:not([hidden]) { display: grid; }
  .obj-tuto, .obj-goal { padding: 8px 10px; }
  .ot-text { font-size: 14px; }
  .obj-goal { gap: 8px; }
  .og .mw-name { font-size: 12px; }
}

/* ---------- Ordres et succès : rouge = monde réel, vert = Matrice ---------- */
.ord { --oc: var(--war); }
.ord.ord-mx { --oc: #3ddc84; }
.ord + .ord { margin-top: 28px; }
.ord .vhead { margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid color-mix(in srgb, var(--oc) 45%, var(--line)); }
.ord .vhead h3 { margin: 0; color: var(--oc); }
.ord .q-badge { color: var(--oc); background: color-mix(in srgb, var(--oc) 12%, transparent); border-color: color-mix(in srgb, var(--oc) 55%, transparent); }
.ord .q-bar .prog u { background: var(--oc); }
.ord .quest.ready { border-color: color-mix(in srgb, var(--oc) 60%, var(--line)) !important; background: linear-gradient(90deg, color-mix(in srgb, var(--oc) 10%, transparent), transparent 60%), var(--panel2); }

/* ---------- Réseau intégré à la page Colonies ---------- */

/* ---------- Notifications : gains (+) et pertes (−) de ressources ---------- */
.toast { display: flex; align-items: center; gap: 12px; width: max-content; } /* sans ça, left:50% de #toasts réduit la largeur disponible et le texte se tasse en colonne étroite */
.t-fx { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.dl { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; font: 700 12px/1.4 var(--fd); background: color-mix(in srgb, var(--rc, var(--mut)) 14%, transparent); }
.dl .ic { width: 1em; height: 1em; color: var(--rc); }
.dl.plus { color: var(--ok); } .dl.minus { color: var(--bad); }
.dl.scrap { --rc: var(--scrap); } .dl.code { --rc: var(--code); } .dl.cells { --rc: var(--cells); } .dl.bits { --rc: var(--bits); }

/* ---------- Fenêtre ouverte : pas de flou d'arrière-plan (recalculé à chaque image du décor animé) ---------- */
.modal { backdrop-filter: none; background: rgba(10, 7, 5, .84); }
body:has(.modal:not([hidden])) :is(.digrow.busy .drill, .hl) { animation-play-state: paused; }

/* ---------- Page Colonies : compteur et autres colonies en petit, puis la colonie active en héros pleine largeur ---------- */
.colbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 10px; }
.ch-count { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; background: var(--panel2); border: 1px solid var(--line); color: var(--mut); font-size: 12px; }
.ch-count .ic { width: 15px; height: 15px; color: var(--dim); }
.ch-count b { font: 700 14px/1 var(--fd); letter-spacing: .06em; color: var(--txt); }
button.ch-count { cursor: pointer; } button.ch-count:hover { border-color: var(--acc); color: var(--txt); }
.ch-count.free { border-style: dashed; border-color: color-mix(in srgb, var(--acc) 55%, transparent); } .ch-count.free .ic:last-child { color: var(--acc); }
.ch-net { display: inline-flex; align-items: center; gap: 6px; font: 700 12px/1 var(--fd); letter-spacing: .06em; text-transform: uppercase; color: var(--ok); }
.ch-net .ic { width: 15px; height: 15px; } .ch-net.off { color: var(--dim); }
.cminis { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.cmini { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 130px; max-width: 200px; padding: 6px 10px; overflow: hidden; text-align: left; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); cursor: pointer; }
.cmini:hover { border-color: var(--acc); }
.cmini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .22; pointer-events: none; transition: opacity .15s; }
.cmini:hover img { opacity: .4; }
.cmini > :not(img) { position: relative; }
.cmini b { display: flex; align-items: center; gap: 6px; font: 600 13px/1.2 var(--fd); letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmini .dot { width: 7px; height: 7px; } .cmini .dot.idle { background: var(--warn); } .cmini .dot.busy { background: var(--ok); }
.cmini span { display: flex; gap: 8px; font-size: 11px; font-weight: 600; color: var(--mut); }
.cmini em { display: inline-flex; align-items: center; gap: 3px; font-style: normal; } .cmini em .ic { width: 11px; height: 11px; } .cmini em b { font: inherit; color: var(--txt); }
.cmini em.scrap { color: var(--scrap); } .cmini em.cells { color: var(--cells); } .cmini em.code { color: var(--code); }
.cmini.pending { flex-direction: row; align-items: center; gap: 6px; border-style: dashed; border-color: rgba(227, 162, 58, .5); cursor: default; }
.cmini.pending .ic { width: 15px; height: 15px; color: #e3a23a; }
@media (max-width: 700px) { .cminis { margin-left: 0; width: 100%; } .cmini { flex: 1 1 130px; max-width: none; } }
.ccard { display: flex; flex-direction: column; gap: 6px; padding: 11px 13px; margin-bottom: 14px; text-align: left; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); }
.ccard.on { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 9%, var(--panel2)); }
.ccard.on:has(.cc-art) { position: relative; min-height: 160px; overflow: hidden; background: var(--panel2); }
.ccard .cc-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ccard.on:has(.cc-art)::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 9, 8, .72), rgba(6, 9, 8, .12) 42%, rgba(6, 9, 8, .88)); }
.ccard.on:has(.cc-art) > :not(.cc-art) { position: relative; z-index: 1; }
.cc-info { display: flex; flex-direction: column; gap: 6px; }
/* Colonie sélectionnée (illustrée) : même habillage que les autres cartes — nom et « MÈRE » dans des boîtes encadrées,
   un seul panneau sombre en bas pour la production et les places, tout décollé du bord. */
.ccard.on:has(.cc-art) { padding: 6px; }
.ccard.on:has(.cc-art) header { align-items: flex-start; gap: 6px; }
.ccard.on:has(.cc-art) header :is(.cc-name, .lvl, .poslink, .cc-pos, .cc-relay, .cc-bonus) { padding: 4px 8px; color: var(--txt); background: rgba(6, 9, 8, .86); border: 1px solid var(--line2); }
.ccard.on:has(.cc-art) header .lvl { font-size: 12px; }
.ccard.on:has(.cc-art) header .sdot { margin: 9px 2px 0 4px; }
.ccard.on:has(.cc-art) header .cc-bonus { align-self: stretch; align-items: center; }
.ccard.on:has(.cc-art) .cc-info { margin-top: auto; padding: 10px; background: rgba(6, 9, 8, .86); border: 1px solid rgba(255, 255, 255, .08); }
.ccard header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.ccard header b { font: 600 15px/1.2 var(--fd); letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Nom de la colonie : cliquer dessus (ou sur son crayon) la renomme */
.cc-name { display: inline-flex; align-items: center; gap: 7px; min-width: 0; padding: 0; background: none; border: 0; color: var(--txt); cursor: pointer; }
.cc-name .ic { flex: none; width: 13px; height: 13px; color: var(--mut); } .cc-name:hover .ic { color: var(--acc); }
.cc-pos { color: var(--dim); font-size: 12px; }
.ccard header .poslink, .ccard header .cc-pos { align-self: stretch; display: flex; align-items: center; }
/* Raccourci vers un emplacement de la carte : [secteur:emplacement] */
.poslink { padding: 0; background: none; border: 0; color: var(--mut); font: 600 12px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .02em; cursor: pointer; }
.poslink:hover, .poslink:focus-visible { color: var(--acc); text-decoration: underline; }
.ccard .row-lbl { margin-top: 0; }
.ccard .row-lbl.full b { color: var(--warn); }


/* ---------- Files de production : un emplacement par laboratoire / hangar / armurerie ---------- */
.slots { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.jslot { position: relative; display: flex; align-items: center; gap: 10px; flex: 1 1 230px; max-width: 360px; padding: 9px 12px 12px; overflow: hidden; background: var(--panel2); border: 1px solid var(--line); }
.jslot .ic { width: 20px; height: 20px; color: var(--acc); }
.jslot .sl-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.jslot .sl-t small { font: 700 10px/1.3 var(--fd); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.jslot .sl-t b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jslot .sl-time { margin-left: auto; font: 700 13px/1 var(--fd); color: var(--acc); }
.sl-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .06); }
.sl-bar u { display: block; height: 100%; width: 0; background: var(--acc); }
.jslot.free { background: none; border-style: dashed; border-color: var(--line2); }
.jslot.free .ic { color: var(--dim); } .jslot.free .sl-t b { color: var(--ok); }
/* Tuiles de colonie (plusieurs colonies) : terrain en transparence, la colonie active encadrée, les autres cliquables */
button.jslot { font: inherit; color: var(--txt); text-align: left; cursor: pointer; } button.jslot:hover { border-color: var(--acc); }
.jslot.on { border: 1px solid var(--acc); background: color-mix(in srgb, var(--acc) 8%, var(--panel2)); }
.jslot .sl-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .12; pointer-events: none; transition: opacity .15s; }
.jslot.on .sl-art, button.jslot:hover .sl-art { opacity: .2; }
.jslot .sl-t small:has(.sdot) { color: var(--mut); } .jslot.on .sl-t small { color: var(--txt); }
.jslot > :not(.sl-art, .sl-bar) { position: relative; }
.jslot .sl-t small .sdot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; vertical-align: 1px; }
.jslot .sl-on { margin-left: 6px; font-style: normal; color: var(--acc); }
.jslot.none .ic { color: var(--dim); } .jslot.none .sl-t b { color: var(--dim); font-weight: 500; }
.jslot.safe .sl-t b { color: var(--ok); } .jslot.weak .sl-t b { color: var(--bad); } .jslot.weak .ic { color: var(--bad); }

/* ---------- Fenêtres : petite croix en haut à droite ---------- */
.dlg { position: relative; }
.dlg > h3 { padding-right: 38px; }
.dlg-x { position: absolute; top: 10px; right: 12px; z-index: 2; width: 30px; height: 30px; display: grid; place-items: center; padding: 0 0 2px; background: none; border: 1px solid var(--line2); color: var(--mut); font-size: 22px; line-height: 1; }
.dlg-x:hover { color: var(--txt); border-color: var(--acc); background: rgba(255, 230, 200, .06); }

/* ---------- Page Colonies : tout se fait sur la tuile du bâtiment (plus de fenêtre de détail) ---------- */
.rooms { align-items: stretch; }
.room { height: auto; min-height: 128px; cursor: default; }
.room.empty { padding: 0; }
.room .r-add { position: relative; overflow: hidden; flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: none; border: 0; color: inherit; cursor: pointer; }
.room .r-add .plus, .room .r-add small { position: relative; text-shadow: 0 1px 6px #000; }
/* Sélecteur, catégorie Production : un titre par ressource, l'entrepôt rangé avec ses producteurs */
.pk-sec { grid-column: 1 / -1; margin: 6px 0 -2px; font: 600 12px/1 var(--fd); letter-spacing: .08em; text-transform: uppercase; color: var(--sc, var(--mut)); display: flex; align-items: center; gap: 8px; }
.pk-sec::after { content: ''; flex: 1; height: 1px; background: color-mix(in srgb, var(--sc, var(--line)) 40%, transparent); }
.pk-sec:first-child { margin-top: 0; }
.pk-sec.scrap { --sc: var(--scrap); } .pk-sec.cells { --sc: var(--cells); } .pk-sec.code { --sc: var(--code); } .pk-sec.energy { --sc: var(--energy); }
/* Carte de colonie : bonus de terrain compact à côté du point de couleur (le survol donne le terrain) */
.cc-bonus { display: inline-flex; gap: 6px; flex: none; } .cc-bonus .gain { font-size: 12px; gap: 3px; }
.room.built { height: auto; min-height: 150px; cursor: pointer; align-items: stretch; justify-content: flex-start; text-align: left; padding: 6px; gap: 5px; }
.room.built .r-main { width: 100%; flex: 1; align-items: stretch; gap: 6px; }
.room.built b { font: 600 15px/1.2 var(--fd); letter-spacing: .02em; }
.room.built .r-art { place-items: center; }
.r-tags { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 2px; }
.r-tags > * { padding: 2px 7px; background: rgba(6, 9, 8, .82); }
.r-tags > .r-acts { margin-left: auto; display: flex; gap: 3px; padding: 0; background: none; }
/* Petits boutons carrés de la tuile (ouvrir la page, déplacer, démolir) */
.btn.sm.r-link { padding: 0; width: 26px; height: 24px; display: grid; place-items: center; background: rgba(6, 9, 8, .86); border-color: var(--line2); clip-path: none; }
.room .r-link .ic { width: 14px; height: 14px; margin: 0; color: var(--mut); transition: color .15s; }
.btn.sm.r-link:hover:not(:disabled) { border-color: var(--acc); } .room .r-link:hover:not(:disabled) .ic, .room .r-link.on .ic { color: var(--txt); }
.btn.sm.r-link.on { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 22%, rgba(6, 9, 8, .86)); }
.btn.sm.r-link.r-del:hover:not(:disabled), .btn.sm.r-link.r-del.on { border-color: var(--bad); } .room .r-link.r-del:hover:not(:disabled) .ic, .room .r-link.r-del.on .ic { color: var(--bad); }
.btn.sm.r-link:disabled { opacity: .45; }
/* Panneau démolir / déplacer : monte sur la tuile, par-dessus son panneau du bas */
.r-sheet { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: flex-end; gap: 7px; padding: 10px; text-align: left;
  background: rgba(6, 9, 8, .96); border: 1px solid var(--line2); border-top: 2px solid var(--acc); box-shadow: 0 -10px 24px rgba(0, 0, 0, .5); animation: rSheetUp .22s cubic-bezier(.2, .8, .2, 1); }
.r-sheet.danger { border-top-color: var(--bad); }
.room .r-sheet b { font: 600 13px/1.2 var(--fd); letter-spacing: .04em; text-transform: uppercase; }
.r-sheet small { color: var(--mut); font-size: 11px; line-height: 1.35; }
.r-sh-btns { display: flex; flex-wrap: wrap; gap: 6px; } .r-sh-btns .btn { flex: 1 1 70px; min-width: 0; padding-inline: 6px; } /* tuile étroite : les boutons s'empilent */
.btn.r-kill { background: var(--bad); color: #fff; }
@keyframes rSheetUp { from { transform: translateY(18px); opacity: 0; } }
/* Déplacement : chaque autre emplacement devient une cible */
.r-dest { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 6px; cursor: pointer;
  background: color-mix(in srgb, var(--acc) 14%, rgba(6, 9, 8, .8)); border: 2px dashed color-mix(in srgb, var(--acc) 70%, transparent); color: var(--txt);
  font: 600 12px/1.2 var(--fd); letter-spacing: .05em; text-transform: uppercase; animation: rSheetUp .22s ease-out; }
.r-dest:hover { background: color-mix(in srgb, var(--acc) 28%, rgba(6, 9, 8, .8)); border-style: solid; }
.room .r-dest .ic { width: 20px; height: 20px; color: var(--acc); }
.r-dest small { display: inline-flex; align-items: center; gap: 3px; color: var(--energy); font: 600 11px var(--font); text-transform: none; letter-spacing: 0; } .room .r-dest small .ic { width: 11px; height: 11px; color: inherit; }
.room.built .out { font-size: 12px; }
button.flabel { font-size: 14px; font-weight: 700; color: var(--txt); }
.f-heat { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; padding: 2px 7px; font-size: 11px; font-weight: 600; color: var(--energy); background: color-mix(in srgb, var(--energy) 12%, rgba(0, 0, 0, .4)); cursor: help; } .f-heat .ic { width: 12px; height: 12px; } /* chaleur du niveau : économie d'énergie */
.room.built .r-timer { top: 50px; right: 10px; z-index: 2; padding: 2px 7px; background: rgba(6, 9, 8, .82); } .room .r-timer:empty { display: none; }
@media (max-width: 800px) {
  .rooms { grid-template-columns: 1fr 1fr; } .rooms .shaft { display: none; }
  .room.built { min-height: 0; padding: 4px; }
  .room.built .r-head { gap: 4px; } .room.built .r-head > * { padding: 3px 6px; } .room.built b { font-size: 13px; } .room.built .r-head .lvl { font-size: 10.5px; }
  .r-tags > * { font-size: 10.5px; }
}
@media (min-width: 1181px) and (max-width: 1420px), (max-width: 960px) {
  .rooms { grid-template-columns: 1fr 1fr; } .rooms .shaft { display: none; }
}

/* Héros : ressources, énergie, habitants, emplacements occupés et vaisseaux sur une ligne — la valeur en grand, la production dessous */
.cc-res { display: flex; flex-wrap: wrap; gap: 8px 12px; }
/* l'icône est à hauteur du chiffre ; la production (ou une ligne vide) passe dessous, dans la colonne du chiffre */
.cc-r { --c: var(--mut); flex: 1 0 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; align-content: center; gap: 0 7px; min-width: max-content; }
.cc-r .ic { grid-row: 1; width: 20px; height: 20px; color: var(--c); }
.cc-r b { font: 700 18px/1.15 var(--fd); color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-r small { grid-column: 2; font-size: 11.5px; line-height: 16px; font-weight: 600; color: var(--c); white-space: nowrap; }
.cc-r.cc-st::after { content: ''; grid-column: 2; height: 16px; } /* ligne vide à la place de la production : les chiffres restent alignés sur ceux des ressources */
.cc-r.scrap { --c: var(--scrap); } .cc-r.cells { --c: var(--cells); } .cc-r.code { --c: var(--code); } .cc-r.energy { --c: var(--energy); } .cc-r.bad { --c: var(--bad); } .cc-r.pop { --c: var(--pop); } .cc-r.full b { color: var(--warn); }
.cc-relay { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; } .cc-relay .ic { width: 13px; height: 13px; }
/* Tuile de bâtiment : « Améliorer » + petit bouton carré vers la page du bâtiment */
.r-charge .ic { width: 14px; height: 14px; color: inherit !important; } /* suit la couleur du bouton, pas celle du groupe de la tuile (rouge sur rouge en Défense) */

.cc-lv { margin-left: auto; display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; color: var(--acc); background: rgba(6, 9, 8, .86); border: 1px solid var(--acc); font: 700 12px/1 var(--fd); letter-spacing: .06em; }
.cc-lv b { font-size: 24px; color: var(--txt); } .cc-relay + .cc-lv { margin-left: 0; }
.ch-lvl { color: var(--acc); font-weight: 700; letter-spacing: .04em; } .ch-lvl b { color: var(--txt); font-size: 15px; }
.who-lvl { margin-left: 6px; }
/* ---------- Panneau de construction : glisse par-dessus la page Colonies ; fiche du bâtiment choisi en haut, tuiles en dessous ---------- */
.center { position: relative; }
.sheet { position: absolute; inset: 0; z-index: 40; overflow: hidden; background: var(--panel); border-top: 1px solid var(--line2); animation: sheetUp .26s cubic-bezier(.2, .8, .2, 1); }
.sheet-sc { height: 100%; overflow-y: auto; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--acc) 55%, var(--line2)) var(--panel); scrollbar-gutter: stable; overscroll-behavior: contain; }
.sheet-sc::-webkit-scrollbar { width: 8px; }
.sheet-sc::-webkit-scrollbar-track { background: var(--panel); border-left: 1px solid var(--line); }
.sheet-sc::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--acc) 55%, var(--line2)); border: 2px solid var(--panel); border-radius: 8px; }
.sheet-sc::-webkit-scrollbar-thumb:hover { background: var(--acc); }
.sheet-in { max-width: 1180px; margin: 0 auto; padding: 22px 26px 28px; }
@media (max-width: 800px) {
  html:has(.sheet), body:has(.sheet) { overflow-y: hidden; }
  .sheet { position: fixed; inset: 8px 8px calc(70px + env(safe-area-inset-bottom)); }
}
@keyframes sheetUp { from { transform: translateY(60px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.ps-fx .row-lbl > span:first-child { display: none; } /* les pictos suffisent : pas de titres « Gain », « Énergie »… */
.pk-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 0 38px 12px 0; }
.pk-head h3 { margin: 0; font-size: 18px; color: var(--txt); }
.pick-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.pk-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; font: 600 13px/1 var(--fd); letter-spacing: .06em; text-transform: uppercase; }
.pk-tab .ic { width: 15px; height: 15px; color: var(--rc); }
.pk-sel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 16px; align-items: stretch; padding: 14px; margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--rc) 45%, var(--line)); background: color-mix(in srgb, var(--rc) 6%, var(--bg)); }
.ps-art { grid-column: 1 / -1; width: 100%; height: clamp(150px, 18vw, 220px); border: 1px solid var(--line); } .ps-art .ic { width: 46px; height: 46px; }
.ps-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ps-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .ps-head h4 { margin: 0; font-size: 17px; }
.ps-main p { margin: 0; color: var(--mut); font-size: 13px; line-height: 1.4; }
.ps-fx { display: flex; flex-wrap: wrap; gap: 4px 18px; } .ps-fx .row-lbl { margin: 0; }
.ps-act { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 10px; min-width: 190px; }
.ps-act .btn { padding: 12px 18px; font-size: 14px; justify-content: center; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.pk-grid.cols { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); align-items: start; gap: 12px; }
.pk-col { display: flex; flex-direction: column; gap: 6px; } .pk-col .pk-sec { margin: 0 0 2px; }
.pk-tile { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; text-align: left; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); cursor: pointer; transition: border-color .12s, background .12s; }
.pk-tile:hover { border-color: var(--line2); }
.pk-tile.on { border-color: var(--rc); background: color-mix(in srgb, var(--rc) 12%, var(--panel2)); box-shadow: inset 3px 0 0 var(--rc); }
.pk-tile.locked { opacity: .5; filter: grayscale(1); } .pk-tile.locked.on { opacity: .8; }
.pk-ic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; color: var(--rc); background: color-mix(in srgb, var(--rc) 14%, transparent); }
.pk-ic .ic { width: 18px; height: 18px; }
.pk-tn { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pk-tn b { font-size: 12.5px; line-height: 1.2; overflow-wrap: anywhere; }
.pk-tn small { display: inline-flex; align-items: center; gap: 4px; color: var(--dim); font-size: 11px; } .pk-tn small .ic { width: 11px; height: 11px; }
.pk-tile .pk-cost .cost { font-size: 10.5px; padding: 0 5px; }
@media (max-width: 800px) {
  .sheet-in { padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
  .sheet { position: fixed; z-index: 85; border-top: 0; } /* la page défile en entier sur mobile : le panneau prend tout l’écran */
  .sheet, .sheet.low { inset: 0; padding-top: env(safe-area-inset-top); } /* plein écran : aucune bordure ne laisse voir la page derrière */
  .pick-tabs { flex-wrap: nowrap; } .pk-tab { flex: 1; justify-content: center; padding: 8px 6px; font-size: 10.5px; letter-spacing: .03em; }
  .pk-sel { grid-template-columns: minmax(0, 1fr); gap: 12px; } .ps-art { height: 150px; } .ps-art .ic { width: 38px; height: 38px; }
  .ps-act { grid-column: 1 / -1; min-width: 0; }
  .pk-grid, .pk-grid.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Cartes compactes, partout : des pictos et des valeurs plutôt que des titres ---------- */
.cards { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.cards:not(.tgrid):has(> .card > .thumb.has-img) { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.card { gap: 8px; padding: 12px 12px 14px; }
.card.has-thumb { padding-top: 12px; }
.card.has-thumb > .thumb:not(.has-img) { display: none; } /* sans illustration fournie, le picto de l’en-tête suffit */
.card.has-thumb:has(> .thumb:not(.has-img)) header .ico { display: grid; }
.card.has-thumb:has(> .thumb.has-img) { min-height: 300px; gap: 0; padding: 6px; }
.card.has-thumb > .thumb.has-img { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border: 0; aspect-ratio: auto; pointer-events: none; }
.card.has-thumb:has(> .thumb.has-img)::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(6, 9, 8, .7), transparent 38%, rgba(6, 9, 8, .4) 62%, rgba(6, 9, 8, .9)); pointer-events: none; }
.card.has-thumb:has(> .thumb.has-img) header { position: relative; z-index: 2; }
.card.has-thumb:has(> .thumb.has-img) header .ttl { flex: 1; flex-wrap: nowrap; }
.card.has-thumb:has(> .thumb.has-img) .card-info { display: flex; flex-direction: column; gap: 7px; }
/* Cartes illustrées (bâtiments, recherches, vaisseaux, avatar, armurerie) : un seul habillage, celui des tuiles de bâtiment.
   En haut le nom et le niveau, chacun dans sa petite boîte sombre encadrée ; en bas un panneau sombre ; tout est décollé du bord. */
:is(.room.built .r-head, .card.has-thumb:has(> .thumb.has-img) header .ttl) { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
:is(.room.built .r-head, .card.has-thumb:has(> .thumb.has-img) header .ttl) > :is(b, h4, .lvl, .jobn) { padding: 4px 8px; color: var(--txt); background: rgba(6, 9, 8, .86); border: 1px solid var(--line2); }
:is(.room.built .r-head, .card.has-thumb:has(> .thumb.has-img) header .ttl) > :is(b, h4) { flex: 0 1 auto; min-width: 0; hyphens: auto; } /* trop étroit : le niveau passe dessous plutôt que de chevaucher le nom */
:is(.room.built .r-head, .card.has-thumb:has(> .thumb.has-img) header .ttl) > :is(.lvl, .jobn) { flex: none; margin-left: auto; font-size: 12px; }
@media (max-width: 800px) { /* mobile : le nom prend toute la largeur, le niveau (ou le nombre d'habitants) passe toujours dessous à gauche : plus de décalage selon la longueur du nom */
  :is(.room.built .r-head, .card.has-thumb:has(> .thumb.has-img) header .ttl) { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: 4px; }
  :is(.room.built .r-head, .card.has-thumb:has(> .thumb.has-img) header .ttl) > :is(b, h4) { max-width: 100%; hyphens: manual; overflow-wrap: break-word; }
  :is(.room.built .r-head, .card.has-thumb:has(> .thumb.has-img) header .ttl) > :is(.lvl, .jobn) { margin-left: 0; white-space: nowrap; }
}
.card.has-thumb:has(> .thumb.has-img) .card-info {
  position: relative; z-index: 2; margin: auto 0 0; padding: 10px; background: rgba(6, 9, 8, .86); border: 1px solid rgba(255, 255, 255, .08); }
.card.has-thumb:has(> .thumb.has-img) .card-info > p { color: var(--txt); }
.card.has-thumb:has(> .thumb.has-img) .card-info > :is(.body, .act, .stepper) { flex: none; margin-top: 0; }
.card.has-thumb:has(> .thumb.has-img) .prog { z-index: 3; }
:not(.card) > .thumb.has-img { min-height: 112px; max-height: 190px; aspect-ratio: 3 / 1; }
#expHead > .thumb.has-img { height: auto; max-height: none; aspect-ratio: 4 / 1; }

#expHead:has(> .thumb.has-img) > .er-head { position: relative; z-index: 1; margin-top: clamp(-84px, -10vw, -40px); padding: 12px; background: rgba(6, 9, 8, .86); }
.card header { gap: 10px; } .card .ico { width: 34px; height: 34px; } .card .ico .ic { width: 18px; height: 18px; }
.card h4 { font-size: 15px; } .card .lvl { padding: 3px 8px; font-size: 12px; color: var(--txt); }


/* ---------- Matrice : secteur en bannière (titre, verdict, ennemis et butin posés sur l'image) ---------- */
.mp-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-stats > * { flex: 1 1 auto; }
.mp-stats .foes { align-content: center; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); }
.mp-stats .loot-box { padding: 8px 10px; gap: 6px; }
.ep-head .verdict { margin-left: auto; }

/* ---------- Matrice · préparer l'avatar : stats sur une ligne, petites cartes illustrées ---------- */
.lo .rpg { display: flex; flex-wrap: wrap; gap: 4px; }
.lo .rs { flex: 1 1 0; min-width: 86px; gap: 6px; padding: 4px 8px; }
.lo .rs-i { width: 22px; height: 22px; } .lo .rs-i .ic { width: 13px; height: 13px; }
.lo .rs-v { flex-direction: row; align-items: baseline; gap: 5px; } .lo .rs-v b { font-size: 15px; }
.lo-st .lo-more { margin-left: auto; align-self: center; }
/* jauges bande passante + mémoire RAM : restent visibles pendant qu'on choisit l'équipement, les modules et les compétences */
.lo-bar { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px; margin: 0 -14px; padding: 6px 14px; background: var(--panel2); border-bottom: 1px solid var(--line); }
.lo-bar .bw { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; padding: 6px 10px; }
.lo-bar .bw > .ghost { grid-row: 1; grid-column: 2; padding: 0 9px; font-size: 15px; line-height: 20px; } .lo-bar .bw-l { white-space: nowrap; } .lo-bar .bw-slots { grid-row: 2; grid-column: 1 / -1; }
@media (min-width: 901px) { .lo-bar { top: -18px; } } /* collée au bord de #view, pas sous sa marge intérieure */
.bw.ram .bw-l .ic { color: #e3a23a; }
.bw-slots i.sk { border: 0; background: #e3a23a; box-shadow: 0 0 6px rgba(227, 162, 58, .5); }
.bw-slots i.lock { border-style: solid; border-color: var(--line); background: repeating-linear-gradient(45deg, transparent 0 3px, rgba(255, 255, 255, .06) 3px 5px); }
.rs.ram { --sc: #e3a23a; }
@media (min-width: 901px) { .rpg.big { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lo .rs-v :is(b, small) { white-space: nowrap; }
/* fiche Avatar : image de l'amélioration en fond léger, bouton « + » pour l'acheter */
.rs.av-up { overflow: hidden; cursor: pointer; } .rs.av-up > :not(.rs-art) { position: relative; }
.rs-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .14; pointer-events: none; -webkit-mask-image: linear-gradient(to left, #000 20%, transparent); mask-image: linear-gradient(to left, #000 20%, transparent); }
.rs-plus { margin-left: auto; display: inline-flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 9px; border-radius: var(--r); line-height: 1.1; color: var(--sc); background: color-mix(in srgb, var(--sc) 14%, var(--bg)); border: 1px solid color-mix(in srgb, var(--sc) 45%, var(--line)); cursor: pointer; }
.rs-plus b { font-size: 13px; font-weight: 800; } .rs-plus small { display: inline-flex; align-items: center; gap: 2px; font-size: 10.5px; color: var(--mut); } .rs-plus .ic { width: 11px; height: 11px; }
/* Avatar : stats de combat, puis l'emport du run (bande passante, RAM) à part */
.av-stats { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; } .av-stats .rpg.big { margin-top: 0; }
.av-stats h4 { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--mut); text-transform: uppercase; letter-spacing: .08em; }
.av-stats h4.av-sep { margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
.rpg.big.av-emport { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rs-plus:hover:not(:disabled) { background: color-mix(in srgb, var(--sc) 26%, var(--bg)); } .rs-plus:disabled { opacity: .45; cursor: not-allowed; }
.lo-pieces, .lo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; } /* lignes de 4 : des cartes assez grandes pour se lire */
@media (max-width: 560px) { .lo-pieces, .lo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lo-card { position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; gap: 6px; aspect-ratio: 1; padding: 6px; overflow: hidden; text-align: left; }
.lo-card > .thumb { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; max-height: none; aspect-ratio: auto; margin: 0; border: 0; pointer-events: none; }
.lo-card:has(> .thumb.has-img)::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(6, 9, 8, .5), transparent 35%, transparent 55%, rgba(6, 9, 8, .7)); pointer-events: none; }
.lo-card > :not(.thumb) { position: relative; z-index: 2; }
.lc-top { display: flex; align-items: flex-start; gap: 4px; }
.lc-top > b, .lc-n { padding: 3px 6px; font-size: 11.5px; line-height: 1.2; color: var(--txt); background: rgba(6, 9, 8, .86); border: 1px solid var(--line2); }
.lc-top > b { flex: 0 1 auto; min-width: 0; hyphens: auto; }
.lc-top > :last-child:not(b) { flex: none; margin-left: auto; }
.lc-n { font: 700 11px/1.2 var(--fd); }
.lo-card .lc-top .lo-c { position: static; height: auto; padding: 3px 6px; background: rgba(6, 9, 8, .86); }
.lo-i.lo-card.on .lc-top .lo-c { color: #04110c; background: #3ddc84; }
.lc-bot { display: flex; flex-direction: column; gap: 3px; padding: 6px 7px; background: rgba(6, 9, 8, .66); border: 1px solid rgba(255, 255, 255, .08); }
.lc-bot small { font-size: 11px; line-height: 1.3; } .lc-bot .up { color: var(--ok); } .lc-bot .down { color: var(--bad); }
.lo-card .lo-q { gap: 4px; } .lo-card .lo-q .btn { padding: 2px 8px; } .lo-card .lo-q .lo-c { margin-left: auto; }
.lo-card.on { box-shadow: inset 0 0 0 1px var(--acc); }
.lo-p.lo-card.none { filter: grayscale(1); opacity: .6; }
/* Compétences et modules : verrouillé (gris + cadenas), indisponible pour l'instant (atténué), sélectionnable (survol), sélectionné (cadre vert + pastille) */
.lo-i.lo-card { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.lo-i.lo-card.none { filter: grayscale(1) brightness(.7); opacity: .5; cursor: not-allowed; }
.lo-i.lo-card.off:not(.on) { opacity: .6; }
.lc-lock { display: inline-flex; align-items: center; gap: 4px; color: var(--mut); } .lc-lock .ic { width: 12px; height: 12px; }
.lo-i.lo-card:not(.on):not(:disabled):hover { border-color: var(--acc); transform: translateY(-2px); }
.lo-i.lo-card.on { border-color: var(--acc); box-shadow: inset 0 0 0 2px var(--acc), 0 0 14px color-mix(in srgb, var(--acc) 45%, transparent); }
.card-info > p { font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .row-lbl > span:first-child, .ccard .row-lbl > span:first-child { display: none; } /* « Effet », « Durée », « Rôle »… : les pictos parlent */
.costs > .lbl { display: none; } /* « Coût », « Prix », « Prime » */
.card .body { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.card .fx { display: contents; }
.card .row-lbl, .card .costs { margin: 0; }
.card .costs { display: flex; flex-wrap: wrap; gap: 4px; }
.card .row-lbl:has(> .sfleet:empty) { display: none; }
.card .req:not(:empty) { flex-basis: 100%; } .card .req:empty { display: none; }
.card .act .btn { padding: 8px 12px; font-size: 12.5px; }
.ep-stats > div { display: flex; align-items: center; gap: 8px; padding: 7px 10px; } .ep-stats > div > .ic { width: 16px; height: 16px; color: var(--dim); flex: none; } .ep-stats b { font-size: 15px; }
.card .tipped, .card h4.lore { cursor: help; } /* effet d’une recherche : les précisions chiffrées sont au survol */
/* Habitants : résumé en haut à gauche */
.pop-sum { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; padding: 10px 14px; background: var(--panel2); border: 1px solid var(--line); flex-wrap: wrap; }
.ps-ic { width: 40px; height: 40px; display: grid; place-items: center; color: var(--pop); background: color-mix(in srgb, var(--pop) 14%, transparent); } .ps-ic .ic { width: 22px; height: 22px; }
.ps-n { display: flex; align-items: baseline; gap: 6px; } .ps-n b { font: 700 26px/1 var(--fd); color: var(--pop); } .ps-n small { color: var(--mut); font-size: 12px; }
.ps-idle b { color: var(--dim); } .ps-idle.on b { color: var(--warn); }
.ps-bar { flex: 1; min-width: 120px; height: 6px; background: var(--bg); border: 1px solid var(--line); } .ps-bar u { display: block; height: 100%; background: var(--pop); transition: width .3s; }
.btn.danger.r-charge:not(:disabled) { background: var(--bad); border-color: var(--bad); color: #fff; } /* Batterie EMP vide : recharger, bien visible */

/* ---------- Infobulle flottante (une seule, posée sur la page) ---------- */
.ftip { position: fixed; z-index: 200; max-width: 260px; padding: 5px 10px; border-radius: var(--r); background: #241c15; border: 1px solid var(--line2); box-shadow: 0 8px 22px rgba(0, 0, 0, .55); color: var(--txt); font: 500 11.5px/1.4 var(--font); text-align: center; pointer-events: none; }
[data-pop] { cursor: pointer; }
.ftip.pop { display: grid; grid-template-columns: auto auto; gap: 3px 14px; min-width: 180px; text-align: left; }
.ftip .pop-t { grid-column: 1 / -1; font: 700 10px/1.4 var(--fd); letter-spacing: .1em; text-transform: uppercase; color: var(--mut); }
.ftip .pop-r { display: contents; }
.ftip .pop-r > span { font-weight: 600; } .ftip .pop-r.on > span::after { content: " ●"; color: var(--acc); font-size: 9px; vertical-align: middle; }
.ftip .pop-r i { font-style: normal; font-weight: 700; text-align: right; } .ftip .pop-r i.bad { color: var(--bad); }
.ftip .pop-r i.scrap { color: var(--scrap); } .ftip .pop-r i.cells { color: var(--cells); } .ftip .pop-r i.code { color: var(--code); } .ftip .pop-r i.energy { color: var(--energy); }
.ftip .pop-r small { grid-column: 1 / -1; margin-top: -3px; color: var(--mut); font-size: 11px; }
.ftip .pop-x { grid-column: 1 / -1; margin-top: 4px; color: var(--warn); font-size: 11px; }
.ftip.long { max-width: 320px; padding: 9px 12px; font-weight: 400; font-size: 12px; line-height: 1.5; text-align: left; }

/* Musée des reliques */
.mus-head { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: baseline; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); margin-bottom: 14px; }
.mus-tier { --rc: #9aa7b8; margin-bottom: 16px; } .mus-tier.t1 { --rc: #4ea3e8; } .mus-tier.t2 { --rc: #b57be8; } .mus-tier.t3 { --rc: #e3a23a; }
.mus-tier h3 { color: var(--rc); }
.mus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.relic { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--rc) 45%, var(--line)); border-radius: var(--r); background: var(--panel2); overflow: hidden; }
.rl-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.rl-info { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; align-items: center; } /* le bouton garde sa largeur, le gain se replie à côté sans passer dessous */
.rl-info .rl-gain { flex-wrap: wrap; min-width: 0; }
.rl-info p { grid-column: 1 / -1; }
.relic:has(> .thumb.has-img) { min-height: 250px; }
.relic > .thumb.has-img { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; aspect-ratio: auto; margin: 0; border: 0; pointer-events: none; }
.relic:has(> .thumb.has-img)::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(6, 9, 8, .7), transparent 38%, rgba(6, 9, 8, .4) 62%, rgba(6, 9, 8, .9)); pointer-events: none; }
.relic:has(> .thumb.has-img) .rl-head { position: relative; z-index: 2; }
.relic:has(> .thumb.has-img) .rl-head :is(h4, .rl-n) { padding: 5px 7px; background: rgba(6, 9, 8, .82); }
.relic:has(> .thumb.has-img) .rl-info { position: relative; z-index: 2; margin: auto -12px -10px; padding: 10px 12px; background: rgba(6, 9, 8, .82); }
.relic h4 { font-size: 13.5px; } .relic p { color: var(--mut); font-size: 11.5px; margin-top: 2px; }
.relic .rl-n { font: 700 16px/1 var(--fd); color: var(--rc); }
.relic .btn { justify-self: start; } .relic .rl-gain { justify-content: flex-end; }
.relic.none { opacity: .45; filter: grayscale(1); border-style: dashed; } .relic.none > :not(.thumb), .relic.none::before { visibility: hidden; }

/* ---------- Relais : panneau d'échange (départ, vaisseau et charge, arrivée), jauges aux couleurs des ressources, envois animés ---------- */
.rl-trade { display: grid; grid-template-columns: minmax(0, 1fr) 190px minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.rl-side { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; min-height: 150px; padding: 12px; overflow: hidden; background: var(--panel2); border: 1px solid var(--line); }
.rl-side.dest { border-color: var(--acc); }
.rl-side > .rl-relay { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; background: rgba(6, 9, 8, .85); font-size: 11px; }
.rl-relay .ic { width: 14px; height: 14px; }
.cv-relay { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 8px 10px; border: 1px solid var(--line); font-size: 12px; }
.cv-relay > .ic { flex: none; color: var(--acc); }
.cv-relay .ok { color: var(--ok); }
.rl-side img, .rl-d img, .rl-end img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.rl-side img { opacity: .5; }
.rl-side::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, transparent 25%, rgba(6, 9, 8, .92)); }
.rl-side > :not(img), .rl-d > b, .rl-end > b { position: relative; z-index: 2; }
.rl-who small { display: block; font: 700 10px/1.4 var(--fd); letter-spacing: .14em; text-transform: uppercase; color: var(--mut); }
.rl-who b { display: flex; align-items: center; gap: 8px; font: 600 18px/1.2 var(--fd); letter-spacing: .03em; }
.rl-who .sdot { width: 8px; height: 8px; flex: none; }
.rl-stock { display: flex; flex-wrap: wrap; gap: 4px; } .rl-stock .cost { font-size: 11.5px; padding: 1px 6px; }
.rl-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
.rl-lane { position: relative; display: grid; place-items: center; width: 100%; height: 44px; }
.rl-lane::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed var(--line2); }
.rl-lane::after { content: ""; position: absolute; right: -2px; top: calc(50% - 5px); border: 6px solid transparent; border-left-color: var(--line2); border-right: 0; }
.rl-ship { color: #f2d28b; filter: drop-shadow(0 0 6px rgba(227, 162, 58, .7)); }
.rl-ship .ic { display: block; animation: bob 1.6s ease-in-out infinite; }
.rl-lane .rl-ship { position: relative; padding: 0 8px; background: var(--panel); } .rl-lane .rl-ship .ic { width: 32px; height: 32px; }
.rl-mid b { font: 700 17px/1.2 var(--fd); } .rl-mid small { color: var(--mut); font-size: 11px; }
.rl-right { display: flex; flex-direction: column; gap: 6px; min-width: 0; } .rl-right .rl-side { flex: 1; }
.rl-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.rl-d { position: relative; flex: 1 1 0; min-width: 0; padding: 7px 10px; overflow: hidden; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); text-align: left; cursor: pointer; }
.rl-d img { opacity: .22; transition: opacity .15s; } .rl-d:hover img, .rl-d.on img { opacity: .4; }
.rl-d b { display: flex; align-items: center; gap: 6px; font: 600 12.5px/1.2 var(--fd); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .rl-d .sdot { width: 7px; height: 7px; flex: none; } .rl-d:hover, .rl-d.on { border-color: var(--acc); }
.rl-bars { display: grid; gap: 8px; margin-bottom: 14px; }
.rl-bar { --c: var(--mut); display: grid; grid-template-columns: 150px minmax(0, 1fr) 72px auto; align-items: center; gap: 14px; padding: 10px 12px; background: var(--panel2); border: 1px solid var(--line); }
.rl-bar.scrap { --c: var(--scrap); } .rl-bar.cells { --c: var(--cells); } .rl-bar.code { --c: var(--code); }
.rl-bar > span { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--c); } .rl-bar > span .ic { width: 18px; height: 18px; }
.rl-bar > b { font: 700 16px/1 var(--fd); text-align: right; }
.rl-bar input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; margin: 0; cursor: pointer;
  background: linear-gradient(90deg, var(--c) var(--p, 0%), rgba(255, 255, 255, .08) var(--p, 0%)); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 25%, transparent); }
.rl-bar input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; background: var(--c); border: 2px solid var(--bg); transform: rotate(45deg); box-shadow: 0 0 8px var(--c); }
.rl-bar input[type=range]::-moz-range-thumb { width: 12px; height: 12px; background: var(--c); border: 2px solid var(--bg); border-radius: 0; transform: rotate(45deg); }
#rlWay h4 { margin: 20px 0 8px; }
.rl-trip { display: grid; grid-template-columns: 140px minmax(0, 1fr) 140px; gap: 8px 12px; align-items: center; padding: 10px 12px; margin-bottom: 8px; background: var(--panel2); border: 1px solid var(--line); }
.rl-end { position: relative; display: flex; align-items: center; min-height: 44px; padding: 6px 10px; overflow: hidden; border: 1px solid var(--line2); }
.rl-end img { opacity: .35; } .rl-end b { font: 600 13px/1.2 var(--fd); }
.rl-track { position: relative; height: 32px; }
.rl-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed var(--line2); }
.rl-track u { position: absolute; left: 0; top: calc(50% - 1px); width: 0; height: 2px; background: linear-gradient(90deg, transparent, #e3a23a); transition: width .25s linear; }
.rl-track .rl-ship { position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%); transition: left .25s linear; } .rl-track .rl-ship .ic { width: 24px; height: 24px; }
/* nez du vaisseau vers l'arrivée, comme dans les expéditions (la rotation s'applique après l'oscillation : bobx devient vertical) */
.rl-track .rl-ship .ic { rotate: 90deg; animation-name: bobx; }
@keyframes bobx { 0%, 100% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
.rl-load { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rl-load .mut { margin-left: auto; }
.cv-h { margin: 4px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); }
.cv-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; width: 100%; margin-top: 6px; font-size: 12px; color: var(--mut); }
.cv-fact { flex: 1 1 80px; display: grid; justify-items: center; gap: 1px; padding: 6px 4px; background: var(--panel2); border: 1px solid var(--line); }
.cv-fact .ic { width: 16px; height: 16px; color: var(--acc); } .cv-fact b { font: 700 13px/1.2 var(--fd); color: var(--txt); white-space: nowrap; } .cv-fact small { font-size: 10px; }
.cv-fact.ok { border-color: color-mix(in srgb, var(--ok) 50%, transparent); } .cv-fact.ok :is(.ic, b) { color: var(--ok); }
.cv-fact.warn { border-color: color-mix(in srgb, var(--warn) 50%, transparent); } .cv-fact.warn :is(.ic, b) { color: var(--warn); }
.cv-risk { margin: 0 0 14px; } .cv-risk:not(.ok) > .ic { color: var(--warn); }
.cv-fleet { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 6px; margin-bottom: 14px; }
.cv-s { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; background: var(--panel2); border: 1px solid var(--line); }
.cv-s:has(input:not([value="0"])), .cv-s:focus-within { border-color: var(--acc); } .cv-s > .ic { width: 20px; height: 20px; color: var(--acc); }
.cv-s b { display: block; font-size: 13px; } .cv-s small { display: block; color: var(--dim); font-size: 11px; } .cv-s input { width: 100%; text-align: right; }
.cv-qty { display: grid; grid-template-columns: 26px 48px 26px; align-items: stretch; border: 1px solid var(--line2); background: var(--bg); }
.cv-qty > b { display: grid; place-items: center; font-size: 13px; }
.cv-qty button { padding: 4px; border: 0; background: var(--panel2); color: var(--acc); font-size: 18px; cursor: pointer; }
.cv-qty button:hover { background: color-mix(in srgb, var(--acc) 15%, var(--panel2)); }
.cv-qty input { min-width: 0; padding: 6px 2px; border: 0; border-radius: 0; background: transparent; text-align: center; appearance: textfield; -moz-appearance: textfield; }
.cv-qty input::-webkit-inner-spin-button, .cv-qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cv-qty:focus-within { border-color: var(--acc); }
.cv-slots { margin-top: 10px; font-size: 12px; }
.cv-toolbar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.cv-index { flex: none; color: var(--acc); font: 600 12px/1 var(--fd); letter-spacing: .08em; }
.cv-vacant { display: flex; align-items: center; gap: 12px; padding: 18px 12px; margin-bottom: 10px; border: 1px dashed var(--line2); color: var(--dim); background: color-mix(in srgb, var(--panel2) 40%, transparent); }
.cv-vacant > b { font-size: 13px; font-weight: 500; } .cv-vacant > span:last-child { margin-left: auto; font-size: 12px; }
.cv-vacant > .ic { width: 18px; height: 18px; }
/* dernière tuile des emplacements : en ajouter un (Coordination des flottes) */
.cv-more { width: 100%; font: inherit; text-align: left; cursor: pointer; } .cv-more:hover { border-color: var(--acc); color: var(--txt); } .cv-more > .cv-index { color: var(--acc); }
.cv-destinations summary { list-style: none; } .cv-destinations summary::-webkit-details-marker { display: none; }
.cv-dest-list { position: absolute; top: calc(100% + 6px); left: 0; z-index: 6; display: grid; gap: 4px; width: min(350px, calc(100vw - 48px)); max-height: 360px; overflow-y: auto; padding: 8px; border: 1px solid var(--line2); background: var(--panel); box-shadow: 0 10px 28px #0009; scrollbar-width: thin; scrollbar-color: var(--line2) var(--panel); }
.cv-dest-list .btn { justify-content: flex-start; text-align: left; } .cv-dest-list small { display: block; font-size: 10px; color: var(--dim); }
.cv-operation { padding: 12px; border: 1px solid var(--line); background: var(--panel2); margin-bottom: 10px; }
.cv-operation > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.cv-operation > header > b { display: flex; align-items: center; gap: 7px; font-size: 13px; min-width: 0; }
.cv-operation > header > .btn { flex: none; }
.cv-operation .rl-trip { margin-bottom: 0; }
.cv-operation > p { margin: 8px 0 0; }
.rl-trip.back { opacity: .7; } .rl-trip.back .rl-ship { color: var(--mut); filter: none; }
/* panneau En cours : le petit vaisseau d'un envoi avance sur la barre */
.actrow:has(.ar-bar.ship) { padding-bottom: 15px; }
.ar-bar em { position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%); display: grid; color: #f2d28b; filter: drop-shadow(0 0 4px rgba(227, 162, 58, .8)); }
.ar-bar em .ic { width: 14px; height: 14px; color: inherit; }
@media (max-width: 700px) {
  .cv-dest-list { max-height: 220px; }
  .rl-trade { grid-template-columns: minmax(0, 1fr); } .rl-side { min-height: 110px; }
  .rl-bar { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 10px; } .rl-bar input[type=range] { grid-column: 1 / -1; grid-row: 2; }
  .rl-trip { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .rl-track { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) { .rl-ship .ic { animation: none; } }

/* ---------- Fondation d'une colonie : le terrain en grand, puis les infos en cases ---------- */
.fd-hero { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 6px; min-height: 220px; padding: 16px; margin-bottom: 12px; overflow: hidden; background: var(--panel2); border: 1px solid var(--line2); }
.fd-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.fd-hero::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(6, 9, 8, .25), transparent 35%, rgba(6, 9, 8, .9)); }
.fd-hero > :not(img) { position: relative; z-index: 2; }
.fd-tag { display: inline-flex; align-items: center; gap: 7px; font: 700 10px/1.4 var(--fd); letter-spacing: .14em; text-transform: uppercase; color: var(--mut); }
.fd-tag .sdot { width: 9px; height: 9px; }
.fd-type { font: 700 26px/1.1 var(--fd); letter-spacing: .03em; }
.fd-bonus { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fd-bonus > * { padding: 4px 8px; background: rgba(6, 9, 8, .86); border: 1px solid var(--line2); }
.fd-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-bottom: 12px; }
.fd-cell { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel2); border: 1px solid var(--line); }
.fd-cell > .ic { flex: none; width: 20px; height: 20px; color: var(--acc); }
.fd-cell small { display: block; font: 700 10px/1.4 var(--fd); letter-spacing: .12em; text-transform: uppercase; color: var(--mut); }
.fd-cell b { font: 600 15px/1.25 var(--fd); }
.fd-fleet { grid-column: 1 / -1; }
.fd-req { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; } .fd-req .btn { margin-left: auto; }

/* Tuile de bâtiment : présentation seule (nom, niveau, rôle, apport, raccourcis), les tags en bas ; un clic ouvre sa fiche */
.room.built .r-tags { margin-top: auto; }
/* Fiche d'un bâtiment : image en grand, puis le passage au niveau suivant */
.rm-hero { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 220px; padding: 14px; margin-bottom: 12px; overflow: hidden; background: var(--panel2); border: 1px solid var(--line2); }
.rm-hero .r-art { position: absolute; inset: 0; z-index: 0; }
.rm-hero .r-art .ic { width: 64px; height: 64px; opacity: .5; }
.rm-hero .r-art.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 9, 8, .7), rgba(6, 9, 8, .1) 40%, rgba(6, 9, 8, .85)); }
.rm-id, .rm-out { position: relative; z-index: 1; }
.rm-id { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rm-id > * { padding: 4px 8px; background: rgba(6, 9, 8, .86); border: 1px solid var(--line2); }
.rm-id b { font: 600 20px/1.2 var(--fd); letter-spacing: .02em; } .rm-id .lvl { font-size: 12px; }
.rm-out { align-self: flex-start; display: flex; gap: 6px; padding: 5px 9px; background: rgba(6, 9, 8, .86); border: 1px solid var(--line2); }
.rm-desc { margin: 0 0 12px; color: var(--mut); }
#rmBody { padding-top: 30px; } .rm-out:empty { display: none; } /* place pour la croix de fermeture */
.rm-h { margin: 0 0 8px; }
#rmBody .price { margin: 12px 0 4px; }
#rmBody .dact .ic { width: 15px; height: 15px; vertical-align: -3px; }

/* Tuiles par quatre (recherche, hangar, armurerie, avatar, habitants) : image, nom, niveau, une ligne d'info ; un clic ouvre la fiche */
.cards.tgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tcard { cursor: pointer; }
.tcard:hover { border-color: var(--acc); } .tcard.locked::after { display: none; } /* le prérequis remplace le niveau en haut à droite */
.card.tcard.has-thumb:has(> .thumb.has-img) { min-height: 180px; }
.tcard .tc-fx { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: flex-end; gap: 6px; margin-top: auto; } /* info à gauche, quantité éventuelle à droite */
.tcard .tc-fx > :empty { display: none; }
.tcard .tc-fx > * { display: inline-flex; padding: 3px 8px; background: rgba(6, 9, 8, .86); border: 1px solid var(--line2); font-size: 11.5px; }
.tcard h4 { font-size: 13.5px; }
@media (max-width: 1250px) { .cards.tgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .cards.tgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .card.tcard.has-thumb:has(> .thumb.has-img) { min-height: 150px; } }

/* ---------- Fiche de bâtiment (modèle des futures cartes) ----------
   Héros : titre + tag en haut à gauche, niveau + production en haut à droite, description dans un encart sombre en bas.
   Dessous : le niveau suivant et ce qu'il rapporte, puis les ressources et le bouton. */
.fi-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr auto auto; gap: 10px 12px; min-height: 260px; padding: 12px; margin-bottom: 10px; overflow: hidden; background: var(--panel2); border: 1px solid var(--line2); }
.fi-hero .r-art { position: absolute; inset: 0; z-index: 0; }
.fi-hero .r-art .ic { width: 64px; height: 64px; opacity: .5; }
.fi-hero .r-art.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 9, 8, .65), rgba(6, 9, 8, .05) 40%, rgba(6, 9, 8, .6)); }
.fi-hero > :not(.r-art) { position: relative; z-index: 1; }
.fi-tl { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.fi-tr { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
/* tous les petits tags du héros : même encadré sombre, même contour, coins droits */
.fi-name, .fi-tl .r-role, .fi-tr .lvl, .fi-out > * { margin: 0; padding: 4px 9px; background: rgba(6, 9, 8, .86); border: 1px solid var(--line2); border-radius: 0; }
.fi-tl .r-role, .fi-tr .lvl, .fi-out > .out { font: 700 12px/1.2 var(--fd); letter-spacing: .04em; }
.fi-name { font: 600 20px/1.2 var(--fd); letter-spacing: .02em; }
.fi-out { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 320px; } .fi-out:empty { display: none; }
.fi-mid { grid-column: 1 / -1; grid-row: 3; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.fi-mid > :empty { display: none; } .fi-mid > :last-child { margin-left: auto; }
.fi-mid > * > * { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; background: rgba(6, 9, 8, .86); border: 1px solid var(--line2); font: 700 12px/1.2 var(--fd); letter-spacing: .04em; } .fi-mid .ic { width: 14px; height: 14px; }
.fi-desc { grid-column: 1 / -1; grid-row: 4; margin: 0; padding: 10px 12px; color: var(--txt); background: rgba(6, 9, 8, .86); border: 1px solid rgba(255, 255, 255, .08); }
.fi-up { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--panel2); border: 1px solid var(--line); }
.fi-next { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.fi-next > b { font: 600 15px/1.2 var(--fd); }
.fi-buy { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.fi-buy .price, .fi-buy .callout { flex: 1 1 260px; margin: 0; }
.fi-buy .btn .ic { width: 15px; height: 15px; vertical-align: -3px; }
.fi-up .req { margin: 0; }
@media (max-width: 700px) { /* étroit : niveau et apport passent sous le titre */
  .fi-hero { min-height: 220px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr auto auto; } .fi-mid { grid-row: 4; } .fi-desc { grid-row: 5; }
  .fi-tr { flex-direction: row; flex-wrap: wrap; align-items: flex-start; } .fi-out { justify-content: flex-start; max-width: none; } .fi-buy .btn { flex: 1 1 auto; }
}

/* ---------- Effort de guerre : barre de PV, progression des 5 cibles, étiquettes ---------- */
:root { --elu: #ffd23f; --elu-glow: 0 0 10px rgba(255, 210, 63, .55); } /* l'Élu : jaune brillant */
.wh-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wtag { --c: var(--mut); display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.wtag .ic { width: 12px; height: 12px; }
.wtag.cyc { --c: #8fb3ff; } .wtag.step { --c: var(--txt); } .wtag.elu { --c: var(--elu); }
.wh-hp b { color: var(--txt); }
.hpbar { position: relative; height: 22px; border-radius: 11px; background: var(--bg); border: 1px solid rgba(217, 72, 59, .4); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5); }
.hpbar span { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .9); letter-spacing: .02em; }
.hpbar u { display: block; height: 100%; width: 100%; border-radius: 7px; background: linear-gradient(90deg, #8e2a22, #d9483b 70%, #ef8a7c); box-shadow: 0 0 12px rgba(217, 72, 59, .5); transition: width .4s; }
.wtrack { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: -4px; }
.wtrack u { height: 6px; border-radius: 3px; border: 1px solid var(--line); background: linear-gradient(90deg, var(--line2) var(--p), var(--bg) var(--p)); }
.wtrack u.done { background: var(--ok); border-color: var(--ok); }
.wtrack u.cur { background: linear-gradient(90deg, #d9483b var(--p), var(--bg) var(--p)); border-color: rgba(217, 72, 59, .6); }
.wh-fx { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.wh-fx .gain { padding: 4px 9px; border-radius: var(--r); background: color-mix(in srgb, var(--rc, var(--ok)) 9%, var(--bg)); border: 1px solid color-mix(in srgb, var(--rc, var(--ok)) 30%, transparent); }
.gain.bad { --rc: #ef8a7c; }
@media (max-width: 700px) { .wtrack { gap: 2px; } }

/* ---------- L'Élu : pseudo doré, couronne sur l'avatar, Panthéon des élus ---------- */
.elu-n { color: var(--elu) !important; text-shadow: var(--elu-glow); }
.elu-t { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--elu); border: 1px solid color-mix(in srgb, var(--elu) 45%, transparent); vertical-align: middle; }
.pd .elu-t { margin-left: 2px; }
#who.elu { color: var(--elu); text-shadow: var(--elu-glow); }

/* ---------- Récap de fin de cycle (reconnexion après un reset) ---------- */
.recap { display: flex; flex-direction: column; gap: 12px; }
.recap .rc-k { color: #ef8a7c; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.recap h3 { margin: -6px 0 0; } .recap .lead { margin: 0; color: var(--mut); }
.rc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.rc-c { padding: 8px 10px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); } .rc-c small { display: block; color: var(--dim); font-size: 11px; } .rc-c b { font-size: 15px; }
.rc-elu { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--elu) 40%, transparent); background: color-mix(in srgb, var(--elu) 7%, transparent); }
.rc-av { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--elu); background: color-mix(in srgb, var(--elu) 14%, transparent); } .rc-av .ic { width: 22px; height: 22px; }
.rc-elu small { display: block; color: var(--elu); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; } .rc-elu b { display: block; font-size: 18px; color: var(--elu); text-shadow: var(--elu-glow); } .rc-elu em { font-style: normal; font-size: 12px; color: var(--mut); }
.rc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .rc-cols h4 { margin: 0 0 4px; font-size: 13px; } .rc-cols ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--mut); line-height: 1.6; }
@media (max-width: 560px) { .rc-cols { grid-template-columns: 1fr; } }

/* Habitants sur téléphone : une carte par ligne, plus basse (deux colonnes écrasaient les commandes) */
@media (max-width: 560px) {
  .cards.jobs.tgrid { grid-template-columns: minmax(0, 1fr); }
  .card.jobcard.has-thumb:has(> .thumb.has-img) { min-height: 190px; }
}

/* Défense : le champ de débris tient sur une ligne fine, ressources alignées */
.def-alerts .callout.debris { flex-wrap: nowrap; align-items: center; padding: 6px 12px; gap: 12px; }
.def-alerts .callout.debris .price { display: flex; flex: none; width: auto; margin: 0; }
@media (max-width: 600px) { .def-alerts .callout.debris { flex-wrap: wrap; } }

/* Musée : trois repères en tête, sur le modèle des jauges de ressources du haut de page */
.ms { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 12px 10px 8px; min-width: 0; border-radius: var(--r); background: var(--panel2); border: 1px solid var(--line); }
.ms .tile { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: var(--r); color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.ms .v { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.ms .cn { font: 700 9.5px/1.1 var(--fd); letter-spacing: .07em; text-transform: uppercase; color: var(--c); opacity: .85; }
.ms b { font: 700 16px/1.2 var(--fd); color: var(--txt); white-space: nowrap; }
.ms .bar { position: absolute; left: 8px; right: 8px; bottom: 3px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.ms .bar u { display: block; height: 100%; background: var(--c); transition: width .3s; }
.mus-head { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0; border: 0; background: none; align-items: stretch; }
@media (max-width: 560px) { .mus-head { grid-template-columns: minmax(0, 1fr); } }

/* Classement : le podium se détache, le reste en lignes sobres */
.rk-row { gap: 10px; padding: 8px 12px; }
.rk-row .rk { min-width: 38px; color: var(--dim); font: 700 14px/1 var(--fd); }
.rk-row .plink { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-weight: 600; }
.rk-row .mut { margin-left: 0; }
.rk-me { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--acc); border-radius: var(--r); background: color-mix(in srgb, var(--acc) 8%, var(--panel2)); } .rk-me .ic { width: 18px; height: 18px; color: var(--acc); flex: none; }
.rk-how { margin: 0 0 10px; font-size: 13px; } .rk-how summary { cursor: pointer; color: var(--acc); } .rk-how p { margin: 6px 0 0; color: var(--mut); line-height: 1.5; }
.ord-n { margin-left: 4px; padding: 1px 6px; border-radius: 9px; background: #d4b24c; color: #130d07; font-size: 11px; } .ord-n:empty { display: none; }
.ord-tabs .sub .ic { width: 14px; height: 14px; vertical-align: -2px; }
.rk-row .score { font: 700 16px/1 var(--fd); color: var(--txt); }
.rk-row.top { padding: 11px 14px; border-left: 3px solid var(--tc); background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 12%, transparent), transparent 55%), var(--panel2); }
.rk-how-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.rk-hw { display: grid; grid-template-columns: 30px 1fr; column-gap: 8px; align-items: center; padding: 8px 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r); }
.rk-hw .ic { grid-row: 1 / 3; width: 24px; height: 24px; color: var(--acc); } .rk-hw b { font: 700 16px/1.1 var(--fd); color: var(--txt); } .rk-hw small { color: var(--mut); font-size: 11.5px; line-height: 1.3; }
.rk-me .rk-pos { display: flex; flex-direction: column; align-items: center; min-width: 64px; } .rk-me .rk-pos b { font: 700 24px/1.1 var(--fd); color: var(--acc); } .rk-me .rk-pos small { color: var(--mut); font-size: 11px; }
.rk-me .rk-gap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.rk-bar { display: block; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; } .rk-bar u { display: block; height: 100%; background: var(--acc); }
.rk-pager { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 10px 0 2px; }
.rk-row.top .rk { color: var(--tc); font-size: 18px; } .rk-row.top .score { color: var(--tc); font-size: 18px; }
.rk-row.r1 { --tc: #e3a23a; } .rk-row.r2 { --tc: #b9c4d0; } .rk-row.r3 { --tc: #c9834a; }
.rk-row.me { border-color: var(--acc); }
.rk-mix { display: inline-flex; align-items: center; gap: 6px; } .rk-ch { display: inline-flex; align-items: center; gap: 3px; font: 600 12px/1 var(--fd); color: var(--txt); } .rk-ch .ic { width: 14px; height: 14px; color: var(--acc); } .rk-ch.mx .ic { color: var(--code); }
.rk-split { display: block; width: 56px; height: 5px; border-radius: 3px; overflow: hidden; background: var(--code); } .rk-split u { display: block; height: 100%; background: var(--acc); }
#digInfo { display: inline-flex; flex-wrap: wrap; align-items: stretch; gap: 6px; } #digInfo .gain { padding: 0 10px; } /* coût et gains côte à côte, même hauteur */
.joined > .btn { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%); } /* collé à un champ : le coin haut gauche reste droit */

/* Effort de guerre : l'habillage du jeu (coins de HUD, pans coupés, losanges, capitales) plutôt que des pilules et des dégradés */
.war-hero { border-radius: 0; border-color: var(--line2); background: var(--panel2); --cc: #d9483b;
  background: linear-gradient(var(--cc), var(--cc)) top left / 14px 2px no-repeat border-box, linear-gradient(var(--cc), var(--cc)) top left / 2px 14px no-repeat border-box,
    linear-gradient(var(--cc), var(--cc)) top right / 14px 2px no-repeat border-box, linear-gradient(var(--cc), var(--cc)) top right / 2px 14px no-repeat border-box,
    linear-gradient(var(--cc), var(--cc)) bottom left / 14px 2px no-repeat border-box, linear-gradient(var(--cc), var(--cc)) bottom left / 2px 14px no-repeat border-box,
    linear-gradient(var(--cc), var(--cc)) bottom right / 14px 2px no-repeat border-box, linear-gradient(var(--cc), var(--cc)) bottom right / 2px 14px no-repeat border-box, var(--panel2); }
.wh-top small { font: 700 10px/1 var(--fd); letter-spacing: .18em; text-transform: uppercase; color: #d9483b; }
.wh-top h2 { margin-top: 4px; letter-spacing: .06em; text-transform: uppercase; }
.wh-hp b { font: 700 26px/1 var(--fd); } .wh-hp small { font: 700 10px/1.4 var(--fd); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.wtag { border-radius: 0; clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px); font: 700 10px/1.2 var(--fd); letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; }
.hpbar { height: 20px; border-radius: 0; box-shadow: none; border-color: rgba(217, 72, 59, .5); }
.hpbar u { border-radius: 0; box-shadow: none; background: repeating-linear-gradient(135deg, #d9483b 0 8px, #b93a30 8px 16px); }
.hpbar span { font: 700 11px/1 var(--fd); letter-spacing: .08em; }
.wtrack u { border-radius: 0; height: 5px; }
.wstep i { border-radius: 0; border: 0; width: 28px; height: 28px; background: var(--line2); color: var(--txt); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); font-size: 11px; }
.wstep.done i { background: var(--ok); } .wstep.cur i { background: #d9483b; color: #fff; }
.wstep span { font: 600 10.5px/1.2 var(--fd); letter-spacing: .06em; text-transform: uppercase; }
.wh-fx .gain { border-radius: 0; clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px); }
.way-chip { border-radius: 0; clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px); font: 600 11px/1 var(--fd); letter-spacing: .08em; text-transform: uppercase; }
.dn { border-radius: 0; border-left: 3px solid #d9483b; }
.dn-range { height: 8px; border-radius: 0; }
.dn-range::-webkit-slider-thumb { width: 14px; height: 14px; border-radius: 0; transform: rotate(45deg); box-shadow: 0 0 8px rgba(217, 72, 59, .7); }
.dn-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 0; transform: rotate(45deg); }
.dn-ico { border-radius: 0; }

/* Effort de guerre : « Mes contributions », une pastille cliquable par source */
.mc-list { display: grid; gap: 6px; }
.mc { width: 100%; text-align: left; color: var(--txt); cursor: pointer; padding-right: 14px; }
.mc:hover { border-color: var(--c); }
.mc .v { flex: 1; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 8px; }
.mc .cn { opacity: 1; } .mc b { font-size: 14px; }
#digInfo .price { display: flex; flex-wrap: nowrap; width: auto; }

/* ---------- Mobile : menu en onglets de section (menus montants) et colonies en panneau bas ---------- */
.nav-tab { display: none; }
.nav-items { display: contents; }
.cpk-list { display: grid; gap: 6px; }
.cpk-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: left; color: var(--txt); background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r); }
.cpk-row span { display: flex; flex-direction: column; min-width: 0; flex: 1; } .cpk-row b { font: 600 15px/1.2 var(--fd); } .cpk-row small { color: var(--mut); font-size: 12px; }
.cpk-row em { font: 700 10px/1 var(--fd); letter-spacing: .12em; text-transform: uppercase; color: var(--acc); }
.cpk-row.on { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 10%, var(--panel2)); } .cpk-row.pending { border-style: dashed; color: var(--mut); }
.cpk-row .ic { width: 18px; height: 18px; color: var(--mut); }
@media (max-width: 800px) {
  .side { overflow: visible; }
  .nav-sec { flex: 1 1 0; min-width: 0; flex-direction: column; position: static; }
  .nav-sec h4 { display: none; }
  .nav-tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; padding: 6px 2px; background: none; border: 0; border-radius: 0; color: var(--mut); font: 600 10px/1.2 var(--fd); letter-spacing: .04em; text-transform: uppercase; }
  .nav-tab .ic { width: 22px; height: 22px; color: var(--acc); opacity: .8; }
  .nav-tab::after { content: '▴'; position: absolute; top: 1px; left: 50%; transform: translateX(-50%); font-size: 8px; line-height: 1; color: var(--dim); transition: transform .15s; }
  .nav-sec.open .nav-tab::after { transform: translateX(-50%) rotate(180deg); }
  .nav-sec.cur .nav-tab, .nav-sec.open .nav-tab { color: var(--acc); background: color-mix(in srgb, var(--acc) 16%, transparent); }
  .nav-tab .badge { position: absolute; top: 4px; right: calc(50% - 20px); min-width: 9px; height: 9px; padding: 0; }
  .nav-items { display: none; }
  .nav-sec.open .nav-items { position: absolute; left: 6px; right: 6px; bottom: calc(100% + 6px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 8px; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: 0 -12px 40px rgba(0, 0, 0, .6); animation: sheetUp .18s cubic-bezier(.2, .8, .2, 1); }
  .nav-items .navi { flex: none; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 12px; font-size: 12px; letter-spacing: .05em; text-align: left; background: var(--panel2); border: 1px solid var(--line); }
  .nav-items .navi .ic { width: 20px; height: 20px; }
  .nav-items .navi .badge { position: static; margin-left: auto; }
  .nav-items .navi.on { background: color-mix(in srgb, var(--acc) 16%, var(--panel2)); border-color: var(--acc); }
  .nav-items .nav-chat { grid-column: 1 / -1; display: flex; gap: 6px; margin: 0; padding: 0; border: 0; } .nav-items .nav-chat[hidden] { display: none; }
  .nav-items .nav-chat .navi { flex: 1; font-size: 11px; text-transform: none; }
  /* colonies : un bouton compact, la liste s'ouvre en panneau bas */
  .cminis { display: none; }
  .cpick { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 12px; color: var(--txt); background: var(--panel2); border: 1px solid var(--acc); border-radius: var(--r); }
  .cpick b { font: 600 13px/1.2 var(--fd); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cpick > span { color: var(--acc); font-size: 11px; }
}

/* Messages privés sur mobile : la liste, ou la conversation, jamais les deux empilées ; un bouton ramène à la liste */
.pm-back { display: none; }
@media (max-width: 700px) {
  .pm.has-peer .pm-sidebar { display: none; } .pm:not(.has-peer) .pm-conv { display: none; }
  .pm-back { display: inline-flex; } .pm-list { max-height: none; }
}
@media (max-width: 800px) { .nav-items .nav-chat, .nav-items .nav-caret { display: none !important; } } /* mobile : les canaux sont déjà les onglets de la page Chat */

/* Profil et compte sur mobile : pas de défilement latéral, en-tête qui se replie, tuiles sur deux colonnes qui rétrécissent */
.sheet-sc { overflow-x: hidden; }
@media (max-width: 800px) {
  .pf-head { flex-wrap: wrap; gap: 10px 12px; align-items: center; }
  .pf-glyph { width: 56px; height: 56px; font-size: 24px; }
  .pf-head > .btn { order: 3; flex: 1 0 100%; justify-content: center; }
  .pf-stats, .pf-badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-k { padding: 6px 8px; column-gap: 7px; } .pf-k small { white-space: normal; line-height: 1.2; }
  .pf-priv, .pf-tabs { max-width: 100%; }
}

/* Colonies en panneau bas : le terrain de la colonie en fond, sa couleur de bonus en liseré */
.cpk-row { position: relative; overflow: hidden; border-left: 3px solid var(--sc, var(--line2)); min-height: 64px; }
.cpk-row > * { position: relative; z-index: 1; }
.cpk-row .cpk-art { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; pointer-events: none; }
.cpk-row:has(.cpk-art)::before { content: ''; position: absolute; inset: 0; z-index: 0; background: linear-gradient(90deg, rgba(10, 8, 6, .88), rgba(10, 8, 6, .35)); }
.cpk-row small { color: #d8cbb8; text-shadow: 0 1px 4px #000; } .cpk-row b { text-shadow: 0 1px 4px #000; }
/* Menu mobile : chaque section a sa couleur (celle de ses pages) */
@media (max-width: 800px) {
  .nav-tab .ic { color: var(--sc); opacity: .9; }
  .nav-sec.cur .nav-tab, .nav-sec.open .nav-tab { color: var(--sc); background: color-mix(in srgb, var(--sc) 16%, transparent); box-shadow: inset 0 2px 0 var(--sc); }
  .nav-sec.open .nav-items { border-top: 2px solid var(--sc); }
  .nav-items .navi { border-left: 3px solid var(--acc); }
  .nav-items .navi.on { background: color-mix(in srgb, var(--acc) 16%, var(--panel2)); color: var(--txt); }
}

/* Rangées de choix (classement, expéditions…) : sur mobile, un bouton qui ouvre la liste en panneau bas */
.tabpick, .cv-opsmenu { display: none; }
@media (max-width: 800px) {
  /* menu des convois : la rangée de raccourcis devient un menu déroulant dans le flux de la page (rien n'est recouvert) */
  #cvShortcuts > :not(.cv-opsmenu) { display: none; } .cv-opsmenu { display: block; width: 100%; }
  .cv-opspick { cursor: pointer; margin-bottom: 0 !important; } .cv-opspick > span { display: inline-flex; align-items: center; gap: 8px; } .cv-opspick .ic { width: 16px; height: 16px; color: var(--acc); }
  .cv-opspick > i { transition: transform .15s; } .cv-opsmenu[open] .cv-opspick > i { transform: rotate(180deg); }
  .cv-opsmenu .cv-dest-list { position: static; width: 100%; max-height: none; margin-top: 6px; box-shadow: none; } .cv-opsmenu .cv-dest-list .btn { padding: 10px 12px; }
  .tabpick, .cv-opspick { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; margin-bottom: 8px; padding: 9px 14px; color: var(--txt); background: var(--panel2); border: 1px solid var(--acc); border-radius: var(--r); font: 600 13px/1.2 var(--fd); letter-spacing: .04em; text-transform: uppercase; }
  .tabpick i, .cv-opspick i { font-style: normal; color: var(--acc); }
  .tabpick + .subtabs { display: none; }
  .tabpick.open + .subtabs { display: flex; flex-direction: column; margin-top: -4px; } .tabpick.open i { transform: rotate(180deg); }
  .rk-row .mut { order: 5; flex-basis: 100%; margin: -6px 0 0 48px; } /* classement : la précision passe sous le pseudo, le score reste aligné à droite */
}
@media (max-width: 800px) { .nav-sec:has(.navi[data-mode=zion]) :is(.nav-tab, .nav-items) .badge { display: none; } } /* mobile : pas de pastilles dans Gestion (colonies sans chantier, convois) */

/* Bouton de colonie visible sur toutes les pages qui dépendent de la colonie active (sur la page Colonie : mobile seulement) */
.cpick { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin-bottom: 8px; padding: 6px 12px; color: var(--txt); background: var(--panel2); border: 1px solid var(--acc); border-radius: var(--r); }
.cpick b { font: 600 13px/1.2 var(--fd); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cpick > span:last-child { color: var(--acc); font-size: 11px; }
.cpick.m-only { display: none; } .colbar .cpick { margin-bottom: 0; }
@media (max-width: 800px) { .cpick.m-only { display: inline-flex; } }
.si-row { display: inline-flex; gap: 4px; } .si { display: inline-grid; place-items: center; color: var(--mut); } .si .ic { width: 14px; height: 14px; }
.si.scrap { color: var(--scrap); } .si.cells { color: var(--cells); } .si.code { color: var(--code); } .si.energy { color: var(--energy); } .si.def { color: #fb7185; }
.cpk-row .si-row { flex: none; margin-left: auto; } .cpk-row .si .ic { width: 18px; height: 18px; }

/* Boutons : tous au gabarit biseauté du jeu (angles haut gauche et bas droit coupés) */
:is(.nav-tab, .nav-items .navi, .navcol, .cpick, .tabpick, .cv-opspick, .cpk-row, .ch-count, .sub, .pk-tab, .pm-i, .way-chip, .mk-r, .ghost, .who) { clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px); }
@media (max-width: 800px) { .nav-items .navi span { white-space: normal; line-height: 1.15; } } /* « Effort de guerre » tient sur deux lignes */

/* Bouton de colonie : mobile seulement (le bureau garde les tuiles par colonie) ; sur mobile il remplace les tuiles */
.cpick, .cpick.m-only { display: none; }
@media (max-width: 800px) { .cpick, .cpick.m-only { display: inline-flex; } .cpick + .slots { display: none; } }

/* Énergie dans l'en-tête : ▲ produite en vert, ▼ utilisée en rouge */
.chip small .ea-up, .chip small .ea-dn { font-weight: 700; } .chip small .ea-up { color: var(--ok); } .chip small .ea-dn { color: var(--bad); } /* pas « .dn » : cette classe est celle des lignes de don */
@media (max-width: 800px) { .nav-tab::after { display: none; } } /* mobile : pas de petites flèches sur les onglets du menu */
#s-energy { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 8px; }

/* ---------- Animations légères : arrivée de page, panneaux qui sortent, fenêtres qui apparaissent ---------- */
@keyframes pgIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes sheetOut { to { opacity: 0; transform: translateY(24px); } }
@keyframes dlgIn { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes fadeIn { from { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  #view.pg-in { animation: pgIn .18s ease-out; }
  .sheet.out { animation: sheetOut .15s ease-in forwards; pointer-events: none; }
  .col.right.closing { animation: sheetOut .14s ease-in forwards; pointer-events: none; }
  .modal:not([hidden]) { animation: fadeIn .15s ease-out; } .modal:not([hidden]) .dlg { animation: dlgIn .18s cubic-bezier(.2, .8, .2, 1); }
  .nav-sec.open .nav-items { animation: sheetUp .18s cubic-bezier(.2, .8, .2, 1); }
  .btn:not(:disabled):active, .cpk-row:active, .tabpick:active, .cv-opspick:active, .cpick:active, .nav-tab:active { transform: translateY(1px); }
}
@keyframes colIn { 0% { opacity: .2; } 100% { opacity: 1; } } /* très rapide, sans décalage : un fondu */
@media (prefers-reduced-motion: no-preference) { #view.col-in { animation: colIn .16s ease-out; } }

.rc-flow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; margin: 14px 0 8px; padding: 10px; background: var(--panel2); border: 1px solid var(--line); }
.rc-flow .chips { margin-top: 4px; } .rc-arrow { color: var(--acc); font-size: 18px; }
.rc-risk { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); background: var(--panel2); }
.rc-risk.ok { border-color: var(--acc); } .rc-risk > .ic { width: 20px; height: 20px; flex: none; color: var(--dim); } .rc-risk.ok > .ic { color: var(--acc); }
.rc-risk b, .rc-risk small { display: block; } .rc-risk small { color: var(--dim); font-size: 11px; }
@media (max-width: 480px) { .rc-flow { grid-template-columns: 1fr; } .rc-arrow { transform: rotate(90deg); justify-self: center; } }
.intel { display: grid; gap: 8px; margin: 8px 0; }
.it { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px; background: var(--panel2); border: 1px solid var(--line); }
.it .it-ic { grid-row: 1 / 3; color: var(--acc); } .it .it-ic .ic { width: 26px; height: 26px; }
.it b { font-size: 15px; font-variant-numeric: tabular-nums; } .it small { color: var(--dim); font-size: 11px; }
.it.wide { grid-template-rows: auto; } .it-body { display: grid; gap: 4px; } .it-body .chips { margin: 0; }

/* Attaque en approche (Convois) : la flotte ennemie avance vers la colonie, compte à rebours jusqu'à l'impact */
.cv-threat { padding: 12px; margin-bottom: 10px; border: 1px solid rgba(229, 83, 75, .55); background: linear-gradient(90deg, rgba(229, 83, 75, .1), transparent 70%), var(--panel2); }
.cv-threat > header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; } .cv-threat > header > .ic { color: var(--bad); }
.cv-threat > header > span:not(.mchip) { color: var(--mut); font-size: 13px; } .cv-threat > header > .mchip { margin-left: auto; }
.cv-threat .rl-trip { margin-bottom: 8px; background: var(--panel); } .cv-threat .rl-track u { background: linear-gradient(90deg, transparent, var(--bad)); } .cv-threat .rl-ship, .cv-threat .rl-left { color: var(--bad); }
.ct-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .ct-foot > span { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .ct-foot > span > .ic { color: var(--ok); }
.actrow.warn .ar-bar u { background: var(--bad); }

/* Rapports de flotte : issue de votre point de vue en tête (couleur), détail dépliable */
/* Rapports de convoi : lignes de l'historique des raids, dépliables */
.rh-d + .rh-d > .rh { border-top: 1px solid var(--line); } .rh-d > summary { cursor: pointer; list-style: none; } .rh-d > summary::-webkit-details-marker { display: none; }
.rh-d > summary:hover, .rh-d[open] > summary { background: var(--panel); } .rh.warn .rh-v { color: var(--warn); }
.cv-log .rh { grid-template-columns: 150px 78px minmax(90px, 1fr) 110px auto; } .cv-log .rh-col { color: var(--mut); }
.fr-body { display: grid; gap: 12px; padding: 4px 12px 12px; border-top: 1px solid var(--line); background: var(--panel); }
.fr-sec h5 { margin: 8px 0 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); }
.fr-vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; margin: 8px 0; }
.fr-vs > div { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-radius: var(--r); background: var(--panel); min-width: 0; }
.fr-vs > .foe { align-items: flex-end; text-align: right; } .fr-vs small { color: var(--mut); font-size: 11px; }
.fr-vs b { display: flex; align-items: center; gap: 4px; } .fr-vs .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.fr-pow { display: flex; align-items: center; gap: 4px; font-size: 18px; font-weight: 700; }
.fr-x { align-self: center; color: var(--dim); font-style: normal; font-size: 12px; text-transform: uppercase; }
.fr-vs .ok { color: var(--ok); } .fr-vs .warn { color: var(--warn); } .fr-vs .bad { color: var(--bad); }
.fr-rounds { width: 100%; border-collapse: collapse; font-size: 12px; } .fr-rounds :is(th, td) { padding: 3px 6px; text-align: right; border-bottom: 1px solid var(--line); }
.fr-rounds th { color: var(--mut); font-weight: 500; } .fr-rounds :is(th, td):first-child { text-align: left; }
.fr-out { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 8px; }
.fr-out .it { grid-template-columns: 22px 1fr; padding: 8px; height: 100%; } .fr-seen { display: flex; align-items: center; gap: 5px; margin-top: 6px; } .fr-seen .ic { width: 12px; height: 12px; } .fr-out .it-ic .ic { width: 20px; height: 20px; }
.it.ok .it-ic { color: var(--ok); } .it.bad .it-ic { color: var(--bad); } .it.bad { border-color: rgba(229, 83, 75, .35); }
.fr-more summary { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; list-style: none; color: var(--mut); font-size: 12px; } .fr-more summary::-webkit-details-marker { display: none; }
.fr-more summary .ic { width: 12px; height: 12px; transform: rotate(-90deg); transition: transform .15s; } .fr-more[open] summary .ic { transform: none; } .fr-more .fr-rounds { margin-top: 6px; } .fr-rounds th .ic { width: 13px; height: 13px; }
@media (max-width: 640px) { .fr-vs { grid-template-columns: 1fr; } .fr-vs > .foe { align-items: flex-start; text-align: left; } .fr-x { display: none; } .cv-log .rh { grid-template-columns: auto auto 1fr auto; } }

/* ---------- Signaler un bug : bouton flottant, fenêtre qui monte du bas sur mobile ---------- */
.bug-fab { position: fixed; right: 14px; bottom: 14px; z-index: 88; /* au-dessus des panneaux (85 sur mobile), sous les fenêtres (90) */ width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border-radius: 50%;
  background: var(--panel2); border: 1px solid var(--line2); color: var(--mut); box-shadow: 0 6px 20px rgba(0, 0, 0, .5); opacity: .75; cursor: pointer; transition: opacity .15s, color .15s, border-color .15s; }
.bug-fab:hover, .bug-fab:focus-visible { opacity: 1; color: var(--txt); border-color: var(--acc); }
.bug-fab .ic { width: 20px; height: 20px; }
.bug-dlg h3 { display: flex; align-items: center; gap: 8px; } .bug-dlg h3 .ic { width: 18px; height: 18px; color: var(--acc); }
.bug-dlg textarea { min-height: 110px; }
@media (max-width: 800px) {
  .bug-fab { right: 10px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 38px; height: 38px; }
  .bug-dlg { animation: sheetUp .26s cubic-bezier(.2, .8, .2, 1); }
}
@media (prefers-reduced-motion: reduce) { .bug-dlg { animation: none; } }

/* Bandeau mobile : installer l'application (PWA) */
#pwaBar { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 8px; right: 8px; z-index: 80; /* sous les panneaux et fenêtres */ display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px;
  background: var(--panel2); border: 1px solid var(--line2); border-left: 3px solid var(--acc); border-radius: var(--r); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font-size: 13px; }
#pwaBar span { flex: 1; }
#pwaBar .pwa-x { background: none; border: 0; color: var(--mut); font-size: 20px; line-height: 1; padding: 2px 6px; }

/* base de connaissance */
.wiki { display: flex; flex-direction: column; gap: 6px; } .wiki-s { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel2); }
.wiki-s summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; font-weight: 600; } .wiki-s summary .ic { width: 18px; height: 18px; color: var(--acc); }
.wiki-b { padding: 0 14px 12px; color: var(--mut); line-height: 1.55; font-size: 13.5px; } .wiki-b b { color: var(--txt); } .wiki-b ul { margin: 6px 0; padding-left: 18px; }

/* ---------- Matrice : carte en arbre (horizontale ; verticale sur mobile), arène de combat, cartes d'action, écran de fin ---------- */
.nmap { --px: 50px; --py: 34px; height: calc(var(--py) * 2 + 190px); min-width: calc(var(--n) * 74px + var(--px) * 2); }
.nmap > svg { position: absolute; left: var(--px); top: var(--py); width: calc(100% - var(--px) * 2); height: calc(100% - var(--py) * 2); overflow: visible; } .nmap .nm-v { display: none; }
.nm-n { left: calc(var(--px) + (100% - var(--px) * 2) * var(--a)); top: calc(var(--py) + (100% - var(--py) * 2) * var(--b)); }
.nmap line.old { stroke: var(--line); opacity: .5; } .nm-n.old { opacity: .35; }
.nm-n.opt { z-index: 2; } .nm-l { pointer-events: none; }
.arena.fight .arena-top .btn { display: none; }
.battle { position: relative; display: grid; grid-template-rows: auto auto; gap: 40px; padding: 18px; min-height: 300px; border-radius: var(--r); border: 1px solid var(--line); overflow: hidden;
  background: linear-gradient(180deg, rgba(6, 9, 8, .5), rgba(6, 9, 8, .88)), var(--art, none) center / cover no-repeat, var(--panel2); }
.battle .fighter { width: min(420px, 100%); background: rgba(10, 14, 12, .78); backdrop-filter: blur(3px); }
.battle .fighter.foe { justify-self: end; } .battle .fighter.me { justify-self: start; }
.battle .fighter .f-body { flex: 1; min-width: 0; } .battle .f-av { width: 76px; height: 76px; } .battle .f-av .ic { width: 38px; height: 38px; } .battle .fighter.foe.boss .f-av, .battle .fighter.foe.elite .f-av { width: 88px; height: 88px; }
.actgrid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.actbtn.has-art { grid-template-columns: 1fr; grid-template-rows: 92px auto auto; padding: 0 0 10px; text-align: center; justify-items: center; }
.actbtn.has-art .ab-art { width: 100%; height: 92px; object-fit: cover; border-bottom: 1px solid var(--line2); } .actbtn.has-art .ab-i { display: none; } .actbtn.has-art b, .actbtn.has-art small { padding: 0 8px; }
.actbtn.has-art.main { background: var(--panel2); color: var(--txt); border: 2px solid var(--acc); } .actbtn.has-art.main small { color: var(--mut); }
@media (hover: hover) { .actbtn.has-art:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0, 0, 0, .4); } }
.run-end { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 28px 18px; text-align: center; border: 1px solid var(--acc); border-radius: var(--r); background: radial-gradient(60% 80% at 50% 0%, color-mix(in srgb, var(--acc) 16%, transparent), transparent 70%), var(--panel2); }
.run-end.dead { border-color: var(--bad); background: radial-gradient(60% 80% at 50% 0%, rgba(229, 83, 75, .18), transparent 70%), var(--panel2); }
.re-h { display: flex; flex-direction: column; align-items: center; gap: 6px; } .re-h > .ic { width: 46px; height: 46px; color: var(--acc); } .run-end.dead .re-h > .ic { color: var(--bad); } .re-h h3 { margin: 0; font-size: 24px; }
.re-gains { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; width: min(640px, 100%); }
.re-g { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); } .re-g .ic { width: 22px; height: 22px; color: var(--acc); } .re-g b { font: 700 20px/1 var(--fd); } .re-g small { color: var(--mut); font-size: 11px; } .re-g.lack b, .re-g.lack .ic { color: var(--bad); }
@media (max-width: 800px) {
  .arena .arena-top { order: 10; } .arena-top .btn { width: 100%; }
  .nmap { --px: 26px; --py: 30px; height: calc(var(--n) * 70px + var(--py) * 2); min-width: 0; } .nmap .nm-h { display: none; } .nmap .nm-v { display: block; }
  .nm-n { left: calc(var(--px) + (100% - var(--px) * 2) * var(--b)); top: calc(var(--py) + (100% - var(--py) * 2) * var(--a)); width: 28px; height: 28px; font-size: 11px; }
  .nm-n .ic { width: 13px; height: 13px; } .nm-n.cur, .nm-n.boss { width: 34px; height: 34px; } .nm-n.opt { width: 42px; height: 42px; } .nm-n.opt .ic { width: 20px; height: 20px; } .nm-l small { display: none; }
  .battle { gap: 22px; padding: 12px; min-height: 0; } .battle .f-av { width: 54px; height: 54px; } .battle .fighter.foe.boss .f-av, .battle .fighter.foe.elite .f-av { width: 60px; height: 60px; }
  .actbtn.has-art { grid-template-rows: 70px auto auto; } .actbtn.has-art .ab-art { height: 70px; }
}
/* run de la Matrice en panneau plein écran (mobile) ; arène décalée façon Pokémon ; avatar : XP à côté du portrait */
.run-x { display: none; } .arena { position: relative; }
@media (max-width: 800px) {
  body.run-full { overflow: hidden; }
  body.run-full #view { position: fixed; inset: 0; z-index: 85; overflow-y: auto; overscroll-behavior: contain; min-height: 0; background: var(--panel); padding: calc(14px + env(safe-area-inset-top)) 12px calc(18px + env(safe-area-inset-bottom)); animation: sheetUp .26s cubic-bezier(.2, .8, .2, 1); }
  body.run-full .run-x { display: grid; top: 0; right: 0; }
  body.run-full .arena .turn { padding-right: 40px; } body.run-full .arena.fight { padding-top: 40px; }
  .actbtn.has-art.main { grid-column: auto; } /* cartes d'action : toutes de la même taille */
  .battle .fighter { width: 84%; padding: 8px 10px; }
  .av-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: center; } .av-card .av-main { display: contents; }
  .av-card .av-fig { grid-row: 1 / 3; } .av-card .av-glyph { width: 64px; height: 64px; } .av-card .av-name { margin: 0; align-self: end; } .av-card .xpwrap { align-self: start; } .av-card .av-stats { grid-column: 1 / -1; margin-top: 8px; }
}
