@import url('/farmdew-horde-preparation.css');
:root {
  color-scheme: dark;
  font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body.farmdew-combat-page {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% 12%, rgba(123, 185, 104, .16), transparent 30rem),
    linear-gradient(#112d20, #081b14 72%);
  color: #f5f4df;
  overscroll-behavior: none;
}

button, a { font: inherit; }
button { touch-action: manipulation; }

.combat-shell {
  width: min(100%, 540px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
}

.combat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  gap: 12px;
}

.combat-topbar a,
.combat-topbar button,
.combat-secondary {
  min-height: 44px;
  border: 1px solid rgba(236, 239, 207, .22);
  border-radius: 13px;
  background: rgba(14, 46, 31, .8);
  color: inherit;
  padding: 9px 13px;
  text-decoration: none;
}

.combat-title { padding: 13px 4px 16px; }
.combat-title p,
.combat-status-card small {
  margin: 0 0 5px;
  color: #acd392;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
}
.combat-title h1 { margin: 0; font-size: clamp(2rem, 8vw, 3rem); line-height: 1; }
.combat-title span { display: block; margin-top: 8px; color: #d5ddc7; line-height: 1.35; }

.combat-card,
.combat-status-card,
.combat-vitals {
  border: 1px solid rgba(236, 239, 207, .18);
  border-radius: 18px;
  background: rgba(19, 55, 38, .82);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .18);
}

.combat-card { padding: 18px; }
.combat-card h2 { margin: 0 0 8px; }
.combat-card p { color: #d5ddc7; line-height: 1.45; }

.combat-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  background: #d6e5a4;
  color: #173020;
  font-weight: 850;
  padding: 10px 16px;
  text-decoration: none;
}

.combat-notice {
  min-height: 1.5em;
  margin: 8px 4px;
  color: #f0d996;
  text-align: center;
}

.combat-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  margin-bottom: 8px;
}
.combat-status-card h2 { margin: 0; font-size: 1.05rem; }
.combat-square {
  min-width: 52px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .18);
  text-align: center;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.combat-vitals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.combat-vital { min-width: 0; }
.combat-vital > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: .76rem;
}
.combat-vital strong,
.combat-vital span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combat-vital progress {
  display: block;
  width: 100%;
  height: 10px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  accent-color: #d6e5a4;
}

.combat-arena {
  --combat-x: 40%;
  --combat-y: 84%;
  --combat-enemy-x: 60%;
  --combat-enemy-y: 10%;
  position: relative;
  width: min(100%, 400px);
  aspect-ratio: 352 / 408;
  margin: 0 auto;
  overflow: hidden;
  border: 3px solid #426d43;
  border-radius: 26px;
  background:
    radial-gradient(circle at 20% 22%, rgba(178, 218, 124, .2), transparent 25%),
    radial-gradient(circle at 78% 70%, rgba(54, 91, 54, .36), transparent 24%),
    #527b49;
  box-shadow: inset 0 0 0 4px rgba(25, 61, 35, .38), 0 16px 36px rgba(0,0,0,.28);
}

.combat-camera-stage {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: transform var(--combat-camera-motion-ms, 200ms) linear;
}

.combat-world {
  --combat-x: 40%;
  --combat-y: 84%;
  --combat-enemy-x: 60%;
  --combat-enemy-y: 10%;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.combat-arena.is-horde {
  border-color: #6f7752;
  background: #2d4533;
  box-shadow:
    inset 0 0 0 4px rgba(21, 40, 27, .42),
    inset 0 0 40px rgba(5, 20, 12, .32),
    0 16px 36px rgba(0,0,0,.28);
}

.combat-arena.is-horde .combat-world {
  background:
    radial-gradient(circle at 50% 45%, rgba(171, 191, 119, .11), transparent 36%),
    radial-gradient(circle at 8% 70%, rgba(35, 53, 42, .42), transparent 24%),
    radial-gradient(circle at 92% 22%, rgba(35, 53, 42, .46), transparent 24%),
    linear-gradient(rgba(60, 87, 57, .96), rgba(45, 69, 51, .98));
}

.combat-arena.is-horde-wide .combat-world {
  left: -52%;
  right: auto;
  width: 204%;
  height: 100%;
}

@media (orientation: portrait) and (max-width: 720px) {
  .combat-arena.is-horde-wide .combat-camera-stage[data-combat-camera-active="true"] {
    transform: translateX(var(--combat-camera-shift-x, 0%));
    will-change: transform;
  }
}

.combat-horde-hud {
  position: absolute;
  z-index: 5;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 22px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  pointer-events: none;
}
.combat-horde-hud[hidden] { display: none; }
.combat-horde-hud span {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(245, 239, 192, .2);
  border-radius: 999px;
  background: rgba(8, 26, 18, .68);
  color: #f0edcf;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
  font-size: .67rem;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.combat-tiles {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  opacity: .1;
}
.combat-tile:nth-child(n + 65) { display: none; }
.combat-arena.is-horde-wide .combat-tiles {
  grid-template-columns: repeat(16, 1fr);
  grid-template-rows: repeat(8, 1fr);
}
.combat-arena.is-horde-wide .combat-tile:nth-child(n + 65) { display: block; }
.combat-tile:nth-child(3n) { background: rgba(224, 235, 164, .16); }
.combat-tile:nth-child(5n) { background: rgba(20, 61, 33, .14); }

.combat-grove {
  position: absolute;
  z-index: 1;
  filter: drop-shadow(0 4px 1px rgba(0,0,0,.2));
  pointer-events: none;
  user-select: none;
}
.grove-one { left: 8%; top: 8%; font-size: clamp(25px, 8vw, 40px); }
.grove-two { right: 6%; top: 11%; font-size: clamp(34px, 10vw, 54px); }
.grove-three { right: 17%; bottom: 19%; font-size: clamp(22px, 7vw, 36px); }

.combat-enemy-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.combat-enemy-layer[hidden],
.combat-enemy[hidden] {
  display: none;
}

.combat-pickup {
  position: absolute;
  z-index: 2;
  width: 9%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 239, 202, .58);
  border-radius: 50%;
  background: rgba(28, 66, 39, .84);
  box-shadow: 0 0 0 4px rgba(244, 230, 155, .08), 0 5px 12px rgba(0,0,0,.24);
  color: #ffe0d1;
  font-size: clamp(17px, 5vw, 24px);
  line-height: 1;
  animation: combat-pickup-pulse 720ms ease-in-out infinite alternate;
  pointer-events: none;
}

.combat-wave-banner {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 48%;
  width: min(78%, 290px);
  transform: translate(-50%, -50%);
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(250, 239, 183, .62);
  border-radius: 14px;
  background: rgba(9, 31, 21, .9);
  box-shadow: 0 10px 28px rgba(0,0,0,.32);
  text-align: center;
  pointer-events: none;
}
.combat-wave-banner[hidden] { display: none; }
.combat-wave-banner strong { color: #fff0b2; font-size: 1rem; }
.combat-wave-banner span { color: #e2e7d5; font-size: .74rem; line-height: 1.35; }

.combat-upgrade-panel {
  position: absolute;
  z-index: 18;
  left: 50%;
  top: 42%;
  width: min(92%, 354px);
  transform: translate(-50%, -50%);
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 2px solid rgba(237, 244, 174, .75);
  border-radius: 16px;
  background: rgba(8, 30, 20, .96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .46);
}
.combat-upgrade-panel[hidden] { display: none; }
.combat-upgrade-panel > strong {
  color: #fff2b7;
  font-size: .98rem;
  text-align: center;
}
.combat-upgrade-kicker {
  margin-top: -5px;
  color: #bcd7bd;
  font-size: .65rem;
  text-align: center;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.combat-upgrade-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.combat-upgrade-choice {
  min-width: 0;
  min-height: 88px;
  padding: 8px 7px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(219, 237, 170, .5);
  border-radius: 12px;
  background: rgba(35, 73, 47, .96);
  color: #f6f2d6;
  text-align: left;
  touch-action: manipulation;
}
.combat-upgrade-choice strong { color: #fff2b0; font-size: .76rem; line-height: 1.1; }
.combat-upgrade-choice span { color: #e1ead8; font-size: .62rem; line-height: 1.25; }
.combat-upgrade-choice small { color: #a9d3b5; font-size: .58rem; }
.combat-upgrade-choice:not(:disabled):active { transform: scale(.97); }
.combat-upgrade-choice.is-pending {
  opacity: 1;
  border-color: rgba(255, 242, 176, .92);
  box-shadow: 0 0 0 3px rgba(255, 226, 122, .16), 0 6px 16px rgba(0,0,0,.28);
}
.combat-upgrade-choice:disabled { opacity: .5; }
.combat-upgrade-choice.is-pending:disabled { opacity: .9; }

.combat-player,
.combat-enemy {
  position: absolute;
  width: 14%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  pointer-events: none;
}
.combat-player {
  z-index: 4;
  left: var(--combat-x);
  top: var(--combat-y);
  transition:
    left var(--combat-motion-ms, 200ms) linear,
    top var(--combat-motion-ms, 200ms) linear,
    opacity 120ms ease-out,
    transform 120ms ease-out;
}
.combat-enemy {
  z-index: 3;
  left: var(--combat-enemy-x);
  top: var(--combat-enemy-y);
  transition: left 200ms linear, top 200ms linear, opacity 120ms ease-out, transform 120ms ease-out;
}

.combat-horde-enemy.is-runner {
  width: 12.4%;
}
.combat-horde-enemy.is-runner .combat-actor-sprite,
.combat-horde-enemy.is-runner .combat-actor-fallback {
  filter: drop-shadow(0 4px 2px rgba(0, 0, 0, .34)) brightness(1.12);
}
.combat-horde-enemy.is-boss {
  width: 19%;
  z-index: 4;
}

/* Wide Horde keeps actor sizes on the original 400px logical scale rather
   than letting percentage widths double with the 816px world. */
.combat-arena.is-horde-wide .combat-player,
.combat-arena.is-horde-wide .combat-enemy {
  width: 6.862745%;
}
.combat-arena.is-horde-wide .combat-horde-enemy.is-runner {
  width: 6.078431%;
}
.combat-arena.is-horde-wide .combat-horde-enemy.is-boss {
  width: 9.313725%;
}
.combat-arena.is-horde-wide .combat-pickup {
  width: 4.411765%;
}
.combat-horde-enemy.is-boss .combat-actor-sprite,
.combat-horde-enemy.is-boss .combat-actor-fallback {
  filter: drop-shadow(0 6px 3px rgba(0, 0, 0, .42)) brightness(.9) saturate(1.18);
}
.combat-boss-badge {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: -30%;
  transform: translateX(-50%);
  min-width: 72px;
  padding: 3px 6px;
  border: 1px solid rgba(255, 224, 141, .72);
  border-radius: 999px;
  background: rgba(64, 24, 20, .9);
  color: #fff0b8;
  font-size: .6rem !important;
  font-weight: 950;
  line-height: 1 !important;
  letter-spacing: .04em;
  text-align: center;
  filter: none !important;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.38);
}
.combat-boss-badge[hidden] { display: none; }
.combat-horde-enemy.is-boss.is-telegraphing::after {
  inset: -26%;
  border-width: 4px;
  box-shadow: 0 0 0 6px rgba(255, 110, 61, .18), 0 0 28px rgba(255, 168, 66, .74);
}
.combat-horde-enemy.is-telegraphing {
  z-index: 5;
}
.combat-horde-enemy.is-telegraphing::after {
  content: "";
  position: absolute;
  inset: -18%;
  border: 3px solid rgba(255, 198, 92, .96);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 111, 70, .14), 0 0 20px rgba(255, 184, 82, .66);
  animation: combat-telegraph var(--combat-windup-ms, 320ms) cubic-bezier(.2, .75, .25, 1) infinite;
}
.combat-horde-enemy.is-danger::after {
  border-width: 4px;
  box-shadow: 0 0 0 6px rgba(255, 92, 57, .18), 0 0 26px rgba(255, 121, 70, .9);
  animation-duration: 120ms;
}
.combat-horde-enemy.is-danger .combat-actor-sprite,
.combat-horde-enemy.is-danger .combat-actor-fallback {
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .38)) brightness(1.28);
}
.combat-horde-enemy.is-runner-charge::after {
  inset: auto;
  left: 50%;
  top: 14%;
  width: 240%;
  height: 72%;
  border-width: 3px;
  border-radius: 999px;
  transform: rotate(var(--combat-charge-angle, 0deg));
  transform-origin: 0 50%;
  animation: combat-runner-charge var(--combat-windup-ms, 420ms) ease-out infinite;
}
.combat-horde-enemy[data-facing="east"].is-runner-charge::after { --combat-charge-angle: 0deg; }
.combat-horde-enemy[data-facing="south"].is-runner-charge::after { --combat-charge-angle: 90deg; }
.combat-horde-enemy[data-facing="west"].is-runner-charge::after { --combat-charge-angle: 180deg; }
.combat-horde-enemy[data-facing="north"].is-runner-charge::after { --combat-charge-angle: 270deg; }
.combat-horde-enemy.is-boss.is-boss-stomp::after {
  inset: -72%;
  border-width: 4px;
  box-shadow: 0 0 0 8px rgba(255, 91, 70, .12), 0 0 30px rgba(255, 170, 74, .72);
  animation: combat-boss-stomp var(--combat-windup-ms, 720ms) ease-out infinite;
}
.combat-horde-enemy.is-boss.is-boss-stomp.is-boss-phase-two::after {
  inset: -88%;
  border-width: 5px;
}
.combat-horde-enemy.is-boss-phase-two .combat-actor-sprite,
.combat-horde-enemy.is-boss-phase-two .combat-actor-fallback {
  filter: drop-shadow(0 7px 4px rgba(0, 0, 0, .46)) brightness(1.08) saturate(1.3);
}
.combat-horde-enemy.is-charging {
  transition: left 105ms linear, top 105ms linear, opacity 120ms ease-out, transform 120ms ease-out;
}
.combat-horde-enemy.is-charging .combat-actor-sprite,
.combat-horde-enemy.is-charging .combat-actor-fallback {
  animation: combat-runner-burst 220ms ease-out;
}
.combat-horde-enemy.is-stomp-impact::after {
  content: "";
  position: absolute;
  inset: -78%;
  border: 5px solid rgba(255, 214, 111, .88);
  border-radius: 50%;
  animation: combat-stomp-impact 360ms ease-out both;
}
.combat-horde-enemy.is-death-burst::after {
  content: "✦ · ✦";
  position: absolute;
  z-index: 9;
  inset: -35%;
  display: grid;
  place-items: center;
  color: rgba(226, 242, 174, .95);
  font-size: 1.25rem;
  font-weight: 900;
  text-shadow: 0 0 9px rgba(129, 214, 112, .72);
  animation: combat-fungal-burst 440ms ease-out both;
}
.combat-horde-enemy.is-boss.is-death-burst::after {
  inset: -62%;
  font-size: 1.7rem;
  animation-duration: 620ms;
}
.combat-horde-enemy.is-staggered .combat-actor-sprite,
.combat-horde-enemy.is-staggered .combat-actor-fallback {
  animation: combat-stagger 360ms ease-out;
}
.combat-enemy .combat-target-reticle {
  font-size: 0;
  line-height: 0;
  filter: none;
}
.combat-target-reticle {
  position: absolute;
  z-index: 6;
  inset: -24%;
  border: 2px solid rgba(255, 238, 128, .96);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(79, 46, 10, .34), 0 0 13px rgba(255, 225, 104, .55);
  opacity: 0;
  transform: scale(.9);
  transition: opacity 90ms ease-out, transform 90ms ease-out;
  pointer-events: none;
}
.combat-horde-enemy.is-targeted .combat-target-reticle {
  opacity: 1;
  transform: scale(1);
  animation: combat-target-pulse 620ms ease-in-out infinite alternate;
}
.combat-horde-enemy.is-hit::before {
  content: attr(data-damage);
  position: absolute;
  z-index: 7;
  left: 50%;
  top: -20%;
  transform: translateX(-50%);
  color: #fff4cc;
  font-size: .82rem;
  font-weight: 950;
  text-shadow: 0 2px 3px rgba(0,0,0,.8);
  animation: combat-damage-pop 320ms ease-out both;
}
.combat-player.is-correcting,
.combat-player.is-defeated,
.combat-enemy.is-defeated { transition: none; }
.combat-player span,
.combat-enemy span {
  line-height: 1;
  filter: drop-shadow(0 4px 2px rgba(0,0,0,.28));
}
.combat-player span { font-size: clamp(24px, 8.5vw, 42px); }
.combat-enemy span { font-size: clamp(24px, 8vw, 40px); }
.combat-actor-sprite {
  display: block;
  width: 138%;
  height: 138%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 5px 2px rgba(0, 0, 0, .36));
}
.combat-actor-sprite[hidden],
.combat-actor-fallback[hidden],
.combat-outcome[hidden] { display: none; }
.combat-player.has-pixel-sprite,
.combat-enemy.has-pixel-sprite { will-change: left, top; }
.combat-player.is-moving .combat-actor-sprite,
.combat-player.is-moving .combat-actor-fallback {
  animation: combat-walk-bob 180ms ease-in-out infinite alternate;
}
.combat-player.is-protected::after,
.combat-enemy.is-protected::after {
  content: "";
  position: absolute;
  inset: 8%;
  border: 2px solid rgba(255, 244, 174, .72);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 244, 174, .42);
}
.combat-player.is-protected::after {
  inset: 2%;
  border-width: 3px;
  box-shadow: 0 0 0 4px rgba(179, 247, 232, .14), 0 0 18px rgba(215, 255, 238, .72);
  animation: combat-protection-pulse 320ms ease-in-out infinite alternate;
}
.combat-enemy.is-defeated:not(.is-dying) { opacity: .28; transform: translate(-50%, -50%) scale(.75) rotate(12deg); }
.combat-horde-enemy.is-dying { opacity: 1; }
.combat-player.is-defeated { opacity: .52; filter: saturate(.45); }
.combat-player.is-hit,
.combat-enemy.is-hit { animation: combat-hit 180ms ease-out; }
.combat-horde-enemy.is-hit { animation: combat-horde-confirmed-hit 220ms ease-out; }
.combat-player.is-healed { animation: combat-heal 360ms ease-out; }
.combat-player.is-attacking { animation: combat-swing 240ms ease-out; }
.combat-player.is-firing {
  --combat-recoil-x: 0px;
  --combat-recoil-y: 0px;
  animation: combat-fire-recoil 120ms cubic-bezier(.2, .8, .25, 1);
}
.combat-player.is-firing[data-facing="south"] { --combat-recoil-y: -3px; }
.combat-player.is-firing[data-facing="north"] { --combat-recoil-y: 3px; }
.combat-player.is-firing[data-facing="east"] { --combat-recoil-x: -3px; }
.combat-player.is-firing[data-facing="west"] { --combat-recoil-x: 3px; }
.combat-player.is-firing .combat-actor-sprite,
.combat-player.is-firing .combat-actor-fallback {
  animation: none;
  transform: translateY(0);
}

.combat-shot-fx {
  position: absolute;
  z-index: 5;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.combat-shot-fx.is-preview,
.combat-shot-fx.is-confirmed { opacity: 1; }
.combat-shot-tracer {
  position: absolute;
  height: 2px;
  opacity: 0;
  transform-origin: 0 50%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,.95), rgba(255,225,112,.95) 45%, rgba(255,161,70,.18));
  box-shadow: 0 0 5px rgba(255, 224, 124, .9);
}
.combat-shot-fx.is-preview .combat-shot-tracer { opacity: 1; }
.combat-shot-impact {
  position: absolute;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 241, 164, .95);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255, 192, 78, .92);
  opacity: 0;
}
.combat-shot-fx.is-confirmed .combat-shot-impact {
  opacity: 1;
  animation: combat-shot-impact 180ms ease-out both;
}

.combat-outcome {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 50%;
  width: min(84%, 320px);
  transform: translate(-50%, -50%);
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 2px solid rgba(255, 247, 203, .74);
  border-radius: 16px;
  background: rgba(10, 34, 23, .94);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .4);
  text-align: center;
  pointer-events: none;
}
.combat-outcome strong { font-size: 1.08rem; color: #fff3bd; }
.combat-outcome span { color: #e4ead5; font-size: .78rem; line-height: 1.35; }
.combat-outcome.is-victory { border-color: #d6e5a4; background: rgba(25, 72, 43, .95); }
.combat-outcome.is-defeat { border-color: #e3b58c; background: rgba(67, 35, 27, .95); }

@keyframes combat-walk-bob {
  from { transform: translateY(0); }
  to { transform: translateY(-2px); }
}
@keyframes combat-hit {
  0%, 100% { filter: none; }
  45% { filter: brightness(1.8); transform: translate(-50%, -50%) scale(.88); }
}
@keyframes combat-horde-confirmed-hit {
  0%, 100% { filter: none; transform: translate(-50%, -50%) scale(1); }
  28% { filter: brightness(2.2); transform: translate(calc(-50% - 3px), -50%) scale(.86); }
  52% { filter: brightness(1.45); transform: translate(calc(-50% + 2px), -50%) scale(.94); }
}
@keyframes combat-heal {
  0%, 100% { filter: none; }
  45% { filter: brightness(1.35); transform: translate(-50%, -50%) scale(1.08); }
}
@keyframes combat-swing {
  0%, 100% { transform: translate(-50%, -50%) rotate(0); }
  50% { transform: translate(-50%, -50%) rotate(10deg) scale(1.08); }
}
@keyframes combat-fire-recoil {
  0%, 100% { transform: translate(-50%, -50%); }
  34% {
    transform: translate(
      calc(-50% + var(--combat-recoil-x)),
      calc(-50% + var(--combat-recoil-y))
    );
  }
}

@keyframes combat-telegraph {
  from { opacity: .18; transform: scale(1.65); }
  55% { opacity: .72; }
  to { opacity: 1; transform: scale(.88); }
}
@keyframes combat-runner-charge {
  from { opacity: .16; transform: rotate(var(--combat-charge-angle, 0deg)) scaleX(.35); }
  60% { opacity: .75; }
  to { opacity: 1; transform: rotate(var(--combat-charge-angle, 0deg)) scaleX(1); }
}
@keyframes combat-boss-stomp {
  from { opacity: .18; transform: scale(.45); }
  70% { opacity: .72; }
  to { opacity: 1; transform: scale(1); }
}
@keyframes combat-runner-burst {
  0% { filter: brightness(1.5); transform: scale(.82); }
  55% { filter: brightness(1.15); transform: scale(1.16); }
  100% { filter: none; transform: scale(1); }
}
@keyframes combat-stomp-impact {
  from { opacity: 1; transform: scale(.55); }
  to { opacity: 0; transform: scale(1.15); }
}
@keyframes combat-fungal-burst {
  from { opacity: 1; transform: scale(.55) rotate(-8deg); }
  to { opacity: 0; transform: scale(1.45) rotate(8deg); }
}

@keyframes combat-damage-pop {
  from { opacity: 0; transform: translate(-50%, 4px) scale(.85); }
  28% { opacity: 1; }
  to { opacity: 0; transform: translate(-50%, -14px) scale(1.05); }
}
@keyframes combat-pickup-pulse {
  from { transform: translate(-50%, -50%) scale(.92); }
  to { transform: translate(-50%, -50%) scale(1.07); }
}
@keyframes combat-stagger {
  0%, 100% { transform: translateX(0); }
  28% { transform: translateX(-4px) rotate(-4deg); }
  58% { transform: translateX(4px) rotate(4deg); }
}
@keyframes combat-target-pulse {
  from { box-shadow: 0 0 0 2px rgba(79, 46, 10, .28), 0 0 9px rgba(255, 225, 104, .4); }
  to { box-shadow: 0 0 0 4px rgba(79, 46, 10, .38), 0 0 16px rgba(255, 225, 104, .72); }
}
@keyframes combat-shot-impact {
  from { opacity: 1; transform: translate(-50%, -50%) scale(.45); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1.45); }
}
@keyframes combat-protection-pulse {
  from { opacity: .58; transform: scale(.94); }
  to { opacity: 1; transform: scale(1.08); }
}
@keyframes combat-action-ready {
  from { filter: brightness(1); }
  to { filter: brightness(1.18); }
}

.combat-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  width: min(100%, 400px);
  margin: 14px auto 0;
  padding-inline: 8px;
}

.combat-action-controls {
  justify-self: end;
  display: flex;
  align-items: flex-end;
  gap: 9px;
}

.combat-joystick {
  position: relative;
  width: 82px;
  height: 82px;
  border: 2px solid rgba(239,245,218,.42);
  border-radius: 50%;
  background: rgba(19,52,29,.45);
  box-shadow: 0 2px 7px rgba(8,22,12,.24), inset 0 1px rgba(255,255,255,.12);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.combat-joystick.is-active { background: rgba(31,83,42,.68); border-color: rgba(255,248,208,.68); }
.combat-joystick.is-disabled { opacity: .45; }
.combat-joystick-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px;
  border: 1px solid rgba(255,250,216,.52);
  border-radius: 50%;
  background: rgba(237,245,211,.62);
  box-shadow: 0 2px 4px rgba(8,22,12,.25);
  transform: translate(var(--combat-joystick-x, 0px), var(--combat-joystick-y, 0px));
  transition: transform .1s ease-out;
}
.combat-joystick.is-active .combat-joystick-knob { transition: none; }

.combat-attack {
  justify-self: end;
  width: 92px;
  min-height: 92px;
  border: 1px solid rgba(238, 223, 163, .5);
  border-radius: 50%;
  background: rgba(114, 93, 45, .9);
  color: #fff3c6;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  font-weight: 850;
  box-shadow: 0 5px 0 rgba(42, 30, 8, .6);
}
.combat-dash {
  width: 62px;
  min-height: 62px;
  border: 1px solid rgba(168, 238, 233, .56);
  border-radius: 50%;
  background: rgba(37, 100, 98, .9);
  color: #e7fffb;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  font-weight: 850;
  box-shadow: 0 4px 0 rgba(8, 44, 43, .68);
}
.combat-dash[hidden],
.combat-actions [hidden] { display: none; }
.combat-dash:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(8, 44, 43, .68); }
.combat-dash span { font-size: 1.35rem; line-height: 1; }
.combat-dash small { font-size: .66rem; line-height: 1; }
.combat-attack:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 rgba(6, 27, 15, .55); }
.combat-attack span { font-size: 1.75rem; }
.combat-attack small { max-width: 78px; line-height: 1.05; }
.combat-attack small,
.combat-dash small {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.combat-attack.is-pistol small { font-size: .62rem; }
.combat-attack.is-pistol span { font-size: 1.55rem; }
.combat-attack.is-pistol.is-held {
  transform: translateY(2px) scale(.98);
  box-shadow: 0 2px 0 rgba(42, 30, 8, .6), 0 0 0 3px rgba(255, 226, 122, .16);
}
.combat-attack.is-cooling-down small,
.combat-dash.is-cooling-down small {
  font-weight: 900;
}

.combat-loadout {
  width: min(100%, 400px);
  margin: 10px auto 0;
  padding: 7px 10px;
  border: 1px solid rgba(221, 233, 180, .16);
  border-radius: 999px;
  background: rgba(12, 39, 24, .52);
  color: #dce7cd;
  font-size: .72rem;
  line-height: 1.25;
  text-align: center;
}
.combat-loadout[hidden] { display: none; }

.combat-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}
.combat-actions > * { flex: 1 1 0; max-width: 210px; }

.combat-return {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}
.combat-return[hidden] { display: none; }

.combat-phase-copy {
  margin: 13px auto 0;
  max-width: 430px;
  color: #bdcbb5;
  font-size: .83rem;
  line-height: 1.4;
  text-align: center;
}

button:disabled { opacity: .5; }
button:focus-visible, a:focus-visible, .combat-joystick:focus-visible { outline: 3px solid #f6df8d; outline-offset: 3px; }

@media (max-width: 380px) {
  .combat-shell { padding-inline: 10px; }
  .combat-controls { grid-template-columns: 1fr auto; gap: 10px; }
  .combat-joystick { width: 78px; height: 78px; }
  .combat-attack { width: 84px; min-height: 84px; }
  .combat-dash { width: 58px; min-height: 58px; }
  .combat-vital > div { font-size: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .combat-player,
  .combat-enemy,
  .combat-player.is-moving .combat-actor-sprite,
  .combat-player.is-moving .combat-actor-fallback,
  .combat-outcome,
  .combat-wave-banner,
  .combat-pickup,
  .combat-horde-enemy.is-telegraphing::after,
  .combat-horde-enemy.is-hit,
  .combat-horde-enemy.is-hit::before,
  .combat-horde-enemy.is-staggered .combat-actor-sprite,
  .combat-horde-enemy.is-staggered .combat-actor-fallback,
  .combat-horde-enemy.is-runner-charge::after,
  .combat-horde-enemy.is-boss-stomp::after,
  .combat-horde-enemy.is-charging .combat-actor-sprite,
  .combat-horde-enemy.is-charging .combat-actor-fallback,
  .combat-horde-enemy.is-stomp-impact::after,
  .combat-horde-enemy.is-death-burst::after,
  .combat-arena.is-boss-finish,
  .combat-arena.is-boss-finish::after,
  .combat-target-reticle,
  .combat-shot-impact,
  .combat-player.is-protected::after,
  .combat-player.is-firing,
  .combat-attack.is-ready,
  .combat-dash.is-ready,
  .combat-joystick-knob { transition: none; animation: none !important; }
}


/* Intentional Horde entry owns a compact viewport loading state. The browser
   does not expose the old/preexisting run while the fresh server session is
   being created and resumed. */
body.is-horde-loading {
  overflow: hidden;
}
body.is-horde-loading .combat-shell {
  width: 100%;
  min-height: 100dvh;
  padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
}
body.is-horde-loading .combat-topbar,
body.is-horde-loading .combat-title,
body.is-horde-loading .combat-notice,
body.is-horde-loading .combat-trial {
  display: none;
}
body.is-horde-loading #combatGate {
  display: grid;
  width: min(100%, 360px);
  gap: 8px;
  padding: 22px 20px;
  text-align: center;
}
body.is-horde-loading #combatGate::before {
  content: "🍄";
  display: block;
  font-size: 2rem;
  line-height: 1;
}
body.is-horde-loading #combatGate h2,
body.is-horde-loading #combatGate p {
  margin: 0;
}
body.is-horde-loading #combatGate .combat-button {
  display: none;
}

/* Horde combat polish: keep the server-owned 400x640 stage visually dominant on phones. */
body.is-horde-route .combat-arena.is-horde {
  width: min(100%, 400px);
  aspect-ratio: 5 / 8;
}

body.is-horde-active {
  overflow: hidden;
}

body.is-horde-route:not(.is-horde-active):not(.is-horde-ended) .combat-controls {
  display: none;
}

body:is(.is-horde-active, .is-horde-ended) .combat-shell {
  width: 100%;
  padding: max(4px, env(safe-area-inset-top)) 6px max(4px, env(safe-area-inset-bottom));
}

body:is(.is-horde-active, .is-horde-ended) .combat-topbar,
body:is(.is-horde-active, .is-horde-ended) .combat-title,
body:is(.is-horde-active, .is-horde-ended) .combat-status-card,
body:is(.is-horde-active, .is-horde-ended) .combat-vitals,
body:is(.is-horde-active, .is-horde-ended) .combat-phase-copy {
  display: none;
}

body:is(.is-horde-active, .is-horde-ended) .combat-notice {
  position: fixed;
  z-index: 30;
  top: max(6px, env(safe-area-inset-top));
  left: 50%;
  width: min(calc(100% - 28px), 360px);
  min-height: 0;
  margin: 0;
  padding: 7px 10px;
  transform: translateX(-50%);
  border: 1px solid rgba(244, 229, 174, .22);
  border-radius: 999px;
  background: rgba(8, 27, 18, .82);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .28);
  font-size: .72rem;
  pointer-events: none;
}
body:is(.is-horde-active, .is-horde-ended) .combat-notice:empty { display: none; }

body:is(.is-horde-active, .is-horde-ended) .combat-trial {
  position: relative;
  width: min(100%, 400px);
  margin: 0 auto;
}

body:is(.is-horde-active, .is-horde-ended) .combat-arena.is-horde {
  width: 100%;
  max-height: calc(100dvh - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom)));
  border-radius: 20px;
}

body.is-horde-active .combat-controls {
  position: absolute;
  z-index: 12;
  left: 0;
  right: 0;
  bottom: max(12px, env(safe-area-inset-bottom));
  width: 100%;
  margin: 0;
  padding: 0 14px;
  grid-template-columns: 1fr auto;
  pointer-events: none;
}

body.is-horde-active .combat-joystick,
body.is-horde-active .combat-action-controls {
  pointer-events: auto;
}

body.is-horde-active .combat-joystick {
  width: 98px;
  height: 98px;
  background: rgba(13, 42, 27, .58);
  backdrop-filter: blur(2px);
}

body.is-horde-active .combat-attack {
  width: 98px;
  min-height: 98px;
  background: rgba(112, 82, 36, .9);
  backdrop-filter: blur(2px);
}

body.is-horde-active .combat-dash {
  width: 64px;
  min-height: 64px;
  background: rgba(34, 103, 102, .92);
  backdrop-filter: blur(2px);
}

body.is-horde-active .combat-attack.is-ready,
body.is-horde-active .combat-dash.is-ready {
  animation: combat-action-ready 720ms ease-in-out infinite alternate;
}
body.is-horde-active .combat-attack.is-cooling-down,
body.is-horde-active .combat-dash.is-cooling-down {
  animation: none;
}

body.is-horde-active .combat-actions {
  position: absolute;
  z-index: 13;
  top: 50px;
  right: 12px;
  margin: 0;
  pointer-events: none;
}

body.is-horde-active .combat-actions > * {
  flex: 0 0 auto;
  max-width: none;
  pointer-events: auto;
}

body.is-horde-active #combatLeave {
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(8, 29, 19, .72);
  font-size: .72rem;
}

body.is-horde-ended .combat-controls {
  display: none;
}

body.is-horde-ended .combat-actions {
  position: absolute;
  z-index: 15;
  left: 50%;
  bottom: max(22px, calc(env(safe-area-inset-bottom) + 10px));
  width: min(calc(100% - 34px), 330px);
  margin: 0;
  transform: translateX(-50%);
}

body.is-horde-ended .combat-actions > * {
  max-width: none;
}

.combat-horde-enemy.is-entering {
  opacity: 0;
  transform: translate(-50%, -50%) scale(.7);
}
.combat-horde-enemy.is-boss.is-entering {
  transform: translate(-50%, -50%) scale(.58);
}

.combat-player.is-attacking::before {
  content: "";
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 50%;
  width: 72%;
  height: 72%;
  border: 3px solid rgba(255, 232, 145, .96);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  filter: drop-shadow(0 0 5px rgba(255, 216, 92, .72));
  pointer-events: none;
  animation: combat-sword-arc 220ms ease-out both;
}

.combat-player.is-dashing .combat-actor-sprite,
.combat-player.is-dashing .combat-actor-fallback {
  animation: combat-dash 300ms ease-out both;
}
.combat-player[data-facing="east"].is-dashing .combat-actor-sprite,
.combat-player[data-facing="east"].is-dashing .combat-actor-fallback { filter: drop-shadow(-14px 0 0 rgba(145, 245, 232, .32)); }
.combat-player[data-facing="west"].is-dashing .combat-actor-sprite,
.combat-player[data-facing="west"].is-dashing .combat-actor-fallback { filter: drop-shadow(14px 0 0 rgba(145, 245, 232, .32)); }
.combat-player[data-facing="north"].is-dashing .combat-actor-sprite,
.combat-player[data-facing="north"].is-dashing .combat-actor-fallback { filter: drop-shadow(0 14px 0 rgba(145, 245, 232, .32)); }
.combat-player[data-facing="south"].is-dashing .combat-actor-sprite,
.combat-player[data-facing="south"].is-dashing .combat-actor-fallback { filter: drop-shadow(0 -14px 0 rgba(145, 245, 232, .32)); }

body.is-horde-active .combat-player.is-protected::after {
  inset: -2%;
  border: 3px solid rgba(157, 247, 239, .94);
  box-shadow: 0 0 0 4px rgba(119, 232, 224, .12), 0 0 17px rgba(111, 246, 235, .7);
  animation: combat-protection-pulse 480ms ease-in-out infinite alternate;
}

.combat-player[data-facing="east"].is-attacking::before { transform: translate(12%, -50%) rotate(45deg); }
.combat-player[data-facing="south"].is-attacking::before { transform: translate(-50%, 12%) rotate(135deg); }
.combat-player[data-facing="west"].is-attacking::before { transform: translate(-112%, -50%) rotate(225deg); }
.combat-player[data-facing="north"].is-attacking::before { transform: translate(-50%, -112%) rotate(315deg); }

.combat-arena.is-player-hit::after {
  content: "";
  position: absolute;
  z-index: 20;
  inset: 0;
  background: rgba(180, 45, 28, .2);
  box-shadow: inset 0 0 42px rgba(222, 76, 48, .34);
  pointer-events: none;
  animation: combat-arena-hit 240ms ease-out both;
}

.combat-arena.is-boss-finish {
  animation: combat-boss-finish 620ms ease-out;
}

.combat-arena.is-boss-finish::after {
  content: "";
  position: absolute;
  z-index: 19;
  inset: 0;
  background: radial-gradient(circle at 50% 46%, rgba(229, 244, 164, .28), rgba(113, 187, 95, .08) 38%, transparent 66%);
  box-shadow: inset 0 0 38px rgba(219, 238, 137, .28);
  pointer-events: none;
  animation: combat-boss-finish-flash 620ms ease-out both;
}

.combat-arena.is-ended::before {
  content: "";
  position: absolute;
  z-index: 5;
  inset: 0;
  background: rgba(4, 14, 9, .46);
  pointer-events: none;
}

.combat-arena.is-ended .combat-outcome {
  z-index: 14;
  top: 44%;
  width: min(82%, 300px);
  padding: 17px 18px;
  pointer-events: none;
}

.combat-arena.is-ended .combat-outcome strong {
  font-size: 1.2rem;
}

@keyframes combat-sword-arc {
  from { opacity: 0; scale: .72; }
  35% { opacity: 1; }
  to { opacity: 0; scale: 1.22; }
}

@keyframes combat-boss-finish {
  0%, 100% { transform: scale(1); }
  28% { transform: scale(1.012); }
}
@keyframes combat-boss-finish-flash {
  0% { opacity: 0; }
  24% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes combat-arena-hit {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes combat-dash {
  0% { opacity: .58; transform: scaleX(.78); }
  55% { opacity: 1; transform: scaleX(1.12); }
  100% { opacity: 1; transform: scaleX(1); }
}

@keyframes combat-protection-pulse {
  from { opacity: .58; transform: scale(.94); }
  to { opacity: 1; transform: scale(1.08); }
}

@media (orientation: landscape) and (max-height: 520px) {
  body:is(.is-horde-active, .is-horde-ended) {
    --combat-landscape-safe-top: max(8px, env(safe-area-inset-top));
    --combat-landscape-safe-right: max(12px, calc(env(safe-area-inset-right) + 6px));
    --combat-landscape-safe-bottom: max(10px, calc(env(safe-area-inset-bottom) + 4px));
    --combat-landscape-safe-left: max(12px, calc(env(safe-area-inset-left) + 6px));
  }

  body:is(.is-horde-active, .is-horde-ended) .combat-shell {
    width: 100%;
    min-height: 100dvh;
    height: 100dvh;
    padding: 0;
    overflow: hidden;
  }

  body:is(.is-horde-active, .is-horde-ended) .combat-trial {
    position: relative;
    width: 100%;
    height: 100dvh;
    margin: 0;
  }

  body:is(.is-horde-active, .is-horde-ended) .combat-arena.is-horde {
    position: absolute;
    top: var(--combat-landscape-safe-top);
    left: 50%;
    width: auto;
    height: calc(100dvh - var(--combat-landscape-safe-top) - var(--combat-landscape-safe-bottom));
    max-width: none;
    max-height: none;
    margin: 0;
    aspect-ratio: 5 / 8;
    transform: translateX(-50%);
    border-radius: 18px;
  }

  body:is(.is-horde-active, .is-horde-ended) .combat-arena.is-horde.is-horde-wide {
    aspect-ratio: 51 / 40;
  }

  body:is(.is-horde-active, .is-horde-ended) .combat-arena.is-horde.is-horde-wide .combat-camera-stage {
    transform: none !important;
  }

  body:is(.is-horde-active, .is-horde-ended) .combat-arena.is-horde.is-horde-wide .combat-world {
    left: 0;
    right: 0;
    width: 100%;
  }

  body:is(.is-horde-active, .is-horde-ended) .combat-horde-hud {
    top: 7px;
    width: calc(100% - 12px);
    grid-template-columns: .8fr 1.4fr .8fr;
    gap: 3px;
  }

  body:is(.is-horde-active, .is-horde-ended) .combat-horde-hud span {
    min-height: 24px;
    padding: 4px 3px;
    display: grid;
    place-items: center;
    font-size: .58rem;
    line-height: 1.05;
    white-space: normal;
  }

  body.is-horde-active .combat-upgrade-panel {
    top: 50%;
    width: min(88%, 360px);
    padding: 9px;
    gap: 6px;
  }

  body.is-horde-active .combat-upgrade-choice {
    min-height: 64px;
    padding: 6px;
  }

  body.is-horde-active .combat-upgrade-choice strong { font-size: .68rem; }
  body.is-horde-active .combat-upgrade-choice span { font-size: .56rem; }
  body.is-horde-active .combat-upgrade-choice small { font-size: .52rem; }

  body:is(.is-horde-active, .is-horde-ended) .combat-notice {
    top: var(--combat-landscape-safe-top);
    left: var(--combat-landscape-safe-left);
    width: clamp(140px, 22vw, 190px);
    transform: none;
    border-radius: 14px;
    text-align: left;
  }

  body.is-horde-active .combat-controls {
    position: fixed;
    z-index: 32;
    inset: 0;
    display: block;
    width: auto;
    height: 100dvh;
    margin: 0;
    padding: 0;
    pointer-events: none;
  }

  body.is-horde-active .combat-joystick {
    position: absolute;
    left: var(--combat-landscape-safe-left);
    bottom: var(--combat-landscape-safe-bottom);
    width: 100px;
    height: 100px;
  }

  body.is-horde-active .combat-action-controls {
    position: absolute;
    right: var(--combat-landscape-safe-right);
    bottom: var(--combat-landscape-safe-bottom);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  body.is-horde-active .combat-attack {
    width: 96px;
    min-height: 96px;
  }

  body.is-horde-active .combat-dash {
    width: 62px;
    min-height: 62px;
  }

  body.is-horde-active .combat-actions {
    position: fixed;
    top: var(--combat-landscape-safe-top);
    right: var(--combat-landscape-safe-right);
    left: auto;
    margin: 0;
  }

  body.is-horde-active #combatLeave {
    min-height: 44px;
    padding: 7px 12px;
  }

  body.is-horde-ended .combat-actions {
    position: fixed;
    z-index: 32;
    right: var(--combat-landscape-safe-right);
    bottom: var(--combat-landscape-safe-bottom);
    left: auto;
    width: clamp(150px, 23vw, 210px);
    margin: 0;
    transform: none;
    flex-direction: column;
  }

  body.is-horde-ended .combat-actions > * {
    width: 100%;
    min-height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .combat-arena.is-horde-wide .combat-camera-stage {
    transition: none !important;
  }
  .combat-player.is-attacking::before,
  .combat-player.is-dashing .combat-actor-sprite,
  .combat-player.is-dashing .combat-actor-fallback,
  body.is-horde-active .combat-player.is-protected::after,
  .combat-arena.is-player-hit::after,
  .combat-horde-enemy.is-entering {
    animation: none !important;
    transition: none !important;
  }
}
.combat-extraction { border: 1px solid #8d7048; border-radius: 12px; padding: 10px; background: #fff6df; }
.combat-extraction p { margin: 0 0 8px; }
.combat-extraction button { min-height: 44px; }

/* Flight is essential feedback and remains visible with reduced motion. */
.combat-projectile { position:absolute; z-index:5; display:block; width:7px; height:3px; background:#ffe7a4; border:1px solid #322419; border-radius:2px; pointer-events:none; }

/* Reuses the combat controller and leaves the movement/action touch targets clear. */
.combat-action-controls { position: relative; }
.combat-mount {
  position: absolute; right: 0; bottom: calc(100% + 8px);
  min-width: 132px; min-height: 44px; padding: 8px 12px;
  border: 1px solid #d5dfac; border-radius: 12px;
  color: #fff6d4; background: rgba(35, 65, 39, .96);
  touch-action: manipulation; font: inherit; font-size: 13px;
}
.combat-mount[hidden] { display: none; }
