:root {
  --bone: #efe7d6;
  --bone-dim: #b9b3a5;
  --cyan: #37c8ff;
  --cyan-soft: rgba(55, 200, 255, 0.55);
  --crimson: #ff3545;
  --crimson-soft: rgba(255, 53, 69, 0.55);
  --ink: #06070a;
  --metal: #101216;
  --metal-2: #1a1d22;
  --line: rgba(239, 231, 214, 0.38);
  --line-soft: rgba(239, 231, 214, 0.16);
  --pad: clamp(10px, 1.5vw, 24px);
  --disp: "Michroma", "Arial Black", sans-serif;
  --text: "Saira Condensed", "Arial Narrow", sans-serif;
  --num: "Rajdhani", "Consolas", monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #07080b;
  color: var(--bone);
  font-family: var(--text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  user-select: none;
}
body { touch-action: none; }
button { font: inherit; color: inherit; }
img { display: block; }

#stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #0a0b0e;
}
#gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

.grade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 46%, rgba(0,0,0,0) 46%, rgba(4,5,8,0.42) 82%, rgba(3,4,7,0.78) 100%),
    linear-gradient(180deg, rgba(5,6,9,0.5) 0%, rgba(5,6,9,0) 16%, rgba(5,6,9,0) 82%, rgba(5,6,9,0.6) 100%);
  transition: opacity 0.5s ease;
}
body.low-hp .grade {
  background:
    radial-gradient(ellipse 92% 70% at 50% 48%, rgba(0,0,0,0) 34%, rgba(55,6,10,0.36) 74%, rgba(24,2,5,0.9) 100%),
    linear-gradient(180deg, rgba(8,4,6,0.7) 0%, rgba(8,4,6,0) 18%, rgba(8,4,6,0) 78%, rgba(20,4,7,0.74) 100%);
}
.grain {
  position: absolute;
  inset: -50%;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='180' height='180' filter='url(%23n)' opacity='0.9'/></svg>");
  animation: grainShift 0.7s steps(3) infinite;
  mix-blend-mode: overlay;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-2%, 1.5%); }
  66% { transform: translate(1.5%, -1%); }
  100% { transform: translate(0, 0); }
}
.letterbox {
  position: absolute;
  left: 0; right: 0;
  height: max(6px, env(safe-area-inset-top));
  background: #050609;
  pointer-events: none;
  z-index: 30;
}
.letterbox.top { top: 0; }
.letterbox.bottom { bottom: 0; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------- loading ---------------- */
#loader {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background:
    radial-gradient(ellipse at 50% 62%, rgba(120, 78, 38, 0.28), rgba(7, 8, 11, 0.98) 70%),
    #07080b;
  transition: opacity 0.7s ease;
}
#loader.gone { opacity: 0; pointer-events: none; }
.loader-mark img {
  width: 84px;
  filter: drop-shadow(0 0 18px rgba(55, 200, 255, 0.25));
  opacity: 0.9;
}
.loader-kicker {
  margin: 0;
  font-family: var(--disp);
  font-size: 11px;
  letter-spacing: 0.36em;
  color: var(--bone);
  text-transform: uppercase;
}
.loader-line {
  width: min(260px, 50vw);
  height: 1px;
  background: rgba(239, 231, 214, 0.16);
  overflow: hidden;
}
.loader-line i {
  display: block;
  height: 100%;
  width: 40%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-soft);
  animation: loadSweep 1.6s ease-in-out infinite;
}
@keyframes loadSweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
.loader-sub {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--bone-dim);
  text-transform: uppercase;
}

/* ---------------- top band ---------------- */
#topband {
  position: absolute;
  z-index: 20;
  top: max(14px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  pointer-events: none;
}
.crest-slot img {
  width: clamp(44px, 5vw, 74px);
  height: auto;
  filter: drop-shadow(0 3px 7px rgba(0,0,0,0.55));
  opacity: 0.95;
  margin-top: 2px;
}
.title-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: clamp(280px, 40vw, 620px);
  transition: width 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.5s ease;
}
.title-img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 1px rgba(55,200,255,0.4));
}
body.in-fight .title-stack { width: clamp(190px, 24vw, 360px); opacity: 0.94; }
body.is-versus .title-stack { opacity: 0.1; }
body.is-versus .crest-slot { opacity: 0.4; }
.arena-slot {
  position: relative;
  width: 44%;
  min-width: 180px;
  margin-top: clamp(2px, 0.5vw, 8px);
  opacity: 0.95;
  transition: width 0.7s ease, opacity 0.4s ease;
}
body.in-fight .arena-slot { width: 54%; opacity: 0.8; }
.arena-slot img { width: 100%; height: auto; }
.arena-sub {
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  margin-top: 2px;
  text-align: center;
  font-family: var(--text);
  font-weight: 300;
  font-size: clamp(6px, 0.62vw, 10px);
  letter-spacing: 0.34em;
  color: rgba(239, 231, 214, 0.62);
  white-space: nowrap;
}
.round-slot {
  justify-self: end;
  position: relative;
  width: clamp(116px, 11.5vw, 162px);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}
body.in-fight .round-slot { opacity: 0.9; transform: none; }
.pips-plaque { display: none; }
.round-slot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: 38%; background: linear-gradient(180deg, rgba(16,18,22,0.78), rgba(7,9,12,0.42)); border: 1px solid rgba(239,231,214,0.16); clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); }
.pips-plaque img { width: 100%; height: auto; }
.pips {
  position: absolute;
  left: 14%;
  right: 14%;
  top: 42%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7%;
}
.pip {
  width: clamp(9px, 0.95vw, 13px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(5, 6, 8, 0.9);
  border: 1px solid rgba(239, 231, 214, 0.34);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.9);
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.pip-sep {
  width: 1px;
  height: clamp(9px, 0.9vw, 13px);
  background: rgba(239, 231, 214, 0.24);
}
.pip.p1.on {
  background: var(--cyan);
  border-color: rgba(190, 240, 255, 0.9);
  box-shadow: 0 0 10px var(--cyan-soft);
}
.pip.p2.on {
  background: var(--crimson);
  border-color: rgba(255, 190, 195, 0.9);
  box-shadow: 0 0 10px var(--crimson-soft);
}
.round-label {
  position: absolute;
  left: 0; right: 0;
  top: 74%;
  margin: 0;
  text-align: center;
  font-family: var(--num);
  font-size: clamp(8px, 0.72vw, 11px);
  letter-spacing: 0.24em;
  color: rgba(239, 231, 214, 0.7);
}

/* ---------------- HUD ---------------- */
#hud {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease;
}
body.in-fight #hud { opacity: 1; visibility: visible; }
.hud-side {
  position: absolute;
  width: clamp(210px, 21vw, 330px);
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.5vw, 8px);
  transition: opacity 0.3s ease;
}
.hud-side.player { top: clamp(132px, 21vh, 182px); left: var(--pad); }
.hud-side.enemy { top: clamp(132px, 21vh, 182px); right: var(--pad); align-items: flex-end; }

.health-frame {
  position: relative;
  width: 100%;
  filter: drop-shadow(0 5px 12px rgba(0,0,0,0.45));
}
.health-frame > img { width: 100%; height: auto; }
.baked-cover {
  position: absolute;
  left: 12.2%;
  top: 14.1%;
  width: 76.2%;
  height: 10.2%;
  background: #0b0c0b;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.9);
}
.bar {
  position: absolute;
  left: 12.8%;
  top: 15.8%;
  width: 75%;
  height: 6.8%;
  overflow: hidden;
}
.bar .fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: linear-gradient(180deg, #9fe8ff 0%, var(--cyan) 48%, #1492c8 100%);
  box-shadow: 0 0 8px rgba(55, 200, 255, 0.55);
  transition: width 0.22s steps(6);
}
.bar .fill.red {
  background: linear-gradient(180deg, #ff9aa2 0%, var(--crimson) 48%, #9d0b18 100%);
  box-shadow: 0 0 8px rgba(255, 53, 69, 0.5);
}
.frame-readout {
  position: absolute;
  left: 8.5%;
  right: 7%;
  top: 32%;
  bottom: 10%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.frame-kicker {
  font-family: var(--disp);
  font-size: clamp(5px, 0.46vw, 7px);
  letter-spacing: 0.3em;
  color: rgba(239, 231, 214, 0.44);
}
.frame-num {
  font-family: var(--num);
  font-weight: 600;
  font-size: clamp(14px, 1.5vw, 23px);
  line-height: 1;
  letter-spacing: 0.06em;
  color: rgba(239, 231, 214, 0.82);
  text-shadow: 0 0 8px rgba(55, 200, 255, 0.18);
}
.enemy .frame-num { text-shadow: 0 0 8px rgba(255, 53, 69, 0.18); }

.nameplate {
  width: 93%;
  padding: clamp(3px, 0.4vw, 6px) clamp(6px, 0.7vw, 10px);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #1b1c1e, #101113 60%, #0a0b0d);
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--cyan);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.enemy .nameplate {
  border-left: 1px solid var(--line-soft);
  border-right: 2px solid var(--crimson);
  text-align: right;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}
.nm {
  display: block;
  font-family: var(--text);
  font-weight: 600;
  font-size: clamp(10px, 1.02vw, 15px);
  letter-spacing: 0.15em;
  line-height: 1.1;
  color: var(--bone);
  white-space: nowrap;
}
.nm-line {
  display: block;
  margin-top: 1px;
  font-family: var(--num);
  font-weight: 400;
  font-size: clamp(7px, 0.64vw, 9px);
  letter-spacing: 0.2em;
  color: rgba(239, 231, 214, 0.5);
  white-space: nowrap;
}
.readout {
  margin: 0;
  font-family: var(--num);
  font-size: clamp(7px, 0.68vw, 10px);
  letter-spacing: 0.22em;
  color: rgba(55, 200, 255, 0.66);
  white-space: nowrap;
}
.enemy .readout { color: rgba(255, 53, 69, 0.72); text-align: right; }

.meters {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  gap: clamp(5px, 0.7vw, 10px);
  width: clamp(230px, 23vw, 350px);
}
.player .meters { left: var(--pad); }
.enemy .meters { right: var(--pad); }
.player .meters { bottom: max(52px, calc(env(safe-area-inset-bottom) + 46px)); }
@media (pointer: coarse) { .player .meters { bottom: max(80px, calc(env(safe-area-inset-bottom) + 74px)); } }
.enemy .meters { bottom: max(96px, calc(env(safe-area-inset-bottom) + 92px)); }
.meter {
  position: relative;
  flex: 1;
  min-width: 0;
  opacity: 0.96;
}
.meter-frame img { width: 100%; height: auto; }
.meter-inner {
  position: absolute;
  inset: 0;
  padding: 0;
}
.meter-label {
  position: absolute;
  left: 12.5%;
  top: 7.5%;
  padding: 1px 3px;
  background: rgba(10, 11, 12, 0.78);
  font-family: var(--disp);
  font-size: clamp(5px, 0.48vw, 7px);
  letter-spacing: 0.24em;
  color: rgba(239, 231, 214, 0.66);
  white-space: nowrap;
}
.meter-inner::before {
  content: "";
  position: absolute;
  left: 13%;
  top: 72.5%;
  width: 75%;
  height: 14%;
  background: #090a09;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.9);
}
.meter-track {
  position: absolute;
  left: 14.6%;
  top: 75.3%;
  width: 71.5%;
  height: 7.4%;
  min-height: 5px;
  background: #090a09;
  overflow: hidden;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.9);
}
.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  transition: width 0.2s linear;
}
.meter-fill.stam {
  background: linear-gradient(180deg, #e9e2d2, #b6ae9d 55%, #6c665c);
}
.meter-fill.force {
  background: linear-gradient(180deg, #9fe8ff, var(--cyan) 55%, #0f7fae);
  box-shadow: 0 0 8px rgba(55, 200, 255, 0.4);
}
.meter-fill.red.stam { background: linear-gradient(180deg, #f0d8d4, #b98c86 55%, #6b4a46); }
.meter-fill.red.force {
  background: linear-gradient(180deg, #ff9aa2, var(--crimson) 55%, #8e0a15);
  box-shadow: 0 0 8px rgba(255, 53, 69, 0.35);
}

.action-bar {
  position: absolute;
  right: var(--pad);
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  pointer-events: none;
}
.force-row {
  display: flex;
  gap: clamp(4px, 0.55vw, 8px);
  align-items: flex-end;
}
.action {
  pointer-events: auto;
  position: relative;
  width: clamp(40px, 4.1vw, 62px);
  aspect-ratio: 0.92;
  padding: 4px 4px 12px;
  background:
    linear-gradient(180deg, rgba(28, 31, 36, 0.92), rgba(8, 9, 11, 0.94));
  border: 1px solid rgba(239, 231, 214, 0.26);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
}
.action img {
  width: 74%;
  height: 74%;
  object-fit: contain;
  filter: brightness(1.45) contrast(1.15) drop-shadow(0 0 3px rgba(0,0,0,0.8));
  opacity: 0.92;
}
.action .a-key {
  position: absolute;
  left: 4px;
  bottom: 2px;
  font-family: var(--num);
  font-size: clamp(6px, 0.6vw, 9px);
  letter-spacing: 0.08em;
  color: rgba(239, 231, 214, 0.55);
}
.action .a-name {
  position: absolute;
  right: 3px;
  bottom: 2px;
  font-family: var(--text);
  font-weight: 600;
  font-size: clamp(5px, 0.5vw, 7px);
  letter-spacing: 0.1em;
  color: rgba(239, 231, 214, 0.42);
}
.action:hover { border-color: rgba(55, 200, 255, 0.62); }
.action:active, .action.pressed {
  transform: translateY(1px) scale(0.97);
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(55, 200, 255, 0.26) inset;
}
.action.force-btn.ready img { filter: drop-shadow(0 0 6px rgba(55,200,255,0.55)); }
.action.force-btn.spent { opacity: 0.55; }
.action.locked {
  opacity: 0.34;
  cursor: default;
}
.action.locked .a-name { display: none; }
.action.locked .a-key {
  left: 50%;
  transform: translateX(-50%);
  color: rgba(239,231,214,0.52);
  letter-spacing: 0.08em;
}

.help-toggle {
  position: absolute;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  pointer-events: auto;
  border: 1px solid rgba(239, 231, 214, 0.22);
  background: rgba(8, 9, 12, 0.6);
  color: rgba(239, 231, 214, 0.62);
  font-family: var(--text);
  font-weight: 600;
  font-size: clamp(7px, 0.66vw, 10px);
  letter-spacing: 0.24em;
  padding: 6px 14px;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.help-toggle:hover { color: var(--bone); border-color: rgba(55, 200, 255, 0.5); }

.pause-btn {
  position: absolute;
  right: var(--pad);
  top: 50%;
  margin-top: -14px;
  pointer-events: auto;
  width: clamp(26px, 2.4vw, 34px);
  height: clamp(26px, 2.4vw, 34px);
  border-radius: 50%;
  border: 1px solid rgba(239, 231, 214, 0.26);
  background: rgba(8, 9, 12, 0.55);
  color: rgba(239, 231, 214, 0.7);
  font-family: var(--num);
  font-size: 10px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.pause-btn:hover { border-color: var(--cyan); color: var(--bone); }

.action-hint {
  position: absolute;
  left: 50%;
  bottom: max(104px, calc(env(safe-area-inset-bottom) + 100px));
  transform: translateX(-50%);
  margin: 0;
  padding: 3px 10px;
  background: rgba(5, 7, 10, 0.68);
  border-left: 1px solid rgba(55, 200, 255, 0.55);
  border-right: 1px solid rgba(55, 200, 255, 0.3);
  font-family: var(--num);
  font-size: clamp(7px, 0.7vw, 10px);
  letter-spacing: 0.26em;
  color: rgba(200, 240, 255, 0.92);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}
.action-hint.show { opacity: 1; }
.spent-warning {
  position: absolute;
  left: 50%;
  bottom: max(58px, calc(env(safe-area-inset-bottom) + 54px));
  width: clamp(140px, 14vw, 200px);
  opacity: 0;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 2;
}
.spent-warning.show { opacity: 1; transform: translateX(-50%); }
.spent-warning img { width: 100%; height: auto; opacity: 0.9; }
.spent-warning span {
  position: absolute;
  left: 12%;
  top: 26%;
  font-family: var(--disp);
  font-size: clamp(6px, 0.6vw, 9px);
  letter-spacing: 0.24em;
  color: #ffb3b9;
  text-shadow: 0 0 8px rgba(255, 53, 69, 0.5);
}

/* ---------------- screens ---------------- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}
.screen.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.5s ease;
}

#landing {
  align-items: flex-end;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(5,6,9,0.15) 0%, rgba(5,6,9,0) 34%, rgba(5,6,9,0.55) 68%, rgba(5,6,9,0.92) 100%);
  padding: 0 var(--pad) max(14px, env(safe-area-inset-bottom));
}
#landing.show { display: flex; }
.landing-watermark {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(34vw, 400px);
  transform: translate(-50%, -50%);
  opacity: 0.055;
  pointer-events: none;
  filter: blur(0.4px);
}
.landing-watermark img { width: 100%; }
.landing-inner {
  position: relative;
  width: min(880px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: clamp(4px, 1vh, 12px);
}
.eyebrow {
  margin: 0 0 clamp(2px, 0.4vh, 6px);
  font-family: var(--disp);
  font-size: clamp(7px, 0.65vw, 10px);
  letter-spacing: 0.42em;
  color: rgba(55, 200, 255, 0.7);
}
.versus-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(10px, 1.8vw, 26px);
  font-family: var(--text);
  font-weight: 500;
  font-size: clamp(12px, 1.35vw, 20px);
  letter-spacing: 0.22em;
  color: rgba(239, 231, 214, 0.88);
}
.versus-line i {
  font-family: var(--disp);
  font-style: normal;
  font-size: clamp(8px, 0.72vw, 11px);
  color: rgba(239, 231, 214, 0.42);
}
.lede {
  width: min(560px, 84%);
  margin: clamp(3px, 0.6vh, 8px) 0 clamp(9px, 1.5vh, 18px);
  font-family: var(--text);
  font-weight: 300;
  font-size: clamp(11px, 1.05vw, 15px);
  line-height: 1.38;
  letter-spacing: 0.06em;
  color: rgba(239, 231, 214, 0.64);
}
.start-row {
  display: flex;
  align-items: stretch;
  gap: clamp(8px, 1vw, 14px);
}
.mini-stack { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.cta {
  position: relative;
  border: 1px solid rgba(55, 200, 255, 0.52);
  background:
    linear-gradient(180deg, rgba(20, 34, 42, 0.85), rgba(7, 11, 14, 0.92));
  color: var(--bone);
  padding: clamp(9px, 1.2vh, 14px) clamp(22px, 3vw, 46px);
  clip-path: polygon(13px 0, 100% 0, 100% calc(100% - 13px), calc(100% - 13px) 100%, 0 100%, 0 13px);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 0 30px rgba(55, 200, 255, 0.09), inset 0 0 24px rgba(55, 200, 255, 0.05);
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  touch-action: manipulation;
}
.cta:hover {
  border-color: rgba(55, 200, 255, 0.95);
  box-shadow: 0 0 42px rgba(55, 200, 255, 0.2), inset 0 0 30px rgba(55, 200, 255, 0.09);
}
.cta-rule {
  position: absolute;
  left: 14px; right: 14px; top: 4px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(55, 200, 255, 0.7), transparent);
}
.cta-text {
  font-family: var(--disp);
  font-size: clamp(11px, 1.3vw, 18px);
  letter-spacing: 0.22em;
}
.cta-sub {
  font-family: var(--num);
  font-size: clamp(7px, 0.62vw, 9px);
  letter-spacing: 0.3em;
  color: rgba(55, 200, 255, 0.66);
}
.cta.small { padding: clamp(8px, 1vh, 12px) clamp(18px, 2.4vw, 34px); }
.cta.small .cta-text { font-size: clamp(9px, 0.9vw, 13px); }
.ghost-btn {
  border: 1px solid rgba(239, 231, 214, 0.2);
  background: rgba(8, 9, 12, 0.5);
  color: rgba(239, 231, 214, 0.62);
  font-family: var(--text);
  font-weight: 600;
  font-size: clamp(7px, 0.63vw, 9px);
  letter-spacing: 0.2em;
  padding: clamp(5px, 0.7vh, 8px) clamp(10px, 1.2vw, 16px);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  touch-action: manipulation;
}
.ghost-btn:hover { color: var(--bone); border-color: rgba(55, 200, 255, 0.45); }
.start-hint {
  margin: clamp(4px, 0.8vh, 9px) 0 clamp(8px, 1.2vh, 14px);
  font-family: var(--num);
  font-size: clamp(6px, 0.58vw, 9px);
  letter-spacing: 0.24em;
  color: rgba(239, 231, 214, 0.38);
}
.modes {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(5px, 0.7vw, 10px);
  max-width: 780px;
}
.mode {
  position: relative;
  border: 1px solid rgba(239, 231, 214, 0.14);
  background: linear-gradient(180deg, rgba(16, 18, 22, 0.72), rgba(7, 8, 10, 0.82));
  padding: clamp(5px, 0.9vh, 9px) 4px clamp(4px, 0.7vh, 7px);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  opacity: 0.42;
  cursor: default;
  text-align: center;
}
.mode b {
  display: block;
  font-family: var(--disp);
  font-size: clamp(7px, 0.72vw, 11px);
  letter-spacing: 0.18em;
  color: var(--bone);
  font-weight: 400;
}
.mode span {
  display: block;
  margin-top: 2px;
  font-family: var(--num);
  font-size: clamp(5px, 0.5vw, 7px);
  letter-spacing: 0.14em;
  color: rgba(239, 231, 214, 0.5);
}
.mode.active {
  opacity: 1;
  border-color: rgba(55, 200, 255, 0.5);
  background: linear-gradient(180deg, rgba(18, 38, 48, 0.8), rgba(7, 11, 14, 0.9));
  box-shadow: 0 0 24px rgba(55, 200, 255, 0.1);
}
.mode.active span { color: var(--cyan); }
.mode.active::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: 3px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(55, 200, 255, 0.75), transparent);
}

/* ---------------- versus ---------------- */
.versus-screen {
  z-index: 50;
  background: radial-gradient(ellipse at 50% 50%, rgba(4,5,8,0.12), rgba(4,5,8,0.62) 78%);
}
.versus-card {
  position: relative;
  width: min(760px, 74vw);
  filter: drop-shadow(0 30px 60px rgba(0,0,0,0.65));
  transform: scale(0.94) translateY(10px);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.16, 0.8, 0.2, 1), opacity 0.6s ease;
}
.versus-screen.show .versus-card { transform: none; opacity: 1; }
.versus-screen.out .versus-card { transform: scale(1.04); opacity: 0; transition: transform 0.5s ease, opacity 0.45s ease; }
.vplate { width: 100%; height: auto; }
.portrait-name {
  position: absolute;
  width: 24%;
  top: 67%;
  text-align: center;
}
.portrait-name.left { left: 2.6%; }
.portrait-name.right { right: 2.6%; }
.portrait-name b {
  display: block;
  font-family: var(--text);
  font-weight: 600;
  font-size: clamp(8px, 0.92vw, 13px);
  letter-spacing: 0.12em;
  color: var(--bone);
}
.portrait-name span {
  display: block;
  margin-top: 1px;
  font-family: var(--num);
  font-size: clamp(6px, 0.55vw, 8px);
  letter-spacing: 0.24em;
  color: rgba(239, 231, 214, 0.5);
}
.vslot {
  position: absolute;
  left: 36.3%;
  width: 23.4%;
  top: 11.2%;
  height: 5.6%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vslot span {
  font-family: var(--disp);
  font-size: clamp(7px, 0.68vw, 10px);
  letter-spacing: 0.3em;
  color: rgba(239, 231, 214, 0.9);
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(0,0,0,0.9);
}
.vs-mark {
  position: absolute;
  left: 30%;
  width: 40%;
  top: 16%;
  height: 36%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.vs-mark em {
  position: relative;
  z-index: 2;
  font-family: var(--disp);
  font-style: normal;
  font-size: clamp(22px, 3.4vw, 52px);
  letter-spacing: 0.12em;
  color: rgba(239, 231, 214, 0.94);
  text-shadow: 0 0 22px rgba(55,200,255,0.55), 0 2px 3px #000;
}
.vs-blade {
  position: absolute;
  width: 64%;
  height: 4px;
  top: 50%;
  left: 18%;
  border-radius: 3px;
  transform-origin: center;
  filter: blur(0.2px);
}
.vs-blade.b1 {
  transform: rotate(28deg);
  background: linear-gradient(90deg, rgba(55,200,255,0), #8fe2ff, #fff);
  box-shadow: 0 0 14px rgba(55,200,255,0.7);
}
.vs-blade.b2 {
  transform: rotate(-28deg);
  background: linear-gradient(90deg, rgba(255,53,69,0), #ff8f97, #fff);
  box-shadow: 0 0 14px rgba(255,53,69,0.65);
}
.vfoot {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 2.5%;
  display: flex;
  justify-content: space-between;
  font-family: var(--num);
  font-size: clamp(6px, 0.55vw, 8px);
  letter-spacing: 0.28em;
  color: rgba(239, 231, 214, 0.4);
}

/* ---------------- sheets / pause / result ---------------- */
.sheet { z-index: 76; }
.pause-screen { z-index: 70; }
.result-screen { z-index: 72; background: rgba(3, 4, 6, 0.95); }
.sheet, .pause-screen, .result-screen {
  background: rgba(4, 5, 8, 0.72);
  backdrop-filter: blur(3px);
}
.sheet-card, .pause-card, .result-card {
  position: relative;
  touch-action: pan-y;
  width: min(560px, 88vw);
  max-height: 88vh;
  overflow: auto;
  padding: clamp(18px, 3vh, 30px) clamp(18px, 3vw, 36px);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(24, 26, 30, 0.96), rgba(9, 10, 13, 0.98));
  border: 1px solid rgba(239, 231, 214, 0.22);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.7), inset 0 0 40px rgba(55, 200, 255, 0.03);
  text-align: center;
}
.sheet-close {
  position: absolute;
  right: 10px; top: 6px;
  width: 30px; height: 30px;
  border: 0;
  background: transparent;
  color: rgba(239, 231, 214, 0.6);
  font-size: 22px;
  cursor: pointer;
}
.sheet-kicker {
  margin: 0 0 8px;
  font-family: var(--disp);
  font-size: clamp(7px, 0.66vw, 9px);
  letter-spacing: 0.34em;
  color: rgba(55, 200, 255, 0.7);
}
.sheet-title, .pause-card h2, .result-card h2 {
  margin: 0;
  font-family: var(--disp);
  font-weight: 400;
  font-size: clamp(18px, 2.1vw, 30px);
  letter-spacing: 0.1em;
  color: var(--bone);
}
.control-grid {
  margin: clamp(14px, 2.2vh, 22px) 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  text-align: left;
}
.control-grid > div {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid rgba(239, 231, 214, 0.1);
  background: rgba(255,255,255,0.018);
  font-family: var(--text);
  font-weight: 400;
  font-size: clamp(9px, 0.86vw, 12px);
  letter-spacing: 0.05em;
  color: rgba(239, 231, 214, 0.7);
}
.control-grid kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border: 1px solid rgba(55, 200, 255, 0.4);
  background: rgba(55, 200, 255, 0.06);
  color: var(--bone);
  font-family: var(--num);
  font-size: 11px;
}
.sheet-note {
  margin: 8px 0;
  font-family: var(--text);
  font-weight: 300;
  font-size: clamp(9px, 0.86vw, 12px);
  line-height: 1.45;
  color: rgba(239, 231, 214, 0.5);
}
.touch-note { display: none; }
@media (pointer: coarse) { .touch-note { display: block; } }
.pause-card h2, .result-card h2 {
  font-size: clamp(30px, 4.6vw, 62px);
  letter-spacing: 0.14em;
  margin: clamp(6px, 1vh, 12px) 0;
}
.pause-sub, .result-sub {
  margin: 0 0 clamp(14px, 2.4vh, 24px);
  font-family: var(--text);
  font-weight: 300;
  font-size: clamp(10px, 1vw, 14px);
  letter-spacing: 0.05em;
  color: rgba(239, 231, 214, 0.55);
}
.pause-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.pause-hint {
  margin: clamp(12px, 2vh, 20px) 0 0;
  font-family: var(--num);
  font-size: 9px;
  letter-spacing: 0.24em;
  color: rgba(239, 231, 214, 0.35);
}
.result-crest img {
  width: 66px;
  margin: 0 auto 7px;
  opacity: 0.8;
  filter: drop-shadow(0 0 14px rgba(55, 200, 255, 0.3));
}
.result-kicker {
  margin: 0;
  font-family: var(--disp);
  font-size: 9px;
  letter-spacing: 0.34em;
  color: rgba(239, 231, 214, 0.5);
}
.result-card h2.win { color: var(--bone); text-shadow: 0 0 28px rgba(55, 200, 255, 0.4); }
.result-card h2.lose { color: #ffd8db; text-shadow: 0 0 28px rgba(255, 53, 69, 0.4); }
.result-stats {
  display: flex;
  justify-content: center;
  gap: clamp(12px, 2.4vw, 28px);
  margin: 0 0 clamp(16px, 2.6vh, 26px);
  font-family: var(--num);
  font-size: clamp(8px, 0.7vw, 10px);
  letter-spacing: 0.16em;
  color: rgba(239, 231, 214, 0.45);
}
.result-stats span { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.result-stats b {
  font-family: var(--num);
  font-weight: 600;
  font-size: clamp(16px, 1.8vw, 24px);
  color: var(--bone);
  letter-spacing: 0.04em;
}

/* ---------------- banner ---------------- */
.banner {
  position: absolute;
  left: 0; right: 0;
  top: 43%;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.banner.show { opacity: 1; transform: none; }
.banner span {
  font-family: var(--disp);
  font-size: clamp(20px, 3.2vw, 52px);
  letter-spacing: 0.3em;
  color: var(--bone);
  text-shadow: 0 0 30px rgba(55, 200, 255, 0.45), 0 2px 4px #000;
  padding: 10px 30px;
  border-top: 1px solid rgba(55, 200, 255, 0.35);
  border-bottom: 1px solid rgba(55, 200, 255, 0.28);
  background: linear-gradient(90deg, transparent, rgba(5,7,10,0.72), transparent);
}

/* ---------------- touch ---------------- */
.touch-pad { display: none; }
@media (pointer: coarse) {
  .touch-pad {
    position: absolute;
    left: var(--pad);
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 19;
    display: flex;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
  }
  body.in-fight .touch-pad { opacity: 1; pointer-events: auto; }
  .tp {
    width: clamp(40px, 9vw, 58px);
    height: clamp(40px, 9vw, 58px);
    border-radius: 50%;
    border: 1px solid rgba(239, 231, 214, 0.22);
    background: rgba(8, 9, 12, 0.55);
    color: rgba(239, 231, 214, 0.75);
    font-family: var(--num);
    font-size: 14px;
    touch-action: none;
  }
  .tp.attack {
    margin-left: auto;
    border-color: rgba(55, 200, 255, 0.5);
    color: #bfefff;
    font-family: var(--disp);
    font-size: 13px;
  }
  .help-toggle { display: none; }
}
@media (max-width: 1000px) and (min-width: 641px) {
  .hud-side { width: clamp(170px, 20vw, 200px); }
  .hud-side.player, .hud-side.enemy { top: clamp(96px, 15vh, 150px); }
}
@media (max-width: 640px), (max-aspect-ratio: 1/1) {
  .hud-side { width: clamp(150px, 44vw, 230px); }
  .hud-side.player { top: clamp(144px, 18vh, 200px); }
  .hud-side.enemy { top: clamp(144px, 18vh, 200px); }
  .frame-readout { top: 30%; }
  .nm { font-size: clamp(8px, 2.1vw, 11px); letter-spacing: 0.08em; }
  .nm-line { font-size: clamp(5.5px, 1.5vw, 8px); }
  .readout { display: none; }
  .title-stack { width: 54vw; }
  body.in-fight .title-stack { width: 38vw; }
  .round-slot { width: 96px; }
  .meters { width: 64vw; }
  .player .meters { bottom: max(66px, calc(env(safe-area-inset-bottom) + 62px)); }
  .enemy .meters { display: none; }
  .spent-warning { bottom: max(200px, calc(env(safe-area-inset-bottom) + 194px)); width: 122px; }
  .action-hint { bottom: max(168px, calc(env(safe-area-inset-bottom) + 162px)); font-size: 7px; }
  .action { width: clamp(34px, 8vw, 46px); }
  .action .a-name { display: none; }
  .action .a-key { font-size: 6px; }
  .force-row { gap: 3px; }
  .pause-btn { top: auto; bottom: max(86px, calc(env(safe-area-inset-bottom) + 82px)); right: var(--pad); margin: 0; }
  #landing { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .landing-inner { width: 94vw; }
  .start-row { flex-direction: column; width: 100%; align-items: center; }
  .mini-stack { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .cta { width: min(100%, 320px); }
  .modes { grid-template-columns: repeat(5, 1fr); }
  .mode b { font-size: 6px; letter-spacing: 0.05em; }
  .mode span { display: none; }
  .versus-card { width: 92vw; }
  .vslot span { font-size: 6px; letter-spacing: 0.14em; }
  .portrait-name b { font-size: 7px; }
  .portrait-name span { font-size: 5px; }
  .touch-pad { bottom: max(10px, env(safe-area-inset-bottom)); }
  .help-toggle { display: none; }
  .letterbox { height: 4px; }
}
@media (max-height: 560px) {
  .control-grid { grid-template-columns: 1fr 1fr; gap: 4px; }
  .control-grid > div { padding: 4px 6px; font-size: clamp(8px, 0.8vw, 11px); }
  .sheet-title { font-size: clamp(16px, 1.8vw, 24px); }
  .sheet-card { padding: 14px 18px; }
  .sheet-note { margin: 4px 0; }
  .result-card { padding: 14px 18px; }
  .result-card h2 { font-size: clamp(28px, 3.6vw, 46px); }
}
@media (max-height: 460px) {
  .hud-side.player, .hud-side.enemy { top: 96px; }
  .title-stack { width: 30vw; }
  body.in-fight .title-stack { width: 23vw; }
  .arena-slot { width: 54%; }
  .modes { max-width: 640px; }
  .lede { display: none; }
  .start-hint { margin: 3px 0 5px; }
  .player .meters {
    left: 210px;
    width: clamp(190px, 27vw, 250px);
    bottom: max(8px, env(safe-area-inset-bottom));
  }
  .enemy .meters { display: none; }
  .spent-warning { display: none; }
  .action-hint { bottom: max(168px, calc(env(safe-area-inset-bottom) + 162px)); }
  .anim-layer { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .loader-line i { animation: none; }
}

/* ---------------- roster / modes chapter 2 ---------------- */
.modes { grid-template-columns: repeat(4, 1fr); }
.nm { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.squad-hud {
  position: absolute;
  z-index: 19;
  top: clamp(88px, 13vh, 128px);
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, 62vw);
  display: none;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
body.team-mode.in-fight .squad-hud { display: flex; opacity: 0.92; }
.squad-side { display: flex; gap: 4px; flex: 1; min-width: 0; }
.squad-side.right { flex-direction: row-reverse; }
.squad-vs {
  font-family: var(--disp);
  font-size: clamp(6px, 0.55vw, 8px);
  letter-spacing: 0.16em;
  color: rgba(239, 231, 214, 0.35);
}
.squad-chip {
  flex: 1;
  min-width: 0;
  padding: 2px 5px 3px;
  border: 1px solid rgba(239, 231, 214, 0.16);
  border-left: 2px solid rgba(55, 200, 255, 0.7);
  background: linear-gradient(180deg, rgba(12, 16, 20, 0.82), rgba(6, 8, 11, 0.86));
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
  transition: opacity 0.3s ease;
}
.squad-chip.red { border-left: 1px solid rgba(239, 231, 214, 0.16); border-right: 2px solid rgba(255, 53, 69, 0.7); }
.squad-chip.down { opacity: 0.3; }
.squad-name {
  display: block;
  font-family: var(--num);
  font-size: clamp(5.5px, 0.52vw, 8px);
  letter-spacing: 0.08em;
  color: rgba(239, 231, 214, 0.74);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.squad-track { display: block; height: 3px; margin-top: 2px; background: rgba(5, 6, 8, 0.9); }
.squad-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #147ca6, var(--cyan));
  box-shadow: 0 0 5px rgba(55, 200, 255, 0.45);
  transition: width 0.2s steps(5);
}
.squad-chip.red .squad-fill {
  margin-left: auto;
  background: linear-gradient(90deg, #b20d19, var(--crimson));
  box-shadow: 0 0 5px rgba(255, 53, 69, 0.4);
}

.special-btn { border-color: rgba(255, 214, 150, 0.4); }
.special-btn.ready { border-color: rgba(255, 214, 150, 0.78); box-shadow: 0 0 14px rgba(255, 190, 110, 0.18) inset; }
.special-btn.spent { opacity: 0.5; }

/* ---------------- fighter selection ---------------- */
.select-screen { z-index: 74; background: rgba(3, 4, 6, 0.82); backdrop-filter: blur(4px); }
.select-card {
  width: min(1080px, 94vw);
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 2.6vh, 26px) clamp(16px, 2.6vw, 32px);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(24, 26, 30, 0.97), rgba(8, 9, 12, 0.99));
  border: 1px solid rgba(239, 231, 214, 0.22);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.7), inset 0 0 40px rgba(55, 200, 255, 0.03);
  text-align: center;
}
.select-sub {
  margin: 4px auto clamp(9px, 1.5vh, 14px);
  max-width: 640px;
  font-family: var(--text);
  font-weight: 300;
  font-size: clamp(9px, 0.86vw, 12px);
  line-height: 1.4;
  color: rgba(239, 231, 214, 0.54);
}
.roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: clamp(5px, 0.6vw, 8px);
  max-height: 56vh;
  overflow: auto;
  padding: 2px 4px 4px 2px;
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: rgba(55,200,255,0.35) rgba(0,0,0,0.3);
}
.fighter-card {
  --blade: #3aa8ff;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 8px 8px;
  border: 1px solid rgba(239, 231, 214, 0.13);
  border-left: 2px solid rgba(239, 231, 214, 0.2);
  background: linear-gradient(180deg, rgba(20, 23, 28, 0.9), rgba(8, 10, 13, 0.93));
  color: var(--bone);
  text-align: left;
  cursor: pointer;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.fighter-card:hover { border-color: color-mix(in srgb, var(--blade) 55%, transparent); background: linear-gradient(180deg, rgba(25, 30, 36, 0.95), rgba(9, 11, 15, 0.96)); }
.fighter-card.picked {
  border-color: var(--blade);
  box-shadow: 0 0 20px color-mix(in srgb, var(--blade) 22%, transparent), inset 0 0 18px color-mix(in srgb, var(--blade) 8%, transparent);
}
.fighter-card .fc-blade {
  display: block;
  height: 3px;
  width: 100%;
  margin-bottom: 1px;
  background: var(--blade);
  box-shadow: 0 0 8px var(--blade);
}
.fc-head b {
  display: block;
  font-family: var(--text);
  font-weight: 600;
  font-size: clamp(9px, 0.82vw, 12px);
  letter-spacing: 0.07em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-head i {
  display: block;
  margin-top: 1px;
  font-family: var(--num);
  font-style: normal;
  font-size: clamp(6px, 0.55vw, 8px);
  letter-spacing: 0.18em;
  color: color-mix(in srgb, var(--blade) 78%, #efe7d6);
  text-transform: uppercase;
}
.fc-tag {
  display: block;
  font-family: var(--num);
  font-size: clamp(5.5px, 0.48vw, 7px);
  letter-spacing: 0.1em;
  color: rgba(239, 231, 214, 0.44);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-stats { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.fc-stats em {
  font-family: var(--num);
  font-style: normal;
  font-size: 5.5px;
  letter-spacing: 0.06em;
  color: rgba(239, 231, 214, 0.42);
}
.fc-stats u {
  display: flex;
  gap: 1px;
  text-decoration: none;
  flex: 1;
}
.fc-stats s {
  display: block;
  height: 3px;
  flex: 1;
  background: var(--blade);
  opacity: 0.85;
  text-decoration: none;
}
.fc-stats s.off { background: rgba(239, 231, 214, 0.13); opacity: 1; }
.fc-special {
  display: block;
  margin-top: 2px;
  font-family: var(--num);
  font-size: clamp(5.5px, 0.48vw, 7px);
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--blade) 72%, #efe7d6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-badge {
  position: absolute;
  right: 6px;
  top: 8px;
  padding: 1px 4px;
  background: rgba(5, 7, 10, 0.82);
  border: 1px solid var(--blade);
  font-family: var(--disp);
  font-size: 5.5px;
  letter-spacing: 0.12em;
  color: var(--blade);
  opacity: 0;
}
.fighter-card.picked .fc-badge { opacity: 1; }
.select-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: clamp(8px, 1.4vh, 14px);
}

/* ---------------- second touch pad ---------------- */
.touch-pad-2 { display: none; }
@media (pointer: coarse) {
  .touch-pad-2 {
    position: absolute;
    right: var(--pad);
    left: auto;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 19;
    display: none;
    gap: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
  }
  body.local-fight.in-fight .touch-pad-2 { display: flex; opacity: 1; pointer-events: auto; }
  body.local-fight.in-fight .action-bar { bottom: max(92px, calc(env(safe-area-inset-bottom) + 86px)); }
  body.local-fight.in-fight .help-toggle { display: none; }
}

@media (max-width: 1000px) {
  .squad-hud { width: min(620px, 74vw); }
  .roster { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}
@media (max-width: 640px), (max-aspect-ratio: 1/1) {
  .squad-hud { top: clamp(74px, 11vh, 104px); width: 88vw; }
  .squad-name { font-size: 5px; }
  .select-card { width: 96vw; max-height: 94vh; padding: 12px; }
  .roster { grid-template-columns: repeat(2, 1fr); max-height: 58vh; gap: 5px; }
  .fc-head b { font-size: 9px; }
  .fc-tag, .fc-special { font-size: 5.5px; }
  .select-sub { font-size: 8.5px; }
  .modes { grid-template-columns: repeat(4, 1fr); }
}
@media (max-height: 460px) {
  .select-card { padding: 8px 12px; }
  .roster { max-height: 52vh; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); }
  .sheet-kicker { margin-bottom: 2px; }
  .select-sub { display: none; }
  .select-actions { margin-top: 4px; }
}
.mode { opacity: 0.78; cursor: pointer; transition: opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease; }
.mode:hover { opacity: 1; border-color: rgba(55, 200, 255, 0.45); }
.mode.active { opacity: 1; }
/* squad strip clears the title in team fights */
body.team-mode.in-fight .title-stack { width: clamp(150px, 16vw, 230px); opacity: 0.82; }
body.team-mode.in-fight .arena-slot { display: none; }
body.team-mode.in-fight .enemy .meters { display: none; }
body.team-mode.in-fight .squad-hud { top: clamp(150px, 22vh, 210px); width: min(620px, 56vw); }
@media (max-width: 1000px) {
  body.team-mode.in-fight .title-stack { width: clamp(140px, 17vw, 180px); }
  body.team-mode.in-fight .squad-hud { top: clamp(120px, 18vh, 165px); width: min(560px, 66vw); }
}
@media (max-width: 640px), (max-aspect-ratio: 1/1) {
  body.team-mode.in-fight .title-stack { width: 150px; }
  body.team-mode.in-fight .arena-slot { opacity: 0.35; }
  body.team-mode.in-fight .squad-hud { top: 96px; width: 90vw; }
}
@media (max-height: 460px) {
  body.team-mode.in-fight .title-stack { width: 120px; opacity: 0.45; }
  body.team-mode.in-fight .arena-slot { display: none; }
  body.team-mode.in-fight .squad-hud { top: 100px; width: 92vw; }
}
