/* ============================================================
   screens.css — per-screen layout rules, scoped by data-screen
   so identically-named classes (.two, .slot, .bgrid) don't clash
   between screens. Mirrors the design prototype's screen styles.
   ============================================================ */

/* ---- SPA shell tweaks ---- */
.screen[hidden] { display: none; }

/* ============================ AUTH GATE (login / onboarding) ============================ */
#authGate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 40px;
  background:
    radial-gradient(ellipse 70% 42% at 50% -8%, rgba(138,20,16,.28), transparent 70%),
    radial-gradient(ellipse 50% 40% at 96% 108%, rgba(220,143,51,.1), transparent 70%),
    var(--ink-900);
  overflow: auto; }
#authGate[hidden] { display: none; }
#authGate .login { width: 440px; max-width: 100%; }
#authGate .mark { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 30px; }
#authGate .mark .sig { width: 84px; height: 84px; border-radius: 18px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 30%, #2a1a14, #0d0908); border: 1px solid var(--line-2);
  box-shadow: 0 0 0 1px rgba(207,43,34,.2), 0 14px 50px rgba(138,20,16,.4), inset 0 0 30px rgba(0,0,0,.6); }
#authGate .mark .sig svg { width: 48px; height: 48px; }
#authGate .mark .sig.logo { width: 152px; height: 152px; border-radius: 50%; padding: 0; overflow: hidden; background: #0d0908; }
#authGate .mark .sig.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
#authGate .mark h1 { font-size: 34px; letter-spacing: .04em; text-transform: uppercase; margin-top: 20px; text-shadow: 0 0 30px var(--blood-glow); }
#authGate .mark h1 b { color: var(--blood-bright); }
#authGate .mark .tl { font-family: var(--f-disp); font-weight: 600; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-top: 10px; }
#authGate .mark .sub { color: var(--ash); font-size: 13.5px; margin-top: 12px; max-width: 340px; line-height: 1.6; }
#authGate .discord { display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%; padding: 15px;
  border-radius: var(--r); background: linear-gradient(180deg, #5865F2, #4752c4); border: 1px solid #3c46a8; color: #fff;
  font-family: var(--f-disp); font-weight: 700; font-size: 15px; letter-spacing: .04em; cursor: pointer;
  box-shadow: 0 8px 24px rgba(88,101,242,.35); transition: .15s; }
#authGate .discord:hover { filter: brightness(1.08); }
#authGate .discord svg { width: 22px; height: 22px; }
#authGate .gate { display: flex; align-items: center; gap: 10px; justify-content: center; margin-top: 18px; font-size: 12.5px; color: var(--ash); }
#authGate .rule { height: 1px; margin: 24px 0; background: linear-gradient(90deg, transparent, var(--line-2), transparent); }
#authGate .roster { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
#authGate .av-s { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-family: var(--f-disp);
  font-weight: 800; font-size: 13px; color: var(--gold); background: linear-gradient(135deg, #3a2a20, #160f0c); border: 1px solid var(--line-2); }

/* ---- identity gate (who are you / my account) ---- */
#idGate { position: fixed; inset: 0; z-index: 190; display: grid; place-items: center; padding: 40px; overflow: auto;
  background: radial-gradient(ellipse 70% 42% at 50% -8%, rgba(138,20,16,.24), transparent 70%), rgba(8,6,5,.92); }
#idGate[hidden] { display: none; }
#idGate .idcard { width: 480px; max-width: 100%; }
#idGate .idmark { display: flex; align-items: center; gap: 13px; }
#idGate .idmark .sig { width: 52px; height: 52px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 30%, #2a1a14, #0d0908); border: 1px solid var(--line-2); box-shadow: 0 0 0 1px rgba(207,43,34,.2); }
#idGate .idmark .sig svg { width: 30px; height: 30px; }
#idGate .idmark .sig.logo { padding: 0; overflow: hidden; border-radius: 50%; background: #0d0908; }
#idGate .idmark .sig.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
#idGate .idmember { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--r-sm); cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); transition: .14s; text-align: left; width: 100%; }
#idGate .idmember:hover { border-color: var(--ember); background: var(--panel-2); }
#idGate .idmember.cur { border-color: var(--gold-dim); box-shadow: 0 0 0 1px rgba(203,165,86,.2); }
#idGate .idmember .av { width: 32px; height: 32px; border-radius: 7px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, #3a2a20, #160f0c); border: 1px solid var(--line-2); font-family: var(--f-disp); font-weight: 800; color: var(--gold); font-size: 14px; }
#idGate .idmember .nm { font-family: var(--f-disp); font-weight: 700; font-size: 14px; color: var(--bone); }
#idGate .idmember .mt { font-size: 11px; color: var(--ash); font-family: var(--f-mono); margin-top: 2px; }
/* clickable rail profile */
.rail-foot .prof { cursor: pointer; transition: .14s; }
.rail-foot .prof:hover { border-color: var(--line-2); background: var(--panel-2); }

/* ============================ SETUP ============================ */
[data-screen="setup"] .kpi-row { display: grid; grid-template-columns: repeat(6, 1fr); }
[data-screen="setup"] .two { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: start; }
[data-screen="setup"] .sec-hd { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--line); }
[data-screen="setup"] .sec-hd .chev { margin-left: auto; color: var(--ash); transition: .2s; }
[data-screen="setup"] .sec-hd.col .chev { transform: rotate(-90deg); }
[data-screen="setup"] .sec-hd.col { border-bottom: none; }
[data-screen="setup"] .sec-hd h3 { font-size: 13.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
[data-screen="setup"] .sec-hd .cnt { font-family: var(--f-mono); font-size: 11px; color: var(--ash); background: var(--ink-850); border: 1px solid var(--line); border-radius: 4px; padding: 1px 7px; }
/* ordered step flow (guided keep setup) */
[data-screen="setup"] .setup-flow { display: flex; flex-direction: column; gap: 18px; }
[data-screen="setup"] .setup-step .sec-hd .step-no {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--f-disp); font-weight: 700; font-size: 12px; color: #1a1208;
  background: linear-gradient(180deg, #d9b35e, #a07f33); border: 1px solid #6e571f; }
[data-screen="setup"] .setup-step.done .sec-hd .step-no { background: linear-gradient(180deg, #74a444, #4d7029); border-color: #3a5520; color: #0d1206; }
[data-screen="setup"] .setup-step.done .sec-hd .cnt.saved { color: var(--green-bright); border-color: rgba(116,164,68,.5); background: rgba(116,164,68,.12); }
/* nested collapsible tables inside a step */
[data-screen="setup"] .sub-block { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ink-900); overflow: hidden; }
[data-screen="setup"] .sub-block .sec-hd { padding: 10px 13px; }
[data-screen="setup"] .sub-block .sec-hd h3 { font-size: 12px; }
[data-screen="setup"] .sub-block > .panel-b { padding: 0 13px 13px; }
/* fortress skin cards (gear-style rank squares) */
.skin-card { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; background: var(--ink-850); border: 1px solid var(--line); border-radius: var(--r-sm); }
.skin-card.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.skin-card .sc-img { width: 48px; height: 48px; flex: none; border-radius: 6px; overflow: hidden; background: var(--panel); border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--ash-dim); }
.skin-card .sc-img img { width: 100%; height: 100%; object-fit: cover; }
.skin-card .sc-img svg { width: 22px; height: 22px; }
.skin-card .sc-body { flex: 1; min-width: 0; }
.skin-card .sc-name { font-size: 13px; font-weight: 600; color: var(--bone); display: flex; align-items: center; gap: 7px; }
.skin-card .sc-bonus { margin: 5px 0 8px; }
.skin-card .sc-b { font-family: var(--f-mono); font-size: 10.5px; color: var(--gold); line-height: 1.4; }
.skin-card .sc-b.muted { color: var(--ash); }
/* troops-in-keep rows */
[data-screen="setup"] .troop-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; background: var(--ink-850); border: 1px solid var(--line); border-radius: var(--r-sm); }
[data-screen="setup"] .troop-row .tr-name { font-weight: 600; color: var(--bone); }
[data-screen="setup"] .troop-row .tr-meta { font-family: var(--f-mono); font-size: 11px; color: var(--ash); }
[data-screen="setup"] .troop-row .tr-cnt { margin-left: auto; font-family: var(--f-mono); font-weight: 700; color: var(--gold); }
[data-screen="setup"] .wl { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; align-items: start; }
[data-screen="setup"] .wlcard { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--blood); border-radius: var(--r-sm); padding: 10px; }
[data-screen="setup"] .wlcard .wh { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
[data-screen="setup"] .wlcard .wn { font-family: var(--f-disp); font-weight: 700; font-size: 14px; color: var(--bone); }
[data-screen="setup"] .buffs { display: flex; flex-wrap: wrap; gap: 6px; }
[data-screen="setup"] .buff { display: flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 4px 8px; border-radius: 4px; border: 1px solid var(--line); color: var(--ash); background: var(--ink-850); cursor: pointer; }
[data-screen="setup"] .buff.on { color: var(--ember); border-color: var(--ember); background: rgba(220,143,51,.1); }
[data-screen="setup"] .buff .x { width: 13px; height: 13px; border-radius: 3px; border: 1px solid var(--line-2); display: grid; place-items: center; }
[data-screen="setup"] .buff.on .x { background: var(--ember); border-color: var(--ember); }
[data-screen="setup"] .buff.on .x svg { width: 9px; height: 9px; color: var(--ink-900); }
[data-screen="setup"] .buff .x svg { opacity: 0; }
[data-screen="setup"] .buff.on .x svg { opacity: 1; }
/* warlord editor rows */
[data-screen="setup"] .wl-name { width: auto; flex: 1; min-width: 0; background: var(--ink-850); font-family: var(--f-disp); font-weight: 700; font-size: 13.5px; color: var(--bone); padding: 6px 9px; }
[data-screen="setup"] .wl-brows { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
[data-screen="setup"] .wl-brow { display: grid; grid-template-columns: 26px minmax(0,1.1fr) minmax(0,0.8fr) minmax(0,1fr) 64px 26px; gap: 6px; align-items: center; }
[data-screen="setup"] .wl-brow .wl-tog { padding: 5px; justify-content: center; cursor: pointer; }
[data-screen="setup"] .wl-brow select { padding: 5px 6px; font-size: 11.5px; }
[data-screen="setup"] .wl-brow select:disabled { opacity: .4; }
[data-screen="setup"] .wl-pctwrap { position: relative; }
[data-screen="setup"] .wl-pctwrap input { text-align: right; padding-right: 18px; }
[data-screen="setup"] .wl-pctwrap .wl-pcts { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--ash); pointer-events: none; }
[data-screen="setup"] .wl-brow .btn-x { width: 24px; height: 24px; }
/* warlord card: avatar + level ranks + default-defender highlight (gear-style) */
[data-screen="setup"] .wlcard.defender { border-color: var(--gold); border-left-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-dim) inset, 0 0 14px rgba(203,165,86,.18); }
[data-screen="setup"] .wl-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
[data-screen="setup"] .wl-av { width: 32px; height: 32px; flex: none; border-radius: 6px; overflow: hidden; background: var(--ink-900); border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--ember); }
[data-screen="setup"] .wl-av img { width: 100%; height: 100%; object-fit: cover; }
[data-screen="setup"] .wl-av svg { width: 17px; height: 17px; }
[data-screen="setup"] .wrankrow { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
[data-screen="setup"] .wrankrow .wrank-lbl { font-size: 9.5px; color: var(--ash); margin-right: 3px; }
[data-screen="setup"] .wrank { font-family: var(--f-mono); font-size: 9px; font-weight: 700; color: rgba(255,255,255,.9); padding: 2px 5px; border-radius: 4px;
  border: 1px solid rgba(0,0,0,.5); background: var(--tc); opacity: .4; cursor: pointer; transition: .12s; box-shadow: 0 1px 2px rgba(0,0,0,.4) inset; }
[data-screen="setup"] .wrank:hover { opacity: .75; }
[data-screen="setup"] .wrank.on { opacity: 1; box-shadow: 0 0 0 2px var(--ink-900), 0 0 0 3px var(--tc); }
[data-screen="setup"] .wl-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
[data-screen="setup"] .wl-actions .btn { padding: 4px 9px; font-size: 11px; }
[data-screen="setup"] .wl-setdef.on { border-color: var(--gold); color: var(--gold); }
[data-screen="setup"] .wl-top .wl-nm { flex: 1; min-width: 0; font-family: var(--f-disp); font-weight: 700; font-size: 12px; color: var(--bone); }
[data-screen="setup"] .wl-top .badge { font-size: 9px; padding: 1px 5px; }
[data-screen="setup"] .wlcard.inwb { border-left-color: var(--gold); }
[data-screen="setup"] .wl-brows { display: flex; flex-direction: column; gap: 1px; }
[data-screen="setup"] .wl-brow2 { display: flex; align-items: center; gap: 7px; padding: 3px 5px; border-radius: var(--r-xs); }
[data-screen="setup"] .wl-brow2.on { background: rgba(203,165,86,.08); }
[data-screen="setup"] .wl-brow2 .wl-tog { padding: 3px; }
[data-screen="setup"] .wl-brow2 .wl-blabel { flex: 1; min-width: 0; font-size: 10.5px; color: var(--bone-dim); }
[data-screen="setup"] .wl-brow2.info .wl-blabel { color: var(--ash); }
[data-screen="setup"] .wl-brow2 .wl-bnote { color: var(--ash-dim); cursor: help; font-size: 10px; }
[data-screen="setup"] .wl-brow2 .wl-bpct { font-size: 10.5px; }
[data-screen="setup"] .wl-brow2 .wl-bpct { font-family: var(--f-mono); font-weight: 700; font-size: 12px; color: var(--gold); flex: none; }
[data-screen="setup"] .wl-brow2.on .wl-blabel { color: var(--bone); }
[data-screen="setup"] .bgrid { width: 100%; border-collapse: collapse; font-size: 12.5px; }
[data-screen="setup"] .bgrid th { font-family: var(--f-disp); font-weight: 700; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); padding: 8px 6px; text-align: right; border-bottom: 1px solid var(--line); }
[data-screen="setup"] .bgrid th:first-child { text-align: left; }
[data-screen="setup"] .bgrid td { padding: 7px 6px; border-bottom: 1px solid rgba(58,42,32,.5); text-align: right; }
[data-screen="setup"] .bgrid td:first-child { text-align: left; }
[data-screen="setup"] .bgrid tr:last-child td { border-bottom: none; }
[data-screen="setup"] .bgrid .pv { font-family: var(--f-mono); font-weight: 600; color: var(--bone); }
[data-screen="setup"] .bgrid .pv.z { color: var(--ash-dim); font-weight: 400; }
[data-screen="setup"] .bgrid .miss { color: var(--blood-bright); font-weight: 700; }
[data-screen="setup"] .stepwrap { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
[data-screen="setup"] .step { width: 26px; height: 26px; border-radius: 5px; border: 1px solid var(--line); background: var(--ink-850); color: var(--ash); display: grid; place-items: center; cursor: pointer; font-size: 15px; }
[data-screen="setup"] .step:hover { border-color: var(--ember); color: var(--ember); }
[data-screen="setup"] .stepval { width: 78px; }
/* ---- Gear Loadout (game-style equip + presets) ---- */
[data-screen="setup"] .gl-own { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
[data-screen="setup"] .gl-own .field.inline { flex-direction: row; align-items: center; gap: 8px; width: auto; }
[data-screen="setup"] .gl-own .field.inline select { width: 140px; }
[data-screen="setup"] .gl-presets { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
[data-screen="setup"] .gp-item.disabled { opacity: .6; }
[data-screen="setup"] .gp-item.disabled .gpi-img { filter: grayscale(1) brightness(.7); }
[data-screen="setup"] .gp-item.disabled .gpi-name { color: var(--ash); }
[data-screen="setup"] .gp-item.disabled .gpi-stat,
[data-screen="setup"] .gp-item.disabled .gpi-stat.combat,
[data-screen="setup"] .gp-item.disabled .gpi-stat b { color: var(--ash-dim); }
[data-screen="setup"] .gp-item .gpi-own { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--ash); cursor: pointer; }
[data-screen="setup"] .gp-item .gpi-own.owned { color: var(--green-bright); border-color: rgba(116,164,68,.5); background: rgba(116,164,68,.12); }
[data-screen="setup"] .gp-item .gpi-own.notowned { color: var(--blood-bright); border-color: #5c2018; background: rgba(207,43,34,.1); display: inline-flex; align-items: center; }
[data-screen="setup"] .gp-item .gpi-own:hover { filter: brightness(1.25); border-color: var(--ember); }
[data-screen="setup"] .gl-chips { display: flex; gap: 7px; flex-wrap: wrap; }
[data-screen="setup"] .gpreset { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 11px; border-radius: 99px; font-size: 12px; background: var(--ink-850); border: 1px solid var(--line-2); color: var(--bone-dim); cursor: pointer; }
[data-screen="setup"] .gpreset:hover { border-color: var(--ember); color: var(--bone); }
[data-screen="setup"] .gpreset .gpx { width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; color: var(--ash); font-size: 11px; }
[data-screen="setup"] .gpreset .gpx:hover { background: rgba(207,43,34,.2); color: var(--blood-bright); }
[data-screen="setup"] .gl-chips .empty { color: var(--ash-dim); font-size: 12px; align-self: center; }

[data-screen="setup"] .gear-equip { display: grid; grid-template-columns: 152px 1fr 152px; grid-template-rows: repeat(3, 1fr); gap: 12px; align-items: stretch; max-width: 660px; margin: 0 auto; }
[data-screen="setup"] .gear-figure { grid-column: 2; grid-row: 1 / span 3; min-height: 320px; border-radius: var(--r-lg); border: 1px solid var(--line-2);
  background: radial-gradient(ellipse 70% 55% at 50% 32%, rgba(138,20,16,.30), transparent 70%), linear-gradient(180deg, var(--ink-850), var(--ink-900));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; position: relative; overflow: hidden; box-shadow: inset 0 0 40px rgba(0,0,0,.6); }
[data-screen="setup"] .gear-figure::before { content: ""; position: absolute; inset: 0; opacity: .5; mix-blend-mode: overlay;
  background-image: repeating-linear-gradient(135deg, rgba(201,164,76,.06) 0 2px, transparent 2px 9px); }
[data-screen="setup"] .gear-figure .gf-sigil { width: 92px; height: 92px; border-radius: 20px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 30%, #2a1a14, #0d0908); border: 1px solid var(--line-2); box-shadow: 0 0 0 1px rgba(207,43,34,.2), 0 14px 44px rgba(138,20,16,.4); position: relative; z-index: 1; }
[data-screen="setup"] .gear-figure .gf-sigil svg { width: 52px; height: 52px; }
[data-screen="setup"] .gear-figure .gf-name { font-family: var(--f-disp); font-weight: 800; font-size: 17px; letter-spacing: .03em; color: var(--bone); text-transform: uppercase; z-index: 1; text-align: center; padding: 0 10px; }
[data-screen="setup"] .gear-figure .gf-sub { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); z-index: 1; }

[data-screen="setup"] .gear-slot2 { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px; cursor: pointer; position: relative;
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-2); border-radius: var(--r); transition: .14s; box-shadow: 0 0 0 1px rgba(201,164,76,.08) inset; }
[data-screen="setup"] .gear-slot2:hover { border-color: var(--ember); }
[data-screen="setup"] .gear-slot2.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-dim), 0 0 14px rgba(203,165,86,.25); }
[data-screen="setup"] .gear-slot2.empty { border-style: dashed; }
[data-screen="setup"] .gear-slot2 .gsl-slot { font-family: var(--f-disp); font-weight: 700; font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--ash); }
[data-screen="setup"] .gear-slot2 .gsl-ico { width: 46px; height: 46px; border-radius: 9px; display: grid; place-items: center; overflow: hidden; background: var(--ink-850); border: 1px solid var(--line-2); color: var(--ember); }
[data-screen="setup"] .gear-slot2.empty .gsl-ico { color: var(--ash-dim); }
[data-screen="setup"] .gear-slot2 .gsl-ico svg { width: 22px; height: 22px; }
[data-screen="setup"] .gear-slot2 .gsl-ico img { width: 100%; height: 100%; object-fit: cover; }
[data-screen="setup"] .gear-slot2 .gsl-name { font-size: 11px; font-weight: 600; color: var(--bone); line-height: 1.2; text-align: center; }
[data-screen="setup"] .gear-slot2.empty .gsl-name { color: var(--ash-dim); font-weight: 500; }

[data-screen="setup"] .gear-picker { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
[data-screen="setup"] .gear-picker[hidden] { display: none; }
[data-screen="setup"] .gp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
[data-screen="setup"] .gp-head h4 { font-family: var(--f-disp); font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
/* all-slots "unlock" mode: one section per slot, stacked */
[data-screen="setup"] .gp-slotsec { margin-bottom: 16px; }
[data-screen="setup"] .gp-slothd { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
  font-family: var(--f-disp); font-weight: 700; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--bone); }
/* per-unit gear impact (DPU / SOAK) */
[data-screen="setup"] #gearUnitStats { margin-top: 14px; }
[data-screen="setup"] .gus-title { font-size: 11.5px; color: var(--ash); margin-bottom: 9px; text-align: center; }
[data-screen="setup"] .gus-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
[data-screen="setup"] .gus-card { flex: 1; min-width: 190px; max-width: 300px; background: var(--ink-850); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; }
[data-screen="setup"] .gus-name { font-size: 12.5px; font-weight: 600; color: var(--bone); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
[data-screen="setup"] .gus-role { font-family: var(--f-disp); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #1a1208; background: linear-gradient(180deg,#d9b35e,#a07f33); border-radius: 3px; padding: 1px 5px; }
[data-screen="setup"] .gus-t { font-family: var(--f-mono); font-size: 10px; color: var(--ash); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; margin-left: auto; }
[data-screen="setup"] .gus-stats { display: flex; gap: 18px; }
[data-screen="setup"] .gus-stat { display: flex; flex-direction: column; gap: 1px; }
[data-screen="setup"] .gus-k { font-family: var(--f-disp); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--ash); }
[data-screen="setup"] .gus-v { font-family: var(--f-mono); font-weight: 700; font-size: 16px; line-height: 1.1; }
[data-screen="setup"] .gus-v.off { color: var(--blood-bright); }
[data-screen="setup"] .gus-v.dur { color: var(--steel-bright); }
[data-screen="setup"] .gus-v small { font-size: 10px; opacity: .8; }
[data-screen="setup"] .gus-total { margin-top: 7px; padding-top: 6px; border-top: 1px solid var(--line); font-family: var(--f-mono); font-size: 10px; color: var(--ash); }
[data-screen="setup"] .gus-total b { color: var(--bone); }
[data-screen="setup"] .gus-grand { margin-top: 12px; text-align: center; font-family: var(--f-mono); font-size: 12px; color: var(--ash); }
[data-screen="setup"] .gus-grand b.off { color: var(--blood-bright); }
[data-screen="setup"] .gus-grand b.dur { color: var(--steel-bright); }
[data-screen="setup"] .gus-warn { margin-top: 7px; font-family: var(--f-mono); font-size: 9.5px; line-height: 1.4; color: var(--gold); }
[data-screen="setup"] .gus-warn b { color: var(--blood-bright); }
[data-screen="setup"] .gus-warn .gus-warn-t { color: var(--ash); }
/* packed (masonry-style) columns so short cards don't stretch to the tallest in a row */
[data-screen="setup"] .gp-list { columns: 232px; column-gap: 8px; }
[data-screen="setup"] .gp-item { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 9px 10px; border-radius: var(--r-sm); background: var(--ink-850); border: 1px solid var(--line); cursor: pointer; transition: .12s; break-inside: avoid; margin-bottom: 8px; }
[data-screen="setup"] .gp-item:hover { border-color: var(--ember); background: var(--ink-800); }
[data-screen="setup"] .gp-item.on { border-color: var(--gold); }
[data-screen="setup"] .gp-item .gpi-img { width: 42px; height: 42px; flex: none; border-radius: 6px; object-fit: cover; border: 1px solid var(--line-2); background: var(--panel); display: grid; place-items: center; color: var(--ash-dim); overflow: hidden; }
[data-screen="setup"] .gp-item .gpi-img svg { width: 18px; height: 18px; }
[data-screen="setup"] .gp-item .gpi-body { flex: 1; min-width: 0; }
/* tier switcher (in-game-style coloured squares) */
.tsqrow { display: flex; gap: 5px; margin-top: 7px; }
.tsq { width: 19px; height: 19px; border-radius: 4px; display: grid; place-items: center; cursor: pointer;
  font-family: var(--f-mono); font-size: 10px; font-weight: 700; color: rgba(255,255,255,.85); border: 1px solid rgba(0,0,0,.5);
  background: var(--tc); opacity: .38; transition: .12s; box-shadow: 0 1px 2px rgba(0,0,0,.4) inset; }
.tsq:hover { opacity: .75; }
.tsq.on { opacity: 1; box-shadow: 0 0 0 2px var(--ink-900), 0 0 0 3px var(--tc); }
[data-screen="setup"] .gp-item.tiered { cursor: pointer; }
[data-screen="setup"] .gp-item .gpi-name { font-size: 12.5px; font-weight: 600; color: var(--bone); line-height: 1.25; }
[data-screen="setup"] .gp-item .gpi-tags { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
/* gear stats — one row per buff (was one cramped run-on line): bold amount left, label wraps right */
[data-screen="setup"] .gp-item .gpi-stats { display: flex; flex-direction: column; gap: 3px; margin-top: 7px; }
[data-screen="setup"] .gp-item .gpi-stat {
  display: flex; gap: 7px; align-items: baseline;
  font-family: var(--f-mono); font-size: 10.5px; line-height: 1.35; color: var(--ash); }
[data-screen="setup"] .gp-item .gpi-stat b {
  flex: none; min-width: 44px; text-align: right; font-weight: 700; color: var(--ash-dim); }
[data-screen="setup"] .gp-item .gpi-stat .gst-l { flex: 1; min-width: 0; }
[data-screen="setup"] .gp-item .gpi-stat.combat { color: var(--bone); }
[data-screen="setup"] .gp-item .gpi-stat.combat b { color: var(--gold); }
@media (max-width: 560px) {
  [data-screen="setup"] .gear-equip { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  [data-screen="setup"] .gear-figure { grid-column: 1 / -1; grid-row: auto; min-height: 160px; order: -1; }
}
/* editable bonus-grid cells */
[data-screen="setup"] .bgrid td .gcell { width: 100%; min-width: 46px; text-align: right; font-family: var(--f-mono); font-weight: 600; font-size: 12.5px; color: var(--bone); background: transparent; border: 1px solid transparent; border-radius: var(--r-xs); padding: 3px 5px; }
[data-screen="setup"] .bgrid td { padding: 4px 4px; }
[data-screen="setup"] .bgrid td .gcell:hover { border-color: var(--line); background: var(--ink-850); }
[data-screen="setup"] .bgrid td .gcell:focus { outline: none; border-color: var(--ember); background: var(--ink-800); box-shadow: 0 0 0 2px rgba(220,143,51,.16); color: var(--bone); }
[data-screen="setup"] .bgrid td .gcell.miss { border-color: var(--blood); color: var(--blood-bright); }
[data-screen="setup"] .bgrid td .gcell::placeholder { color: var(--blood-bright); }

/* ============================ WARBAND ============================ */
[data-screen="warband"] .two { display: grid; grid-template-columns: 1fr 350px; gap: 18px; align-items: start; }
[data-screen="warband"] .setup-flow { display: flex; flex-direction: column; gap: 18px; }
/* sticky live-stats header — auto-updates, stays on scroll */
[data-screen="warband"] .wb-livehdr { position: sticky; top: 64px; z-index: 6; display: grid; grid-template-columns: repeat(8, 1fr); gap: 1px;
  margin-bottom: 18px; background: var(--line); border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
[data-screen="warband"] .wlh-stat { display: flex; flex-direction: column; gap: 3px; padding: 9px 10px; background: linear-gradient(180deg, var(--ink-850), var(--ink-900)); }
[data-screen="warband"] .wlh-stat .k { font-family: var(--f-disp); font-weight: 700; font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ash); white-space: nowrap; }
[data-screen="warband"] .wlh-stat .v { font-family: var(--f-mono); font-weight: 700; font-size: 14px; line-height: 1.1; color: var(--bone); }
[data-screen="warband"] .wlh-stat .v.off { color: var(--blood-bright); }
[data-screen="warband"] .wlh-stat .v.dur { color: var(--steel-bright); }
[data-screen="warband"] .wlh-stat .v.gold { color: var(--gold); }
[data-screen="warband"] .wlh-stat .v small { font-size: 9px; opacity: .8; }
@media (max-width: 760px) { [data-screen="warband"] .wb-livehdr { grid-template-columns: repeat(4, 1fr); } }
/* FULL CALC combo-table highlights */
[data-screen="warband"] .dtable tr.hl-ratio td { background: rgba(203,165,86,.12); }
[data-screen="warband"] .dtable tr.hl-ratio td:first-child b { color: var(--gold); }
[data-screen="warband"] .dtable tr.hl-dmg td:first-child b { color: var(--blood-bright); }
[data-screen="warband"] .dtable tr.hl-soak td:first-child b { color: var(--steel-bright); }
[data-screen="warband"] .wb-livehdr + .setup-flow .dtable { font-size: 12px; }
/* TOTAL AUTO include/exclude toggles */
[data-screen="warband"] .tatoggle { font-size: 11px; }
[data-screen="warband"] .tatoggle.on { border-color: var(--gold); color: var(--gold); }
/* collapsible Warband Builder panels (chevron via ::after) */
[data-screen="warband"] .panel-h[data-collapse] { cursor: pointer; user-select: none; }
[data-screen="warband"] .panel-h[data-collapse]::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ash); border-bottom: 2px solid var(--ash); transform: rotate(45deg); transition: transform .18s; flex: none; margin-left: 8px; margin-bottom: 2px; }
[data-screen="warband"] .panel-h[data-collapse]:not(:has(.sub))::after { margin-left: auto; }
[data-screen="warband"] .panel.col > .panel-h[data-collapse]::after { transform: rotate(-45deg); }
[data-screen="warband"] .panel.col > .panel-h[data-collapse] { border-bottom: none; }
[data-screen="warband"] .panel.col > .panel-b { display: none; }
/* city buffs & titles toggles */
[data-screen="warband"] .citygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); gap: 7px; align-items: start; }
[data-screen="warband"] .citytoggle { text-align: left; background: var(--ink-850); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 9px; cursor: pointer; color: var(--bone); transition: border-color .12s, background .12s; }
[data-screen="warband"] .citytoggle:hover { border-color: var(--ash-dim); }
[data-screen="warband"] .citytoggle.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; background: rgba(203,165,86,.08); }
[data-screen="warband"] .citytoggle .ct-h { display: flex; align-items: baseline; gap: 6px; }
[data-screen="warband"] .citytoggle .ct-n { font-weight: 600; font-size: 11px; }
[data-screen="warband"] .citytoggle .ct-r { font-size: 8px; letter-spacing: .03em; text-transform: uppercase; color: var(--ash); }
[data-screen="warband"] .citytoggle .ct-x { margin-left: auto; color: var(--gold); font-weight: 700; font-size: 11px; }
[data-screen="warband"] .citytoggle .ct-b { margin-top: 6px; font-family: var(--f-mono); font-size: 9.5px; line-height: 1.35; display: flex; flex-direction: column; gap: 2px; }
[data-screen="warband"] .ct-line { display: flex; justify-content: space-between; gap: 8px; }
[data-screen="warband"] .ct-line .l { min-width: 0; }
[data-screen="warband"] .ct-line .v { flex: none; font-weight: 700; }
[data-screen="warband"] .ct-line { color: var(--gold); }
[data-screen="warband"] .ct-line.info { color: var(--ash-dim); }
[data-screen="warband"] .wb-ct th, [data-screen="warband"] .wb-ct td { padding: 7px 6px; }
[data-screen="warband"] .wb-ct th { font-size: 8.5px; letter-spacing: .06em; }
[data-screen="warband"] .wb-ct .num { font-size: 11px; }
[data-screen="warband"] .slot { display: grid; grid-template-columns: 22px 88px 1fr 92px 130px 28px; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px; }
[data-screen="warband"] .slot.tank { border-left: 3px solid var(--steel); }
[data-screen="warband"] .slot.dps { border-left: 3px solid var(--blood-bright); }
[data-screen="warband"] .grip { color: var(--ash-dim); cursor: grab; display: grid; place-items: center; }
[data-screen="warband"] .grip svg { width: 14px; height: 16px; }
[data-screen="warband"] .uname { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
[data-screen="warband"] .uname .un { font-weight: 600; color: var(--bone); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-screen="warband"] .uname .ut { font-size: 11px; color: var(--ash); display: flex; align-items: center; gap: 6px; }
[data-screen="warband"] .qty { position: relative; }
[data-screen="warband"] .qty input { text-align: right; padding-right: 30px; }
[data-screen="warband"] .qty .u { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--ash); font-family: var(--f-mono); pointer-events: none; }
[data-screen="warband"] .contrib { text-align: right; font-family: var(--f-mono); font-size: 12px; }
[data-screen="warband"] .contrib .o { color: var(--blood-bright); font-weight: 600; }
[data-screen="warband"] .contrib .d { color: var(--steel-bright); font-size: 11px; }
[data-screen="warband"] .capwrap { display: flex; flex-direction: column; gap: 7px; }

/* ============================ MARCH ============================ */
[data-screen="march"] .two { display: grid; grid-template-columns: 1fr 350px; gap: 18px; align-items: start; }
[data-screen="march"] .champ { display: flex; gap: 14px; align-items: center; }
[data-screen="march"] .champ .portrait { width: 64px; height: 64px; border-radius: var(--r); flex: none; background: linear-gradient(135deg,#3a2a20,#160f0c); border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--gold); font-family: var(--f-disp); font-weight: 800; font-size: 26px; box-shadow: inset 0 0 18px rgba(0,0,0,.6); }
[data-screen="march"] .champ .ci2 { min-width: 0; }
[data-screen="march"] .champ .cn { font-family: var(--f-disp); font-weight: 700; font-size: 19px; color: var(--bone); }
[data-screen="march"] .champ .cm { font-size: 12.5px; color: var(--ash); margin-top: 3px; }
[data-screen="march"] .gear { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
[data-screen="march"] .gitem { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; }
[data-screen="march"] .gitem .gi { width: 32px; height: 32px; border-radius: 6px; flex: none; display: grid; place-items: center; background: var(--ink-850); border: 1px solid var(--line-2); color: var(--ember); }
[data-screen="march"] .gitem .gi svg { width: 16px; height: 16px; }
[data-screen="march"] .gitem .gn { font-size: 12px; color: var(--bone-dim); font-weight: 500; line-height: 1.3; }
[data-screen="march"] .gitem .gv { font-family: var(--f-mono); font-size: 11px; color: var(--gold); margin-top: 2px; }
[data-screen="march"] .gitem.empty-slot { border-style: dashed; opacity: .6; }
/* champion march gear editor rows */
[data-screen="march"] .cmg-row { display: grid; grid-template-columns: 26px 1fr 72px 26px; gap: 8px; align-items: center; }
[data-screen="march"] .cmg-row .cmg-tog { padding: 5px; justify-content: center; cursor: pointer; }
[data-screen="march"] .cmg-row select { padding: 6px 7px; font-size: 12px; }
[data-screen="march"] .cmg-row .wl-pctwrap { position: relative; }
[data-screen="march"] .cmg-row .wl-pctwrap input { text-align: right; padding-right: 18px; }
[data-screen="march"] .cmg-row .wl-pcts { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--ash); pointer-events: none; }

/* ============================ DEFENDER ============================ */
[data-screen="defender"] .two { display: grid; grid-template-columns: 1fr 350px; gap: 18px; align-items: start; }
[data-screen="defender"] .bgrid { width: 100%; border-collapse: collapse; font-size: 12.5px; }
[data-screen="defender"] .bgrid th { font-family: var(--f-disp); font-weight: 700; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); padding: 8px 6px; text-align: right; border-bottom: 1px solid var(--line); }
[data-screen="defender"] .bgrid th:first-child { text-align: left; }
[data-screen="defender"] .bgrid td { padding: 7px 6px; border-bottom: 1px solid rgba(58,42,32,.5); text-align: right; }
[data-screen="defender"] .bgrid td:first-child { text-align: left; }
[data-screen="defender"] .bgrid tr:last-child td { border-bottom: none; }
[data-screen="defender"] .bgrid .pv { font-family: var(--f-mono); font-weight: 600; color: var(--steel-bright); }
[data-screen="defender"] .marchrow { display: grid; grid-template-columns: 28px 1fr 92px 96px 28px; gap: 11px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; }
[data-screen="defender"] .marchrow .ord { width: 24px; height: 24px; border-radius: 5px; display: grid; place-items: center; background: var(--ink-850); border: 1px solid var(--line-2); font-family: var(--f-mono); font-weight: 700; font-size: 12px; color: var(--steel-bright); }
[data-screen="defender"] .marchrow.first .ord { background: rgba(207,43,34,.16); border-color: rgba(207,43,34,.4); color: var(--blood-bright); }

/* ============================ RESULT ============================ */
[data-screen="result"] .two { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
[data-screen="result"] .strike { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; padding: 10px 14px; border-bottom: 1px dotted rgba(58,42,32,.6); }
[data-screen="result"] .strike:last-child { border: none; }
[data-screen="result"] .side { display: flex; flex-direction: column; gap: 2px; }
[data-screen="result"] .side.r { text-align: right; align-items: flex-end; }
[data-screen="result"] .side .nm { font-size: 12.5px; color: var(--bone-dim); font-weight: 500; }
[data-screen="result"] .side .vv { font-family: var(--f-mono); font-weight: 600; font-size: 13px; }
[data-screen="result"] .arrow { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink-850); border: 1px solid var(--line-2); color: var(--blood-bright); }
[data-screen="result"] .arrow svg { width: 15px; height: 15px; }
[data-screen="result"] .arrow.def { color: var(--steel-bright); }
[data-screen="result"] .bdrow { display: grid; grid-template-columns: 140px 1fr 84px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid rgba(58,42,32,.5); }
[data-screen="result"] .bdrow:last-child { border: none; }
[data-screen="result"] .bdrow .un { font-size: 12.5px; color: var(--bone-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-screen="result"] .bdrow .vv { text-align: right; font-family: var(--f-mono); font-weight: 600; font-size: 12.5px; color: var(--blood-bright); }
[data-screen="result"] .lossbar { height: 6px; border-radius: 99px; background: var(--ink-850); overflow: hidden; border: 1px solid var(--line); }

/* ============================ RECOMMEND ============================ */
[data-screen="recommend"] .two { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
[data-screen="recommend"] .rectabs { display: flex; gap: 6px; margin-bottom: 16px; }
[data-screen="recommend"] .rectab { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--r-sm); cursor: pointer; font-family: var(--f-disp); font-weight: 700; font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--ash); border: 1px solid var(--line); background: var(--panel); }
[data-screen="recommend"] .rectab svg { width: 15px; height: 15px; }
[data-screen="recommend"] .rectab.on { color: var(--ember); border-color: var(--ember); background: rgba(220,143,51,.1); }
[data-screen="recommend"] .optcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; position: relative; }
[data-screen="recommend"] .optcard.best { border-color: var(--gold-dim); box-shadow: 0 0 0 1px rgba(203,165,86,.2), 0 8px 24px rgba(0,0,0,.4); }
[data-screen="recommend"] .optcard .crown { position: absolute; top: -10px; left: 14px; }
[data-screen="recommend"] .cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 12px; }
[data-screen="recommend"] .cmpcol { background: var(--ink-850); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px; }
[data-screen="recommend"] .cmpcol .ch { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ash); font-weight: 600; margin-bottom: 8px; }
[data-screen="recommend"] .cmpline { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; }
[data-screen="recommend"] .cmpline .l { color: var(--ash); }
[data-screen="recommend"] .cmpline .v { font-family: var(--f-mono); font-weight: 600; color: var(--bone); }
[data-screen="recommend"] .gear-rec { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(58,42,32,.5); }
[data-screen="recommend"] .gear-rec:last-child { border: none; }
[data-screen="recommend"] .gear-rec .gi { width: 34px; height: 34px; border-radius: 7px; flex: none; display: grid; place-items: center; background: var(--ink-850); border: 1px solid var(--line-2); color: var(--ember); }
[data-screen="recommend"] .gear-rec .gi svg { width: 17px; height: 17px; }
[data-screen="recommend"] .ally { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid rgba(58,42,32,.5); }
[data-screen="recommend"] .ally:last-child { border: none; }
[data-screen="recommend"] .ally .av { width: 30px; height: 30px; border-radius: 6px; flex: none; display: grid; place-items: center; background: linear-gradient(135deg,#3a2a20,#1a1310); border: 1px solid var(--line-2); font-family: var(--f-disp); font-weight: 800; color: var(--gold); font-size: 12px; }

/* ============================ PLAYERS roster ============================ */
[data-screen="players"] .two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
[data-screen="players"] .pcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; }
[data-screen="players"] .pcard .ph { display: flex; align-items: center; gap: 9px; }
[data-screen="players"] .pcard .pn { font-family: var(--f-disp); font-weight: 700; font-size: 14px; color: var(--bone); }
[data-screen="players"] .pcard .pmeta { font-family: var(--f-mono); font-size: 11px; color: var(--ash); margin: 7px 0 10px; }
[data-screen="players"] .pcard .ppresets { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 11px; }
[data-screen="players"] .pcard .ppreset { display: inline-flex; align-items: center; gap: 6px; padding: 3px 5px 3px 9px; border-radius: 99px; font-size: 11px; background: var(--ink-850); border: 1px solid var(--line-2); color: var(--bone-dim); }
[data-screen="players"] .pcard .ppreset .ppx { width: 15px; height: 15px; display: grid; place-items: center; border-radius: 50%; color: var(--ash); font-size: 10px; cursor: pointer; }
[data-screen="players"] .pcard .ppreset .ppx:hover { background: rgba(207,43,34,.2); color: var(--blood-bright); }
[data-screen="players"] .pcard .prow { display: flex; gap: 7px; flex-wrap: wrap; }

/* ============================ STATES (units/scout placeholders) ============================ */
[data-screen] .three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
[data-screen] .statehead { font-family: var(--f-disp); font-weight: 700; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ash); margin-bottom: 10px; }

/* ---- responsive: tablet (768) ---- */
@media (max-width: 1100px) {
  [data-screen="setup"] .two,
  [data-screen="warband"] .two,
  [data-screen="march"] .two,
  [data-screen="defender"] .two,
  [data-screen="result"] .two,
  [data-screen="recommend"] .two,
  [data-screen="scout"] .two { grid-template-columns: 1fr !important; }
  [data-screen="setup"] .kpi-row { grid-template-columns: repeat(3, 1fr); }
}
/* keyboard focus + active nav affordance */
.nav-i:focus-visible { outline: none; box-shadow: var(--ring); }
.nav-i[aria-current="page"] { /* mirrors .on; set by app.js */ }
/* tablet: keep the sidebar, just make it narrower (desktop-first scaled down) */
@media (max-width: 980px) {
  .app { grid-template-columns: 196px 1fr; }
  .content { padding: 20px 18px 60px; }
  [data-screen="setup"] .kpi-row { grid-template-columns: repeat(2, 1fr); }
}
/* mobile: collapse the rail to a horizontal wrapping bar */
@media (max-width: 640px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .rail::after { display: none; }
  .rail-nav { flex-direction: row; flex-wrap: wrap; overflow: visible; padding: 8px 10px; }
  .nav-grp { display: none; }
  .nav-i.on::before { display: none; }
  .rail-foot { margin-left: auto; border-top: none; }
  /* stack dense composition rows so they don't force horizontal scroll */
  [data-screen="warband"] .slot,
  [data-screen="defender"] .marchrow { grid-template-columns: 1fr 1fr !important; gap: 7px; }
  [data-screen="warband"] .slot .uname,
  [data-screen="warband"] .slot .grip { grid-column: 1 / -1; }
  [data-screen="march"] .slot { grid-template-columns: 1fr 1fr !important; }
  [data-screen="setup"] .kpi-row { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px 12px 50px; }
}
/* Battle Simulator */
[data-screen="battlesim"] .bs-typebar { display: flex; gap: 8px; margin-bottom: 18px; }
[data-screen="battlesim"] .bs-type { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; background: var(--ink-850); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ash); font-family: var(--f-disp); font-weight: 700; font-size: 13px; letter-spacing: .04em; cursor: pointer; }
[data-screen="battlesim"] .bs-type svg { width: 16px; height: 16px; }
[data-screen="battlesim"] .bs-type:hover { color: var(--bone); border-color: var(--ash-dim); }
[data-screen="battlesim"] .bs-type.on { color: var(--blood-bright); border-color: var(--blood); background: rgba(207,43,34,.08); box-shadow: 0 0 0 1px var(--blood) inset; }
[data-screen="battlesim"] .bs-srcrow { display: flex; gap: 8px; }
[data-screen="battlesim"] .bs-srcbtn { flex: 1; justify-content: center; }
[data-screen="battlesim"] .bs-srcbtn.on { border-color: var(--gold); color: var(--gold); }
[data-screen="battlesim"] .bs-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
[data-screen="battlesim"] .bs-sum > div { background: var(--ink-900); padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; }
[data-screen="battlesim"] .bs-sum .k { font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ash); }
[data-screen="battlesim"] .bs-sum .v { font-family: var(--f-mono); font-weight: 700; font-size: 13px; color: var(--bone); }
[data-screen="battlesim"] .bs-sum .v.off { color: var(--blood-bright); }
[data-screen="battlesim"] .bs-sum .v.dur { color: var(--steel-bright); }
[data-screen="battlesim"] .bs-sum .v.gold { color: var(--gold); }
[data-screen="battlesim"] .bs-frow { display: grid; grid-template-columns: 58px 1fr 110px 28px; gap: 8px; align-items: center; }
[data-screen="battlesim"] .bs-role { text-align: center; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 5px 0; border-radius: 5px; cursor: pointer; border: 1px solid var(--line); }
[data-screen="battlesim"] .bs-role.tank { color: var(--steel-bright); border-color: var(--steel); }
[data-screen="battlesim"] .bs-role.dps { color: var(--blood-bright); border-color: var(--blood); }
[data-screen="battlesim"] .bs-frow .bs-fqty { text-align: right; }
/* Scout screenshot importer */
[data-screen="scout"] .si-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
[data-screen="scout"] .si-slot { display: flex; gap: 10px; background: var(--ink-850); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px; }
[data-screen="scout"] .si-icon { width: 64px; height: 64px; flex: none; border-radius: 6px; object-fit: cover; border: 1px solid var(--line-2); }
[data-screen="scout"] .si-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
[data-screen="scout"] .si-conf { font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
[data-screen="scout"] .si-conf.good { color: var(--green-bright); }
[data-screen="scout"] .si-conf.warn { color: var(--gold); }
[data-screen="scout"] .si-conf.bad { color: var(--blood-bright); }
[data-screen="scout"] .si-unit { width: 100%; font-size: 12px; }
[data-screen="scout"] .si-cnt { display: flex; align-items: center; gap: 6px; }
[data-screen="scout"] .si-cntimg { height: 26px; border-radius: 4px; border: 1px solid var(--line); background: var(--ink-900); }
[data-screen="scout"] .si-qty { flex: 1; text-align: right; }
[data-screen="scout"] .si-role { align-self: flex-start; font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 3px 10px; border-radius: 5px; cursor: pointer; border: 1px solid var(--line); }
[data-screen="scout"] .si-role.tank { color: var(--steel-bright); border-color: var(--steel); }
[data-screen="scout"] .si-role.dps { color: var(--blood-bright); border-color: var(--blood); }
/* Units DB — troop artwork thumbnail */
[data-screen="units"] .udb-unit { display: flex; align-items: center; gap: 9px; }
[data-screen="units"] .udb-img { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line-2); background: var(--ink-850); flex: none; }
