.game[data-battle] {
  width: min(876px, 100%);
}
.game[data-battle] .life {
  display: none;
}

.battle-scene {
  --hero-x: 24%;
  --foe-x: 76%;
  --ground: 17%;
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  height: clamp(214px, 34.5svh, 326px);
  overflow: hidden;
  color: #fff4d8;
  background: #1c392e url("mosswood-arena.webp") center 65% / cover no-repeat;
  border-bottom: 3px solid #aa9162;
}
.battle-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(0deg, #0c1c19d9, #0c1c1938 15%, transparent 35%, transparent 78%, #13221c55),
    linear-gradient(90deg, #091b1929, transparent 42%, transparent 68%, #091b1933);
}
.grandstands {
  position: absolute;
  inset: 0 4% 31%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
}
.stand {
  position: relative;
  width: min(42%, 32svh);
  aspect-ratio: 512 / 270;
  background: url("mosswood-stands.webp") 0 0 / 200% 200% no-repeat;
  filter: saturate(0.76) brightness(0.88);
}
.stand::after {
  content: "";
  position: absolute;
  inset: 98% 6% auto;
  height: 12%;
  background: linear-gradient(90deg, #382c23, #6a523a 8%, #413326 42%, #715941 88%, #3e3026);
  clip-path: polygon(
    0 0,
    100% 0,
    99% 100%,
    95% 100%,
    94% 18%,
    53% 18%,
    52% 100%,
    48% 100%,
    47% 18%,
    6% 18%,
    5% 100%,
    1% 100%
  );
}
[data-area="castle"] .stand::after {
  background: linear-gradient(90deg, #615650, #897664 8%, #51484b 42%, #8c786b 88%, #544b51);
}
[data-area="castle"] .stand {
  background-image: url("castle-stands.webp");
}
.stand:last-child {
  background-position-x: 100%;
}
@container (max-width: 550px) {
  .grandstands {
    inset: 0 1% 34%;
  }
  .stand {
    width: 48%;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .battle-scene[data-result="won"]:not([data-beat="idle"]) .stand {
    animation: crowd-cheer 1ms steps(1, end) 70ms forwards;
  }
  .battle-scene[data-result="won"]:not([data-beat="idle"]) .stand:last-child {
    animation-delay: 125ms;
  }
}
@keyframes crowd-cheer {
  from {
    background-position-y: 0%;
  }
  to {
    background-position-y: 100%;
  }
}
.arena-room,
.arena-log,
.arena-skip,
.intent-bubble {
  position: absolute;
  z-index: 5;
  background: #182c25ed;
  border: 1px solid #b49c6c;
  box-shadow: 0 2px 5px #07151270;
  color: #f4e6bb;
}
.arena-room {
  top: 9px;
  left: 0;
  padding: 5px 17px 5px 12px;
  border-left: 0;
  border-radius: 0 12px 12px 0;
  font: 700 10px/1.2 var(--sans);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.arena-log,
.arena-skip {
  top: 7px;
  right: 8px;
  min-width: 32px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 5px;
}
.arena-skip {
  right: 46px;
  padding-inline: 8px;
  font: 650 11px var(--sans);
}
.arena-log:hover,
.arena-skip:hover {
  background: #354b38;
}

.intent-bubble {
  left: var(--foe-x);
  top: 12%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: max-content;
  max-width: 43%;
  padding: 4px 9px;
  border-radius: 12px;
  color: #ffdfae;
  border-color: #dfb080;
  background: #412d22ee;
  font: 700 clamp(10px, 1.55cqw, 13px) / 1.15 var(--sans);
  text-align: center;
}
.intent-bubble::after {
  content: "";
  position: absolute;
  left: calc(50% - 3px);
  bottom: -4px;
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  border: solid #d5af7e;
  border-width: 0 1px 1px 0;
  background: #412d22;
}
.intent-bubble svg {
  width: 14px;
  height: 14px;
}
.intent-bubble[data-icon="shield"],
.intent-bubble[data-icon="heart"] {
  background: #213c36f0;
  color: #e0edd3;
  border-color: #aed0b4;
}
.intent-bubble[data-icon="shield"]::after,
.intent-bubble[data-icon="heart"]::after {
  background: #213c36;
  border-color: #aed0b4;
}
.intent-bubble[data-acting] {
  outline: 1px solid #fff0c1;
}

.fighter {
  position: absolute;
  z-index: 2;
  bottom: var(--ground);
  transform: translateX(-50%);
  pointer-events: none;
}
.fighter.hero {
  left: var(--hero-x);
  height: 64%;
  aspect-ratio: 1140 / 720;
}
.fighter.foe {
  left: var(--foe-x);
  height: 68%;
  aspect-ratio: 576 / 544;
}
.fighter-motion,
.fighter-sprite {
  position: absolute;
  inset: 0;
  transform-origin: 50% 96%;
}
.fighter-sprite {
  background-repeat: no-repeat;
  filter: drop-shadow(1px 2px 1px #141c1b80);
  animation: battle-breathe 3.25s ease-in-out infinite;
}
.fall-cel {
  position: absolute;
  bottom: 0;
  left: 50%;
  height: 100%;
  aspect-ratio: 416 / 272;
  transform: translateX(-50%);
  opacity: 0;
  background-repeat: no-repeat;
  background-size: 200% var(--fall-rows, 100%);
  background-position: 0% var(--fall-row, 0%);
  filter: drop-shadow(1px 2px 1px #141c1b80);
}
.hero .fall-cel {
  background-image: url("wayfarer-fall.webp");
}
.foe .fall-cel {
  background-image: url("mosswood-falls.webp");
}
[data-area="castle"] .foe .fall-cel {
  background-image: url("castle-falls.webp");
}

.hero .fighter-sprite {
  background-image: url("wayfarer.webp");
  background-size: 300% 100%;
}
.hero[data-pose="cast"] .fighter-sprite {
  background-position: 50% 0;
  animation: none;
}
.hero[data-pose="guard"] .fighter-sprite {
  background-position: 100% 0;
}
.foe .fighter-sprite {
  background-image: url("arena-foes.webp");
  animation-delay: -0.9s;
}
[data-foe="moth"] .foe .fighter-sprite {
  animation: battle-hover 2.1s ease-in-out infinite;
}
[data-foe="scribe"] .foe .fighter-sprite {
  animation: battle-hover 2.8s ease-in-out infinite;
}
[data-foe="inkcap"] .foe .fighter-sprite {
  animation-duration: 1.9s;
}
[data-foe="boar"] .foe .fighter-sprite {
  animation-duration: 3.8s;
}
.foot-shadow {
  position: absolute;
  left: 28%;
  right: 28%;
  bottom: 0;
  height: 7%;
  background: radial-gradient(ellipse, #0b1714be 8%, #0b17145e 48%, transparent 72%);
}
.foe .foot-shadow {
  left: 11%;
  right: 10%;
}
.fireflies,
.stage-fx {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.fireflies i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #f3d98b;
  box-shadow: 0 0 7px 2px #f5cb727d;
  animation: firefly-drift 6s ease-in-out infinite alternate;
  opacity: 0.55;
}
.fireflies i:nth-child(1) {
  left: 14%;
  top: 45%;
}
.fireflies i:nth-child(2) {
  left: 41%;
  top: 64%;
  animation-delay: -3s;
}
.fireflies i:nth-child(3) {
  left: 63%;
  top: 35%;
  animation-delay: -1s;
}
.fireflies i:nth-child(4) {
  left: 87%;
  top: 54%;
  animation-delay: -4s;
}

.combat-hud {
  position: absolute;
  z-index: 4;
  bottom: 2.5%;
  width: clamp(91px, 20%, 150px);
  transform: translateX(-50%);
  display: grid;
  justify-items: stretch;
  gap: 3px;
  text-align: center;
  pointer-events: none;
}
.hero-hud {
  left: var(--hero-x);
}
.foe-hud {
  left: var(--foe-x);
}
.fighter-name {
  color: #fff5d5;
  font: 650 clamp(14px, 2.25cqw, 21px) / 1 var(--serif);
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-shadow:
    0 1px 2px #0a1714,
    0 0 5px #071511,
    1px 1px 2px #071511;
}
.hp-meter {
  position: relative;
  border: 1px solid #c8a979;
  border-radius: 6px 2px;
  background: #291f20;
  overflow: hidden;
  box-shadow: 0 1px 3px #071515;
  color: #fff9df;
  font: 750 11px/1.16 var(--sans);
  font-variant-numeric: tabular-nums;
}
.hp-meter i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(#bb6551, #985042);
  transition: width 200ms ease-out;
}
.hero-hud .hp-meter i {
  background: linear-gradient(#8f9b65, #586943);
}
.hp-meter b {
  position: relative;
  text-shadow: 0 1px 2px #222;
}
.armor-tag {
  position: absolute;
  left: calc(100% + 3px);
  bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #c7f0e8;
  background: #163c36;
  border: 1px solid #86b4a4;
  border-radius: 4px;
  padding: 1px 3px;
  font: 700 10px/1 var(--sans);
}
.armor-tag svg {
  width: 10px;
  height: 10px;
}

.spell-path {
  position: absolute;
  z-index: 3;
  left: calc(var(--hero-x) + 5%);
  right: calc(100% - var(--foe-x) - 1%);
  top: 45%;
  height: 1px;
  pointer-events: none;
}
.flying-word {
  position: absolute;
  display: none;
  left: 0;
  color: #fff5c9;
  font: 700 clamp(16px, 4.3cqw, 32px) / 1 var(--serif);
  letter-spacing: 0.07em;
  text-shadow:
    0 1px 2px #31261b,
    0 0 3px #49361e,
    0 0 8px #d58a31;
}
.flying-word::after {
  content: "";
  position: absolute;
  left: -29%;
  right: -6%;
  bottom: -2px;
  height: 4px;
  background: linear-gradient(90deg, transparent, #dba85a, #fff2bd);
  clip-path: polygon(0 90%, 71% 15%, 100% 0, 65% 95%);
}
[data-beat="cast"] .flying-word {
  display: block;
  animation: word-flight 0.45s ease-out both;
}
[data-beat="ward"] .flying-word {
  display: block;
  color: #c1ffe4;
  animation: ward-word 0.52s ease-out both;
}
[data-beat="cast"] .hero .fighter-motion {
  animation: quill-step 0.5s ease-out both;
}
[data-delivery="strike"] .foe .fighter-motion {
  animation: foe-lunge 0.54s cubic-bezier(0.32, 0.08, 0.24, 1) both;
}
[data-delivery="dive"] .foe .fighter-motion {
  animation: wing-dive 0.54s ease-out both;
}
:is([data-delivery="channel"], [data-delivery="spores"], [data-delivery="thorns"], [data-delivery="ember"])
  .foe
  .fighter-motion {
  animation: channel 0.72s ease-out both;
}
.foe-shot {
  position: absolute;
  display: none;
}
:is([data-delivery="spores"], [data-delivery="thorns"], [data-delivery="ember"]) .foe-shot {
  display: block;
  animation: ranged-shot 0.36s ease-in both;
}
[data-delivery="spores"] .foe-shot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffefb6;
  box-shadow:
    0 0 8px 4px #cab664ab,
    7px -9px 0 -2px #fae9a5,
    14px 4px 0 -1px #e6c26a,
    22px -5px 3px #a8be7988;
}
[data-delivery="ember"] .foe-shot {
  width: 28px;
  height: 12px;
  border-radius: 65% 10% 80% 35%;
  background: radial-gradient(ellipse at 25% 55%, #fff7c8 9%, #ffb348 35%, #e34925 63%, transparent 74%);
  box-shadow:
    -1px 0 9px 2px #f87835af,
    12px -3px 6px -2px #e77c3a99;
}
[data-delivery="thorns"] .foe-shot {
  width: 18%;
  height: 15px;
  background: linear-gradient(0deg, #594326, #f4d38c);
  clip-path: polygon(0 45%, 36% 35%, 30% 0, 52% 31%, 75% 24%, 67% 4%, 100% 36%, 67% 66%, 51% 100%, 52% 65%);
}
.fighter[data-impact="hurt"] .fighter-sprite {
  animation: hit-recoil 0.33s ease-out both;
}
.guard-ring {
  position: absolute;
  opacity: 0;
  top: 17%;
  bottom: 4%;
  left: 58%;
  width: 24%;
  border-right: 4px solid #c8fff1;
  border-radius: 50%;
  box-shadow:
    inset -5px 0 7px #71f5df88,
    4px 0 9px #6fcdb077;
}
.foe .guard-ring {
  left: 0;
  transform: scaleX(-1);
}
.fighter[data-ward] .guard-ring,
.fighter[data-impact="guard"] .guard-ring,
[data-beat="ward"] .hero .guard-ring {
  animation: ward-light 0.74s ease-out both;
}
.stage-fx {
  z-index: 4;
}
.combat-float {
  position: absolute;
  top: 40%;
  display: grid;
  width: max-content;
  max-width: 44%;
  justify-items: center;
  padding: 3px 7px;
  border-radius: 4px;
  background: #17241dda;
  color: #ffbf94;
  font: 700 clamp(17px, 3.5cqw, 26px) / 1 var(--serif);
  text-shadow: 0 1px 2px #1b1c12;
  animation: impact-text 0.79s ease-out both;
}
.hero-float {
  left: var(--hero-x);
}
.foe-float {
  left: var(--foe-x);
}
[data-result="won"] .foe-float,
[data-result="lost"] .hero-float {
  top: 24%;
}
.combat-float.ward {
  color: #c2f4df;
}
.combat-float.mend {
  color: #cee7a8;
  top: 29%;
}
.combat-float.power {
  color: #f7d78e;
}
.combat-float small {
  font: 700 10px/1.2 var(--sans);
  color: #caf1dd;
}

@keyframes battle-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: translateY(-0.8%) scale(0.995, 1.015);
  }
}
@keyframes battle-hover {
  0%,
  100% {
    transform: translateY(-4%) rotate(-2deg);
  }
  50% {
    transform: translateY(-8%) rotate(2deg) scaleX(0.97);
  }
}
@keyframes firefly-drift {
  0% {
    transform: translate(0, 0);
    opacity: 0.12;
  }
  55% {
    opacity: 0.8;
  }
  100% {
    transform: translate(11px, -12px);
    opacity: 0.3;
  }
}
@keyframes quill-step {
  0% {
    transform: translateX(-3%) rotate(-4deg);
  }
  34%,
  53% {
    transform: translateX(17%) rotate(1deg);
  }
  100% {
    transform: none;
  }
}
@keyframes word-flight {
  0% {
    left: 0;
    transform: translate(-40%, 30%) scale(0.55);
    opacity: 0;
  }
  22% {
    opacity: 1;
  }
  60% {
    left: 90%;
    transform: translate(-50%, -20%) scale(1.08);
    opacity: 1;
  }
  100% {
    left: 100%;
    transform: translate(-50%, -42%) scale(0.9);
    opacity: 0;
  }
}
@keyframes ward-word {
  0% {
    transform: translate(-70%, 50%) scale(0.65);
    opacity: 0;
  }
  32% {
    opacity: 1;
  }
  100% {
    transform: translate(-70%, -60%);
    opacity: 0;
  }
}
@keyframes foe-lunge {
  0%,
  100% {
    transform: none;
  }
  22% {
    transform: translateX(6%) scale(0.97, 0.94);
  }
  42%,
  50% {
    transform: translate(calc(-52cqw + 68%), -4%) rotate(-5deg);
  }
  72% {
    transform: translateX(-6cqw);
  }
}
@keyframes wing-dive {
  0%,
  100% {
    transform: none;
  }
  22% {
    transform: translate(4%, -15%) rotate(6deg);
  }
  43%,
  52% {
    transform: translate(calc(-52cqw + 60%), 3%) rotate(-12deg);
  }
  75% {
    transform: translate(-5cqw, -10%);
  }
}
@keyframes ranged-shot {
  0% {
    left: 95%;
    transform: translateY(6px) scale(0.5);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  65% {
    left: 0%;
    transform: translateY(-2px);
    opacity: 1;
  }
  100% {
    left: -5%;
    transform: translateY(4px) scale(0.65);
    opacity: 0;
  }
}
@keyframes channel {
  0%,
  100% {
    transform: none;
  }
  45% {
    transform: translateY(-4%) scale(1.04);
    filter: drop-shadow(0 0 6px #e5e4a0);
  }
}
@keyframes hit-recoil {
  0% {
    filter: brightness(1.5) drop-shadow(0 0 3px #ffcb8c);
    transform: translateX(4%) skewX(4deg);
  }
  46% {
    transform: translateX(-1%) skewX(-2deg);
  }
  100% {
    transform: none;
  }
}
.hero[data-impact="hurt"] .fighter-sprite {
  animation-name: hero-recoil;
}
@keyframes hero-recoil {
  0% {
    filter: brightness(1.46);
    transform: translateX(-5%) rotate(-5deg);
  }
  100% {
    transform: none;
  }
}
@keyframes ward-light {
  0% {
    opacity: 0;
  }
  20%,
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes impact-text {
  0% {
    opacity: 0;
    transform: translate(-50%, 9px) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -1px) scale(1.08);
  }
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -19px);
  }
}

/* The recoil uses the live sprite. Two foot-aligned drawings carry the weight down to the floor. */
.fighter {
  --hit-shift: 5%;
  --rest-shift: 7%;
  --hit-lean: 3deg;
  --buckle-lift: -2%;
  --dust-ink: #dbca9f;
}
.fighter.hero {
  --hit-shift: -5%;
  --rest-shift: -7%;
  --hit-lean: -3deg;
}
:is([data-foe="moth"], [data-foe="scribe"]) .foe {
  --buckle-lift: -9%;
}
[data-area="castle"] .fighter {
  --dust-ink: #dbc2ad;
}

.fighter[data-defeat] .fighter-sprite {
  animation: none;
}
.fighter[data-defeat="hit"] .fighter-motion {
  animation: last-hit 65ms ease-out both;
}
.fighter[data-defeat="hit"] .fighter-sprite {
  filter: brightness(1.23) drop-shadow(1px 2px 1px #26201990);
}
.fighter:is([data-defeat="buckle"], [data-defeat="land"], [data-defeat="down"]) .fighter-sprite {
  opacity: 0;
}
.fighter:is([data-defeat="buckle"], [data-defeat="land"], [data-defeat="down"]) .fall-cel {
  opacity: 1;
}
.fighter[data-defeat="buckle"] .fighter-motion {
  animation: lose-footing 140ms cubic-bezier(0.44, 0.03, 0.87, 0.52) both;
}
.fighter:is([data-defeat="land"], [data-defeat="down"]) .fall-cel {
  background-position-x: 100%;
}
.fighter[data-defeat="land"] .fighter-motion {
  animation: touch-ground 185ms ease-out both;
}
.fighter[data-defeat="down"] .fighter-motion {
  transform: translateX(var(--rest-shift));
}
.fighter:is([data-defeat="land"], [data-defeat="down"]) .foot-shadow {
  transform: translateX(var(--rest-shift)) scaleX(1.2);
}
.fighter[data-defeat="land"] .foot-shadow::after {
  content: "";
  position: absolute;
  inset: -100% -15% 10%;
  background:
    radial-gradient(ellipse at 7% 74%, var(--dust-ink) 0 2%, transparent 4%),
    radial-gradient(ellipse at 17% 46%, var(--dust-ink) 0 2%, transparent 4%),
    radial-gradient(ellipse at 24% 68%, var(--dust-ink) 0 3%, transparent 6%),
    radial-gradient(ellipse at 72% 60%, var(--dust-ink) 0 3%, transparent 6%),
    radial-gradient(ellipse at 82% 42%, var(--dust-ink) 0 2%, transparent 4%),
    radial-gradient(ellipse at 90% 80%, var(--dust-ink) 0 2%, transparent 4%);
  transform-origin: center bottom;
  animation: landing-dust 200ms ease-out both;
}
@keyframes last-hit {
  0%,
  32% {
    transform: none;
  }
  100% {
    transform: translate(var(--hit-shift), -1%) rotate(var(--hit-lean));
  }
}
@keyframes lose-footing {
  0% {
    transform: translate(var(--hit-shift), var(--buckle-lift)) rotate(var(--hit-lean));
  }
  30% {
    transform: translate(var(--rest-shift), var(--buckle-lift));
  }
  100% {
    transform: translate(var(--rest-shift), 1%) rotate(var(--hit-lean));
  }
}
@keyframes touch-ground {
  0% {
    transform: translate(var(--rest-shift), 1%) scale(1.01, 0.96);
  }
  35% {
    transform: translate(var(--rest-shift), -1%) scale(1, 1.01);
  }
  100% {
    transform: translateX(var(--rest-shift));
  }
}
@keyframes landing-dust {
  from {
    opacity: 0;
    transform: scale(0.68, 0.4);
  }
  22% {
    opacity: 0.7;
  }
  to {
    opacity: 0;
    transform: translateY(-35%) scale(1.18, 1);
  }
}

body[data-area="castle"] {
  background: radial-gradient(ellipse at 50% 18%, #53414b, #2d2e3c 52%, #1a1923);
}
[data-area="castle"] .game {
  background: #363443;
  box-shadow:
    0 0 0 3px #25202b,
    0 0 0 4px #796651,
    0 18px 64px #130f1c88;
}
[data-area="castle"] .hud {
  background: linear-gradient(100deg, #362a35, #393342);
}
[data-area="castle"] .battle-scene {
  background-image: url("briarwatch-hall.webp");
  background-color: #483b46;
  background-position: center 68%;
}
[data-area="castle"] .foe .fighter-sprite {
  background-image: url("castle-foes.webp");
}
[data-area="castle"] .fireflies i {
  background: #ffce8c;
  box-shadow: 0 0 5px 2px #de642778;
}
[data-area="castle"] .workbench {
  background:
    radial-gradient(ellipse at 50% 0%, #574355, transparent 72%),
    repeating-linear-gradient(35deg, #d3a18d08 0 1px, transparent 1px 4px), #373440;
}
[data-area="castle"] .spelling {
  background: #302a36;
  border-color: #99856e;
}
[data-area="castle"] .socket {
  background: #433944;
  border-color: #ab958080;
  color: #c2ada4;
}
[data-area="castle"] .socket.lead {
  color: #f6d690;
  border-color: #b9a476;
  background: #56464d;
}
[data-area="castle"] .arena-room,
[data-area="castle"] .arena-log,
[data-area="castle"] .arena-skip {
  background: #332531ed;
}
[data-area="castle"] .scene-emblem {
  color: #f0cc87;
  background:
    linear-gradient(#352d4180, #282136b3),
    url("briarwatch-hall.webp") center / cover;
}
[data-area="castle"] .map-node:is(.current, .open) {
  color: #fff0ce;
  background: #5c4050;
  border-color: #72555d;
}
@media (min-width: 700px) and (min-height: 501px) {
  .game[data-battle] .workbench {
    padding-inline: max(28px, calc((100% - 674px) / 2));
    padding-block: 10px 14px;
  }
}
@media (max-width: 550px) {
  .battle-scene {
    height: clamp(177px, 30svh, 235px);
    --ground: 20%;
  }
  .arena-room {
    top: 6px;
    padding: 4px 9px;
    font-size: 8px;
  }
  .arena-log {
    top: 5px;
    right: 5px;
    width: 26px;
    min-width: 0;
    height: 25px;
  }
  .arena-skip {
    right: 36px;
    top: 5px;
    height: 23px;
    font-size: 9px;
  }
  .intent-bubble {
    top: 15%;
  }
  .combat-hud {
    gap: 2px;
    bottom: 3%;
  }
  .hp-meter {
    font-size: 10px;
  }
}
@media (max-width: 355px) and (max-height: 600px) {
  .battle-scene {
    height: 164px;
  }
}
@media (orientation: landscape) and (min-width: 551px) and (max-width: 920px) and (max-height: 500px) {
  .arena:has(.workbench:not([hidden])) .grandstands {
    bottom: 46%;
  }
  .arena:has(.workbench:not([hidden])) .stand::after {
    height: 36%;
  }
  .game[data-battle] {
    width: min(900px, 100%);
  }
  .arena:has(.workbench:not([hidden])) .battle-scene {
    height: 100%;
    min-height: 228px;
    --ground: 22%;
    border-bottom: 0;
    border-right: 2px solid #a18c60;
  }
  .arena:has(.workbench:not([hidden])) .fighter.hero {
    height: 49%;
  }
  .arena:has(.workbench:not([hidden])) .fighter.foe {
    height: 53%;
  }
  .battle-scene {
    --hero-x: 24%;
    --foe-x: 74%;
  }
  .arena-room {
    font-size: 8px;
    top: 6px;
    padding: 4px 8px;
  }
  .arena-log {
    top: 5px;
    right: 5px;
    width: 25px;
    min-width: 0;
    height: 23px;
  }
  .arena-skip {
    top: 5px;
    right: 34px;
    height: 23px;
    font-size: 9px;
  }
  .intent-bubble {
    top: 21%;
    max-width: 48%;
  }
  .combat-hud {
    width: 39%;
    bottom: 5%;
  }
  .fighter-name {
    font-size: 14px;
  }
  .armor-tag {
    left: auto;
    right: -3px;
    bottom: 14px;
  }
  .game[data-battle] .workbench {
    padding-inline: 7px;
  }
  .game[data-battle] .hand-rack .letter-tile {
    flex-basis: calc((100% - 4 * var(--gap)) / 5);
    height: 38px;
  }
  .game[data-battle] .hand-rack .glyph {
    font-size: 21px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .battle-scene *,
  .battle-scene *::before,
  .battle-scene *::after {
    animation: none !important;
    transition: none !important;
  }
}
