:root{--red:#ef4444;--blue:#3b82f6;--cyan:#38bdf8;--muted:#94a3b8;--panel:rgba(15,23,42,.92)}*{box-sizing:border-box}.hub-container{max-width:1480px!important}.nav-buttons{display:flex;justify-content:center;gap:15px;margin-bottom:20px}.sim-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.panel{background:var(--panel);backdrop-filter:blur(8px);padding:20px;border-radius:12px;color:#e2e8f0;border:1px solid rgba(255,255,255,.1)}.att{border-color:rgba(239,68,68,.45)}.def{border-color:rgba(59,130,246,.45)}.att h2,.att .section-title{color:var(--red)}.def h2,.def .section-title{color:var(--blue)}.section-title{font-weight:800;text-transform:uppercase;letter-spacing:1px;font-size:.85rem;margin:22px 0 10px;border-bottom:1px solid rgba(255,255,255,.1);padding-bottom:7px}.troop-card,.hero-card,.joiner-card,.result-card{background:rgba(30,41,59,.62);border:1px solid rgba(255,255,255,.09);padding:12px;border-radius:9px;margin-bottom:10px}.troop-head{display:flex;justify-content:space-between;align-items:center;font-weight:800}.row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:8px}.row4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.field{display:flex;flex-direction:column;gap:4px}.field label{font-size:.72rem;color:var(--muted);text-transform:uppercase}.field input,.field select{width:100%;background:rgba(15,23,42,.78);border:1px solid rgba(255,255,255,.15);border-radius:6px;padding:8px;color:#fff}.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;margin-top:10px}.stats-grid input{text-align:center}.toolbar{display:flex;gap:10px;flex-wrap:wrap;margin:15px 0}.btn{background:#3b82f6;color:#fff;border:0;border-radius:7px;padding:10px 16px;font-weight:800;cursor:pointer}.btn.secondary{background:#475569}.mode-toggle{display:flex;background:rgba(30,41,59,.8);border-radius:7px;padding:3px;margin-bottom:10px}.mode-toggle button{flex:1;border:0;background:transparent;color:#94a3b8;padding:7px;border-radius:5px;font-weight:700;cursor:pointer}.mode-toggle button.active{background:#2563eb;color:white}.ratio-wrap{display:none}.ratio-line{display:grid;grid-template-columns:100px 1fr 55px;gap:8px;align-items:center;margin:8px 0}.summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.battle-panel{margin-top:20px}.round-log{max-height:420px;overflow:auto;background:rgba(2,6,23,.6);padding:12px;border-radius:8px;border:1px solid rgba(255,255,255,.08)}.round-item{padding:9px 0;border-bottom:1px solid rgba(255,255,255,.06);font-size:.86rem}.winner{font-size:1.25rem;font-weight:900}.muted{color:var(--muted)}.warn{background:rgba(245,158,11,.12);border:1px solid rgba(245,158,11,.35);color:#fde68a;padding:10px;border-radius:7px;font-size:.8rem;margin:10px 0}.formula{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;background:rgba(2,6,23,.75);padding:8px;border-radius:6px;font-size:.76rem;overflow:auto}.small{font-size:.78rem}.hidden{display:none!important}.hero-picker{display:grid;grid-template-columns:62px 1fr 86px;gap:9px;align-items:center}.hero-portrait{width:58px;height:58px;object-fit:cover;border-radius:10px;border:1px solid rgba(255,255,255,.18);background:#111827}.slot-type{font-size:.68rem;text-transform:uppercase;color:#cbd5e1;margin-bottom:5px}.skill-list{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-top:9px}.skill-box{display:grid;grid-template-columns:40px 1fr;gap:6px;background:rgba(2,6,23,.42);padding:7px;border-radius:7px;min-height:78px}.skill-icon{width:38px;height:38px;border-radius:8px;object-fit:cover;background:#111827}.skill-name{font-size:.72rem;font-weight:800}.skill-desc{font-size:.66rem;color:#cbd5e1;line-height:1.25;margin-top:2px}.widget-box{margin-top:8px;padding:8px;border-radius:7px;background:rgba(56,189,248,.07);border:1px solid rgba(56,189,248,.18);font-size:.7rem}.widget-line{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap}.joiner-grid{display:grid;grid-template-columns:48px 1fr 76px;gap:8px;align-items:center}.joiner-img{width:44px;height:44px;border-radius:8px;object-fit:cover}.effective-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.effective-stats>div{background:rgba(2,6,23,.45);padding:9px;border-radius:7px;font-size:.78rem}@media(max-width:980px){.sim-grid,.summary-grid{grid-template-columns:1fr}.row4,.stats-grid{grid-template-columns:repeat(2,1fr)}.effective-stats{grid-template-columns:1fr}}@media(max-width:650px){.row,.row4,.skill-list{grid-template-columns:1fr}.panel{padding:13px}}

/* === v3 RNG / joiner / troop-skill additions === */
.joiner-actions{display:flex;gap:8px;align-items:center;margin:8px 0 12px}.add-joiner-btn{width:34px;height:34px;border-radius:50%;border:1px solid rgba(56,189,248,.5);background:rgba(56,189,248,.12);color:#7dd3fc;font-size:22px;font-weight:900;cursor:pointer}.add-joiner-btn:disabled{opacity:.35;cursor:not-allowed}.remove-joiner{border:0;background:rgba(239,68,68,.18);color:#fca5a5;border-radius:6px;padding:6px 8px;cursor:pointer}.joiner-grid-v3{display:grid;grid-template-columns:48px 1fr 76px 38px;gap:8px;align-items:center}.skill-event{display:inline-flex;align-items:center;gap:5px;margin:3px 5px 3px 0;padding:4px 7px;border-radius:7px;background:rgba(15,23,42,.88);border:1px solid rgba(255,255,255,.12);vertical-align:middle;position:relative}.skill-event img{width:26px;height:26px;border-radius:6px;object-fit:cover;background:#111827}.skill-event .proc-count{font-size:.67rem;color:#cbd5e1}.skill-event[data-tip]:hover:after{content:attr(data-tip);position:absolute;z-index:99;left:0;bottom:calc(100% + 7px);width:290px;white-space:normal;background:#020617;color:#e2e8f0;border:1px solid rgba(125,211,252,.45);padding:9px;border-radius:7px;font-size:.72rem;line-height:1.35;box-shadow:0 10px 30px rgba(0,0,0,.45);pointer-events:none}.skill-summary{margin-top:10px;padding-top:8px;border-top:1px solid rgba(255,255,255,.08)}.skill-summary-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.skill-summary-side{background:rgba(2,6,23,.4);padding:8px;border-radius:7px}.joiner-stack-note{font-size:.72rem;color:#bae6fd;background:rgba(14,165,233,.08);border:1px solid rgba(14,165,233,.2);padding:8px;border-radius:7px;margin:8px 0}.rng-badge{font-size:.64rem;padding:2px 5px;border-radius:5px;background:rgba(168,85,247,.18);color:#d8b4fe;border:1px solid rgba(168,85,247,.28)}

.joiner-picker-choice small{display:block;color:#94a3b8;font-size:.64rem;line-height:1.2;margin-top:2px}

/* === v4 locked stats / RNG luck / clearer widgets / grouped report === */
.stat-mode-wrap{display:flex;gap:8px;padding:8px;border-radius:8px;background:rgba(2,6,23,.45);border:1px solid rgba(255,255,255,.10);margin-bottom:10px}.stat-mode-btn{flex:1;border:1px solid rgba(255,255,255,.15);background:rgba(30,41,59,.72);color:#94a3b8;padding:9px;border-radius:7px;font-weight:800;cursor:pointer}.stat-mode-btn.active{background:#0f766e;color:#ecfeff;border-color:#2dd4bf}.stat-mode-help{font-size:.70rem;color:#a5f3fc;margin:-3px 0 10px}.locked-stat-badge{display:inline-block;margin-left:6px;padding:2px 6px;border-radius:5px;background:rgba(20,184,166,.16);border:1px solid rgba(45,212,191,.35);color:#5eead4;font-size:.65rem}.widget-box-v4{display:grid;grid-template-columns:64px 1fr;gap:10px;align-items:center}.widget-img{width:60px;height:60px;object-fit:contain;border-radius:9px;background:rgba(255,255,255,.06);padding:5px}.widget-status{display:inline-flex;align-items:center;gap:6px;font-weight:900;padding:4px 8px;border-radius:999px;margin-top:6px}.widget-status.active{background:rgba(34,197,94,.16);color:#86efac;border:1px solid rgba(34,197,94,.40)}.widget-status.inactive{background:rgba(239,68,68,.16);color:#fca5a5;border:1px solid rgba(239,68,68,.40)}.widget-status.locked{background:rgba(245,158,11,.15);color:#fde68a;border:1px solid rgba(245,158,11,.38)}
.joiner-grid-v3{align-items:start}.joiner-grid-v3>.field{align-self:start}.joiner-grid-v3 .joiner-img{margin-top:22px}.joiner-grid-v3 .remove-joiner{margin-top:22px}.joiner-grid-v3 .field label{min-height:16px;display:flex;align-items:center}.joiner-card{padding-top:10px}
.luck-panel{margin-top:12px;padding:10px;border-radius:8px;background:rgba(2,6,23,.48);border:1px solid rgba(168,85,247,.30)}.luck-badge{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:5px 9px;font-weight:900;font-size:.74rem;position:relative;cursor:help}.luck-badge.lucky{background:rgba(34,197,94,.16);border:1px solid rgba(34,197,94,.4);color:#86efac}.luck-badge.average{background:rgba(59,130,246,.16);border:1px solid rgba(59,130,246,.4);color:#93c5fd}.luck-badge.unlucky{background:rgba(239,68,68,.16);border:1px solid rgba(239,68,68,.4);color:#fca5a5}.luck-badge:hover:after{content:attr(data-tip);position:absolute;z-index:100;left:0;bottom:calc(100% + 8px);width:330px;white-space:normal;background:#020617;color:#e2e8f0;border:1px solid rgba(168,85,247,.5);padding:9px;border-radius:8px;font-weight:500;line-height:1.35}.skill-type-group{margin-top:10px;padding:9px;border-radius:8px;background:rgba(15,23,42,.55);border:1px solid rgba(255,255,255,.08)}.skill-type-title{font-size:.75rem;font-weight:900;text-transform:uppercase;letter-spacing:.8px;margin-bottom:6px}.proc-vs-exp{font-size:.67rem;color:#c4b5fd;margin-left:4px}.effective-note{font-size:.68rem;color:#94a3b8;margin-top:6px;line-height:1.3}.rng-badge-v4{font-size:.62rem;padding:2px 5px;border-radius:4px;background:rgba(168,85,247,.18);color:#e9d5ff;border:1px solid rgba(168,85,247,.28);margin-left:4px}

/* === v5 compact results / collapsible proc details === */
.battle-core-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:10px}.battle-core-side{background:rgba(2,6,23,.38);border:1px solid rgba(255,255,255,.08);border-radius:9px;padding:12px}.remaining-line{display:flex;justify-content:space-between;gap:8px;align-items:center;font-size:.82rem}.remaining-bar{height:10px;background:rgba(148,163,184,.18);border-radius:999px;overflow:hidden;margin:7px 0 9px}.remaining-fill{height:100%;border-radius:999px;transition:width .2s ease}.remaining-fill.att{background:#ef4444}.remaining-fill.def{background:#3b82f6}.details-toggle{margin-top:12px;background:#334155}.battle-details.hidden-details{display:none}.round-log.hidden-details{display:none}.skill-summary{margin-top:12px}.widget-img{content-visibility:auto}.hero-card{content-visibility:auto;contain-intrinsic-size:1px 310px}@media(max-width:650px){.battle-core-grid{grid-template-columns:1fr}}

/* ===== Formation controls & visual polish ===== */
.panel{box-shadow:0 18px 50px rgba(2,6,23,.28);transition:transform .22s ease,border-color .22s ease,box-shadow .22s ease}.panel:hover{box-shadow:0 22px 60px rgba(2,6,23,.36)}
.troop-card,.hero-card,.joiner-card{transition:transform .18s ease,border-color .18s ease,background .18s ease}.troop-card:hover,.hero-card:hover,.joiner-card:hover{transform:translateY(-1px);border-color:rgba(56,189,248,.26);background:rgba(30,41,59,.72)}
.btn,.stat-mode-btn,.mode-toggle button{transition:transform .16s ease,filter .16s ease,box-shadow .16s ease}.btn:hover,.stat-mode-btn:hover,.mode-toggle button:hover{transform:translateY(-1px);filter:brightness(1.08)}.btn:active,.stat-mode-btn:active,.mode-toggle button:active{transform:translateY(0) scale(.985)}
.ratio-wrap{margin-top:10px;padding:14px;border-radius:14px;background:linear-gradient(145deg,rgba(2,6,23,.5),rgba(30,41,59,.5));border:1px solid rgba(148,163,184,.13)}
.ratio-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:12px 0 14px}.ratio-presets{display:flex;gap:7px;flex-wrap:wrap}.ratio-preset{border:1px solid rgba(148,163,184,.22);background:rgba(15,23,42,.8);color:#dbeafe;border-radius:999px;padding:7px 11px;font-size:.75rem;font-weight:800;cursor:pointer;transition:all .16s ease}.ratio-preset:hover{border-color:rgba(56,189,248,.65);background:rgba(30,58,138,.34);transform:translateY(-1px)}
.ratio-total-pill{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;background:rgba(56,189,248,.1);border:1px solid rgba(56,189,248,.24);font-size:.73rem;color:#bae6fd}.ratio-total-pill strong{color:#fff}
.formation-stack{height:14px;display:flex;overflow:hidden;border-radius:999px;background:rgba(2,6,23,.75);border:1px solid rgba(255,255,255,.08);box-shadow:inset 0 1px 5px rgba(0,0,0,.3);margin:8px 0 14px}.formation-seg{height:100%;transition:width .22s ease}.formation-seg.inf{background:linear-gradient(90deg,#22c55e,#4ade80)}.formation-seg.lancer{background:linear-gradient(90deg,#3b82f6,#60a5fa)}.formation-seg.marksman{background:linear-gradient(90deg,#ef4444,#fb7185)}
.ratio-control{--ratio-color:#38bdf8;display:grid;grid-template-columns:88px 38px minmax(140px,1fr) 64px 38px;gap:8px;align-items:center;margin:10px 0;padding:9px 10px;border-radius:11px;background:rgba(15,23,42,.5);border:1px solid rgba(148,163,184,.1)}.ratio-control.inf{--ratio-color:#4ade80}.ratio-control.lancer{--ratio-color:#60a5fa}.ratio-control.marksman{--ratio-color:#fb7185}.ratio-label{font-weight:850;font-size:.8rem}.ratio-control.inf .ratio-label{color:#4ade80}.ratio-control.lancer .ratio-label{color:#60a5fa}.ratio-control.marksman .ratio-label{color:#fb7185}
.ratio-step{width:36px;height:36px;border-radius:9px;border:1px solid rgba(148,163,184,.2);background:rgba(30,41,59,.92);color:#e2e8f0;font-size:1.15rem;font-weight:900;cursor:pointer;display:grid;place-items:center;transition:all .15s ease}.ratio-step:hover{border-color:var(--ratio-color);color:#fff;box-shadow:0 0 0 3px rgba(56,189,248,.12);transform:translateY(-1px)}.ratio-step:active{transform:scale(.94)}
.ratio-value{justify-self:center;min-width:58px;text-align:center;padding:7px 8px;border-radius:9px;background:rgba(2,6,23,.68);border:1px solid rgba(148,163,184,.18);font-variant-numeric:tabular-nums;color:#fff;font-size:.82rem}
.ratio-slider{-webkit-appearance:none;appearance:none;width:100%;height:9px;border-radius:999px;outline:none;background:linear-gradient(90deg,var(--ratio-color) 0 var(--fill,0%),rgba(71,85,105,.48) var(--fill,0%) 100%);box-shadow:inset 0 1px 4px rgba(0,0,0,.38)}.ratio-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:21px;height:21px;border-radius:50%;background:#f8fafc;border:4px solid var(--ratio-color);box-shadow:0 2px 7px rgba(0,0,0,.4);cursor:grab;transition:transform .12s ease}.ratio-slider::-webkit-slider-thumb:hover{transform:scale(1.12)}.ratio-slider::-webkit-slider-thumb:active{cursor:grabbing;transform:scale(.96)}.ratio-slider::-moz-range-thumb{width:14px;height:14px;border-radius:50%;background:#f8fafc;border:4px solid var(--ratio-color);box-shadow:0 2px 7px rgba(0,0,0,.4);cursor:grab}
.hero-portrait{box-shadow:0 6px 18px rgba(0,0,0,.25);transition:transform .2s ease,box-shadow .2s ease}.hero-card:hover .hero-portrait{transform:scale(1.035);box-shadow:0 9px 25px rgba(0,0,0,.34)}
.none-hero-portrait{object-fit:cover!important;border-color:rgba(96,165,250,.45)!important;filter:saturate(.9);opacity:1!important}
.section-title{position:relative}.section-title:after{content:"";position:absolute;left:0;bottom:-1px;width:42px;height:2px;border-radius:2px;background:currentColor;opacity:.9}
@media(max-width:650px){.ratio-control{grid-template-columns:76px 34px 1fr 56px 34px;gap:5px;padding:8px 6px}.ratio-step{width:32px;height:32px}.ratio-label{font-size:.7rem}.ratio-preset{font-size:.68rem;padding:6px 8px}}

/* === v9 UI fixes: true-position ratio thumbs + light theme === */
.ratio-slider{background:linear-gradient(90deg,var(--ratio-color) 0 var(--fill,0%),rgba(71,85,105,.42) var(--fill,0%) 100%);transition:background .18s ease}
.ratio-preset.selected{border-color:#38bdf8;background:rgba(14,165,233,.24);box-shadow:0 0 0 3px rgba(56,189,248,.12);transform:translateY(-1px) scale(1.02)}
.ratio-total-pill strong.complete{color:#86efac}.ratio-total-pill strong.incomplete{color:#fde68a}
.theme-toggle{display:inline-flex;align-items:center;gap:8px;border:1px solid rgba(148,163,184,.28);background:rgba(15,23,42,.82);color:#e2e8f0;border-radius:999px;padding:8px 13px;font-weight:800;cursor:pointer;box-shadow:0 5px 18px rgba(0,0,0,.18);transition:transform .16s ease,background .2s ease,border-color .2s ease,color .2s ease}.theme-toggle:hover{transform:translateY(-1px);border-color:rgba(56,189,248,.65)}.theme-toggle .theme-icon{font-size:1rem;line-height:1}.nav-buttons{align-items:center}.theme-toggle-wrap{display:flex;justify-content:center;margin:-8px 0 18px}
body.light-theme{--panel:rgba(248,250,252,.94);--muted:#64748b;color:#0f172a}
body.light-theme .bg-overlay{background:rgba(241,245,249,.72)!important;backdrop-filter:saturate(.85) brightness(1.08)}
body.light-theme .web-title{color:#0f172a!important;text-shadow:0 2px 12px rgba(255,255,255,.8),0 1px 2px rgba(15,23,42,.18)}
body.light-theme .panel{background:rgba(248,250,252,.95);color:#0f172a;border-color:rgba(148,163,184,.36);box-shadow:0 12px 32px rgba(15,23,42,.12)}
body.light-theme .troop-card,body.light-theme .hero-card,body.light-theme .joiner-card,body.light-theme .result-card,body.light-theme .mechanics-card{background:rgba(255,255,255,.82);border-color:rgba(148,163,184,.28);color:#0f172a}
body.light-theme .section-title{border-bottom-color:rgba(100,116,139,.22)}
body.light-theme .field label,body.light-theme .muted,body.light-theme .effective-note{color:#64748b}
body.light-theme .field input,body.light-theme .field select{background:#fff;color:#0f172a;border-color:#cbd5e1;box-shadow:inset 0 1px 2px rgba(15,23,42,.04)}
body.light-theme .field input:focus,body.light-theme .field select:focus{outline:2px solid rgba(56,189,248,.24);border-color:#38bdf8}
body.light-theme .mode-toggle{background:#e2e8f0}.light-theme .mode-toggle button{color:#64748b}.light-theme .mode-toggle button.active{color:#fff}
body.light-theme .ratio-wrap{background:linear-gradient(145deg,rgba(248,250,252,.98),rgba(226,232,240,.68));border-color:rgba(148,163,184,.3)}
body.light-theme .ratio-control{background:rgba(255,255,255,.72);border-color:rgba(148,163,184,.25)}
body.light-theme .ratio-step{background:#f8fafc;color:#334155;border-color:#cbd5e1;box-shadow:0 3px 10px rgba(15,23,42,.06)}
body.light-theme .ratio-step:hover{color:#0f172a}
body.light-theme .ratio-value{background:#fff;color:#0f172a;border-color:#cbd5e1}
body.light-theme .ratio-preset{background:#fff;color:#1e293b;border-color:#cbd5e1}
body.light-theme .ratio-preset:hover{background:#eff6ff;border-color:#60a5fa}
body.light-theme .ratio-preset.selected{background:#e0f2fe;border-color:#38bdf8}
body.light-theme .ratio-total-pill{background:#f0f9ff;border-color:#bae6fd;color:#0369a1}
body.light-theme .formation-stack{background:#e2e8f0;border-color:#cbd5e1;box-shadow:inset 0 1px 4px rgba(15,23,42,.12)}
body.light-theme .ratio-slider{background:linear-gradient(90deg,var(--ratio-color) 0 var(--fill,0%),#dbe4ee var(--fill,0%) 100%);box-shadow:inset 0 1px 3px rgba(15,23,42,.15)}
body.light-theme .stat-mode-wrap{background:#f1f5f9;border-color:#cbd5e1}.light-theme .stat-mode-btn{background:#fff;color:#64748b;border-color:#cbd5e1}.light-theme .stat-mode-help{color:#0f766e}
body.light-theme .skill-box,body.light-theme .effective-stats>div,body.light-theme .skill-summary-side,body.light-theme .skill-type-group,body.light-theme .luck-panel{background:rgba(241,245,249,.9);border-color:rgba(148,163,184,.26);color:#0f172a}
body.light-theme .skill-desc,body.light-theme .proc-count,body.light-theme .slot-type{color:#475569}
body.light-theme .widget-box{background:#f0f9ff;border-color:#bae6fd;color:#0f172a}
body.light-theme .joiner-stack-note{background:#f0f9ff;border-color:#bae6fd;color:#075985}
body.light-theme .round-log{background:rgba(255,255,255,.88);border-color:#cbd5e1;color:#0f172a}.light-theme .round-item{border-bottom-color:#e2e8f0}
body.light-theme .warn{background:rgba(254,243,199,.92);border-color:#f59e0b;color:#78350f}
body.light-theme .formula{background:#e2e8f0;color:#0f172a}
body.light-theme .skill-event{background:#fff;border-color:#cbd5e1;color:#0f172a}
body.light-theme .hero-portrait,body.light-theme .skill-icon,body.light-theme .joiner-img{background:#e2e8f0;border-color:#cbd5e1}
body.light-theme .theme-toggle{background:rgba(255,255,255,.92);color:#0f172a;border-color:#cbd5e1;box-shadow:0 5px 18px rgba(15,23,42,.10)}
body.light-theme .circle-back-btn{background:rgba(255,255,255,.9)!important;color:#0369a1!important;border-color:rgba(14,165,233,.38)!important;box-shadow:0 5px 16px rgba(15,23,42,.10)}
body.light-theme .btn.secondary{background:#64748b;color:#fff}
body.light-theme .remove-joiner{background:#fee2e2;color:#b91c1c}
body.light-theme .add-joiner-btn{background:#e0f2fe;color:#0369a1;border-color:#7dd3fc}
body.light-theme .skill-event[data-tip]:hover:after,body.light-theme .luck-badge:hover:after{background:#0f172a;color:#f8fafc}
@media(max-width:650px){.theme-toggle-wrap{margin-top:-2px}.theme-toggle{padding:7px 11px;font-size:.78rem}}

/* === v10 floating theme control + light-theme readability + active-widget particles === */
.theme-toggle-wrap{
  position:fixed!important;
  right:18px!important;
  top:50%!important;
  transform:translateY(-50%);
  z-index:1200;
  margin:0!important;
  justify-content:flex-end!important;
  pointer-events:none;
}
.theme-toggle-wrap .theme-toggle{
  pointer-events:auto;
  min-width:126px;
  justify-content:center;
  backdrop-filter:blur(12px);
  border-width:1px;
  box-shadow:0 10px 30px rgba(0,0,0,.28),0 0 0 1px rgba(255,255,255,.04) inset;
}
.theme-toggle-wrap .theme-toggle:hover{transform:translateX(-3px)!important}

/* Make light theme stateful controls unmistakable. */
body.light-theme .stat-mode-btn{
  background:#ffffff!important;
  color:#64748b!important;
  border-color:#cbd5e1!important;
  box-shadow:0 1px 2px rgba(15,23,42,.05);
}
body.light-theme .stat-mode-btn.active{
  background:linear-gradient(135deg,#0f766e,#0d9488)!important;
  color:#ffffff!important;
  border-color:#0f766e!important;
  box-shadow:0 5px 16px rgba(13,148,136,.24),0 0 0 2px rgba(45,212,191,.14)!important;
}
body.light-theme .mode-toggle button.active{
  background:linear-gradient(135deg,#2563eb,#3b82f6)!important;
  color:#fff!important;
  box-shadow:0 4px 12px rgba(37,99,235,.18);
}

/* RNG labels: higher contrast in light mode. */
body.light-theme .rng-badge-v4{
  background:#ede9fe!important;
  color:#5b21b6!important;
  border:1px solid #a78bfa!important;
  font-weight:900!important;
  box-shadow:0 1px 2px rgba(91,33,182,.08);
}
body.light-theme .proc-vs-exp{color:#6d28d9!important;font-weight:700}

/* Widget state pills: readable in both modes, especially yellow locked state. */
body.light-theme .widget-status.active{
  background:#dcfce7!important;color:#166534!important;border-color:#22c55e!important;
  box-shadow:0 0 0 2px rgba(34,197,94,.08);
}
body.light-theme .widget-status.inactive{
  background:#fee2e2!important;color:#991b1b!important;border-color:#ef4444!important;
  box-shadow:0 0 0 2px rgba(239,68,68,.06);
}
body.light-theme .widget-status.locked{
  background:#fff7d6!important;color:#854d0e!important;border-color:#eab308!important;
  text-shadow:none!important;box-shadow:0 0 0 2px rgba(234,179,8,.09);
}

/* Locked badge in effective-combat cards. */
body.light-theme .locked-stat-badge{
  background:#ccfbf1!important;
  color:#115e59!important;
  border-color:#2dd4bf!important;
  font-weight:900!important;
}

/* Battle summary contrast and survivor-bar track. */
.battle-core-side{
  background:linear-gradient(145deg,rgba(15,23,42,.60),rgba(30,41,59,.48));
  border:1px solid rgba(148,163,184,.18);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}
.remaining-bar{
  height:13px;
  background:rgba(100,116,139,.34)!important;
  border:1px solid rgba(148,163,184,.22);
  box-shadow:inset 0 2px 4px rgba(2,6,23,.28);
}
.remaining-fill{box-shadow:0 0 9px rgba(255,255,255,.12) inset,0 0 8px currentColor;min-width:0}
body.light-theme .battle-core-side{
  background:linear-gradient(145deg,#ffffff,#eef2f7)!important;
  border-color:#cbd5e1!important;
  color:#0f172a!important;
  box-shadow:0 5px 16px rgba(15,23,42,.08),inset 0 1px 0 #fff!important;
}
body.light-theme .remaining-bar{
  background:#d6dee8!important;
  border-color:#b8c5d4!important;
  box-shadow:inset 0 2px 4px rgba(15,23,42,.16)!important;
}
body.light-theme .remaining-fill.att{background:linear-gradient(90deg,#ef4444,#fb7185)!important;box-shadow:none!important}
body.light-theme .remaining-fill.def{background:linear-gradient(90deg,#2563eb,#60a5fa)!important;box-shadow:none!important}
body.light-theme .rounds-core{color:#0f172a!important}
body.light-theme #finalSummary{background:#ffffff!important;border-color:#cbd5e1!important;color:#0f172a!important}
body.light-theme #finalSummary .winner{color:#0f172a!important}
body.light-theme #finalSummary .luck-badge.average{background:#dbeafe!important;color:#1e3a8a!important;border-color:#60a5fa!important}
body.light-theme #finalSummary .luck-badge.lucky{background:#dcfce7!important;color:#166534!important;border-color:#22c55e!important}
body.light-theme #finalSummary .luck-badge.unlucky{background:#fee2e2!important;color:#991b1b!important;border-color:#ef4444!important}
body.light-theme #finalSummary .btn.secondary{background:#334155!important;color:#fff!important}

/* Active-widget gold flame / mote effect. Visual only; never blocks interaction. */
.widget-box-v4{position:relative;overflow:hidden;isolation:isolate}
.widget-box-v4>*{position:relative;z-index:2}
.widget-box-v4.widget-active-fx{
  border-color:rgba(250,204,21,.38)!important;
  background:linear-gradient(145deg,rgba(56,189,248,.065),rgba(245,158,11,.065))!important;
  box-shadow:inset 0 -18px 32px rgba(245,158,11,.055),0 0 18px rgba(250,204,21,.06);
}
.widget-particles{position:absolute!important;inset:0;z-index:1!important;pointer-events:none;overflow:hidden}
.widget-particle{
  position:absolute;
  bottom:-12px;
  width:4px;height:11px;
  border-radius:60% 60% 45% 45%;
  background:linear-gradient(to top,rgba(245,158,11,0),rgba(250,204,21,.78),rgba(254,240,138,.12));
  filter:blur(.2px);
  opacity:0;
  animation:widgetGoldRise var(--dur,3.4s) ease-out infinite;
  animation-delay:var(--delay,0s);
  transform:translate3d(0,0,0) scale(var(--scale,1));
  box-shadow:0 0 7px rgba(250,204,21,.35);
}
@keyframes widgetGoldRise{
  0%{opacity:0;transform:translate3d(0,7px,0) scale(.65)}
  16%{opacity:.60}
  62%{opacity:.28}
  100%{opacity:0;transform:translate3d(var(--drift,7px),-92px,0) scale(1.28)}
}
body.light-theme .widget-box-v4.widget-active-fx{
  background:linear-gradient(145deg,#f0f9ff,#fff9e8)!important;
  border-color:#eab308!important;
  box-shadow:inset 0 -18px 28px rgba(250,204,21,.08),0 5px 14px rgba(15,23,42,.06)!important;
}

@media(max-width:900px){
  .theme-toggle-wrap{top:auto!important;bottom:18px!important;right:14px!important;transform:none!important}
  .theme-toggle-wrap .theme-toggle{min-width:auto;padding:9px 12px}
}
@media(prefers-reduced-motion:reduce){.widget-particle{animation:none!important}.theme-toggle-wrap .theme-toggle{transition:none!important}}

/* ===== V11 HERO PROGRESSION + DYNAMIC LOADOUT ===== */
.hero-card{position:relative;overflow:visible}
.hero-picker-v11{display:grid;grid-template-columns:88px minmax(220px,1fr) 132px;gap:14px;align-items:center}
.hero-progression{margin:12px 0 10px;padding:10px 12px;border:1px solid rgba(96,165,250,.24);border-radius:14px;background:rgba(15,23,42,.32);position:relative;z-index:3}
.hero-progression-top{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.star-readout{font-weight:900;color:#7dd3fc;min-width:88px}.skill-level-readout{font-weight:800;color:#c4b5fd}
.star-controls{display:flex;align-items:center;gap:7px}.star-up-btn,.star-max-btn{border:1px solid rgba(96,165,250,.35);background:#17243a;color:#eaf4ff;border-radius:10px;cursor:pointer;transition:.18s ease;font-weight:900}.star-up-btn:hover,.star-max-btn:hover{transform:translateY(-1px);box-shadow:0 7px 18px rgba(37,99,235,.18)}
.star-up-btn{width:36px;height:36px;padding:3px}.star-up-btn img{width:100%;height:100%;object-fit:contain}.star-max-btn{height:36px;padding:0 12px}
.snowflake-row{display:flex;justify-content:center;gap:7px;margin-top:9px;min-height:48px;transition:transform .18s ease,filter .18s ease;transform-origin:center}
.hero-progression:hover .snowflake-row{transform:scale(1.10);filter:drop-shadow(0 5px 10px rgba(34,211,238,.15));z-index:12}
.snowflake{position:relative;width:48px;height:48px;flex:0 0 48px}
.snowflake-leaf{position:absolute;left:50%;top:50%;width:13px;height:19px;margin:-9.5px 0 0 -6.5px;border:0;border-radius:60% 60% 48% 48%;background:#26364f;box-shadow:inset 0 0 0 1px rgba(148,163,184,.22);transform-origin:50% 9.5px;cursor:pointer;padding:0;transition:background .14s ease,box-shadow .14s ease,filter .14s ease,transform .14s ease}
.snowflake-leaf::after{content:'';position:absolute;inset:3px 3px 6px;border-radius:50%;background:rgba(255,255,255,.08)}
.snowflake-leaf.active{background:linear-gradient(180deg,#67f8ff,#2dd4e8);box-shadow:0 0 9px rgba(34,211,238,.62),inset 0 0 0 1px rgba(6,78,96,.72)}
.snowflake-leaf:hover{filter:brightness(1.25)}
.snowflake-leaf:nth-child(1){transform:rotate(0deg) translateY(-13px)}.snowflake-leaf:nth-child(2){transform:rotate(-60deg) translateY(-13px)}.snowflake-leaf:nth-child(3){transform:rotate(-120deg) translateY(-13px)}.snowflake-leaf:nth-child(4){transform:rotate(-180deg) translateY(-13px)}.snowflake-leaf:nth-child(5){transform:rotate(-240deg) translateY(-13px)}.snowflake-leaf:nth-child(6){transform:rotate(-300deg) translateY(-13px)}
.hero-stat-strip{margin-top:7px;text-align:center;font-size:.83rem;color:#a5b4fc}.hero-stat-strip b{color:#5eead4}
.skill-box.locked-skill{opacity:.38;filter:grayscale(.88);position:relative}.skill-box.locked-skill::after{content:attr(data-lock);position:absolute;right:8px;top:7px;padding:3px 7px;border-radius:999px;background:rgba(15,23,42,.86);color:#f8fafc;font-size:.67rem;font-weight:900;letter-spacing:.02em}
.skill-active-value{color:#4ade80!important;font-weight:950;text-shadow:0 0 8px rgba(74,222,128,.18)}
.widget-current-stats{font-size:.88rem;margin-top:2px}.widget-current-stats b{color:#67e8f9}
.dynamic-loadout{display:none;margin:12px 0 18px;border:1px solid rgba(56,189,248,.25);border-radius:16px;background:rgba(15,23,42,.36);overflow:hidden}.dynamic-loadout.open{display:block;animation:dynOpen .22s ease both}@keyframes dynOpen{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:none}}
.dynamic-tabs{display:flex;gap:6px;overflow-x:auto;padding:9px;border-bottom:1px solid rgba(148,163,184,.18);background:rgba(15,23,42,.28)}.dynamic-tab{white-space:nowrap;border:1px solid rgba(100,116,139,.32);background:#111d30;color:#cbd5e1;border-radius:10px;padding:8px 11px;font-weight:800;cursor:pointer}.dynamic-tab.active{background:linear-gradient(135deg,#0ea5e9,#2563eb);color:white;border-color:#38bdf8;box-shadow:0 6px 18px rgba(37,99,235,.22)}
.dynamic-content{padding:13px}.loadout-total{margin:0 auto 13px;max-width:650px;text-align:center;padding:11px;border-radius:14px;border:1px solid rgba(45,212,191,.28);background:rgba(13,148,136,.09)}.loadout-total strong{color:#5eead4}.loadout-total-grid{display:flex;justify-content:center;gap:14px;flex-wrap:wrap;margin-top:4px;font-size:.85rem}
.gear-six-grid{display:grid;grid-template-columns:repeat(3,minmax(150px,1fr));gap:10px}.gear-slot-card{position:relative;border:1px solid rgba(100,116,139,.27);border-radius:14px;background:rgba(30,41,59,.55);padding:10px;cursor:pointer;transition:.17s ease;min-height:128px}.gear-slot-card:hover{transform:translateY(-2px);border-color:rgba(56,189,248,.55);box-shadow:0 9px 24px rgba(2,8,23,.18)}.gear-slot-title{font-weight:900}.gear-slot-icon{width:54px;height:54px;border-radius:13px;display:grid;place-items:center;margin:7px auto;font-size:30px;background:linear-gradient(145deg,#1e293b,#0f172a);box-shadow:inset 0 0 0 1px rgba(148,163,184,.16)}.gear-tier{font-size:.78rem;text-align:center;font-weight:800;color:#93c5fd}.gear-stat{font-size:.78rem;text-align:center;color:#94a3b8;margin-top:4px}
.charm-avg{position:absolute;right:8px;top:8px;min-width:34px;height:26px;padding:0 7px;display:grid;place-items:center;border-radius:999px;background:#0e7490;color:white;font-weight:900}.charm-gem{font-size:36px;filter:drop-shadow(0 0 8px rgba(34,211,238,.32))}
.hero-gear-board{display:grid;grid-template-columns:1fr minmax(150px,210px) 1fr;grid-template-rows:auto auto;gap:11px;align-items:stretch}.hero-gear-piece{border:1px solid rgba(100,116,139,.25);border-radius:15px;background:rgba(30,41,59,.52);padding:10px}.hero-gear-piece img{width:54px;height:54px;object-fit:contain;float:left;margin-right:8px}.hero-gear-piece .piece-controls{display:grid;grid-template-columns:1fr 1fr;gap:6px;clear:both;padding-top:8px}.hero-gear-piece select{padding:6px}.hero-gear-center{grid-column:2;grid-row:1/3;display:grid;place-items:center;text-align:center;border-radius:16px;background:radial-gradient(circle at 50% 30%,rgba(14,165,233,.16),rgba(15,23,42,.3));border:1px solid rgba(56,189,248,.2);padding:12px}.hero-gear-pos-tl{grid-column:1;grid-row:1}.hero-gear-pos-tr{grid-column:3;grid-row:1}.hero-gear-pos-bl{grid-column:1;grid-row:2}.hero-gear-pos-br{grid-column:3;grid-row:2}
.loadout-note{font-size:.73rem;color:#94a3b8;margin-top:10px;text-align:center}
.loadout-modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;padding:25px;background:rgba(2,6,23,.72);backdrop-filter:blur(7px);z-index:10020}.loadout-modal.open{display:flex}.loadout-dialog{width:min(900px,96vw);max-height:86vh;overflow:auto;border-radius:18px;background:#101a2b;border:1px solid rgba(96,165,250,.38);box-shadow:0 28px 80px rgba(0,0,0,.48);padding:16px}.loadout-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.loadout-dialog-head h3{margin:0;color:#7dd3fc}.modal-close{width:36px;height:36px;border-radius:10px;border:1px solid #475569;background:#1e293b;color:#fff;font-size:20px;cursor:pointer}.gear-choice-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px}.gear-choice{border:1px solid rgba(100,116,139,.3);border-radius:12px;background:#162237;color:#dbeafe;padding:9px;cursor:pointer;min-height:92px;transition:.16s ease}.gear-choice:hover{border-color:#38bdf8;transform:translateY(-2px)}.gear-choice.selected{outline:2px solid #2dd4bf;background:#12343b}.gear-choice .swatch{height:7px;border-radius:99px;margin-bottom:7px}.gear-choice b{display:block;font-size:.82rem}.gear-choice small{color:#94a3b8}.charm-triangle{display:grid;grid-template-columns:1fr 1fr;max-width:310px;margin:10px auto;gap:10px}.charm-node{border:1px solid rgba(56,189,248,.3);background:#17243a;border-radius:14px;padding:12px;color:#e2e8f0;cursor:pointer;text-align:center}.charm-node:first-child{grid-column:1/3;width:50%;justify-self:center}.charm-node .charm-gem{display:block}
.dynamic-readonly{background:rgba(14,165,233,.08)!important;border-color:rgba(14,165,233,.38)!important;color:#7dd3fc!important;font-weight:900!important}
.light-theme .hero-progression{background:#f8fbff;border-color:#cbddeb}.light-theme .star-readout{color:#0369a1}.light-theme .skill-level-readout{color:#6d28d9}.light-theme .snowflake-leaf{background:#cbd5e1;box-shadow:inset 0 0 0 1px #94a3b8}.light-theme .snowflake-leaf.active{background:linear-gradient(180deg,#5eead4,#22d3ee);box-shadow:0 0 8px rgba(8,145,178,.28),inset 0 0 0 1px #0e7490}.light-theme .hero-stat-strip{color:#475569}.light-theme .hero-stat-strip b{color:#047857}.light-theme .skill-active-value{color:#15803d!important;text-shadow:none}.light-theme .dynamic-loadout{background:#f7fbff;border-color:#cbddeb}.light-theme .dynamic-tabs{background:#eef5fb;border-color:#d7e2ed}.light-theme .dynamic-tab{background:white;color:#475569;border-color:#cbd5e1}.light-theme .dynamic-tab.active{color:white}.light-theme .gear-slot-card,.light-theme .hero-gear-piece{background:white;border-color:#d6e1eb;color:#172033}.light-theme .gear-slot-icon{background:linear-gradient(145deg,#eff6ff,#dbeafe)}.light-theme .gear-tier{color:#1d4ed8}.light-theme .gear-stat,.light-theme .loadout-note{color:#64748b}.light-theme .loadout-total{background:#ecfdf5;border-color:#a7f3d0;color:#334155}.light-theme .loadout-total strong{color:#047857}.light-theme .hero-gear-center{background:radial-gradient(circle at 50% 30%,#e0f2fe,#f8fafc);border-color:#bae6fd;color:#334155}.light-theme .loadout-dialog{background:#f8fbff;border-color:#93c5fd;color:#172033}.light-theme .gear-choice{background:white;color:#172033;border-color:#cbd5e1}.light-theme .gear-choice small{color:#64748b}.light-theme .charm-node{background:white;color:#172033;border-color:#bfdbfe}.light-theme .dynamic-readonly{background:#eff9ff!important;color:#0369a1!important}
@media(max-width:760px){.hero-picker-v11{grid-template-columns:72px 1fr}.hero-picker-v11>.hero-level-column{grid-column:1/-1;display:flex;gap:8px}.gear-six-grid{grid-template-columns:repeat(2,1fr)}.hero-gear-board{grid-template-columns:1fr 1fr}.hero-gear-center{grid-column:1/3;grid-row:2}.hero-gear-pos-tl,.hero-gear-pos-tr{grid-row:1}.hero-gear-pos-bl,.hero-gear-pos-br{grid-row:3}.hero-gear-pos-tl,.hero-gear-pos-bl{grid-column:1}.hero-gear-pos-tr,.hero-gear-pos-br{grid-column:2}}

/* Loadout imagery and compact center layouts */
.loadout-item-photo{width:58px;height:58px;object-fit:contain;border-radius:12px;display:block}.muted-gear-photo{position:absolute;inset:5px;opacity:.23;filter:saturate(.65);width:calc(100% - 10px);height:calc(100% - 10px)}.gear-blank-plus{font-size:2rem;font-weight:900;color:#93c5fd;line-height:1}.charm-slot-photo{position:relative;overflow:hidden}.charm-level-gem{--gem-h:190;display:inline-grid;place-items:center;position:relative;width:54px;height:54px;filter:drop-shadow(0 4px 7px rgba(0,0,0,.24))}.charm-level-gem i{position:absolute;inset:8px;transform:rotate(45deg);border-radius:10px 4px 10px 4px;background:linear-gradient(135deg,hsl(var(--gem-h) 95% 80%),hsl(var(--gem-h) 78% 47%));border:3px solid rgba(250,204,21,.88);box-shadow:inset 0 0 11px rgba(255,255,255,.75),0 0 9px hsl(var(--gem-h) 75% 50% / .35)}.charm-level-gem b{position:relative;z-index:2;color:white;text-shadow:0 1px 3px #000;font-size:.9rem}.gear-center-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:stretch}.gear-system-center{grid-column:2;grid-row:2;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;min-height:132px;padding:15px;border-radius:18px;border:1px solid rgba(45,212,191,.28);background:radial-gradient(circle at 50% 25%,rgba(45,212,191,.15),rgba(15,23,42,.68));box-shadow:inset 0 0 28px rgba(56,189,248,.05)}.gear-system-center span{color:#94a3b8;font-size:.76rem;text-transform:uppercase;letter-spacing:.08em}.gear-system-center strong{margin-top:8px;color:#5eead4;line-height:1.5}.gear-choice-photo{width:62px;height:62px;border:2px solid #64748b;border-radius:14px;display:grid;place-items:center;margin:0 auto 7px;background:rgba(15,23,42,.65);overflow:hidden}.gear-choice-photo .loadout-item-photo{width:58px;height:58px}.light-theme .gear-system-center{background:radial-gradient(circle at 50% 25%,#d1fae5,#f8fafc);border-color:#99f6e4}.light-theme .gear-system-center strong{color:#047857}.light-theme .gear-choice-photo{background:#f1f5f9}.light-theme .gear-blank-plus{color:#2563eb}@media(max-width:780px){.gear-center-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.gear-system-center{grid-column:1/-1;grid-row:auto;order:-1}}

/* === v12 Preview/network safety === */
.network-safety{display:flex;justify-content:center;align-items:center;gap:8px;margin:-10px 0 16px;flex-wrap:wrap}.network-safety-badge{display:inline-flex;align-items:center;gap:7px;padding:7px 11px;border-radius:999px;background:rgba(34,197,94,.12);border:1px solid rgba(34,197,94,.34);color:#bbf7d0;font-size:.72rem;font-weight:900}.network-safety-badge::before{content:"●";font-size:.65rem}.network-safety small{color:#94a3b8}.light-theme .network-safety-badge{background:#dcfce7;border-color:#86efac;color:#166534}.light-theme .network-safety small{color:#64748b}

/* ===== V14 OFFLINE ART / HERO-GEAR / CHARM / LAYOUT REFINEMENTS ===== */
.gear-side-layout{display:grid;grid-template-columns:minmax(160px,1fr) minmax(180px,240px) minmax(160px,1fr);gap:14px;align-items:center}
.gear-side-column{display:grid;grid-template-rows:repeat(3,minmax(0,1fr));gap:10px}
.gear-side-layout .gear-system-center{grid-column:auto;grid-row:auto;min-height:210px}
.charm-image{width:72px;height:72px;object-fit:contain;display:block;margin:0 auto;filter:drop-shadow(0 4px 7px rgba(0,0,0,.27))}
.gear-slot-icon .charm-image{width:58px;height:58px}
.charm-node .charm-image{width:78px;height:78px;margin-bottom:4px}
.hero-gear-piece{overflow:hidden;transition:border-color .18s ease,background .18s ease,box-shadow .18s ease}
.hero-gear-piece.red-tier{border-color:rgba(248,113,113,.54);background:linear-gradient(145deg,rgba(127,29,29,.24),rgba(30,41,59,.58));box-shadow:inset 0 0 0 1px rgba(239,68,68,.08)}
.hero-gear-piece img.hero-gear-art{width:78px;height:78px;float:left;margin-right:10px;object-fit:contain;border-radius:14px}
.hero-gear-piece .piece-title{font-weight:950;font-size:.92rem}
.hero-gear-piece .piece-level-state{font-size:.68rem;font-weight:900;display:inline-flex;margin-top:3px;padding:2px 7px;border-radius:999px;background:rgba(245,158,11,.15);color:#fde68a;border:1px solid rgba(245,158,11,.28)}
.hero-gear-piece.red-tier .piece-level-state{background:rgba(239,68,68,.18);color:#fecaca;border-color:rgba(248,113,113,.38)}
.hero-gear-empower{clear:both;margin-top:9px;display:flex;gap:5px;flex-wrap:wrap}
.hero-gear-empower span{font-size:.64rem;padding:3px 6px;border-radius:999px;background:rgba(59,130,246,.10);border:1px solid rgba(96,165,250,.20);color:#bfdbfe;font-weight:800}
.hero-gear-empower span.active{background:rgba(250,204,21,.15);border-color:rgba(250,204,21,.42);color:#fde68a;box-shadow:0 0 8px rgba(250,204,21,.10)}
.hero-gear-center .empower-total{margin-top:8px;font-size:.73rem;color:#cbd5e1;line-height:1.45}
.light-theme .hero-gear-piece.red-tier{background:linear-gradient(145deg,#fff1f2,#ffffff)!important;border-color:#fca5a5!important}
.light-theme .hero-gear-piece .piece-level-state{background:#fff7ed;color:#9a3412;border-color:#fdba74}
.light-theme .hero-gear-piece.red-tier .piece-level-state{background:#fee2e2;color:#991b1b;border-color:#fca5a5}
.light-theme .hero-gear-empower span{background:#eff6ff;color:#1d4ed8;border-color:#bfdbfe}
.light-theme .hero-gear-empower span.active{background:#fef3c7;color:#92400e;border-color:#fbbf24}
.light-theme .hero-gear-center .empower-total{color:#475569}
/* A broad golden sweep + motes for active widgets. */
.widget-box-v4.widget-active-fx{overflow:hidden!important}
.widget-particles{position:absolute!important;inset:-12% -5%!important;z-index:1!important;pointer-events:none;overflow:hidden!important}
.widget-gold-wave{position:absolute;left:-55%;top:58%;width:180%;height:54%;border-radius:50%;border-top:4px solid rgba(255,235,130,.72);background:radial-gradient(ellipse at 50% 0%,rgba(255,241,153,.32) 0%,rgba(250,204,21,.16) 22%,rgba(245,158,11,.04) 52%,transparent 70%);filter:blur(.2px) drop-shadow(0 0 8px rgba(250,204,21,.52));transform:rotate(-8deg) translateX(-12%);animation:widgetGoldenSweep 3.1s ease-in-out infinite}
.widget-particle{position:absolute!important;left:var(--x,50%);bottom:-8px;width:var(--s,6px)!important;height:calc(var(--s,6px)*2.5)!important;border-radius:70% 70% 45% 45%;background:linear-gradient(to top,rgba(245,158,11,0),rgba(250,204,21,.92),rgba(255,247,190,.28))!important;opacity:0;animation:widgetGoldRise 2.9s ease-out infinite!important;animation-delay:var(--d,0s)!important;box-shadow:0 0 9px rgba(250,204,21,.52)!important}
@keyframes widgetGoldenSweep{0%,100%{opacity:.18;transform:rotate(-8deg) translateX(-18%) scaleY(.78)}45%{opacity:.92;transform:rotate(-8deg) translateX(12%) scaleY(1.05)}70%{opacity:.38;transform:rotate(-8deg) translateX(28%) scaleY(.9)}}
@keyframes widgetGoldRise{0%{opacity:0;transform:translate3d(0,9px,0) scale(.55)}14%{opacity:.85}64%{opacity:.35}100%{opacity:0;transform:translate3d(var(--dr,8px),-98px,0) scale(1.35)}}
@media(max-width:760px){.gear-side-layout{grid-template-columns:1fr}.gear-side-layout .gear-system-center{order:-1;min-height:120px}.gear-side-column{grid-template-columns:1fr;grid-template-rows:none}}

/* ===== V15 COMPACT HERO PICKER / LOADOUT CLEANUP ===== */
.hub-container{max-width:1880px!important;width:calc(100% - 24px);margin-inline:auto}
.sim-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
.panel{min-width:0;overflow-x:hidden}
.dynamic-loadout,.dynamic-content{min-width:0;max-width:100%;overflow-x:hidden}
.dynamic-toolbar{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;padding:9px 10px;border-bottom:1px solid rgba(148,163,184,.18)}
.dynamic-toolbar-actions{display:flex;gap:7px;flex-wrap:wrap}
.dynamic-tool-btn{border:1px solid rgba(96,165,250,.3);background:#17243a;color:#dbeafe;border-radius:9px;padding:7px 10px;font-weight:850;cursor:pointer}
.dynamic-tool-btn:hover{border-color:#38bdf8;filter:brightness(1.08)}
.dynamic-tool-btn.max{border-color:rgba(250,204,21,.4);color:#fde68a;background:rgba(120,83,10,.22)}
.dynamic-collapsed-note{padding:14px;text-align:center;color:#94a3b8}

.gear-slot-card{color:#e2e8f0!important}
.gear-slot-title{color:#f8fafc!important}
.light-theme .gear-slot-card{color:#172033!important}
.light-theme .gear-slot-title{color:#172033!important}

.hero-card{padding:9px 10px}
.hero-picker-v11{display:block}
.hero-picker-v11>select{display:none!important}
.hero-progression{margin:0 0 8px;padding:10px}
.hero-compact-grid{display:grid;grid-template-columns:92px minmax(0,1fr) 118px;gap:12px;align-items:center}
.hero-photo-select{appearance:none;border:1px solid rgba(96,165,250,.3);background:rgba(15,23,42,.42);border-radius:14px;padding:6px;color:#e2e8f0;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0}
.hero-photo-select:hover{border-color:#38bdf8;box-shadow:0 8px 22px rgba(14,165,233,.12)}
.hero-photo-select .hero-portrait{width:70px;height:70px;border-radius:12px}
.hero-photo-name{font-size:.72rem;font-weight:900;text-align:center;max-width:82px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hero-progress-main{min-width:0}
.hero-progression-top{margin-bottom:3px}
.hero-widget-corner{align-self:end;display:flex;flex-direction:column;gap:4px}
.hero-widget-corner label{font-size:.66rem;color:#94a3b8;text-transform:uppercase;font-weight:850}
.hero-widget-corner select{width:100%;background:rgba(15,23,42,.78);border:1px solid rgba(255,255,255,.15);border-radius:7px;padding:7px;color:#fff}
.hero-picker-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(104px,1fr));gap:10px}
.hero-picker-choice{border:1px solid rgba(100,116,139,.3);background:#162237;color:#e2e8f0;border-radius:13px;padding:8px;cursor:pointer;text-align:center}
.hero-picker-choice:hover,.hero-picker-choice.selected{border-color:#38bdf8;background:#12314d;transform:translateY(-1px)}
.hero-picker-choice img{width:82px;height:82px;border-radius:13px;object-fit:cover;background:#111827;display:block;margin:0 auto 6px}
.hero-picker-choice b{display:block;font-size:.78rem}
.light-theme .hero-photo-select,.light-theme .hero-picker-choice{background:#fff;color:#172033;border-color:#cbd5e1}
.light-theme .hero-widget-corner select{background:#fff;color:#172033;border-color:#cbd5e1}

.hero-gear-empower{display:none!important}
.hero-gear-piece .piece-final-bonus{clear:both;margin-top:7px;font-size:.72rem;color:#fde68a;font-weight:850}
.hero-gear-piece .piece-final-bonus.zero{color:#94a3b8}
.light-theme .hero-gear-piece .piece-final-bonus{color:#92400e}
.hero-gear-center .empower-total{margin-top:10px}

.widget-gold-wave{display:none!important}
.widget-box-v4.widget-active-fx{background:radial-gradient(ellipse at 55% 60%,rgba(250,204,21,.12),rgba(56,189,248,.055) 55%,rgba(15,23,42,.1) 100%)!important;box-shadow:inset 0 0 34px rgba(250,204,21,.09),0 0 18px rgba(250,204,21,.08)!important}
body.light-theme .widget-box-v4.widget-active-fx{background:radial-gradient(ellipse at 55% 60%,rgba(250,204,21,.14),#f7fbff 68%)!important}

@media(max-width:1500px){.sim-grid{grid-template-columns:1fr}}
@media(max-width:850px){
 .hero-compact-grid{grid-template-columns:78px minmax(0,1fr)}
 .hero-widget-corner{grid-column:1/-1;justify-self:end;width:118px}
 .snowflake-row{gap:4px;transform:scale(.94)}
 .gear-side-layout{grid-template-columns:minmax(0,1fr) minmax(150px,210px) minmax(0,1fr);gap:9px}
}
@media(max-width:650px){
 .gear-side-layout{grid-template-columns:1fr}
 .gear-side-layout .gear-system-center{order:-1;min-height:120px}
 .gear-side-column{grid-template-rows:none}
}

/* ===== V16 HERO PICKER + WIDGET STAT FIXES ===== */
.hero-picker-choice.none-choice{background:rgba(15,23,42,.40)}
.none-choice-icon{width:82px;height:82px;border-radius:13px;border:1px dashed rgba(148,163,184,.45);display:grid;place-items:center;margin:0 auto 6px;background:rgba(2,6,23,.35);color:#94a3b8;font-weight:950;font-size:.82rem;letter-spacing:.08em}
.none-choice-icon::before{content:"—";font-size:2.1rem;line-height:.8}
.none-choice-icon span{display:none}
.light-theme .hero-picker-choice.none-choice{background:#f8fafc}
.light-theme .none-choice-icon{background:#eef2f7;color:#64748b;border-color:#94a3b8}

/* ===== V17 POLISH / FIXES ===== */
.hero-progression{position:relative;padding-top:12px}
.hero-progression-top{padding-right:148px;min-height:42px}
.star-controls{position:absolute!important;right:12px;top:10px;z-index:8;display:flex;gap:8px}
.star-up-btn{width:43px!important;height:43px!important;padding:3px!important;overflow:hidden;background:rgba(14,165,233,.12)!important;border-color:rgba(56,189,248,.48)!important}
.star-up-btn img{width:100%!important;height:100%!important;object-fit:contain!important;display:block!important;border-radius:8px}
.star-max-btn{height:43px!important}
@media(max-width:760px){.hero-progression-top{padding-right:0;padding-top:48px}.star-controls{top:8px;right:8px}}

.resettable-card{position:relative;cursor:pointer}
.piece-reset-btn{position:absolute;right:7px;top:7px;z-index:5;width:27px;height:27px;border-radius:8px;border:1px solid rgba(148,163,184,.28);background:rgba(15,23,42,.82);color:#cbd5e1;font-size:16px;font-weight:900;display:grid;place-items:center;cursor:pointer;opacity:.72;transition:.15s ease}
.piece-reset-btn:hover{opacity:1;border-color:#60a5fa;color:white;background:#1e3a5f;transform:rotate(-15deg)}
.light-theme .piece-reset-btn{background:#fff;color:#475569;border-color:#cbd5e1}
.hero-gear-piece{position:relative}
.subtle-reset{padding-inline:9px!important;color:#cbd5e1!important;background:rgba(51,65,85,.46)!important}
.subtle-reset:hover{color:#fff!important;border-color:#94a3b8!important}

/* Chief gear art: preserve the whole icon, remove screenshot rims, and keep all tiers the same visual footprint. */
.gear-slot-icon{overflow:hidden!important;padding:4px!important}
.gear-slot-icon .loadout-item-photo,.gear-choice-photo .loadout-item-photo{width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;object-position:center!important;border-radius:9px!important}
.gear-choice-photo{overflow:hidden!important;padding:3px!important}

/* Ratio control redesign — functionality unchanged. */
.ratio-wrap{
  position:relative;overflow:hidden;padding:20px!important;border-radius:20px!important;
  background:
    radial-gradient(circle at 15% 0%,rgba(34,197,94,.10),transparent 34%),
    radial-gradient(circle at 85% 0%,rgba(244,63,94,.10),transparent 34%),
    linear-gradient(155deg,rgba(15,23,42,.92),rgba(17,30,51,.80))!important;
  border:1px solid rgba(96,165,250,.20)!important;
  box-shadow:0 18px 45px rgba(2,6,23,.22),inset 0 1px 0 rgba(255,255,255,.035)
}
.ratio-toolbar{margin:4px 0 18px!important;padding:0 2px}
.ratio-presets{gap:9px!important}
.ratio-preset{
  border-radius:12px!important;padding:8px 13px!important;
  background:rgba(30,41,59,.72)!important;border-color:rgba(148,163,184,.16)!important;
  box-shadow:0 5px 14px rgba(2,6,23,.12);letter-spacing:.01em
}
.ratio-preset:hover{background:rgba(30,58,138,.34)!important;box-shadow:0 8px 19px rgba(14,165,233,.10)}
.ratio-total-pill{padding:8px 13px!important;border-radius:12px!important;background:rgba(14,165,233,.10)!important}
.formation-stack{
  height:18px!important;border-radius:12px!important;margin:8px 2px 18px!important;
  border:1px solid rgba(148,163,184,.14)!important;background:#0b1220!important;
  box-shadow:inset 0 2px 8px rgba(0,0,0,.35),0 5px 15px rgba(2,6,23,.12)!important
}
.ratio-control{
  grid-template-columns:108px 38px minmax(180px,1fr) 68px 38px!important;
  padding:12px 13px!important;margin:9px 0!important;border-radius:14px!important;
  background:linear-gradient(135deg,rgba(30,41,59,.72),rgba(15,23,42,.58))!important;
  border:1px solid rgba(148,163,184,.12)!important;box-shadow:0 7px 18px rgba(2,6,23,.10);
  transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease
}
.ratio-control:hover{transform:translateY(-1px);border-color:color-mix(in srgb,var(--ratio-color) 48%,transparent)!important;box-shadow:0 10px 25px rgba(2,6,23,.17)}
.ratio-label{font-size:.83rem!important;letter-spacing:.015em}
.ratio-step{border-radius:10px!important;background:rgba(30,41,59,.86)!important;border-color:rgba(148,163,184,.18)!important}
.ratio-value{border-radius:10px!important;background:rgba(2,6,23,.62)!important;font-size:.84rem!important}
.ratio-slider{height:8px!important}
body.light-theme .ratio-wrap{background:linear-gradient(155deg,#f8fbff,#eef5fb)!important;border-color:#cbddeb!important}
body.light-theme .ratio-control{background:linear-gradient(135deg,#fff,#f7fafc)!important;border-color:#dbe4ee!important;box-shadow:0 6px 16px rgba(15,23,42,.06)}
body.light-theme .ratio-preset{background:#fff!important}
body.light-theme .formation-stack{background:#e2e8f0!important}
@media(max-width:700px){.ratio-control{grid-template-columns:84px 34px 1fr 58px 34px!important;padding:10px 8px!important}}

/* ===== V18 CHARM ALIGNMENT + WIDGET DISPLAY FIX ===== */
.charm-slot-photo{
  display:grid!important;
  place-items:center!important;
  padding:4px!important;
  overflow:hidden!important;
}
.charm-slot-photo .charm-level-gem,
.charm-slot-photo img{
  margin:0!important;
  float:none!important;
  display:grid!important;
  place-items:center!important;
}
.charm-slot-photo .charm-level-gem{width:50px!important;height:50px!important}
.charm-node .charm-level-gem{margin:0 auto 6px!important}
.gear-slot-card .charm-slot-photo{margin-inline:auto!important}

/* ===== V21 FULL-HEIGHT BATTLE RAIL / MULTI-SIM / OPTIMIZER ===== */

/* Charm artwork remains true-centered. */
.charm-slot-photo{position:relative!important;display:block!important;overflow:hidden!important}
.charm-slot-photo .charm-image{
  position:absolute!important;left:50%!important;top:50%!important;
  width:50px!important;height:50px!important;max-width:50px!important;max-height:50px!important;
  object-fit:contain!important;object-position:center!important;margin:0!important;float:none!important;
  transform:translate(-50%,-50%)!important
}
.charm-slot-photo .gear-blank-plus{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}
.charm-node .charm-level-gem{margin:0 auto 6px!important}
.gear-slot-card .charm-slot-photo{margin-inline:auto!important}

/* Three-column battlefield: attacker | rail | defender. */
.sim-grid{
  position:relative!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 154px minmax(0,1fr)!important;
  gap:18px!important;
  align-items:stretch!important;
}
.sim-grid>.att{grid-column:1;grid-row:1}
.sim-grid>.def{grid-column:3;grid-row:1}

/* Full-height rail. */
.battle-rail{
  grid-column:2;grid-row:1;
  position:relative;
  min-height:100%;
  border-radius:22px;
  overflow:visible;
  isolation:isolate;
}
.battle-rail::before,.battle-rail::after{
  content:"";position:absolute;top:0;bottom:0;width:48%;z-index:-2;opacity:.64;
}
.battle-rail::before{
  left:0;
  background:
    radial-gradient(ellipse at 100% 50%,rgba(248,113,113,.20),transparent 58%),
    linear-gradient(90deg,rgba(239,68,68,.02),rgba(239,68,68,.10));
  border-right:1px solid rgba(248,113,113,.10);
}
.battle-rail::after{
  right:0;
  background:
    radial-gradient(ellipse at 0 50%,rgba(96,165,250,.20),transparent 58%),
    linear-gradient(90deg,rgba(59,130,246,.10),rgba(59,130,246,.02));
  border-left:1px solid rgba(96,165,250,.10);
}
.rail-energy-line{
  position:absolute;top:0;bottom:0;left:50%;width:3px;transform:translateX(-50%);
  background:linear-gradient(to bottom,transparent 0%,rgba(255,255,255,.15) 4%,rgba(255,255,255,.34) 50%,rgba(255,255,255,.15) 96%,transparent 100%);
  box-shadow:0 0 14px rgba(255,255,255,.18);
  overflow:hidden;
}
.rail-energy-line::before,.rail-energy-line::after{
  content:"";position:absolute;left:-7px;width:17px;height:90px;border-radius:50%;
  filter:blur(5px);animation:railFlow 2.4s linear infinite;
}
.rail-energy-line::before{top:-100px;background:rgba(248,113,113,.58)}
.rail-energy-line::after{top:35%;background:rgba(96,165,250,.60);animation-delay:-1.2s}
@keyframes railFlow{from{transform:translateY(-120px)}to{transform:translateY(calc(100vh + 260px))}}

/* Sticky viewport-centered control stack. */
.rail-sticky{
  position:sticky;
  top:50vh;
  transform:translateY(-50%);
  width:148px;
  display:flex;flex-direction:column;align-items:center;
  gap:8px;
  z-index:70;
  padding:8px 3px;
}
.rail-circle{
  width:43px;height:43px;border-radius:50%;
  border:1px solid rgba(148,163,184,.30);
  background:rgba(15,23,42,.92);color:#e2e8f0;
  display:grid;place-items:center;cursor:pointer;
  font-size:18px;font-weight:950;
  box-shadow:0 7px 22px rgba(2,6,23,.30);
  transition:.16s ease;
}
.rail-circle:hover{transform:scale(1.07);border-color:#7dd3fc;box-shadow:0 9px 28px rgba(14,165,233,.18)}
.rail-circle.small-toggle{width:31px;height:31px;font-size:12px;opacity:.82}
.rail-circle.fx-off{opacity:.42}

.clash-stage{
  position:relative;width:144px;height:74px;
  display:flex;align-items:center;justify-content:center;
  pointer-events:none;
}
.clash-beam{
  position:absolute;top:50%;height:8px;transform:translateY(-50%);
  overflow:visible;filter:drop-shadow(0 0 7px currentColor);
}
.clash-beam.att{
  right:50%;width:70px;color:#fb4b4b;
  background:linear-gradient(90deg,rgba(239,68,68,0),rgba(239,68,68,.50) 25%,#ff5757 76%,#fff 100%);
  animation:attBeamPush 1.18s ease-in-out infinite;
}
.clash-beam.def{
  left:50%;width:70px;color:#38bdf8;
  background:linear-gradient(90deg,#fff 0%,#59cbff 23%,rgba(59,130,246,.52) 68%,rgba(59,130,246,0));
  animation:defBeamPush 1.11s ease-in-out infinite;
}
.clash-core{
  position:absolute;left:50%;top:50%;width:13px;height:13px;border-radius:50%;
  transform:translate(-50%,-50%);background:#fff;
  box-shadow:0 0 7px 3px #fff,0 0 18px 8px rgba(125,211,252,.78),0 0 33px 12px rgba(248,113,113,.42);
  animation:clashCorePulse .56s ease-in-out infinite alternate;
}
.clash-core::before,.clash-core::after{
  content:"";position:absolute;left:50%;top:50%;width:2px;height:66px;
  background:linear-gradient(to bottom,transparent,#fff 43%,#fff 57%,transparent);
  transform-origin:center;opacity:.62;filter:blur(.35px);
}
.clash-core::before{transform:translate(-50%,-50%) rotate(34deg)}
.clash-core::after{transform:translate(-50%,-50%) rotate(-42deg)}
.clash-particle{
  position:absolute;left:50%;top:50%;width:4px;height:4px;border-radius:50%;
  background:#fff;box-shadow:0 0 7px currentColor;color:var(--pc,#facc15);
  opacity:0;animation:clashSpark var(--dur,1.2s) ease-out infinite;animation-delay:var(--delay,0s);
}
.clash-shockwave{
  position:absolute;left:50%;top:50%;width:20px;height:20px;transform:translate(-50%,-50%);
  border:1px solid rgba(255,255,255,.62);border-radius:50%;opacity:0;animation:clashShock 1.45s ease-out infinite;
}
.clash-shockwave.s2{animation-delay:.72s}
.battle-rail.fx-off .clash-stage,.battle-rail.fx-off .rail-energy-line{opacity:.12}
.battle-rail.fx-off .clash-stage *,.battle-rail.fx-off .rail-energy-line *{animation-play-state:paused!important}

@keyframes attBeamPush{0%,100%{width:62px;opacity:.72}48%{width:78px;opacity:1}68%{width:66px;opacity:.82}}
@keyframes defBeamPush{0%,100%{width:64px;opacity:.76}46%{width:79px;opacity:1}72%{width:64px;opacity:.80}}
@keyframes clashCorePulse{from{transform:translate(-50%,-50%) scale(.86)}to{transform:translate(-50%,-50%) scale(1.30);filter:brightness(1.35)}}
@keyframes clashSpark{
  0%{opacity:0;transform:translate(-50%,-50%) scale(.4)}12%{opacity:1}
  100%{opacity:0;transform:translate(calc(-50% + var(--dx,0px)),calc(-50% + var(--dy,-55px))) scale(.15)}
}
@keyframes clashShock{0%{opacity:.65;transform:translate(-50%,-50%) scale(.25)}100%{opacity:0;transform:translate(-50%,-50%) scale(3.25)}}

/* Fight control. */
.rail-fight-btn{
  width:62px;height:62px;border-radius:50%;border:1px solid rgba(250,204,21,.44);
  background:radial-gradient(circle at 40% 30%,rgba(250,204,21,.18),rgba(15,23,42,.96) 68%);
  color:#fde68a;display:grid;place-items:center;cursor:pointer;font-size:27px;
  box-shadow:0 0 0 4px rgba(250,204,21,.05),0 9px 26px rgba(2,6,23,.35);
  transition:.16s ease;
}
.rail-fight-btn:hover{transform:scale(1.06);box-shadow:0 0 0 5px rgba(250,204,21,.08),0 12px 30px rgba(250,204,21,.13)}
.rail-fight-btn.running{animation:fightPulse .62s ease-in-out infinite alternate}
.rail-fight-btn.running .sword-a{animation:swordA .34s ease-in-out infinite alternate}
.rail-fight-btn.running .sword-b{animation:swordB .34s ease-in-out infinite alternate}
.sword-pair{position:relative;width:36px;height:36px}
.sword-a,.sword-b{position:absolute;left:50%;top:50%;font-size:25px;line-height:1;transform-origin:50% 70%}
.sword-a{transform:translate(-50%,-50%) rotate(-42deg)}
.sword-b{transform:translate(-50%,-50%) rotate(42deg) scaleX(-1)}
@keyframes swordA{to{transform:translate(-50%,-50%) rotate(-25deg) translateX(2px)}}
@keyframes swordB{to{transform:translate(-50%,-50%) rotate(25deg) scaleX(-1) translateX(-2px)}}
@keyframes fightPulse{to{filter:brightness(1.35);box-shadow:0 0 0 6px rgba(250,204,21,.10),0 0 28px rgba(250,204,21,.26)}}

.rail-run-select{
  width:86px;background:rgba(15,23,42,.94);color:#e2e8f0;border:1px solid rgba(148,163,184,.25);
  border-radius:10px;padding:6px 7px;font-weight:850;text-align:center;
}
.rail-run-label{font-size:.61rem;color:#94a3b8;text-transform:uppercase;letter-spacing:.08em;font-weight:900}

.multi-bar-wrap{
  width:138px;border-radius:11px;padding:6px;background:rgba(2,6,23,.78);
  border:1px solid rgba(148,163,184,.17);box-shadow:0 7px 22px rgba(2,6,23,.22)
}
.multi-bar{height:22px;display:flex;overflow:hidden;border-radius:8px;background:#1e293b;position:relative}
.multi-red,.multi-blue{height:100%;display:flex;align-items:center;justify-content:center;min-width:0;overflow:hidden;color:#fff;font-size:.64rem;font-weight:950;transition:width .18s ease}
.multi-red{background:linear-gradient(90deg,#991b1b,#ef4444)}
.multi-blue{background:linear-gradient(90deg,#3b82f6,#1d4ed8)}
.multi-stalemate{position:absolute;left:50%;top:0;bottom:0;width:2px;background:rgba(255,255,255,.4);transform:translateX(-50%);display:none}
.multi-count{font-size:.61rem;color:#94a3b8;text-align:center;margin-top:4px}
.multi-status{font-size:.63rem;color:#cbd5e1;text-align:center;max-width:138px;line-height:1.2;min-height:28px}

/* Optimizer panel. */
.optimizer-panel{
  margin:18px 0 0;padding:15px;border-radius:18px;
  background:linear-gradient(145deg,rgba(15,23,42,.88),rgba(30,41,59,.74));
  border:1px solid rgba(96,165,250,.22);color:#e2e8f0;
  box-shadow:0 12px 34px rgba(2,6,23,.16)
}
.optimizer-head{display:grid;grid-template-columns:1fr auto 1fr;gap:10px;align-items:center}
.optimize-btn{
  min-height:48px;border:1px solid rgba(148,163,184,.22);color:white;font-weight:950;cursor:pointer;
  transition:.16s ease;font-size:.86rem
}
.optimize-btn.att{border-radius:14px 7px 7px 14px;background:linear-gradient(135deg,#991b1b,#dc2626)}
.optimize-btn.def{border-radius:7px 14px 14px 7px;background:linear-gradient(135deg,#2563eb,#1d4ed8)}
.optimize-btn:hover{transform:translateY(-1px);filter:brightness(1.08)}
.optimizer-gen{
  display:flex;flex-direction:column;align-items:center;gap:3px;padding:5px 8px;border-radius:10px;
  background:rgba(2,6,23,.50);border:1px solid rgba(148,163,184,.16)
}
.optimizer-gen label{font-size:.58rem;text-transform:uppercase;color:#94a3b8;font-weight:900}
.optimizer-gen select{background:#0f172a;color:#fff;border:0;font-weight:900;text-align:center}
.optimizer-progress-area{margin-top:12px}
.optimizer-progress-track{height:17px;border-radius:999px;background:#0f172a;border:1px solid rgba(148,163,184,.16);overflow:hidden}
.optimizer-progress-fill{height:100%;width:0%;background:linear-gradient(90deg,#22c55e,#38bdf8);transition:width .12s linear}
.optimizer-progress-text{display:flex;justify-content:space-between;gap:8px;margin-top:5px;font-size:.69rem;color:#94a3b8}
.optimizer-note{margin-top:6px;font-size:.67rem;color:#cbd5e1}
.optimizer-recs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-top:12px}
.optimizer-rec{
  border:1px solid rgba(148,163,184,.18);border-radius:13px;padding:10px;background:rgba(2,6,23,.40);
  cursor:pointer;color:#e2e8f0;text-align:left;transition:.16s ease
}
.optimizer-rec:hover{border-color:#60a5fa;transform:translateY(-1px);background:rgba(30,58,138,.22)}
.optimizer-rec .rank{font-weight:950;color:#fde68a}
.optimizer-rec .heroes{font-size:.76rem;font-weight:850;margin-top:3px}
.optimizer-rec .ratio{font-size:.72rem;color:#93c5fd;margin-top:3px}
.optimizer-rec .score{font-size:.66rem;color:#94a3b8;margin-top:5px}
.optimizer-empty{margin-top:10px;text-align:center;color:#64748b;font-size:.72rem}
.optimizer-cancel{background:#475569!important}
.optimizer-invalid{color:#fca5a5!important}

.light-theme .optimizer-panel{background:linear-gradient(145deg,#fff,#eef5fb);color:#172033}
.light-theme .optimizer-rec{background:#fff;color:#172033;border-color:#d6e1eb}
.light-theme .rail-circle,.light-theme .rail-fight-btn,.light-theme .rail-run-select{background:#fff;color:#172033}
.light-theme .rail-fight-btn{color:#92400e}

/* Existing battle summary remains below everything. */
.battle-panel{margin-top:18px!important}

@media(max-width:1500px){
  .sim-grid{grid-template-columns:1fr!important}
  .sim-grid>.att,.sim-grid>.def{grid-column:1!important;grid-row:auto!important}
  .battle-rail{display:none!important}
  .optimizer-head{grid-template-columns:1fr}
  .optimizer-gen{justify-self:center}
}
@media(max-width:760px){
  .optimizer-recs{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){
  .battle-rail *{animation:none!important}
}

/* ===== V22 NAV RESTORE / CLEAN CENTER RAIL / FAST OPTIMIZER ===== */
html,body{min-height:100%}
body{position:relative}
.bg-media{
  position:fixed!important;inset:0!important;width:100%!important;height:100%!important;
  object-fit:cover!important;object-position:center!important;z-index:-3!important;
  opacity:1!important;pointer-events:none!important
}
.bg-overlay{position:fixed!important;inset:0!important;z-index:-2!important;background:rgba(2,6,23,.58);pointer-events:none}
.legacy-nav{display:flex!important;justify-content:center!important;align-items:center!important;gap:14px!important;margin:8px 0 20px!important}
.legacy-nav-btn{
  appearance:none;width:46px!important;height:46px!important;border-radius:50%!important;padding:0!important;
  display:grid!important;place-items:center!important;background:rgba(15,23,42,.82)!important;
  border:1px solid rgba(56,189,248,.38)!important;color:#7dd3fc!important;font-size:25px!important;
  line-height:1!important;cursor:pointer!important;box-shadow:0 7px 20px rgba(2,6,23,.20)!important;
  transition:transform .16s ease,border-color .16s ease,background .16s ease!important
}
.legacy-nav-btn:hover{transform:translateY(-2px)!important;border-color:#38bdf8!important;background:rgba(14,165,233,.15)!important}
.light-theme .legacy-nav-btn{background:rgba(255,255,255,.92)!important;color:#0369a1!important;border-color:#7dd3fc!important}

/* Clash effect fully removed. Rail is now a clean utility/control column. */
.battle-rail::before,.battle-rail::after,.rail-energy-line,.clash-stage,#clashFxToggle{display:none!important}
.sim-grid{grid-template-columns:minmax(0,1fr) 164px minmax(0,1fr)!important;gap:15px!important}
.rail-sticky{width:158px!important;gap:8px!important;padding:7px 3px!important}
.battle-rail{background:transparent!important}
.rail-circle{width:40px!important;height:40px!important}
.rail-fight-btn{margin-top:4px}

/* Compact two-half optimizer directly beneath repeated-sim controls. */
.rail-optimizer{
  width:158px;margin-top:5px;padding:7px;border-radius:18px;
  background:rgba(15,23,42,.92);border:1px solid rgba(148,163,184,.18);
  box-shadow:0 9px 26px rgba(2,6,23,.28)
}
.rail-opt-split{display:grid;grid-template-columns:1fr 42px 1fr;align-items:stretch}
.rail-opt-half{
  min-width:0;border:0;color:#fff;font-size:.61rem;line-height:1.08;font-weight:950;cursor:pointer;
  padding:9px 3px;transition:.15s ease
}
.rail-opt-half.att{border-radius:12px 5px 5px 12px;background:linear-gradient(135deg,#991b1b,#dc2626)}
.rail-opt-half.def{border-radius:5px 12px 12px 5px;background:linear-gradient(135deg,#2563eb,#1d4ed8)}
.rail-opt-half:hover{filter:brightness(1.12)}
.rail-opt-half:disabled{opacity:.42;cursor:not-allowed}
.rail-gen{
  position:relative;z-index:2;display:grid;place-items:center;padding:2px;
  background:#111827;border-top:1px solid rgba(148,163,184,.22);border-bottom:1px solid rgba(148,163,184,.22)
}
.rail-gen label{font-size:.48rem;line-height:1;color:#94a3b8;font-weight:900;text-transform:uppercase}
.rail-gen select{
  width:38px!important;max-width:38px!important;appearance:none;text-align:center;
  border:0!important;outline:0!important;background:#0f172a!important;color:#f8fafc!important;
  font-size:.72rem!important;font-weight:950!important;padding:2px 0!important;line-height:1.15!important
}
.rail-opt-caption{font-size:.52rem;color:#94a3b8;text-align:center;margin-top:5px;line-height:1.15}
.light-theme .rail-optimizer{background:rgba(255,255,255,.95);border-color:#cbd5e1}
.light-theme .rail-gen{background:#eef2f7;border-color:#cbd5e1}
.light-theme .rail-gen select{background:#fff!important;color:#172033!important}

/* Results only; no duplicated optimizer buttons below the panels. */
.optimizer-results-dock{
  margin:16px 0 0;padding:12px 14px;border-radius:15px;
  background:rgba(15,23,42,.72);border:1px solid rgba(96,165,250,.16);color:#e2e8f0
}
.light-theme .optimizer-results-dock{background:rgba(255,255,255,.88);color:#172033;border-color:#cbd5e1}
.optimizer-progress-area{margin-top:0!important}
.optimizer-note{line-height:1.35}

/* Slightly denser recommendation cards. */
.optimizer-recs{margin-top:10px!important}
.optimizer-rec{min-height:102px}

/* Make unsupported future generations clear without breaking the selector. */
.gen-availability{font-size:.54rem;color:#64748b;text-align:center;margin-top:4px}

@media(max-width:1500px){
  .sim-grid{grid-template-columns:1fr!important}
  .sim-grid>.att,.sim-grid>.def{grid-column:1!important}
  .battle-rail{display:none!important}
}

/* ===== V23 EMBEDDED BATTLE BACKGROUND / RESTORED HEADER / FORMULA DATA ===== */
.web-title{
  text-align:center!important;margin:28px auto 8px!important;color:#eaf8ff!important;
  font-family:Georgia,"Times New Roman",serif!important;font-size:clamp(2rem,3.25vw,3.35rem)!important;
  font-weight:900!important;letter-spacing:.035em!important;
  text-shadow:0 2px 0 rgba(4,47,73,.85),0 0 10px rgba(125,211,252,.55),0 0 28px rgba(56,189,248,.24),0 7px 20px rgba(2,6,23,.78)!important
}
body.light-theme .web-title{
  color:#f8fdff!important;
  text-shadow:0 2px 0 rgba(3,105,161,.72),0 0 9px rgba(224,242,254,.90),0 0 22px rgba(56,189,248,.45),0 6px 16px rgba(15,23,42,.48)!important
}
.bg-overlay{background:linear-gradient(to bottom,rgba(2,6,23,.52),rgba(2,6,23,.68))!important;backdrop-filter:none!important}
body.light-theme .bg-overlay{background:linear-gradient(to bottom,rgba(219,234,254,.34),rgba(226,232,240,.48))!important;backdrop-filter:none!important}
.rail-opt-progress{margin-top:8px;padding:7px 5px 2px;border-top:1px solid rgba(148,163,184,.14)}
.rail-opt-progress .optimizer-progress-track{height:9px!important;margin:0 0 5px!important}
.rail-opt-progress-label{font-size:.56rem;color:#cbd5e1;font-weight:900;text-align:center;line-height:1.15}
.rail-opt-progress-count{font-size:.52rem;color:#94a3b8;text-align:center;margin-top:3px;line-height:1.15}
.light-theme .rail-opt-progress-label{color:#334155}.light-theme .rail-opt-progress-count{color:#64748b}
.optimizer-results-dock{margin-top:10px!important}

/* ===== V24 RALLY/GARRISON vs WILDERNESS CONTEXT ===== */
.battle-context-switch{
  display:flex;justify-content:center;align-items:center;gap:0;
  width:max-content;max-width:100%;margin:6px auto 10px;
  padding:4px;border:1px solid rgba(96,165,250,.28);
  border-radius:15px;background:rgba(15,23,42,.76);
  box-shadow:0 8px 24px rgba(2,6,23,.17)
}
.battle-context-btn{
  min-width:165px;border:0;border-radius:11px;padding:10px 16px;
  background:transparent;color:#94a3b8;font-weight:950;
  letter-spacing:.015em;cursor:pointer;transition:.16s ease
}
.battle-context-btn:hover{color:#e2e8f0;background:rgba(30,41,59,.58)}
.battle-context-btn.active{
  color:#ecfeff;
  background:linear-gradient(135deg,rgba(8,145,178,.88),rgba(37,99,235,.88));
  box-shadow:0 5px 16px rgba(14,165,233,.20)
}
body.light-theme .battle-context-switch{background:rgba(255,255,255,.92);border-color:#bae6fd}
body.light-theme .battle-context-btn{color:#64748b}
body.light-theme .battle-context-btn:hover{color:#0f172a;background:#f1f5f9}
body.light-theme .battle-context-btn.active{color:#fff}
@media(max-width:520px){
  .battle-context-switch{width:100%}
  .battle-context-btn{min-width:0;flex:1;padding-inline:8px;font-size:.78rem}
}

/* ===== V26 HECTOR RAMPANT + CLEARER CENTER OPTIMIZER ===== */
.sim-grid{grid-template-columns:minmax(0,1fr) 250px minmax(0,1fr)!important;gap:18px!important}
.rail-sticky{
  width:242px!important;gap:9px!important;padding:8px 4px!important;
  max-height:96vh;overflow-y:auto;scrollbar-width:thin
}
.rail-optimizer{
  width:238px!important;margin-top:7px!important;padding:10px!important;border-radius:20px!important;
  border-color:rgba(96,165,250,.28)!important
}
.rail-opt-split{grid-template-columns:minmax(0,1fr) 66px minmax(0,1fr)!important;gap:4px!important}
.rail-opt-half{
  min-height:56px!important;padding:9px 7px!important;font-size:.80rem!important;
  line-height:1.15!important;letter-spacing:.01em!important
}
.rail-opt-half.att{border-radius:13px 7px 7px 13px!important}
.rail-opt-half.def{border-radius:7px 13px 13px 7px!important}
.rail-gen{
  border:1px solid rgba(148,163,184,.22)!important;border-radius:8px!important;
  padding:5px 3px!important;align-content:center!important
}
.rail-gen label{font-size:.60rem!important;letter-spacing:.05em!important;margin-bottom:3px!important}
.rail-gen select{
  width:56px!important;max-width:56px!important;font-size:.95rem!important;
  padding:3px 0!important;cursor:pointer!important
}
.rail-opt-caption{
  font-size:.64rem!important;line-height:1.3!important;margin-top:7px!important;color:#cbd5e1!important
}
.rail-opt-progress{margin-top:9px!important;padding:9px 3px 2px!important}
.rail-opt-progress .optimizer-progress-track{height:12px!important;border-radius:999px!important}
.rail-opt-progress-label{font-size:.68rem!important;margin-top:5px!important}
.rail-opt-progress-count{font-size:.62rem!important;margin-top:4px!important}
.rail-opt-note{
  margin-top:8px;padding-top:7px;border-top:1px solid rgba(148,163,184,.13);
  color:#94a3b8;font-size:.61rem;line-height:1.25;text-align:center
}
.rail-opt-empty{
  margin-top:7px!important;padding:8px!important;min-height:0!important;
  font-size:.66rem!important;color:#64748b!important
}
.rail-optimizer .optimizer-recs{
  display:flex!important;flex-direction:column!important;gap:7px!important;margin-top:8px!important
}
.rail-optimizer .optimizer-rec{
  width:100%!important;min-height:0!important;border-radius:11px!important;padding:8px 9px!important;
  background:rgba(2,6,23,.48)!important;text-align:left!important
}
.rail-optimizer .optimizer-rec .rank{font-size:.78rem!important}
.rail-optimizer .optimizer-rec .heroes{font-size:.72rem!important;line-height:1.22!important;margin-top:2px!important}
.rail-optimizer .optimizer-rec .ratio{font-size:.70rem!important;margin-top:3px!important}
.rail-optimizer .optimizer-rec .score{font-size:.58rem!important;line-height:1.25!important;margin-top:4px!important}
.light-theme .rail-opt-caption{color:#475569!important}
.light-theme .rail-opt-note{color:#64748b}
.light-theme .rail-optimizer .optimizer-rec{background:#fff!important}
@media(max-width:1500px){
  .sim-grid{grid-template-columns:1fr!important}
  .battle-rail{display:none!important}
}

/* ===== V27 WIDER LAYOUT / GROUPED OPTIMIZER / GWEN ===== */
html,body{max-width:100%;overflow-x:clip!important}
.hub-container{max-width:2180px!important;width:calc(100% - 18px)!important}
.sim-grid{grid-template-columns:minmax(0,1fr) 292px minmax(0,1fr)!important;gap:20px!important}
.panel,.side,.dynamic-loadout,.dynamic-content,.ratio-wrap{min-width:0!important;max-width:100%!important;overflow-x:hidden!important}
.rail-sticky{width:284px!important;max-width:284px!important;overflow-x:hidden!important;overflow-y:auto!important}
.rail-optimizer{width:278px!important;max-width:278px!important;padding:12px!important}
.rail-opt-half{font-size:.88rem!important;min-height:62px!important}
.rail-gen{min-width:72px!important}.rail-gen select{width:62px!important;max-width:62px!important;font-size:1.02rem!important}
.rail-opt-caption{font-size:.69rem!important}.rail-opt-progress-label{font-size:.72rem!important}.rail-opt-progress-count{font-size:.66rem!important}
.rail-optimizer .optimizer-recs{display:flex!important;flex-direction:column!important;gap:10px!important}
.optimizer-hero-group{border:1px solid rgba(148,163,184,.20);border-radius:14px;padding:10px;background:rgba(2,6,23,.48)}
.optimizer-hero-group.att{border-left:3px solid #ef4444}.optimizer-hero-group.def{border-right:3px solid #3b82f6}
.optimizer-group-head{display:flex;justify-content:space-between;align-items:center;gap:7px}
.optimizer-side-badge{font-size:.58rem;font-weight:950;letter-spacing:.04em;padding:3px 6px;border-radius:999px}
.optimizer-side-badge.att{color:#fecaca;background:rgba(127,29,29,.48);border:1px solid rgba(239,68,68,.34)}
.optimizer-side-badge.def{color:#bfdbfe;background:rgba(30,64,175,.42);border:1px solid rgba(59,130,246,.34)}
.optimizer-hero-group>.heroes{font-size:.80rem!important;font-weight:950;margin:5px 0 7px}
.optimizer-group-ratios{display:flex;flex-direction:column;gap:6px}
.optimizer-ratio-option{width:100%;border-radius:10px;padding:7px 8px;text-align:left;cursor:pointer;background:rgba(15,23,42,.72);border:1px solid rgba(148,163,184,.15);color:#e2e8f0}
.optimizer-ratio-option:hover{border-color:#7dd3fc;filter:brightness(1.08)}
.optimizer-ratio-option.att .ratio{color:#f87171!important}.optimizer-ratio-option.def .ratio{color:#60a5fa!important}
.optimizer-ratio-option .ratio{font-size:.74rem!important;font-weight:950}.optimizer-ratio-option .score{font-size:.59rem!important;line-height:1.26!important;color:#94a3b8}
.light-theme .optimizer-hero-group{background:#fff}.light-theme .optimizer-ratio-option{background:#f8fafc;color:#172033}
.rail-sticky::-webkit-scrollbar{width:7px;height:0}

@media(max-width:1600px){.sim-grid{grid-template-columns:1fr!important}.battle-rail{display:none!important}}

/* ===== V28 OPTIMIZER READABILITY / TRUE STICKY / FINAL RANKING ===== */
.battle-rail{
  align-self:stretch!important;
  min-height:100%!important;
  overflow:visible!important
}
.rail-sticky{
  position:sticky!important;
  top:12px!important;
  transform:none!important;
  align-self:start!important;
  max-height:calc(100vh - 24px)!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  scrollbar-width:thin!important
}
.rail-sticky::-webkit-scrollbar{width:7px!important;height:0!important}

.optimizer-hero-group,
.optimizer-hero-group .rank,
.optimizer-hero-group .heroes,
.optimizer-hero-group .ratio,
.optimizer-hero-group .score{
  color:#e5edf7!important
}
.optimizer-hero-group .rank{color:#fde047!important}
.optimizer-hero-group.att .heroes{color:#fecaca!important}
.optimizer-hero-group.def .heroes{color:#bfdbfe!important}
.optimizer-ratio-option.att .ratio{color:#ff7b7b!important}
.optimizer-ratio-option.def .ratio{color:#77b7ff!important}
.optimizer-ratio-option .score{color:#aebed2!important}
.optimizer-hero-group{
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025)
}
.optimizer-progress-fill{width:0;transition:width .14s linear}
.optimizer-progress-track{overflow:hidden!important}

body.light-theme .optimizer-hero-group,
body.light-theme .optimizer-hero-group .heroes,
body.light-theme .optimizer-hero-group .ratio,
body.light-theme .optimizer-hero-group .score{color:#172033!important}
body.light-theme .optimizer-hero-group .rank{color:#a16207!important}
body.light-theme .optimizer-ratio-option.att .ratio{color:#b91c1c!important}
body.light-theme .optimizer-ratio-option.def .ratio{color:#1d4ed8!important}

/* ===== V29 MULTI-RATIO SCREENING / VIEWPORT-CENTERED RAIL ===== */
.battle-rail{
  position:relative!important;
  overflow:visible!important;
  align-self:stretch!important;
  min-height:100%!important
}
.rail-sticky{
  position:absolute!important;
  top:0;
  left:50%;
  transform:translateX(-50%)!important;
  align-self:start!important;
  max-height:96vh!important;
  overflow-y:auto!important;
  overflow-x:clip!important;
  overscroll-behavior:contain;
  z-index:70
}
.rail-sticky.rail-fixed{
  position:fixed!important;
  top:50vh!important;
  transform:translate(-50%,-50%)!important
}
.rail-sticky.rail-bottom{
  top:auto!important;
  bottom:0!important;
  transform:translateX(-50%)!important
}

/* ===== V31 LOCKED-STATS OPTIMIZER ===== */
.optimizer-group-head{display:grid!important;grid-template-columns:auto 1fr auto!important;align-items:center!important}
.optimizer-mode-badge{
  justify-self:center;
  font-size:.54rem;font-weight:950;letter-spacing:.05em;
  padding:3px 6px;border-radius:999px
}
.optimizer-mode-badge.locked{
  color:#fde68a;background:rgba(120,53,15,.45);border:1px solid rgba(245,158,11,.36)
}
.optimizer-mode-badge.dynamic{
  color:#a5f3fc;background:rgba(8,47,73,.48);border:1px solid rgba(34,211,238,.30)
}
body.light-theme .optimizer-mode-badge.locked{color:#92400e;background:#fef3c7}
body.light-theme .optimizer-mode-badge.dynamic{color:#0e7490;background:#cffafe}

/* ===== V34 NORMAL VS SKILL DAMAGE REPORTING ===== */
.damage-channel{display:inline-block;padding:1px 6px;border-radius:999px;font-size:.82em;font-weight:850}
.damage-channel.normal{color:#dbeafe;background:rgba(59,130,246,.13);border:1px solid rgba(96,165,250,.18)}
.damage-channel.skill{color:#fef3c7;background:rgba(245,158,11,.13);border:1px solid rgba(251,191,36,.22)}
.skill-hit-tag{display:inline-block;color:#fde68a;background:rgba(120,53,15,.32);border:1px solid rgba(245,158,11,.25);padding:1px 5px;border-radius:999px;font-size:.76em;font-weight:900}
.zero-damage-reason{color:#fca5a5;font-size:.86em}
body.light-theme .damage-channel.normal{color:#1d4ed8;background:#eff6ff}
body.light-theme .damage-channel.skill{color:#92400e;background:#fffbeb}
body.light-theme .zero-damage-reason{color:#b91c1c}

/* ===== V36 REPEATED-SIMULATION BUTTON RESET ===== */
.rail-fight-btn:disabled{cursor:wait;opacity:.88}

/* ===== V37 HERO GENERATION BADGES + GEN 6 ===== */
.hero-photo-select,.hero-picker-choice{position:relative!important}
.hero-gen-badge{
 position:absolute;z-index:4;top:-9px;right:7px;
 padding:2px 7px;border-radius:999px;
 background:linear-gradient(135deg,#7c5a08,#d4af37);
 color:#fff7cc;border:1px solid rgba(255,225,120,.72);
 font-size:.58rem;font-weight:950;letter-spacing:.06em;
 box-shadow:0 3px 9px rgba(0,0,0,.34)
}
.hero-picker-choice{padding-top:27px!important}
.hero-picker-gen{
 position:absolute;z-index:3;top:7px;left:50%;transform:translateX(-50%);
 padding:2px 7px;border-radius:999px;white-space:nowrap;
 background:linear-gradient(135deg,#725207,#d2ab2f);
 color:#fff7cc;border:1px solid rgba(255,225,120,.65);
 font-size:.58rem;font-weight:950;letter-spacing:.05em
}
body.light-theme .hero-gen-badge,body.light-theme .hero-picker-gen{
 background:linear-gradient(135deg,#fff3bf,#f2c94c);
 color:#6b4f00;border-color:#b98a00;box-shadow:0 2px 7px rgba(100,72,0,.16)
}
.damage-channel.special{color:#e9d5ff;background:rgba(147,51,234,.13);border:1px solid rgba(192,132,252,.22)}
body.light-theme .damage-channel.special{color:#7e22ce;background:#faf5ff}

/* ===== V38 PORTRAIT JOINERS + NORAH ===== */
.portrait-joiner-card{padding:10px!important}
.joiner-portrait-layout{
 display:grid;grid-template-columns:minmax(110px,150px) 94px 34px;
 gap:10px;align-items:center
}
.joiner-photo-select{
 width:100%;min-height:150px;border-radius:16px;
 border:1px solid rgba(56,189,248,.24);
 background:rgba(15,23,42,.54);color:var(--text);
 display:flex;flex-direction:column;align-items:center;justify-content:center;
 gap:5px;padding:10px;cursor:pointer;position:relative
}
.joiner-photo-select:hover{border-color:#38bdf8;background:rgba(14,116,144,.12)}
.joiner-portrait-img{
 width:78px;height:78px;object-fit:cover;border-radius:15px;
 border:1px solid rgba(255,255,255,.16);box-shadow:0 5px 14px rgba(0,0,0,.22)
}
.joiner-empty-plus{
 width:78px;height:78px;border-radius:15px;display:grid;place-items:center;
 border:1px dashed rgba(148,163,184,.56);font-size:3rem;line-height:1;
 color:#b8c7dc;background:rgba(15,23,42,.34)
}
.joiner-photo-select strong{font-size:.9rem;line-height:1.05}
.joiner-skill-name{font-size:.68rem;color:var(--muted);text-align:center;line-height:1.15}
.joiner-level-field label{display:block;margin-bottom:5px;text-align:center}
.joiner-level-field select{width:100%}
.joiner-picker-choice span{display:block;color:var(--muted);font-size:.67rem;line-height:1.15;margin-top:3px}
.joiner-picker-plus{font-size:2.6rem!important;display:grid!important;place-items:center!important}
body.light-theme .joiner-photo-select{background:rgba(255,255,255,.72);border-color:#cbd5e1}
body.light-theme .joiner-empty-plus{background:#f8fafc;color:#64748b;border-color:#94a3b8}
@media(max-width:650px){
 .joiner-portrait-layout{grid-template-columns:1fr 90px 34px}
}

/* ===== V39 JOINER EFFECT VISIBILITY / COMPACT HORIZONTAL JOINERS ===== */
#att_joinerContainer,#def_joinerContainer{
 display:grid!important;
 grid-template-columns:repeat(4,minmax(0,1fr))!important;
 gap:10px!important;
 align-items:start!important;
 margin-top:10px!important
}
#att_joinerContainer .portrait-joiner-card,
#def_joinerContainer .portrait-joiner-card{
 margin:0!important;padding:8px!important;min-width:0!important
}
.joiner-portrait-layout{
 position:relative!important;
 display:flex!important;
 flex-direction:column!important;
 align-items:stretch!important;
 gap:7px!important
}
.joiner-photo-select{
 min-height:126px!important;
 padding:8px 6px!important
}
.joiner-portrait-img,.joiner-empty-plus{
 width:68px!important;height:68px!important
}
.joiner-level-field{
 width:100%!important;
 display:grid!important;
 grid-template-columns:auto 1fr!important;
 gap:6px!important;
 align-items:center!important
}
.joiner-level-field label{
 margin:0!important;text-align:left!important;font-size:.68rem!important;white-space:nowrap
}
.joiner-level-field select{min-width:0!important;height:30px!important;padding:2px 5px!important}
.joiner-portrait-layout>.remove-joiner{
 position:absolute!important;top:3px!important;right:3px!important;z-index:6!important;
 width:26px!important;height:26px!important;min-width:26px!important;padding:0!important;
 border-radius:8px!important;font-size:.72rem!important
}
.joiner-active-stat{color:#67e8f9;font-weight:850}
body.light-theme .joiner-active-stat{color:#0e7490}

@media(max-width:1100px){
 #att_joinerContainer,#def_joinerContainer{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:600px){
 #att_joinerContainer,#def_joinerContainer{grid-template-columns:1fr!important}
}

/* ===== V39 OPTIMIZER GEN CONTROL ===== */
.rail-opt-split{
 display:grid!important;
 grid-template-columns:minmax(0,1fr) 54px minmax(0,1fr)!important;
 gap:4px!important;
 align-items:stretch!important
}
.rail-opt-half.att{border-radius:12px 7px 7px 12px!important}
.rail-opt-half.def{border-radius:7px 12px 12px 7px!important}
.rail-gen{
 z-index:1!important;
 border:1px solid rgba(255,220,95,.72)!important;
 border-radius:8px!important;
 background:linear-gradient(145deg,#5f4507,#b8860b)!important;
 box-shadow:inset 0 1px 0 rgba(255,247,190,.24),0 2px 8px rgba(0,0,0,.22)!important;
 padding:4px 2px!important
}
.rail-gen label{
 color:#fff1a8!important;
 font-size:.48rem!important;
 letter-spacing:.08em!important
}
.rail-gen select{
 width:42px!important;max-width:42px!important;
 background:transparent!important;
 color:#fff8cf!important;
 font-size:.78rem!important
}
.rail-gen select option{color:#111827;background:#fff}
body.light-theme .rail-gen{
 background:linear-gradient(145deg,#fff3b0,#e6b93e)!important;
 border-color:#a87800!important
}
body.light-theme .rail-gen label,body.light-theme .rail-gen select{color:#624700!important}

/* ===== V42 FORMULA EXPERIMENT AUDIT ===== */
.formula-audit{
 margin-top:3px;color:#93c5fd;font-size:.72em;font-weight:700;opacity:.9
}
body.light-theme .formula-audit{color:#1d4ed8}

/* ===== IDE-SAFE DEFAULTS FOR DYNAMIC CSS CUSTOM PROPERTIES ===== */
:root{
 --fill:0%;
 --dur:1s;
 --delay:0s;
 --scale:1;
 --drift:0px;
 --pc:#facc15;
 --dx:0px;
 --dy:-55px;
 --text:currentColor;
 --x:50%;
 --s:6px;
 --d:0s;
 --dr:8px;
 --ratio-color:#38bdf8;
 --gem-h:45;
}


/* ===== V43 DEEP FORMULA AUDIT ===== */
.formula-deep-audit{
 margin:5px 0 8px 0;border:1px solid rgba(96,165,250,.18);
 border-radius:9px;background:rgba(15,23,42,.28);max-width:100%
}
.formula-deep-audit>summary{
 cursor:pointer;padding:5px 8px;color:#93c5fd;font-size:.72rem;
 font-weight:850;letter-spacing:.02em;user-select:none
}
.formula-deep-audit-grid{
 display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
 gap:3px 8px;padding:6px 8px 8px
}
.formula-deep-audit-grid>div{
 display:flex;justify-content:space-between;gap:7px;
 border-bottom:1px solid rgba(148,163,184,.08);
 padding:2px 0;font-size:.67rem;min-width:0
}
.formula-deep-audit-grid span{color:#94a3b8;overflow:hidden;text-overflow:ellipsis}
.formula-deep-audit-grid b{color:#e2e8f0;text-align:right;white-space:nowrap}
body.light-theme .formula-deep-audit{background:rgba(248,250,252,.8);border-color:#dbeafe}
body.light-theme .formula-deep-audit>summary{color:#1d4ed8}
body.light-theme .formula-deep-audit-grid span{color:#64748b}
body.light-theme .formula-deep-audit-grid b{color:#0f172a}
@media(max-width:900px){.formula-deep-audit-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.formula-deep-audit-grid{grid-template-columns:1fr}}


/* ===== V44 TROOP-STAT FORMULA BREAKDOWN ===== */
/* V46: operation-group damage stacking + explicit base/normal/extra channels. */
/* V47: corrected leader/joiner group merging, defensive operation groups, no 95% cap, delayed Momentum/Viper timing. */
/* V48: Attack/Defense/Health/enemy-Attack hero stamps use op102/op112/op113/op202; Greg lag and vulnerability op buckets corrected. */
/* V49: introduced explicit Alonso extra-normal channel and Wu audit cleanup. */
/* V50: restored CURRENT Alonso S1 lethality / S2 all-troop attack proc; kept S3 extra-normal op101; S1 stat/widget ordering and S2 op201 timing rechecked. Troop offensive op101/op102 + extra-attack buckets now merge correctly with hero groups. */
.audit-section-title{
 margin:7px 8px 2px;padding-top:5px;
 color:#f8fafc;font-size:.72rem;font-weight:950;
 border-top:1px solid rgba(148,163,184,.13);
 letter-spacing:.025em
}
.formula-deep-audit>summary+.audit-section-title{border-top:0;margin-top:2px}
.formula-original-grid .audit-key b{color:#7dd3fc}
.formula-original-grid .audit-result b{color:#86efac}
.formula-original-grid .audit-formula{
 grid-column:span 2;background:rgba(59,130,246,.08);padding:4px 5px;border-radius:5px
}
.formula-original-grid .audit-formula b{color:#bfdbfe}
.formula-original-grid .audit-final{
 background:rgba(34,197,94,.09);padding:4px 5px;border-radius:5px
}
.formula-original-grid .audit-final b{color:#bbf7d0}
body.light-theme .audit-section-title{color:#0f172a}
body.light-theme .formula-original-grid .audit-key b{color:#0369a1}
body.light-theme .formula-original-grid .audit-result b{color:#15803d}
body.light-theme .formula-original-grid .audit-final b{color:#166534}


/* V53: Logan/Philly/Molly/Wayne interaction audit.
   Concrete fixes:
   - Wayne Roundabout Hit is independent side skill damage to enemy Lancer
     + Marksman every other Wayne Marksman attack.
   - Splash/side damage recomputes target-specific Renee and troop-counter
     DamageUp groups for the troop type actually being hit. */
/* V52: unified target-specific OppDamageDown op201 across Alonso/Greg/Lynn/Norah; Ahmose Blade target scoping fixed; joiner operation reporting corrected. */
/* V51: optimizer performance only. Search stages, candidate retention, ratio grid,
   RNG seeds, and simulation counts are unchanged. Fast mode now caches static combat/group
   data, avoids nonvisual DOM refreshes, throttles progress painting, and yields by a GLOBAL time budget. */

/* ===== V54 OPTIMIZER GEN BOX MENU / NO-OVERLAP FIX =====
   The middle GEN column now owns its full width. The original select remains
   in the DOM for battle_simulator.js, but the user interacts with a WOS-style
   GEN button + grid menu like Bear Hunt / Endless Trials. */
.rail-opt-split{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 72px minmax(0,1fr)!important;
  gap:7px!important;
  align-items:stretch!important;
  width:100%!important;
}
.rail-opt-half{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  position:relative!important;
  z-index:1!important;
}
.rail-gen{
  position:relative!important;
  z-index:40!important;
  width:72px!important;
  min-width:72px!important;
  max-width:72px!important;
  padding:0!important;
  border:0!important;
  border-radius:11px!important;
  background:transparent!important;
  box-shadow:none!important;
  overflow:visible!important;
  display:flex!important;
  align-items:stretch!important;
  justify-content:stretch!important;
}
.rail-gen>label{display:none!important}

/* Keep the original select functional for existing JS, but invisible to users. */
.rail-gen>select{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  min-width:1px!important;
  max-width:1px!important;
  opacity:0!important;
  pointer-events:none!important;
  overflow:hidden!important;
  clip-path:inset(50%)!important;
}

.rail-gen-box-btn{
  width:72px;
  min-width:72px;
  min-height:62px;
  padding:6px 4px;
  border:1px solid #ffdb6b;
  border-radius:11px;
  background:linear-gradient(135deg,#d99a12,#8f6505);
  color:#fff8d1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  cursor:pointer;
  font-weight:1000;
  box-shadow:0 6px 18px rgba(150,101,0,.28),inset 0 1px 0 rgba(255,247,190,.28);
  transition:transform .15s ease,filter .15s ease,box-shadow .15s ease;
}
.rail-gen-box-btn:hover{
  transform:translateY(-1px);
  filter:brightness(1.08);
  box-shadow:0 8px 22px rgba(150,101,0,.34),inset 0 1px 0 rgba(255,247,190,.34);
}
.rail-gen-box-btn:active{transform:translateY(0) scale(.98)}
.rail-gen-box-btn .gen-box-title{
  font-size:.58rem;
  line-height:1;
  letter-spacing:.08em;
}
.rail-gen-box-btn strong{
  font-size:1.08rem;
  line-height:1.1;
}

.rail-gen-box-menu{
  position:absolute;
  top:calc(100% + 8px);
  left:50%;
  transform:translateX(-50%);
  z-index:10060;
  display:grid;
  grid-template-columns:repeat(4,58px);
  gap:6px;
  width:max-content;
  padding:8px;
  border:1px solid #6f5520;
  border-radius:12px;
  background:#120c1e;
  box-shadow:0 18px 45px rgba(0,0,0,.58);
}
.rail-gen-box-menu[hidden]{display:none!important}
.rail-gen-box-menu button{
  min-width:58px;
  min-height:38px;
  border:1px solid #5f4a1d;
  border-radius:9px;
  background:#241730;
  color:#ffe08b;
  padding:7px 6px;
  font-size:.80rem;
  font-weight:950;
  cursor:pointer;
  transition:.14s ease;
}
.rail-gen-box-menu button:hover,
.rail-gen-box-menu button.active{
  background:#f3b62c;
  color:#211405;
  border-color:#ffe08b;
  box-shadow:0 3px 10px rgba(243,182,44,.24);
}

/* Battle Simulator light theme version of the same box menu. */
body.light-theme .rail-gen-box-btn{
  background:linear-gradient(135deg,#ffd86b,#d99a12)!important;
  color:#3d2a00!important;
  border-color:#b8860b!important;
  box-shadow:0 5px 16px rgba(142,96,0,.18),inset 0 1px 0 rgba(255,255,255,.52)!important;
}
body.light-theme .rail-gen-box-menu{
  background:#ffffff!important;
  border-color:#c9a347!important;
  box-shadow:0 18px 40px rgba(39,54,72,.20)!important;
}
body.light-theme .rail-gen-box-menu button{
  background:#f8fafc!important;
  color:#4b3a0b!important;
  border-color:#d5c083!important;
}
body.light-theme .rail-gen-box-menu button:hover,
body.light-theme .rail-gen-box-menu button.active{
  background:#f3b62c!important;
  color:#211405!important;
  border-color:#b8870c!important;
}

/* Do not let the sticky rail clip the open generation grid. */
.rail-optimizer,
.rail-opt-split{
  overflow:visible!important;
}

/* If the rail becomes narrow, buttons wrap rather than overlap. */
@media(max-width:1850px) and (min-width:1601px){
  .rail-opt-split{
    grid-template-columns:minmax(0,1fr) 68px minmax(0,1fr)!important;
    gap:5px!important;
  }
  .rail-gen,.rail-gen-box-btn{
    width:68px!important;
    min-width:68px!important;
    max-width:68px!important;
  }
  .rail-opt-half{
    font-size:.80rem!important;
    padding-inline:5px!important;
  }
}




/* === v0.69 joint leader / formation / joiner optimizer === */
.rail-joiner-opt{display:grid;grid-template-columns:30px minmax(0,1fr);gap:8px;align-items:center;margin:8px 1px 1px;padding:7px 8px;border:1px solid rgba(148,163,184,.18);border-radius:10px;background:rgba(15,23,42,.58);cursor:pointer;user-select:none}
.rail-joiner-opt input{position:absolute;opacity:0;pointer-events:none}
.rail-joiner-switch{width:30px;height:17px;border-radius:999px;background:rgba(100,116,139,.55);position:relative;transition:.18s ease;box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}
.rail-joiner-switch:after{content:"";position:absolute;width:13px;height:13px;left:2px;top:2px;border-radius:50%;background:#e2e8f0;transition:.18s ease}
.rail-joiner-opt input:checked+.rail-joiner-switch{background:#0ea5e9;box-shadow:0 0 0 2px rgba(14,165,233,.12)}
.rail-joiner-opt input:checked+.rail-joiner-switch:after{transform:translateX(13px);background:#fff}
.rail-joiner-copy{display:flex;flex-direction:column;min-width:0;line-height:1.05}.rail-joiner-copy b{font-size:.66rem;color:#e2e8f0}.rail-joiner-copy small{font-size:.54rem;color:#94a3b8;margin-top:3px;white-space:normal}
.optimizer-joiners{font-size:.63rem;line-height:1.25;margin-top:5px;padding:4px 6px;border-radius:6px;background:rgba(14,165,233,.09);border:1px solid rgba(14,165,233,.16);color:#bae6fd}
.light-theme .rail-joiner-opt{background:rgba(248,250,252,.92);border-color:#cbd5e1}.light-theme .rail-joiner-copy b{color:#1e293b}.light-theme .rail-joiner-copy small{color:#64748b}.light-theme .optimizer-joiners{color:#075985;background:#e0f2fe;border-color:#bae6fd}

/* === v0.70 optimizer toggles + both-army quick controls === */
.rail-opt-toggle-stack{display:grid;gap:6px;margin-top:8px}.rail-opt-toggle-stack .rail-joiner-opt{margin:0 1px}
.rail-global-tools{margin:8px 1px 2px;padding:8px;border:1px solid rgba(148,163,184,.18);border-radius:10px;background:rgba(15,23,42,.42)}
.rail-global-title{font-size:.60rem;font-weight:900;letter-spacing:.06em;text-transform:uppercase;color:#cbd5e1;margin-bottom:6px;text-align:center}
.rail-global-selects{display:grid;grid-template-columns:1fr 1fr;gap:6px}.rail-global-selects label{display:grid;grid-template-columns:auto 1fr;gap:5px;align-items:center;font-size:.54rem;color:#94a3b8}.rail-global-selects select{width:100%;min-width:0;background:rgba(2,6,23,.76);border:1px solid rgba(148,163,184,.22);border-radius:7px;color:#e2e8f0;padding:5px 4px;font-size:.59rem;font-weight:800}
.rail-global-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:6px}.rail-global-btn{border:1px solid rgba(148,163,184,.22);border-radius:7px;padding:6px 4px;font-size:.55rem;font-weight:900;cursor:pointer;color:#e2e8f0;background:rgba(30,41,59,.82)}.rail-global-btn.max{border-color:rgba(34,197,94,.38);color:#bbf7d0;background:rgba(22,101,52,.20)}.rail-global-btn.reset{border-color:rgba(248,113,113,.35);color:#fecaca;background:rgba(127,29,29,.16)}.rail-global-btn:hover{filter:brightness(1.12)}
.light-theme .rail-global-tools{background:rgba(248,250,252,.92);border-color:#cbd5e1}.light-theme .rail-global-title{color:#334155}.light-theme .rail-global-selects label{color:#64748b}.light-theme .rail-global-selects select{background:#fff;color:#1e293b;border-color:#cbd5e1}.light-theme .rail-global-btn{background:#f8fafc;color:#334155;border-color:#cbd5e1}.light-theme .rail-global-btn.max{background:#f0fdf4;color:#166534;border-color:#bbf7d0}.light-theme .rail-global-btn.reset{background:#fef2f2;color:#991b1b;border-color:#fecaca}

/* Extracted from battle_simulator.html style block 2: id="v0744-meta-styles" */

/* v0.74.5 — Global Meta launch button / audited search */
@keyframes metaGlowPulse{0%,100%{box-shadow:0 0 0 1px rgba(192,132,252,.18),0 0 16px rgba(168,85,247,.28),0 7px 22px rgba(14,165,233,.16)}50%{box-shadow:0 0 0 1px rgba(216,180,254,.38),0 0 28px rgba(168,85,247,.52),0 9px 30px rgba(14,165,233,.28)}}
@keyframes metaShimmer{0%{transform:translateX(-150%) skewX(-22deg)}60%,100%{transform:translateX(260%) skewX(-22deg)}}
.rail-meta-btn{position:relative;overflow:hidden;width:calc(100% - 2px);margin:10px 1px 0;border:1px solid rgba(192,132,252,.78);border-radius:12px;padding:11px 7px;background:linear-gradient(135deg,rgba(88,28,135,.88),rgba(30,64,175,.68),rgba(8,145,178,.58));color:#fff;font-size:.70rem;font-weight:950;letter-spacing:.025em;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:6px;animation:metaGlowPulse 2.4s ease-in-out infinite;transition:transform .18s ease,filter .18s ease}
.rail-meta-btn:after{content:"";position:absolute;inset:-20% auto -20% -35%;width:30%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.48),transparent);animation:metaShimmer 3.2s ease-in-out infinite;pointer-events:none}.rail-meta-btn:hover{filter:brightness(1.18);transform:translateY(-2px) scale(1.015)}.rail-meta-btn:disabled{opacity:.45;cursor:not-allowed;transform:none;animation:none}.meta-btn-spark{color:#e9d5ff;text-shadow:0 0 10px rgba(255,255,255,.8)}.meta-btn-spark.second{font-size:.58rem;opacity:.8}
.rail-meta-caption{text-align:center;color:#c4b5fd;font-size:.52rem;line-height:1.25;margin:5px 4px 2px}.global-meta-summary{display:grid;gap:6px;margin-top:8px;padding:9px;border-radius:10px;border:1px solid rgba(192,132,252,.28);background:rgba(88,28,135,.12);text-align:center}.global-meta-summary b{font-size:.62rem;color:#e9d5ff}.global-meta-summary span{font-size:.49rem;color:#94a3b8;line-height:1.25}.global-meta-summary button{border:1px solid rgba(125,211,252,.4);border-radius:8px;padding:7px;background:rgba(14,116,144,.22);color:#bae6fd;font-size:.56rem;font-weight:900;cursor:pointer}.global-meta-summary button:hover{filter:brightness(1.15)}
/* Joiner picker grouped into one horizontal row per generation */
.joiner-picker-none-row{display:flex;justify-content:flex-start;margin-bottom:14px}.joiner-picker-none-row .joiner-picker-choice{width:132px}.joiner-gen-list{display:grid;gap:16px}.joiner-gen-section{display:grid;gap:7px}.joiner-gen-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 3px 6px;border-bottom:1px solid rgba(148,163,184,.18)}.joiner-gen-head b{font-size:.82rem;color:#e9d5ff}.joiner-gen-head span{font-size:.66rem;color:#94a3b8}.joiner-gen-row{display:flex;gap:9px;overflow-x:auto;overflow-y:hidden;padding:2px 2px 8px;scrollbar-width:thin}.joiner-gen-row .joiner-picker-choice{flex:0 0 132px;width:132px;min-width:132px}.joiner-gen-row .joiner-picker-choice img{width:68px;height:68px}.joiner-gen-row .joiner-picker-choice b{font-size:.76rem}.joiner-gen-row .joiner-picker-choice span{font-size:.60rem}.joiner-gen-row .joiner-picker-choice small{font-size:.58rem}
/* Dedicated Global Meta results window */
body.meta-modal-open{overflow:hidden}.global-meta-modal{position:fixed;inset:0;z-index:10150;display:none;align-items:center;justify-content:center;padding:22px;background:rgba(2,6,23,.82);backdrop-filter:blur(10px)}.global-meta-modal.open{display:flex}.global-meta-dialog{width:min(1220px,97vw);max-height:92vh;overflow:hidden;border-radius:22px;border:1px solid rgba(168,85,247,.42);background:linear-gradient(160deg,#0b1220,#101a2d 58%,#111827);box-shadow:0 34px 100px rgba(0,0,0,.62),0 0 40px rgba(124,58,237,.18);display:flex;flex-direction:column}.global-meta-modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:19px 22px 15px;border-bottom:1px solid rgba(148,163,184,.16);background:linear-gradient(90deg,rgba(88,28,135,.20),rgba(14,116,144,.10))}.global-meta-modal-head h2{margin:2px 0 3px;font-size:1.35rem;color:#f8fafc}.global-meta-modal-head p{margin:0;color:#94a3b8;font-size:.78rem}.meta-kicker{font-size:.62rem;font-weight:950;letter-spacing:.14em;color:#c4b5fd}.global-meta-close{flex:0 0 auto;width:39px;height:39px;border-radius:11px;border:1px solid rgba(148,163,184,.28);background:rgba(30,41,59,.72);color:#fff;font-size:1.45rem;cursor:pointer}.global-meta-close:hover{border-color:#c4b5fd;background:rgba(88,28,135,.28)}.global-meta-modal-body{overflow:auto;padding:18px 20px 24px}.meta-modal-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.meta-modal-section{min-width:0}.meta-modal-section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:10px;padding:0 3px}.meta-modal-section-head span{font-size:.58rem;font-weight:950;letter-spacing:.12em}.meta-modal-section.att .meta-modal-section-head span,.meta-modal-section.att h3{color:#fca5a5}.meta-modal-section.def .meta-modal-section-head span,.meta-modal-section.def h3{color:#93c5fd}.meta-modal-section-head h3{margin:1px 0 0;font-size:1.02rem}.meta-modal-section-head p{margin:0;max-width:260px;text-align:right;font-size:.64rem;line-height:1.3;color:#94a3b8}.meta-card-list{display:grid;gap:11px}.meta-rich-card{position:relative;border-radius:16px;border:1px solid rgba(148,163,184,.18);background:rgba(15,23,42,.68);padding:13px;box-shadow:0 9px 28px rgba(0,0,0,.14)}.meta-rich-card.att{border-left:4px solid #ef4444}.meta-rich-card.def{border-left:4px solid #3b82f6}.meta-card-top{display:grid;grid-template-columns:58px 1fr;gap:10px;align-items:center}.meta-card-rank{display:grid;place-items:center;width:52px;height:52px;border-radius:14px;background:rgba(124,58,237,.14);border:1px solid rgba(196,181,253,.20)}.meta-card-rank span{font-size:1.1rem;font-weight:950;color:#e9d5ff}.meta-card-rank small{font-size:.45rem;font-weight:900;letter-spacing:.08em;color:#94a3b8}.meta-leaders{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.meta-leader{min-width:0;text-align:center}.meta-leader-img-wrap{position:relative;width:58px;height:58px;margin:0 auto 4px}.meta-leader-img-wrap img{width:58px;height:58px;border-radius:12px;object-fit:cover;border:1px solid rgba(255,255,255,.15);box-shadow:0 5px 15px rgba(0,0,0,.28)}.meta-leader-img-wrap span{position:absolute;right:-3px;bottom:-2px;padding:2px 4px;border-radius:5px;background:#020617;border:1px solid rgba(148,163,184,.28);font-size:.43rem;font-weight:950;color:#cbd5e1}.meta-leader b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.67rem;color:#f8fafc}.meta-leader small{display:block;font-size:.48rem;color:#94a3b8}.meta-formation{display:grid;grid-template-columns:auto auto 1fr;gap:7px;align-items:baseline;margin-top:10px;padding:7px 9px;border-radius:9px;background:rgba(2,6,23,.46);border:1px solid rgba(148,163,184,.11)}.meta-formation span,.meta-block-label{font-size:.48rem;font-weight:950;letter-spacing:.08em;color:#94a3b8}.meta-formation b{font-size:.82rem;color:#f8fafc}.meta-formation small{font-size:.51rem;color:#64748b}.meta-joiner-block{margin-top:9px}.meta-joiner-row{display:flex;gap:5px;flex-wrap:wrap;margin-top:5px}.meta-joiner-chip{display:flex;align-items:center;gap:5px;padding:4px 6px 4px 4px;border-radius:8px;background:rgba(14,116,144,.13);border:1px solid rgba(56,189,248,.17)}.meta-joiner-chip img{width:26px;height:26px;object-fit:cover;border-radius:6px}.meta-joiner-chip span{display:grid}.meta-joiner-chip b{font-size:.54rem;color:#bae6fd}.meta-joiner-chip small{font-size:.45rem;color:#94a3b8}.meta-no-joiners{font-size:.56rem;color:#64748b}.meta-stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin-top:9px}.meta-stat-grid div{padding:6px 5px;border-radius:8px;background:rgba(2,6,23,.34);text-align:center}.meta-stat-grid small{display:block;font-size:.44rem;color:#94a3b8}.meta-stat-grid b{display:block;margin-top:2px;font-size:.66rem;color:#e2e8f0}.meta-hardest-rich{display:grid;grid-template-columns:auto 1fr auto;gap:6px;align-items:center;margin-top:8px;font-size:.51rem}.meta-hardest-rich span{color:#64748b}.meta-hardest-rich b{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#cbd5e1}.meta-hardest-rich small{color:#94a3b8}.meta-apply-rich{width:100%;margin-top:9px;border-radius:9px;padding:8px;border:1px solid rgba(148,163,184,.20);font-size:.58rem;font-weight:950;text-transform:uppercase;letter-spacing:.055em;cursor:pointer}.meta-apply-rich.att{background:rgba(127,29,29,.18);border-color:rgba(248,113,113,.27);color:#fecaca}.meta-apply-rich.def{background:rgba(30,64,175,.18);border-color:rgba(96,165,250,.28);color:#bfdbfe}.meta-apply-rich:hover{filter:brightness(1.18)}
.light-theme .rail-meta-btn{background:linear-gradient(135deg,#7e22ce,#2563eb,#0891b2);color:#fff}.light-theme .rail-meta-caption{color:#7e22ce}.light-theme .global-meta-summary{background:#faf5ff;border-color:#e9d5ff}.light-theme .global-meta-summary b{color:#581c87}.light-theme .global-meta-summary span{color:#64748b}.light-theme .global-meta-dialog{background:linear-gradient(160deg,#fff,#f8fafc);border-color:#ddd6fe}.light-theme .global-meta-modal-head{background:linear-gradient(90deg,#faf5ff,#f0f9ff);border-color:#e2e8f0}.light-theme .global-meta-modal-head h2,.light-theme .meta-leader b{color:#1e293b}.light-theme .global-meta-modal-head p,.light-theme .meta-modal-section-head p{color:#64748b}.light-theme .meta-rich-card{background:#fff;border-color:#e2e8f0}.light-theme .meta-formation,.light-theme .meta-stat-grid div{background:#f8fafc}.light-theme .meta-formation b,.light-theme .meta-stat-grid b{color:#1e293b}.light-theme .meta-hardest-rich b{color:#334155}.light-theme .joiner-gen-head b{color:#581c87}.light-theme .joiner-gen-head{border-color:#e2e8f0}
@media(max-width:900px){.meta-modal-columns{grid-template-columns:1fr}.meta-modal-section-head p{max-width:none}.global-meta-dialog{width:min(760px,97vw)}}
@media(max-width:560px){.global-meta-modal{padding:7px}.global-meta-modal-head{padding:14px}.global-meta-modal-body{padding:12px}.meta-card-top{grid-template-columns:46px 1fr}.meta-card-rank{width:44px;height:44px}.meta-leader-img-wrap,.meta-leader-img-wrap img{width:48px;height:48px}.meta-stat-grid{grid-template-columns:repeat(2,1fr)}.meta-hardest-rich{grid-template-columns:1fr}.meta-modal-section-head{display:block}.meta-modal-section-head p{text-align:left;margin-top:4px}}

/* Extracted from battle_simulator.html style block 3: id="v0747-ui-upgrade" */

/* v0.74.7 — stronger optimizer rail + larger richer Global Meta UI */
@keyframes railGlowPulse{0%,100%{box-shadow:0 14px 32px rgba(2,6,23,.22),0 0 0 1px rgba(255,255,255,.06),0 0 0 rgba(255,255,255,0)}50%{box-shadow:0 18px 38px rgba(2,6,23,.26),0 0 0 1px rgba(255,255,255,.09),0 0 22px rgba(255,255,255,.06)}}
@keyframes metaAuroraShift{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}
@keyframes metaHaloPulse{0%,100%{box-shadow:0 0 0 1px rgba(216,180,254,.40),0 0 26px rgba(168,85,247,.48),0 0 52px rgba(14,165,233,.16),0 18px 38px rgba(2,6,23,.24)}50%{box-shadow:0 0 0 1px rgba(250,204,21,.42),0 0 36px rgba(192,132,252,.62),0 0 66px rgba(14,165,233,.22),0 20px 44px rgba(2,6,23,.30)}}
@keyframes metaSparkFloat{0%,100%{transform:translateY(0) scale(1)}50%{transform:translateY(-1px) scale(1.04)}}
.rail-opt-split{align-items:stretch!important;gap:10px!important}
.rail-opt-half{position:relative;overflow:hidden;display:flex!important;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:4px;min-height:102px!important;padding:12px 10px!important;border-radius:18px!important;font-weight:1000!important;line-height:1.05!important;letter-spacing:.015em;box-shadow:0 14px 32px rgba(2,6,23,.22), inset 0 1px 0 rgba(255,255,255,.11)!important;animation:railGlowPulse 2.8s ease-in-out infinite}
.rail-opt-half:before{content:"";position:absolute;inset:1px;border-radius:17px;background:linear-gradient(180deg,rgba(255,255,255,.16),rgba(255,255,255,0) 38%);pointer-events:none}
.rail-opt-half.att{background:linear-gradient(155deg,#7f1d1d 0%,#dc2626 56%,#f97316 100%)!important;border:1px solid rgba(254,202,202,.22)!important}
.rail-opt-half.def{background:linear-gradient(155deg,#1d4ed8 0%,#2563eb 52%,#06b6d4 100%)!important;border:1px solid rgba(191,219,254,.24)!important}
.rail-opt-half:hover{transform:translateY(-2px) scale(1.015)!important;filter:brightness(1.06)!important}
.rail-opt-icon{font-size:1.25rem;line-height:1;display:block;text-shadow:0 0 18px rgba(255,255,255,.36)}
.rail-opt-title{display:block;font-size:1.02rem;line-height:1.02;max-width:100%;white-space:normal}
.rail-opt-sub{display:block;font-size:.63rem;line-height:1.2;color:rgba(255,255,255,.88);font-weight:800;letter-spacing:.02em;text-transform:uppercase}
.rail-gen.rail-gen-card{display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:102px!important;min-width:92px!important;padding:10px 8px!important;border-radius:18px!important;background:linear-gradient(160deg,#a16207,#ca8a04 50%,#f59e0b)!important;border:1px solid rgba(254,240,138,.28)!important;box-shadow:0 14px 32px rgba(120,53,15,.20), inset 0 1px 0 rgba(255,255,255,.14)!important}
.rail-gen-kicker{font-size:.53rem;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:#fef3c7}
.rail-gen-note{font-size:.55rem;color:#fffbeb;opacity:.9;line-height:1.15;text-align:center}
.rail-gen.rail-gen-card label{font-size:.64rem!important;color:#fff7ed!important;letter-spacing:.07em!important;margin:0!important}
.rail-gen.rail-gen-card select{background:rgba(255,255,255,.14)!important;border:1px solid rgba(255,255,255,.24)!important;color:#fff!important;font-size:1.08rem!important;font-weight:1000!important;border-radius:14px!important;padding:7px 12px!important;min-width:68px!important;text-align:center!important}
.rail-opt-caption{font-size:.78rem!important;line-height:1.32!important;text-align:center;color:#d8e5ff!important;margin-top:9px!important}
.rail-joiner-opt{position:relative;display:grid!important;grid-template-columns:42px minmax(0,1fr)!important;align-items:center;gap:12px!important;padding:12px 13px!important;border-radius:16px!important;background:linear-gradient(145deg,rgba(15,23,42,.82),rgba(30,41,59,.68))!important;border:1px solid rgba(148,163,184,.20)!important;box-shadow:0 12px 24px rgba(2,6,23,.16), inset 0 1px 0 rgba(255,255,255,.05)!important;transition:transform .18s ease, box-shadow .18s ease, filter .18s ease}
.rail-joiner-opt:hover{transform:translateY(-1px);filter:brightness(1.03);box-shadow:0 16px 28px rgba(2,6,23,.22), 0 0 0 1px rgba(56,189,248,.08)}
.rail-joiner-switch{width:40px!important;height:24px!important;border-radius:999px!important;background:linear-gradient(135deg,rgba(100,116,139,.78),rgba(71,85,105,.88))!important;box-shadow:inset 0 1px 2px rgba(255,255,255,.10), 0 6px 12px rgba(2,6,23,.18)!important}
.rail-joiner-switch:after{width:18px!important;height:18px!important;left:3px!important;top:3px!important;box-shadow:0 2px 8px rgba(2,6,23,.32)!important}
.rail-joiner-opt input:checked + .rail-joiner-switch{background:linear-gradient(135deg,#22d3ee,#2563eb)!important;box-shadow:0 0 0 2px rgba(14,165,233,.12),0 0 18px rgba(56,189,248,.14)!important}
.rail-joiner-opt input:checked + .rail-joiner-switch:after{transform:translateX(16px)!important}
.rail-joiner-copy b{display:block;font-size:.92rem!important;line-height:1.12;color:#f8fafc!important}
.rail-joiner-copy small{display:block;margin-top:2px;font-size:.72rem!important;line-height:1.25;color:#c7d5ea!important}
.ui-tip{position:relative}
.ui-tip[data-tip]:hover::after,.ui-tip[data-tip]:focus-visible::after{content:attr(data-tip);position:absolute;left:50%;bottom:calc(100% + 11px);transform:translateX(-50%);width:min(360px,82vw);padding:12px 13px;border-radius:13px;background:linear-gradient(180deg,rgba(15,23,42,.985),rgba(30,41,59,.98));border:1px solid rgba(148,163,184,.34);color:#f8fafc;font-size:.82rem;line-height:1.36;font-weight:700;text-align:left;box-shadow:0 18px 42px rgba(2,6,23,.34);white-space:normal;z-index:10310;pointer-events:none}
.ui-tip[data-tip]:hover::before,.ui-tip[data-tip]:focus-visible::before{content:"";position:absolute;left:50%;bottom:calc(100% + 5px);transform:translateX(-50%);border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid rgba(30,41,59,.98);z-index:10311;pointer-events:none}
.rail-meta-btn{position:relative;overflow:hidden;display:flex!important;align-items:center;justify-content:center;gap:10px;min-height:66px!important;padding:13px 14px!important;border-radius:18px!important;border:1px solid rgba(233,213,255,.92)!important;background:linear-gradient(120deg,rgba(88,28,135,.98),rgba(79,70,229,.94),rgba(14,165,233,.88),rgba(168,85,247,.94));background-size:220% 220%;animation:metaAuroraShift 4.3s ease infinite,metaHaloPulse 2.2s ease-in-out infinite!important;font-size:.94rem!important;font-weight:1000!important;letter-spacing:.02em!important;color:#fff!important}
.rail-meta-btn:before{content:"";position:absolute;inset:1px;border-radius:17px;background:linear-gradient(180deg,rgba(255,255,255,.16),rgba(255,255,255,0) 38%);pointer-events:none}
.rail-meta-btn:hover{transform:translateY(-2px) scale(1.015)!important;filter:brightness(1.08)!important}
.rail-meta-caption{font-size:.75rem!important;line-height:1.3!important;text-align:center;color:#ddd6fe!important;margin-top:8px!important}
.meta-btn-spark{font-size:1.05rem!important;animation:metaSparkFloat 1.8s ease-in-out infinite;text-shadow:0 0 14px rgba(255,255,255,.96),0 0 26px rgba(196,181,253,.72)}
.meta-btn-spark.second{font-size:.95rem!important;opacity:.92}
.global-meta-summary{background:linear-gradient(135deg,rgba(88,28,135,.18),rgba(14,116,144,.14))!important;border-color:rgba(192,132,252,.28)!important;box-shadow:0 8px 22px rgba(2,6,23,.12)}
.global-meta-summary b{font-size:.78rem!important}
.global-meta-summary span{font-size:.66rem!important;line-height:1.28;color:#dbeafe!important}
.global-meta-summary button{font-size:.72rem!important;font-weight:950!important;background:linear-gradient(135deg,rgba(37,99,235,.32),rgba(88,28,135,.26))!important;color:#eef8ff!important;border-color:rgba(125,211,252,.58)!important;box-shadow:0 8px 18px rgba(56,189,248,.10)}
.global-meta-dialog{max-width:min(1440px,96vw)!important;border-radius:24px!important;box-shadow:0 38px 120px rgba(0,0,0,.64),0 0 0 1px rgba(255,255,255,.05),0 0 54px rgba(124,58,237,.20)!important}
.global-meta-modal-head{position:relative;overflow:hidden;padding:20px 22px!important;background:linear-gradient(90deg,rgba(88,28,135,.32),rgba(14,116,144,.14),rgba(30,64,175,.20))!important}
.global-meta-modal-head:after{content:"";position:absolute;right:-8%;top:-26px;width:260px;height:260px;border-radius:50%;background:radial-gradient(circle,rgba(192,132,252,.18),rgba(192,132,252,0) 72%);pointer-events:none}
.meta-kicker{font-size:.76rem!important;color:#e9d5ff!important}
.global-meta-modal-head h2{font-size:1.75rem!important;line-height:1.05;margin:4px 0 6px!important}
.global-meta-modal-head p{font-size:.98rem!important;color:#dbeafe!important;line-height:1.35!important}
.global-meta-modal-body{padding:18px 18px 22px!important}
.meta-modal-overview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:0 0 20px}
.meta-overview-pill{padding:15px 16px;border-radius:18px;border:1px solid rgba(148,163,184,.18);background:linear-gradient(160deg,rgba(15,23,42,.80),rgba(30,41,59,.66));box-shadow:0 12px 26px rgba(2,6,23,.12)}
.meta-overview-pill b{display:block;font-size:.92rem;color:#f8fafc;margin-bottom:5px}
.meta-overview-pill span{display:block;font-size:.78rem;line-height:1.42;color:#d5def0}
.meta-overview-pill small{display:block;margin-top:8px;font-size:.62rem;letter-spacing:.08em;color:#93c5fd;text-transform:uppercase}
.meta-modal-columns{gap:18px!important}
.meta-modal-section-head h3{font-size:1.28rem!important}.meta-modal-section-head p{font-size:.86rem!important;line-height:1.38!important}
.meta-rich-card{padding:16px 16px 14px!important;border-radius:20px!important;background:linear-gradient(160deg,rgba(15,23,42,.82),rgba(15,23,42,.64))!important;box-shadow:0 16px 36px rgba(2,6,23,.18)}
.meta-rich-card:before{content:"";position:absolute;inset:0;border-radius:20px;background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,0) 32%);pointer-events:none}
.meta-card-rank span{font-size:1.24rem!important}.meta-card-rank small{font-size:.72rem!important}
.meta-formation{margin-top:12px!important;padding:10px 11px!important}.meta-formation span,.meta-block-label{font-size:.58rem!important;letter-spacing:.08em!important}.meta-formation b{font-size:1.02rem!important}.meta-formation small{font-size:.66rem!important}
.meta-stat-grid{gap:10px!important;margin-top:12px!important}
.meta-stat-cell{padding:10px 9px!important;border-radius:13px;background:linear-gradient(180deg,rgba(2,6,23,.48),rgba(15,23,42,.34))!important;border:1px solid rgba(148,163,184,.08);cursor:help}
.meta-stat-cell small{font-size:.60rem!important;color:#b5c4da!important;font-weight:900;letter-spacing:.05em;text-transform:uppercase}
.meta-stat-cell b{display:block;margin-top:3px;font-size:.93rem!important;color:#f8fafc!important}
.meta-hardest-rich{margin-top:12px!important;padding:10px 12px;border-radius:13px;background:rgba(2,6,23,.28)}
.meta-hardest-rich span{font-size:.66rem!important;color:#b6c6dc!important;letter-spacing:.05em;text-transform:uppercase}
.meta-hardest-rich b{display:block;margin-top:3px;font-size:.90rem!important;line-height:1.25;color:#f8fafc!important}
.meta-hardest-rich small{display:block;margin-top:2px;font-size:.74rem!important;color:#c9d4e5!important}
.meta-card-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.meta-breakdown-btn,.meta-apply-rich{margin-top:0!important;min-height:42px;padding:10px 12px!important;border-radius:13px!important;font-size:.78rem!important;font-weight:900!important}
.meta-breakdown-btn{border:1px solid rgba(125,211,252,.36);background:linear-gradient(135deg,rgba(14,116,144,.24),rgba(37,99,235,.24));color:#e0f2fe;box-shadow:0 10px 20px rgba(2,6,23,.12)}
.meta-breakdown-btn:hover,.meta-apply-rich:hover{transform:translateY(-1px);box-shadow:0 16px 28px rgba(2,6,23,.16)}
.meta-apply-rich{box-shadow:0 10px 20px rgba(2,6,23,.12)}
.meta-matchup-modal{position:fixed;inset:0;background:rgba(2,6,23,.74);backdrop-filter:blur(10px);display:none;align-items:center;justify-content:center;z-index:10060;padding:22px}
.meta-matchup-modal.open{display:flex}
.meta-matchup-dialog{width:min(1220px,96vw);max-height:90vh;overflow:auto;border-radius:22px;border:1px solid rgba(148,163,184,.22);background:linear-gradient(180deg,rgba(15,23,42,.98),rgba(15,23,42,.94));box-shadow:0 34px 100px rgba(0,0,0,.56)}
.meta-matchup-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:18px 20px;border-bottom:1px solid rgba(148,163,184,.18);background:linear-gradient(90deg,rgba(14,116,144,.14),rgba(88,28,135,.16))}
.meta-matchup-head h3{margin:0;font-size:1.45rem;color:#f8fafc}
.meta-matchup-head p{margin:6px 0 0;font-size:.92rem;line-height:1.38;color:#d7e1ef}
.meta-matchup-close{width:40px;height:40px;border-radius:50%;border:1px solid rgba(255,255,255,.18);background:rgba(15,23,42,.72);color:#fff;font-size:1.45rem;cursor:pointer}
.meta-matchup-body{padding:18px 20px 22px}
.meta-matchup-summary{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:14px}
.meta-matchup-pill{padding:10px 12px;border-radius:14px;background:linear-gradient(160deg,rgba(15,23,42,.82),rgba(30,41,59,.68));border:1px solid rgba(148,163,184,.16)}
.meta-matchup-pill b{display:block;font-size:.78rem;color:#f8fafc}.meta-matchup-pill span{display:block;margin-top:3px;font-size:.76rem;color:#d5def0}
.meta-matchup-table{display:grid;gap:10px}
.meta-matchup-row{display:grid;grid-template-columns:54px minmax(220px,1.5fr) 120px 120px 150px 150px;gap:10px;align-items:center;padding:12px 12px;border-radius:16px;background:rgba(15,23,42,.52);border:1px solid rgba(148,163,184,.10)}
.meta-matchup-row.head{background:rgba(59,130,246,.16);border-color:rgba(96,165,250,.28);font-weight:900;text-transform:uppercase;letter-spacing:.05em}
.meta-matchup-cell{font-size:.86rem;line-height:1.28;color:#e5eefb}
.meta-matchup-cell b{display:block;font-size:.96rem;color:#fff}
.meta-matchup-cell small{display:block;font-size:.70rem;color:#b9c8dd;margin-top:2px}
.meta-matchup-rank{display:flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:50%;font-weight:1000;background:linear-gradient(135deg,rgba(59,130,246,.28),rgba(14,165,233,.18));color:#fff;margin:auto}
.meta-matchup-opponent{font-size:.92rem}.meta-matchup-opponent .opp-sub{display:block;font-size:.74rem;color:#b8c7dc;margin-top:3px}
.meta-matchup-win.good b{color:#86efac}.meta-matchup-win.bad b{color:#fca5a5}.meta-matchup-win.mid b{color:#fde68a}
body.light-theme .rail-opt-caption{color:#475569!important}
body.light-theme .rail-opt-half.att{background:linear-gradient(155deg,#ef4444,#dc2626,#f59e0b)!important}
body.light-theme .rail-opt-half.def{background:linear-gradient(155deg,#3b82f6,#2563eb,#06b6d4)!important}
body.light-theme .rail-gen.rail-gen-card{background:linear-gradient(160deg,#d97706,#f59e0b,#facc15)!important}
body.light-theme .rail-joiner-opt{background:linear-gradient(145deg,#ffffff,#f8fafc)!important;border-color:#dbe2ea!important;box-shadow:0 12px 24px rgba(148,163,184,.10), inset 0 1px 0 rgba(255,255,255,.70)!important}
body.light-theme .rail-joiner-copy b{color:#0f172a!important} body.light-theme .rail-joiner-copy small{color:#475569!important}
body.light-theme .rail-meta-btn{background:linear-gradient(120deg,#7e22ce,#4f46e5,#0ea5e9,#8b5cf6)!important;color:#fff!important;border-color:#d8b4fe!important}
body.light-theme .rail-meta-caption{color:#6d28d9!important}
body.light-theme .global-meta-summary{background:linear-gradient(135deg,#faf5ff,#eff6ff)!important;border-color:#ddd6fe!important}
body.light-theme .global-meta-summary span{color:#475569!important} body.light-theme .global-meta-summary button{color:#1e40af!important;background:linear-gradient(135deg,#eff6ff,#eef2ff)!important;border-color:#93c5fd!important}
body.light-theme .ui-tip[data-tip]:hover::after,body.light-theme .ui-tip[data-tip]:focus-visible::after{background:linear-gradient(180deg,#fff,#f8fafc);border-color:#dbe2ea;color:#0f172a;box-shadow:0 16px 30px rgba(148,163,184,.20)}
body.light-theme .ui-tip[data-tip]:hover::before,body.light-theme .ui-tip[data-tip]:focus-visible::before{border-top-color:#fff}
body.light-theme .global-meta-modal-head p{color:#475569!important}
body.light-theme .meta-overview-pill{background:linear-gradient(160deg,#fff,#f8fafc);border-color:#e2e8f0;box-shadow:0 10px 24px rgba(148,163,184,.10)}
body.light-theme .meta-overview-pill b{color:#0f172a} body.light-theme .meta-overview-pill span{color:#475569} body.light-theme .meta-overview-pill small{color:#1d4ed8}
body.light-theme .meta-rich-card{background:linear-gradient(160deg,#fff,#f8fafc)!important}
body.light-theme .meta-stat-cell{background:linear-gradient(180deg,#f8fafc,#eef2f7)!important;border-color:#e2e8f0} body.light-theme .meta-stat-cell small{color:#64748b!important} body.light-theme .meta-stat-cell b{color:#0f172a!important}
body.light-theme .meta-hardest-rich{background:#f8fafc} body.light-theme .meta-hardest-rich span{color:#475569!important} body.light-theme .meta-hardest-rich b{color:#0f172a!important} body.light-theme .meta-hardest-rich small{color:#475569!important}
body.light-theme .meta-breakdown-btn{color:#1d4ed8;background:linear-gradient(135deg,#eff6ff,#dbeafe);border-color:#93c5fd}
body.light-theme .meta-matchup-dialog{background:linear-gradient(180deg,#ffffff,#f8fafc);border-color:#dbe2ea;box-shadow:0 30px 80px rgba(148,163,184,.24)}
body.light-theme .meta-matchup-head{background:linear-gradient(90deg,#eff6ff,#faf5ff)} body.light-theme .meta-matchup-head h3{color:#0f172a} body.light-theme .meta-matchup-head p{color:#475569}
body.light-theme .meta-matchup-close{background:#fff;color:#0f172a;border-color:#cbd5e1}
body.light-theme .meta-matchup-pill{background:linear-gradient(160deg,#fff,#f8fafc);border-color:#e2e8f0} body.light-theme .meta-matchup-pill b{color:#0f172a} body.light-theme .meta-matchup-pill span{color:#475569}
body.light-theme .meta-matchup-row{background:#fff;border-color:#e2e8f0} body.light-theme .meta-matchup-row.head{background:#eff6ff;border-color:#bfdbfe}
body.light-theme .meta-matchup-cell{color:#0f172a} body.light-theme .meta-matchup-cell small, body.light-theme .meta-matchup-opponent .opp-sub{color:#475569}
@media(max-width:1150px){.meta-matchup-row{grid-template-columns:48px minmax(220px,1.4fr) 100px 100px 130px 130px}.meta-modal-overview{grid-template-columns:1fr}}
@media(max-width:860px){.rail-opt-half{min-height:94px!important}.rail-opt-title{font-size:.90rem}.rail-opt-sub{font-size:.58rem}.rail-gen.rail-gen-card{min-width:80px!important}.meta-matchup-row{grid-template-columns:1fr;align-items:flex-start}.meta-matchup-row.head{display:none}.meta-matchup-rank{margin:0}.meta-card-actions{flex-direction:column}.meta-breakdown-btn,.meta-apply-rich{width:100%}}

/* Extracted from battle_simulator.html style block 4: id="v0748-ui-premium" */

/* v0.74.8 premium optimizer controls + calmer Global Meta button */
@keyframes premiumButtonPulse{0%,100%{box-shadow:0 12px 28px rgba(2,6,23,.18),0 0 0 1px rgba(255,255,255,.08),0 0 18px rgba(255,255,255,.05)}50%{box-shadow:0 16px 34px rgba(2,6,23,.24),0 0 0 1px rgba(255,255,255,.12),0 0 26px rgba(255,255,255,.08)}}
@keyframes premiumMetaGlow{0%,100%{box-shadow:0 0 0 1px rgba(233,213,255,.48),0 0 18px rgba(168,85,247,.34),0 0 36px rgba(14,165,233,.12),0 18px 34px rgba(2,6,23,.26)}50%{box-shadow:0 0 0 1px rgba(250,204,21,.42),0 0 24px rgba(192,132,252,.46),0 0 44px rgba(14,165,233,.16),0 20px 40px rgba(2,6,23,.30)}}

.rail-opt-split{display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;gap:10px!important;align-items:stretch!important}
.rail-opt-half{min-height:92px!important;padding:12px 8px!important;gap:8px!important;border-radius:18px!important;animation:premiumButtonPulse 3s ease-in-out infinite!important}
.rail-opt-half .rail-opt-title{font-size:1rem!important;line-height:1.05!important;font-weight:1000!important;letter-spacing:.02em!important}
.rail-opt-half .rail-opt-sub{display:none!important}
.rail-opt-half .rail-opt-icon{font-size:1.42rem!important;line-height:1!important;margin:0 auto;text-shadow:0 0 16px rgba(255,255,255,.26)}
.rail-opt-half.att{background:linear-gradient(180deg,#8b1d24 0%,#e53e3e 100%)!important;border:1px solid rgba(255,235,235,.16)!important}
.rail-opt-half.def{background:linear-gradient(180deg,#2563eb 0%,#06b6d4 100%)!important;border:1px solid rgba(219,234,254,.18)!important}
.rail-opt-half:hover{transform:translateY(-2px)!important;filter:saturate(1.06) brightness(1.02)!important}

.rail-gen.rail-gen-card{min-width:118px!important;min-height:92px!important;display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;gap:8px!important;padding:10px 12px!important;border-radius:18px!important;background:linear-gradient(180deg,#9a6b04 0%,#e0a20a 100%)!important;border:1px solid rgba(255,247,220,.18)!important;box-shadow:0 14px 28px rgba(120,53,15,.18), inset 0 1px 0 rgba(255,255,255,.12)!important}
.rail-gen.rail-gen-card .rail-gen-kicker,.rail-gen.rail-gen-card .rail-gen-note{display:none!important}
.rail-gen.rail-gen-card label{font-size:1rem!important;font-weight:1000!important;letter-spacing:.02em!important;color:#fff8eb!important;margin:0!important}
.rail-gen.rail-gen-card select{min-width:74px!important;max-width:74px!important;padding:8px 8px!important;border-radius:14px!important;font-size:1rem!important;font-weight:1000!important;text-align:center!important;background:rgba(255,255,255,.16)!important;border:1px solid rgba(255,255,255,.22)!important;color:#fff!important}
.rail-opt-caption{font-size:.78rem!important;line-height:1.35!important;text-align:center!important;margin-top:8px!important}

.rail-opt-toggle-stack{gap:10px!important}
.rail-joiner-opt{padding:12px 14px!important;border-radius:16px!important;grid-template-columns:42px minmax(0,1fr)!important}
.rail-joiner-copy b{font-size:.96rem!important;line-height:1.1!important}
.rail-joiner-copy small{font-size:.78rem!important;line-height:1.28!important}

.rail-meta-btn{overflow:visible!important;min-height:62px!important;padding:14px 16px!important;border-radius:18px!important;background:linear-gradient(180deg,#6d28d9 0%,#2563eb 100%)!important;background-size:auto!important;animation:premiumMetaGlow 2.8s ease-in-out infinite!important}
.rail-meta-btn:before{display:none!important}
.rail-meta-btn .meta-btn-spark{animation:none!important;opacity:.95}
.rail-meta-btn.ui-tip:hover::after,.rail-meta-btn.ui-tip:focus-visible::after{bottom:calc(100% + 12px)!important}
.rail-meta-caption{font-size:.78rem!important;line-height:1.35!important}

.meta-matchup-modal{z-index:200000!important}
.global-meta-overlay{z-index:120000!important}
.global-meta-dialog{position:relative;z-index:120001!important}
.global-meta-modal-head h2{font-size:1.82rem!important}
.global-meta-modal-head p{font-size:1rem!important}
.meta-modal-section-head h3{font-size:1.36rem!important}
.meta-modal-section-head p{font-size:.9rem!important}
.meta-overview-pill span{font-size:.82rem!important}
.meta-card-rank span{font-size:1.3rem!important}
.meta-formation b{font-size:1.06rem!important}
.meta-stat-cell small{font-size:.64rem!important}
.meta-stat-cell b{font-size:1rem!important}
.meta-hardest-rich span{font-size:.72rem!important}
.meta-hardest-rich b{font-size:1rem!important}
.meta-hardest-rich small{font-size:.8rem!important}
.meta-breakdown-btn,.meta-apply-rich{font-size:.82rem!important;min-height:44px!important}
.meta-matchup-head h3{font-size:1.52rem!important}
.meta-matchup-head p{font-size:.96rem!important}
.meta-matchup-cell{font-size:.9rem!important}
.meta-matchup-cell b{font-size:1rem!important}
.meta-matchup-cell small,.meta-matchup-opponent .opp-sub{font-size:.76rem!important}

body.light-theme .rail-opt-caption{color:#475569!important}
body.light-theme .rail-gen.rail-gen-card{background:linear-gradient(180deg,#d97706 0%,#facc15 100%)!important}
body.light-theme .rail-meta-btn{background:linear-gradient(180deg,#7c3aed 0%,#0ea5e9 100%)!important;color:#fff!important}
@media(max-width:860px){
  .rail-opt-split{grid-template-columns:1fr!important}
  .rail-gen.rail-gen-card{min-width:100%!important;max-width:none!important}
}

/* Extracted from battle_simulator.html style block 5: id="v0749-premium-controls" */

/* v0.74.9 — clean premium optimizer controls, no pseudo-element shimmer */
.rail-optimizer{padding:14px!important;border-radius:24px!important;background:linear-gradient(180deg,rgba(12,20,37,.96),rgba(15,23,42,.93))!important;border:1px solid rgba(148,163,184,.18)!important;box-shadow:0 18px 42px rgba(2,6,23,.30),inset 0 1px 0 rgba(255,255,255,.035)!important;overflow:visible!important}
.rail-opt-top{display:grid;gap:10px;margin-bottom:9px}
.rail-gen.rail-gen-card{display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;min-width:0!important;max-width:none!important;min-height:0!important;padding:0!important;margin:0!important;background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;overflow:visible!important}
.rail-gen.rail-gen-card>label,.rail-gen.rail-gen-card>select{display:none!important}
.rail-opt-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.rail-opt-half{min-width:0!important;width:100%!important;height:82px!important;min-height:82px!important;padding:11px 8px!important;border-radius:18px!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:7px!important;color:#fff!important;font-weight:1000!important;line-height:1!important;letter-spacing:.01em!important;overflow:hidden!important;animation:none!important;transition:transform .16s ease,box-shadow .16s ease,filter .16s ease!important}
.rail-opt-half::before{content:""!important;display:block!important;position:absolute!important;inset:1px!important;border-radius:17px!important;background:linear-gradient(180deg,rgba(255,255,255,.13),rgba(255,255,255,0) 42%)!important;pointer-events:none!important}
.rail-opt-half.att{background:linear-gradient(180deg,#a62830 0%,#ef4444 100%)!important;border:1px solid rgba(254,202,202,.20)!important;box-shadow:0 12px 25px rgba(127,29,29,.24),inset 0 1px 0 rgba(255,255,255,.08)!important}
.rail-opt-half.def{background:linear-gradient(180deg,#2f6fe7 0%,#08b4d1 100%)!important;border:1px solid rgba(191,219,254,.22)!important;box-shadow:0 12px 25px rgba(30,64,175,.22),inset 0 1px 0 rgba(255,255,255,.08)!important}
.rail-opt-half:hover{transform:translateY(-2px)!important;filter:brightness(1.04)!important}
.rail-opt-half.att:hover{box-shadow:0 17px 30px rgba(127,29,29,.30),0 0 20px rgba(248,113,113,.12)!important}
.rail-opt-half.def:hover{box-shadow:0 17px 30px rgba(30,64,175,.30),0 0 20px rgba(56,189,248,.12)!important}
.rail-opt-icon{font-size:1.48rem!important;line-height:1!important;margin:0!important;text-shadow:0 0 16px rgba(255,255,255,.22)!important}
.rail-opt-title{display:block!important;max-width:100%!important;font-size:.96rem!important;line-height:1!important;white-space:nowrap!important;overflow:visible!important;color:#fff!important}
.rail-opt-sub{display:none!important}
.rail-opt-caption{margin:2px 2px 10px!important;font-size:.70rem!important;line-height:1.3!important;text-align:center!important;color:#9fb0c8!important}

/* The enhanced GEN selector is the only visible GEN control: one compact premium pill. */
.rail-gen-box-btn{position:relative!important;display:flex!important;align-items:center!important;justify-content:center!important;width:112px!important;min-width:112px!important;max-width:112px!important;height:44px!important;margin:0 auto!important;padding:0 14px!important;border-radius:14px!important;border:1px solid rgba(254,240,138,.24)!important;background:linear-gradient(180deg,#bd8307,#e1aa11)!important;color:#fff9e8!important;box-shadow:0 10px 22px rgba(120,53,15,.20),inset 0 1px 0 rgba(255,255,255,.13)!important;font-family:inherit!important;font-size:.92rem!important;font-weight:1000!important;line-height:1!important;letter-spacing:.02em!important;cursor:pointer!important;overflow:hidden!important;transition:transform .15s ease,box-shadow .15s ease,filter .15s ease!important}
.rail-gen-box-btn::before{content:"";position:absolute;inset:1px;border-radius:13px;background:linear-gradient(180deg,rgba(255,255,255,.12),rgba(255,255,255,0) 48%);pointer-events:none}
.rail-gen-box-btn:hover{transform:translateY(-1px)!important;filter:brightness(1.04)!important;box-shadow:0 13px 25px rgba(120,53,15,.24),0 0 18px rgba(250,204,21,.10)!important}
.rail-gen-box-btn .gen-box-title{display:none!important}.rail-gen-box-btn .gen-box-value{font-size:.92rem!important;font-weight:1000!important;line-height:1!important;color:#fff9e8!important}
.rail-gen-box-menu{top:calc(100% + 7px)!important;left:50%!important;transform:translateX(-50%)!important;width:150px!important;min-width:150px!important;max-width:150px!important;padding:7px!important;border-radius:15px!important;background:rgba(15,23,42,.985)!important;border:1px solid rgba(148,163,184,.22)!important;box-shadow:0 18px 38px rgba(2,6,23,.42)!important;z-index:60000!important}
.rail-gen-box-menu button{font-size:.78rem!important;border-radius:9px!important;padding:8px 9px!important}

.rail-opt-toggle-stack{display:grid!important;gap:10px!important;margin-top:0!important}
.rail-joiner-opt{margin:0!important;padding:12px 13px!important;border-radius:16px!important;background:linear-gradient(180deg,rgba(23,34,54,.76),rgba(17,27,45,.74))!important;border:1px solid rgba(148,163,184,.16)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.025)!important}
.rail-joiner-opt:hover{transform:none!important;filter:none!important;border-color:rgba(125,211,252,.24)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 8px 18px rgba(2,6,23,.12)!important}
.rail-joiner-copy b{font-size:.90rem!important;line-height:1.1!important;color:#f1f5f9!important}.rail-joiner-copy small{margin-top:3px!important;font-size:.70rem!important;line-height:1.26!important;color:#aebdd1!important}

/* Global Meta: static premium gradient + outer glow only. Absolutely no shimmer layer. */
.rail-meta-wrap{position:relative;display:block;margin-top:13px;overflow:visible!important;z-index:30}
.rail-meta-btn{position:relative!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:11px!important;width:100%!important;min-height:62px!important;margin:0!important;padding:13px 14px!important;border-radius:19px!important;border:1px solid rgba(216,180,254,.78)!important;background:linear-gradient(135deg,#6f37e8 0%,#4f46e5 50%,#2677ea 100%)!important;background-size:100% 100%!important;color:#fff!important;font-size:.98rem!important;font-weight:1000!important;line-height:1.1!important;letter-spacing:.01em!important;cursor:pointer!important;overflow:hidden!important;animation:none!important;box-shadow:0 0 0 1px rgba(192,132,252,.16),0 0 25px rgba(124,58,237,.30),0 14px 28px rgba(2,6,23,.24)!important;transition:transform .16s ease,box-shadow .16s ease,filter .16s ease!important}
.rail-meta-btn::before{content:""!important;display:block!important;position:absolute!important;inset:1px!important;border-radius:18px!important;background:linear-gradient(180deg,rgba(255,255,255,.12),rgba(255,255,255,0) 42%)!important;pointer-events:none!important;animation:none!important}
.rail-meta-btn::after{content:none!important;display:none!important;animation:none!important;background:none!important;width:0!important;height:0!important}
.rail-meta-btn:hover{transform:translateY(-2px)!important;filter:brightness(1.035)!important;box-shadow:0 0 0 1px rgba(216,180,254,.24),0 0 32px rgba(124,58,237,.38),0 18px 34px rgba(2,6,23,.28)!important}
.rail-meta-btn .meta-btn-spark{font-size:1rem!important;animation:none!important;color:#efe9ff!important;text-shadow:0 0 10px rgba(255,255,255,.40)!important}.rail-meta-btn .meta-btn-spark.second{font-size:.86rem!important;opacity:.78!important}
.rail-meta-tooltip{position:absolute;left:50%;bottom:calc(100% + 11px);width:300px;max-width:min(300px,78vw);transform:translateX(-50%);padding:11px 13px;border-radius:13px;background:rgba(11,18,32,.985);border:1px solid rgba(148,163,184,.24);box-shadow:0 18px 38px rgba(2,6,23,.42);color:#eef2ff;font-size:.78rem;line-height:1.38;font-weight:700;text-align:left;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .12s ease,visibility .12s ease;z-index:70000}
.rail-meta-tooltip::after{content:"";position:absolute;left:50%;top:100%;transform:translateX(-50%);border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid rgba(11,18,32,.985)}
.rail-meta-wrap:hover .rail-meta-tooltip,.rail-meta-wrap:focus-within .rail-meta-tooltip{opacity:1;visibility:visible}
.rail-meta-caption{margin-top:8px!important;font-size:.70rem!important;line-height:1.32!important;text-align:center!important;color:#c5bdf7!important}

/* matchup detail must sit above the already-open Meta dashboard */
.global-meta-modal{z-index:110000!important}.global-meta-dialog{z-index:110001!important}.meta-matchup-modal{z-index:300000!important}.meta-matchup-dialog{z-index:300001!important;position:relative!important}
.global-meta-modal.matchup-underlay .global-meta-dialog{filter:brightness(.70) saturate(.86);transition:filter .12s ease}

body.light-theme .rail-optimizer{background:linear-gradient(180deg,#ffffff,#f8fafc)!important;border-color:#d9e2ec!important;box-shadow:0 16px 34px rgba(100,116,139,.15),inset 0 1px 0 #fff!important}
body.light-theme .rail-opt-caption{color:#64748b!important}
body.light-theme .rail-joiner-opt{background:linear-gradient(180deg,#fff,#f8fafc)!important;border-color:#dbe4ef!important}body.light-theme .rail-joiner-copy b{color:#0f172a!important}body.light-theme .rail-joiner-copy small{color:#64748b!important}
body.light-theme .rail-gen-box-menu{background:#fff!important;border-color:#dbe4ef!important;box-shadow:0 16px 30px rgba(100,116,139,.20)!important}
body.light-theme .rail-meta-tooltip{background:#fff;color:#0f172a;border-color:#dbe4ef;box-shadow:0 16px 30px rgba(100,116,139,.22)}body.light-theme .rail-meta-tooltip::after{border-top-color:#fff}
@media(max-width:1500px){.rail-opt-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}}

/* Extracted from battle_simulator.html style block 6: id="v0750-search-speed" */

.rail-search-speed{margin:10px 0 12px;padding:11px 12px;border-radius:15px;border:1px solid rgba(125,211,252,.16);background:linear-gradient(145deg,rgba(8,20,37,.78),rgba(20,34,55,.72));box-shadow:inset 0 1px 0 rgba(255,255,255,.035)}
.rail-speed-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}.rail-speed-head b{font-size:.82rem;color:#f8fafc}.rail-speed-head span{font-size:.65rem;color:#9edcff;text-align:right}
.rail-search-speed input[type=range]{width:100%;accent-color:#38bdf8;cursor:pointer}.rail-speed-scale{display:flex;justify-content:space-between;margin-top:4px;color:#8294aa;font-size:.57rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
body.light-theme .rail-search-speed{background:linear-gradient(145deg,#f8fafc,#eef6ff);border-color:#cfe8f7}body.light-theme .rail-speed-head b{color:#0f172a}body.light-theme .rail-speed-head span{color:#0369a1}body.light-theme .rail-speed-scale{color:#64748b}

/* Extracted from battle_simulator.html style block 7: id="v0760-performance-ui" */

.rail-perf-btn{width:100%;margin-top:8px;padding:8px 10px;border-radius:11px;border:1px solid rgba(125,211,252,.22);background:rgba(15,23,42,.42);color:#cfe8ff;font-size:.68rem;font-weight:900;letter-spacing:.03em;cursor:pointer;transition:.16s ease}
.rail-perf-btn:hover{transform:translateY(-1px);border-color:rgba(125,211,252,.46);background:rgba(14,116,144,.18)}
.perf-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-bottom:12px}.perf-summary>div{padding:11px;border-radius:12px;background:rgba(15,23,42,.52);border:1px solid rgba(148,163,184,.12)}.perf-summary b{display:block;font-size:.72rem}.perf-summary span{display:block;margin-top:3px;font-size:.9rem;font-weight:900;color:#f8fafc}.perf-list{display:grid;gap:7px}.perf-row{display:grid;grid-template-columns:minmax(0,1fr) 88px 56px;gap:8px;align-items:center;padding:9px 10px;border-radius:10px;background:rgba(15,23,42,.38);border:1px solid rgba(148,163,184,.08)}.perf-row span{font-size:.76rem}.perf-row b{font-size:.76rem;text-align:right}.perf-row small{font-size:.68rem;color:#93c5fd;text-align:right}
body.light-theme .rail-perf-btn{background:#f8fafc;color:#075985;border-color:#bae6fd}body.light-theme .perf-summary>div,body.light-theme .perf-row{background:#f8fafc;border-color:#e2e8f0}body.light-theme .perf-summary span,body.light-theme .perf-row b{color:#0f172a}
@media(max-width:760px){.perf-summary{grid-template-columns:repeat(2,1fr)}}

/* Extracted from battle_simulator.html style block 8: id="v0762-gen-portal-fix" */

/* Generation menu is portaled to <body>; it must never inherit the middle rail's clipping. */
.rail-gen-box-menu.gen-portal-menu{
  position:fixed!important;
  top:var(--gen-menu-top,0px)!important;
  left:var(--gen-menu-left,0px)!important;
  transform:none!important;
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:7px!important;
  width:176px!important;
  min-width:176px!important;
  max-width:176px!important;
  max-height:min(360px,calc(100vh - 20px))!important;
  overflow:auto!important;
  padding:8px!important;
  z-index:500000!important;
}
.rail-gen-box-menu.gen-portal-menu[hidden]{display:none!important}
.rail-gen-box-menu.gen-portal-menu button{min-width:0!important;width:100%!important;min-height:38px!important;padding:8px 7px!important;font-size:.80rem!important}

/* Extracted from battle_simulator.html style block 9: id="v0763-meta-archetype-tabs" */

.meta-archetype-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:0 0 11px;padding:6px;border-radius:17px;background:rgba(15,23,42,.42);border:1px solid rgba(148,163,184,.14)}
.meta-archetype-tab{min-height:54px;padding:8px 10px;border-radius:13px;border:1px solid transparent;background:rgba(30,41,59,.64);color:#dbeafe;cursor:pointer;text-align:center;transition:transform .15s ease,border-color .15s ease,background .15s ease,box-shadow .15s ease}
.meta-archetype-tab b{display:block;font-size:.84rem;line-height:1.1;color:inherit}.meta-archetype-tab small{display:block;margin-top:4px;font-size:.61rem;line-height:1.15;color:#9fb0c9}
.meta-archetype-tab:hover{transform:translateY(-1px);border-color:rgba(125,211,252,.32);background:rgba(37,99,235,.15)}
.meta-archetype-tab.active{background:linear-gradient(135deg,rgba(79,70,229,.92),rgba(14,165,233,.72));border-color:rgba(191,219,254,.55);color:#fff;box-shadow:0 8px 20px rgba(37,99,235,.18)}
.meta-archetype-tab.active small{color:#e0f2fe}
.meta-archetype-rule{display:flex;align-items:center;gap:10px;margin:0 0 16px;padding:10px 13px;border-radius:13px;background:linear-gradient(90deg,rgba(30,41,59,.66),rgba(15,23,42,.4));border:1px solid rgba(148,163,184,.12)}
.meta-archetype-rule b{font-size:.82rem;color:#f8fafc;white-space:nowrap}.meta-archetype-rule span{font-size:.76rem;line-height:1.35;color:#cbd5e1}
.meta-category-empty{padding:22px;border-radius:16px;border:1px dashed rgba(148,163,184,.24);color:#94a3b8;text-align:center;font-size:.82rem;line-height:1.4}
body.light-theme .meta-archetype-tabs{background:#f1f5f9;border-color:#dbe2ea}body.light-theme .meta-archetype-tab{background:#fff;color:#334155;border-color:#e2e8f0}body.light-theme .meta-archetype-tab small{color:#64748b}body.light-theme .meta-archetype-tab.active{background:linear-gradient(135deg,#4f46e5,#0ea5e9);color:#fff;border-color:#93c5fd}body.light-theme .meta-archetype-tab.active small{color:#e0f2fe}body.light-theme .meta-archetype-rule{background:linear-gradient(90deg,#f8fafc,#eff6ff);border-color:#dbe2ea}body.light-theme .meta-archetype-rule b{color:#0f172a}body.light-theme .meta-archetype-rule span{color:#475569}
@media(max-width:760px){.meta-archetype-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}.meta-archetype-rule{align-items:flex-start;flex-direction:column;gap:4px}}

/* Extracted from battle_simulator.html style block 10: id="v0766-command-center" */

:root{--book-font:Georgia,'Palatino Linotype','Book Antiqua',serif;--ui-font:'Trebuchet MS','Segoe UI',system-ui,sans-serif;--gold:#e7bf67;--gold2:#ffe4a2;--ink:#0c1424;--paper:#111c30;--paper2:#0b1526;--redv:#ff493f;--bluev:#3f9cff;--green-v:#38c978}
body{font-family:var(--ui-font)!important}.command-hub{max-width:1880px!important}
.sim-hero-header{position:relative;isolation:isolate;overflow:hidden;min-height:410px;margin:0 0 18px;border-radius:28px;border:1px solid rgba(231,191,103,.28);background-image:linear-gradient(90deg,rgba(7,12,21,.96) 0%,rgba(9,16,28,.86) 42%,rgba(7,12,21,.18) 72%,rgba(7,12,21,.06) 100%),var(--jeronimo-banner);background-size:cover;background-position:center;box-shadow:0 30px 70px rgba(0,0,0,.35),inset 0 1px 0 rgba(255,255,255,.08)}
.sim-hero-header:after{content:"";position:absolute;inset:9px;border-radius:21px;border:1px solid rgba(255,225,157,.08);pointer-events:none}.hero-nav-row{position:absolute;z-index:4;top:18px;left:20px;right:20px;display:flex;justify-content:space-between;align-items:center}.hero-nav-row .nav-buttons{margin:0}.legacy-nav-btn,.theme-toggle{backdrop-filter:blur(12px);background:rgba(8,14,24,.78)!important;border:1px solid rgba(231,191,103,.22)!important;box-shadow:0 10px 24px rgba(0,0,0,.26)!important}.legacy-nav-btn{border-radius:14px!important;color:#f7e8c0!important}.theme-toggle{border-radius:14px!important;color:#f7e8c0!important}.sim-hero-copy{position:relative;z-index:3;width:min(850px,64%);padding:92px 32px 34px 44px}.sim-hero-kicker{display:inline-flex;align-items:center;gap:8px;color:#e8c77f;font-family:var(--book-font);font-size:.78rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.sim-hero-kicker:before{content:"✦"}.sim-hero-copy h1{margin:10px 0 12px;font-family:var(--book-font);font-size:clamp(3rem,5vw,5.4rem);line-height:.92;color:#fff5dc;letter-spacing:.02em;text-shadow:0 4px 20px rgba(0,0,0,.46)}.sim-hero-copy p{max-width:760px;margin:0;color:#e6edf7;font-size:1rem;line-height:1.58;font-weight:650}.sim-feature-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:24px;max-width:900px}.sim-feature{display:flex;align-items:center;gap:9px;min-height:58px;padding:10px 12px;border-radius:14px;border:1px solid rgba(148,163,184,.18);background:linear-gradient(180deg,rgba(17,30,51,.78),rgba(10,20,36,.88));box-shadow:inset 0 1px 0 rgba(255,255,255,.04),0 10px 20px rgba(0,0,0,.16)}.sim-feature>span{font-size:1.2rem;color:#e9c36f}.sim-feature b{font-family:var(--book-font);font-size:.76rem;line-height:1.16;color:#eef5ff}.sim-feature.meta-feature{border-color:rgba(255,210,104,.55);background:linear-gradient(135deg,rgba(91,57,11,.72),rgba(34,40,70,.86));box-shadow:0 0 0 1px rgba(255,219,130,.08),0 0 22px rgba(244,187,63,.14),inset 0 1px 0 rgba(255,245,210,.10)}.sim-feature.meta-feature b{color:#fff0b9}.sim-feature.meta-feature>span{color:#ffe28b}
.sim-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:22px!important;align-items:start}.army-panel{position:relative;overflow:visible;border-radius:20px!important;padding-top:16px!important}.army-chapter{display:grid;grid-template-columns:1fr auto auto 1fr;align-items:center;gap:12px;margin:-4px 0 18px}.army-chapter .chapter-rule{height:1px;background:linear-gradient(90deg,transparent,rgba(230,193,116,.55))}.army-chapter .chapter-rule:last-child{background:linear-gradient(90deg,rgba(230,193,116,.55),transparent)}.army-chapter>div{text-align:center}.army-chapter small{display:block;font-family:var(--book-font);font-size:.66rem;letter-spacing:.12em;text-transform:uppercase;opacity:.78}.army-chapter h2{margin:2px 0 0!important;font-family:var(--book-font)!important;font-size:1.75rem!important;letter-spacing:.045em!important;color:#fff!important}.army-chapter.att h2,.army-chapter.att small{color:#ffd2cc!important}.army-chapter.def h2,.army-chapter.def small{color:#cde4ff!important}.chapter-seal{display:grid;place-items:center;width:43px;height:43px;border-radius:50%;border:1px solid rgba(231,191,103,.32);background:radial-gradient(circle,#26324a,#10192a 68%);color:#f1d184;box-shadow:0 0 0 4px rgba(231,191,103,.04)}.section-title{position:relative;display:flex!important;align-items:center;gap:10px!important;border:0!important;padding:0!important;margin:22px 0 12px!important;font-family:var(--book-font)!important;font-size:.9rem!important;letter-spacing:.07em!important;text-transform:none!important;color:#e8d4a8!important}.section-title:before,.section-title:after{content:"";height:1px;flex:1;background:linear-gradient(90deg,transparent,rgba(231,191,103,.24))}.section-title:after{background:linear-gradient(90deg,rgba(231,191,103,.24),transparent)}
.troop-head-name,.ratio-label{display:flex!important;align-items:center!important;gap:8px!important}.troop-type-icon{display:grid;place-items:center;width:29px;height:29px;border-radius:9px;border:1px solid rgba(255,255,255,.12);font-size:1rem;box-shadow:inset 0 1px 0 rgba(255,255,255,.06)}.troop-type-icon.inf{background:rgba(255,73,63,.14);color:#ff746b;border-color:rgba(255,73,63,.34)}.troop-type-icon.lancer{background:rgba(72,141,255,.14);color:#74a9ff;border-color:rgba(72,141,255,.34)}.troop-type-icon.marksman{background:rgba(56,201,120,.14);color:#68e5a1;border-color:rgba(56,201,120,.34)}.troop-head{font-family:var(--book-font);font-size:.98rem}.formation-mode-toggle{max-width:310px;margin:0 auto 12px!important;border:1px solid rgba(231,191,103,.14);background:rgba(8,15,27,.62)!important}.formation-mode-toggle button{font-family:var(--book-font);letter-spacing:.03em}.army-total-field{max-width:240px;margin-bottom:10px}.ratio-toolbar{align-items:center!important}.ratio-presets{gap:7px!important}.ratio-preset{border-radius:10px!important;padding:7px 10px!important;font-family:var(--book-font)!important;font-size:.72rem!important;background:linear-gradient(180deg,rgba(25,38,60,.92),rgba(11,21,38,.96))!important;border-color:rgba(231,191,103,.16)!important}.ratio-preset:hover{border-color:rgba(255,218,132,.58)!important;color:#fff0be!important}.formation-stack{height:12px!important;border-radius:999px!important;background:#08111f!important;border:1px solid rgba(255,255,255,.10)!important;box-shadow:inset 0 2px 6px rgba(0,0,0,.42),0 0 0 1px rgba(231,191,103,.04)!important;overflow:hidden!important}.formation-seg.inf{background:linear-gradient(90deg,#b72424,#ff5146)!important}.formation-seg.lancer{background:linear-gradient(90deg,#245ec9,#4c9bff)!important}.formation-seg.marksman{background:linear-gradient(90deg,#198b4d,#3ed57b)!important}.ratio-control{grid-template-columns:132px 38px minmax(0,1fr) 62px 38px!important;gap:8px!important;padding:10px 8px!important;margin:6px 0!important;border-radius:14px!important;background:linear-gradient(180deg,rgba(19,31,51,.72),rgba(10,20,35,.82))!important;border:1px solid rgba(148,163,184,.10)!important}.ratio-label{font-family:var(--book-font);font-size:.8rem!important;color:#f0f4fa!important}.ratio-slider{-webkit-appearance:none!important;appearance:none!important;height:8px!important;border-radius:999px!important;outline:0!important;border:1px solid rgba(255,255,255,.08)!important;box-shadow:inset 0 2px 5px rgba(0,0,0,.38)!important}.ratio-control.inf .ratio-slider{background:linear-gradient(90deg,#ff4e45 0 var(--fill),#202c3c var(--fill) 100%)!important}.ratio-control.lancer .ratio-slider{background:linear-gradient(90deg,#4f98ff 0 var(--fill),#202c3c var(--fill) 100%)!important}.ratio-control.marksman .ratio-slider{background:linear-gradient(90deg,#42d87d 0 var(--fill),#202c3c var(--fill) 100%)!important}.ratio-slider::-webkit-slider-thumb{-webkit-appearance:none!important;width:19px!important;height:19px!important;border-radius:50%!important;background:radial-gradient(circle at 35% 30%,#fff3b5,#e0a833 60%,#8a5a13)!important;border:2px solid #fff1bc!important;box-shadow:0 0 0 3px rgba(224,168,51,.13),0 3px 9px rgba(0,0,0,.38)!important}.ratio-slider::-moz-range-thumb{width:17px!important;height:17px!important;border-radius:50%!important;background:#e0a833!important;border:2px solid #fff1bc!important}.ratio-step{border-radius:10px!important;background:linear-gradient(180deg,#26344b,#111c2f)!important;border-color:rgba(231,191,103,.20)!important;color:#ffe5a5!important}.ratio-value{font-family:var(--book-font);font-size:.86rem!important;color:#fff5dc!important}
.command-deck{display:block!important;position:sticky!important;top:10px!important;z-index:2000!important;width:100%!important;max-width:none!important;height:auto!important;margin:14px 0 24px!important;padding:0!important;background:transparent!important;overflow:visible!important}.command-deck .rail-sticky{position:relative!important;left:auto!important;top:auto!important;bottom:auto!important;transform:none!important;width:100%!important;max-height:none!important;overflow:visible!important;padding:15px 18px 0!important;border-radius:26px!important;background:linear-gradient(180deg,rgba(11,20,35,.965),rgba(8,15,27,.965))!important;border:1px solid rgba(231,191,103,.22)!important;box-shadow:0 24px 55px rgba(0,0,0,.38),inset 0 1px 0 rgba(255,255,255,.055)!important;backdrop-filter:blur(15px)}.command-context{display:flex;justify-content:center;gap:7px;margin-bottom:8px}.command-context .battle-context-btn{min-width:190px;padding:8px 14px!important;border-radius:999px!important;font-family:var(--book-font);font-size:.76rem!important;background:rgba(20,31,48,.72)!important;border:1px solid rgba(148,163,184,.16)!important;color:#bfc9d8!important}.command-context .battle-context-btn.active{background:linear-gradient(180deg,#725526,#3c2c17)!important;border-color:rgba(239,199,108,.42)!important;color:#fff0bd!important;box-shadow:0 0 16px rgba(221,169,61,.10)!important}.command-orbit{display:grid;grid-template-columns:minmax(220px,1fr) 360px minmax(220px,1fr);gap:14px;align-items:center;max-width:1320px;margin:0 auto}.command-core{display:flex;justify-content:center}.command-dial{position:relative;width:330px;height:330px;border-radius:50%;overflow:hidden;background:#0b1425;border:2px solid rgba(231,191,103,.38);box-shadow:0 0 0 8px rgba(231,191,103,.035),0 16px 36px rgba(0,0,0,.36),inset 0 0 35px rgba(0,0,0,.32)}.command-dial:after{content:"";position:absolute;z-index:5;top:16px;bottom:16px;left:50%;width:1px;background:linear-gradient(180deg,transparent,rgba(255,237,192,.38),transparent);pointer-events:none}.command-opt-half{position:absolute;inset:0 auto 0 0;width:50%;border:0!important;border-radius:165px 0 0 165px!important;color:#fff!important;cursor:pointer;display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding-right:20px!important;font-family:var(--book-font)!important;font-size:1.05rem!important;font-weight:900!important;letter-spacing:.04em!important;transition:filter .15s,transform .15s!important}.command-opt-half.att{background:radial-gradient(circle at 65% 50%,rgba(255,108,91,.23),transparent 34%),linear-gradient(90deg,#761f25,#c63434)!important}.command-opt-half.def{left:50%;border-radius:0 165px 165px 0!important;padding-left:20px!important;padding-right:0!important;background:radial-gradient(circle at 35% 50%,rgba(103,180,255,.24),transparent 34%),linear-gradient(90deg,#1f4f9c,#237fca)!important}.command-opt-half:hover{filter:brightness(1.13)!important}.command-opt-half:disabled{opacity:.5}.command-opt-icon{font-size:2.05rem;filter:drop-shadow(0 3px 8px rgba(0,0,0,.38))}.command-gen{position:absolute!important;z-index:20!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;width:112px!important;height:112px!important;border-radius:50%!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;background:radial-gradient(circle at 40% 30%,#e3b84f,#9b6818 65%,#5b390d)!important;border:3px solid #ffe09a!important;box-shadow:0 0 0 7px rgba(17,24,39,.72),0 0 28px rgba(229,183,72,.30),inset 0 1px 0 rgba(255,255,255,.36)!important}.command-gen>span{font-family:var(--book-font);font-size:.62rem;letter-spacing:.12em;color:#4e3109;font-weight:900}.command-gen select{width:64px!important;padding:2px 3px!important;border:0!important;background:transparent!important;color:#fff8df!important;font-family:var(--book-font)!important;font-size:1.2rem!important;font-weight:900!important;text-align:center!important;appearance:none}.command-suggestions{min-height:210px;max-height:300px;overflow:auto;padding:8px 14px;background:linear-gradient(180deg,rgba(16,27,45,.74),rgba(8,17,31,.80));border:1px solid rgba(148,163,184,.13);box-shadow:inset 0 1px 0 rgba(255,255,255,.03)}.command-suggestions-att{clip-path:polygon(0 0,92% 0,100% 50%,92% 100%,0 100%);padding-right:32px;border-left:3px solid rgba(255,73,63,.76)}.command-suggestions-def{clip-path:polygon(8% 0,100% 0,100% 100%,8% 100%,0 50%);padding-left:32px;border-right:3px solid rgba(63,156,255,.76)}.suggestion-empty{height:100%;min-height:190px;display:grid;place-items:center;text-align:center;color:#718096;font-family:var(--book-font);font-size:.72rem}.command-suggestions .optimizer-hero-group{margin-bottom:7px!important;padding:7px!important}.command-suggestions .optimizer-ratio-option{padding:7px!important}.command-suggestions .heroes{font-size:.69rem!important}.command-suggestions .score{font-size:.55rem!important}.command-toggle-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-width:820px;margin:10px auto}.command-toggle-row .rail-joiner-opt{margin:0!important;min-height:64px!important;padding:9px 12px!important;border-radius:16px!important;background:linear-gradient(180deg,rgba(23,36,57,.82),rgba(13,24,41,.90))!important}.command-armies{max-width:1040px;margin:8px auto!important;padding:8px 12px!important;border-radius:16px!important;background:rgba(14,25,43,.76)!important}.command-armies .rail-global-title{font-family:var(--book-font)!important;font-size:.74rem!important;color:#e9d9b6!important}.command-army-fields{display:grid;grid-template-columns:140px 140px 185px 150px 110px;gap:8px;align-items:end;justify-content:center}.command-army-fields label{display:grid;gap:3px;font-size:.58rem;color:#8796ab;text-transform:uppercase}.command-army-fields select{width:100%;background:#081426;border:1px solid rgba(148,163,184,.20);border-radius:9px;color:#e5edf7;padding:7px;font-weight:800}.command-army-fields .rail-global-btn{height:34px!important;padding:6px!important}.command-speed-wrap{position:relative;width:min(760px,84%);margin:9px auto 11px;padding:5px 0}.command-speed-bar{display:block;width:100%;height:7px;appearance:none;background:linear-gradient(90deg,#31435c,#58b8ff 60%,#ffd568);border-radius:999px;outline:none;box-shadow:inset 0 1px 4px rgba(0,0,0,.45),0 0 0 1px rgba(255,255,255,.05)}.command-speed-bar::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;border-radius:50%;background:#f5d57e;border:2px solid #fff0b8;box-shadow:0 2px 9px rgba(0,0,0,.4)}.command-speed-tooltip{position:absolute;left:50%;bottom:calc(100% + 10px);transform:translateX(-50%) translateY(6px);width:360px;padding:10px 12px;border-radius:12px;background:#07101e;border:1px solid rgba(231,191,103,.28);box-shadow:0 14px 28px rgba(0,0,0,.34);opacity:0;pointer-events:none;transition:.15s;color:#e6edf8;text-align:center;z-index:20}.command-speed-wrap:hover .command-speed-tooltip{opacity:1;transform:translateX(-50%) translateY(0)}.command-speed-tooltip b,.command-speed-tooltip span,.command-speed-tooltip small{display:block}.command-speed-tooltip b{font-family:var(--book-font);color:#f4d790}.command-speed-tooltip span{margin:2px 0;color:#8dccff;font-size:.74rem}.command-speed-tooltip small{color:#aeb9c9;font-size:.65rem;line-height:1.35}.command-meta-wrap{width:min(820px,88%);margin:5px auto 4px!important}.command-meta-btn{width:100%!important;min-height:60px!important;border-radius:17px!important;background:linear-gradient(100deg,#314f99,#5144c7 46%,#2a88ba)!important;border:1px solid rgba(193,214,255,.62)!important;color:#fff!important;font-family:var(--book-font)!important;font-size:1.1rem!important;box-shadow:0 0 0 1px rgba(183,203,255,.08),0 0 24px rgba(96,101,255,.25),0 12px 28px rgba(0,0,0,.24)!important;animation:metaCommandGlow 2.5s ease-in-out infinite!important}.command-meta-btn:before,.command-meta-btn:after{display:none!important}.command-meta-btn:hover{transform:translateY(-1px) scale(1.005)!important;filter:brightness(1.08)!important}.meta-crown{color:#ffe28d;font-size:1.2rem}.command-meta-wrap .rail-meta-tooltip{left:50%!important;transform:translateX(-50%)!important;width:min(520px,90vw)!important}.command-progress{max-width:900px;margin:8px auto 0!important;border-top:0!important;padding:0!important}.command-progress .optimizer-progress-track{height:7px!important;background:#121f33!important}.command-progress-copy{display:flex;justify-content:space-between;gap:12px;margin-top:4px}.command-progress-copy span{font-size:.58rem!important}.command-note{max-width:900px;margin:5px auto 0!important;text-align:center!important;font-size:.58rem!important}.command-meta-status{max-width:900px;margin:3px auto!important;padding:0!important;min-height:0!important;background:transparent!important;border:0!important;text-align:center!important;font-size:.58rem!important}.simulation-dock{position:relative;margin:12px -18px 0;padding:15px 24px 13px;border-top:1px solid rgba(231,191,103,.18);border-radius:0 0 26px 26px;background:linear-gradient(180deg,rgba(6,13,24,.30),rgba(4,10,19,.92))}.simulation-dock-label{display:flex;justify-content:center;align-items:center;gap:7px;margin-bottom:8px;color:#aeb9ca;font-size:.62rem;text-transform:uppercase;letter-spacing:.08em}.simulation-dock-label .rail-run-select{width:68px!important;height:29px!important;padding:4px!important;border-radius:8px!important}.simulation-result-track{position:relative;max-width:1320px;margin:0 auto;height:58px;display:flex;align-items:center}.simulation-result-track .multi-bar-wrap{width:100%!important;margin:0!important}.simulation-result-track .multi-bar{height:27px!important;border-radius:999px!important;overflow:hidden!important;background:linear-gradient(90deg,rgba(130,32,32,.23) 0 50%,rgba(35,84,147,.23) 50% 100%)!important;border:1px solid rgba(231,191,103,.20)!important;box-shadow:inset 0 3px 8px rgba(0,0,0,.42)!important}.simulation-result-track .multi-red{background:linear-gradient(90deg,#7b1f23,#ff4c43)!important}.simulation-result-track .multi-blue{background:linear-gradient(90deg,#3e98ff,#2451a8)!important}.simulation-clash{position:absolute!important;z-index:7!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;width:84px!important;height:84px!important;border-radius:50%!important;margin:0!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:1px!important;background:radial-gradient(circle at 38% 30%,#3b4659,#111b2c 62%,#070e19)!important;border:3px solid #e5bd65!important;color:#ffe8ae!important;box-shadow:0 0 0 7px rgba(7,14,25,.88),0 0 22px rgba(231,191,103,.22),0 10px 24px rgba(0,0,0,.36)!important}.simulation-clash .sword-pair{font-size:1.75rem}.simulation-clash small{font-family:var(--book-font);font-size:.52rem;letter-spacing:.06em}.simulation-dock-status{display:flex;justify-content:space-between;max-width:1320px;margin:6px auto 0;color:#8292a8;font-size:.58rem}.simulation-dock-status .multi-status,.simulation-dock-status .multi-count{margin:0!important}
@keyframes metaCommandGlow{0%,100%{box-shadow:0 0 0 1px rgba(183,203,255,.08),0 0 22px rgba(96,101,255,.20),0 12px 28px rgba(0,0,0,.24)}50%{box-shadow:0 0 0 1px rgba(255,222,144,.16),0 0 32px rgba(96,101,255,.33),0 0 18px rgba(255,209,103,.12),0 12px 28px rgba(0,0,0,.28)}}
body.light-theme .sim-hero-header{background-image:linear-gradient(90deg,rgba(250,246,238,.91) 0%,rgba(242,236,227,.77) 43%,rgba(248,242,233,.12) 70%),var(--jeronimo-banner);border-color:rgba(146,101,42,.28)}body.light-theme .sim-hero-copy h1{color:#2b2018;text-shadow:none}body.light-theme .sim-hero-copy p{color:#4c5968}body.light-theme .sim-hero-kicker{color:#795622}body.light-theme .sim-feature{background:rgba(255,255,255,.76);border-color:rgba(122,93,54,.16)}body.light-theme .sim-feature b{color:#263445}body.light-theme .sim-feature.meta-feature{background:linear-gradient(135deg,#fff4d1,#e8eefb)}body.light-theme .command-deck .rail-sticky{background:linear-gradient(180deg,rgba(255,255,255,.965),rgba(244,248,252,.965))!important;border-color:#d4c19b!important}body.light-theme .command-suggestions,body.light-theme .command-toggle-row .rail-joiner-opt,body.light-theme .command-armies{background:#f8fafc!important}body.light-theme .command-dial{background:#edf2f7}body.light-theme .section-title{color:#765524!important}body.light-theme .ratio-control{background:#f8fafc!important;border-color:#dbe3ed!important}body.light-theme .ratio-label{color:#1d2c3f!important}body.light-theme .ratio-value{color:#27364a!important}body.light-theme .suggestion-empty{color:#64748b}
@media(max-width:1250px){.sim-hero-copy{width:70%}.sim-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.command-orbit{grid-template-columns:1fr 310px 1fr}.command-dial{width:290px;height:290px}.command-gen{width:102px!important;height:102px!important}.command-army-fields{grid-template-columns:repeat(3,minmax(120px,1fr));max-width:760px;margin:auto}.command-army-fields .rail-global-btn{min-width:0}}
@media(max-width:980px){.sim-hero-copy{width:100%;padding-right:28%}.command-deck{position:relative!important;top:auto!important}.command-orbit{grid-template-columns:1fr}.command-suggestions{clip-path:none!important;min-height:0;max-height:220px}.command-suggestions-att,.command-suggestions-def{padding:10px!important;border:1px solid rgba(148,163,184,.14)}.command-suggestions-att{border-left:3px solid var(--redv)}.command-suggestions-def{border-right:3px solid var(--bluev)}.command-toggle-row{grid-template-columns:1fr}.command-army-fields{grid-template-columns:repeat(2,minmax(120px,1fr))}.sim-grid{grid-template-columns:1fr!important}}
@media(max-width:680px){.sim-hero-header{min-height:500px;background-position:65% center}.sim-hero-copy{padding:80px 18px 22px;width:100%;background:linear-gradient(90deg,rgba(7,12,21,.88),rgba(7,12,21,.58))}.sim-feature-grid{grid-template-columns:1fr}.command-context{flex-direction:column}.command-context .battle-context-btn{min-width:0;width:100%}.command-dial{width:270px;height:270px}.command-gen{width:94px!important;height:94px!important}.command-army-fields{grid-template-columns:1fr 1fr}.ratio-control{grid-template-columns:100px 34px 1fr 55px 34px!important}.simulation-dock{padding-left:12px;padding-right:12px}.simulation-clash{width:72px!important;height:72px!important}}

/* v0.76.6 command-deck fit refinements */
.command-deck .rail-sticky{max-height:calc(100vh - 20px)!important;overflow-y:auto!important;overflow-x:visible!important;scrollbar-width:thin;scrollbar-color:rgba(231,191,103,.34) transparent}
.command-deck .rail-sticky::-webkit-scrollbar{width:8px}.command-deck .rail-sticky::-webkit-scrollbar-thumb{background:rgba(231,191,103,.30);border-radius:999px}.simulation-dock{position:sticky!important;bottom:0!important;z-index:15!important}
.command-gen>span{display:none!important}.command-gen .rail-gen-box-btn{width:88px!important;min-width:88px!important;max-width:88px!important;height:88px!important;margin:0!important;padding:0!important;border-radius:50%!important;border:0!important;background:transparent!important;box-shadow:none!important;color:#fff8df!important;font-family:var(--book-font)!important}.command-gen .rail-gen-box-btn::before{display:none!important}.command-gen .rail-gen-box-btn .gen-box-value{font-family:var(--book-font)!important;font-size:1.05rem!important;letter-spacing:.02em!important;color:#fff8df!important}.command-gen .rail-gen-box-btn:hover{transform:scale(1.03)!important;box-shadow:none!important;filter:brightness(1.08)!important}
.command-suggestions .optimizer-group-head{display:flex!important;gap:5px!important;align-items:center!important}.command-suggestions .optimizer-group-ratios{display:grid!important;gap:5px!important}.command-suggestions .optimizer-side-badge{display:none!important}

/* Extracted from battle_simulator.html style block 11: id="v0767-command-layout-fix" */

/* v0.76.7 — command center structural repair
   Removes inherited skinny-rail limits and the obsolete 3-column army grid. */
html,body{overflow-x:hidden!important}

/* Command center is a normal full-width block ABOVE the armies. It never overlays them. */
#battleRail.command-deck{
  position:relative!important;
  inset:auto!important;
  top:auto!important;left:auto!important;right:auto!important;bottom:auto!important;
  display:block!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:auto!important;
  margin:12px 0 22px!important;
  padding:0!important;
  transform:none!important;
  overflow:visible!important;
  z-index:20!important;
}
#battleRail.command-deck .rail-sticky,
#battleRail.command-deck .rail-sticky.rail-fixed,
#battleRail.command-deck .rail-sticky.rail-bottom{
  position:relative!important;
  inset:auto!important;
  left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
  transform:none!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  max-height:none!important;
  overflow:visible!important;
  margin:0!important;
  padding:10px 16px 0!important;
  border-radius:22px!important;
}
#battleRail.command-deck .rail-sticky::-webkit-scrollbar{display:none!important}

/* Two army dossiers only. No ghost center column. */
#sidePanels.sim-grid{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  grid-template-rows:auto!important;
  gap:24px!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  align-items:start!important;
  overflow:visible!important;
}
#sidePanels.sim-grid>.att{
  grid-column:1!important;
  grid-row:1!important;
  min-width:0!important;
  width:100%!important;
}
#sidePanels.sim-grid>.def{
  grid-column:2!important;
  grid-row:1!important;
  min-width:0!important;
  width:100%!important;
}

/* Compact command center. */
.command-context{
  margin:0 auto 5px!important;
  gap:6px!important;
  min-height:0!important;
}
.command-context .battle-context-btn{
  min-width:164px!important;
  min-height:31px!important;
  padding:6px 13px!important;
  font-size:.69rem!important;
}
.command-orbit{
  width:min(1180px,100%)!important;
  max-width:1180px!important;
  min-width:0!important;
  grid-template-columns:minmax(0,1fr) 190px minmax(0,1fr)!important;
  gap:11px!important;
  align-items:center!important;
  margin:0 auto 6px!important;
}
.command-core{min-width:0!important}
.command-dial{
  width:178px!important;
  height:178px!important;
  min-width:178px!important;
  min-height:178px!important;
  border-width:1px!important;
  box-shadow:0 0 0 5px rgba(231,191,103,.035),0 10px 25px rgba(0,0,0,.32),inset 0 0 25px rgba(0,0,0,.28)!important;
}
.command-dial:after{top:10px!important;bottom:10px!important}
.command-opt-half{
  border-radius:89px 0 0 89px!important;
  gap:4px!important;
  padding-right:12px!important;
  font-size:.78rem!important;
}
.command-opt-half.def{
  border-radius:0 89px 89px 0!important;
  padding-left:12px!important;
}
.command-opt-icon{font-size:1.32rem!important}
.command-gen{
  width:70px!important;
  height:70px!important;
  border-width:2px!important;
  box-shadow:0 0 0 5px rgba(17,24,39,.72),0 0 18px rgba(229,183,72,.23),inset 0 1px 0 rgba(255,255,255,.30)!important;
}
.command-gen>span{font-size:.48rem!important;line-height:1!important}
.command-gen select{width:50px!important;font-size:.91rem!important;line-height:1!important}

/* Recommendation wings remain beside the dial but no longer force tall empty columns. */
.command-suggestions{
  min-width:0!important;
  min-height:116px!important;
  height:140px!important;
  max-height:140px!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:6px 12px!important;
  border-radius:12px!important;
}
.command-suggestions-att{
  clip-path:polygon(0 0,95% 0,100% 50%,95% 100%,0 100%)!important;
  padding-right:24px!important;
}
.command-suggestions-def{
  clip-path:polygon(5% 0,100% 0,100% 100%,5% 100%,0 50%)!important;
  padding-left:24px!important;
}
.suggestion-empty{
  min-height:102px!important;
  height:100%!important;
  font-size:.62rem!important;
}
.command-suggestions .optimizer-hero-group{margin-bottom:4px!important;padding:5px!important}
.command-suggestions .optimizer-ratio-option{padding:5px!important}
.command-suggestions .heroes{font-size:.62rem!important}
.command-suggestions .ratio{font-size:.60rem!important}
.command-suggestions .score{font-size:.52rem!important}

/* Everything below the dial becomes shallow, not card-on-card vertical bulk. */
.command-toggle-row{
  width:min(720px,100%)!important;
  max-width:720px!important;
  gap:8px!important;
  margin:4px auto!important;
}
.command-toggle-row .rail-joiner-opt{
  min-height:43px!important;
  padding:6px 10px!important;
  border-radius:12px!important;
  grid-template-columns:34px minmax(0,1fr)!important;
  gap:8px!important;
}
.command-toggle-row .rail-joiner-switch{
  width:34px!important;
  height:20px!important;
}
.command-toggle-row .rail-joiner-switch:after{
  width:14px!important;height:14px!important;top:3px!important;left:3px!important;
}
.command-toggle-row .rail-joiner-opt input:checked + .rail-joiner-switch:after{transform:translateX(14px)!important}
.command-toggle-row .rail-joiner-copy b{font-size:.70rem!important}
.command-toggle-row .rail-joiner-copy small{font-size:.55rem!important;margin-top:1px!important}

.command-armies{
  width:min(940px,100%)!important;
  max-width:940px!important;
  margin:5px auto!important;
  padding:5px 9px 7px!important;
  border-radius:12px!important;
}
.command-armies .rail-global-title{
  margin:0 0 4px!important;
  font-size:.58rem!important;
  line-height:1!important;
  text-align:center!important;
}
.command-army-fields{
  display:grid!important;
  grid-template-columns:110px 110px 150px 122px 88px!important;
  gap:6px!important;
  align-items:end!important;
  justify-content:center!important;
}
.command-army-fields label{gap:2px!important;font-size:.48rem!important}
.command-army-fields select{
  min-height:29px!important;
  height:29px!important;
  padding:3px 7px!important;
  border-radius:7px!important;
  font-size:.65rem!important;
}
.command-army-fields .rail-global-btn{
  height:29px!important;
  min-height:29px!important;
  padding:3px 6px!important;
  border-radius:7px!important;
  font-size:.55rem!important;
}

.command-speed-wrap{
  width:min(660px,72%)!important;
  margin:4px auto 5px!important;
  padding:3px 0!important;
}
.command-speed-bar{height:5px!important}
.command-speed-bar::-webkit-slider-thumb{width:15px!important;height:15px!important}
.command-speed-tooltip{bottom:calc(100% + 7px)!important;font-size:.67rem!important}

.command-meta-wrap{
  width:min(680px,76%)!important;
  margin:3px auto!important;
}
.command-meta-btn{
  min-height:43px!important;
  height:43px!important;
  padding:7px 14px!important;
  border-radius:13px!important;
  font-size:.83rem!important;
}
.meta-crown{font-size:.95rem!important}

.command-progress{
  width:min(760px,82%)!important;
  max-width:760px!important;
  margin:4px auto 0!important;
}
.command-progress .optimizer-progress-track{height:5px!important}
.command-progress-copy{margin-top:2px!important}
.command-progress-copy span{font-size:.49rem!important}
.command-note,.command-meta-status{
  max-width:760px!important;
  margin:2px auto!important;
  font-size:.49rem!important;
  line-height:1.2!important;
}

/* The simulation strip is attached to the bottom but stays in flow. */
.simulation-dock{
  position:relative!important;
  inset:auto!important;
  bottom:auto!important;
  margin:6px -16px 0!important;
  padding:8px 18px 7px!important;
  border-radius:0 0 21px 21px!important;
}
.simulation-dock-label{
  margin-bottom:3px!important;
  gap:5px!important;
  font-size:.49rem!important;
}
.simulation-dock-label .rail-run-select{
  width:60px!important;
  height:24px!important;
  min-height:24px!important;
  padding:2px 4px!important;
}
.simulation-result-track{
  height:42px!important;
  max-width:1180px!important;
}
.simulation-result-track .multi-bar{height:18px!important}
.simulation-clash{
  width:58px!important;
  height:58px!important;
  border-width:2px!important;
  box-shadow:0 0 0 5px rgba(7,14,25,.88),0 0 16px rgba(231,191,103,.18),0 7px 18px rgba(0,0,0,.32)!important;
}
.simulation-clash .sword-pair{font-size:1.22rem!important}
.simulation-clash small{font-size:.39rem!important}
.simulation-dock-status{
  max-width:1180px!important;
  margin-top:2px!important;
  font-size:.48rem!important;
}

/* Stop old rail dimensions from resurfacing anywhere inside the new command deck. */
#battleRail.command-deck,
#battleRail.command-deck *{box-sizing:border-box}
#battleRail.command-deck .rail-sticky{max-width:none!important}
#battleRail.command-deck .rail-fixed{max-width:none!important}

/* Keep both armies visible side-by-side on normal desktop widths. */
@media (min-width:1181px){
  #sidePanels.sim-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}
  #sidePanels.sim-grid>.att{grid-column:1!important}
  #sidePanels.sim-grid>.def{grid-column:2!important}
}
@media (max-width:1180px){
  #battleRail.command-deck{position:relative!important}
  .command-orbit{grid-template-columns:minmax(0,1fr) 170px minmax(0,1fr)!important}
  .command-dial{width:160px!important;height:160px!important;min-width:160px!important;min-height:160px!important}
  #sidePanels.sim-grid{grid-template-columns:1fr!important}
  #sidePanels.sim-grid>.att,#sidePanels.sim-grid>.def{grid-column:1!important;grid-row:auto!important}
}
@media (max-width:820px){
  .command-orbit{grid-template-columns:1fr!important}
  .command-core{grid-row:1}
  .command-suggestions{clip-path:none!important;height:auto!important;max-height:130px!important}
  .command-toggle-row{grid-template-columns:1fr!important}
  .command-army-fields{grid-template-columns:repeat(2,minmax(110px,1fr))!important}
  .command-speed-wrap,.command-meta-wrap,.command-progress{width:100%!important}
}

/* Extracted from battle_simulator.html style block 12: id="v0768-compact-floating-command" */

/* v0.76.8 — compact floating command center */
#battleRail.command-deck{
 position:sticky!important;top:8px!important;z-index:9000!important;
 margin:10px 0 18px!important;width:100%!important;overflow:visible!important;
}
#battleRail.command-deck .rail-sticky,
#battleRail.command-deck .rail-sticky.rail-fixed,
#battleRail.command-deck .rail-sticky.rail-bottom{
 position:relative!important;inset:auto!important;transform:none!important;
 width:100%!important;max-width:none!important;max-height:none!important;
 overflow:visible!important;padding:7px 12px 0!important;border-radius:20px!important;
 box-shadow:0 16px 38px rgba(0,0,0,.34),0 0 0 1px rgba(255,255,255,.025)!important;
 backdrop-filter:blur(16px) saturate(1.08)!important;
}
.command-context{margin:0 auto 4px!important;gap:5px!important}
.command-context .battle-context-btn{min-width:158px!important;height:28px!important;min-height:28px!important;padding:4px 11px!important;font-size:.66rem!important;border-radius:999px!important}
.command-context .battle-context-btn.active{filter:brightness(1.13);box-shadow:0 0 0 1px rgba(255,222,151,.11),0 5px 13px rgba(0,0,0,.16)!important}

.command-orbit{width:100%!important;max-width:1260px!important;grid-template-columns:minmax(0,1fr) 184px minmax(0,1fr)!important;gap:9px!important;margin:0 auto 2px!important;align-items:center!important}
.command-dial{width:174px!important;height:174px!important;min-width:174px!important;min-height:174px!important}
.command-gen{width:62px!important;height:62px!important;background:radial-gradient(circle at 42% 32%,#263247,#111a2a 68%,#080f1c)!important;border:2px solid #d8ba74!important;box-shadow:0 0 0 4px rgba(8,15,28,.78),0 0 14px rgba(210,178,105,.18),inset 0 1px 0 rgba(255,255,255,.10)!important}
.command-gen select{width:56px!important;color:#f8e8bd!important;font-size:.88rem!important;text-shadow:none!important}
.command-opt-half{font-size:.76rem!important;gap:4px!important}
.command-opt-half.att{padding:0 34px 0 9px!important;align-items:center!important}
.command-opt-half.def{padding:0 9px 0 34px!important;align-items:center!important}
.command-opt-icon{font-size:1.25rem!important}
.command-opt-label{display:block!important;position:relative;z-index:3;white-space:nowrap!important;overflow:visible!important;font-size:.73rem!important;line-height:1!important}

.command-suggestions{height:124px!important;min-height:124px!important;max-height:124px!important;overflow:hidden!important;padding:6px 18px!important;border-radius:11px!important}
.command-suggestions.optimizer-recs{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important}
.command-suggestions-att{padding-right:24px!important}.command-suggestions-def{padding-left:24px!important}
.suggestion-empty{min-height:108px!important;font-size:.61rem!important}
.optimizer-recommend-card{display:block!important;width:100%!important;min-width:0!important;height:110px!important;margin:0!important;padding:6px 7px!important;border-radius:9px!important;overflow:hidden!important;text-align:left!important;cursor:pointer!important;color:inherit!important;background:rgba(8,17,31,.68)!important;border:1px solid rgba(148,163,184,.15)!important;box-shadow:none!important}
.optimizer-recommend-card:hover{border-color:rgba(125,211,252,.46)!important;background:rgba(16,31,52,.84)!important;transform:translateY(-1px)}
.optimizer-recommend-card .optimizer-group-head{display:flex!important;justify-content:space-between!important;margin:0 0 2px!important}
.optimizer-recommend-card .rank{font-size:.70rem!important}.optimizer-recommend-card .optimizer-mode-badge{font-size:.42rem!important;padding:2px 4px!important}
.optimizer-recommend-card .heroes{font-size:.58rem!important;line-height:1.15!important;margin:0 0 3px!important;white-space:normal!important;min-height:26px!important}
.optimizer-recommend-card .ratio{font-size:.72rem!important;font-weight:950!important;line-height:1!important;margin:0 0 3px!important}
.optimizer-recommend-card .optimizer-joiners{font-size:.49rem!important;line-height:1.12!important;margin:0 0 3px!important;padding:2px 4px!important;white-space:normal!important;min-height:22px!important}
.optimizer-recommend-card .score{display:flex!important;justify-content:space-between!important;gap:4px!important;font-size:.47rem!important;line-height:1!important;color:#aebed2!important}.optimizer-recommend-card .score b{font-size:.53rem!important;color:#f3f7fb!important}.optimizer-recommend-card .score span{white-space:nowrap}.optimizer-apply-hint{margin-top:3px;font-size:.42rem!important;text-transform:uppercase;letter-spacing:.06em;color:#8395aa;text-align:right}

/* Optimizer progress is only present while a counter search is actually running. */
.command-progress{display:none!important;width:min(980px,90%)!important;margin:2px auto 4px!important}
.optimizer-running .command-progress{display:block!important}
.command-progress .optimizer-progress-track{height:3px!important}.command-progress-copy{margin-top:1px!important}.command-progress-copy span{font-size:.46rem!important}

.command-compact-row{display:grid!important;grid-template-columns:minmax(330px,.78fr) minmax(540px,1.35fr)!important;gap:8px!important;align-items:center!important;width:min(1080px,96%)!important;margin:3px auto!important}
.command-toggle-row{width:100%!important;max-width:none!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;margin:0!important}
.command-toggle-row .rail-joiner-opt{min-height:37px!important;height:37px!important;padding:4px 7px!important;border-radius:10px!important;grid-template-columns:29px minmax(0,1fr)!important;gap:6px!important}
.command-toggle-row .rail-joiner-switch{width:29px!important;height:17px!important}.command-toggle-row .rail-joiner-switch:after{width:11px!important;height:11px!important;top:3px!important;left:3px!important}.command-toggle-row .rail-joiner-opt input:checked + .rail-joiner-switch:after{transform:translateX(12px)!important}
.command-toggle-row .rail-joiner-copy b{font-size:.62rem!important}.command-toggle-row .rail-joiner-copy small{display:none!important}
.command-armies{display:grid!important;grid-template-columns:68px minmax(0,1fr)!important;align-items:center!important;width:100%!important;max-width:none!important;margin:0!important;padding:4px 7px!important;border-radius:10px!important;min-height:37px!important}
.command-armies .rail-global-title{margin:0!important;font-size:.52rem!important;text-align:left!important;white-space:nowrap!important}
.command-army-fields{grid-template-columns:74px 74px 82px 106px 66px!important;gap:5px!important;justify-content:end!important}
.command-army-fields label>span{display:none!important}.command-army-fields select{height:27px!important;min-height:27px!important;padding:2px 5px!important;font-size:.60rem!important}.command-army-fields .rail-global-btn{height:27px!important;min-height:27px!important;font-size:.48rem!important;padding:2px 5px!important}

.command-speed-wrap{display:grid!important;grid-template-columns:104px minmax(0,1fr)!important;gap:9px!important;align-items:center!important;width:min(740px,70%)!important;margin:3px auto 5px!important;padding:1px 0!important}
.command-speed-headline{display:flex;align-items:baseline;gap:5px;white-space:nowrap}.command-speed-headline b{font-family:var(--book-font);font-size:.58rem;color:#d8c8a8;letter-spacing:.04em}.command-speed-headline span{font-size:.46rem;color:#87a6ca}
.command-speed-bar{height:4px!important}.command-speed-bar::-webkit-slider-thumb{width:14px!important;height:14px!important}.command-speed-tooltip{bottom:calc(100% + 5px)!important}

.command-meta-wrap{width:min(760px,72%)!important;margin:2px auto 4px!important}
.command-meta-btn{position:relative!important;height:42px!important;min-height:42px!important;padding:0 14px!important;overflow:hidden!important;border-radius:13px!important}
.meta-button-progress-fill{position:absolute;z-index:0;left:0;top:0;bottom:0;width:0;background:linear-gradient(90deg,rgba(254,207,103,.34),rgba(103,229,255,.30));transition:width .15s linear;pointer-events:none}
.meta-button-content{position:relative;z-index:2;display:flex;align-items:center;justify-content:center;gap:8px;width:100%;font-family:var(--book-font);font-weight:900}.meta-button-pct{min-width:0;font-family:var(--med-body,inherit);font-size:.55rem;color:#dcecff}.command-meta-btn.meta-running{animation:none!important;box-shadow:0 0 0 1px rgba(183,203,255,.13),0 0 20px rgba(79,154,255,.24)!important}.command-meta-btn.meta-ready{background:linear-gradient(100deg,#314f99,#4d44bb 48%,#23799c)!important}.command-meta-btn.meta-ready .meta-crown{color:#ffe38f!important}
.command-note{display:none!important}.command-meta-status{display:none!important}

/* Full-width simulation strip, with controls overlaid instead of consuming another row. */
.simulation-dock{width:calc(100% + 24px)!important;margin:4px -12px 0!important;padding:7px 14px 6px!important;border-radius:0 0 19px 19px!important;min-height:50px!important}
.simulation-result-track{max-width:none!important;width:100%!important;height:38px!important;margin:0!important}.simulation-result-track .multi-bar-wrap{width:100%!important}.simulation-result-track .multi-bar{height:18px!important}
.simulation-dock-label{position:absolute!important;left:16px!important;top:4px!important;z-index:8!important;margin:0!important;padding:3px 6px!important;border-radius:8px!important;background:rgba(6,13,24,.72)!important;font-size:.44rem!important}.simulation-dock-label .rail-run-select{width:54px!important;height:22px!important;min-height:22px!important;font-size:.55rem!important}
.simulation-clash{width:56px!important;height:56px!important}.simulation-dock-status{position:absolute!important;right:16px!important;bottom:4px!important;z-index:8!important;max-width:none!important;margin:0!important;gap:8px!important;font-size:.44rem!important}

/* Light mode: the Gen center is neutral/ivory, not a competing gold disc. */
body.light-theme .command-gen{background:radial-gradient(circle at 42% 30%,#ffffff,#eef2f6 72%,#dbe3eb)!important;border-color:#9a7741!important;box-shadow:0 0 0 4px rgba(255,255,255,.86),0 5px 14px rgba(68,79,92,.17),inset 0 1px 0 #fff!important}
body.light-theme .command-gen select{color:#263446!important;-webkit-text-fill-color:#263446!important}
body.light-theme .optimizer-recommend-card{background:#fff!important;color:#1f2d40!important;border-color:#dbe3ed!important}body.light-theme .optimizer-recommend-card .score b{color:#243347!important}body.light-theme .optimizer-recommend-card .optimizer-joiners{color:#075985!important;background:#e8f6fd!important}body.light-theme .command-speed-headline b{color:#654b28!important}body.light-theme .command-speed-headline span{color:#42698f!important}

@media(max-width:1280px){.command-compact-row{grid-template-columns:1fr!important;width:min(900px,96%)!important}.command-toggle-row{width:min(520px,100%)!important;margin:auto!important}.command-armies{width:min(760px,100%)!important;margin:auto!important}.command-speed-wrap{width:min(660px,88%)!important}}
@media(max-width:980px){ #battleRail.command-deck{position:relative!important;top:auto!important}.command-orbit{grid-template-columns:1fr!important}.command-core{grid-row:1}.command-suggestions{clip-path:none!important;height:auto!important;max-height:none!important;min-height:0!important;overflow:visible!important}.command-suggestions.optimizer-recs{grid-template-columns:repeat(3,minmax(0,1fr))!important}.command-compact-row{grid-template-columns:1fr!important}.command-armies{grid-template-columns:1fr!important}.command-armies .rail-global-title{text-align:center!important;margin-bottom:3px!important}.command-army-fields{justify-content:center!important}.simulation-dock{width:calc(100% + 24px)!important}}
@media(max-width:720px){.command-suggestions.optimizer-recs{grid-template-columns:1fr!important}.optimizer-recommend-card{height:auto!important}.command-toggle-row{grid-template-columns:1fr 1fr!important}.command-army-fields{grid-template-columns:repeat(3,minmax(64px,1fr))!important}.command-speed-wrap{grid-template-columns:1fr!important;gap:3px!important}.command-speed-headline{justify-content:center}.command-meta-wrap{width:100%!important}}

/* Extracted from battle_simulator.html style block 13: id="v0769-command-polish" */

/* v0.76.9 — readability, glow, real floating command deck */
#battleRail.command-deck .rail-sticky.rail-command-fixed{
  box-shadow:0 20px 48px rgba(0,0,0,.43),0 0 0 1px rgba(255,255,255,.035)!important;
  backdrop-filter:blur(18px) saturate(1.12)!important;
}

/* Dial: golden Gen in both themes, preserve a true circle, and keep Optimize completely outside the centre disc. */
.command-dial{width:194px!important;height:194px!important;min-width:194px!important;min-height:194px!important}
.command-gen{
 width:70px!important;height:70px!important;min-width:70px!important;min-height:70px!important;aspect-ratio:1/1!important;
 border-radius:50%!important;padding:0!important;
 background:radial-gradient(circle at 38% 28%,#ffe27a 0%,#e0a733 45%,#a56d19 76%,#6d430d 100%)!important;
 border:2px solid #ffe8a8!important;
 box-shadow:0 0 0 4px rgba(8,15,28,.80),0 0 18px rgba(238,185,72,.32),inset 0 1px 0 rgba(255,255,255,.42)!important;
}
.command-gen>span{font-size:.48rem!important;color:#5b3607!important;line-height:1!important}
.command-gen select{width:62px!important;height:28px!important;color:#fff9df!important;-webkit-text-fill-color:#fff9df!important;font-size:.92rem!important;text-shadow:0 1px 3px rgba(69,40,5,.58)!important;line-height:1!important}
body.light-theme .command-gen{
 width:70px!important;height:70px!important;min-width:70px!important;min-height:70px!important;aspect-ratio:1/1!important;border-radius:50%!important;
 background:radial-gradient(circle at 38% 28%,#ffe889 0%,#efb73d 48%,#bd8123 78%,#855211 100%)!important;
 border-color:#9f6b20!important;box-shadow:0 0 0 4px rgba(255,255,255,.92),0 7px 18px rgba(92,63,22,.23),0 0 18px rgba(210,152,44,.22),inset 0 1px 0 rgba(255,255,255,.54)!important;
}
body.light-theme .command-gen>span{color:#62400d!important}
body.light-theme .command-gen select{color:#fffdf0!important;-webkit-text-fill-color:#fffdf0!important;text-shadow:0 1px 3px rgba(80,47,8,.58)!important}
.command-opt-half{overflow:hidden!important}
.command-opt-half.att{padding:0!important}
.command-opt-half.def{padding:0!important}
.command-opt-icon,.command-opt-label{position:relative;z-index:4!important;transition:transform .18s ease,text-shadow .18s ease,filter .18s ease}
.command-opt-half.att .command-opt-icon,.command-opt-half.att .command-opt-label{transform:translateX(-21px)}
.command-opt-half.def .command-opt-icon,.command-opt-half.def .command-opt-label{transform:translateX(21px)}
.command-opt-label{width:62px!important;text-align:center!important;font-size:.72rem!important;letter-spacing:.015em!important;white-space:nowrap!important;overflow:visible!important;text-overflow:clip!important}
.command-opt-icon{font-size:1.30rem!important}
.command-opt-half::before{content:"";position:absolute;z-index:2;inset:4px;opacity:0;pointer-events:none;transition:opacity .18s ease;filter:blur(1px)}
.command-opt-half.att::before{background:radial-gradient(circle at 30% 50%,rgba(255,216,119,.62),rgba(255,88,47,.25) 34%,transparent 67%);box-shadow:inset 0 0 25px rgba(255,121,53,.46)}
.command-opt-half.def::before{background:radial-gradient(circle at 70% 50%,rgba(188,232,255,.68),rgba(67,152,255,.29) 34%,transparent 68%);box-shadow:inset 0 0 25px rgba(73,159,255,.50)}
.command-opt-half:hover::before{opacity:1;animation:commandAuraPulse 1.05s ease-in-out infinite alternate}
.command-opt-half:hover .command-opt-icon,.command-opt-half:hover .command-opt-label{filter:brightness(1.18);text-shadow:0 0 8px rgba(255,244,211,.80),0 0 15px currentColor}
.command-dial:has(.command-opt-half.att:hover){box-shadow:0 0 0 7px rgba(255,110,60,.07),0 0 27px rgba(255,78,41,.38),0 16px 34px rgba(0,0,0,.37),inset 0 0 30px rgba(0,0,0,.30)!important}
.command-dial:has(.command-opt-half.def:hover){box-shadow:0 0 0 7px rgba(67,157,255,.08),0 0 29px rgba(61,151,255,.42),0 16px 34px rgba(0,0,0,.37),inset 0 0 30px rgba(0,0,0,.30)!important}
@keyframes commandAuraPulse{from{filter:brightness(.92) blur(1px)}to{filter:brightness(1.18) blur(2px)}}

/* Recommendations: larger readable text, tiny portraits + names, still no internal scrolling. */
.command-suggestions{height:148px!important;min-height:148px!important;max-height:148px!important;padding-top:7px!important;padding-bottom:7px!important}
.suggestion-empty{min-height:132px!important;font-size:.69rem!important}
.optimizer-recommend-card{height:132px!important;padding:6px 7px!important}
.optimizer-recommend-card .optimizer-group-head{margin-bottom:3px!important}
.optimizer-recommend-card .rank{font-size:.76rem!important}.optimizer-recommend-card .optimizer-mode-badge{font-size:.46rem!important}
.optimizer-mini-heroes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;margin:1px 0 4px}
.optimizer-mini-hero{display:flex;align-items:center;min-width:0;gap:3px;padding:2px 3px;border-radius:6px;background:rgba(148,163,184,.07)}
.optimizer-mini-hero img{width:22px;height:22px;min-width:22px;border-radius:5px;object-fit:cover;border:1px solid rgba(255,255,255,.16)}
.optimizer-mini-hero em{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal;font-weight:850;font-size:.50rem;line-height:1;color:#e9f2ff}
.optimizer-recommend-instruction{grid-column:1/-1;margin:0 0 7px;padding:7px 9px;border:1px solid rgba(96,165,250,.22);border-radius:9px;background:rgba(37,99,235,.08);color:#bcd8ef;font-size:.57rem;font-weight:750;line-height:1.35;text-align:center}
.optimizer-recommend-card .ratio{font-size:.78rem!important;margin-bottom:4px!important}
.optimizer-recommend-card .optimizer-joiners{font-size:.55rem!important;line-height:1.16!important;min-height:0!important;margin-bottom:4px!important;padding:3px 4px!important}
.optimizer-recommend-card .score{font-size:.52rem!important}.optimizer-recommend-card .score b{font-size:.59rem!important}.optimizer-apply-hint{font-size:.45rem!important;margin-top:3px!important}
body.light-theme .optimizer-mini-hero{background:#eef3f8!important}body.light-theme .optimizer-mini-hero em{color:#26384c!important}body.light-theme .optimizer-mini-hero img{border-color:#d1dbe5!important}

/* Larger visible toggle labels + proper custom tooltips. */
.command-compact-row{grid-template-columns:minmax(390px,.90fr) minmax(540px,1.30fr)!important}
.command-toggle-row .rail-joiner-opt{height:41px!important;min-height:41px!important;padding:5px 8px!important;overflow:visible!important}
.command-toggle-row .rail-joiner-copy b{font-size:.69rem!important;line-height:1.05!important;white-space:nowrap!important}
.command-control-tip{position:relative!important}
.command-control-tip::before{content:attr(data-command-tip);position:absolute;left:50%;bottom:calc(100% + 9px);transform:translate(-50%,5px);width:300px;max-width:72vw;padding:9px 11px;border-radius:10px;background:rgba(5,12,22,.98);border:1px solid rgba(222,187,112,.30);color:#e7eef7;font-size:.64rem;line-height:1.38;text-align:left;font-weight:650;box-shadow:0 14px 30px rgba(0,0,0,.34);opacity:0;visibility:hidden;pointer-events:none;transition:.15s ease;z-index:10050;text-transform:none;letter-spacing:0}
.command-control-tip::after{content:"";position:absolute;left:50%;bottom:calc(100% + 3px);transform:translateX(-50%);border:6px solid transparent;border-top-color:rgba(222,187,112,.30);opacity:0;visibility:hidden;transition:.15s ease;z-index:10051}
.command-control-tip:hover::before{opacity:1;visibility:visible;transform:translate(-50%,0)}.command-control-tip:hover::after{opacity:1;visibility:visible}
body.light-theme .command-control-tip::before{background:#fffdf9;color:#263547;border-color:#c8a866;box-shadow:0 12px 26px rgba(68,58,43,.18)}body.light-theme .command-control-tip::after{border-top-color:#c8a866}

/* Meta always has a controlled glow; hover intensifies it. */
.command-meta-btn{animation:metaAlwaysGlow 2.25s ease-in-out infinite!important;box-shadow:0 0 0 1px rgba(189,207,255,.18),0 0 18px rgba(91,103,255,.34),0 0 34px rgba(43,151,219,.15),0 10px 22px rgba(0,0,0,.22)!important;transition:transform .18s ease,filter .18s ease,box-shadow .18s ease!important}
.command-meta-btn.meta-running{animation:metaAlwaysGlow 1.55s ease-in-out infinite!important}
.command-meta-btn:hover{transform:translateY(-2px) scale(1.008)!important;filter:brightness(1.12)!important;box-shadow:0 0 0 1px rgba(225,231,255,.34),0 0 27px rgba(102,94,255,.58),0 0 48px rgba(43,175,235,.30),0 13px 28px rgba(0,0,0,.26)!important}
@keyframes metaAlwaysGlow{0%,100%{filter:brightness(1);box-shadow:0 0 0 1px rgba(189,207,255,.16),0 0 16px rgba(91,103,255,.30),0 0 29px rgba(43,151,219,.12),0 10px 22px rgba(0,0,0,.21)}50%{filter:brightness(1.045);box-shadow:0 0 0 1px rgba(213,220,255,.25),0 0 23px rgba(103,95,255,.45),0 0 39px rgba(43,167,229,.21),0 11px 25px rgba(0,0,0,.24)}}

/* Simulation: selector on left, result on right, larger centre label, full-width bar remains underneath. */
.simulation-dock{position:relative!important;padding:6px 14px 5px!important;min-height:54px!important}
.simulation-result-track{height:43px!important}
.simulation-dock-label{left:18px!important;top:50%!important;bottom:auto!important;transform:translateY(-50%)!important;padding:4px 7px!important;font-size:.55rem!important;gap:5px!important;background:rgba(5,12,22,.82)!important}
.simulation-dock-label>span{font-size:.58rem!important;font-weight:850!important}.simulation-dock-label small{font-size:.48rem!important}
.simulation-dock-label .rail-run-select{width:60px!important;height:25px!important;font-size:.62rem!important}
.simulation-clash{width:60px!important;height:60px!important}.simulation-clash .sword-pair{font-size:1.38rem!important}.simulation-clash small{font-size:.60rem!important;font-weight:900!important;letter-spacing:.07em!important}
.simulation-dock-status{position:absolute!important;z-index:8;right:19px!important;top:50%!important;transform:translateY(-50%)!important;display:flex!important;flex-direction:column!important;align-items:flex-end!important;gap:1px!important;margin:0!important;padding:4px 7px!important;border-radius:8px;background:rgba(5,12,22,.78)!important;color:#cbd8e8!important}
.simulation-dock-status .multi-status{font-size:.64rem!important;font-weight:900!important;color:#eef5fd!important}.simulation-dock-status .multi-count{font-size:.49rem!important;color:#8fa5bd!important}
body.light-theme .simulation-dock-label,body.light-theme .simulation-dock-status{background:rgba(255,255,255,.88)!important;color:#31445a!important;border:1px solid rgba(134,153,174,.18)}body.light-theme .simulation-dock-status .multi-status{color:#273b51!important}

/* Custom lance symbol for Lancers. */
.troop-type-icon.lancer{position:relative;display:inline-block!important;width:19px!important;height:19px!important;min-width:19px!important;vertical-align:middle;color:transparent!important}
.troop-type-icon.lancer::before{content:"";position:absolute;left:8px;top:1px;width:2px;height:18px;border-radius:2px;background:linear-gradient(180deg,#d9ecff,#79a9d6 60%,#4c6d8b);transform:rotate(42deg);transform-origin:center;box-shadow:0 0 4px rgba(91,174,255,.28)}
.troop-type-icon.lancer::after{content:"";position:absolute;left:1px;top:0;width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:8px solid #d9ecff;transform:rotate(-48deg);filter:drop-shadow(0 0 2px rgba(87,169,255,.38))}

@media(max-width:980px){
 #battleRail.command-deck .rail-sticky.rail-command-fixed{position:relative!important;left:auto!important;top:auto!important;width:100%!important}
 .command-dial{width:184px!important;height:184px!important;min-width:184px!important;min-height:184px!important}
 .command-compact-row{grid-template-columns:1fr!important}.command-toggle-row .rail-joiner-copy b{font-size:.67rem!important}
}

/* Extracted from battle_simulator.html style block 14: id="v0770-context-layout-polish" */

/* v0.77.0 — spacing, center simulation controls, readable optimizer cards, context-safe Meta */
#battleRail.command-deck{margin-bottom:26px!important}
#battleRail.command-deck .rail-sticky.rail-command-fixed{top:8px!important}
#sidePanels.sim-grid{margin-top:24px!important}

/* Recommendation wings: slightly larger, no clipped hero names. */
.command-suggestions{height:166px!important;min-height:166px!important;max-height:166px!important;padding-top:8px!important;padding-bottom:8px!important}
.suggestion-empty{min-height:148px!important;font-size:.73rem!important}
.optimizer-recommend-card{height:148px!important;padding:7px 8px!important}
.optimizer-mini-heroes{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:4px!important;margin:2px 0 5px!important}
.optimizer-mini-hero{min-width:0!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:flex-start!important;gap:3px!important;padding:3px 2px!important;overflow:visible!important}
.optimizer-mini-hero img{width:27px!important;height:27px!important;min-width:27px!important;border-radius:6px!important}
.optimizer-mini-hero em{display:block!important;width:100%!important;min-width:0!important;overflow:visible!important;text-overflow:clip!important;white-space:normal!important;word-break:normal!important;text-align:center!important;font-size:.53rem!important;line-height:1.05!important;min-height:1.1em!important}
.optimizer-recommend-card .rank{font-size:.82rem!important}
.optimizer-recommend-card .ratio{font-size:.84rem!important}
.optimizer-recommend-card .optimizer-joiners{font-size:.58rem!important;line-height:1.15!important;margin-bottom:4px!important}
.optimizer-recommend-card .score{font-size:.55rem!important}.optimizer-recommend-card .score b{font-size:.62rem!important}.optimizer-apply-hint{font-size:.47rem!important}
/* #1 is physically nearest the central optimizer: attacker cards are rendered in reverse visual order in JS. */

/* Hard circle lock: older light-theme .rail-gen rules cannot stretch the Gen control. */
.command-dial .command-gen,
body.light-theme .command-dial .command-gen{
 position:absolute!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;
 width:70px!important;height:70px!important;min-width:70px!important;min-height:70px!important;
 max-width:70px!important;max-height:70px!important;flex:0 0 70px!important;aspect-ratio:1/1!important;
 border-radius:50%!important;padding:0!important;margin:0!important;overflow:hidden!important;
 box-sizing:border-box!important;
 background:radial-gradient(circle at 38% 28%,#ffe27a 0%,#e0a733 45%,#a56d19 76%,#6d430d 100%)!important;
 border:2px solid #ffe8a8!important;
}
body.light-theme .command-dial .command-gen{border-color:#a36f20!important;box-shadow:0 0 0 4px rgba(255,255,255,.94),0 7px 18px rgba(92,63,22,.23),0 0 18px rgba(210,152,44,.22),inset 0 1px 0 rgba(255,255,255,.54)!important}
.command-dial .command-gen>span{font-size:.46rem!important;line-height:1!important}
.command-dial .command-gen select{position:static!important;display:block!important;width:64px!important;min-width:64px!important;max-width:64px!important;height:26px!important;padding:0!important;margin:0!important;border:0!important;background:transparent!important;text-align:center!important;font-size:.90rem!important;line-height:1!important;appearance:none!important}

/* Wilderness makes joiner search/control visibly inactive. */
.command-toggle-row .rail-joiner-opt.context-disabled{opacity:.54!important;filter:saturate(.45)!important;cursor:not-allowed!important}
.command-toggle-row .rail-joiner-opt.context-disabled .rail-joiner-switch{box-shadow:none!important}
#railBothJoiners:disabled{opacity:.55!important;cursor:not-allowed!important}

/* Simulation selector and result sit immediately beside the centre Simulate button. */
.simulation-dock{padding:7px 14px 6px!important}
.simulation-result-track{position:relative!important;height:54px!important;display:flex!important;align-items:center!important}
.simulation-result-track .multi-bar-wrap{position:absolute!important;left:0!important;right:0!important;top:50%!important;transform:translateY(-50%)!important;width:100%!important;margin:0!important}
.simulation-center-cluster{
 position:absolute!important;z-index:12!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;
 display:grid!important;grid-template-columns:auto 62px auto!important;gap:10px!important;align-items:center!important;
 white-space:nowrap!important;
}
.simulation-run-control,.simulation-inline-result{
 height:31px!important;display:flex!important;align-items:center!important;gap:5px!important;padding:3px 7px!important;
 border-radius:9px!important;background:rgba(5,12,22,.91)!important;border:1px solid rgba(148,163,184,.18)!important;
 box-shadow:0 6px 16px rgba(0,0,0,.24)!important;color:#d9e4f2!important;
}
.simulation-run-control span{font-size:.56rem!important;font-weight:900!important;letter-spacing:.05em!important;text-transform:uppercase!important}
.simulation-run-control .rail-run-select{width:58px!important;height:24px!important;min-height:24px!important;padding:2px 4px!important;font-size:.62rem!important}
.simulation-inline-result{min-width:124px!important;justify-content:flex-start!important;gap:7px!important}
.simulation-inline-result .multi-status{font-size:.66rem!important;font-weight:950!important;color:#f3f7fc!important}
.simulation-inline-result .multi-count{font-size:.52rem!important;color:#aebfd2!important}
.simulation-clash{position:relative!important;left:auto!important;top:auto!important;transform:none!important;width:62px!important;height:62px!important;min-width:62px!important;min-height:62px!important;margin:0!important}
.simulation-clash small{font-size:.62rem!important;font-weight:950!important;letter-spacing:.065em!important}
body.light-theme .simulation-run-control,body.light-theme .simulation-inline-result{background:rgba(255,255,255,.94)!important;border-color:#d1dbe7!important;color:#314156!important;box-shadow:0 5px 14px rgba(64,78,94,.14)!important}
body.light-theme .simulation-inline-result .multi-status{color:#26384b!important}body.light-theme .simulation-inline-result .multi-count{color:#61748a!important}

/* Keep a deliberate visual buffer under the floating command deck. */
#battleRail.command-deck[style*="height"]{margin-bottom:28px!important}

@media(max-width:980px){
 #sidePanels.sim-grid{margin-top:18px!important}
 .simulation-center-cluster{grid-template-columns:auto 58px auto!important;gap:6px!important}
 .simulation-inline-result{min-width:105px!important}
}

/* Extracted from battle_simulator.html style block 15: id="v0771-final-spacing-context-fix" */

/* Keep a visible buffer below the fixed command deck even while page content scrolls underneath it. */
#battleRail.command-deck .rail-sticky.rail-command-fixed{overflow:visible!important}
#battleRail.command-deck .rail-sticky.rail-command-fixed::after{
 content:"";position:absolute;pointer-events:none;left:-1px;right:-1px;height:22px;bottom:-22px;
 background:linear-gradient(180deg,rgba(5,12,22,.98) 0%,rgba(5,12,22,.90) 56%,rgba(5,12,22,0) 100%);
}
body.light-theme #battleRail.command-deck .rail-sticky.rail-command-fixed::after{
 background:linear-gradient(180deg,rgba(246,249,252,.99) 0%,rgba(246,249,252,.92) 56%,rgba(246,249,252,0) 100%);
}
#battleRail.command-deck{margin-bottom:34px!important}

/* The SIMULATE button is mathematically centered. Left/right controls no longer influence its position. */
.simulation-center-cluster{position:absolute!important;inset:0!important;left:0!important;top:0!important;transform:none!important;display:block!important;white-space:nowrap!important;pointer-events:none!important}
.simulation-center-cluster>*{pointer-events:auto!important}
.simulation-clash{position:absolute!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;margin:0!important}
.simulation-run-control{position:absolute!important;right:calc(50% + 42px)!important;top:50%!important;transform:translateY(-50%)!important;margin:0!important}
.simulation-inline-result{position:absolute!important;left:calc(50% + 42px)!important;top:50%!important;transform:translateY(-50%)!important;margin:0!important}

/* Wilderness has a single neutral meta column. */
.wilderness-single-meta{grid-template-columns:minmax(0,760px)!important;justify-content:center!important}
.wilderness-single-meta .meta-modal-section{width:100%!important}
.meta-rich-card.wild{border-color:rgba(218,187,116,.26)!important}
.meta-apply-rich.wild{background:linear-gradient(135deg,rgba(132,96,42,.38),rgba(68,81,109,.34))!important}
body.light-theme .meta-rich-card.wild{border-color:rgba(151,108,48,.22)!important}

@media(max-width:980px){
 #battleRail.command-deck .rail-sticky.rail-command-fixed::after{display:none!important}
 .simulation-run-control{right:calc(50% + 37px)!important}
 .simulation-inline-result{left:calc(50% + 37px)!important}
}

/* Extracted from battle_simulator.html style block 16: id="v0773-true-floating-gap" */

/* v0.77.5 — the fixed clearance looks like ACTUAL page background, not a dark extension of the deck. */
#commandFloatClearance{
  display:none;position:fixed;pointer-events:none;z-index:8999;
  height:30px;overflow:hidden;
  background-color:transparent;
  background-repeat:no-repeat;
  background-position:center center;
  background-size:cover;
  background-attachment:fixed;
  box-shadow:none!important;
}
#commandFloatClearance::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:rgba(2,6,23,.58);
}
#commandFloatClearance.active{display:block}
body.light-theme #commandFloatClearance::after{background:rgba(236,242,247,.22)}
/* Disable every earlier fake/painted gap. */
#battleRail.command-deck .rail-sticky.rail-command-fixed::after{display:none!important}
/* Six feature items: consistent muted-gold icon language. */
.sim-feature-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;max-width:900px!important}
.sim-feature>span,.sim-feature.mode-feature>span{color:#e9c36f!important;text-shadow:0 0 12px rgba(233,195,111,.12)}
body.light-theme .sim-feature>span,body.light-theme .sim-feature.mode-feature>span{color:#a97827!important;text-shadow:none}
.sim-feature.meta-feature>span{color:#ffe28b!important}
body.light-theme .sim-feature.meta-feature>span{color:#9a6b16!important}
@media(max-width:1250px){.sim-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:680px){.sim-feature-grid{grid-template-columns:1fr!important}}

/* Extracted from battle_simulator.html style block 17: id="v0774-native-sticky-fix" */

/* v0.77.5 — native sticky command deck: no JS fixed-mode handoff, no clearance strip. */
#commandFloatClearance{display:none!important}
#battleRail.command-deck{
  position:-webkit-sticky!important;
  position:sticky!important;
  top:8px!important;
  z-index:9000!important;
  height:auto!important;
  margin-bottom:26px!important;
  overflow:visible!important;
}
#battleRail.command-deck .rail-sticky,
#battleRail.command-deck .rail-sticky.rail-command-fixed,
#battleRail.command-deck .rail-sticky.rail-fixed,
#battleRail.command-deck .rail-sticky.rail-bottom{
  position:relative!important;
  left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
  width:100%!important;max-width:none!important;transform:none!important;
  z-index:auto!important;overflow:visible!important;
}
#battleRail.command-deck .rail-sticky::after,
#battleRail.command-deck .rail-sticky.rail-command-fixed::after{display:none!important;content:none!important}
@media(max-width:980px){
  #battleRail.command-deck{position:relative!important;top:auto!important;z-index:auto!important}
}

/* Extracted from battle_simulator.html style block 18: id="v0775-continuous-command-follow" */

/* v0.77.5 — continuous floating command deck.
   The panel never switches positioning modes while scrolling, so it cannot snap. */
#commandFloatClearance{display:none!important}
#battleRail.command-deck{
  position:relative!important;
  top:auto!important;
  z-index:9000!important;
  overflow:visible!important;
  margin-bottom:26px!important;
}
#battleRail.command-deck .rail-sticky.command-following{
  position:fixed!important;
  top:var(--command-follow-top)!important;
  left:var(--command-follow-left)!important;
  width:var(--command-follow-width)!important;
  max-width:none!important;
  right:auto!important;bottom:auto!important;
  transform:none!important;
  z-index:9000!important;
  overflow:visible!important;
}
#battleRail.command-deck .rail-sticky.command-following::after{display:none!important;content:none!important}
@media(max-width:980px){
  #battleRail.command-deck{height:auto!important;margin-bottom:26px!important}
  #battleRail.command-deck .rail-sticky.command-following{
    position:relative!important;left:auto!important;top:auto!important;width:100%!important;
    max-width:none!important;transform:none!important;z-index:auto!important;
  }
}

/* Extracted from battle_simulator.html style block 19: id="v0776-command-slot-height-fix" */

/* Outer rail is the real in-flow placeholder for the continuously floating deck.
   Its explicit JS-calculated height must win over legacy `height:auto!important`. */
#battleRail.command-deck{margin-bottom:30px!important}

/* Extracted from battle_simulator.html style block 20: id="v0778-restored-flow-pin-fix" */

/* v0.77.8 repair: normal flow at load; fixed only after the deck reaches 8px. */
#commandDeckFlowSpacer,#commandFloatClearance{display:none!important}
#battleRail.command-deck{
  position:relative!important;
  top:auto!important;
  z-index:9000!important;
  overflow:visible!important;
  margin-bottom:30px!important;
}
#battleRail.command-deck .rail-sticky:not(.command-pinned){
  position:relative!important;
  left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
  width:100%!important;max-width:none!important;transform:none!important;
  z-index:1!important;
}
#battleRail.command-deck .rail-sticky.command-pinned{
  position:fixed!important;
  top:8px!important;
  left:var(--command-pin-left)!important;
  width:var(--command-pin-width)!important;
  right:auto!important;bottom:auto!important;
  max-width:none!important;transform:none!important;
  z-index:9000!important;
  overflow:visible!important;
}
#sidePanels.sim-grid{margin-top:0!important}
@media(max-width:980px){
  #battleRail.command-deck{height:auto!important;min-height:0!important;margin-bottom:26px!important}
  #battleRail.command-deck .rail-sticky.command-pinned{
    position:relative!important;left:auto!important;top:auto!important;width:100%!important;
    z-index:auto!important;
  }
}

/* Extracted from battle_simulator.html style block 21: id="v0780-meta-diversity" */

/* Community-anchor toggle + Meta family/field presentation */
.command-compact-row{grid-template-columns:minmax(560px,1.05fr) minmax(540px,1fr)!important;width:min(1240px,97%)!important}
.command-toggle-row{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important}
.command-anchor-toggle .rail-joiner-copy b{color:#f2d899!important}
.command-anchor-toggle input:not(:checked) + .rail-joiner-switch{background:linear-gradient(180deg,#3b4657,#293444)!important}
.command-anchor-toggle input:checked + .rail-joiner-switch{background:linear-gradient(180deg,#b98a35,#7c5921)!important;box-shadow:0 0 0 2px rgba(231,191,103,.10),0 0 13px rgba(231,191,103,.12)!important}
body.light-theme .command-anchor-toggle .rail-joiner-copy b{color:#795622!important}

.meta-archetype-tabs{grid-template-columns:repeat(5,minmax(0,1fr))!important}
.meta-archetype-tab.field-tab{border-color:rgba(231,191,103,.18)!important}
.meta-archetype-tab.field-tab.active{background:linear-gradient(135deg,#7c5b24,#7652a9 52%,#2563a5)!important;border-color:rgba(245,214,146,.52)!important;box-shadow:0 8px 22px rgba(118,82,169,.20),0 0 15px rgba(231,191,103,.10)!important}
.meta-archetype-rule.field-rule{border-color:rgba(231,191,103,.22)!important;background:linear-gradient(90deg,rgba(105,78,32,.16),rgba(71,55,112,.17),rgba(15,23,42,.42))!important}
.meta-rich-card.field-dominance{border-color:rgba(231,191,103,.24)!important;box-shadow:0 16px 34px rgba(2,6,23,.18),inset 0 1px 0 rgba(255,233,185,.04)!important}
.meta-rich-card.field-dominance .meta-card-rank{background:linear-gradient(145deg,rgba(133,94,34,.22),rgba(83,59,133,.20))!important;border-color:rgba(231,191,103,.25)!important}
.meta-rich-card.field-dominance .meta-card-rank span{color:#f6dfa7!important}

.meta-leader-family{position:relative;min-width:0}
.meta-leaders.has-variants{cursor:pointer;border-radius:12px;transition:background .15s ease,box-shadow .15s ease}
.meta-leaders.has-variants:hover{background:rgba(125,211,252,.055);box-shadow:0 0 0 1px rgba(125,211,252,.12)}
.meta-variant-trigger{display:block;margin:5px auto 0;padding:4px 9px;border-radius:999px;border:1px solid rgba(125,211,252,.20);background:rgba(14,116,144,.10);color:#b9def6;font-size:.55rem;font-weight:900;cursor:pointer}
.meta-variant-trigger:hover{background:rgba(14,116,144,.18);border-color:rgba(125,211,252,.38)}
.meta-active-variant{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:-3px 0 9px;padding:6px 8px;border-radius:9px;border:1px solid rgba(245,158,11,.24);background:rgba(120,76,16,.15);color:#f6d89d;font-size:.56rem;font-weight:800}
.meta-active-variant button{border:0;background:transparent;color:#fde7b5;font-size:.53rem;text-decoration:underline;cursor:pointer}
.meta-variant-flyout{display:none;position:absolute;z-index:80;top:56px;left:calc(100% + 10px);width:330px;max-height:330px;overflow:auto;padding:10px;border-radius:14px;border:1px solid rgba(125,211,252,.24);background:linear-gradient(160deg,#091321,#111c2d);box-shadow:0 22px 50px rgba(0,0,0,.48),0 0 22px rgba(56,189,248,.10)}
.meta-modal-section.def .meta-variant-flyout{left:auto;right:calc(100% + 10px)}
.meta-rich-card.variants-open .meta-variant-flyout{display:block}
.meta-variant-head{display:grid;gap:2px;margin-bottom:8px}.meta-variant-head b{font-size:.72rem;color:#f8fafc}.meta-variant-head span{font-size:.56rem;color:#8fa2bb}
.meta-variant-option{width:100%;display:grid;grid-template-columns:minmax(0,1fr) 88px;gap:8px;align-items:center;margin-top:6px;padding:7px;border-radius:10px;border:1px solid rgba(148,163,184,.14);background:rgba(15,23,42,.72);color:#e5edf7;cursor:pointer;text-align:left}
.meta-variant-option:hover,.meta-variant-option.selected{border-color:rgba(125,211,252,.42);background:rgba(30,58,91,.62)}
.meta-variant-option.family-best{border-left:3px solid #d8af59}
.meta-variant-heroes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
.meta-variant-hero{min-width:0;text-align:center}.meta-variant-hero img{display:block;width:38px;height:38px;margin:auto;object-fit:cover;border-radius:8px;border:1px solid rgba(148,163,184,.18)}.meta-variant-hero small{display:block;margin-top:2px;white-space:normal;overflow-wrap:anywhere;font-size:.48rem;line-height:1.05;color:#cbd5e1}.meta-variant-hero.changed img{border-color:rgba(245,190,79,.58);box-shadow:0 0 10px rgba(245,190,79,.12)}.meta-variant-hero.changed small{color:#f6d997;font-weight:900}
.meta-variant-metrics{display:grid;gap:2px;text-align:right}.meta-variant-metrics b{font-size:.67rem;color:#fff}.meta-variant-metrics span{font-size:.57rem;color:#bde8ff}.meta-variant-metrics small{font-size:.49rem;color:#91a2b8}.meta-variant-metrics em{font-size:.44rem;line-height:1.1;color:#7f91a9;font-style:normal;white-space:normal}
body.light-theme .meta-variant-flyout{background:linear-gradient(160deg,#fff,#f2f6fb);border-color:#c8d7e7;box-shadow:0 18px 44px rgba(51,65,85,.20)}
body.light-theme .meta-variant-head b{color:#172033}body.light-theme .meta-variant-head span{color:#64748b}body.light-theme .meta-variant-option{background:#fff;color:#243247;border-color:#dbe3ed}body.light-theme .meta-variant-option:hover,body.light-theme .meta-variant-option.selected{background:#eff6ff;border-color:#93c5fd}body.light-theme .meta-variant-hero small{color:#475569}body.light-theme .meta-variant-hero.changed small{color:#8a5d18}
body.light-theme .meta-archetype-tab.field-tab.active{background:linear-gradient(135deg,#9a6c24,#7c58ad 55%,#307ab7)!important}
body.light-theme .meta-archetype-rule.field-rule{background:linear-gradient(90deg,#fff7e6,#f7f1ff,#eff7ff)!important;border-color:#e0c995!important}

@media(max-width:1280px){
 .command-compact-row{grid-template-columns:1fr!important;width:min(980px,97%)!important}
 .command-toggle-row{width:min(760px,100%)!important}
 .meta-variant-flyout,.meta-modal-section.def .meta-variant-flyout{left:50%;right:auto;top:calc(100% + 8px);transform:translateX(-50%);width:min(360px,92vw)}
}
@media(max-width:900px){.meta-archetype-tabs{grid-template-columns:repeat(2,minmax(0,1fr))!important}.command-toggle-row{grid-template-columns:1fr!important}}

/* Extracted from battle_simulator.html style block 22: id="v0781-field-quality-sections" */

/* Two-level Meta dashboard: ranking goal first, formation archetype second. */
.meta-ranking-sections{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0 0 10px}
.meta-ranking-section{position:relative;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto auto;column-gap:10px;align-items:center;min-height:64px;padding:11px 42px 10px 14px;border-radius:15px;border:1px solid rgba(148,163,184,.17);background:linear-gradient(145deg,rgba(15,23,42,.76),rgba(17,29,48,.72));color:#dbe7f5;text-align:left;cursor:pointer;transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease,background .15s ease}
.meta-ranking-section b{font-size:.78rem;font-weight:950;letter-spacing:.02em;color:#f8fafc}.meta-ranking-section small{grid-column:1/2;margin-top:2px;font-size:.55rem;color:#8fa3bc}.meta-ranking-section>span{position:absolute;right:13px;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:22px;height:22px;border-radius:50%;border:1px solid rgba(148,163,184,.25);color:#b7c8dd;font-size:.66rem;font-weight:950}
.meta-ranking-section:hover{transform:translateY(-1px);border-color:rgba(125,211,252,.35);box-shadow:0 8px 24px rgba(2,6,23,.20)}
.meta-ranking-section.active{background:linear-gradient(135deg,rgba(30,64,175,.38),rgba(14,116,144,.22));border-color:rgba(125,211,252,.46);box-shadow:0 8px 24px rgba(14,116,144,.16),inset 0 1px 0 rgba(255,255,255,.04)}
.meta-ranking-section.field.active{background:linear-gradient(135deg,rgba(126,88,32,.35),rgba(91,64,135,.34) 54%,rgba(32,90,137,.30));border-color:rgba(238,203,126,.46);box-shadow:0 8px 24px rgba(91,64,135,.18),0 0 18px rgba(229,190,105,.08)}
.meta-ranking-section.field b{color:#f6dfa7}.meta-ranking-section.field>span{color:#f1d99f;border-color:rgba(231,191,103,.28)}
.meta-archetype-tabs{grid-template-columns:repeat(4,minmax(0,1fr))!important}
.meta-archetype-rule.field-rule{border-color:rgba(231,191,103,.22)!important;background:linear-gradient(90deg,rgba(105,78,32,.14),rgba(71,55,112,.15),rgba(15,23,42,.42))!important}
.meta-field-tier{display:inline-flex;align-items:center;margin-left:5px;padding:2px 5px;border-radius:999px;font-size:.42rem;font-weight:950;letter-spacing:.06em;vertical-align:1px;border:1px solid rgba(148,163,184,.18)}
.meta-field-tier.meta{color:#fde68a;background:rgba(133,77,14,.18);border-color:rgba(245,190,79,.30)}
.meta-field-tier.strong{color:#bae6fd;background:rgba(14,116,144,.16);border-color:rgba(56,189,248,.26)}
.meta-field-tier.field{color:#cbd5e1;background:rgba(71,85,105,.18)}
.meta-rich-card.field-dominance .meta-stat-grid{grid-template-columns:repeat(5,minmax(0,1fr))!important}
body.light-theme .meta-ranking-section{background:linear-gradient(145deg,#fff,#f5f8fc);border-color:#dbe3ed;color:#334155;box-shadow:0 7px 18px rgba(71,85,105,.08)}
body.light-theme .meta-ranking-section b{color:#172033}body.light-theme .meta-ranking-section small{color:#64748b}body.light-theme .meta-ranking-section>span{color:#52677f;border-color:#cbd5e1;background:#fff}
body.light-theme .meta-ranking-section.active{background:linear-gradient(135deg,#eaf2ff,#e9fbff);border-color:#93c5fd}
body.light-theme .meta-ranking-section.field.active{background:linear-gradient(135deg,#fff7e6,#f7f1ff,#eef8ff);border-color:#dec58a;box-shadow:0 8px 22px rgba(91,64,135,.10)}
body.light-theme .meta-ranking-section.field b{color:#7a5622}body.light-theme .meta-field-tier.meta{color:#8a5d18;background:#fff7dc;border-color:#e8c879}body.light-theme .meta-field-tier.strong{color:#075985;background:#e8f8ff;border-color:#a5dcf4}body.light-theme .meta-field-tier.field{color:#475569;background:#f1f5f9;border-color:#dbe3ed}
@media(max-width:760px){ .meta-ranking-sections{grid-template-columns:1fr}.meta-rich-card.field-dominance .meta-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important} }

/* Extracted from battle_simulator.html style block 23: id="v0782-premium-controls-theme-audit" */

/* === v0.78.2 — premium command controls + final dark/light theme audit === */

/* ---------- Premium optimizer switches ---------- */
.command-toggle-row .rail-joiner-opt{
  position:relative!important;isolation:isolate;overflow:hidden!important;
  grid-template-columns:46px minmax(0,1fr)!important;gap:9px!important;
  min-height:44px!important;height:44px!important;padding:6px 10px!important;
  border-radius:13px!important;
  border:1px solid rgba(171,190,214,.18)!important;
  background:
    linear-gradient(180deg,rgba(28,42,64,.94),rgba(11,22,39,.96))!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.055),0 8px 18px rgba(2,6,23,.16)!important;
  transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease,background .16s ease!important;
}
.command-toggle-row .rail-joiner-opt:before{
  content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;opacity:.34;
  background:linear-gradient(105deg,rgba(231,191,103,.11),transparent 35%,rgba(86,181,255,.07));
}
.command-toggle-row .rail-joiner-opt:hover{transform:translateY(-1px)!important;border-color:rgba(231,191,103,.34)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.07),0 11px 24px rgba(2,6,23,.22)!important}
.command-toggle-row .rail-joiner-opt:has(input:focus-visible){outline:2px solid rgba(125,211,252,.46);outline-offset:2px}
.command-toggle-row .rail-joiner-switch{
  direction:ltr!important;position:relative!important;overflow:hidden!important;
  width:44px!important;height:24px!important;border-radius:999px!important;
  background:linear-gradient(180deg,#445166,#2a3547)!important;
  border:1px solid rgba(171,190,214,.23)!important;
  box-shadow:inset 0 2px 5px rgba(0,0,0,.34),0 4px 10px rgba(2,6,23,.16)!important;
}
.command-toggle-row .rail-joiner-switch:before{
  content:"";position:absolute;inset:2px;border-radius:999px;pointer-events:none;
  background:linear-gradient(180deg,rgba(255,255,255,.07),transparent 55%);
}
.command-toggle-row .rail-joiner-switch:after{
  width:18px!important;height:18px!important;left:2px!important;top:2px!important;
  border:1px solid rgba(255,255,255,.55)!important;
  background:linear-gradient(145deg,#f8fbff,#cfd8e5)!important;
  box-shadow:0 2px 7px rgba(0,0,0,.38),inset 0 1px 0 #fff!important;
  transform:translateX(0)!important;
}
/* One physical convention everywhere: OFF = left, ON = right. */
.command-toggle-row .rail-joiner-opt input:not(:checked) + .rail-joiner-switch:after{left:2px!important;transform:translateX(0)!important}
.command-toggle-row .rail-joiner-opt input:checked + .rail-joiner-switch:after{left:2px!important;transform:translateX(20px)!important;background:linear-gradient(145deg,#fff8da,#fff)!important}
.command-toggle-row .rail-joiner-opt input:checked + .rail-joiner-switch{
  background:linear-gradient(135deg,#b98734,#377faf 58%,#275d88)!important;
  border-color:rgba(246,211,132,.48)!important;
  box-shadow:inset 0 1px 2px rgba(255,255,255,.17),0 0 0 2px rgba(231,191,103,.07),0 0 15px rgba(62,151,214,.17)!important;
}
.command-toggle-row .command-leader-toggle:has(input:checked){border-color:rgba(255,155,108,.28)!important;background:linear-gradient(180deg,rgba(55,40,42,.92),rgba(22,24,38,.96))!important}
.command-toggle-row .command-leader-toggle input:checked + .rail-joiner-switch{background:linear-gradient(135deg,#c17b2f,#b84438 60%,#7e2929)!important}
.command-toggle-row .command-joiner-toggle:has(input:checked){border-color:rgba(91,184,255,.30)!important;background:linear-gradient(180deg,rgba(25,43,67,.94),rgba(12,24,43,.96))!important}
.command-toggle-row .command-joiner-toggle input:checked + .rail-joiner-switch{background:linear-gradient(135deg,#ad8537,#328ac2 52%,#245f91)!important}
.command-toggle-row .command-anchor-toggle:has(input:checked){border-color:rgba(231,191,103,.34)!important;background:linear-gradient(180deg,rgba(58,46,29,.93),rgba(25,25,35,.96))!important}
.command-toggle-row .command-anchor-toggle input:not(:checked) + .rail-joiner-switch{background:linear-gradient(180deg,#445166,#2a3547)!important}
.command-toggle-row .command-anchor-toggle input:checked + .rail-joiner-switch{background:linear-gradient(135deg,#d2a24d,#9c7029 58%,#76521e)!important}
.command-toggle-row .rail-joiner-copy{min-width:0!important;justify-content:center!important}
.command-toggle-row .rail-joiner-copy b{display:flex!important;align-items:center!important;gap:7px!important;color:#edf4fb!important;font-family:var(--book-font)!important;font-size:.68rem!important;letter-spacing:.01em!important}
.command-toggle-row .rail-joiner-copy b:after{
  content:"OFF";display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:16px;padding:0 5px;border-radius:999px;
  border:1px solid rgba(148,163,184,.20);background:rgba(71,85,105,.28);color:#9eafc3;font-family:var(--ui-font);font-size:.42rem;font-weight:950;letter-spacing:.07em
}
.command-toggle-row .rail-joiner-opt:has(input:checked) .rail-joiner-copy b:after{content:"ON";border-color:rgba(246,211,132,.26);background:rgba(231,191,103,.13);color:#f6d998}
.command-toggle-row .command-anchor-toggle .rail-joiner-copy b{color:#f2d899!important}

/* ---------- Both Armies control bank ---------- */
.command-armies{
  position:relative!important;isolation:isolate!important;overflow:hidden!important;
  grid-template-columns:96px minmax(0,1fr)!important;gap:10px!important;
  min-height:50px!important;padding:6px 8px!important;border-radius:13px!important;
  border:1px solid rgba(231,191,103,.20)!important;
  background:linear-gradient(180deg,rgba(25,38,58,.95),rgba(10,21,37,.97))!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.055),0 8px 18px rgba(2,6,23,.15)!important;
}
.command-armies:before{content:"";position:absolute;inset:0;z-index:-1;background:radial-gradient(circle at 12% 0%,rgba(231,191,103,.11),transparent 34%),radial-gradient(circle at 92% 100%,rgba(63,156,255,.08),transparent 34%)}
.command-armies .rail-global-title{display:flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;margin:0!important;color:#ead9b6!important;font-family:var(--book-font)!important;font-size:.59rem!important;line-height:1.05!important;letter-spacing:.045em!important;text-transform:uppercase!important;text-align:center!important}
.command-armies-mark{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;border:1px solid rgba(231,191,103,.30);background:rgba(231,191,103,.08);color:#f2d58f;font-size:.82rem;box-shadow:inset 0 1px 0 rgba(255,255,255,.05)}
.command-army-fields{display:grid!important;grid-template-columns:88px 88px 92px minmax(116px,1fr) 76px!important;gap:6px!important;align-items:stretch!important;justify-content:stretch!important}
.command-army-fields .command-army-control{position:relative!important;display:grid!important;grid-template-rows:11px 1fr!important;gap:2px!important;padding:3px 5px 4px!important;border-radius:9px!important;border:1px solid rgba(148,163,184,.12)!important;background:rgba(4,12,24,.31)!important;min-width:0!important}
.command-army-fields .command-army-control>span{display:block!important;color:#899bb0!important;font-size:.43rem!important;line-height:1!important;font-weight:900!important;letter-spacing:.075em!important;text-transform:uppercase!important;text-align:left!important}
.command-army-fields select{
  width:100%!important;height:25px!important;min-height:25px!important;padding:2px 22px 2px 6px!important;
  border-radius:7px!important;border:1px solid rgba(171,190,214,.20)!important;
  background:linear-gradient(180deg,#122238,#0b1729)!important;color:#edf5ff!important;
  box-shadow:inset 0 1px 3px rgba(0,0,0,.30)!important;font-size:.61rem!important;font-weight:850!important;cursor:pointer!important
}
.command-army-fields select:hover,.command-army-fields select:focus{border-color:rgba(231,191,103,.46)!important;outline:none!important}
.command-army-fields .rail-global-btn{display:flex!important;align-items:center!important;justify-content:center!important;gap:5px!important;height:auto!important;min-height:36px!important;border-radius:9px!important;font-family:var(--book-font)!important;font-size:.50rem!important;letter-spacing:.02em!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 5px 12px rgba(2,6,23,.13)!important;transition:transform .15s ease,filter .15s ease,box-shadow .15s ease!important}
.command-army-fields .rail-global-btn:hover{transform:translateY(-1px)!important;filter:brightness(1.08)!important}
.command-army-fields .rail-global-btn.max{border-color:rgba(231,191,103,.34)!important;background:linear-gradient(135deg,rgba(111,82,30,.68),rgba(41,89,73,.58))!important;color:#fae7b0!important}
.command-army-fields .rail-global-btn.reset{border-color:rgba(160,178,201,.18)!important;background:linear-gradient(180deg,rgba(55,68,86,.66),rgba(31,41,55,.72))!important;color:#cbd6e5!important}
.command-army-action-icon{font-size:.70rem;line-height:1}

/* ---------- Final LIGHT theme audit: common page surfaces ---------- */
body.light-theme{--theme-ink:#172436;--theme-muted:#617185;--theme-line:#d6e0ea;--theme-card:#ffffff;--theme-soft:#f5f8fb}
body.light-theme .army-panel,body.light-theme .battle-panel{background:rgba(250,252,254,.96)!important;color:#172436!important;border-color:#d6e0ea!important}
body.light-theme .troop-card,body.light-theme .hero-card,body.light-theme .joiner-card,body.light-theme .result-card{background:rgba(255,255,255,.94)!important;color:#172436!important;border-color:#d8e1ea!important;box-shadow:0 7px 18px rgba(38,54,73,.045)!important}
body.light-theme .section-title{color:#765524!important}
body.light-theme .army-chapter h2{color:#27384d!important;text-shadow:none!important}body.light-theme .army-chapter.att h2,body.light-theme .army-chapter.att small{color:#9d302b!important}body.light-theme .army-chapter.def h2,body.light-theme .army-chapter.def small{color:#245e9f!important}
body.light-theme .chapter-seal{background:radial-gradient(circle,#fff7e6,#e7edf4 72%)!important;color:#8b6220!important;border-color:#d3b778!important;box-shadow:0 0 0 4px rgba(145,111,47,.05)!important}
body.light-theme .troop-head,body.light-theme .ratio-label{color:#25364a!important}
body.light-theme .slot-type,body.light-theme .gear-stat,body.light-theme .loadout-note,body.light-theme .dynamic-collapsed-note{color:#617185!important}

/* Dynamic loadout: every interactive surface receives an explicit light state. */
body.light-theme .hero-progression{background:linear-gradient(180deg,#fbfdff,#f3f7fb)!important;border-color:#ccd9e5!important;color:#172436!important}
body.light-theme .star-up-btn,body.light-theme .star-max-btn{background:linear-gradient(180deg,#fff,#edf4fa)!important;color:#23405e!important;border-color:#b8ccde!important;box-shadow:0 4px 11px rgba(44,67,91,.07)!important}
body.light-theme .star-up-btn{background:linear-gradient(180deg,#eef9ff,#e4f1f8)!important;border-color:#9ccde4!important}
body.light-theme .dynamic-loadout{background:linear-gradient(180deg,#fbfdff,#f4f8fb)!important;border-color:#cbd9e5!important;color:#172436!important;box-shadow:0 10px 24px rgba(52,71,91,.06)!important}
body.light-theme .dynamic-tabs{background:#edf3f8!important;border-color:#d4dee8!important}
body.light-theme .dynamic-tab{background:#fff!important;color:#4b5d70!important;border-color:#d2dce6!important;box-shadow:0 3px 8px rgba(49,65,84,.04)!important}
body.light-theme .dynamic-tab.active{background:linear-gradient(135deg,#277cc3,#255fc0)!important;color:#fff!important;border-color:#549cda!important;box-shadow:0 5px 15px rgba(37,95,192,.18)!important}
body.light-theme .dynamic-toolbar{background:linear-gradient(180deg,#f7fafc,#eef4f8)!important;border-color:#d4dee8!important}
body.light-theme .dynamic-tool-btn{background:#fff!important;color:#2b435b!important;border-color:#c6d4e0!important;box-shadow:0 4px 10px rgba(50,68,88,.05)!important}
body.light-theme .dynamic-tool-btn.max{background:linear-gradient(135deg,#fff8e8,#eef8f2)!important;color:#765417!important;border-color:#d7bc78!important}
body.light-theme .gear-slot-card,body.light-theme .hero-gear-piece{background:linear-gradient(180deg,#fff,#f8fafc)!important;color:#172436!important;border-color:#d5e0e9!important;box-shadow:0 6px 14px rgba(51,69,89,.045)!important}
body.light-theme .gear-slot-title{color:#1b2b3e!important}body.light-theme .gear-tier{color:#245eb4!important}body.light-theme .gear-slot-icon{background:linear-gradient(145deg,#f4f8fc,#e5edf5)!important;box-shadow:inset 0 0 0 1px #d5e0ea!important}
body.light-theme .hero-gear-center{background:radial-gradient(circle at 50% 30%,#eaf7ff,#f8fbfd 70%)!important;color:#2f4358!important;border-color:#c7dce8!important}
body.light-theme .hero-gear-piece select,body.light-theme .hero-widget-corner select,body.light-theme .piece-controls select,body.light-theme .dynamic-content select,body.light-theme .dynamic-content input{background:#fff!important;color:#172436!important;border-color:#c8d5e0!important}
body.light-theme .piece-reset-btn,body.light-theme .subtle-reset{background:#f5f8fb!important;color:#4d6074!important;border-color:#cbd6e0!important}
body.light-theme .widget-box-v4{color:#1b2b3e!important;border-color:#c9dde8!important}body.light-theme .widget-current-stats{color:#43566b!important}body.light-theme .widget-current-stats b{color:#08778b!important}
body.light-theme .loadout-total{background:#eefaf5!important;color:#31465a!important;border-color:#bde2ce!important}body.light-theme .loadout-total strong{color:#087447!important}
body.light-theme .loadout-dialog{background:linear-gradient(180deg,#fff,#f5f9fc)!important;color:#172436!important;border-color:#a9c9e0!important;box-shadow:0 28px 80px rgba(62,79,98,.20)!important}
body.light-theme .loadout-dialog-head h3{color:#17638c!important}body.light-theme .modal-close{background:#fff!important;color:#22354a!important;border-color:#c7d3df!important}
body.light-theme .gear-choice,body.light-theme .charm-node{background:#fff!important;color:#172436!important;border-color:#ccd8e2!important}body.light-theme .gear-choice small{color:#66768a!important}body.light-theme .gear-choice.selected{background:#ecf8f4!important;border-color:#4fb79f!important;outline-color:#4fb79f!important}
body.light-theme .none-choice-icon{background:#f0f4f8!important;color:#67788a!important;border-color:#aebdcb!important}

/* Formation / ratio late !important rules were overriding older light rules. */
body.light-theme .ratio-wrap{background:linear-gradient(155deg,#fbfdff,#eef4f8)!important;border-color:#cad8e4!important;box-shadow:0 13px 30px rgba(49,66,84,.07),inset 0 1px 0 #fff!important}
body.light-theme .ratio-control{background:linear-gradient(180deg,#fff,#f7fafc)!important;border-color:#d8e2ea!important;box-shadow:0 6px 15px rgba(49,66,84,.05)!important}
body.light-theme .ratio-label{color:#23374b!important}body.light-theme .ratio-step{background:#f3f7fa!important;color:#31465b!important;border-color:#cbd7e2!important}body.light-theme .ratio-value{background:#fff!important;color:#23364b!important;border-color:#cbd7e2!important}
body.light-theme .ratio-preset{background:linear-gradient(180deg,#fff,#f5f8fb)!important;color:#33475c!important;border-color:#ccd8e3!important}body.light-theme .ratio-preset:hover{background:#eef6ff!important;color:#163d68!important;border-color:#8dbce2!important}
body.light-theme .formation-stack{background:#dbe4ec!important;border-color:#becbd7!important;box-shadow:inset 0 2px 5px rgba(59,76,95,.15)!important}

/* Command deck final light states. */
body.light-theme .command-deck .rail-sticky{background:linear-gradient(180deg,rgba(255,255,255,.975),rgba(243,247,251,.975))!important;border-color:#d2bc8d!important;box-shadow:0 18px 44px rgba(63,75,90,.16),inset 0 1px 0 #fff!important}
body.light-theme .command-context .battle-context-btn{background:#f5f8fb!important;color:#55687d!important;border-color:#d3dde6!important}body.light-theme .command-context .battle-context-btn.active{background:linear-gradient(180deg,#9b7331,#695022)!important;color:#fff2c9!important;border-color:#a8803d!important}
body.light-theme .command-suggestions{background:linear-gradient(180deg,#f8fafc,#eef3f7)!important;border-color:#d7e1ea!important;box-shadow:inset 0 1px 0 #fff!important}body.light-theme .suggestion-empty{color:#66788b!important}
body.light-theme .optimizer-recommend-card{background:#fff!important;color:#22364a!important;border-color:#d5e0e9!important}body.light-theme .optimizer-recommend-card:hover{background:#f3f8fd!important;border-color:#91b9d9!important}
body.light-theme .optimizer-recommend-card .score{color:#5e7185!important}body.light-theme .optimizer-recommend-card .score b{color:#23384d!important}body.light-theme .optimizer-apply-hint{color:#61758a!important}
body.light-theme .command-toggle-row .rail-joiner-opt{background:linear-gradient(180deg,#fff,#f3f7fa)!important;border-color:#d4dee7!important;box-shadow:inset 0 1px 0 #fff,0 7px 16px rgba(62,79,98,.07)!important}body.light-theme .command-toggle-row .rail-joiner-opt:before{opacity:.20}
body.light-theme .command-toggle-row .rail-joiner-copy b{color:#26394d!important}body.light-theme .command-toggle-row .command-anchor-toggle .rail-joiner-copy b{color:#795622!important}
body.light-theme .command-toggle-row .rail-joiner-copy b:after{background:#eef2f6;color:#6b7a8a;border-color:#d4dde6}body.light-theme .command-toggle-row .rail-joiner-opt:has(input:checked) .rail-joiner-copy b:after{background:#fff4d9;color:#795622;border-color:#dec486}
body.light-theme .command-toggle-row .command-leader-toggle:has(input:checked){background:linear-gradient(180deg,#fff7f3,#f9f4f3)!important;border-color:#e7b5a5!important}body.light-theme .command-toggle-row .command-joiner-toggle:has(input:checked){background:linear-gradient(180deg,#f2f9ff,#eef5fa)!important;border-color:#a8cce4!important}body.light-theme .command-toggle-row .command-anchor-toggle:has(input:checked){background:linear-gradient(180deg,#fff9eb,#f9f6ee)!important;border-color:#ddc585!important}
body.light-theme .command-armies{background:linear-gradient(180deg,#fff,#f2f6f9)!important;border-color:#d5c08f!important;box-shadow:inset 0 1px 0 #fff,0 7px 16px rgba(62,79,98,.07)!important}body.light-theme .command-armies:before{opacity:.35}
body.light-theme .command-armies .rail-global-title{color:#6e542a!important}body.light-theme .command-armies-mark{background:#fff7e5;color:#79591f;border-color:#d7bd7d}
body.light-theme .command-army-fields .command-army-control{background:#f8fafc!important;border-color:#dbe3ea!important}body.light-theme .command-army-fields .command-army-control>span{color:#6a7b8c!important}body.light-theme .command-army-fields select{background:linear-gradient(180deg,#fff,#f5f8fb)!important;color:#26394e!important;border-color:#cbd7e2!important;box-shadow:inset 0 1px 2px rgba(47,64,83,.05)!important}
body.light-theme .command-army-fields .rail-global-btn.max{background:linear-gradient(135deg,#fff8e7,#eaf7ef)!important;color:#6d4d16!important;border-color:#d7ba71!important}body.light-theme .command-army-fields .rail-global-btn.reset{background:linear-gradient(180deg,#f6f8fa,#e9eef3)!important;color:#4c6074!important;border-color:#cbd6df!important}
body.light-theme .command-speed-tooltip{background:#fffdf8!important;color:#25384c!important;border-color:#cfb779!important;box-shadow:0 14px 28px rgba(62,79,98,.17)!important}body.light-theme .command-speed-tooltip b{color:#75551b!important}body.light-theme .command-speed-tooltip span{color:#245f92!important}body.light-theme .command-speed-tooltip small{color:#627487!important}
body.light-theme .command-progress .optimizer-progress-track{background:#dfe7ee!important}
body.light-theme .simulation-dock{background:linear-gradient(180deg,rgba(239,244,248,.55),rgba(225,233,240,.94))!important;border-top-color:#d6c18e!important}body.light-theme .simulation-result-track .multi-bar{border-color:#cbb67f!important;box-shadow:inset 0 2px 6px rgba(66,82,99,.15)!important}
body.light-theme .simulation-dock-label,body.light-theme .simulation-dock-status{background:rgba(255,255,255,.92)!important;color:#33495f!important;border-color:#d3dde7!important}body.light-theme .simulation-dock-status .multi-status{color:#263a4e!important}body.light-theme .simulation-dock-status .multi-count{color:#66798c!important}body.light-theme .rail-run-select{background:#fff!important;color:#26394c!important;border-color:#c8d4df!important}

/* Meta dashboard / matchup window: explicit light surfaces all the way down. */
body.light-theme .global-meta-modal{background:rgba(48,60,75,.38)!important}
body.light-theme .global-meta-dialog{background:linear-gradient(160deg,#fff,#f5f8fb)!important;border-color:#cfc7e5!important;box-shadow:0 30px 90px rgba(66,78,95,.23)!important}
body.light-theme .global-meta-modal-head{background:linear-gradient(90deg,#fbf7ff,#eef7fc,#f3f6ff)!important;border-color:#d9e1ea!important}body.light-theme .meta-kicker{color:#6942a1!important}body.light-theme .global-meta-modal-head h2{color:#1c2c40!important}body.light-theme .global-meta-modal-head p{color:#5b6d81!important}body.light-theme .global-meta-close{background:#fff!important;color:#2d4054!important;border-color:#cbd6df!important;box-shadow:0 4px 10px rgba(56,72,91,.06)!important}
body.light-theme .meta-ranking-section{background:linear-gradient(145deg,#fff,#f4f7fa)!important;border-color:#d8e1e9!important;color:#33485d!important}body.light-theme .meta-ranking-section b{color:#1d2e42!important}body.light-theme .meta-ranking-section small{color:#68798c!important}body.light-theme .meta-ranking-section>span{background:#fff!important;color:#566a7e!important;border-color:#cbd7e2!important}
body.light-theme .meta-archetype-tabs{background:#edf2f6!important;border-color:#d6e0e8!important}body.light-theme .meta-archetype-tab{background:#fff!important;color:#33485d!important;border-color:#d8e1e9!important}body.light-theme .meta-archetype-tab small{color:#697b8e!important}body.light-theme .meta-archetype-tab.active{background:linear-gradient(135deg,#4f46e5,#0b91c6)!important;color:#fff!important;border-color:#83bada!important}body.light-theme .meta-archetype-tab.active small{color:#edf8ff!important}
body.light-theme .meta-archetype-rule{background:linear-gradient(90deg,#f8fafc,#eef5fb)!important;border-color:#d7e1e9!important}body.light-theme .meta-archetype-rule b{color:#203247!important}body.light-theme .meta-archetype-rule span{color:#5e7084!important}
body.light-theme .meta-modal-section-head p{color:#607286!important}body.light-theme .meta-rich-card{background:linear-gradient(160deg,#fff,#f7f9fb)!important;color:#203247!important;border-color:#dbe3eb!important;box-shadow:0 12px 28px rgba(58,74,92,.08)!important}body.light-theme .meta-rich-card:before{background:linear-gradient(180deg,rgba(255,255,255,.75),rgba(255,255,255,0) 32%)!important}
body.light-theme .meta-card-rank{background:linear-gradient(145deg,#f2edff,#eef6ff)!important;border-color:#d6cfee!important}body.light-theme .meta-card-rank span{color:#5b3f98!important}body.light-theme .meta-card-rank small{color:#63778c!important}
body.light-theme .meta-leader b{color:#273a4f!important}body.light-theme .meta-leader-img-wrap img{border-color:#d4dce5!important;box-shadow:0 4px 12px rgba(57,73,91,.12)!important}body.light-theme .meta-leader-img-wrap span{background:#fff!important;color:#344a61!important;border-color:#cbd6e0!important}
body.light-theme .meta-formation,body.light-theme .meta-stat-cell,body.light-theme .meta-hardest-rich{background:linear-gradient(180deg,#f8fafc,#eef3f7)!important;border-color:#dfe6ed!important}body.light-theme .meta-formation span,body.light-theme .meta-block-label,body.light-theme .meta-stat-cell small,body.light-theme .meta-hardest-rich span{color:#617488!important}body.light-theme .meta-formation b,body.light-theme .meta-stat-cell b,body.light-theme .meta-hardest-rich b{color:#203247!important}body.light-theme .meta-formation small,body.light-theme .meta-hardest-rich small{color:#617488!important}
body.light-theme .meta-breakdown-btn{background:linear-gradient(135deg,#eef7ff,#e5f0fb)!important;color:#245e9c!important;border-color:#91b9dc!important}body.light-theme .meta-apply-rich.att{background:linear-gradient(135deg,#b83f39,#d65b42)!important;color:#fff!important}body.light-theme .meta-apply-rich.def{background:linear-gradient(135deg,#2b67b4,#288cbf)!important;color:#fff!important}body.light-theme .meta-apply-rich.wild{background:linear-gradient(135deg,#8f6b2f,#65738d)!important;color:#fff!important}
body.light-theme .meta-variant-trigger{background:#eef8fd!important;color:#24617f!important;border-color:#b9d7e6!important}body.light-theme .meta-active-variant{background:#fff7e7!important;color:#78571e!important;border-color:#dec17a!important}body.light-theme .meta-active-variant button{color:#6e4d17!important}
body.light-theme .meta-variant-flyout{background:linear-gradient(160deg,#fff,#f3f7fa)!important;color:#25394d!important;border-color:#c9d8e5!important}body.light-theme .meta-variant-option{background:#fff!important;color:#263a4f!important;border-color:#d9e2ea!important}body.light-theme .meta-variant-option:hover,body.light-theme .meta-variant-option.selected{background:#edf6fd!important;border-color:#8ebada!important}body.light-theme .meta-variant-metrics b{color:#203247!important}body.light-theme .meta-variant-metrics span{color:#1d6d99!important}body.light-theme .meta-variant-metrics small,body.light-theme .meta-variant-metrics em{color:#66798d!important}
body.light-theme .meta-matchup-modal{background:rgba(53,64,78,.36)!important}body.light-theme .meta-matchup-dialog{background:linear-gradient(180deg,#fff,#f5f8fa)!important;color:#213448!important;border-color:#d2dce5!important}body.light-theme .meta-matchup-head{background:linear-gradient(90deg,#eef7ff,#faf5ff)!important;border-color:#dce4eb!important}body.light-theme .meta-matchup-head h3{color:#1d2f43!important}body.light-theme .meta-matchup-head p{color:#5f7185!important}body.light-theme .meta-matchup-close{background:#fff!important;color:#26394e!important;border-color:#cbd6e1!important}
body.light-theme .meta-matchup-pill,body.light-theme .meta-matchup-row{background:#fff!important;color:#26394e!important;border-color:#dce4eb!important}body.light-theme .meta-matchup-row.head{background:#eaf4fc!important;border-color:#b9d5e8!important}body.light-theme .meta-matchup-cell{color:#26394e!important}body.light-theme .meta-matchup-cell b{color:#1f3145!important}body.light-theme .meta-matchup-cell small,body.light-theme .meta-matchup-opponent .opp-sub{color:#617488!important}

/* Miscellaneous late surfaces / tooltips / battle details. */
body.light-theme .battle-core-side{background:#f7fafc!important;color:#26394e!important;border-color:#dce4eb!important}body.light-theme .remaining-bar{background:#dfe6ed!important}body.light-theme .details-toggle{background:#e9eef3!important;color:#33495f!important;border-color:#cbd6e0!important}
body.light-theme .round-log{background:#fff!important;color:#25384c!important;border-color:#d6e0e9!important}body.light-theme .round-item{border-bottom-color:#e5ebf0!important}
body.light-theme .ui-tip[data-tip]:hover::after,body.light-theme .ui-tip[data-tip]:focus-visible::after,body.light-theme .command-control-tip::before{background:#fffdf9!important;color:#27394c!important;border-color:#ccb374!important;box-shadow:0 14px 30px rgba(59,72,89,.16)!important}
body.light-theme .theme-toggle{background:rgba(255,255,255,.94)!important;color:#31445a!important;border-color:#d1b978!important;box-shadow:0 8px 22px rgba(54,67,82,.12)!important}

/* Explicit dark contrast guardrails for text that previously inherited unpredictably. */
body:not(.light-theme) .dynamic-toolbar,body:not(.light-theme) .dynamic-content,body:not(.light-theme) .loadout-dialog{color:#e7eef7}
body:not(.light-theme) .meta-rich-card,body:not(.light-theme) .meta-matchup-dialog,body:not(.light-theme) .command-armies,body:not(.light-theme) .command-toggle-row .rail-joiner-opt{color:#e5edf7}

@media(max-width:1280px){.command-armies{grid-template-columns:92px minmax(0,1fr)!important}.command-army-fields{grid-template-columns:82px 82px 86px minmax(112px,1fr) 72px!important}}
@media(max-width:980px){.command-armies{grid-template-columns:1fr!important}.command-armies .rail-global-title{justify-content:center!important;margin-bottom:4px!important}.command-army-fields{grid-template-columns:repeat(3,minmax(88px,1fr))!important}.command-army-fields .rail-global-btn{min-height:38px!important}}
@media(max-width:720px){.command-toggle-row{grid-template-columns:1fr!important}.command-army-fields{grid-template-columns:repeat(2,minmax(92px,1fr))!important}.command-army-fields .rail-global-btn.max{grid-column:1/2}.command-army-fields .rail-global-btn.reset{grid-column:2/3}}

/* Extracted from battle_simulator.html style block 24: id="v0784-functional-theme-fixes" */

/* v0.78.4 — functional fixes only. Meta window visuals remain the v0.78.2 design. */

/* Body-level tooltips: preserve the clipping fix without changing the old Meta layout. */
.ui-tip[data-tip]::before,.ui-tip[data-tip]::after,.command-control-tip::before,.command-control-tip::after{display:none!important;content:none!important}
.premium-tooltip-portal{position:fixed;z-index:500000;left:12px;top:12px;width:max-content;max-width:min(360px,calc(100vw - 24px));padding:11px 13px;border-radius:12px;border:1px solid rgba(213,184,119,.36);background:linear-gradient(180deg,rgba(7,15,27,.985),rgba(18,30,47,.985));color:#edf4fc;font-family:var(--ui-font);font-size:.76rem;font-weight:700;line-height:1.4;text-align:left;box-shadow:0 18px 44px rgba(0,0,0,.42);opacity:0;visibility:hidden;transform:translateY(3px);pointer-events:none;transition:opacity .11s ease,transform .11s ease,visibility .11s ease}
.premium-tooltip-portal.show{opacity:1;visibility:visible;transform:translateY(0)}
body.light-theme .premium-tooltip-portal{background:linear-gradient(180deg,#fffefb,#f7fafc);color:#25384c;border-color:#cbb171;box-shadow:0 16px 36px rgba(55,70,88,.18)}

/* Switch ON/OFF stays inside the track, so labels cannot spill outside their control. */
.command-toggle-row .rail-joiner-opt{grid-template-columns:56px minmax(0,1fr)!important;overflow:hidden!important}
.command-toggle-row .rail-joiner-switch{width:54px!important;height:26px!important;overflow:hidden!important}
.command-toggle-row .rail-joiner-switch:before{content:"OFF"!important;inset:0!important;display:flex!important;align-items:center!important;justify-content:flex-end!important;padding:0 6px!important;background:none!important;color:#aebdcd!important;font-size:.40rem!important;font-weight:1000!important;letter-spacing:.06em!important;line-height:1!important}
.command-toggle-row .rail-joiner-opt input:checked + .rail-joiner-switch:before{content:"ON"!important;justify-content:flex-start!important;color:#fff0bd!important}
.command-toggle-row .rail-joiner-switch:after{width:20px!important;height:20px!important;left:2px!important;top:2px!important}
.command-toggle-row .rail-joiner-opt input:checked + .rail-joiner-switch:after{transform:translateX(28px)!important}
.command-toggle-row .rail-joiner-copy b:after{display:none!important;content:none!important}

/* Native select popup theme. Chromium/Windows may otherwise open a white option list
   even when the closed control is dark. color-scheme + explicit option colors fixes both layers. */
body:not(.light-theme) select{color-scheme:dark!important}
body:not(.light-theme) select option,body:not(.light-theme) select optgroup{background-color:#0b1625!important;color:#edf4fc!important}
body.light-theme select{color-scheme:light!important}
body.light-theme select option,body.light-theme select optgroup{background-color:#ffffff!important;color:#25384c!important}

/* Both Armies gets an explicit final cascade guard so Tier / FC / Joiners never inherit
   a later light surface while the page is in dark mode. */
body:not(.light-theme) .command-army-fields select{background:#081426!important;color:#eef4fb!important;border-color:rgba(148,163,184,.24)!important;-webkit-text-fill-color:#eef4fb!important}
body:not(.light-theme) .command-army-fields select option,body:not(.light-theme) .command-army-fields select optgroup{background:#081426!important;color:#eef4fb!important;-webkit-text-fill-color:#eef4fb!important}
body.light-theme .command-army-fields select{color-scheme:light!important;-webkit-text-fill-color:#26394e!important}

/* Extracted from battle_simulator.html style block 25: id="v0785-comprehensive-ui-theme-fix" */

/* ============================================================
   v0.78.6 — targeted UI repair / readability pass
   ============================================================ */

/* One tooltip system only. Legacy pseudo-tooltips caused duplicate overlays. */
.ui-tip[data-tip]::before,.ui-tip[data-tip]::after,
.skill-event[data-tip]::before,.skill-event[data-tip]::after,
.command-control-tip::before,.command-control-tip::after,
[data-command-tip]::before,[data-command-tip]::after{display:none!important;content:none!important}

/* Context selector — richer, legible in both themes. */
.command-context{gap:10px!important;padding:7px!important;border-radius:16px!important;background:linear-gradient(180deg,rgba(11,21,35,.78),rgba(5,13,24,.90))!important;border:1px solid rgba(148,163,184,.16)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.04)!important}
.command-context .battle-context-btn{min-height:48px!important;padding:7px 14px!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:10px!important;border-radius:12px!important;border:1px solid transparent!important;background:rgba(16,29,47,.62)!important;color:#aebdd0!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.025)!important;transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease,background .15s ease!important}
.command-context .battle-context-btn:hover{transform:translateY(-1px)!important;border-color:rgba(125,211,252,.28)!important;color:#eef6ff!important}
.context-mode-icon{display:grid!important;place-items:center!important;width:31px!important;height:31px!important;border-radius:10px!important;background:rgba(255,255,255,.055)!important;font-size:1rem!important}
.context-mode-copy{display:grid!important;text-align:left!important;line-height:1.05!important}
.context-mode-copy b{font-size:.78rem!important;color:inherit!important;letter-spacing:.025em!important}
.context-mode-copy small{margin-top:4px!important;font-size:.55rem!important;font-weight:750!important;color:#7f91a7!important;letter-spacing:.045em!important;text-transform:uppercase!important}
.command-context .battle-context-btn.active{background:linear-gradient(135deg,rgba(37,99,235,.31),rgba(14,116,144,.23))!important;border-color:rgba(125,211,252,.50)!important;color:#f4f9ff!important;box-shadow:0 6px 18px rgba(14,116,144,.14),inset 0 1px 0 rgba(255,255,255,.08)!important}
.command-context .battle-context-btn.active .context-mode-icon{background:linear-gradient(135deg,rgba(59,130,246,.32),rgba(14,165,233,.22))!important;color:#dff5ff!important;box-shadow:0 0 14px rgba(56,189,248,.14)!important}
.command-context .battle-context-btn.active .context-mode-copy small{color:#b6ddf3!important}
.context-hidden{display:none!important}
body.light-theme .command-context{background:linear-gradient(180deg,#f4f8fb,#eaf1f6)!important;border-color:#cedae4!important;box-shadow:inset 0 1px 0 #fff!important}
body.light-theme .command-context .battle-context-btn{background:#fff!important;color:#53677b!important;border-color:#d5e0e8!important;box-shadow:0 3px 9px rgba(53,70,89,.04)!important}
body.light-theme .command-context .battle-context-btn .context-mode-icon{background:#eef4f8!important;color:#587086!important}
body.light-theme .command-context .battle-context-btn .context-mode-copy small{color:#77899b!important}
body.light-theme .command-context .battle-context-btn.active{background:linear-gradient(135deg,#e8f3ff,#eafafc)!important;color:#153b5c!important;border-color:#7fb7dc!important;box-shadow:0 6px 16px rgba(40,105,151,.10)!important}
body.light-theme .command-context .battle-context-btn.active .context-mode-icon{background:linear-gradient(135deg,#d8ebff,#d8f5f7)!important;color:#176491!important}
body.light-theme .command-context .battle-context-btn.active .context-mode-copy small{color:#397895!important}

/* All three search toggles use one visual language and one ON/OFF direction. */
.command-toggle-row .rail-joiner-opt{border-color:rgba(148,163,184,.18)!important;background:linear-gradient(180deg,rgba(16,29,47,.72),rgba(8,18,31,.84))!important}
.command-toggle-row .rail-joiner-opt:has(input:checked){border-color:rgba(56,189,248,.42)!important;background:linear-gradient(135deg,rgba(14,116,144,.20),rgba(37,99,235,.16))!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.045),0 5px 16px rgba(14,116,144,.08)!important}
.command-toggle-row .rail-joiner-opt input:checked + .rail-joiner-switch{background:linear-gradient(90deg,#0e7490,#2563eb)!important;border-color:#5fc8e9!important;box-shadow:0 0 0 1px rgba(56,189,248,.12),0 0 14px rgba(37,99,235,.16)!important}
.command-toggle-row .rail-joiner-opt input:checked + .rail-joiner-switch:after{background:#f5fbff!important;border-color:#bfeaff!important}
body.light-theme .command-toggle-row .rail-joiner-opt{background:linear-gradient(180deg,#fff,#f6f9fb)!important;border-color:#d2dde6!important;color:#32485e!important}
body.light-theme .command-toggle-row .rail-joiner-opt:has(input:checked){background:linear-gradient(135deg,#eaf7fb,#edf3ff)!important;border-color:#8fc4d9!important}

/* Ratio identity: Infantry green, Lancers blue, Marksmen red. */
.formation-seg.inf{background:linear-gradient(90deg,#16a34a,#4ade80)!important}
.formation-seg.lancer{background:linear-gradient(90deg,#2563eb,#60a5fa)!important}
.formation-seg.marksman{background:linear-gradient(90deg,#dc2626,#fb7185)!important}
.ratio-control.inf{--ratio-color:#22c55e!important}.ratio-control.lancer{--ratio-color:#3b82f6!important}.ratio-control.marksman{--ratio-color:#ef4444!important}
.ratio-control.inf .ratio-slider{--ratio-color:#22c55e!important}.ratio-control.lancer .ratio-slider{--ratio-color:#3b82f6!important}.ratio-control.marksman .ratio-slider{--ratio-color:#ef4444!important}
.troop-type-icon.inf{background:rgba(34,197,94,.14)!important;color:#6ee7a0!important;border-color:rgba(34,197,94,.34)!important}
.troop-type-icon.lancer{background:rgba(59,130,246,.14)!important;color:#85b5ff!important;border-color:rgba(59,130,246,.34)!important}
.troop-type-icon.marksman{background:rgba(239,68,68,.14)!important;color:#ff8b85!important;border-color:rgba(239,68,68,.34)!important}
body.light-theme .troop-type-icon.inf{background:#e9f9ef!important;color:#16833d!important;border-color:#a9dfba!important}
body.light-theme .troop-type-icon.lancer{background:#edf4ff!important;color:#245da7!important;border-color:#b6cef0!important}
body.light-theme .troop-type-icon.marksman{background:#fff0ef!important;color:#b82d28!important;border-color:#efbbb8!important}

/* Ratio slider handle is now a vertical measurer, not a gold ball. */
.ratio-slider::-webkit-slider-thumb{-webkit-appearance:none!important;appearance:none!important;width:6px!important;height:24px!important;border-radius:3px!important;background:#f7fbff!important;border:1px solid rgba(15,23,42,.40)!important;box-shadow:0 1px 5px rgba(0,0,0,.42),0 0 0 2px color-mix(in srgb,var(--ratio-color) 35%,transparent)!important;cursor:pointer!important}
.ratio-slider::-webkit-slider-thumb:hover,.ratio-slider::-webkit-slider-thumb:active{transform:none!important;cursor:pointer!important}
.ratio-slider::-moz-range-thumb{width:5px!important;height:22px!important;border-radius:3px!important;background:#f7fbff!important;border:1px solid rgba(15,23,42,.40)!important;box-shadow:0 1px 5px rgba(0,0,0,.38)!important;cursor:pointer!important}
body.light-theme .ratio-slider::-webkit-slider-thumb,body.light-theme .ratio-slider::-moz-range-thumb{background:#26384b!important;border-color:#fff!important}

/* Count / Ratio and formation controls remain readable in both themes. */
.formation-mode-toggle{background:rgba(7,16,28,.78)!important;border-color:rgba(148,163,184,.18)!important}
.formation-mode-toggle button{color:#9fb0c3!important;background:transparent!important}
.formation-mode-toggle button.active{background:linear-gradient(135deg,#1f5d8f,#2459b5)!important;color:#fff!important;box-shadow:0 3px 10px rgba(30,93,143,.18)!important}
body.light-theme .formation-mode-toggle{background:#edf3f7!important;border-color:#ccd8e2!important}
body.light-theme .formation-mode-toggle button{color:#53677c!important;background:transparent!important}
body.light-theme .formation-mode-toggle button.active{background:linear-gradient(135deg,#2d7fba,#356ac3)!important;color:#fff!important;border-color:#6ca5d1!important}
body.light-theme .ratio-step,body.light-theme .ratio-value,body.light-theme .ratio-preset{background:#fff!important;color:#263a4e!important;border-color:#cbd8e3!important;box-shadow:0 3px 8px rgba(48,65,84,.04)!important}
body.light-theme .ratio-preset:hover{background:#edf6fc!important;color:#174f76!important;border-color:#8db7d2!important}

/* Base Stats + Smart Screenshot — complete light-theme audit. */
body.light-theme .v61-base-panel{color:#172b40!important}
body.light-theme .v60-panel-head h3,body.light-theme .v61-base-section-head b,body.light-theme .v61-resolved-wrap>div:first-child>b{color:#172b40!important}
body.light-theme .v60-panel-head p,body.light-theme .v61-base-section-head small,body.light-theme .v61-resolved-wrap>div:first-child small{color:#65798d!important}
body.light-theme .v61-base-mode{background:linear-gradient(180deg,#fff,#f6f9fb)!important;color:#24394e!important;border-color:#d2dce5!important}
body.light-theme .v61-base-mode b{color:#1d3349!important}.v61-base-mode small{line-height:1.35!important}
body.light-theme .v61-base-stat-card{background:linear-gradient(145deg,#fff,#f5f9fc)!important;color:#21374d!important;border-color:#d4e0e9!important}
body.light-theme .v61-base-stat-card h4{color:#1a3148!important}
body.light-theme .v61-base-field{background:#f4f8fb!important;color:#23384d!important;border-color:#d4dee7!important}
body.light-theme .v61-base-field>span{color:#33495f!important}
body.light-theme .v61-base-field input,body.light-theme .v61-base-field input[readonly]{background:#fff!important;color:#1b3046!important;border-color:#c9d6e1!important;-webkit-text-fill-color:#1b3046!important}
body.light-theme .v61-base-live{color:#1775a8!important}.v61-base-live{white-space:nowrap!important}
body.light-theme .v61-resolved-wrap{background:linear-gradient(145deg,#f8fbfd,#eef5f9)!important;border-color:#9db3c6!important;color:#1b3045!important}
body.light-theme .v61-resolved-card{background:#fff!important;color:#253b51!important;border:1px solid #d9e3eb!important;box-shadow:0 3px 8px rgba(52,72,92,.04)!important}
body.light-theme .v61-resolved-card b{color:#20364c!important}
body.light-theme .v61-resolved-card span{color:#1672a4!important;font-weight:750!important}
body.light-theme .v61-base-subtabs{background:#eef4f8!important;border-color:#d5e0e8!important}
body.light-theme .v61-base-subtab{color:#52677c!important;background:#fff!important;border-color:#d6e0e8!important}
body.light-theme .v61-base-subtab.active{background:#e5f2fb!important;color:#175b86!important;border-color:#8bbbd7!important}
.v62-base-import{overflow:hidden!important}
body.light-theme .v62-base-import{background:linear-gradient(145deg,#f5fbff,#edf5fa)!important;border-color:#9ec7dd!important;box-shadow:0 8px 20px rgba(53,91,116,.07)!important}
body.light-theme .v62-base-import-copy b{color:#19344c!important}
body.light-theme .v62-base-import-copy small{color:#526f85!important}
body.light-theme .v62-base-import-copy small b{color:#7b5a18!important}
body.light-theme .v62-base-upload-btn{background:linear-gradient(135deg,#267cae,#3167b6)!important;color:#fff!important;border-color:#639dc6!important;box-shadow:0 6px 15px rgba(39,106,154,.14)!important}
body.light-theme .v62-base-upload-btn span{color:#fff!important}.v62-base-import-status{overflow-wrap:anywhere!important}
body.light-theme .v62-base-import-status{color:#14678f!important}.v62-base-import-status.error{color:#dc2626!important}

/* Calculated Base Stats panels (Chief Gear / Charms / Island / Pets / Experts). */
body.light-theme .v60-photo-panel,body.light-theme .v60-island-grid section,body.light-theme .v60-special-summary{background:linear-gradient(145deg,#fff,#f4f8fb)!important;border-color:#d3dfe8!important;color:#20364c!important}
body.light-theme .v60-island-grid section h4,body.light-theme .v60-expert-gareth b{color:#20364c!important}
body.light-theme .v60-stat-row{background:#f6f9fb!important;border-bottom-color:#e0e7ed!important}
body.light-theme .v60-stat-row:nth-child(4n+1),body.light-theme .v60-stat-row:nth-child(4n+2){background:#eef5fa!important}
body.light-theme .v60-stat-row span{color:#324a60!important}
body.light-theme .v60-stat-row input{background:#fff!important;color:#20354a!important;border-color:#c8d5df!important;-webkit-text-fill-color:#20354a!important}
body.light-theme .v60-stat-row b{color:#176f9e!important}
body.light-theme .v60-source-note{background:#edf3f7!important;color:#60758a!important;border:1px solid #d8e1e8!important}
body.light-theme .v60-expert-gareth{background:#f6fafc!important;color:#24394e!important;border-color:#bcd8d3!important}

/* Hero Gear headings, controls, mastery menu. */
body.light-theme .v60-panel-head h3,body.light-theme .hero-gear-center b,body.light-theme .hero-gear-piece .field>span,body.light-theme .piece-controls .field>span{color:#20354a!important}
body.light-theme .piece-controls>.field>select,body.light-theme .hero-gear-mastery-btn{background:#fff!important;color:#20354a!important;border-color:#c7d5df!important;-webkit-text-fill-color:#20354a!important}
body.light-theme .piece-controls>.field>select:hover,body.light-theme .piece-controls>.field>select:focus,body.light-theme .hero-gear-mastery-btn:hover,body.light-theme .hero-gear-mastery-btn.open{background:#f7fafc!important;color:#172c41!important;border-color:#8fb1c8!important}
body.light-theme .hero-gear-mastery-btn .mastery-chevron{color:#435d74!important}
body.light-theme .hero-gear-mastery-menu{background:#fff!important;border-color:#c9a953!important;box-shadow:0 18px 42px rgba(50,65,82,.18)!important}
body.light-theme .hero-gear-mastery-menu button{background:#f5f8fb!important;color:#2b435a!important;border-color:#d5dfe7!important}
body.light-theme .hero-gear-mastery-menu button:hover{background:#eaf3f9!important;border-color:#8eb4cd!important}
body.light-theme .hero-gear-mastery-menu button.active{background:linear-gradient(135deg,#f5be42,#ffd76b)!important;color:#3b2a08!important;border-color:#d7a92f!important}

/* Specials configurator: no dark islands inside light theme. */
body.light-theme .v60-special-modal{color:#21374d!important}
body.light-theme .v60-special-section{background:#fff!important;color:#21374d!important;border-color:#d1dde6!important}
body.light-theme .v60-special-section h3{color:#1d3349!important}
body.light-theme .v60-special-section>p{color:#61768a!important}
body.light-theme .v60-event-choice{background:#f6f9fb!important;color:#22384e!important;border-color:#d4dfe8!important}
body.light-theme .v60-event-choice.selected{background:#fff9e9!important;border-color:#d4aa3d!important;box-shadow:0 0 0 2px rgba(212,170,61,.08)!important}
body.light-theme .v60-event-choice b{color:#21364b!important}.v60-event-choice small{line-height:1.3!important}
body.light-theme .v60-event-choice small{color:#667a8e!important}
body.light-theme .v60-none-icon{background:#e9f0f5!important;color:#40576d!important}
body.light-theme .v60-special-card{background:#f6f9fb!important;color:#21364b!important;border-color:#d5e0e8!important}
body.light-theme .v60-special-card b{color:#21364b!important}.v60-special-card small{line-height:1.28!important}
body.light-theme .v60-special-card small{color:#65798d!important}
body.light-theme .v60-special-card strong{color:#176f9f!important}
body.light-theme .v60-special-card select{background:#fff!important;color:#20364b!important;border-color:#c7d5df!important;-webkit-text-fill-color:#20364b!important}
body.light-theme .v60-special-summary>div{background:#fff!important;border:1px solid #dae3ea!important}
body.light-theme .v60-special-summary span{color:#63778b!important}.v60-special-summary b{overflow-wrap:anywhere!important}
body.light-theme .v60-special-summary b{color:#21364b!important}
body.light-theme .loadout-dialog:has(.v60-special-modal){background:linear-gradient(180deg,#fff,#f5f8fa)!important;color:#20364b!important}

/* Meta window — preserve familiar layout but remove clutter and increase header polish. */
.global-meta-head{padding:20px 22px 18px!important;background:linear-gradient(105deg,rgba(20,42,70,.96),rgba(29,27,69,.95) 52%,rgba(15,70,82,.92))!important;border-bottom:1px solid rgba(148,163,184,.17)!important;box-shadow:0 10px 24px rgba(0,0,0,.12)!important}
.global-meta-title-wrap{display:grid!important;gap:3px!important}.meta-kicker{letter-spacing:.19em!important;font-size:.64rem!important;font-weight:950!important;color:#9fd9ff!important;text-shadow:0 0 14px rgba(56,189,248,.16)!important}
.global-meta-head h2{margin:0!important;color:#f7fbff!important;font-size:1.62rem!important;letter-spacing:.01em!important}.global-meta-head p{margin:4px 0 0!important;color:#bdcad8!important;font-size:.78rem!important;font-weight:700!important}
.global-meta-body{padding-top:20px!important}.meta-modal-overview{display:none!important}
.meta-ranking-sections{margin-bottom:10px!important}.meta-ranking-section{cursor:pointer!important}.meta-ranking-section>span{display:none!important}
.meta-ranking-explanation{margin:0 0 15px!important;padding:12px 15px!important;border-radius:13px!important;background:linear-gradient(135deg,rgba(14,116,144,.10),rgba(37,99,235,.08))!important;border:1px solid rgba(125,211,252,.20)!important;color:#dbe9f5!important;font-size:.86rem!important;font-weight:700!important;line-height:1.48!important}
.meta-ranking-explanation.field{background:linear-gradient(135deg,rgba(161,98,7,.12),rgba(88,28,135,.08))!important;border-color:rgba(231,191,103,.24)!important;color:#eee5d2!important}
.meta-modal-section-head p{display:none!important}.meta-modal-section-head{align-items:center!important;padding-bottom:11px!important;margin-bottom:12px!important}.meta-modal-section-head h3{margin-top:3px!important}
.meta-stat-grid{grid-template-columns:repeat(auto-fit,minmax(115px,1fr))!important}
.meta-rich-card.wild,.meta-modal-section.wild{color:#eaf2fa!important}.meta-modal-section.wild .meta-modal-section-head>div>span{color:#efd48e!important}.meta-modal-section.wild .meta-modal-section-head h3{color:#f4f8fd!important}.meta-rich-card.wild .meta-card-rank span{color:#fff1b5!important}.meta-rich-card.wild .meta-card-rank small{color:#e6ce91!important}.meta-apply-rich.wild{color:#fff6df!important;background:linear-gradient(135deg,#8a642a,#53627e)!important;border-color:#d9bb71!important;text-shadow:0 1px 1px rgba(0,0,0,.30)!important}
.meta-matchup-row{grid-template-columns:54px minmax(220px,1.6fr) 120px 150px 150px!important}
.meta-variant-flyout,.meta-modal-section.def .meta-variant-flyout{left:50%!important;right:auto!important;top:calc(100% + 8px)!important;transform:translateX(-50%)!important;width:min(390px,calc(100vw - 72px))!important;max-height:min(410px,62vh)!important;z-index:1000!important}
.meta-rich-card{overflow:visible!important}.meta-card-list,.meta-modal-section{overflow:visible!important}
body.light-theme .global-meta-head{background:linear-gradient(105deg,#eef7ff,#f4f0ff 52%,#edfafa)!important;border-bottom-color:#d4dee8!important;box-shadow:0 8px 20px rgba(61,78,96,.08)!important}
body.light-theme .meta-kicker{color:#17688f!important;text-shadow:none!important}.light-theme .global-meta-head h2{color:#1c3045!important}.light-theme .global-meta-head p{color:#5c7186!important}
body.light-theme .meta-ranking-explanation{background:linear-gradient(135deg,#eef8fc,#eef4ff)!important;border-color:#b7d5e5!important;color:#29465e!important}
body.light-theme .meta-ranking-explanation.field{background:linear-gradient(135deg,#fff9ec,#f8f4ff)!important;border-color:#dcc88f!important;color:#594a2d!important}
body.light-theme .meta-modal-section.wild .meta-modal-section-head>div>span{color:#7a5b20!important}.light-theme .meta-modal-section.wild .meta-modal-section-head h3{color:#20364c!important}.light-theme .meta-rich-card.wild .meta-card-rank span{color:#6d4b0c!important}.light-theme .meta-rich-card.wild .meta-card-rank small{color:#80642c!important}.light-theme .meta-apply-rich.wild{color:#fff!important;background:linear-gradient(135deg,#9b742d,#60738c)!important}
body.light-theme .meta-rich-card.field-dominance .meta-card-rank span{color:#6f4b0e!important}.light-theme .meta-rich-card.field-dominance .meta-card-rank small{color:#7b602b!important}

/* Optimizer controls — clearer intent even before results exist. */
.command-opt-half{position:relative!important;overflow:hidden!important;transition:transform .16s ease,filter .16s ease,box-shadow .16s ease!important}
.command-opt-half:after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(115deg,transparent 20%,rgba(255,255,255,.11) 45%,transparent 68%);transform:translateX(-110%);transition:transform .32s ease}
.command-opt-half:hover:after{transform:translateX(110%)}.command-opt-half:hover{transform:translateY(-1px)!important;filter:brightness(1.09)!important}
.command-opt-half.att{box-shadow:inset 0 0 0 1px rgba(248,113,113,.12)!important}.command-opt-half.def{box-shadow:inset 0 0 0 1px rgba(96,165,250,.14)!important}
.command-opt-label{font-weight:950!important;letter-spacing:.04em!important}
.suggestion-empty.premium-empty{min-height:70px!important;display:grid!important;grid-template-columns:36px 1fr 22px!important;align-items:center!important;gap:9px!important;padding:10px 12px!important;border-radius:14px!important;border:1px dashed rgba(148,163,184,.22)!important;background:linear-gradient(145deg,rgba(17,30,48,.64),rgba(7,16,28,.52))!important;color:#d7e2ee!important;text-align:left!important}
.suggestion-empty-icon{display:grid!important;place-items:center!important;width:34px!important;height:34px!important;border-radius:11px!important;background:rgba(255,255,255,.055)!important;font-size:1rem!important}.suggestion-empty-copy{display:grid!important;gap:3px!important}.suggestion-empty-copy b{font-size:.68rem!important;color:#e7f0f9!important}.suggestion-empty-copy small{font-size:.55rem!important;line-height:1.25!important;color:#8093a8!important}.suggestion-empty-arrow{font-size:1.05rem!important;color:#60778f!important}
body.light-theme .suggestion-empty.premium-empty{background:linear-gradient(145deg,#fff,#f2f6f9)!important;border-color:#ccd9e3!important;color:#2d4359!important}.light-theme .suggestion-empty-icon{background:#eaf1f6!important}.light-theme .suggestion-empty-copy b{color:#2a4056!important}.light-theme .suggestion-empty-copy small{color:#718398!important}.light-theme .suggestion-empty-arrow{color:#6c8399!important}

/* Simulation controls: keep their horizontal alignment but place them below the red/blue bar. */
.simulation-result-track{height:92px!important;align-items:flex-start!important}
.simulation-result-track .multi-bar-wrap{top:31px!important;transform:translateY(-50%)!important}
.simulation-clash{top:31px!important}
.simulation-run-control{right:calc(50% + 42px)!important;top:59px!important;transform:none!important}
.simulation-inline-result{left:calc(50% + 42px)!important;top:59px!important;transform:none!important}
@media(max-width:980px){.simulation-run-control{right:calc(50% + 37px)!important}.simulation-inline-result{left:calc(50% + 37px)!important}}

/* Skill proc chips: one tooltip + clear separation between name and activation count. */
.skill-event-copy{display:inline-flex!important;align-items:center!important;gap:7px!important;min-width:0!important}.skill-event-copy b{display:inline-block!important;margin:0!important}.skill-event-count{display:inline-flex!important;align-items:center!important;margin:0!important;padding:2px 6px!important;border-radius:999px!important;background:rgba(56,189,248,.12)!important;border:1px solid rgba(56,189,248,.20)!important;color:#bcecff!important;font-size:.62rem!important;font-weight:900!important;white-space:nowrap!important}
body.light-theme .skill-event-count{background:#e9f6fc!important;border-color:#b9dceb!important;color:#1a698f!important}

/* Native dropdowns: final explicit guard, including opened Windows/Chromium option lists. */
body:not(.light-theme) select{color-scheme:dark!important;background-color:#081426!important;color:#eef4fb!important;-webkit-text-fill-color:#eef4fb!important}
body:not(.light-theme) select option,body:not(.light-theme) select optgroup{background-color:#081426!important;color:#eef4fb!important;-webkit-text-fill-color:#eef4fb!important}
body.light-theme select{color-scheme:light!important;background-color:#fff!important;color:#25384c!important;-webkit-text-fill-color:#25384c!important}
body.light-theme select option,body.light-theme select optgroup{background-color:#fff!important;color:#25384c!important;-webkit-text-fill-color:#25384c!important}

/* Extracted from battle_simulator.html style block 26: id="v0786-targeted-ui-repairs" */

/* v0.78.6 — targeted UI repairs only. No combat formula/mechanics rules live here. */

/* Formation identity: both stacked bars and sliders use the same colors. */
.formation-seg.inf{background:linear-gradient(90deg,#15803d,#4ade80)!important}
.formation-seg.lancer{background:linear-gradient(90deg,#1d4ed8,#60a5fa)!important}
.formation-seg.marksman{background:linear-gradient(90deg,#b91c1c,#fb7185)!important}
.ratio-control.inf .ratio-slider{background:linear-gradient(90deg,#22c55e 0 var(--fill,0%),#202c3c var(--fill,0%) 100%)!important}
.ratio-control.lancer .ratio-slider{background:linear-gradient(90deg,#3b82f6 0 var(--fill,0%),#202c3c var(--fill,0%) 100%)!important}
.ratio-control.marksman .ratio-slider{background:linear-gradient(90deg,#ef4444 0 var(--fill,0%),#202c3c var(--fill,0%) 100%)!important}
body.light-theme .ratio-control.inf .ratio-slider{background:linear-gradient(90deg,#22c55e 0 var(--fill,0%),#dbe4ee var(--fill,0%) 100%)!important}
body.light-theme .ratio-control.lancer .ratio-slider{background:linear-gradient(90deg,#3b82f6 0 var(--fill,0%),#dbe4ee var(--fill,0%) 100%)!important}
body.light-theme .ratio-control.marksman .ratio-slider{background:linear-gradient(90deg,#ef4444 0 var(--fill,0%),#dbe4ee var(--fill,0%) 100%)!important}
/* Keep the vertical measurer, but restore a normal hand/grab cursor. */
.ratio-slider{cursor:grab!important}.ratio-slider:active{cursor:grabbing!important}
.ratio-slider::-webkit-slider-thumb{cursor:grab!important}.ratio-slider::-webkit-slider-thumb:active{cursor:grabbing!important}
.ratio-slider::-moz-range-thumb{cursor:grab!important}.ratio-slider:active::-moz-range-thumb{cursor:grabbing!important}

/* Meta modal: repair compact card render and header close-button placement. */
.global-meta-head{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:18px!important;position:relative!important}
body.has-omni-global-topbar .global-meta-modal{inset:calc(var(--omni-topbar-actual-h,var(--omni-topbar-h,76px)) + 8px) 0 0!important;padding:14px 22px 22px!important}
body.has-omni-global-topbar .global-meta-dialog{max-height:calc(100vh - var(--omni-topbar-actual-h,var(--omni-topbar-h,76px)) - 30px)!important}
.global-meta-title-wrap{flex:1 1 auto!important;min-width:0!important}
.global-meta-close{position:relative!important;top:0!important;right:0!important;flex:0 0 40px!important;width:40px!important;height:40px!important;display:grid!important;place-items:center!important;margin:0!important;line-height:1!important}
.global-meta-body{overflow:auto!important;padding:20px 20px 24px!important}
.meta-leaders{min-width:0!important}.meta-leader{min-width:0!important}
.meta-leader-img-wrap,.meta-leader-img-wrap img{width:58px!important;height:58px!important;max-width:58px!important;max-height:58px!important}
.meta-joiner-chip img{width:26px!important;height:26px!important;max-width:26px!important;max-height:26px!important}

/* Optimizer: restore proper circular half-button geometry, then make it visibly interactive. */
.command-opt-half{position:absolute!important;isolation:isolate!important;overflow:hidden!important;box-shadow:inset 0 0 0 1px rgba(255,255,255,.08),0 0 18px rgba(0,0,0,.14)!important}
.command-opt-half.att{left:0!important;right:auto!important}
.command-opt-half.def{left:50%!important;right:auto!important}
.command-opt-half::after{content:""!important;position:absolute!important;z-index:0!important;inset:-20%!important;pointer-events:none!important;opacity:.34!important;background:linear-gradient(120deg,transparent 32%,rgba(255,255,255,.24) 48%,transparent 64%)!important;transform:translateX(-125%)!important;animation:optimizerButtonSweep 3.8s ease-in-out infinite!important}
.command-opt-half.def::after{animation-delay:1.9s!important}
.command-opt-half .command-opt-icon,.command-opt-half .command-opt-label{position:relative!important;z-index:2!important}
.command-opt-half.att{box-shadow:inset 0 0 22px rgba(255,90,70,.20),0 0 15px rgba(239,68,68,.12)!important}
.command-opt-half.def{box-shadow:inset 0 0 22px rgba(84,168,255,.20),0 0 15px rgba(59,130,246,.12)!important}
.command-opt-half:hover{filter:brightness(1.17)!important;transform:none!important}
.command-opt-half:hover .command-opt-icon{transform:scale(1.10)!important}
@keyframes optimizerButtonSweep{0%,42%{transform:translateX(-125%)}63%,100%{transform:translateX(125%)}}

/* Empty optimizer sides: no extra visible container. The existing arrow-shaped side itself carries a directional glow toward Optimize. */
.suggestion-empty.premium-empty{position:relative!important;min-height:180px!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:11px!important;padding:18px 34px!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;overflow:hidden!important;text-align:center!important}
.suggestion-empty.premium-empty::before{content:"";position:absolute;inset:8% 4%;pointer-events:none;opacity:.70;filter:blur(7px);animation:emptyOptimizerPulse 2.1s ease-in-out infinite alternate}
.suggestion-empty.premium-empty.att::before{background:linear-gradient(90deg,transparent 5%,rgba(239,68,68,.10) 44%,rgba(248,113,113,.34) 82%,transparent 100%)}
.suggestion-empty.premium-empty.def::before{background:linear-gradient(270deg,transparent 5%,rgba(59,130,246,.10) 44%,rgba(96,165,250,.34) 82%,transparent 100%)}
.suggestion-empty-icon,.suggestion-empty-copy,.suggestion-empty-arrow{position:relative;z-index:1}
.suggestion-empty-icon{width:auto!important;height:auto!important;background:transparent!important;font-size:1.18rem!important;opacity:.78}
.suggestion-empty-copy{display:grid!important;gap:4px!important;max-width:280px}
.suggestion-empty-copy b{font-size:.78rem!important;color:#e7eef8!important}.suggestion-empty-copy small{font-size:.58rem!important;line-height:1.35!important;color:#8ea0b4!important}
.suggestion-empty-arrow{font-size:1.28rem!important;color:#b8c8d9!important;animation:emptyArrowNudge 1.15s ease-in-out infinite alternate}
.suggestion-empty.premium-empty.def .suggestion-empty-arrow{animation-name:emptyArrowNudgeBack}
@keyframes emptyOptimizerPulse{from{opacity:.36}to{opacity:.86}}
@keyframes emptyArrowNudge{from{transform:translateX(-3px);opacity:.50}to{transform:translateX(4px);opacity:1}}
@keyframes emptyArrowNudgeBack{from{transform:translateX(3px);opacity:.50}to{transform:translateX(-4px);opacity:1}}
body.light-theme .suggestion-empty.premium-empty{background:transparent!important;border:0!important;box-shadow:none!important}
body.light-theme .suggestion-empty-copy b{color:#263b50!important}body.light-theme .suggestion-empty-copy small{color:#6d8195!important}body.light-theme .suggestion-empty-arrow{color:#526c84!important}

/* Matchup values are percentages of the original army, not raw 0–1 fractions. */
.meta-matchup-row{grid-template-columns:54px minmax(220px,1.5fr) 120px 140px 140px!important}

/* Extracted from battle_simulator.html style block 27: id="v0787-ui-polish" */

/* v0.78.7 — UI-only polish. Combat formulas/mechanics are untouched. */

/* Variants: anchor the flyout to the exact leader/variant control area, not the card bottom. */
.meta-leader-family{position:relative!important;overflow:visible!important}
.meta-leader-family .meta-variant-flyout,
.meta-modal-section.def .meta-leader-family .meta-variant-flyout{
  left:50%!important;right:auto!important;top:calc(100% + 7px)!important;
  transform:translateX(-50%)!important;width:min(390px,calc(100vw - 72px))!important;
  max-height:min(410px,62vh)!important;z-index:2500!important
}
@media(max-width:760px){.meta-leader-family .meta-variant-flyout{width:min(350px,calc(100vw - 36px))!important}}

/* Empty optimizer wings: fill the entire arrow wing with directional light and use larger guidance. */
.suggestion-empty.premium-empty{min-height:166px!important;padding:16px 34px!important;gap:14px!important}
.suggestion-empty.premium-empty::before{inset:0!important;opacity:.92!important;filter:blur(9px)!important}
.suggestion-empty.premium-empty.att::before{background:linear-gradient(90deg,rgba(88,12,17,.10) 0%,rgba(185,28,28,.20) 28%,rgba(248,113,113,.40) 76%,rgba(255,120,97,.18) 100%)!important}
.suggestion-empty.premium-empty.def::before{background:linear-gradient(270deg,rgba(18,48,105,.10) 0%,rgba(37,99,235,.22) 28%,rgba(96,165,250,.42) 76%,rgba(56,189,248,.18) 100%)!important}
.suggestion-empty-icon{font-size:1.42rem!important;opacity:.9!important}
.suggestion-empty-copy{max-width:360px!important;gap:5px!important}
.suggestion-empty-copy b{font-size:.96rem!important;line-height:1.12!important}
.suggestion-empty-copy small{font-size:.70rem!important;line-height:1.38!important}
.suggestion-empty-arrow{font-size:1.5rem!important}

/* Recommendation cards: one step larger without changing the three-card layout. */
.command-suggestions{height:188px!important;min-height:188px!important;max-height:188px!important}
.optimizer-recommend-card{height:170px!important;padding:9px 10px!important;border-radius:11px!important}
.optimizer-mini-heroes{gap:5px!important;margin:3px 0 6px!important}
.optimizer-mini-hero{padding:4px 3px!important;gap:4px!important}
.optimizer-mini-hero img{width:32px!important;height:32px!important;min-width:32px!important}
.optimizer-mini-hero em{font-size:.59rem!important;line-height:1.08!important}
.optimizer-recommend-card .rank{font-size:.90rem!important}
.optimizer-recommend-card .optimizer-mode-badge{font-size:.50rem!important}
.optimizer-recommend-card .ratio{font-size:.90rem!important}
.optimizer-recommend-card .optimizer-joiners{font-size:.61rem!important;line-height:1.18!important}
.optimizer-recommend-card .score{font-size:.58rem!important}.optimizer-recommend-card .score b{font-size:.67rem!important}
.optimizer-apply-hint{font-size:.50rem!important}

/* Generation control: high-contrast dark ink on warm gold rather than white-on-gold. */
.command-gen{background:radial-gradient(circle at 42% 30%,#ffe49b,#d9a733 58%,#8b5a12 100%)!important;border-color:#fff0b9!important}
.command-gen select{color:#3f2907!important;-webkit-text-fill-color:#3f2907!important;font-weight:1000!important;text-shadow:0 1px rgba(255,255,255,.24)!important}
.command-gen select option{background:#fff5d4!important;color:#3f2907!important;-webkit-text-fill-color:#3f2907!important}
body.light-theme .command-gen{background:radial-gradient(circle at 42% 30%,#fff0bd,#e2b341 60%,#a66c0c 100%)!important}
body.light-theme .command-gen select{color:#3a2506!important;-webkit-text-fill-color:#3a2506!important}

/* Both Armies primary action: clearer wording and a slightly stronger premium treatment. */
.command-army-fields .rail-global-btn.max{background:linear-gradient(135deg,#9a6818,#d2a132 55%,#f1c961)!important;color:#231707!important;border-color:#f4d88f!important;box-shadow:0 5px 16px rgba(154,104,24,.20),inset 0 1px rgba(255,255,255,.25)!important;font-weight:950!important}
.command-army-fields .rail-global-btn.max:hover{filter:brightness(1.06)!important;transform:translateY(-1px)!important}

/* New generated frozen-fortress plate: keep UI readability first. */
.bg-media{filter:saturate(.90) contrast(1.04)!important;object-position:center center!important}
.bg-overlay{background:linear-gradient(180deg,rgba(2,8,20,.50),rgba(3,10,22,.64) 52%,rgba(2,7,17,.72))!important}
body.light-theme .bg-overlay{background:linear-gradient(180deg,rgba(232,240,248,.43),rgba(229,237,245,.55) 52%,rgba(222,232,241,.64))!important}

/* Extracted from battle_simulator.html style block 28: id="v0788-gen7-ui-fixes" */

/* v0.78.8 — final battle-mode / optimizer-legibility pass + Gen 7 UI support. */

/* Make the selected battle context unmistakable, especially in Light mode. */
.command-context .battle-context-btn{position:relative!important;overflow:hidden!important}
.command-context .battle-context-btn.active{transform:translateY(-1px)!important;font-weight:900!important}
.command-context .battle-context-btn.active::after{content:"";position:absolute;left:14px;right:14px;bottom:3px;height:2px;border-radius:999px;background:currentColor;opacity:.70;box-shadow:0 0 9px currentColor}
body.light-theme .command-context .battle-context-btn{background:linear-gradient(180deg,#ffffff,#f4f7fa)!important;color:#53677b!important;border:1px solid #cbd7e1!important;box-shadow:0 3px 10px rgba(30,50,70,.06)!important}
body.light-theme .command-context .battle-context-btn.context-rally.active{background:linear-gradient(135deg,#fff1dc,#ffe0bd)!important;color:#71350f!important;border:2px solid #d78336!important;box-shadow:0 0 0 2px rgba(255,255,255,.95),0 7px 18px rgba(179,87,24,.20),inset 0 1px 0 #fff!important}
body.light-theme .command-context .battle-context-btn.context-wild.active{background:linear-gradient(135deg,#e1f8ee,#d8f4f5)!important;color:#075c59!important;border:2px solid #2aa29b!important;box-shadow:0 0 0 2px rgba(255,255,255,.95),0 7px 18px rgba(15,118,110,.18),inset 0 1px 0 #fff!important}
body.light-theme .command-context .battle-context-btn.context-rally.active .context-mode-icon{background:rgba(190,82,19,.13)!important;color:#9a4213!important;border-color:rgba(190,82,19,.22)!important}
body.light-theme .command-context .battle-context-btn.context-wild.active .context-mode-icon{background:rgba(13,148,136,.13)!important;color:#087b72!important;border-color:rgba(13,148,136,.22)!important}
body.light-theme .command-context .battle-context-btn.context-rally.active .context-mode-copy small{color:#96501f!important}
body.light-theme .command-context .battle-context-btn.context-wild.active .context-mode-copy small{color:#277a75!important}

/* The visible GEN control is a custom button, not the hidden select. Keep its ink dark on gold. */
.command-gen .rail-gen-box-btn,.command-gen .rail-gen-box-btn .gen-box-value{
  color:#3b2708!important;-webkit-text-fill-color:#3b2708!important;text-shadow:0 1px 0 rgba(255,255,255,.34)!important;font-weight:1000!important
}
body.light-theme .command-gen .rail-gen-box-btn,body.light-theme .command-gen .rail-gen-box-btn .gen-box-value{
  color:#352204!important;-webkit-text-fill-color:#352204!important;text-shadow:0 1px 0 rgba(255,255,255,.46)!important
}

/* Empty optimizer wings: beam belongs to the FULL arrow-shaped parent, not the inset message. */
.command-suggestions-empty{position:relative!important;isolation:isolate!important;overflow:hidden!important}
.command-suggestions-empty::before{content:"";position:absolute;z-index:0;inset:-2px;pointer-events:none;background-size:220% 100%;opacity:.86;filter:saturate(1.2);animation:v0788WingBeam 2.0s ease-in-out infinite}
.command-suggestions-empty.command-suggestions-att::before{background-image:linear-gradient(100deg,rgba(93,13,18,.18) 0%,rgba(207,36,42,.35) 30%,rgba(255,104,100,.72) 53%,rgba(207,36,42,.25) 72%,rgba(93,13,18,.08) 100%)}
.command-suggestions-empty.command-suggestions-def::before{background-image:linear-gradient(260deg,rgba(15,45,100,.18) 0%,rgba(37,99,235,.35) 30%,rgba(74,163,255,.72) 53%,rgba(37,99,235,.25) 72%,rgba(15,45,100,.08) 100%)}
@keyframes v0788WingBeam{0%,100%{background-position:0% 50%;opacity:.56}50%{background-position:100% 50%;opacity:1}}
.command-suggestions-empty .suggestion-empty.premium-empty{position:relative!important;z-index:1!important;min-height:166px!important;padding:15px 30px!important;background:transparent!important;border:0!important;box-shadow:none!important;overflow:visible!important}
.command-suggestions-empty .suggestion-empty.premium-empty::before{display:none!important}
.command-suggestions-empty .suggestion-empty-icon{font-size:1.65rem!important;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;width:auto!important;height:auto!important;min-width:0!important;color:inherit!important}
.command-suggestions-empty .suggestion-empty-copy{gap:7px!important;max-width:390px!important}
.command-suggestions-empty .suggestion-empty-copy b{font-size:1.08rem!important;line-height:1.15!important;font-weight:950!important}
.command-suggestions-empty .suggestion-empty-copy small{font-size:.78rem!important;line-height:1.42!important;font-weight:650!important}
.command-suggestions-empty .suggestion-empty-arrow{font-size:1.72rem!important;font-weight:950!important}
body.light-theme .command-suggestions-empty.command-suggestions-att::before{background-image:linear-gradient(100deg,rgba(255,226,226,.62) 0%,rgba(244,127,127,.66) 28%,rgba(226,55,55,.82) 54%,rgba(249,155,148,.66) 74%,rgba(255,237,235,.38) 100%)!important;opacity:.95!important}
body.light-theme .command-suggestions-empty.command-suggestions-def::before{background-image:linear-gradient(260deg,rgba(226,239,255,.68) 0%,rgba(122,176,245,.68) 28%,rgba(37,110,224,.82) 54%,rgba(125,193,252,.66) 74%,rgba(236,247,255,.40) 100%)!important;opacity:.95!important}
body.light-theme .command-suggestions-empty .suggestion-empty.premium-empty{background:transparent!important;color:#17324b!important}
body.light-theme .command-suggestions-empty.command-suggestions-att .suggestion-empty-copy b,body.light-theme .command-suggestions-empty.command-suggestions-att .suggestion-empty-arrow{color:#8f2024!important}
body.light-theme .command-suggestions-empty.command-suggestions-def .suggestion-empty-copy b,body.light-theme .command-suggestions-empty.command-suggestions-def .suggestion-empty-arrow{color:#185cae!important}
body.light-theme .command-suggestions-empty .suggestion-empty-copy small{color:#354e65!important}
body.light-theme .command-suggestions-empty .suggestion-empty-icon{background:transparent!important;color:#263f56!important}

/* Extracted from battle_simulator.html style block 29: id="v07811-counter-skill-ui-fixes" */

/* v0.78.11 — light-mode skill badges + ordinary pointer cursor for ratio controls. */
.ratio-slider,.ratio-slider:active,
.ratio-slider::-webkit-slider-thumb,.ratio-slider::-webkit-slider-thumb:hover,.ratio-slider::-webkit-slider-thumb:active,
.ratio-slider::-moz-range-thumb,.ratio-slider:active::-moz-range-thumb{cursor:pointer!important}
.damage-type-badge{display:inline-flex;align-items:center;margin-left:5px;padding:2px 6px;border-radius:999px;font-size:.58rem;font-weight:900;letter-spacing:.035em;vertical-align:1px;border:1px solid rgba(255,255,255,.18);white-space:nowrap}
.damage-type-badge.normal{background:rgba(245,158,11,.16);border-color:rgba(245,158,11,.40);color:#fde68a}
.damage-type-badge.skill{background:rgba(14,165,233,.17);border-color:rgba(56,189,248,.42);color:#bae6fd}
.damage-type-badge.special{background:rgba(236,72,153,.16);border-color:rgba(244,114,182,.42);color:#fbcfe8}
body.light-theme .rng-badge,body.light-theme .rng-badge-v4{background:#ede9fe!important;border-color:#8b5cf6!important;color:#4c1d95!important;font-weight:900!important;text-shadow:none!important}
body.light-theme .damage-type-badge.normal{background:#fff7ed!important;border-color:#f59e0b!important;color:#92400e!important}
body.light-theme .damage-type-badge.skill{background:#e0f2fe!important;border-color:#0284c7!important;color:#075985!important}
body.light-theme .damage-type-badge.special{background:#fce7f3!important;border-color:#db2777!important;color:#831843!important}

/* Extracted from battle_simulator.html style block 30: id="player-profile-stat-ui" */

.optimizer-mode-badge.profile{background:rgba(245,190,62,.15)!important;border-color:rgba(245,190,62,.38)!important;color:#f8d979!important}.light-theme .optimizer-mode-badge.profile{background:#fff4cf!important;border-color:#d7ad3d!important;color:#6d4b05!important}
.stat-mode-wrap{gap:5px!important}.stat-mode-btn.profile-stat-btn{border-color:rgba(245,190,62,.32)!important;color:#f6d77f!important;background:linear-gradient(180deg,rgba(86,61,13,.28),rgba(30,41,59,.76))!important}.stat-mode-btn.profile-stat-btn.active{background:linear-gradient(180deg,#d9a932,#8d6515)!important;color:#fff7d6!important;border-color:#f7d36f!important;box-shadow:0 0 16px rgba(245,190,62,.18)!important}.profile-stat-note{margin:0 0 10px;padding:9px 11px;border:1px solid rgba(245,190,62,.25);background:rgba(245,190,62,.07);color:#c7d7df;font-size:.72rem;line-height:1.45;border-radius:8px}.dynamic-tool-btn.profile-reload{border-color:rgba(245,190,62,.35);color:#fde8a6}.light-theme .stat-mode-btn.profile-stat-btn{background:#fff8df!important;color:#7c5608!important;border-color:#d8b55a!important}.light-theme .stat-mode-btn.profile-stat-btn.active{background:linear-gradient(180deg,#f5cf6b,#c89b32)!important;color:#3e2c08!important}.light-theme .profile-stat-note{background:#fff9e9;color:#4c5e69;border-color:#e0c777}@media(max-width:650px){.stat-mode-wrap{flex-direction:column}}

.profile-editable-wrap{margin:12px 0 15px;padding:13px;border:1px solid rgba(245,190,62,.24);border-radius:10px;background:rgba(7,18,31,.58)}
.profile-editable-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:11px}.profile-editable-head b{display:block;color:#f7dfa0;font-size:.86rem}.profile-editable-head small{display:block;color:#9fb2c1;font-size:.67rem;margin-top:2px}
.profile-editable-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.profile-editable-card{border:1px solid rgba(148,163,184,.16);border-radius:9px;background:rgba(15,30,47,.72);padding:10px}.profile-editable-card h4{margin:0 0 8px;color:#e9f3fa;font-size:.78rem}.profile-editable-card.inf{border-top-color:rgba(96,165,250,.48)}.profile-editable-card.lancer{border-top-color:rgba(45,212,191,.48)}.profile-editable-card.marksman{border-top-color:rgba(244,114,182,.45)}
.profile-editable-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.profile-editable-fields label{display:grid;gap:3px}.profile-editable-fields span{font-size:.58rem;text-transform:uppercase;letter-spacing:.05em;color:#91a6b7;font-weight:800}.profile-editable-fields input{width:100%;min-width:0;background:#071522;border:1px solid #35516d;border-radius:7px;color:#fff;padding:7px 8px;text-align:center;font-weight:800}.profile-editable-fields input:focus{outline:0;border-color:#e4b84c;box-shadow:0 0 0 2px rgba(228,184,76,.12)}
.profile-specials-block{margin-top:12px;padding-top:12px;border-top:1px solid rgba(245,190,62,.18)}.profile-specials-title{display:flex;align-items:baseline;gap:9px;margin-bottom:10px}.profile-specials-title b{color:#f7dfa0}.profile-specials-title span{color:#94a3b8;font-size:.65rem}
.light-theme .profile-editable-wrap{background:#fffdf6;border-color:#dbc16f}.light-theme .profile-editable-head b,.light-theme .profile-specials-title b{color:#6d4b05}.light-theme .profile-editable-head small,.light-theme .profile-specials-title span{color:#647784}.light-theme .profile-editable-card{background:#f8fbfd;border-color:#c9d7df}.light-theme .profile-editable-card h4{color:#203744}.light-theme .profile-editable-fields span{color:#607785}.light-theme .profile-editable-fields input{background:#fff;color:#183241;border-color:#b8cad4}.light-theme .profile-specials-block{border-top-color:#dbc16f}
@media(max-width:1000px){.profile-editable-grid{grid-template-columns:1fr}}@media(max-width:650px){.profile-editable-fields{grid-template-columns:1fr 1fr}}
