:root {
  --ink: #24170f;
  --paper: #fff4df;
  --paper-2: #f6dfb7;
  --night: #121827;
  --night-2: #1d2b38;
  --street: #313846;
  --orange: #ff6b1a;
  --gold: #ffb020;
  --green: #79a614;
  --blue: #4f8ba6;
  --violet: #a594ff;
  --red: #d94b3d;
  --muted: #8d7d69;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  color: var(--paper);
  background: var(--night);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  image-rendering: pixelated;
}

button {
  font: inherit;
}

.app {
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
  padding: 24px;
}

.pixel-panel {
  border: 4px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .35);
  background: var(--paper);
  color: var(--ink);
}

.menu-screen {
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(#101727 0 45%, #202b38 45% 72%, #2f3640 72% 100%);
}

.menu-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.moon {
  position: absolute;
  top: 54px;
  right: 12%;
  width: 48px;
  height: 48px;
  background: #f5dc8b;
  border: 4px solid var(--ink);
  box-shadow: 0 0 0 8px rgba(245, 220, 139, .12);
}

.lamp {
  position: absolute;
  left: 11%;
  bottom: 152px;
  width: 16px;
  height: 118px;
  background: var(--ink);
}

.lamp::before {
  content: "";
  position: absolute;
  left: -16px;
  top: -22px;
  width: 48px;
  height: 24px;
  background: var(--gold);
  border: 4px solid var(--ink);
}

.shop {
  position: absolute;
  right: 8%;
  bottom: 92px;
  width: 230px;
  height: 128px;
  border: 4px solid var(--ink);
  background: #3b4b61;
}

.shop::before {
  content: "";
  position: absolute;
  left: 18px;
  top: -30px;
  width: 170px;
  height: 32px;
  border: 4px solid var(--ink);
  background: #9e5650;
}

.bin {
  position: absolute;
  left: 23%;
  bottom: 78px;
  width: 54px;
  height: 42px;
  border: 4px solid var(--ink);
  background: #64748b;
}

.animal-dot {
  position: absolute;
  bottom: 76px;
  width: 28px;
  height: 18px;
  border: 3px solid var(--ink);
  background: #d97706;
}

.animal-dot.one { left: 35%; }
.animal-dot.two { left: 39%; width: 20px; background: #111827; }
.animal-dot.three { left: 43%; width: 22px; background: #e5e7eb; }

.menu-card {
  position: relative;
  z-index: 2;
  width: min(520px, calc(100vw - 40px));
  padding: 34px;
  text-align: center;
}

.title {
  margin: 0;
  font-size: clamp(38px, 8vw, 70px);
  line-height: 1;
  letter-spacing: 2px;
}

.subtitle {
  margin: 14px 0 26px;
  color: var(--muted);
  font-weight: 700;
}

.menu-actions,
.save-list {
  display: grid;
  gap: 12px;
}

.pixel-button {
  border: 4px solid var(--ink);
  background: var(--orange);
  color: white;
  padding: 13px 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(36, 23, 15, .28);
  transition: transform .08s steps(2), filter .08s steps(2);
}

.pixel-button:not(:disabled):hover {
  transform: translate(-2px, -2px);
  filter: brightness(1.08);
}

.pixel-button:not(:disabled):active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(36, 23, 15, .28);
}

.pixel-button.secondary {
  background: var(--paper-2);
  color: var(--ink);
}

.pixel-button.dark {
  background: var(--night-2);
}

.pixel-button:disabled {
  cursor: not-allowed;
  filter: grayscale(.8);
  opacity: .65;
}

.save-slot {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 4px solid var(--ink);
  background: #fffaf1;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.save-thumb {
  height: 58px;
  border: 3px solid var(--ink);
  background:
    linear-gradient(#17202b 0 50%, #303640 50% 100%);
  position: relative;
}

.save-thumb::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: 10px;
  width: 28px;
  height: 16px;
  border: 2px solid var(--ink);
  background: #d97706;
}

.battle-screen {
  display: grid;
  grid-template-rows: auto minmax(300px, 42vh) auto auto 1fr;
  gap: 14px;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 176, 32, .12), transparent 26%),
    linear-gradient(#0f1724, #111827 55%, #0b101a);
}

.topbar,
.battle-log,
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
}

.map-screen .topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
}

.stat-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.stat {
  border: 3px solid var(--ink);
  padding: 6px 10px;
  background: #fffaf1;
  color: var(--ink);
  font-weight: 900;
}

.phase-badge {
  background: var(--orange);
  color: #fff;
}

.enemy-stat {
  background: #3b3029;
  color: #fff4df;
}

.map-screen {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  background:
    radial-gradient(circle at 72% 10%, rgba(255, 176, 32, .14), transparent 20%),
    linear-gradient(#101727 0, #121827 55%, #0b1018 100%);
}

.map-stage {
  position: relative;
  min-height: 1120px;
  overflow: hidden;
  background: #17202b;
}

.map-sky {
  position: absolute;
  inset: 0 0 38%;
  background:
    radial-gradient(circle at 78% 18%, #f5dc8b 0 22px, transparent 24px),
    linear-gradient(#0f1524, #1a2636);
}

.map-buildings {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 48%;
  background:
    linear-gradient(90deg, transparent 0 7%, #39475b 7% 20%, transparent 20% 26%, #263445 26% 42%, transparent 42% 48%, #4b3e46 48% 64%, transparent 64% 72%, #334155 72% 90%, transparent 90%),
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(255,176,32,.35) 42px 48px, transparent 48px 86px);
  border-bottom: 5px solid var(--ink);
}

.map-road {
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: 0;
  height: 62%;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), transparent 34%),
    repeating-linear-gradient(90deg, transparent 0 48px, rgba(255,255,255,.08) 48px 58px, transparent 58px 110px),
    #303640;
  border-top: 5px solid var(--ink);
}

.map-lines {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.map-lines path {
  fill: none;
  stroke: rgba(255, 244, 223, .34);
  stroke-width: 1.2;
  stroke-dasharray: 3 2;
  filter: drop-shadow(0 2px 0 var(--ink));
}

.map-lines path.available {
  stroke: var(--gold);
  stroke-width: 1.8;
  animation: path-pulse .8s steps(2) infinite;
}

.map-lines path.chosen {
  stroke: var(--green);
  stroke-width: 1.6;
  stroke-dasharray: 0;
}

.map-lines path.skipped {
  stroke: rgba(150, 120, 100, .5);
  stroke-dasharray: 1 3;
}

@keyframes path-pulse {
  50% { filter: drop-shadow(0 0 4px rgba(255,176,32,.9)); }
}

.map-node {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -50%);
  width: 118px;
  min-height: 58px;
  border: 4px solid var(--ink);
  background: #786a5b;
  color: #fff;
  display: grid;
  gap: 3px;
  place-items: center;
  padding: 6px;
  text-align: center;
  font-weight: 900;
  cursor: not-allowed;
  box-shadow: 5px 5px 0 rgba(0,0,0,.3);
}

.map-node span {
  font-size: 12px;
  color: #ffdd9a;
}

.map-node b {
  font-size: 13px;
}

.map-node.visited {
  background: #4f8ba6;
}

.map-node.skipped {
  background: #5b5048;
  color: #b7a694;
  opacity: .58;
  cursor: not-allowed;
  filter: grayscale(.65);
}

.map-node.skipped::after {
  content: "错过";
  position: absolute;
  right: -12px;
  top: -14px;
  padding: 2px 6px;
  border: 3px solid var(--ink);
  background: #3b3029;
  color: #f6dfb7;
  font-size: 12px;
}

.map-node.current {
  background: var(--orange);
  color: #fff;
  animation: node-current .8s steps(2) infinite;
}

.map-node.reachable {
  background: var(--gold);
  color: var(--ink);
  cursor: pointer;
  animation: node-ready .8s steps(2) infinite;
}

.map-node.moving-target {
  background: #fff4df;
  color: var(--ink);
  animation: node-current .45s steps(2) infinite;
}

.map-node.reachable span {
  color: #6e3c11;
}

.map-node.reachable:hover {
  transform: translate(-50%, -58%);
}

@keyframes node-current {
  50% { filter: brightness(1.25); }
}

@keyframes node-ready {
  50% { box-shadow: 5px 5px 0 rgba(0,0,0,.3), 0 0 0 6px rgba(255,176,32,.25); }
}

.map-party {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, calc(-50% + 46px));
  width: 86px;
  height: 72px;
  pointer-events: none;
  transition: left .92s steps(9), top .92s steps(9);
}

.party-leader {
  position: absolute;
  left: 18px;
  bottom: 14px;
  width: 34px;
  height: 38px;
  border: 3px solid var(--ink);
  background: #d97706;
  animation: idle-bob 1s steps(2) infinite;
}

.map-party.moving .party-leader,
.map-party.moving .buddy {
  animation: map-walk .24s steps(2) infinite;
}

.map-party.moving .scarf {
  animation: scarf-flap .24s steps(2) infinite;
}

@keyframes map-walk {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes scarf-flap {
  50% { transform: translateX(-4px); }
}

.party-leader .ear {
  position: absolute;
  top: -15px;
  width: 13px;
  height: 16px;
  border: 3px solid var(--ink);
  background: #d97706;
}

.party-leader .ear.left { left: -3px; }
.party-leader .ear.right { right: -3px; }

.party-leader .face {
  position: absolute;
  left: 7px;
  top: 10px;
  width: 20px;
  height: 12px;
  background:
    linear-gradient(90deg, var(--ink) 0 4px, transparent 4px 16px, var(--ink) 16px 20px),
    linear-gradient(transparent 0 8px, #fff4df 8px 12px);
}

.party-leader .tail {
  position: absolute;
  right: -16px;
  bottom: 6px;
  width: 18px;
  height: 11px;
  border: 3px solid var(--ink);
  background: #d97706;
}

.party-leader .scarf {
  position: absolute;
  left: -5px;
  right: -5px;
  top: 22px;
  height: 8px;
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  background: var(--red);
}

.map-party .buddy {
  position: absolute;
  bottom: 12px;
  width: 25px;
  height: 18px;
  border: 3px solid var(--ink);
  animation: idle-bob 1.1s steps(2) infinite;
}

.map-party .doggo {
  left: 0;
  background: #6b4f3f;
  animation-delay: .2s;
}

.map-party .birdie {
  right: 0;
  bottom: 34px;
  width: 22px;
  height: 15px;
  background: #e5e7eb;
  animation-delay: .4s;
}

.map-info {
  position: absolute;
  z-index: 6;
  left: 18px;
  bottom: 18px;
  width: min(360px, calc(100% - 36px));
  padding: 16px;
}

.map-info h2,
.map-info p {
  margin: 0 0 8px;
}

.scene {
  position: relative;
  overflow: hidden;
  border: 4px solid var(--ink);
  background:
    linear-gradient(#111827 0 42%, #253041 42% 66%, #303640 66% 100%);
  box-shadow: inset 0 -92px 0 #3a414c, inset 0 -100px 0 var(--ink);
  isolation: isolate;
}

.scene::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 84px;
  height: 26px;
  background: repeating-linear-gradient(90deg, #222a35 0 24px, #151c27 24px 30px);
  border-top: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  z-index: 1;
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 2px, transparent 2px 5px);
  mix-blend-mode: screen;
  opacity: .55;
  z-index: 7;
}

.rain {
  position: absolute;
  inset: -40px 0 0;
  background: repeating-linear-gradient(115deg, transparent 0 20px, rgba(190, 212, 255, .28) 20px 23px, transparent 23px 46px);
  animation: rain-fall .9s linear infinite;
  opacity: .45;
  z-index: 2;
}

.rain.r2 {
  animation-duration: 1.35s;
  opacity: .22;
  transform: translateX(40px);
}

@keyframes rain-fall {
  to { transform: translate(-28px, 46px); }
}

.scene .awning,
.scene .booth,
.scene .trash,
.scene .crate,
.scene .guard,
.scene .cat,
.scene .dog,
.scene .bird,
.scene .rat,
.scene .trap {
  position: absolute;
  border: 4px solid var(--ink);
  z-index: 3;
}

.scene .awning {
  left: 8%;
  top: 26%;
  width: 210px;
  height: 42px;
  background: repeating-linear-gradient(90deg, #9e5650 0 28px, #c46b47 28px 56px);
  box-shadow: 0 12px 0 #4b2e29;
}

.scene .booth {
  right: 10%;
  bottom: 72px;
  width: 132px;
  height: 118px;
  background:
    linear-gradient(90deg, transparent 0 48px, #c9d3df 48px 80px, transparent 80px),
    #64748b;
}

.scene .trash {
  left: 32%;
  bottom: 64px;
  width: 70px;
  height: 58px;
  background:
    linear-gradient(#7f8b9a 0 12px, transparent 12px),
    #56616f;
}

.scene .crate {
  left: 47%;
  bottom: 62px;
  width: 76px;
  height: 44px;
  background: #7c5b35;
}

.scene .guard {
  right: 23%;
  bottom: 68px;
  width: 74px;
  height: 118px;
  background: transparent;
  border: 0;
  animation: guard-step 1.1s steps(2) infinite;
}

.scene .guard::before {
  display: none;
}

.guard-nameplate {
  position: absolute;
  right: 18%;
  bottom: 198px;
  z-index: 5;
  padding: 6px 10px;
  border: 4px solid var(--ink);
  background: var(--red);
  color: #fff;
  font-weight: 900;
  box-shadow: 4px 4px 0 rgba(0,0,0,.3);
}

.guard-cap,
.guard-face,
.guard-body,
.guard-arm,
.guard-leg,
.flashlight,
.badge {
  position: absolute;
  border: 4px solid var(--ink);
}

.guard-cap {
  left: 11px;
  top: 0;
  width: 52px;
  height: 22px;
  background: #ffb020;
}

.guard-cap::before {
  content: "";
  position: absolute;
  left: 9px;
  top: -10px;
  width: 30px;
  height: 14px;
  border: 4px solid var(--ink);
  background: #374151;
}

.guard-face {
  left: 16px;
  top: 22px;
  width: 42px;
  height: 32px;
  background:
    linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 28px, var(--ink) 28px 34px, transparent 34px),
    linear-gradient(transparent 0 21px, #8b3d2f 21px 26px, transparent 26px),
    #f0be96;
}

.guard-body {
  left: 10px;
  top: 54px;
  width: 54px;
  height: 45px;
  background:
    linear-gradient(90deg, transparent 0 20px, #dbeafe 20px 34px, transparent 34px),
    #334155;
}

.guard-arm {
  left: -14px;
  top: 62px;
  width: 30px;
  height: 16px;
  background: #334155;
}

.flashlight {
  left: -34px;
  top: 60px;
  width: 25px;
  height: 18px;
  background: var(--gold);
}

.badge {
  right: 7px;
  top: 64px;
  width: 12px;
  height: 12px;
  background: var(--gold);
}

.guard-leg {
  top: 96px;
  width: 18px;
  height: 24px;
  background: #1f2937;
}

.guard-leg.left {
  left: 14px;
}

.guard-leg.right {
  right: 14px;
}

.guard-light {
  position: absolute;
  right: calc(23% + 54px);
  bottom: 136px;
  width: 260px;
  height: 80px;
  z-index: 2;
  opacity: .38;
  clip-path: polygon(0 38%, 100% 0, 100% 100%);
  background: #ffed9a;
  animation: light-sweep 2.6s steps(6) infinite;
}

@keyframes light-sweep {
  0%, 100% { transform: translateX(0); opacity: .22; }
  50% { transform: translateX(-60px); opacity: .38; }
}

@keyframes guard-step {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-8px); }
}

.scene .cat {
  left: 18%;
  bottom: 64px;
  width: 38px;
  height: 24px;
  background: #d97706;
}

.scene .dog {
  left: 24%;
  bottom: 62px;
  width: 44px;
  height: 30px;
  background: #6b4f3f;
}

.scene .bird {
  left: 57%;
  top: 24%;
  width: 28px;
  height: 20px;
  background: #e5e7eb;
  animation: bird-flap .8s steps(2) infinite;
}

.scene .rat {
  left: 40%;
  bottom: 62px;
  width: 24px;
  height: 15px;
  background: #8b8f98;
  animation: rat-dart 1.8s steps(4) infinite;
}

.scene .trap {
  left: 55%;
  bottom: 60px;
  width: 44px;
  height: 30px;
  background: repeating-linear-gradient(90deg, #b8c0cc 0 5px, #334155 5px 10px);
}

.sprite {
  animation: idle-bob 1.25s steps(2) infinite;
}

.sprite span {
  position: absolute;
  right: -9px;
  top: -8px;
  width: 13px;
  height: 10px;
  border: 3px solid var(--ink);
  background: inherit;
}

@keyframes idle-bob {
  50% { transform: translateY(-4px); }
}

@keyframes bird-flap {
  50% { transform: translateY(-8px); }
}

@keyframes rat-dart {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(18px); }
}

.neon {
  position: absolute;
  left: 12%;
  top: calc(26% + 54px);
  z-index: 4;
  border: 4px solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  padding: 5px 9px;
  font-weight: 900;
  animation: blink-neon 1.6s steps(2) infinite;
}

@keyframes blink-neon {
  50% { filter: brightness(.55); }
}

.safe-zone {
  position: absolute;
  left: 16%;
  bottom: 102px;
  z-index: 4;
  border: 4px solid var(--ink);
  background: var(--green);
  color: #fff;
  padding: 7px 10px;
  font-weight: 900;
  animation: pulse-zone .9s steps(2) infinite;
}

@keyframes pulse-zone {
  50% { transform: scale(1.04); }
}

.scene-label {
  position: absolute;
  left: 14px;
  top: 14px;
  padding: 9px 12px;
  border: 4px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-weight: 900;
}

.intent-panel {
  position: absolute;
  right: 16px;
  top: 16px;
  width: min(330px, calc(100% - 32px));
  padding: 12px;
  z-index: 8;
}

.intent-title {
  font-weight: 900;
  margin-bottom: 6px;
}

.guide {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-color: var(--gold);
  animation: guide-pop .3s steps(3);
}

.guide strong {
  flex: none;
  padding: 5px 8px;
  background: var(--gold);
  border: 3px solid var(--ink);
}

@keyframes guide-pop {
  from { transform: translateY(-4px); }
}

.dice {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 4px solid var(--ink);
  background: #fffaf1;
  color: var(--ink);
  font-size: 30px;
  font-weight: 900;
  box-shadow: 4px 4px 0 rgba(0,0,0,.25);
}

.dice.await {
  animation: dice-wait .7s steps(2) infinite;
}

@keyframes dice-wait {
  50% { transform: rotate(5deg) translateY(-2px); background: var(--gold); }
}

.log-text {
  min-height: 24px;
  font-weight: 800;
}

.hand {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
  gap: 12px;
}

.card {
  min-height: 158px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  padding: 12px;
  border: 4px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .25);
  position: relative;
  overflow: hidden;
  transition: transform .1s steps(2), opacity .1s steps(2), filter .1s steps(2);
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 8px;
  background: var(--blue);
}

.card.type-car-bottom::before,
.card.type-cage::before { background: #d97706; }
.card.type-box::before,
.card.type-power::before { background: #64748b; }
.card.type-whistle::before { background: #e5e7eb; }
.card.type-awning::before { background: var(--green); }
.card.type-tie::before { background: var(--red); }
.card.type-bark::before { background: #6b4f3f; }
.card.type-phone::before { background: var(--violet); }
.card.type-all::before { background: var(--orange); }
}

.card.playable {
  cursor: pointer;
  transform: translateY(-2px);
  outline: 3px solid var(--gold);
  animation: card-ready .9s steps(2) infinite;
}

.card.playable:hover {
  transform: translate(-3px, -8px);
  filter: brightness(1.05);
}

.card.unplayable {
  opacity: .48;
}

@keyframes card-ready {
  50% { box-shadow: 5px 5px 0 rgba(0,0,0,.25), 0 0 0 5px rgba(255,176,32,.2); }
}

.card-header {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: start;
}

.cost {
  flex: none;
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  background: var(--orange);
  color: white;
  font-weight: 900;
}

.tag {
  display: inline-block;
  border: 2px solid var(--ink);
  padding: 2px 6px;
  background: var(--paper-2);
  font-size: 12px;
  font-weight: 900;
}

.card h3 {
  margin: 0;
  font-size: 18px;
}

.card p {
  margin: 0;
  color: #493629;
  font-size: 14px;
  line-height: 1.55;
}

.result-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 13, .78);
  z-index: 10;
}

.result-card {
  width: min(520px, calc(100vw - 40px));
  padding: 28px;
  text-align: center;
}

.battle-log {
  align-items: flex-start;
}

.battle-log details {
  width: 100%;
}

.battle-log summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--orange);
}

.battle-log ol {
  margin: 8px 0 0;
  padding-left: 22px;
}

.fx-burst {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 9;
  transform: translate(-50%, -50%);
  border: 5px solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  padding: 10px 16px;
  font-size: clamp(24px, 5vw, 54px);
  font-weight: 900;
  box-shadow: 6px 6px 0 rgba(0,0,0,.35);
  animation: burst .65s steps(5) both;
}

.fx-burst.enemy-hit,
.fx-burst.player-hit {
  background: var(--red);
  color: #fff;
}

.fx-burst.block {
  background: var(--green);
  color: #fff;
}

.fx-burst.play {
  font-size: clamp(18px, 3vw, 34px);
  background: var(--paper);
}

@keyframes burst {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(.75); }
  20% { opacity: 1; transform: translate(-50%, -52%) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(1); }
}

.fx-enemy-hit .guard,
.fx-play .cat,
.fx-play .dog,
.fx-play .bird,
.fx-play .rat {
  animation: attack-hop .35s steps(3);
}

.fx-player-hit .cat,
.fx-player-hit .dog,
.fx-player-hit .bird,
.fx-player-hit .rat {
  animation: hit-shake .35s steps(4);
}

.fx-enemy .guard {
  animation: enemy-lunge .35s steps(3);
}

@keyframes attack-hop {
  50% { transform: translateX(34px) translateY(-10px); }
}

@keyframes enemy-lunge {
  50% { transform: translateX(-36px); }
}

@keyframes hit-shake {
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-6px); }
}

@media (max-width: 760px) {
  .screen {
    padding: 12px;
  }

  .battle-screen {
    grid-template-rows: auto 280px auto auto 1fr;
  }

  .intent-panel {
    top: auto;
    bottom: 12px;
  }

  .hand {
    grid-template-columns: 1fr;
  }

  .guide {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
