:root {
  --w: min(100vw, calc(100vh * 9 / 16));
  --h: 100vh;
  --home-margin: 4.6%;
  --home-gap: clamp(4px, calc(var(--h) * 0.006), 7px);
  --gold: #ffd61a;
  --red: #ff2525;
  --blue: #12d8ff;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #050507;
  color: white;
  font-family: Impact, Haettenschweiler, "Arial Black", system-ui, sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  top: 0;
  bottom: 0;
  width: max(22vw, calc((100vw - var(--w)) / 2 + 2vw));
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.72)),
    url("assets/home_sparks.png") center / 28rem auto repeat,
    url("assets/side_ambient.png") center / cover no-repeat;
  opacity: 0.72;
  filter: saturate(1.25) contrast(1.08);
  animation: sideBreath 8s ease-in-out infinite;
}

body::before {
  left: 0;
}

body::after {
  right: 0;
  transform: scaleX(-1);
  animation-delay: -3.5s;
}

button {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.phone-shell {
  position: fixed;
  inset: 0 auto auto 50%;
  width: var(--w);
  height: var(--h);
  overflow: hidden;
  transform: translateX(-50%);
  background: #000;
  z-index: 1;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
}

.screen.active {
  display: block;
}

.screen-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-screen .screen-bg {
  animation: homeBgDrift 10s ease-in-out infinite;
  transform-origin: center;
}

#battleBg {
  object-fit: fill;
}

.home-screen::after,
.battle-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.22), transparent 17%, transparent 54%, rgba(0, 0, 0, 0.88)),
    linear-gradient(to right, rgba(0, 0, 0, 0.2), transparent 18%, transparent 74%, rgba(0, 0, 0, 0.48));
}

.home-screen::before {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  background:
    url("assets/home_rain.png") center top / 100% auto repeat,
    url("assets/home_sparks.png") center / 100% auto repeat;
  mix-blend-mode: screen;
  opacity: 0.42;
  animation: homeWeather 5.6s linear infinite;
}

.battle-screen[data-level="subway"] .enemy { filter: drop-shadow(0 0.42rem 0.25rem #000) saturate(1.05); }
.battle-screen[data-level="alley"] .enemy { filter: drop-shadow(0 0 0.45rem #ff2fb8) drop-shadow(0 0.42rem 0.25rem #000); }
.battle-screen[data-level="rooftop"] .enemy.walking,
.battle-screen[data-level="rooftop"] .enemy.running { animation-duration: 150ms; }
.battle-screen[data-level="warehouse"] .enemy { height: 65%; }
.battle-screen[data-level="club"] .enemy.walking,
.battle-screen[data-level="club"] .enemy.running { animation-name: victoryPulse; animation-duration: 430ms; }
.battle-screen[data-level="dock"] .enemy { filter: drop-shadow(0 0 0.4rem #25e5ff) drop-shadow(0 0.42rem 0.25rem #000); }
.battle-screen[data-level="factory"] .enemy.specialing { filter: drop-shadow(0 0 0.95rem #ff6b16) drop-shadow(0 0.42rem 0.25rem #000); }
.battle-screen[data-level="construction"] .enemy { height: 66%; }
.battle-screen[data-level="champion"] .enemy { filter: drop-shadow(0 0 0.78rem #ffd61a) drop-shadow(0 0.42rem 0.25rem #000); }
.battle-screen[data-level="final_boss"] .enemy { height: 68%; filter: drop-shadow(0 0 0.9rem #ff1919) drop-shadow(0 0.42rem 0.25rem #000); }

.home-top {
  position: absolute;
  z-index: 7;
  top: 1.25%;
  left: 2.2%;
  right: 2.2%;
  height: 5.9%;
  display: grid;
  grid-template-columns: 34% minmax(0, 1fr) 7.4%;
  gap: 1.2%;
  align-items: center;
}

.identity {
  display: grid;
  min-width: 0;
  height: 100%;
  grid-template-columns: 29% 1fr;
  grid-template-rows: 42% 24% 20%;
  column-gap: 5%;
  align-items: center;
  text-shadow: 0 2px 0 #000;
}

.identity-portrait,
.hud-portrait {
  grid-row: 1 / 4;
  height: 100%;
  aspect-ratio: 0.82;
  overflow: hidden;
  border: 1px solid #ff4a30;
  background: rgba(0, 0, 0, 0.72);
  box-shadow: 0 0 0.45rem #000;
}

.identity-portrait img,
.hud-portrait img,
.roster-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.identity b {
  align-self: end;
  font-size: clamp(12px, calc(var(--w) * 0.039), 18px);
  line-height: 1.02;
}

.identity small,
.mode-tile small {
  font-family: "Arial Black", system-ui, sans-serif;
  color: #ffe78c;
  font-size: clamp(8px, calc(var(--w) * 0.025), 12px);
  line-height: 1;
  text-shadow: 0 2px 0 #000;
}

.mini-xp,
.xp-copy em,
.hp-bar,
.guard-bar,
.ex-meter span {
  display: block;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.32);
}

.mini-xp {
  height: 60%;
}

.mini-xp i,
.xp-copy i,
.hp-bar span,
.guard-bar span,
.ex-meter i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffe700, #fff6b0);
}

.currencies {
  display: flex;
  min-width: 0;
  overflow: hidden;
  height: 58%;
  gap: 1.8%;
}

.currencies span {
  flex: 1;
  display: flex;
  min-width: 0;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  gap: 4%;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: clamp(9px, calc(var(--w) * 0.029), 14px);
  text-shadow: 0 2px 0 #000;
}

.currencies img {
  width: auto;
  height: 96%;
  max-width: 30%;
  flex: 0 0 auto;
  object-fit: contain;
}

.currencies b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gear {
  min-width: 0;
}

.gear img {
  width: 100%;
  filter: drop-shadow(0 2px 2px #000);
}

.side-actions {
  position: absolute;
  z-index: 7;
  top: 8.2%;
  right: 2.3%;
  width: 9.4%;
  display: grid;
  gap: var(--home-gap);
}

.side-actions button {
  display: grid;
  justify-items: center;
  align-items: center;
  min-height: calc(var(--h) * 0.056);
  padding: 0.08rem 0.04rem 0.13rem;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0.35rem rgba(255, 255, 255, 0.12), 0 0 0.35rem #000;
}

.side-actions img {
  width: 76%;
  aspect-ratio: 1;
  object-fit: contain;
}

.side-actions b,
.bottom-nav b,
.home-tools b,
.mode-card b {
  text-transform: uppercase;
  font-size: clamp(7px, calc(var(--w) * 0.025), 12px);
  line-height: 1.05;
  text-align: center;
  text-shadow: 0 2px 0 #000, 0 0 0.4rem #000;
}

.notice-dot {
  position: absolute;
  z-index: 4;
  top: 0.08rem;
  right: 0.08rem;
  width: clamp(13px, calc(var(--w) * 0.041), 18px) !important;
  height: clamp(13px, calc(var(--w) * 0.041), 18px) !important;
  object-fit: contain !important;
  filter: drop-shadow(0 0.12rem 0.18rem #000);
  animation: alertPing 1.6s ease-in-out infinite;
}

.game-logo {
  position: absolute;
  z-index: 5;
  top: 7.6%;
  left: 13.6%;
  width: 42%;
  height: auto;
  filter: drop-shadow(0 0.25rem 0.28rem #000) drop-shadow(0 0 0.35rem #ff1d16);
  animation: logoPulse 4.8s ease-in-out infinite;
}

.level-map {
  position: absolute;
  z-index: 6;
  left: var(--home-margin);
  right: calc(var(--home-margin) + 10.5%);
  top: 27.6%;
  height: 8.4%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(3px, calc(var(--w) * 0.012), 5px);
}

.level-map::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 6%;
  right: 6%;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 214, 26, 0.1), rgba(255, 214, 26, 0.78), rgba(255, 43, 24, 0.2));
  box-shadow: 0 0 0.35rem rgba(255, 38, 20, 0.55);
  animation: pathCharge 3s linear infinite;
}

.level-map button {
  position: relative;
  z-index: 1;
  overflow: hidden;
  min-width: 0;
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0.32rem #000;
}

.level-map img {
  position: absolute;
  inset: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  object-fit: cover;
  opacity: 0.78;
}

.level-map b,
.level-map span {
  position: relative;
  z-index: 2;
  display: block;
  text-align: center;
  text-shadow: 0 2px 0 #000;
}

.level-map b {
  padding-top: 0.12rem;
  color: #fff;
  font-size: clamp(8px, calc(var(--w) * 0.026), 12px);
}

.level-map span {
  color: #ffe426;
  font-family: "Arial Black", system-ui, sans-serif;
  font-size: clamp(5px, calc(var(--w) * 0.016), 8px);
  line-height: 0.9;
  text-transform: uppercase;
}

.level-map button.locked img {
  filter: grayscale(1) brightness(0.42);
}

.level-map button.active {
  border-color: #ff3a1f;
  box-shadow: 0 0 0.55rem #ff2417, inset 0 0 0.46rem rgba(255, 45, 25, 0.58);
  transform: translateY(-2px) scale(1.05);
  animation: activeNodePulse 1.9s ease-in-out infinite;
}

.level-map button.complete {
  border-color: #ffd61a;
  box-shadow: 0 0 0.34rem rgba(255, 214, 26, 0.6), inset 0 0 0.3rem rgba(255, 214, 26, 0.24);
}

.reward-strip {
  position: absolute;
  z-index: 6;
  left: var(--home-margin);
  right: calc(var(--home-margin) + 7.6%);
  top: 36.7%;
  height: 6.9%;
  display: grid;
  grid-template-columns: 16% 1fr 25%;
  align-items: center;
  gap: 0.18rem;
  padding: 0.2rem 0.28rem;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.72), rgba(39, 9, 5, 0.82) 55%, rgba(0, 0, 0, 0.58));
  border: 1px solid rgba(255, 194, 70, 0.36);
  box-shadow: inset 0 0 0.55rem rgba(255, 70, 16, 0.18), 0 0 0.42rem #000;
  animation: rewardGlow 3.4s ease-in-out infinite;
}

.reward-strip::after,
.mode-card::before,
.home-tools button::before,
.bottom-nav .selected::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.18) 48%, transparent 62%);
  transform: translateX(-125%);
  opacity: 0;
}

.reward-strip::after {
  animation: sheenSweep 3.2s ease-in-out infinite;
}

.reward-strip > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0.14rem 0.2rem #000);
}

.reward-strip span {
  display: grid;
  min-width: 0;
  gap: 0.01rem;
}

.reward-strip small,
.reward-strip em {
  font-family: "Arial Black", system-ui, sans-serif;
  font-size: clamp(7px, calc(var(--w) * 0.022), 10px);
  line-height: 1;
  color: #ffd86c;
  font-style: normal;
  text-shadow: 0 2px 0 #000;
}

.reward-strip b {
  overflow: hidden;
  color: #fff;
  font-size: clamp(11px, calc(var(--w) * 0.033), 15px);
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: 0.1rem 0.1rem 0 #000, 0 0 0.35rem #000;
}

.reward-strip button {
  position: relative;
  height: 100%;
  min-width: 0;
}

.reward-strip button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 0.28rem rgba(255, 30, 16, 0.85));
  animation: fightPulse 1.7s ease-in-out infinite;
}

.reward-strip button b,
.fight-cta b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff7d0;
  font-size: clamp(10px, calc(var(--w) * 0.032), 15px);
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #000, 0 0 0.4rem #000;
}

.primary-fight img,
.result-overlay button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.primary-fight:active,
.controls button:active {
  transform: scale(0.96);
}

.home-mode-stack {
  position: absolute;
  z-index: 6;
  left: var(--home-margin);
  right: var(--home-margin);
  bottom: 13.2%;
  display: grid;
  gap: var(--home-gap);
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--home-gap);
}

.mode-card {
  position: relative;
  overflow: hidden;
  text-align: left;
  filter: drop-shadow(0 0.16rem 0.22rem #000);
}

.mode-card::before {
  z-index: 2;
  animation: sheenSweep 5.6s ease-in-out infinite;
}

.mode-card:nth-child(2)::before {
  animation-delay: -1.4s;
}

.mode-card:nth-child(3)::before {
  animation-delay: -2.8s;
}

.mode-card:nth-child(4)::before {
  animation-delay: -4.2s;
}

.mode-card.locked > img:first-child,
.bottom-nav button.locked img {
  filter: grayscale(0.9) brightness(0.58);
}

.mode-card.locked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.mode-card > img:first-child {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tournament-card {
  height: calc(var(--h) * 0.126);
  animation: cardBreathe 4.6s ease-in-out infinite;
}

.tournament-card > img:first-child {
  object-fit: cover;
}

.mode-grid .mode-card {
  height: calc(var(--h) * 0.091);
}

.mode-title {
  position: absolute;
  z-index: 2;
  display: block;
  left: 7.2%;
  top: 10%;
  max-width: 62%;
  color: #fff;
  font-size: clamp(12px, calc(var(--w) * 0.043), 20px);
  line-height: 1.08;
  text-transform: uppercase;
  transform: rotate(-5deg);
  text-shadow: 0.11rem 0.11rem 0 #000, 0 0 0.4rem #000;
}

.tournament-card .mode-title {
  top: 14%;
  max-width: 48%;
  font-size: clamp(15px, calc(var(--w) * 0.047), 21px);
  line-height: 0.98;
}

.mode-progress,
.mode-stars {
  position: absolute;
  z-index: 2;
  left: 7%;
  max-width: 66%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  bottom: 24%;
  font-family: "Arial Black", system-ui, sans-serif;
  font-size: clamp(7px, calc(var(--w) * 0.023), 11px);
  text-shadow: 0 2px 0 #000;
}

.mode-stars {
  bottom: 8%;
  color: #ffe426;
}

.fight-cta {
  position: absolute;
  z-index: 4;
  right: 4.6%;
  bottom: 8%;
  width: 29%;
  height: 34%;
  filter: drop-shadow(0 0 0.32rem rgba(255, 35, 18, 0.9));
}

.fight-cta img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lock-ribbon {
  position: absolute;
  z-index: 3;
  right: 5%;
  bottom: 9%;
  padding: 0.16rem 0.34rem;
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #d7d7dc;
  font-family: "Arial Black", system-ui, sans-serif;
  font-size: clamp(6px, calc(var(--w) * 0.02), 9px);
  line-height: 1.05;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #000;
}

.mode-card:not(.locked) .lock-ribbon {
  display: none;
}

.home-tools {
  position: static;
  height: calc(var(--h) * 0.064);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--home-gap);
}

.home-tools button {
  position: relative;
  overflow: hidden;
  background: rgba(5, 6, 10, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0.35rem #000;
}

.home-tools button::before {
  animation: sheenSweep 6.4s ease-in-out infinite;
}

.home-tools img {
  position: absolute;
  left: 3%;
  right: 3%;
  top: 3%;
  width: 94%;
  height: 68%;
  object-fit: contain;
}

.home-tools b {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7%;
  font-size: clamp(6px, calc(var(--w) * 0.02), 9px);
  line-height: 1.08;
}

.bottom-nav {
  position: absolute;
  z-index: 7;
  left: var(--home-margin);
  right: var(--home-margin);
  bottom: 1%;
  height: 6.7%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.12rem;
  background: rgba(7, 8, 12, 0.84);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.bottom-nav button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.04rem;
  color: #c6c6cc;
}

.bottom-nav .selected {
  position: relative;
  color: #fff;
  background: rgba(255, 25, 25, 0.24);
  box-shadow: inset 0 0 0.48rem #ff2020, 0 0 0.3rem rgba(255, 0, 0, 0.48);
}

.bottom-nav .selected::before {
  animation: sheenSweep 4.6s ease-in-out infinite;
}

.bottom-nav button.locked {
  color: #8f9098;
}

.bottom-nav img {
  width: 35%;
  height: 42%;
  object-fit: contain;
  padding: 1px;
}

.battle-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.battle-layer.shake {
  animation: shake 180ms linear 1;
}

@keyframes shake {
  0%,
  100% { transform: translate(0, 0); }
  25% { transform: translate(-0.35rem, 0.1rem); }
  50% { transform: translate(0.32rem, -0.15rem); }
  75% { transform: translate(-0.18rem, 0.1rem); }
}

@keyframes sideBreath {
  0%,
  100% { opacity: 0.58; background-position: center 0, center 0, center; }
  50% { opacity: 0.82; background-position: center 1.8rem, center -1.1rem, center; }
}

@keyframes homeBgDrift {
  0%,
  100% { transform: scale(1.015) translate3d(0, 0, 0); filter: saturate(1.04); }
  50% { transform: scale(1.035) translate3d(-0.35%, -0.25%, 0); filter: saturate(1.18); }
}

@keyframes homeWeather {
  from { background-position: center -45%, center 0; }
  to { background-position: center 145%, center -60%; }
}

@keyframes logoPulse {
  0%,
  100% { filter: drop-shadow(0 0.25rem 0.28rem #000) drop-shadow(0 0 0.35rem #ff1d16); transform: scale(1); }
  50% { filter: drop-shadow(0 0.25rem 0.28rem #000) drop-shadow(0 0 0.62rem #ff3a24); transform: scale(1.025); }
}

@keyframes pathCharge {
  0% { opacity: 0.72; transform: scaleX(0.96); }
  50% { opacity: 1; transform: scaleX(1.02); }
  100% { opacity: 0.72; transform: scaleX(0.96); }
}

@keyframes activeNodePulse {
  0%,
  100% { box-shadow: 0 0 0.55rem #ff2417, inset 0 0 0.46rem rgba(255, 45, 25, 0.58); }
  50% { box-shadow: 0 0 0.82rem #ffbd2a, inset 0 0 0.52rem rgba(255, 210, 60, 0.44); }
}

@keyframes rewardGlow {
  0%,
  100% { box-shadow: inset 0 0 0.55rem rgba(255, 70, 16, 0.18), 0 0 0.42rem #000; }
  50% { box-shadow: inset 0 0 0.75rem rgba(255, 132, 30, 0.32), 0 0 0.58rem rgba(255, 38, 20, 0.45); }
}

@keyframes fightPulse {
  0%,
  100% { transform: scale(1); filter: drop-shadow(0 0 0.28rem rgba(255, 30, 16, 0.85)); }
  50% { transform: scale(1.06); filter: drop-shadow(0 0 0.48rem rgba(255, 210, 65, 0.95)); }
}

@keyframes alertPing {
  0%,
  100% { transform: scale(1); filter: drop-shadow(0 0.12rem 0.18rem #000); }
  50% { transform: scale(1.13); filter: drop-shadow(0 0 0.34rem #ff3218); }
}

@keyframes sheenSweep {
  0%,
  58% { opacity: 0; transform: translateX(-125%); }
  68% { opacity: 0.65; }
  84%,
  100% { opacity: 0; transform: translateX(135%); }
}

@keyframes cardBreathe {
  0%,
  100% { filter: drop-shadow(0 0.16rem 0.22rem #000) saturate(1); }
  50% { filter: drop-shadow(0 0.2rem 0.28rem #000) saturate(1.12); }
}

.battle-hud {
  position: absolute;
  z-index: 8;
  top: 3%;
  left: 2.6%;
  right: 2.6%;
  height: 11%;
  display: grid;
  grid-template-columns: 1fr 17% 1fr;
  gap: 1.5%;
}

.fighter-hud {
  display: grid;
  grid-template-columns: 25% 1fr;
  grid-template-rows: 26% 24% 17% 20%;
  column-gap: 4%;
  align-items: center;
}

.enemy-hud {
  grid-template-columns: 1fr 25%;
  text-align: right;
}

.enemy-hud .hud-portrait {
  grid-column: 2;
}

.fighter-hud b {
  align-self: end;
  font-size: clamp(17px, calc(var(--w) * 0.058), 26px);
  line-height: 0.88;
  text-shadow: 0 2px 0 #000;
}

.hp-bar,
.guard-bar {
  height: 100%;
  transform: skewX(-10deg);
}

.hp-bar span {
  width: 100%;
  background: linear-gradient(90deg, #ffe500, #ff9400);
}

.hp-bar.red span {
  background: linear-gradient(90deg, #ff2525, #9d1018);
}

.guard-bar span {
  width: 100%;
  background: linear-gradient(90deg, #11e8ff, #136cff);
}

.guard-bar.red span {
  background: linear-gradient(90deg, #e0e0e0, #6d6d6d);
}

.hp-bar em {
  position: absolute;
  inset: 0.02rem 0.25rem auto auto;
  transform: skewX(10deg);
  font-style: normal;
  font-size: clamp(9px, calc(var(--w) * 0.034), 15px);
  line-height: 1;
  text-shadow: 0 1px 0 #000;
}

.stock-row img {
  width: 14%;
  margin-right: 0.12rem;
}

.stock-row.dim img {
  filter: grayscale(1) brightness(0.7);
  margin-right: 0;
  margin-left: 0.12rem;
}

.timer-box {
  display: grid;
  justify-items: center;
  align-content: start;
  text-align: center;
  text-shadow: 0 2px 0 #000;
}

.timer-box small {
  font-style: italic;
  font-size: clamp(12px, calc(var(--w) * 0.042), 18px);
}

.timer-box strong {
  margin-top: -0.25rem;
  color: var(--gold);
  font-size: clamp(42px, calc(var(--w) * 0.16), 70px);
  line-height: 0.85;
}

.timer-box button {
  width: 46%;
  aspect-ratio: 1;
  margin-top: 0.1rem;
  background: url("assets/locked_panel.png") center / cover no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.45);
  font-size: clamp(12px, calc(var(--w) * 0.04), 18px);
  line-height: 1;
}

.round-intro {
  position: absolute;
  z-index: 12;
  inset: 22% 0 auto;
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
  text-shadow: 0 3px 0 #000, 0 0 0.8rem #000;
}

.round-intro span {
  color: #fff;
  font-size: clamp(26px, calc(var(--w) * 0.09), 42px);
}

.round-intro strong {
  color: var(--gold);
  font-size: clamp(68px, calc(var(--w) * 0.23), 102px);
  line-height: 0.85;
  transform: rotate(-5deg);
}

.round-intro.fade {
  opacity: 0;
  transform: scale(1.18);
  transition: opacity 280ms ease, transform 280ms ease;
}

.arena {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  top: 23%;
  height: 44%;
}

.fighter {
  position: absolute;
  bottom: 1%;
  width: auto;
  height: 58%;
  object-fit: contain;
  filter: drop-shadow(0 0.42rem 0.25rem rgba(0, 0, 0, 0.78));
  transition: left 80ms linear, right 80ms linear, transform 120ms ease, opacity 180ms ease, filter 120ms ease;
  will-change: left, transform, filter;
}

.player {
  left: calc(var(--player-x, 24) * 1%);
  transform: translateX(-50%);
}

.enemy {
  left: calc(var(--enemy-x, 76) * 1%);
  transform: translateX(-50%) scaleX(-1);
}

.fighter.walking {
  animation: bob 260ms ease-in-out infinite;
}

.fighter.running {
  animation: bob 180ms ease-in-out infinite;
}

.fighter.attacking {
  transform: translateX(-41%) scale(1.07);
}

.enemy.attacking {
  transform: translateX(-59%) scaleX(-1) scale(1.07);
}

.fighter.specialing {
  filter: drop-shadow(0 0 0.85rem #1bd6ff) drop-shadow(0 0.42rem 0.25rem rgba(0, 0, 0, 0.78));
}

.fighter.jumping {
  transform: translateX(-50%) translateY(-18%) scale(1.03);
}

.enemy.jumping {
  transform: translateX(-50%) scaleX(-1) translateY(-18%) scale(1.03);
}

.fighter.crouching {
  transform: translateX(-50%) translateY(7%) scaleY(0.88);
}

.enemy.crouching {
  transform: translateX(-50%) scaleX(-1) translateY(7%) scaleY(0.88);
}

.fighter.dodging {
  opacity: 0.78;
  filter: drop-shadow(0 0 0.72rem #f7f7ff) drop-shadow(0 0.42rem 0.25rem #000);
}

.fighter.falling,
.fighter.recovering {
  opacity: 0.82;
  transform: translateX(-50%) rotate(8deg) translateY(8%) scale(0.96);
}

.enemy.falling,
.enemy.recovering {
  transform: translateX(-50%) scaleX(-1) rotate(8deg) translateY(8%) scale(0.96);
}

.fighter.victory {
  filter: drop-shadow(0 0 0.9rem #ffd61a) drop-shadow(0 0.42rem 0.25rem #000);
  animation: victoryPulse 720ms ease-in-out infinite;
}

.fighter.stunned {
  animation: recoil 130ms ease-out 1;
}

.fighter.blocking {
  filter: drop-shadow(0 0 0.55rem #e7f0ff) drop-shadow(0 0.42rem 0.25rem #000);
}

.fighter.hit {
  filter: brightness(1.8) drop-shadow(0 0 0.65rem #ff3218) drop-shadow(0 0.42rem 0.25rem #000);
}

.fighter.ko {
  opacity: 0.45;
  transform: translateX(-50%) rotate(12deg) translateY(12%) scale(0.92);
}

.enemy.ko {
  transform: translateX(-50%) scaleX(-1) rotate(12deg) translateY(12%) scale(0.92);
}

@keyframes bob {
  50% { translate: 0 -1.2%; }
}

@keyframes recoil {
  40% { translate: -1.2% 0; }
}

@keyframes victoryPulse {
  50% { translate: 0 -2%; }
}

.slash-effect {
  position: absolute;
  z-index: 9;
  top: 34%;
  left: 44%;
  width: 34%;
  pointer-events: none;
  filter: drop-shadow(0 0 0.65rem #ff1b1b);
}

.ko-badge {
  position: absolute;
  z-index: 13;
  top: 30%;
  left: 20%;
  width: 60%;
  filter: drop-shadow(0 0.3rem 0.45rem #000);
}

.combo-badge {
  position: absolute;
  z-index: 10;
  top: 18%;
  left: 8%;
  display: flex;
  align-items: end;
  gap: 0.25rem;
  transform: rotate(-7deg);
  text-transform: uppercase;
  text-shadow: 0.16rem 0.16rem 0 #000, 0 0 0.45rem #d40b00;
}

.combo-badge strong {
  color: var(--gold);
  font-size: clamp(56px, calc(var(--w) * 0.2), 90px);
  line-height: 0.72;
}

.combo-badge span {
  font-size: clamp(17px, calc(var(--w) * 0.06), 28px);
  line-height: 0.85;
}

.ex-meter {
  position: absolute;
  z-index: 9;
  left: 6.2%;
  bottom: 34.7%;
  width: 46%;
  height: 3.2%;
  display: grid;
  grid-template-columns: 13% 1fr 19%;
  gap: 2%;
  align-items: center;
  text-shadow: 0 2px 0 #000;
  pointer-events: none;
}

.ex-meter b {
  font-size: clamp(14px, calc(var(--w) * 0.052), 23px);
}

.ex-meter span {
  height: 64%;
  transform: skewX(-10deg);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0.28rem rgba(18, 216, 255, 0.22), 0 0 0.2rem #000;
}

.ex-meter i {
  width: 0%;
  background: linear-gradient(90deg, #10f0ff, #1e72ff);
}

.ex-meter em {
  display: none;
  color: #fff44d;
  font-style: normal;
  font-size: clamp(9px, calc(var(--w) * 0.032), 14px);
}

.ex-meter.ready em {
  display: block;
}

.controls {
  position: absolute;
  z-index: 8;
  left: 4%;
  right: 4%;
  bottom: 13.8%;
  height: 25.8%;
  pointer-events: none;
}

.controls button {
  position: absolute;
  aspect-ratio: 1;
  filter: drop-shadow(0 0.28rem 0.25rem rgba(0, 0, 0, 0.85));
  pointer-events: auto;
  transition: transform 90ms ease, filter 120ms ease, opacity 120ms ease;
}

.controls button::before {
  content: "";
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 62%);
  opacity: 0.55;
  pointer-events: none;
}

.controls img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.move-zone.left {
  left: 0;
  bottom: 8%;
  width: 29.5%;
}

.move-zone.right {
  left: 13.5%;
  bottom: 8%;
  width: 15.5%;
  opacity: 0;
}

.block-control {
  right: 0;
  top: 0;
  width: 15.5%;
}

.jump-control {
  right: 33%;
  top: 9%;
  width: 11.8%;
}

.dodge-control {
  right: 41%;
  bottom: 16%;
  width: 11.8%;
}

.skill-control {
  right: 25%;
  bottom: 36%;
  width: 12.5%;
}

.special-control {
  right: 25%;
  bottom: 0;
  width: 13.5%;
}

.special-control.locked {
  filter: grayscale(1) brightness(0.55) drop-shadow(0 0.28rem 0.25rem rgba(0, 0, 0, 0.85));
}

.attack-control {
  right: 0.5%;
  bottom: 4%;
  width: 20%;
  filter: drop-shadow(0 0.34rem 0.3rem rgba(0, 0, 0, 0.9)) drop-shadow(0 0 0.32rem rgba(255, 35, 24, 0.5));
}

.roster-strip {
  position: absolute;
  z-index: 7;
  left: 5%;
  right: 5%;
  bottom: 4.2%;
  height: 9.2%;
  display: grid;
  grid-template-columns: 1.28fr repeat(3, 1fr);
  gap: 2.8%;
}

.roster-strip button {
  overflow: hidden;
  background: rgba(0, 0, 0, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0.35rem #000;
}

.roster-strip .selected {
  border-color: #ff8b1b;
  box-shadow: 0 0 0.55rem #ff7b0c, inset 0 0 0.4rem #ff4917;
}

.result-overlay {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.5rem;
  padding: 8%;
  text-align: center;
  background: rgba(0, 0, 0, 0.82);
  text-shadow: 0 2px 0 #000;
}

.result-overlay > img {
  width: 48%;
  max-height: 18%;
  object-fit: contain;
}

.result-overlay strong {
  color: var(--gold);
  font-size: clamp(44px, calc(var(--w) * 0.15), 70px);
  line-height: 0.9;
  text-transform: uppercase;
}

.result-overlay span,
.reward-line b {
  font-family: "Arial Black", system-ui, sans-serif;
  font-size: clamp(13px, calc(var(--w) * 0.042), 19px);
}

.reward-line {
  width: 78%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.reward-line span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.6rem;
  background: url("assets/chapter_plaque.png") center / 100% 100% no-repeat;
}

.reward-line img {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
}

.result-overlay button {
  position: relative;
  width: 58%;
  height: 3.1rem;
  filter: drop-shadow(0 0.2rem 0.28rem #000);
}

.result-overlay button b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(17px, calc(var(--w) * 0.052), 24px);
  text-transform: uppercase;
  text-shadow: 0 2px 0 #000, 0 0 0.55rem #000;
}

.hidden {
  display: none !important;
}

@media (max-height: 820px) {
  .game-logo {
    top: 7.3%;
    left: 14.2%;
    width: 39%;
  }

  .home-mode-stack {
    bottom: 12.9%;
    gap: clamp(3px, calc(var(--h) * 0.005), 5px);
  }

  .tournament-card {
    height: calc(var(--h) * 0.126);
  }

  .mode-grid {
    gap: clamp(3px, calc(var(--h) * 0.005), 5px);
  }

  .mode-grid .mode-card {
    height: calc(var(--h) * 0.086);
  }

  .home-tools {
    height: calc(var(--h) * 0.06);
  }

  .bottom-nav {
    height: 6.5%;
  }

  .side-actions {
    top: 8%;
    width: 9%;
  }

  .level-map {
    top: 26.8%;
    height: 8.1%;
  }

  .reward-strip {
    top: 35.3%;
    height: 6.5%;
  }

  .reward-strip b {
    font-size: clamp(11px, calc(var(--w) * 0.034), 15px);
  }

  .fight-cta {
    width: 27%;
    height: 32%;
  }
}

.home-panel {
  position: absolute;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 7%;
  background: rgba(0, 0, 0, 0.72);
}

.panel-card {
  position: relative;
  width: 84%;
  min-height: 38%;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(6px, calc(var(--h) * 0.012), 12px);
  padding: 1.05rem 1rem;
  background: url("assets/locked_panel_wide.png") center / 100% 100% no-repeat;
  text-align: center;
  filter: drop-shadow(0 0.35rem 0.5rem #000);
}

.panel-card > img {
  width: 58%;
  height: clamp(54px, calc(var(--h) * 0.12), 92px);
  object-fit: contain;
  filter: drop-shadow(0 0.18rem 0.22rem #000);
}

.panel-card strong {
  color: #ffe426;
  font-size: clamp(24px, calc(var(--w) * 0.082), 36px);
  line-height: 1.12;
  text-transform: uppercase;
  text-shadow: 0 3px 0 #000;
}

.panel-card span {
  display: block;
  max-width: 88%;
  font-family: "Arial Black", system-ui, sans-serif;
  font-size: clamp(11px, calc(var(--w) * 0.034), 15px);
  line-height: 1.18;
  text-shadow: 0 2px 0 #000;
}

.panel-card button {
  position: relative;
  width: 56%;
  height: clamp(38px, calc(var(--h) * 0.062), 52px);
}

#panelAction {
  margin-top: 0.1rem;
}

#panelAction + #panelClose {
  width: 44%;
  height: clamp(32px, calc(var(--h) * 0.052), 44px);
  opacity: 0.92;
}

.panel-card button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.panel-card button b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(15px, calc(var(--w) * 0.046), 21px);
  text-shadow: 0 2px 0 #000;
}

.intro-guide {
  position: absolute;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 5.5%;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 59, 20, 0.32), transparent 34%),
    rgba(0, 0, 0, 0.78);
  text-align: center;
  text-shadow: 0 2px 0 #000;
}

.guide-card {
  position: relative;
  width: 92%;
  min-height: 68%;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(7px, calc(var(--h) * 0.011), 12px);
  padding: clamp(14px, calc(var(--h) * 0.024), 22px) 5.5%;
  background: url("assets/locked_panel_wide.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 0.45rem 0.6rem #000);
}

.guide-logo {
  width: 62%;
  max-height: 16%;
  object-fit: contain;
  filter: drop-shadow(0 0.2rem 0.3rem #000);
}

.guide-card strong {
  color: #ffe426;
  font-size: clamp(26px, calc(var(--w) * 0.088), 38px);
  line-height: 0.95;
  text-transform: uppercase;
}

.guide-copy {
  width: 88%;
  font-family: "Arial Black", system-ui, sans-serif;
  font-size: clamp(11px, calc(var(--w) * 0.033), 15px);
  line-height: 1.2;
}

.guide-steps {
  width: 100%;
  display: grid;
  gap: clamp(5px, calc(var(--h) * 0.008), 8px);
}

.guide-steps span {
  min-height: clamp(42px, calc(var(--h) * 0.068), 58px);
  display: grid;
  grid-template-columns: 20% 1fr;
  gap: 3.5%;
  align-items: center;
  padding: 1.5% 5%;
  background: rgba(0, 0, 0, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0.45rem rgba(255, 35, 20, 0.18);
  text-align: left;
}

.guide-steps img {
  width: 100%;
  height: clamp(30px, calc(var(--h) * 0.052), 45px);
  object-fit: contain;
}

.guide-steps b {
  font-family: "Arial Black", system-ui, sans-serif;
  font-size: clamp(10px, calc(var(--w) * 0.031), 14px);
  line-height: 1.12;
}

.guide-card button {
  position: relative;
  height: clamp(38px, calc(var(--h) * 0.062), 52px);
  filter: drop-shadow(0 0.2rem 0.26rem #000);
}

.guide-primary {
  width: 62%;
}

.guide-secondary {
  width: 50%;
  opacity: 0.86;
}

.guide-card button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.guide-card button b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(14px, calc(var(--w) * 0.044), 20px);
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
