:root {
  --ink: #17131f;
  --paper: #fff7dc;
  --yellow: #ffdc3d;
  --red: #ff4057;
  --blue: #43b9ff;
  --mint: #60e6a8;
  --shadow: 5px 6px 0 var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--yellow);
  font-family: "Trebuchet MS", Arial, system-ui, sans-serif;
  font-weight: 900;
}

button, input { font: inherit; }
button { color: inherit; }

.halftone {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: radial-gradient(var(--ink) 1.3px, transparent 1.4px);
  background-size: 9px 9px;
}

.game-shell {
  position: relative;
  width: min(100%, 920px);
  max-width: 100vw;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  overflow-x: clip;
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 56px;
}

.lucky-retry { position: absolute; z-index: 24; bottom: 10px; left: 50%; width: 66px; height: 58px; display: grid; grid-template-rows: 1fr auto; place-items: center; gap: 0; padding: 4px; border: 3px solid rgba(23,19,31,.8); border-radius: 9px; background: rgba(238,255,240,.88); color: #16935d; box-shadow: 3px 3px 0 rgba(23,19,31,.75); transform: translateX(-50%); transition: filter .25s, opacity .25s; }
.lucky-retry span { font-size: 2rem; line-height: .8; filter: drop-shadow(1px 1px 0 #fff); }
.lucky-retry small { font-size: .52rem; letter-spacing: .08em; }
.lucky-retry.used { color: #777; filter: grayscale(1); opacity: .68; }

.mini-logo {
  font-family: "Bangers", Impact, sans-serif;
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  letter-spacing: .04em;
  transform: rotate(-2deg);
}

.mini-logo span { color: var(--red); text-shadow: 2px 2px 0 var(--ink); }

.run-score {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 14px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  box-shadow: 3px 4px 0 var(--ink);
  transform: rotate(1deg);
}

.run-score small { font-size: .68rem; }
.run-score strong { font-family: "Bangers", Impact, sans-serif; font-size: 1.65rem; }

.round-button {
  justify-self: end;
  width: 42px;
  height: 42px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}

.round-button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.screen { position: relative; }
.screen[hidden] { display: none !important; }

.menu-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .85fr);
  gap: 18px 28px;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 8px 3% 12px;
}

.menu-screen > * { min-width: 0; max-width: 100%; }

.burst-title { grid-column: 1 / -1; text-align: center; }
.burst-title p {
  position: relative;
  z-index: 2;
  display: inline-block;
  margin: 0 0 13px;
  padding: 3px 12px;
  color: #fff;
  background: var(--ink);
  transform: rotate(-1deg);
  font-size: clamp(.65rem, 2.5vw, .9rem);
  letter-spacing: .12em;
}

.burst-title h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: "Bangers", Impact, sans-serif;
  font-size: clamp(4.5rem, 14vw, 8.8rem);
  line-height: .76;
  letter-spacing: .025em;
  text-shadow: 4px 5px 0 #fff, 8px 10px 0 var(--ink);
  transform: rotate(-2deg);
}

.burst-title h1 span { color: var(--red); }

.menu-fighter-wrap { display: grid; justify-items: center; align-self: end; }

.dice-button {
  z-index: 4;
  margin-top: -9px;
  padding: 8px 16px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--blue);
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  transform: rotate(-2deg);
}

.dice-button span { font-size: 1.4rem; }
.dice-button:hover { transform: rotate(2deg) scale(1.04); }

.start-card {
  padding: 19px;
  border: 4px solid var(--ink);
  border-radius: 14px 18px 12px 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
  transform: rotate(1deg);
}

.start-card label { display: block; margin-bottom: 6px; font-size: .78rem; letter-spacing: .12em; }

.start-card input {
  width: 100%;
  padding: 12px 13px;
  border: 3px solid var(--ink);
  border-radius: 5px;
  outline: none;
  background: #fff;
  text-transform: uppercase;
}

.start-card input:focus { box-shadow: 0 0 0 4px var(--blue); }
.lock-note { margin: 10px 0 4px; font-size: .72rem; line-height: 1.3; }
.form-message { min-height: 1.2em; margin: 3px 0; color: #c4102f; font-size: .74rem; }
.privacy-note { margin: 10px 0 0; font-size: .66rem; font-weight: 700; line-height: 1.45; }
.privacy-note a { color: #9a0d29; text-underline-offset: 2px; }
.privacy-note a:hover, .privacy-note a:focus-visible { color: #005f91; }

.comic-button {
  width: 100%;
  padding: 13px 18px;
  border: 4px solid var(--ink);
  border-radius: 50% 45% 48% 43%;
  background: var(--red);
  color: #fff;
  font-family: "Bangers", Impact, sans-serif;
  font-size: 1.65rem;
  letter-spacing: .06em;
  text-shadow: 2px 2px 0 var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer;
}

.comic-button:hover { transform: translateY(-2px) rotate(-1deg); }
.comic-button:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.comic-button:disabled { cursor: wait; opacity: .65; }

.leader-chip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(100%, 620px);
  margin: 2px auto 0;
  padding: 9px 15px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  box-shadow: 3px 4px 0 var(--ink);
  cursor: pointer;
}

.leader-chip span { color: #b06800; }
.leader-chip strong { overflow: hidden; text-overflow: ellipsis; text-align: left; white-space: nowrap; }
.leader-chip em { font-family: "Bangers", Impact, sans-serif; font-size: 1.45rem; font-style: normal; }
.title-id { grid-column: 1 / -1; margin: 0; text-align: center; font-size: .6rem; letter-spacing: .16em; opacity: .65; }

/* Stick fighters are built from CSS parts so every roll can mix silhouettes. */
.fighter {
  --skin: #f2b47d;
  --gear: #43b9ff;
  --accent: #ff4057;
  position: relative;
  width: 150px;
  height: 244px;
  transform-origin: 50% 94%;
  filter: drop-shadow(4px 5px 0 rgba(23, 19, 31, .22));
}

.fighter-menu { width: 170px; height: 265px; }
.fighter-enemy { transform: scaleX(-1) scale(var(--enemy-scale, 1)); }
.fighter-result { transform: rotate(76deg); }

.fighter .head {
  position: absolute;
  z-index: 5;
  top: 15px;
  left: 45px;
  width: 62px;
  height: 62px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--skin);
}

.fighter .eye {
  position: absolute;
  top: 23px;
  width: 6px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.fighter .eye.one { left: 16px; }
.fighter .eye.two { right: 16px; }
.fighter .mouth { position: absolute; left: 20px; bottom: 10px; width: 21px; border-bottom: 4px solid var(--ink); transform: rotate(-3deg); }

.fighter .body {
  position: absolute;
  z-index: 3;
  top: 75px;
  left: 48px;
  width: 58px;
  height: 90px;
  border: 4px solid var(--ink);
  border-radius: 35% 35% 14% 14%;
  background: var(--gear);
}

.fighter .body::after { content: ""; position: absolute; inset: 16px 9px auto; border-top: 5px solid var(--accent); transform: rotate(-10deg); }
.fighter .arm, .fighter .leg { position: absolute; z-index: 2; width: 17px; border: 4px solid var(--ink); background: var(--skin); transform-origin: 50% 4px; }
.fighter .arm { top: 83px; height: 93px; border-radius: 10px; }
.fighter .arm.front { z-index: 6; left: 101px; transform: rotate(-56deg); }
.fighter .arm.back { left: 36px; transform: rotate(43deg); }
.fighter .glove { position: absolute; bottom: -13px; left: -8px; width: 26px; height: 26px; border: 4px solid var(--ink); border-radius: 50%; background: var(--accent); }
.fighter .leg { top: 157px; height: 79px; background: var(--gear); }
.fighter .leg.front { left: 86px; transform: rotate(-16deg); }
.fighter .leg.back { left: 54px; transform: rotate(17deg); }
.fighter .boot { position: absolute; bottom: -8px; left: -9px; width: 31px; height: 18px; border: 4px solid var(--ink); border-radius: 50% 50% 4px 4px; background: var(--accent); }

.fighter.skin-2 { --skin: #8e5539; }
.fighter.skin-3 { --skin: #f6d05c; }
.fighter.skin-4 { --skin: #a9dfec; }
.fighter.gear-2 { --gear: #60e6a8; --accent: #8d4dff; }
.fighter.gear-3 { --gear: #ff7a3d; --accent: #2c79ff; }
.fighter.gear-4 { --gear: #d989ff; --accent: #ffdc3d; }
.fighter.gear-5 { --gear: #fff7dc; --accent: #ff4057; }
.fighter.head-square .head { border-radius: 8px; }
.fighter.head-tall .head { top: 7px; height: 75px; border-radius: 46%; }
.fighter.head-flat .head { height: 51px; top: 25px; border-radius: 48% 48% 20% 20%; }
.fighter.head-point .head { border-radius: 52% 52% 48% 48% / 25% 25% 70% 70%; }
.fighter.head-wide .head { left: 38px; width: 76px; height: 55px; top: 22px; }
.fighter.head-tiny .head { left: 54px; top: 26px; width: 48px; height: 48px; }
.fighter.head-mohawk .head::before { content: ""; position: absolute; left: 20px; top: -23px; width: 19px; height: 24px; border: 4px solid var(--ink); border-bottom: 0; background: var(--accent); clip-path: polygon(0 100%, 20% 0, 50% 65%, 80% 0, 100% 100%); }
.fighter.head-hat .head::before { content: ""; position: absolute; left: -9px; top: -17px; width: 72px; height: 18px; border: 4px solid var(--ink); border-radius: 50% 50% 8px 8px; background: var(--accent); }
.fighter.head-goggles .eye { width: 14px; height: 14px; top: 18px; border: 3px solid var(--ink); background: var(--blue); }
.fighter.head-goggles .eye.one { left: 8px; } .fighter.head-goggles .eye.two { right: 8px; }
.fighter.body-round .body { width: 68px; left: 43px; border-radius: 46%; }
.fighter.body-thin .body { width: 46px; left: 54px; }
.fighter.body-box .body { border-radius: 5px; }
.fighter.body-cape .body::before { content: ""; position: absolute; z-index: -1; top: 14px; right: -25px; width: 30px; height: 68px; border: 4px solid var(--ink); border-left: 0; border-radius: 0 70% 55% 0; background: var(--accent); }
.fighter.body-belt .body::after { inset: auto -4px 14px; border-top: 10px solid var(--accent); }
.fighter.body-star .body::before { content: "★"; position: absolute; top: 24px; left: 13px; color: var(--accent); font-size: 28px; }
.fighter.body-tie .body::before { content: "▼"; position: absolute; top: 10px; left: 16px; color: var(--accent); font-size: 22px; }
.fighter.legs-short .leg { top: 166px; height: 60px; }
.fighter.legs-long .leg { top: 147px; height: 94px; }
.fighter.legs-wide .leg.front { transform: rotate(-29deg); } .fighter.legs-wide .leg.back { transform: rotate(30deg); }
.fighter.legs-spring .leg { background: repeating-linear-gradient(to bottom, var(--paper) 0 7px, var(--ink) 7px 11px); }
.fighter.legs-bigboots .boot { width: 42px; height: 24px; left: -13px; }
.fighter.legs-skirt .leg.back::before { content: ""; position: absolute; z-index: 4; left: -25px; top: -13px; width: 70px; height: 34px; border: 4px solid var(--ink); background: var(--accent); clip-path: polygon(16% 0, 84% 0, 100% 100%, 0 100%); }

.arena-screen { min-height: calc(100svh - 70px); }
.fight-head { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 50px; text-align: center; }
.fight-head > div:first-child { display: flex; align-items: baseline; gap: 6px; }
.fight-head strong { font-family: "Bangers", Impact, sans-serif; font-size: 2rem; }
.fight-head small { font-size: .65rem; letter-spacing: .12em; }
.venue-tag { padding: 4px 9px; border: 2px solid var(--ink); border-radius: 12px; background: var(--mint); font-size: .62rem; letter-spacing: .06em; transform: rotate(1deg); }
.enemy-tag { padding: 5px 11px; border: 3px solid var(--ink); background: #fff; transform: rotate(-1deg); font-size: .72rem; }
.boss-tag { padding: 4px 10px; border: 3px solid var(--ink); background: var(--red); color: #fff; transform: rotate(4deg); font-family: "Bangers", Impact, sans-serif; font-size: 1.25rem; }

.arena {
  --sky: #ffc978;
  --sky-soft: #ffe9ae;
  --ground: #b97455;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr 70px 1fr;
  align-items: end;
  min-height: min(630px, calc(100svh - 125px));
  padding: 105px 20px 135px;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 18px;
  background:
    radial-gradient(circle at 78% 14%, rgba(255,255,255,.75) 0 5%, transparent 5.5%),
    linear-gradient(165deg, transparent 55%, rgba(23,19,31,.1) 55.2% 56%, transparent 56.2%),
    linear-gradient(var(--sky) 0 38%, var(--sky-soft) 38% 55%, #fff7dc 55% 58%, var(--ground) 58%);
  box-shadow: var(--shadow);
  transition: background .45s ease;
}

.arena::before { content: ""; position: absolute; z-index: 1; inset: 55% 0 auto; border-top: 4px solid var(--ink); }
.arena-scenery { position: absolute; z-index: 0; right: 0; bottom: 42%; left: 0; height: 35%; pointer-events: none; opacity: .72; transition: background .45s ease, opacity .45s ease; }

.arena.theme-slum { --sky: #ffb873; --sky-soft: #ffe09c; --ground: #ad6f4e; }
.arena.theme-slum .arena-scenery {
  background:
    linear-gradient(145deg, transparent 0 47%, var(--ink) 48% 51%, transparent 52%) 7% 24% / 31% 52% no-repeat,
    linear-gradient(35deg, transparent 0 47%, var(--ink) 48% 51%, transparent 52%) 92% 26% / 35% 54% no-repeat,
    repeating-linear-gradient(90deg, #985b4c 0 13%, #6f4140 13% 16%, #d18861 16% 29%, #5d3d3b 29% 32%);
  clip-path: polygon(0 20%, 8% 8%, 18% 25%, 27% 5%, 39% 22%, 49% 3%, 61% 25%, 73% 7%, 84% 21%, 94% 2%, 100% 13%, 100% 100%, 0 100%);
}
.arena.theme-backstreet { --sky: #f8a36f; --sky-soft: #ffd6a6; --ground: #8a6670; }
.arena.theme-backstreet .arena-scenery {
  background:
    repeating-linear-gradient(0deg, transparent 0 20px, rgba(23,19,31,.32) 21px 24px),
    repeating-linear-gradient(90deg, #bc6c62 0 38px, #793f4d 39px 43px, #d48a6d 44px 78px);
  box-shadow: inset 0 -22px 0 rgba(23,19,31,.2);
}
.arena.theme-street { --sky: #79d6ff; --sky-soft: #d8f2ff; --ground: #6f7787; }
.arena.theme-street .arena-scenery {
  background:
    repeating-linear-gradient(90deg, #576580 0 11%, #f7dc69 11.5% 13%, #59677c 13.5% 22%, #34465f 22.5% 31%),
    linear-gradient(transparent, #324258);
  clip-path: polygon(0 30%, 10% 30%, 10% 4%, 24% 4%, 24% 25%, 34% 25%, 34% 10%, 49% 10%, 49% 31%, 61% 31%, 61% 0, 76% 0, 76% 24%, 87% 24%, 87% 8%, 100% 8%, 100% 100%, 0 100%);
}
.arena.theme-downtown { --sky: #9d83e8; --sky-soft: #e0d6ff; --ground: #595372; }
.arena.theme-downtown .arena-scenery {
  background:
    repeating-linear-gradient(90deg, #353153 0 7%, #ffdc3d 7.5% 9%, #454064 9.5% 16%, #43b9ff 16.5% 18%, #2f2d49 18.5% 25%);
  clip-path: polygon(0 18%, 9% 18%, 9% 0, 20% 0, 20% 29%, 31% 29%, 31% 9%, 44% 9%, 44% 20%, 56% 20%, 56% 2%, 69% 2%, 69% 27%, 82% 27%, 82% 11%, 100% 11%, 100% 100%, 0 100%);
}
.arena.theme-arena { --sky: #68cef7; --sky-soft: #d9f5ff; --ground: #bb8c5f; }
.arena.theme-arena .arena-scenery {
  background:
    radial-gradient(ellipse at 15% 100%, transparent 0 20%, #dfb66f 21% 32%, var(--ink) 33% 35%, transparent 36%),
    radial-gradient(ellipse at 50% 100%, transparent 0 24%, #e9c57f 25% 37%, var(--ink) 38% 40%, transparent 41%),
    radial-gradient(ellipse at 85% 100%, transparent 0 20%, #dfb66f 21% 32%, var(--ink) 33% 35%, transparent 36%),
    linear-gradient(to top, #b97d4f 0 48%, transparent 49%);
}
.arena.theme-tunnel { --sky: #527399; --sky-soft: #9cb6cc; --ground: #4a5462; }
.arena.theme-tunnel .arena-scenery {
  opacity: .85;
  background:
    linear-gradient(63deg, transparent 0 46%, #ffdc3d 47% 49%, transparent 50%),
    linear-gradient(-63deg, transparent 0 46%, #ffdc3d 47% 49%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, #d8e5ec 0 9%, #364455 10% 42%, #1f2733 43% 65%, transparent 66%);
}
.arena.theme-stadium { --sky: #5bc8ff; --sky-soft: #e2f7ff; --ground: #61b67a; }
.arena.theme-stadium .arena-scenery {
  opacity: .9;
  background:
    radial-gradient(circle at 12% 12%, #fff 0 2%, transparent 2.5%),
    radial-gradient(circle at 30% 8%, #fff 0 2%, transparent 2.5%),
    radial-gradient(circle at 70% 8%, #fff 0 2%, transparent 2.5%),
    radial-gradient(circle at 88% 12%, #fff 0 2%, transparent 2.5%),
    repeating-linear-gradient(0deg, #315b89 0 13px, #fff7dc 14px 18px, #d34b5f 19px 31px);
  clip-path: ellipse(66% 72% at 50% 100%);
}
.crowd { position: absolute; z-index: 1; right: 3%; bottom: 42%; left: 3%; height: 58px; display: flex; align-items: flex-end; justify-content: space-around; gap: 4px; overflow: hidden; opacity: .18; pointer-events: none; }
.fan { --cheer: -7deg; position: relative; flex: 0 1 18px; width: 18px; max-width: 22px; height: 34px; border: 3px solid var(--ink); border-radius: 8px 8px 2px 2px; background: var(--red); transform-origin: 50% 100%; animation: crowd-cheer 1.1s ease-in-out infinite alternate; }
.fan::before { content: ""; position: absolute; top: -17px; left: 50%; width: 14px; height: 14px; border: 3px solid var(--ink); border-radius: 50%; background: var(--paper); transform: translateX(-50%); }
.fan::after { content: ""; position: absolute; top: 9px; left: 50%; width: 31px; border-top: 4px solid var(--ink); transform: translateX(-50%) rotate(var(--cheer)); }
.fan:nth-child(3n) { height: 28px; background: var(--blue); }
.fan:nth-child(3n + 2) { height: 39px; background: var(--yellow); }
@keyframes crowd-cheer { from { transform: translateY(3px) rotate(-2deg); } to { transform: translateY(-3px) rotate(2deg); } }
.fighter-slot { position: relative; z-index: 4; display: grid; justify-items: center; }
.versus { z-index: 2; align-self: center; margin-bottom: 90px; font-family: "Bangers", Impact, sans-serif; font-size: 3.5rem; color: #fff; text-shadow: 3px 4px 0 var(--ink); transform: rotate(-8deg); }
.round-score { position: absolute; z-index: 10; top: -60px; width: 54px; height: 54px; display: grid; place-items: center; border: 4px solid var(--ink); border-radius: 50%; background: #fff; box-shadow: 3px 4px 0 var(--ink); font-family: "Bangers", Impact, sans-serif; font-size: 2rem; }
.name-plate { z-index: 8; margin-top: -4px; padding: 5px 12px; border: 3px solid var(--ink); background: #fff; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .7rem; transform: rotate(-2deg); }
.enemy-name { transform: rotate(2deg); }

.action-panel { position: absolute; z-index: 12; top: 16px; right: 18px; width: calc(50% - 28px); transition: left .2s, right .2s; }
.action-panel.defend { right: auto; left: 18px; }
.action-panel p { margin: 0 auto 8px; width: max-content; max-width: 100%; padding: 4px 10px; border: 3px solid var(--ink); background: var(--yellow); transform: rotate(-1deg); font-family: "Bangers", Impact, sans-serif; font-size: 1.15rem; }
.zone-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.zone-button { min-height: 70px; padding: 8px 2px; border: 3px solid var(--ink); border-radius: 8px; box-shadow: 3px 3px 0 var(--ink); cursor: pointer; }
.zone-button span, .zone-button small { display: block; }
.zone-button span { font-family: "Bangers", Impact, sans-serif; font-size: clamp(1.1rem, 3vw, 1.55rem); }
.zone-button small { font-size: .55rem; }
.head-zone { background: var(--red); color: #fff; }
.body-zone { background: var(--yellow); }
.low-zone { background: var(--blue); }
.zone-button:hover:not(:disabled) { transform: translateY(-4px) rotate(-2deg); }
.zone-button:disabled { filter: grayscale(.5); opacity: .55; cursor: wait; }

.callout { position: absolute; z-index: 30; top: 18%; left: 50%; opacity: 0; pointer-events: none; font-family: "Bangers", Impact, sans-serif; font-size: clamp(3rem, 11vw, 7rem); color: #fff; text-shadow: 4px 5px 0 var(--ink); transform: translate(-50%, -50%) rotate(-8deg) scale(.3); }
.callout.pop { animation: callout-pop .65s ease-out; }

@keyframes callout-pop { 0% { opacity: 0; transform: translate(-50%,-50%) rotate(-12deg) scale(.2); } 24% { opacity: 1; transform: translate(-50%,-50%) rotate(5deg) scale(1.25); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-65%) rotate(-4deg) scale(.9); } }
@keyframes player-punch { 45% { transform: translateX(58px) rotate(-4deg); } }
@keyframes enemy-punch { 0%, 100% { transform: scaleX(-1) scale(var(--enemy-scale, 1)); } 45% { transform: scaleX(-1) scale(var(--enemy-scale, 1)) translateX(58px) rotate(-4deg); } }
@keyframes punch-head-arm { 0%, 100% { transform: rotate(-56deg); } 45% { transform: rotate(-110deg) scaleY(1.7); } }
@keyframes punch-body-arm { 0%, 100% { transform: rotate(-56deg); } 45% { transform: rotate(-90deg) scaleY(1.8); } }
@keyframes punch-low-arm { 0%, 100% { transform: rotate(-56deg); } 45% { transform: rotate(-58deg) scaleY(1.75); } }
@keyframes zone-hit { 45% { filter: brightness(1.65); box-shadow: 0 0 0 9px rgba(255,64,87,.7); } }
@keyframes zone-guard { 45% { filter: brightness(1.3); box-shadow: 0 0 0 9px rgba(67,185,255,.75); } }
@keyframes wobble { 20% { transform: translateX(-16px) rotate(-8deg); } 50% { transform: translateX(14px) rotate(7deg); } 80% { transform: translateX(-7px) rotate(-3deg); } }
@keyframes enemy-wobble { 0%, 100% { transform: scaleX(-1) scale(var(--enemy-scale, 1)); } 20% { transform: scaleX(-1) scale(var(--enemy-scale, 1)) translateX(-16px) rotate(-8deg); } 50% { transform: scaleX(-1) scale(var(--enemy-scale, 1)) translateX(14px) rotate(7deg); } 80% { transform: scaleX(-1) scale(var(--enemy-scale, 1)) translateX(-7px) rotate(-3deg); } }
@keyframes ko-player { to { transform: translate(-30px, 35px) rotate(-88deg); } }
@keyframes ko-enemy { from { transform: scaleX(-1) scale(var(--enemy-scale, 1)); } to { transform: scaleX(-1) scale(var(--enemy-scale, 1)) translate(-30px, 35px) rotate(-88deg); } }
@keyframes winner-bounce { 50% { transform: translateY(-35px) rotate(8deg); } }
@keyframes enemy-winner-bounce { 0%, 100% { transform: scaleX(-1) scale(var(--enemy-scale, 1)); } 50% { transform: scaleX(-1) scale(var(--enemy-scale, 1)) translateY(-35px) rotate(8deg); } }
@keyframes fighter-idle { 0%, 100% { transform: translateY(0) rotate(-.5deg); } 50% { transform: translateY(-5px) rotate(.7deg); } }
@keyframes enemy-idle { 0%, 100% { transform: scaleX(-1) scale(var(--enemy-scale, 1)) translateY(0) rotate(-.4deg); } 50% { transform: scaleX(-1) scale(var(--enemy-scale, 1)) translateY(-5px) rotate(.6deg); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }

.fighter.player-punch { animation: player-punch .42s ease-in-out; }
.fighter.enemy-punch { animation: enemy-punch .42s ease-in-out; }
.fighter.attack-head .arm.front { animation: punch-head-arm .42s ease-in-out; }
.fighter.attack-body .arm.front { animation: punch-body-arm .42s ease-in-out; }
.fighter.attack-low .arm.front { animation: punch-low-arm .42s ease-in-out; }
.fighter.hit-zone-head .head { animation: zone-hit .42s ease-out; }
.fighter.hit-zone-body .body { animation: zone-hit .42s ease-out; }
.fighter.hit-zone-low .leg { animation: zone-hit .42s ease-out; }
.fighter.guard-zone-head .head { animation: zone-guard .42s ease-out; }
.fighter.guard-zone-body .body { animation: zone-guard .42s ease-out; }
.fighter.guard-zone-low .leg { animation: zone-guard .42s ease-out; }
.fighter.hit-player { animation: wobble .45s linear; }
.fighter.hit-enemy { animation: enemy-wobble .45s linear; }
.fighter.ko-player { animation: ko-player .8s forwards cubic-bezier(.4,1.4,.6,1); }
.fighter.ko-enemy { animation: ko-enemy .8s forwards cubic-bezier(.4,1.4,.6,1); }
.fighter.winner { animation: winner-bounce .65s ease-in-out 2; }
.fighter-enemy.winner { animation: enemy-winner-bounce .65s ease-in-out 2; }
.fighter:not(.fighter-enemy):not(.player-punch):not(.hit-player):not(.ko-player):not(.winner) { animation: fighter-idle 1.8s ease-in-out infinite; }
.fighter-enemy:not(.enemy-punch):not(.hit-enemy):not(.ko-enemy):not(.winner) { animation: enemy-idle 1.8s ease-in-out infinite; }
.fighter .eye { animation: blink 4.2s linear infinite; transform-origin: center; }

.strike-marker { position: absolute; z-index: 18; width: 72px; height: 72px; display: grid; place-items: center; border: 5px solid #fff; border-radius: 50%; background: rgba(255,64,87,.76); color: #fff; font-family: "Bangers", Impact, sans-serif; font-size: 1.15rem; letter-spacing: .04em; text-shadow: 2px 2px 0 var(--ink); box-shadow: 0 0 0 4px var(--ink), 0 0 0 10px rgba(255,255,255,.5); transform: translate(-50%, -50%); pointer-events: none; animation: target-lock .48s ease-out; }
.strike-marker::before, .strike-marker::after { content: ""; position: absolute; background: var(--ink); }
.strike-marker::before { width: 102px; height: 4px; }
.strike-marker::after { width: 4px; height: 102px; }
.strike-marker.target-player { left: 25%; }
.strike-marker.target-enemy { left: 75%; }
.strike-marker.zone-head { top: 42%; }
.strike-marker.zone-body { top: 53%; }
.strike-marker.zone-low { top: 67%; }
.strike-marker.fake { opacity: .62; background: rgba(255,220,61,.7); color: var(--ink); }
@keyframes target-lock { from { opacity: 0; transform: translate(-50%,-50%) scale(1.8) rotate(-25deg); } to { opacity: 1; transform: translate(-50%,-50%) scale(1) rotate(0); } }

.coach-tip { position: absolute; z-index: 22; top: 116px; width: min(42%, 370px); padding: 12px 14px; border: 4px solid var(--ink); border-radius: 16px; background: #fff; box-shadow: 5px 6px 0 var(--ink); text-align: left; pointer-events: none; animation: coach-in .28s ease-out; }
.coach-tip.tip-attack { right: 18px; }
.coach-tip.tip-defense { left: 18px; }
.coach-tip strong, .coach-tip span { display: block; }
.coach-tip strong { color: var(--red); font-family: "Bangers", Impact, sans-serif; font-size: 1.25rem; letter-spacing: .05em; }
.coach-tip span { margin-top: 3px; font-size: .75rem; line-height: 1.35; }
.action-panel.tutorial-focus .zone-buttons { animation: tutorial-pulse .8s ease-in-out infinite alternate; }
@keyframes coach-in { from { opacity: 0; transform: translateY(-12px) scale(.92); } }
@keyframes tutorial-pulse { to { filter: drop-shadow(0 0 8px rgba(255,255,255,.95)); transform: translateY(-2px); } }

.victory-panel { position: absolute; z-index: 36; inset: 0; display: grid; place-content: center; justify-items: center; overflow: hidden; background: rgba(96,230,168,.74); text-align: center; pointer-events: none; }
.victory-panel span { padding: 4px 12px; border: 3px solid var(--ink); background: #fff; font-size: .72rem; letter-spacing: .15em; transform: rotate(-2deg); }
.victory-panel strong { font-family: "Bangers", Impact, sans-serif; font-size: clamp(4.7rem, 15vw, 8rem); line-height: .9; color: var(--yellow); text-shadow: 5px 6px 0 var(--ink), -2px -2px 0 var(--ink); transform: rotate(-4deg); animation: victory-pop .6s cubic-bezier(.2,1.7,.4,1); }
.victory-panel em { padding: 6px 16px; border: 4px solid var(--ink); background: var(--red); color: #fff; font-family: "Bangers", Impact, sans-serif; font-size: 1.7rem; font-style: normal; transform: rotate(3deg); }
.victory-panel i { position: absolute; top: -15%; left: 12%; width: 13px; height: 25px; border: 2px solid var(--ink); background: var(--yellow); animation: confetti-fall 1.3s linear forwards; }
.victory-panel i:nth-of-type(1) { left: 12%; background: var(--red); }
.victory-panel i:nth-of-type(2) { left: 28%; animation-delay: .12s; background: var(--blue); }
.victory-panel i:nth-of-type(3) { left: 43%; animation-delay: .04s; }
.victory-panel i:nth-of-type(4) { left: 59%; animation-delay: .18s; background: var(--red); }
.victory-panel i:nth-of-type(5) { left: 74%; animation-delay: .08s; background: var(--blue); }
.victory-panel i:nth-of-type(6) { left: 89%; animation-delay: .2s; }
@keyframes victory-pop { from { opacity: 0; transform: rotate(-10deg) scale(.25); } }
@keyframes confetti-fall { to { top: 110%; transform: rotate(540deg); } }

.retry-panel { position: absolute; z-index: 37; inset: 0; display: grid; place-content: center; justify-items: center; background: rgba(226,255,232,.88); text-align: center; pointer-events: none; }
.retry-panel span { font-size: clamp(6rem, 20vw, 11rem); line-height: .8; color: #36bc76; filter: drop-shadow(5px 6px 0 var(--ink)); animation: retry-clover .75s cubic-bezier(.2,1.5,.4,1); }
.retry-panel strong { margin-top: 12px; font-family: "Bangers", Impact, sans-serif; font-size: clamp(3.5rem, 11vw, 6rem); color: #fff; text-shadow: 4px 5px 0 var(--ink); transform: rotate(-3deg); }
.retry-panel em { padding: 5px 13px; border: 3px solid var(--ink); background: var(--yellow); font-style: normal; letter-spacing: .1em; transform: rotate(2deg); }
@keyframes retry-clover { from { opacity: 0; transform: scale(.2) rotate(-90deg); } to { opacity: 1; transform: scale(1) rotate(0); } }

.event-panel { position: absolute; z-index: 40; inset: 0; display: grid; place-items: center; padding: 12px; background: rgba(255, 220, 61, .93); }
.event-card { width: min(100%, 620px); padding: 20px; border: 5px solid var(--ink); border-radius: 18px; background: var(--paper); box-shadow: 8px 9px 0 var(--ink); text-align: center; transform: rotate(-.5deg); }
.event-kicker { display: inline-block; margin: 0; padding: 3px 9px; background: var(--red); color: #fff; font-size: .65rem; letter-spacing: .12em; }
.event-card h2 { margin: 7px 0 0; font-family: "Bangers", Impact, sans-serif; font-size: clamp(2.4rem, 8vw, 4.5rem); line-height: 1; }
.event-card > p:not(.event-kicker) { margin: 7px 0 12px; }
.event-timer { height: 15px; overflow: hidden; border: 3px solid var(--ink); background: #fff; }
.event-timer span { display: block; width: 100%; height: 100%; background: var(--red); transform-origin: left; }
.event-timer span.counting { animation: timer-drain 5s linear forwards; }
@keyframes timer-drain { to { transform: scaleX(0); } }
.event-stage { position: relative; min-height: 190px; margin-top: 12px; overflow: hidden; border: 3px dashed var(--ink); background: #fff; }
.event-status { display: block; min-height: 1.5em; margin-top: 7px; }
.event-countdown { position: absolute; inset: 0; display: grid; place-content: center; gap: 2px; }
.event-countdown span { font-size: .75rem; letter-spacing: .16em; }
.event-countdown strong { font-family: "Bangers", Impact, sans-serif; font-size: 6.5rem; line-height: .8; color: var(--red); text-shadow: 3px 4px 0 var(--ink); }
.event-big-button { position: absolute; inset: 50% auto auto 50%; min-width: 120px; padding: 14px; border: 4px solid var(--ink); border-radius: 50%; background: var(--yellow); box-shadow: 4px 5px 0 var(--ink); transform: translate(-50%,-50%); cursor: pointer; font-family: "Bangers", Impact, sans-serif; font-size: 1.6rem; }
.event-target { position: absolute; width: 58px; height: 58px; display: grid; place-items: center; border: 4px solid var(--ink); border-radius: 50%; background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); cursor: pointer; font-size: 1.8rem; }
.arrow-grid { display: grid; grid-template-columns: repeat(3, 62px); justify-content: center; gap: 8px; padding-top: 30px; }
.arrow-grid button { height: 58px; border: 3px solid var(--ink); background: var(--blue); box-shadow: 3px 3px 0 var(--ink); font-size: 1.5rem; cursor: pointer; }
.arrow-grid button[data-dir="up"] { grid-column: 2; }
.arrow-grid button[data-dir="left"] { grid-column: 1; }
.arrow-grid button[data-dir="down"] { grid-column: 2; }
.arrow-grid button[data-dir="right"] { grid-column: 3; }

.result-screen { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: calc(100svh - 75px); padding: 18px 8px 28px; text-align: center; }
.result-screen::before { content: ""; position: absolute; z-index: -1; width: min(85vw, 570px); aspect-ratio: 1; background: var(--red); clip-path: polygon(50% 0,61% 27%,85% 10%,75% 37%,100% 42%,75% 55%,96% 78%,67% 74%,62% 100%,49% 76%,26% 97%,32% 68%,2% 70%,26% 52%,0 34%,31% 34%,20% 7%,43% 27%); }
.result-fighter-stage { position: relative; width: 190px; height: 88px; overflow: hidden; pointer-events: none; }
.fighter-result { --result-scale: .48; position: absolute; z-index: 1; top: -77px; left: 20px; width: 150px; height: 244px; margin: 0; transform: scale(var(--result-scale)) rotate(76deg); transform-origin: 50% 50%; pointer-events: none; }
.fighter-result.ko-player { animation: result-ko .7s forwards cubic-bezier(.4,1.4,.6,1); }
@keyframes result-ko { from { transform: scale(var(--result-scale)) rotate(35deg); } to { transform: scale(var(--result-scale)) translate(12px, 8px) rotate(84deg); } }
.result-screen h2 { margin: 0; font-family: "Bangers", Impact, sans-serif; font-size: clamp(5rem, 20vw, 10rem); color: #fff; text-shadow: 5px 6px 0 var(--ink); line-height: .8; transform: rotate(-5deg); }
.result-screen > p { max-width: 440px; margin: 2px 0; }
.final-score { display: flex; align-items: center; gap: 12px; margin: 5px 0; padding: 7px 20px; border: 4px solid var(--ink); background: #fff; box-shadow: 4px 5px 0 var(--ink); transform: rotate(2deg); }
.final-score strong { font-family: "Bangers", Impact, sans-serif; font-size: 2.5rem; }
.save-status { min-height: 1.4em; margin: 7px 0 12px; font-size: .82rem; }
.result-screen .comic-button { width: min(100%, 330px); }
.text-button { margin-top: 14px; border: 0; border-bottom: 3px solid var(--ink); background: transparent; cursor: pointer; }

.leader-dialog { width: min(calc(100% - 24px), 610px); max-height: 85svh; padding: 18px; border: 5px solid var(--ink); border-radius: 16px; background: var(--paper); box-shadow: 9px 10px 0 var(--ink); }
.leader-dialog::backdrop { background: rgba(23,19,31,.74); }
.dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.dialog-head small { letter-spacing: .14em; }
.dialog-head h2 { margin: 0; font-family: "Bangers", Impact, sans-serif; font-size: clamp(2rem, 8vw, 3.5rem); line-height: 1; color: var(--red); text-shadow: 2px 2px 0 var(--ink); }
.leader-list { margin: 18px 0 8px; padding: 0; list-style: none; counter-reset: rank; }
.leader-list li { counter-increment: rank; display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; padding: 8px 6px; border-bottom: 2px solid var(--ink); }
.leader-list li::before { content: counter(rank); font-family: "Bangers", Impact, sans-serif; font-size: 1.5rem; }
.leader-list li:first-child { background: var(--yellow); }
.leader-list em { font-style: normal; }
.leader-status { margin: 9px 0 0; font-size: .75rem; text-align: center; }

.legal-page { min-height: 100vh; min-height: 100svh; padding: clamp(14px, 4vw, 42px); }
.legal-shell { position: relative; width: min(820px, 100%); margin: 0 auto; border: 5px solid var(--ink); border-radius: 18px; background: var(--paper); box-shadow: 9px 10px 0 var(--ink); transform: rotate(-.15deg); }
.legal-header { padding: clamp(24px, 6vw, 52px); border-bottom: 4px solid var(--ink); background: var(--red); color: #fff; }
.legal-header .legal-kicker { display: inline-block; margin: 0 0 10px; padding: 3px 10px; border: 3px solid var(--ink); background: var(--yellow); color: var(--ink); font-size: .68rem; letter-spacing: .13em; transform: rotate(-1deg); }
.legal-header h1 { margin: 0; font-family: "Bangers", Impact, sans-serif; font-size: clamp(3.4rem, 11vw, 6.8rem); line-height: .8; text-shadow: 4px 5px 0 var(--ink); transform: rotate(-2deg); }
.legal-header p:last-child { max-width: 620px; margin: 18px 0 0; line-height: 1.5; }
.legal-content { padding: clamp(22px, 5vw, 46px); }
.legal-content section + section { margin-top: 27px; padding-top: 24px; border-top: 3px solid var(--ink); }
.legal-content h2 { margin: 0 0 10px; color: #c4102f; font-family: "Bangers", Impact, sans-serif; font-size: 1.75rem; letter-spacing: .03em; }
.legal-content p { font-weight: 700; line-height: 1.65; }
.legal-content a, .legal-footer a { color: #8c0824; text-underline-offset: 3px; }
.legal-content code { padding: .12rem .35rem; border: 2px solid var(--ink); background: #fff; }
.legal-footer { padding: 18px clamp(22px, 5vw, 46px); display: flex; flex-wrap: wrap; gap: 10px 20px; border-top: 4px solid var(--ink); background: var(--yellow); font-size: .78rem; }

@media (min-width: 700px) {
  .result-screen { width: min(calc(100% - 30px), 680px); min-height: min(650px, calc(100svh - 82px)); margin: 8px auto; padding: 26px 34px 30px; gap: 4px; overflow: hidden; border: 5px solid var(--ink); border-radius: 24px; background: rgba(255,247,220,.96); box-shadow: 9px 10px 0 var(--ink); }
  .result-screen::before { z-index: 0; top: 18px; left: 50%; width: min(56vmin, 430px); transform: translateX(-50%); }
  .result-screen > * { position: relative; z-index: 1; }
  .result-screen h2 { font-size: clamp(5rem, 13vmin, 7.8rem); }
  .result-fighter-stage { display: none; }
}

@media (max-width: 820px) {
  .game-shell { padding-inline: 8px; }
  .menu-screen { grid-template-columns: minmax(0, 1fr); gap: 11px; padding-inline: 12px; }
  .burst-title h1 { font-size: clamp(3.6rem, 16vw, 5.6rem); text-shadow: 3px 4px 0 #fff, 6px 7px 0 var(--ink); }
  .menu-fighter-wrap { transform: scale(.82); margin: -28px 0; }
  .start-card { width: min(calc(100% - 8px), 450px); margin: auto; padding: 16px; }
  .leader-chip { grid-template-columns: auto 1fr auto; font-size: .75rem; }
  .arena { min-height: calc(100svh - 122px); grid-template-columns: 1fr 34px 1fr; padding: 100px 2px 150px; }
  .fighter-slot { transform: scale(.78); }
  .versus { font-size: 2.2rem; margin-bottom: 100px; }
  .action-panel, .action-panel.defend { top: 8px; right: 5px; left: auto; width: calc(50% - 8px); }
  .action-panel.defend { left: 5px; right: auto; }
  .zone-buttons { gap: 3px; }
  .zone-button { min-height: 66px; }
  .zone-button small { display: none; }
  .enemy-tag { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .coach-tip, .coach-tip.tip-attack, .coach-tip.tip-defense { top: 111px; right: auto; left: 10px; width: calc(100% - 20px); }
  .coach-tip span { font-size: .7rem; }
  .strike-marker { width: 60px; height: 60px; font-size: 1rem; }
  .strike-marker::before { width: 84px; }
  .strike-marker::after { height: 84px; }
}

@media (max-width: 420px) {
  .game-shell { padding-inline: 4px; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; }
  .mini-logo { font-size: 1.05rem; }
  .run-score { padding-inline: 10px; }
  .menu-screen { padding-inline: 8px; }
  .burst-title h1 { font-size: clamp(3.25rem, 15.5vw, 4.2rem); }
  .burst-title p { max-width: calc(100vw - 28px); font-size: .6rem; }
  .leader-chip { width: calc(100% - 8px); gap: 7px; padding-inline: 10px; }
  .venue-tag { display: none; }
  .lucky-retry { bottom: 8px; width: 58px; height: 52px; padding: 3px; }
  .lucky-retry span { font-size: 1.75rem; }
  .lucky-retry small { display: block; font-size: .45rem; }
}

@media (max-height: 680px) and (orientation: landscape) {
  .topbar { min-height: 43px; }
  .arena { min-height: calc(100svh - 92px); padding-top: 64px; padding-bottom: 105px; }
  .fighter-slot { transform: scale(.72); transform-origin: bottom; }
  .action-panel { top: 3px; }
  .zone-button { min-height: 55px; }
  .fight-head { min-height: 38px; }
  .result-screen { min-height: calc(100svh - 48px); padding-block: 5px 12px; gap: 2px; }
  .result-screen h2 { font-size: 5.3rem; }
  .result-screen::before { width: min(72vmin, 410px); }
  .result-fighter-stage { height: 72px; }
  .save-status { margin-block: 2px 5px; }
  .text-button { margin-top: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
