/* Reference-backed empty art. Identity, portrait, wins and HP are live DOM. */
.mm-screen .mm-rail[data-shell="reference-rail"],
.war-battle-screen .fighter-shell[data-shell="reference-rail"]{
  --rail-accent:#ff5068;
  --rail-ink:#fff4f6;
  --rail-glow:#ff365466;
  position:relative;
  display:block;
  width:100%;
  height:auto;
  min-height:0;
  max-height:none;
  aspect-ratio:660/156;
  padding:0;
  border:0;
  background:none;
  clip-path:none;
  box-shadow:none;
  overflow:visible;
  direction:ltr;
  container-type:inline-size;
  isolation:isolate;
  color:var(--rail-ink);
  filter:none;
}
.mm-screen .mm-rail[data-team="cyan"],
.war-battle-screen .fighter-shell[data-team="cyan"]{
  --rail-accent:#32dcff;
  --rail-ink:#eafbff;
  --rail-glow:#19bfff77;
}
.mm-screen .mm-rail .fighter-rail-art,
.war-battle-screen .fighter-shell .fighter-rail-art{
  position:absolute;inset:0;z-index:2;display:block;width:100%;height:100%;pointer-events:none;user-select:none;
}
.mm-screen .mm-rail .fighter-rail-art img,
.war-battle-screen .fighter-shell .fighter-rail-art img{display:block;width:100%;height:100%;object-fit:fill}
.mm-screen .mm-rail[data-team="cyan"] .fighter-rail-art,
.war-battle-screen .fighter-shell[data-team="cyan"] .fighter-rail-art{transform:scaleX(-1);filter:hue-rotate(190deg) saturate(1.4) brightness(1.12)}

/* 660x156 art coordinates: 78px portrait center, 150px identity start, 145px HP start. */
.mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-portrait,
.war-battle-screen .fighter-shell[data-shell="reference-rail"] .fs-avatar-zone{
  position:absolute;z-index:1;top:14.1%;left:3.34%;width:16.97%;height:auto;aspect-ratio:1;
  display:block;padding:0;margin:0;border:0;border-radius:50%;background:#101723;box-shadow:none;overflow:hidden;cursor:pointer;
}
.mm-screen .mm-rail[data-team="cyan"] .mm-rail-portrait,
.war-battle-screen .fighter-shell[data-team="cyan"] .fs-avatar-zone{left:auto;right:3.34%}
.mm-screen .mm-rail-portrait .mm-student-photo,
.war-battle-screen .fighter-shell .fs-avatar-image,
.war-battle-screen .fighter-shell .fs-avatar-sample{display:block;width:100%;height:100%;object-fit:cover;object-position:center;max-width:none;aspect-ratio:1}
.war-battle-screen .fighter-shell .fs-avatar-mask{position:absolute;inset:0;display:block;width:100%;height:100%;border-radius:50%;overflow:hidden}
.mm-screen .mm-rail-portrait::after{position:absolute;inset:0;content:"";border-radius:50%;background:linear-gradient(180deg,transparent 75%,#08111b40);pointer-events:none}
.mm-screen .mm-rail-portrait .mm-rival-question{font-size:clamp(20px,5cqw,42px)}

.mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-body,
.war-battle-screen .fighter-shell[data-shell="reference-rail"] .fighter-rail-body{position:static;display:contents;padding:0;height:auto}
.mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-body::before{display:none}
.mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-identity,
.war-battle-screen .fighter-shell[data-shell="reference-rail"] .fighter-rail-identity{
  position:absolute;z-index:3;top:23%;left:31%;width:56%;height:40%;display:flex;flex-direction:column;
  align-items:stretch;justify-content:center;gap:2px;min-width:0;min-height:0;padding:0 3px;margin:0;
  text-align:left;direction:ltr;pointer-events:auto;
}
.mm-screen .mm-rail[data-team="cyan"] .mm-rail-identity,
.war-battle-screen .fighter-shell[data-team="cyan"] .fighter-rail-identity{left:auto;right:31%;text-align:right}
.mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-name,
.war-battle-screen .fighter-shell[data-shell="reference-rail"] .fs-name{
  position:static;display:block;width:100%;height:auto;min-width:0;max-width:100%;margin:0;padding:0;border:0;background:none;
  color:var(--rail-ink);font:700 clamp(9px,3.2cqw,21px)/1.1 Alexandria,sans-serif;text-align:inherit;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 1px 5px #000,0 0 10px var(--rail-glow);cursor:help;
}
.mm-screen .mm-rail[data-shell="reference-rail"] .mm-name-full,
.war-battle-screen .fighter-shell[data-shell="reference-rail"] .fs-name-full{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mm-screen .mm-rail[data-shell="reference-rail"] .mm-name-compact{display:none}
.mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-meta,
.mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-group,
.war-battle-screen .fighter-shell[data-shell="reference-rail"] .fighter-rail-university,
.war-battle-screen .fighter-shell[data-shell="reference-rail"] .fighter-rail-group{
  position:static;display:block;width:100%;height:auto;min-width:0;max-width:100%;padding:0;margin:0;
  color:#e9e7ee;font:500 clamp(7px,2.35cqw,15px)/1.13 Alexandria,sans-serif;text-align:inherit;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 1px 4px #000;
}
.mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-group,
.war-battle-screen .fighter-shell[data-shell="reference-rail"] .fighter-rail-group{color:var(--rail-accent);font-weight:700}
.mm-screen .mm-rail[data-shell="reference-rail"] .mm-rival-search,
.mm-screen .mm-rail[data-shell="reference-rail"] .mm-rival-reveal{position:static;display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:2px;width:100%;height:100%;padding:0;margin:0;background:none;border:0;box-shadow:none;overflow:hidden;text-align:inherit}
.mm-screen .mm-rail[data-shell="reference-rail"] .mm-rival-reveal{display:none}
.mm-screen:is([data-phase="RIVAL_REVEAL"],[data-phase="RIVAL_CONFIRMED"],[data-phase="ENTERING_ARENA"]) .mm-rail[data-shell="reference-rail"] .mm-rival-reveal{display:flex}
.mm-screen:is([data-phase="RIVAL_REVEAL"],[data-phase="RIVAL_CONFIRMED"],[data-phase="ENTERING_ARENA"]) .mm-rail[data-shell="reference-rail"] .mm-rival-search{display:none}

.mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-health,
.war-battle-screen .fighter-shell[data-shell="reference-rail"] .fs-hp{
  position:absolute;z-index:3;top:73%;left:22%;width:59%;height:19%;display:block;margin:0;padding:3px 2px;
  border:0;background:none;box-shadow:none;overflow:hidden;
}
.mm-screen .mm-rail[data-team="cyan"] .mm-rail-health,
.war-battle-screen .fighter-shell[data-team="cyan"] .fs-hp{left:auto;right:22%}
.mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-health::before{display:none}
.mm-screen .mm-rail .mm-rail-segments,
.war-battle-screen .fighter-shell .mm-rail-segments{display:grid;grid-template-columns:repeat(16,minmax(0,1fr));gap:2px;width:100%;height:100%;overflow:visible;direction:ltr}
.mm-screen .mm-rail[data-team="cyan"] .mm-rail-segments,
.war-battle-screen .fighter-shell[data-team="cyan"] .mm-rail-segments{direction:rtl}
.mm-screen .mm-rail .mm-rail-segment,
.war-battle-screen .fighter-shell .mm-rail-segment{
  display:block;min-width:0;height:100%;border:1px solid color-mix(in srgb,var(--rail-accent) 80%,white);border-radius:1px;
  transform:skewX(-18deg);background:linear-gradient(180deg,color-mix(in srgb,var(--rail-accent) 40%,white),var(--rail-accent) 58%,color-mix(in srgb,var(--rail-accent) 68%,black));
  box-shadow:0 0 5px var(--rail-accent);transition:opacity .35s ease,filter .35s ease;
}
.war-battle-screen .fighter-shell .mm-rail-segment[data-active="false"]{opacity:.13;filter:grayscale(1)}
.mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-wins,
.war-battle-screen .fighter-shell[data-shell="reference-rail"] .fighter-rail-wins{
  position:absolute;z-index:3;top:72%;left:82%;width:16%;height:22%;display:flex;flex-direction:row;align-items:center;justify-content:center;
  gap:3px;min-width:0;margin:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;
  color:var(--rail-ink);font:600 clamp(7px,2.25cqw,15px)/1.05 Alexandria,sans-serif;text-align:center;
}
.mm-screen .mm-rail[data-team="cyan"] .mm-rail-wins,
.war-battle-screen .fighter-shell[data-team="cyan"] .fighter-rail-wins{left:2%}
.mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-wins span,
.war-battle-screen .fighter-shell[data-shell="reference-rail"] .fighter-rail-wins span{font:inherit;color:inherit}
.mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-wins strong,
.war-battle-screen .fighter-shell[data-shell="reference-rail"] .fighter-rail-wins strong{font:700 1.08em/1 Alexandria,sans-serif;color:inherit}
.war-battle-screen .fighter-shell[data-shell="reference-rail"] .fs-meter-number{display:none}

/* Search: match the desktop reference's ~650px shell and paired rows. */
.mm-screen:not([data-phase="IDLE"]) .mm-team-roster[data-count="1"]{top:28%;width:min(38%,660px)}
.mm-screen:not([data-phase="IDLE"]) .mm-team-roster[data-count="2"]{top:26%;width:min(38%,660px);gap:clamp(9px,1.8vh,20px)}
.mm-screen:not([data-phase="IDLE"]) .mm-team-roster[data-count="4"]{top:18%;width:min(34%,580px);gap:clamp(5px,1vh,10px)}
.mm-screen:not([data-phase="IDLE"]) .mm-team-roster--red{left:2.5%}
.mm-screen:not([data-phase="IDLE"]) .mm-team-roster--cyan{right:2.5%}
.mm-screen:not([data-phase="IDLE"]) .mm-scanner{width:min(38%,min(350px,34vh))}

/* Battle: identical rail system, with genuine HP values and responsive row density. */
.war-battle-screen .battle-shell-hud{grid-template-columns:minmax(0,1fr) clamp(48px,6vw,100px) minmax(0,1fr);width:min(98%,1840px);gap:clamp(4px,.7vw,12px)}
.war-battle-screen .battle-shell-team,
.war-battle-screen .battle-shell-hud[data-mode="2v2"] .battle-shell-team,
.war-battle-screen .battle-shell-hud[data-mode="4v4"] .battle-shell-team{display:grid;grid-template-columns:minmax(0,1fr);gap:clamp(4px,.6vw,10px);width:100%;max-width:660px}
.war-battle-screen .battle-shell-team[data-team="cyan"]{justify-self:end}
.war-battle-screen .battle-shell-hud[data-mode="2v2"] .battle-shell-team{max-width:560px}
.war-battle-screen .battle-shell-hud[data-mode="4v4"] .battle-shell-team{max-width:450px}
.war-battle-screen .fighter-shell[data-shell="reference-rail"] .fs-name-full{display:block}
.war-battle-screen .fighter-shell[data-shell="reference-rail"] .fs-hp.is-hit .mm-rail-segments{filter:brightness(1.5)}

@media(max-width:650px){
  .mm-screen .mm-rail[data-shell="reference-rail"],
  .war-battle-screen .fighter-shell[data-shell="reference-rail"]{aspect-ratio:400/150;--rail-mobile:1}
  .mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-portrait,
  .war-battle-screen .fighter-shell[data-shell="reference-rail"] .fs-avatar-zone{top:14%;left:5%;width:27%;height:auto}
  .mm-screen .mm-rail[data-team="cyan"] .mm-rail-portrait,
  .war-battle-screen .fighter-shell[data-team="cyan"] .fs-avatar-zone{left:auto;right:5%}
  .mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-identity,
  .war-battle-screen .fighter-shell[data-shell="reference-rail"] .fighter-rail-identity{top:20%;left:40%;width:57%;height:47%;gap:1px;padding:0 1px}
  .mm-screen .mm-rail[data-team="cyan"] .mm-rail-identity,
  .war-battle-screen .fighter-shell[data-team="cyan"] .fighter-rail-identity{left:auto;right:40%}
  .mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-name,
  .war-battle-screen .fighter-shell[data-shell="reference-rail"] .fs-name{font-size:clamp(7px,5.1cqw,10px);line-height:1.08}
  .mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-meta,
  .mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-group,
  .war-battle-screen .fighter-shell[data-shell="reference-rail"] .fighter-rail-university,
  .war-battle-screen .fighter-shell[data-shell="reference-rail"] .fighter-rail-group{font-size:clamp(5.8px,3.5cqw,7.3px);line-height:1.1}
  .mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-health,
  .war-battle-screen .fighter-shell[data-shell="reference-rail"] .fs-hp{top:74%;left:33%;width:49%;height:18%;padding:2px 1px}
  .mm-screen .mm-rail[data-team="cyan"] .mm-rail-health,
  .war-battle-screen .fighter-shell[data-team="cyan"] .fs-hp{left:auto;right:33%}
  .mm-screen .mm-rail .mm-rail-segments,
  .war-battle-screen .fighter-shell .mm-rail-segments{gap:1px}
  .mm-screen .mm-rail[data-shell="reference-rail"] .mm-rail-wins,
  .war-battle-screen .fighter-shell[data-shell="reference-rail"] .fighter-rail-wins{top:74%;left:81%;width:17%;height:18%;gap:2px;font-size:clamp(5.5px,3.5cqw,7px)}
  .mm-screen .mm-rail[data-team="cyan"] .mm-rail-wins,
  .war-battle-screen .fighter-shell[data-team="cyan"] .fighter-rail-wins{left:2%}
  .mm-screen:not([data-phase="IDLE"]) .mm-team-roster[data-count="1"]{top:11%;width:48%}
  .mm-screen:not([data-phase="IDLE"]) .mm-team-roster[data-count="2"]{top:31%;width:48%;gap:clamp(6px,1.3vh,11px)}
  .mm-screen:not([data-phase="IDLE"]) .mm-team-roster[data-count="4"]{top:34%;width:48%;gap:clamp(5px,1vh,9px)}
  .mm-screen:not([data-phase="IDLE"]) .mm-team-roster--red{left:.5%}
  .mm-screen:not([data-phase="IDLE"]) .mm-team-roster--cyan{right:.5%}
  .mm-screen[data-team-count="2"] .mm-core,.mm-screen[data-team-count="4"] .mm-core{position:absolute;inset:0;display:block;width:100%;height:100%;margin:0;z-index:4;pointer-events:none}
  .mm-screen[data-team-count="2"] .mm-status-code,.mm-screen[data-team-count="4"] .mm-status-code{position:absolute;top:19%;left:50%;transform:translateX(-50%);white-space:nowrap}
  .mm-screen[data-team-count="2"] .mm-core h1,.mm-screen[data-team-count="4"] .mm-core h1{position:absolute;top:23%;left:0;width:100%;font-size:clamp(15px,4.6vw,21px)}
  .mm-screen[data-team-count="2"] .mm-match-meta,.mm-screen[data-team-count="4"] .mm-match-meta{position:absolute;top:28%;left:0;width:100%;font-size:9px}
  .mm-screen[data-team-count="2"] .mm-scanner{position:absolute;top:53%;left:50%;transform:translateX(-50%);width:min(45vw,180px)}
  .mm-screen[data-team-count="4"] .mm-scanner{display:none}
  .mm-screen[data-team-count="2"] .mm-search-clock,.mm-screen[data-team-count="4"] .mm-search-clock{position:absolute;top:76%;left:50%;transform:translateX(-50%);width:min(48vw,190px)}
  .mm-screen[data-team-count="4"] .mm-search-clock{top:74%}
  .mm-screen[data-team-count="2"] .mm-team-roster--red .mm-rail::after,
  .mm-screen[data-team-count="4"] .mm-team-roster--red .mm-rail::after{position:absolute;z-index:6;left:100%;top:42%;width:8vw;content:"VS";color:#b9efff;font:700 clamp(11px,4vw,18px)/1 Georgia,serif;text-align:center;text-shadow:0 0 8px #13b5ff,0 0 16px #13b5ff;pointer-events:none}
  .war-battle-screen .battle-shell-hud{grid-template-columns:minmax(0,1fr) 32px minmax(0,1fr);width:100%;gap:2px;margin-top:8px}
  .war-battle-screen .battle-shell-team,.war-battle-screen .battle-shell-hud[data-mode="2v2"] .battle-shell-team,.war-battle-screen .battle-shell-hud[data-mode="4v4"] .battle-shell-team{grid-template-columns:minmax(0,1fr);gap:4px;max-width:none}
  .war-battle-screen .battle-shell-hud .war-round{width:32px;height:32px;align-self:start}
  .war-battle-screen .fighter-shell[data-shell="reference-rail"] .fs-university,.war-battle-screen .fighter-shell[data-shell="reference-rail"] .fs-specialty{display:none}
}
@media(prefers-reduced-motion:reduce){.war-battle-screen .fighter-shell .mm-rail-segment{transition:none}}
