/* The fight stage: a pixel-art arena (combat/stages.js) behind the fighters,
 * a fighting-game HUD across the top, and arcade juice (sparks, floating
 * damage, shake, announcer). The HUD keeps the SF2 layout in robot-dojo
 * dress: salvaged gauges with hazard trim, a stencilled KO, an LED counter,
 * rusted-chrome announcer lettering, sparks and bolts flying. Decoration only: every number and word shown
 * here is also in the beat headline, captions and beat table, and body.still
 * (motion off) stops every animation in combat.css.
 *
 * Grid: row 1 is the HUD (A bars | round box | B bars), row 2 the arena floor
 * with the fighters, row 3 the move each side just made. The canvas spans
 * rows 1-2. .corner is display: contents so its three parts land in the grid
 * while staying one element for scripts, tests and ARIA. */

.stage.arcade {
  --fighter: 144px;
  --feet: 14px;
  --soot: #0d0f12; --rust: #8a3b12; --rust-2: #c2551b; --hazard: #f2c230; --steel: #9aa6b2; --steel-2: #4b5563; --chrome: #e8edf2; --warn: #e0342b;
  position: relative; display: grid; gap: 0; padding: 0;
  grid-template-columns: minmax(0, 1fr) minmax(84px, 150px) minmax(0, 1fr);
  grid-template-rows: auto minmax(220px, 1fr) auto;
  background: var(--soot); border: 4px solid var(--black); box-shadow: 0 0 0 2px var(--steel-2);
  overflow: hidden; isolation: isolate;
}
.stage.arcade .stage-bg {
  /* Absolute inside its grid area, so the bitmap's size never sizes the grid. */
  position: absolute; inset: 0; grid-row: 1 / 3; grid-column: 1 / -1; width: 100%; height: 100%; display: block; z-index: 0;
  image-rendering: pixelated; image-rendering: crisp-edges; background: var(--soot);
}
.stage.arcade .corner { display: contents; }

/* ---- HUD ------------------------------------------------------------------- */
.stage.arcade .corner-hud {
  grid-row: 1; z-index: 2; min-width: 0; display: flex; flex-direction: column; gap: 4px;
  padding: 8px 10px 16px; background: linear-gradient(to bottom, rgba(8, 9, 11, .82), rgba(8, 9, 11, .5) 70%, transparent);
}
.stage.arcade .corner-A .corner-hud { grid-column: 1; }
.stage.arcade .corner-B .corner-hud { grid-column: 3; text-align: right; }
.stage.arcade .corner-name { font-size: 10px; color: var(--hazard); text-shadow: 2px 2px 0 var(--soot), 3px 3px 0 var(--rust); overflow-wrap: anywhere; }
.stage.arcade .corner-B .corner-name { align-self: flex-end; }
.stage.arcade .cbar { font-size: 8px; text-shadow: 1px 1px 0 var(--black); }
.stage.arcade .cbar-label { margin-bottom: 2px; }
.stage.arcade .cbar-label b { font-size: 9px; }
.stage.arcade .cbar-track { height: 16px; border: 2px solid var(--steel); box-shadow: 0 0 0 2px var(--soot), inset 0 -3px 0 rgba(0, 0, 0, .35); background: #2a0a08; }
/* Stamina: a thin steel conduit, bevelled. */
.stage.arcade .cbar-st .cbar-track { height: 8px; border-color: #c9d1d9 var(--steel-2) var(--steel-2) #c9d1d9; background: var(--soot); }
.stage.arcade .cbar-lost { background: repeating-linear-gradient(90deg, #ff2a2a 0 4px, #ffd200 4px 6px); opacity: .85; }
.stage.arcade .flags { font-size: 8px; }
.stage.arcade .flag:not(.on) { background: rgba(13, 15, 18, .6); border-color: var(--steel-2); }
/* SF2-style: name under the life bar, yellow life, a red chunk for the hit that drains away.
 * The bar is a salvaged gauge: bevelled steel frame, rivets, tick marks, and
 * a strip of hazard tape under it. */
.stage.arcade .corner-hud .cbar-hp { order: 1; }
.stage.arcade .corner-hud .corner-name { order: 2; font-size: 11px; letter-spacing: 1px; }
.stage.arcade .corner-hud .cbar-st { order: 3; }
.stage.arcade .corner-hud .rmarks { order: 4; }
.stage.arcade .corner-hud .flags { order: 5; }
.stage.arcade .cbar-hp .cbar-label span { display: none; }
.stage.arcade .cbar-hp .cbar-label { position: absolute; z-index: 1; top: 3px; left: 6px; right: 6px; margin: 0; justify-content: flex-start; }
.stage.arcade .corner-B .cbar-hp .cbar-label { justify-content: flex-end; flex-direction: row; }
.stage.arcade .cbar-hp .cbar-label b { font-size: 8px; color: var(--soot); text-shadow: 1px 1px 0 rgba(255, 243, 176, .55); }
.stage.arcade .cbar-hp { position: relative; }
.stage.arcade .cbar-hp .cbar-track {
  height: 18px; border: 2px solid; border-color: var(--chrome) var(--steel-2) #2e343c #c9d1d9;
  box-shadow: 0 0 0 1px #6b7480, 0 0 0 3px var(--soot), 3px 3px 0 3px rgba(0, 0, 0, .5);
  background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(0, 0, 0, .45) 9px 10px), linear-gradient(to bottom, #3a0e0a, #22070a);
}
/* Rivets on the frame's ends, above the fill. */
.stage.arcade .cbar-hp::before {
  content: ""; position: absolute; z-index: 2; left: -2px; right: -2px; top: -2px; height: 26px; pointer-events: none;
  background:
    radial-gradient(circle at 3px 3px, #fff 0 1px, var(--steel) 1.5px 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 3px) 3px, #fff 0 1px, var(--steel) 1.5px 2px, transparent 2.5px),
    radial-gradient(circle at 3px calc(100% - 3px), #fff 0 1px, var(--steel) 1.5px 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 3px) calc(100% - 3px), #fff 0 1px, var(--steel) 1.5px 2px, transparent 2.5px);
}
/* Hazard tape under the gauge, with a rusty edge. */
.stage.arcade .cbar-hp::after {
  content: ""; display: block; height: 4px; margin: 4px 1px 0;
  background: repeating-linear-gradient(-45deg, var(--hazard) 0 4px, var(--soot) 4px 8px);
  box-shadow: 0 0 0 1px var(--soot), 0 2px 0 1px var(--rust); opacity: .9;
}
.stage.arcade .corner-B .cbar-hp::after { background: repeating-linear-gradient(45deg, var(--hazard) 0 4px, var(--soot) 4px 8px); }
.stage.arcade .cbar-hp .cbar-fill { background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(120, 70, 0, .35) 9px 10px), linear-gradient(to bottom, #fff3b0 0 22%, var(--hazard) 22% 68%, #c8901a 68%); }
.stage.arcade .cbar-hp .cbar-fill.low { background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(90, 30, 0, .35) 9px 10px), linear-gradient(to bottom, #ffd0a0 0 22%, #ff8c1a 22% 68%, #c8501a 68%); }
.stage.arcade .cbar-hp .cbar-lost { background: linear-gradient(to bottom, #ff7a6a 0 22%, var(--warn) 22% 68%, #9a1a10 68%); opacity: 1; }
.stage.arcade .cbar-hp .cbar-lost.drain { width: 0 !important; transition: width .45s steps(6) .35s; }
.stage.arcade .cbar-st .cbar-label span { font-size: 8px; }
.stage.arcade .rmarks { min-height: 12px; display: flex; gap: 3px; font-size: 12px; }
.stage.arcade .corner-B .rmarks { justify-content: flex-end; }
.stage.arcade .rmark { font-style: normal; color: var(--hazard); text-shadow: 1px 1px 0 var(--soot), -1px -1px 0 var(--rust-2); font-family: var(--font-text); line-height: 1; }

/* The round box in the middle: KO emblem, beats left, round and beat. */
.stage.arcade .center {
  grid-row: 1; grid-column: 2; z-index: 2; align-self: start; margin: 6px auto 0; padding: 5px 6px 6px; min-width: 76px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  /* Its own riveted steel plate (V-06): a sign painted on the stage behind it never shows through the readout. */
  background: linear-gradient(to bottom, rgba(24, 27, 31, .96), rgba(10, 11, 13, .96));
  border: 2px solid; border-color: #6b7480 #2e343c #2e343c #6b7480;
  box-shadow: 0 0 0 2px var(--soot), 3px 3px 0 2px rgba(0, 0, 0, .45);
}
/* KO: red paint sprayed through a stencil onto a scuffed plate. The strip
 * across the letters is the stencil bridge; the soft edge is overspray. */
.stage.arcade .ko-emblem {
  position: relative; display: block; padding: 4px 7px 3px; margin-bottom: 4px; font-size: 13px; letter-spacing: 1px;
  color: rgba(160, 60, 40, .75); text-shadow: none;
  background: radial-gradient(circle at 12% 85%, rgba(194, 85, 27, .5) 0 3px, transparent 4px), radial-gradient(circle at 90% 18%, rgba(138, 59, 18, .5) 0 2px, transparent 3px), linear-gradient(to bottom, #8f897a, #6f6a5d);
  border: 2px solid var(--soot); box-shadow: 0 0 0 1px var(--steel-2);
}
.stage.arcade .ko-emblem::after { content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: 2px; margin-top: -1px; background: #c8c0a8; }
.stage.arcade .ko-emblem.lit {
  color: #fff6e8; text-shadow: 0 0 3px #fff, 0 0 6px rgba(255, 90, 40, .9);
  background: radial-gradient(circle at 50% 50%, #ff7a4a 0 30%, transparent 75%), linear-gradient(to bottom, #e0342b, #8a120a);
  box-shadow: 0 0 0 1px #ffb09a, 0 0 10px 3px rgba(255, 60, 30, .7); animation: fx-plate .5s steps(2) infinite;
}
.stage.arcade .ko-emblem.lit::after { background: rgba(255, 230, 210, .35); }
/* The beats-left clock: a salvaged LED counter with screws in the corners. */
.stage.arcade .clock {
  display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 4px 6px 4px;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .03) 0 1px, transparent 1px 3px), #0b0d0c;
  border: 2px solid; border-color: #c9d1d9 var(--steel-2) #2e343c var(--steel);
  box-shadow: 0 0 0 2px var(--soot), inset 0 0 6px rgba(0, 0, 0, .9);
  position: relative;
}
.stage.arcade .clock::before {
  content: ""; position: absolute; inset: 1px; pointer-events: none;
  background:
    radial-gradient(circle at 2px 2px, var(--steel) 0 1px, transparent 1.5px), radial-gradient(circle at calc(100% - 2px) 2px, var(--steel) 0 1px, transparent 1.5px),
    radial-gradient(circle at 2px calc(100% - 2px), var(--steel) 0 1px, transparent 1.5px), radial-gradient(circle at calc(100% - 2px) calc(100% - 2px), var(--steel) 0 1px, transparent 1.5px);
}
.stage.arcade .clock-n { font-size: 22px; font-weight: normal; line-height: 1.1; color: #ff4a2e; text-shadow: 0 0 4px rgba(255, 74, 46, .85), 0 0 1px #ffd0c0; }
.stage.arcade .clock-l { display: block; max-width: 52px; margin-top: 2px; font-size: 8px; line-height: 1.15; color: #b9c2cb; letter-spacing: 0; white-space: normal; }
.stage.arcade .clock-l:empty { display: none; }
.stage.arcade .round-no { font-size: 8px; margin-top: 5px; color: var(--chrome); text-shadow: 2px 2px 0 var(--soot); }
.stage.arcade .beat-no { font-size: 8px; color: var(--white); margin-top: 3px; min-height: 0; text-shadow: 1px 1px 0 var(--black); }
.stage.arcade .beat-no:empty { display: none; }
.stage.arcade .center-note { margin-top: 4px; font-size: 8px; min-height: 0; color: #c9d1d9; text-shadow: none; }
.stage.arcade .center-note:empty { display: none; }
.stage.arcade .center-note.note-end, .stage.arcade .center-note.note-start { font-size: 8px; color: var(--red); text-shadow: none; }
.stage.arcade .center-note.note-forfeit { font-size: 8px; }

/* ---- fighters on the floor -------------------------------------------------- */
.stage.arcade .fighter-box {
  grid-row: 2; z-index: 1; align-self: end; position: relative; height: auto; display: block;
  width: var(--fighter); margin: 0 6px var(--feet);
}
.stage.arcade .corner-A .fighter-box { grid-column: 1; justify-self: end; }
.stage.arcade .corner-B .fighter-box { grid-column: 3; justify-self: start; }
.stage.arcade .avatar-stage {
  position: relative; z-index: 1; display: block; width: var(--fighter); height: var(--fighter);
  image-rendering: pixelated; shape-rendering: crispEdges; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .6));
}
.stage.arcade .avatar-stage svg { shape-rendering: crispEdges; }
.stage.arcade .corner.down .avatar-stage { opacity: .6; filter: grayscale(1); }
.stage.arcade .fshadow {
  position: absolute; left: 14%; right: 14%; bottom: -5px; height: 10px; z-index: 0;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .6), rgba(0, 0, 0, .35) 60%, transparent);
}
.stage.arcade .corner.winner .avatar-stage { filter: drop-shadow(0 0 3px var(--hazard)) drop-shadow(0 0 1px var(--hazard)); }

/* Pose tags (GUARD, DUCK, ...) sit above the head. */
.stage.arcade .corner .fighter-box::after { top: -16px; left: 50%; right: auto; transform: translateX(-50%); z-index: 2; white-space: nowrap; }

/* Damage number: static with motion off; floats up with motion on. */
.stage.arcade .pop {
  z-index: 3; top: 8%; font-size: 20px; color: var(--warn);
  text-shadow: 2px 0 0 var(--soot), -2px 0 0 var(--soot), 0 2px 0 var(--soot), 0 -2px 0 var(--soot), 3px 3px 0 var(--hazard);
}
.stage.arcade .corner-A .pop { left: auto; right: -14px; }
.stage.arcade .corner-B .pop { right: auto; left: -14px; }
.stage.arcade .pop.go { animation: fx-float .9s steps(9) forwards; }
@keyframes fx-float {
  0% { transform: translateY(6px) scale(.6); opacity: 1; }
  15% { transform: translateY(-4px) scale(1.25); }
  30% { transform: translateY(-8px) scale(1); }
  80% { opacity: 1; }
  100% { transform: translateY(var(--rise, -34px)); opacity: 0; }
}

/* Hit spark at the point of contact (the struck side's inner edge): a burst
 * of hot metal streaks, and a nut and a bolt knocked loose. */
.stage.arcade .fx-spark {
  position: absolute; z-index: 2; top: 30%; width: 48px; height: 48px; opacity: 0; pointer-events: none;
  background:
    radial-gradient(circle, #fff 0 9%, #ffe9a0 10% 16%, transparent 17%),
    linear-gradient(0deg, transparent 47%, #fff3c0 47% 53%, transparent 53%),
    linear-gradient(90deg, transparent 46%, #ffd24a 46% 54%, transparent 54%),
    linear-gradient(35deg, transparent 48%, #ffb030 48% 52%, transparent 52%),
    linear-gradient(-35deg, transparent 48%, #fff3c0 48% 52%, transparent 52%),
    linear-gradient(65deg, transparent 48.5%, #ff8a2a 48.5% 51.5%, transparent 51.5%),
    linear-gradient(-65deg, transparent 48.5%, #ffd24a 48.5% 51.5%, transparent 51.5%);
}
.stage.arcade .fx-spark.big { width: 68px; height: 68px; top: 24%; filter: drop-shadow(0 0 3px #ff8a2a); }
.stage.arcade .fx-spark::before, .stage.arcade .fx-spark::after { content: ""; position: absolute; left: 50%; top: 50%; opacity: 0; }
/* a hex nut */
.stage.arcade .fx-spark::before {
  width: 8px; height: 8px; margin: -4px 0 0 -4px; background: radial-gradient(circle, var(--soot) 0 1.5px, #c9d1d9 2px 3px, var(--steel-2) 3.5px);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
/* a bolt: head and shank */
.stage.arcade .fx-spark::after { width: 4px; height: 10px; margin: -5px 0 0 -2px; background: linear-gradient(to bottom, #e8edf2 0 30%, var(--steel) 30% 100%); box-shadow: -1px 0 0 var(--soot), 1px 0 0 var(--soot); }
.stage.arcade .corner-A .fx-spark { right: -18px; }
.stage.arcade .corner-B .fx-spark { left: -18px; }
.stage.arcade .fx-spark.go { animation: fx-spark .45s steps(5) forwards; }
.stage.arcade .fx-spark.go::before { animation: fx-nut .45s steps(5) forwards; }
.stage.arcade .fx-spark.go::after { animation: fx-bolt .45s steps(5) forwards; }
@keyframes fx-spark {
  0% { opacity: 1; transform: scale(.3) rotate(0deg); }
  35% { opacity: 1; transform: scale(1.15) rotate(12deg); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.3) rotate(20deg); }
}
@keyframes fx-nut { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(-26px, -30px) rotate(300deg); } }
@keyframes fx-bolt { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(24px, -36px) rotate(-420deg); } }

/* BLOCKED / EVADE: feedback only; the words are also in the move line below. */
.stage.arcade .fx-word {
  position: absolute; z-index: 3; top: 12%; left: 50%; transform: translateX(-50%); opacity: 0; white-space: nowrap;
  font-size: 11px; color: var(--cyan); text-shadow: 2px 0 0 var(--black), -2px 0 0 var(--black), 0 2px 0 var(--black), 0 -2px 0 var(--black);
}
.stage.arcade .fx-word.w-evade { color: var(--green); }
.stage.arcade .fx-word.go { animation: fx-word .8s steps(8) forwards; }
@keyframes fx-word {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(.6); }
  20% { opacity: 1; transform: translate(-50%, -2px) scale(1.2); }
  35% { transform: translate(-50%, -4px) scale(1); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -18px); }
}

/* ---- candidate-3 moves: LAST STAND and FEINT ----------------------------------- */
/* The move's callout sits where the pose tags do, above the head, and is set
 * from the frame (motion off shows it too); motion adds the entrance. */
.stage.arcade .fx-call {
  position: absolute; z-index: 4; top: -34px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-size: 8px; padding: 2px 4px; background: var(--black); border: 1px solid currentColor; display: none;
}
.stage.arcade .fx-call.c-stand { display: block; color: #ffb35a; border-color: #ff3a1e; box-shadow: 0 0 0 1px #4a0806, 0 0 8px 1px rgba(255, 58, 30, .55); }
.stage.arcade .fx-call.c-feint { display: block; color: #9fe0e6; border-color: #5f98a2; }
.stage.arcade .fx-call.go { animation: fx-call .5s steps(4) both; }
@keyframes fx-call { 0% { transform: translateX(-50%) scale(1.8); opacity: 0; } 50% { transform: translateX(-50%) scale(.9); opacity: 1; } 100% { transform: translateX(-50%) scale(1); } }

/* LAST STAND's reactor: a red glow behind the chest whose size and heat
 * follow the bonus dealt (data-stand 0-3: embers, warm, hot, white-hot). It
 * stays lit on the beat with motion off; motion adds the burst. */
.stage.arcade .fx-reactor {
  position: absolute; z-index: 0; left: 50%; bottom: 22%; width: 72px; height: 72px; margin-left: -36px; border-radius: 50%;
  pointer-events: none; opacity: 0; --heat: 0;
  background: radial-gradient(closest-side, #fff0a8 0 12%, #ff9a3a 13% 30%, #ff3a1e 31% 58%, rgba(163, 20, 12, .55) 59% 80%, transparent 81%);
}
.stage.arcade .corner[data-stand] .fx-reactor { opacity: calc(.35 + .2 * var(--heat)); transform: scale(calc(.8 + .35 * var(--heat))); }
.stage.arcade .corner[data-stand="0"] .fx-reactor { --heat: 0; filter: saturate(.6) brightness(.7); }
.stage.arcade .corner[data-stand="1"] .fx-reactor { --heat: 1; }
.stage.arcade .corner[data-stand="2"] .fx-reactor { --heat: 2; }
.stage.arcade .corner[data-stand="3"] .fx-reactor { --heat: 3; filter: drop-shadow(0 0 6px #ff3a1e); }
.stage.arcade .corner[data-stand] .avatar-stage { filter: drop-shadow(0 0 calc(1px + 1px * var(--heat, 0)) #ff3a1e); }
.stage.arcade .corner[data-stand="0"] .avatar-stage { --heat: 0; }
.stage.arcade .corner[data-stand="1"] .avatar-stage { --heat: 1; }
.stage.arcade .corner[data-stand="2"] .avatar-stage { --heat: 2; }
.stage.arcade .corner[data-stand="3"] .avatar-stage { --heat: 3; }
.stage.arcade .fx-reactor.go { animation: fx-reactor .7s steps(7) both; }
@keyframes fx-reactor {
  0% { transform: scale(.3); opacity: 0; }
  30% { transform: scale(calc(1.1 + .45 * var(--heat))); opacity: 1; }
  60% { transform: scale(calc(.9 + .35 * var(--heat))); opacity: .9; }
  100% { transform: scale(calc(.8 + .35 * var(--heat))); opacity: calc(.35 + .2 * var(--heat)); }
}
/* Coolant: two pixel clouds rising off the shoulders. */
.stage.arcade .fx-steam { position: absolute; z-index: 3; left: 50%; top: 18%; width: 0; height: 0; pointer-events: none; }
.stage.arcade .fx-steam i {
  position: absolute; width: 10px; height: 8px; opacity: 0;
  background: #e8f4fa; box-shadow: 4px -4px 0 #d4e2ea, -3px -7px 0 #eef7fb, 2px -11px 0 #d4e2ea, 0 0 0 1px #9aacb6;
}
.stage.arcade .fx-steam i:first-child { left: -30px; }
.stage.arcade .fx-steam i:last-child { left: 18px; }
.stage.arcade .fx-steam.go i { animation: fx-steam .8s steps(8) forwards; }
.stage.arcade .fx-steam.go i:last-child { animation-delay: .06s; }
@keyframes fx-steam {
  0% { opacity: 0; transform: translate(0, 10px) scale(.4); }
  20% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(0, -30px) scale(1.8); }
}
/* FEINT: a pale teal afterimage streak that the fighter leaves behind as it
 * snaps back (the clip itself also draws a ghost of the half-thrown jab). */
.stage.arcade .fx-ghost {
  position: absolute; z-index: 1; bottom: 30%; width: 34px; height: 28px; opacity: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, transparent 0 18%, #8cc4cc 18% 26%, transparent 26% 44%, #5f98a2 44% 52%, transparent 52% 70%, #3c6a72 70% 78%, transparent 78%);
}
.stage.arcade .corner-A .fx-ghost { right: -12px; }
.stage.arcade .corner-B .fx-ghost { left: -12px; transform: scaleX(-1); }
.stage.arcade .fx-ghost.go { animation: fx-ghost .45s steps(5) forwards; }
.stage.arcade .corner-B .fx-ghost.go { animation-name: fx-ghost-b; }
@keyframes fx-ghost { 0% { opacity: .9; transform: translateX(8px); } 100% { opacity: 0; transform: translateX(-16px); } }
@keyframes fx-ghost-b { 0% { opacity: .9; transform: scaleX(-1) translateX(8px); } 100% { opacity: 0; transform: scaleX(-1) translateX(-16px); } }
.stage.arcade .fx-word.w-bait { color: #9fe0e6; font-size: 13px; }
.stage.arcade .fx-word.w-whiff { color: var(--steel); }
@media (max-width: 700px) {
  .stage.arcade .fx-call { font-size: 7px; top: -26px; }
  .stage.arcade .fx-reactor { width: 54px; height: 54px; margin-left: -27px; }
  .stage.arcade .fx-steam i:first-child { left: -24px; }
  .stage.arcade .fx-steam i:last-child { left: 12px; }
}

/* WINNER plate over the winner at the end (also shown with motion off). */
/* A stencilled steel plate, riveted, with a hazard-striped edge. */
.stage.arcade .win-plate {
  display: none; position: absolute; z-index: 3; bottom: calc(100% + 18px); left: 50%; transform: translateX(-50%);
  padding: 5px 9px 4px; font-size: 10px; letter-spacing: 1px; color: #1a1c20; white-space: nowrap;
  background:
    radial-gradient(circle at 3px 50%, #fff 0 1px, var(--steel-2) 1.5px 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 3px) 50%, #fff 0 1px, var(--steel-2) 1.5px 2px, transparent 2.5px),
    linear-gradient(to bottom, var(--chrome) 0%, #b8c1cb 45%, #8b939c 55%, #c9d1d9 100%);
  border: 2px solid var(--soot); border-bottom-width: 4px; border-image: repeating-linear-gradient(-45deg, var(--hazard) 0 3px, var(--soot) 3px 6px) 2 2 4 2;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .6); text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
}
.stage.arcade .corner.winner .win-plate { display: block; animation: fx-plate 1.2s steps(2) infinite; }
@keyframes fx-plate { 50% { filter: brightness(1.3); } }

/* ---- announcer ------------------------------------------------------------------ */
.stage.arcade .announcer {
  grid-row: 2; grid-column: 1 / -1; z-index: 4; align-self: start; justify-self: center; margin-top: 18px;
  pointer-events: none; display: none; text-align: center;
}
.stage.arcade .announcer.on { display: block; }
/* Rusted chrome: a steel gradient with a hard horizon line, rust creeping up
 * from the bottom edge, a heavy soot outline and a rust drop shadow. */
.stage.arcade .announcer { filter: drop-shadow(3px 0 0 var(--soot)) drop-shadow(-3px 0 0 var(--soot)) drop-shadow(0 3px 0 var(--soot)) drop-shadow(0 -3px 0 var(--soot)) drop-shadow(5px 5px 0 rgba(138, 59, 18, .9)); }
.stage.arcade .announcer span {
  display: inline-block; font-size: clamp(24px, 4.4vw, 48px); line-height: 1.15; white-space: nowrap; padding: 2px 0;
  background: linear-gradient(to bottom, #ffffff 0%, #e8edf2 20%, #aab4bf 44%, #3e4650 50%, #7c8794 54%, #d8dee5 68%, #c9a48a 80%, #c2551b 90%, #7a2e10 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  /* Press Start 2P spaces and dots are a full cell wide: close them up (V-32). */
  word-spacing: -.45em;
}
.stage.arcade .announcer.ann-ko span { letter-spacing: -.18em; }
.stage.arcade .announcer.ann-ko span { font-size: clamp(34px, 6.4vw, 68px); background-image: linear-gradient(to bottom, #ffffff 0%, #e8edf2 20%, #aab4bf 44%, #3e4650 50%, #8a5a50 56%, #ff6a4a 70%, #e0342b 84%, #7a1208 100%); }
.stage.arcade .announcer.ann-win span { background-image: linear-gradient(to bottom, #ffffff 0%, #e8edf2 20%, #aab4bf 44%, #3e4650 50%, #7c8794 54%, #fff0b0 68%, #f2c230 82%, #a8741a 100%); }
.stage.arcade .announcer.ann-fight span { font-size: clamp(30px, 5.6vw, 60px); }
.stage.arcade .announcer.ann-win span { font-size: clamp(22px, 3.6vw, 40px); }
.stage.arcade .announcer.enter span { animation: fx-enter .28s steps(4) both; }
.stage.arcade .announcer.leave span { animation: fx-leave .3s steps(3) forwards; }
@keyframes fx-enter { 0% { transform: scale(2.6); opacity: 0; } 60% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1); } }
@keyframes fx-leave { to { transform: scale(1.3); opacity: 0; } }

/* ---- shake and power flash ---------------------------------------------------- */
.stage.arcade .fx-flash { grid-row: 1 / 3; grid-column: 1 / -1; z-index: 5; background: #fff4e0; opacity: 0; pointer-events: none; }
.stage.arcade.flash-power .fx-flash { animation: fx-flash .22s steps(2) forwards; }
@keyframes fx-flash { 0% { opacity: .75; } 100% { opacity: 0; } }
.stage.arcade.shake { animation: fx-shake .26s steps(1) 1; }
.stage.arcade.shake-big { animation: fx-shake-big .4s steps(1) 1; }
@keyframes fx-shake { 0% { transform: translate(4px, -2px); } 25% { transform: translate(-4px, 2px); } 50% { transform: translate(3px, 1px); } 75% { transform: translate(-2px, -1px); } 100% { transform: none; } }
@keyframes fx-shake-big { 0% { transform: translate(8px, -4px); } 20% { transform: translate(-8px, 3px); } 40% { transform: translate(6px, 2px); } 60% { transform: translate(-5px, -2px); } 80% { transform: translate(2px, 1px); } 100% { transform: none; } }
/* The hit flash from combat.css, on the sprite only. */
.stage.arcade .corner.flash-hit .fighter-box { animation: none; }
.stage.arcade .corner.flash-hit .avatar-stage { animation: hitflash .3s steps(2) 1; }

/* ---- the move line under the arena ---------------------------------------------- */
.stage.arcade .side-now {
  grid-row: 3; z-index: 2; min-height: 44px; padding: 8px 10px; font-size: 9px;
  background: linear-gradient(to bottom, #181b1f, #0e1012); border-top: 3px solid var(--black);
}
.stage.arcade .corner-A .side-now { grid-column: 1 / 3; }
.stage.arcade .corner-B .side-now { grid-column: 3; text-align: right; }
.stage.arcade::after { content: ""; grid-row: 3; grid-column: 1 / -1; background: linear-gradient(to bottom, #181b1f, #0e1012); border-top: 3px solid var(--black); z-index: 1; }

/* ---- smaller stages ------------------------------------------------------------ */
.compact .stage.arcade { --fighter: 96px; --feet: 10px; grid-template-rows: auto minmax(160px, 1fr) auto; }
.compact .stage.arcade .announcer span, .compact .stage.arcade .announcer.ann-fight span, .compact .stage.arcade .announcer.ann-win span { font-size: clamp(18px, 3vw, 30px); }
.compact .stage.arcade .announcer.ann-ko span { font-size: clamp(22px, 4vw, 40px); }

@media (max-width: 700px) {
  .stage.arcade { --fighter: 96px; --feet: 10px; grid-template-columns: minmax(0, 1fr) 74px minmax(0, 1fr); grid-template-rows: auto minmax(170px, 1fr) auto; }
  /* Above the move strip (z 2), so the flags placed over it stay visible. */
  .stage.arcade .corner-hud { padding: 6px 6px 10px; gap: 3px; z-index: 3; }
  .stage.arcade .cbar-label { font-size: 8px; }
  .stage.arcade .cbar-label b { font-size: 8px; }
  .stage.arcade .cbar-track { height: 12px; }
  .stage.arcade .cbar-st .cbar-track { height: 6px; }
  /* The flags leave the HUD for the strip under the arena, so the HUD covers
     less of the fighters (V-25). The stage is their containing block. */
  .stage.arcade .flags { position: absolute; z-index: 3; bottom: 6px; max-width: calc(50% - 9px); gap: 3px; font-size: 8px; line-height: 1.2; }
  .stage.arcade .corner-A .flags { left: 6px; }
  .stage.arcade .corner-B .flags { right: 6px; }
  .stage.arcade .flag { padding: 1px 3px; }
  .stage.arcade .side-now { padding-bottom: 42px; }
  .stage.arcade .center { grid-column: 2; grid-row: 1; min-width: 0; width: 70px; padding: 4px 3px 5px; margin-top: 6px; }
  .stage.arcade .round-no { font-size: 8px; line-height: 1.3; }
  .stage.arcade .beat-no { font-size: 8px; line-height: 1.3; }
  .stage.arcade .ko-emblem { font-size: 9px; padding: 3px 5px 2px; }
  .stage.arcade .cbar-hp::before { height: 22px; }
  .stage.arcade .cbar-hp::after { height: 3px; margin-top: 3px; }
  .stage.arcade .clock { min-width: 0; width: 56px; padding: 2px; }
  .stage.arcade .clock-n { font-size: 16px; }
  /* The number alone says it; BEATS LEFT would need a sub-8 px face here. */
  .stage.arcade .clock-l { display: none; }
  .stage.arcade .corner-hud .corner-name { font-size: 8px; }
  .stage.arcade .cbar-hp .cbar-track { height: 14px; }
  .stage.arcade .cbar-hp .cbar-label { top: 1px; }
  .stage.arcade .cbar-hp .cbar-label b { font-size: 8px; }
  .stage.arcade .fighter-box { margin: 0 2px var(--feet); }
  /* Damage numbers sit lower and rise less, clear of the pose tag above the head. */
  .stage.arcade .pop { font-size: 15px; top: 32%; --rise: -18px; }
  .stage.arcade .side-now { font-size: 8px; padding-left: 6px; padding-right: 6px; padding-top: 6px; }
  .stage.arcade .act { white-space: normal; }
  .compact .stage.arcade { --fighter: 72px; }
  .stage.arcade .announcer { max-width: 100%; padding: 0 6px; }
  .stage.arcade .announcer span, .stage.arcade .announcer.ann-fight span, .stage.arcade .announcer.ann-win span { font-size: 22px; white-space: normal; }
  .stage.arcade .announcer.ann-ko span { font-size: 28px; white-space: normal; }
  .stage.arcade .center-note { display: none; }
  .stage.arcade .win-plate { font-size: 8px; bottom: calc(100% + 14px); }
}
@media (max-width: 380px) {
  .stage.arcade { --fighter: 72px; }
}

/* ---- title attract card: a small stage behind the two fighters ---------------------- */
.attract-arena { position: relative; display: block; width: 100%; height: 184px; overflow: hidden; border: 3px solid var(--black); }
.attract-arena .stage-bg { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.attract-arena .attract-vs { position: absolute; left: 0; right: 0; bottom: 8px; justify-content: center; gap: 28px; align-items: flex-end; }
.attract-arena .attract-vs .avatar-lg { width: 144px; height: 144px; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .45)); }
.attract-arena .attract-vs .avatar-lg:last-child { transform: scaleX(-1); }
.attract-arena .attract-vs .avatar-lg:last-child svg { transform: none; }
.attract-arena .vs { align-self: center; font-size: 16px; color: #f2c230; text-shadow: 2px 0 0 #0d0f12, -2px 0 0 #0d0f12, 0 2px 0 #0d0f12, 0 -2px 0 #0d0f12, 3px 3px 0 #8a3b12; }
.attract-arena .stage-name { position: absolute; left: 6px; top: 5px; font-size: 8px; color: var(--white); text-shadow: 1px 1px 0 var(--black); opacity: .85; }

@media (prefers-reduced-motion: reduce) {
  .stage.arcade *, .stage.arcade *::before, .stage.arcade *::after, .stage.arcade { animation: none !important; }
}
/* VS on the attract card: rusted chrome, like the announcer. */
.attract-arena .vs-fire {
  padding: 0 4px; font-size: 34px; line-height: 1.1;
  background: linear-gradient(to bottom, #ffffff 0%, #e8edf2 20%, #aab4bf 44%, #3e4650 50%, #7c8794 54%, #d8dee5 68%, #c9a48a 80%, #c2551b 90%, #7a2e10 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none;
  filter: drop-shadow(3px 0 0 #0d0f12) drop-shadow(-3px 0 0 #0d0f12) drop-shadow(0 3px 0 #0d0f12) drop-shadow(0 -3px 0 #0d0f12) drop-shadow(4px 4px 0 rgba(138, 59, 18, .9));
}
.attract-card:has(.attract-arena) { padding: 12px; }
@media (max-width: 700px) {
  .attract-arena { height: 150px; }
  .attract-arena .attract-vs { gap: 10px; }
  .attract-arena .attract-vs .avatar-lg { width: 96px; height: 96px; }
  .attract-arena .vs-fire { font-size: 24px; }
}
