:root {
  color-scheme: dark;
  --bg: #101410;
  --panel: #1b211b;
  --line: #3a4538;
  --text: #f3ead7;
  --muted: #b9ad96;
  --accent: #d9b55d;
  --danger: #d96d5d;
  --tile: 38px;
  --asset-ground: url(/static/images/battlefield-styles/low-poly/ground.png);
  --asset-stone: url(/static/images/battlefield-styles/low-poly/stone.png);
  --asset-dirt: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%3E%3Cpath%20fill%3D%22%232a1a12%22%20d%3D%22M5%2083%2010%2025%2023%207%2049%203%2075%209%2092%2028%2096%2081%2082%2095%2020%2096Z%22%2F%3E%3Cpath%20fill%3D%22%236f4728%22%20d%3D%22M10%2078%2014%2031%2029%2018%2048%2012%2070%2018%2087%2034%2091%2077%2078%2088%2022%2089Z%22%2F%3E%3Cpath%20fill%3D%22%238b5a31%22%20d%3D%22M14%2031%2029%2018%2038%2035%2023%2045Z%22%2F%3E%3Cpath%20fill%3D%22%235d3922%22%20d%3D%22M29%2018%2048%2012%2055%2031%2038%2035Z%22%2F%3E%3Cpath%20fill%3D%22%239f6b39%22%20d%3D%22M48%2012%2070%2018%2062%2035%2055%2031Z%22%2F%3E%3Cpath%20fill%3D%22%23704323%22%20d%3D%22M70%2018%2087%2034%2074%2045%2062%2035Z%22%2F%3E%3Cpath%20fill%3D%22%237f512d%22%20d%3D%22M23%2045%2038%2035%2042%2055%2020%2061Z%22%2F%3E%3Cpath%20fill%3D%22%23a5703e%22%20d%3D%22M38%2035%2055%2031%2052%2055%2042%2055Z%22%2F%3E%3Cpath%20fill%3D%22%238e5d33%22%20d%3D%22M55%2031%2062%2035%2068%2057%2052%2055Z%22%2F%3E%3Cpath%20fill%3D%22%235b351f%22%20d%3D%22M62%2035%2074%2045%2080%2063%2068%2057Z%22%2F%3E%3Cpath%20fill%3D%22%236f4528%22%20d%3D%22M20%2061%2042%2055%2039%2078%2016%2076Z%22%2F%3E%3Cpath%20fill%3D%22%238b5a32%22%20d%3D%22M42%2055%2052%2055%2055%2080%2039%2078Z%22%2F%3E%3Cpath%20fill%3D%22%23744727%22%20d%3D%22M52%2055%2068%2057%2074%2077%2055%2080Z%22%2F%3E%3Cpath%20fill%3D%22%234b2d1d%22%20d%3D%22M68%2057%2080%2063%2086%2077%2074%2077Z%22%2F%3E%3Cpath%20fill%3D%22%23c0874c%22%20opacity%3D%22.52%22%20d%3D%22M25%2026%2047%2016%2039%2031Z%22%2F%3E%3Cpath%20fill%3D%22%23b67b43%22%20opacity%3D%22.38%22%20d%3D%22M56%2017%2069%2021%2061%2031Z%22%2F%3E%3Cpath%20fill%3D%22%23351f16%22%20opacity%3D%22.45%22%20d%3D%22M15%2076%2039%2078%2055%2080%2085%2076%2078%2088%2022%2089Z%22%2F%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%231d120d%22%20stroke-width%3D%223%22%20stroke-linejoin%3D%22round%22%20d%3D%22M5%2083%2010%2025%2023%207%2049%203%2075%209%2092%2028%2096%2081%2082%2095%2020%2096Z%22%2F%3E%3C%2Fsvg%3E");
  --asset-grass: url(/static/images/battlefield-styles/low-poly/grass.svg);
  --asset-star: url(/static/images/battlefield-styles/low-poly/star.png);
  --asset-star-small: url(/static/images/battlefield-styles/low-poly/star_small.png);
  --asset-bullet-1: url(/static/images/battlefield-styles/low-poly/bullet1.svg);
  --asset-bullet-2: url(/static/images/battlefield-styles/low-poly/bullet2.svg);
  --asset-bullet-tail-display: block;
}

:root[data-asset-style="original"] {
  --asset-ground: url(/static/images/battlefield-styles/original/ground.png);
  --asset-stone: url(/static/images/battlefield-styles/original/stone.png);
  --asset-grass: url(/static/images/battlefield-styles/original/grass.png);
  --asset-star: url(/static/images/battlefield-styles/original/star.png);
  --asset-star-small: url(/static/images/battlefield-styles/original/star_small.png);
  --asset-bullet-1: url(/static/images/battlefield-styles/original/bullet1.png);
  --asset-bullet-2: url(/static/images/battlefield-styles/original/bullet2.png);
  --asset-bullet-tail-display: none;
}

:root[data-asset-style="realistic"] {
  --asset-ground: url(/static/images/battlefield-styles/realistic/ground.png);
  --asset-stone: url(/static/images/battlefield-styles/realistic/stone.png);
  --asset-grass: url(/static/images/battlefield-styles/realistic/grass.svg);
  --asset-star: url(/static/images/battlefield-styles/realistic/star.png);
  --asset-star-small: url(/static/images/battlefield-styles/realistic/star_small.png);
  --asset-bullet-1: url(/static/images/battlefield-styles/realistic/bullet1.svg);
  --asset-bullet-2: url(/static/images/battlefield-styles/realistic/bullet2.svg);
  --asset-bullet-tail-display: block;
}

:root[data-asset-style="low-poly"] {
  --asset-ground: url(/static/images/battlefield-styles/low-poly/ground.png);
  --asset-stone: url(/static/images/battlefield-styles/low-poly/stone.png);
  --asset-grass: url(/static/images/battlefield-styles/low-poly/grass.svg);
  --asset-star: url(/static/images/battlefield-styles/low-poly/star.png);
  --asset-star-small: url(/static/images/battlefield-styles/low-poly/star_small.png);
  --asset-bullet-1: url(/static/images/battlefield-styles/low-poly/bullet1.svg);
  --asset-bullet-2: url(/static/images/battlefield-styles/low-poly/bullet2.svg);
  --asset-bullet-tail-display: block;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
input,
textarea,
.home-link-button {
  border: 1px solid var(--line);
  background: #151a15;
  color: var(--text);
}

button {
  min-height: 36px;
  padding: 0 12px;
  cursor: pointer;
}

.home-link-button {
  display: inline-grid;
  min-height: 36px;
  align-items: center;
  padding: 0 12px;
  text-decoration: none;
}

button:hover,
button:focus-visible,
.home-link-button:hover,
.home-link-button:focus-visible {
  border-color: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary-button,
.tool-button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #201806;
  font-weight: 700;
}

.map-editor-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.map-editor-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 20, 16, 0.96);
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
}

.toolbar-row-global {
  align-items: center;
}

.toolbar-row-tools {
  padding-top: 10px;
  border-top: 1px solid rgba(58, 69, 56, 0.72);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.brand-lockup img {
  width: 38px;
  height: 38px;
}

.brand-lockup strong,
.brand-lockup span {
  display: block;
}

.brand-lockup span,
label,
.status-line,
.replay-head span {
  color: var(--muted);
  font-size: 13px;
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

label {
  display: grid;
  gap: 4px;
}

input,
select,
textarea {
  min-height: 36px;
  padding: 0 10px;
}

textarea {
  padding: 10px;
  resize: vertical;
}

input[type="number"] {
  width: 76px;
}

.editor-layout {
  padding: 16px;
}

.canvas-panel {
  min-width: 0;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(var(--map-width), var(--tile));
  grid-auto-rows: var(--tile);
  width: max-content;
  border: 2px solid #090b09;
  background: #e7dfc2 var(--asset-ground);
  background-size: var(--tile) var(--tile);
  user-select: none;
  touch-action: none;
}

.map-cell {
  position: relative;
  width: var(--tile);
  height: var(--tile);
  border: 1px solid rgba(8, 11, 8, 0.28);
  background: transparent;
  background-size: 100% 100%;
}

.map-cell.is-stone {
  background-image: var(--asset-stone);
}

.map-cell.is-dirt {
  background-image: var(--asset-dirt);
}

.map-cell.is-grass {
  background-image: var(--asset-grass);
}

.map-cell.is-grass.has-p1,
.map-cell.is-grass.has-p2,
.map-cell.is-grass.has-p3,
.map-cell.is-grass.has-p4 {
  background-image: none;
}

.map-cell.is-grass.has-p1::before,
.map-cell.is-grass.has-p2::before,
.map-cell.is-grass.has-p3::before,
.map-cell.is-grass.has-p4::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: var(--asset-grass);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: 0.46;
  pointer-events: none;
}

.map-cell.has-p1::after,
.map-cell.has-p2::after,
.map-cell.has-p3::after,
.map-cell.has-p4::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: var(--tank-bg);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  transform: rotate(var(--tank-rotation));
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35));
}

.map-cell.has-p1,
.map-cell.has-p2,
.map-cell.has-p3,
.map-cell.has-p4 {
  cursor: grab;
}

.map-cell.has-p1:active,
.map-cell.has-p2:active,
.map-cell.has-p3:active,
.map-cell.has-p4:active {
  cursor: grabbing;
}

.map-cell .map-tank-badge {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 3;
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1px solid rgba(12, 14, 12, 0.9);
  border-radius: 999px;
  background: rgba(245, 231, 183, 0.94);
  color: #151812;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.38);
}

.map-cell.is-drop-target {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.map-cell.is-drop-blocked {
  outline: 3px solid var(--danger);
  outline-offset: -3px;
}

.status-line {
  margin-top: 12px;
  line-height: 1.45;
}

.status-line.is-error {
  color: var(--danger);
}

.replay-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 7, 4, 0.78);
}

.submit-modal {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
}

.submit-modal[hidden] {
  display: none;
}

.submit-dialog {
  width: min(560px, 100%);
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  background: #141914;
  padding: 18px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.5);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.replay-modal[hidden] {
  display: none;
}

.replay-dialog {
  width: min(1180px, 100%);
  max-height: min(860px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) 150px;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #151b15;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.45);
}

.replay-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.replay-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.map-editor-playground-shell {
  min-height: 220px;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  background: #0e130e;
}

.replay-mount {
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.replay-logs {
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  background: #121712;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.playground {
  position: relative;
  background:
    repeating-linear-gradient(0deg, rgba(21, 18, 15, 0.08) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, rgba(255, 250, 240, 0.12), rgba(118, 32, 25, 0.08)),
    #e7dfc2 var(--asset-ground);
  background-size: auto, auto, 50px 50px;
  transform-origin: center top;
  overflow: hidden;
  border: 3px solid #231d16;
  box-shadow: inset 0 0 0 5px rgba(255, 250, 240, 0.42);
  image-rendering: pixelated;
}

.playground .stone,
.playground .grass,
.playground .dirt,
.playground .star,
.playground .player,
.playground .bullet,
.playground .crash {
  position: absolute;
  width: 50px;
  height: 50px;
  background-size: 100%;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}

.playground .stone {
  z-index: 1;
  background-image: var(--asset-stone);
}

.playground .dirt {
  z-index: 1;
  background-image: var(--asset-dirt);
}

.playground .grass {
  z-index: 3;
  background-image: var(--asset-grass);
  opacity: 1;
  transition: opacity 160ms ease;
}

.playground .grass.has-tank {
  opacity: 0.46;
}

.playground .star {
  z-index: 4;
  background-image: var(--asset-star);
}

.playground .player {
  z-index: 2;
  transition: transform linear;
}

.playground .player .skill-aura {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.playground .bullet {
  z-index: 6;
  transition: transform linear;
  filter: drop-shadow(0 0 8px rgba(255, 214, 92, 0.95));
  opacity: 0.98;
}

.playground .bullet-sprite {
  position: relative;
  width: 100%;
  height: 100%;
  background-image: var(--asset-bullet-1);
  background-size: 100%;
  background-repeat: no-repeat;
  transform-origin: 50% 50%;
}

.playground .bullet.bullet2 {
  filter: drop-shadow(0 0 8px rgba(123, 203, 255, 0.95));
}

.playground .bullet.bullet2 .bullet-sprite {
  background-image: var(--asset-bullet-2);
}

.playground .bullet-sprite::after {
  content: "";
  display: var(--asset-bullet-tail-display);
  position: absolute;
  left: 50%;
  top: 58%;
  width: 18%;
  height: 30%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(circle at 50% 16%, rgba(255, 250, 180, 0.95), rgba(255, 179, 43, 0.58) 38%, rgba(255, 112, 20, 0) 72%);
  filter: blur(0.4px);
  animation: bullet-tail 180ms steps(2, end) infinite;
  pointer-events: none;
}

.playground .bullet.bullet2 .bullet-sprite::after {
  background: radial-gradient(circle at 50% 16%, rgba(220, 255, 255, 0.95), rgba(61, 220, 255, 0.58) 38%, rgba(18, 141, 219, 0) 72%);
}

.playground .bullet-sprite {
  image-rendering: auto;
}

.playground .crash {
  z-index: 4;
  background-image: url(/static/images/crash1.png);
  opacity: 0;
}

.playground .crash.play {
  animation: crash 1s linear forwards;
}

.playground .crashed {
  animation: crashed 1s linear forwards;
}

.playground .skill-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
}

.playground .skill-burst {
  position: absolute;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  margin-top: -20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 700;
  animation: skill-burst 900ms ease-out forwards;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.16);
}

.playground .skill-layer .speech-bubble {
  position: absolute;
  max-width: 210px;
  min-width: 58px;
  min-height: 24px;
  padding: 5px 11px;
  border: 2px solid rgba(21, 18, 15, 0.54);
  border-radius: 6px;
  background: rgba(255, 250, 240, 0.82);
  color: #241e19;
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.16;
  text-align: center;
  overflow-wrap: anywhere;
  white-space: normal;
  box-shadow: 3px 3px 0 rgba(21, 18, 15, 0.18), 0 8px 20px rgba(21, 18, 15, 0.1);
  backdrop-filter: blur(1.5px);
  transform: translate(-50%, -100%);
  transform-origin: 50% 100%;
  transition-property: left, top;
  transition-timing-function: linear;
  animation: speech-bubble-pop 1800ms ease-out forwards;
  pointer-events: none;
  z-index: 8;
}

.playground .skill-layer .speech-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 12px;
  height: 12px;
  border-right: 2px solid rgba(21, 18, 15, 0.54);
  border-bottom: 2px solid rgba(21, 18, 15, 0.54);
  background: rgba(255, 250, 240, 0.82);
  transform: translateX(-50%) rotate(45deg);
}

.playground .skill-layer .speech-bubble-player1 {
  border-color: rgba(139, 39, 31, 0.7);
  color: #772018;
}

.playground .skill-layer .speech-bubble-player1::after {
  border-color: rgba(139, 39, 31, 0.7);
}

.playground .skill-layer .speech-bubble-player2 {
  border-color: rgba(39, 80, 108, 0.7);
  color: #214f69;
}

.playground .skill-layer .speech-bubble-player2::after {
  border-color: rgba(39, 80, 108, 0.7);
}

.playground .skill-burst-shield {
  background: rgba(116, 217, 255, 0.22);
  color: #bff3ff;
}

.playground .skill-burst-freeze {
  background: rgba(177, 235, 255, 0.22);
  color: #d6f6ff;
}

.playground .skill-burst-stun {
  background: rgba(255, 205, 87, 0.2);
  color: #ffe6a3;
}

.playground .skill-burst-overload {
  background: rgba(255, 126, 126, 0.2);
  color: #ffd3d3;
}

.playground .skill-burst-cloak {
  background: rgba(205, 190, 255, 0.22);
  color: #f0eaff;
}

.playground .skill-burst-poison {
  width: 62px;
  height: 62px;
  margin-left: -31px;
  margin-top: -31px;
  background: rgba(181, 108, 255, 0.24);
  color: #f0ddff;
  font-size: 31px;
  box-shadow: 0 0 0 2px rgba(181, 108, 255, 0.48), 0 0 34px rgba(181, 108, 255, 0.42);
  animation: poison-skill-burst var(--skill-burst-duration, 2400ms) ease-in-out forwards;
}

.playground .skill-burst-teleport {
  background: rgba(255, 154, 240, 0.22);
  color: #ffe3fb;
}

.playground .skill-burst-boost {
  background: rgba(255, 228, 110, 0.24);
  color: #fff1b4;
}

.playground .player.is-skill-shield .skill-aura,
.playground .player.is-skill-freeze .skill-aura,
.playground .player.is-skill-stun .skill-aura,
.playground .player.is-skill-overload .skill-aura,
.playground .player.is-skill-cloak .skill-aura,
.playground .player.is-skill-poison .skill-aura,
.playground .player.is-skill-boost .skill-aura {
  opacity: 1;
}

.playground .player.is-skill-shield .skill-aura {
  box-shadow: 0 0 0 2px rgba(116, 217, 255, 0.7), 0 0 24px rgba(116, 217, 255, 0.52);
  animation: pulse-skill 1.1s ease-in-out infinite;
}

.playground .player.is-skill-freeze .skill-aura {
  box-shadow: 0 0 0 2px rgba(177, 235, 255, 0.78), 0 0 26px rgba(177, 235, 255, 0.48);
  animation: pulse-skill 1.2s ease-in-out infinite;
}

.playground .player.is-skill-stun .skill-aura {
  box-shadow: 0 0 0 2px rgba(255, 205, 87, 0.78), 0 0 26px rgba(255, 205, 87, 0.48);
  animation: pulse-skill 0.8s ease-in-out infinite;
}

.playground .player.is-skill-overload .skill-aura {
  box-shadow: 0 0 0 2px rgba(255, 126, 126, 0.78), 0 0 26px rgba(255, 126, 126, 0.48);
  animation: pulse-skill 0.7s ease-in-out infinite;
}

.playground .player.is-skill-cloak {
  opacity: 0.55;
  filter: saturate(0.8) brightness(1.08);
}

.playground .player.is-skill-cloak .skill-aura {
  box-shadow: 0 0 0 2px rgba(205, 190, 255, 0.62), 0 0 20px rgba(205, 190, 255, 0.32);
  animation: pulse-skill 1.5s ease-in-out infinite;
}

.playground .player.is-skill-poison .skill-aura {
  box-shadow: 0 0 0 2px rgba(181, 108, 255, 0.76), 0 0 28px rgba(181, 108, 255, 0.48);
  animation: pulse-skill 1s ease-in-out infinite;
}

.playground .player.is-skill-boost .skill-aura {
  box-shadow: 0 0 0 2px rgba(255, 228, 110, 0.75), 0 0 24px rgba(255, 228, 110, 0.46);
  animation: pulse-skill 0.55s ease-in-out infinite;
}

.playground .status {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 50px;
  padding-top: 10px;
  background: #f1f1f1;
}

.playground .player-bar {
  height: 40px;
}

.playground .player1-bar {
  float: left;
  background-position: left center;
  background-repeat: no-repeat;
  background-size: 40px 40px;
  padding-left: 50px;
}

.playground .player2-bar {
  float: right;
  background-position: right center;
  background-repeat: no-repeat;
  background-size: 40px 40px;
  padding-right: 50px;
}

.playground .player-bar .star-count {
  color: #ebb12b;
  width: 40px;
  line-height: 38px;
  height: 40px;
  text-align: center;
  background: var(--asset-star-small) left center no-repeat;
  background-size: 40px 40px;
}

.playground .player1-bar .star-count,
.playground .player1-bar .name {
  float: left;
}

.playground .player2-bar .star-count,
.playground .player2-bar .name {
  float: right;
}

.playground .player1-bar .name {
  margin-left: 10px;
  line-height: 45px;
  color: #222;
}

.playground .player2-bar .name {
  margin-right: 10px;
  line-height: 45px;
  color: #222;
}

.playground .frames {
  position: absolute;
  left: 0;
  top: 10px;
  width: 100%;
  height: 40px;
  line-height: 40px;
  text-align: center;
  font-weight: 700;
  color: #222;
}

@keyframes crash {
  0% { opacity: 1; transform: scale(0.6); }
  70% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0; transform: scale(1.25); }
}

@keyframes crashed {
  100% { opacity: 0.35; filter: grayscale(1); }
}

@keyframes bullet-tail {
  0% { opacity: 0.45; height: 24%; }
  50% { opacity: 0.95; height: 36%; }
  100% { opacity: 0.55; height: 28%; }
}

@keyframes pulse-skill {
  0%, 100% { transform: scale(0.94); opacity: 0.72; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes skill-burst {
  0% { transform: scale(0.45); opacity: 0; }
  25% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes poison-skill-burst {
  0% { transform: scale(0.55); opacity: 0; }
  12% { transform: scale(1); opacity: 1; }
  78% { transform: scale(1.08); opacity: 0.95; }
  100% { transform: scale(1.28); opacity: 0; }
}

@keyframes speech-bubble-pop {
  0% { opacity: 0; transform: translate(-50%, calc(-100% + 8px)) scale(0.96); }
  12% { opacity: 0.92; transform: translate(-50%, -100%) scale(1); }
  68% { opacity: 0.74; transform: translate(-50%, calc(-100% - 4px)) scale(1); }
  100% { opacity: 0; transform: translate(-50%, calc(-100% - 16px)) scale(0.98); }
}

@media (max-width: 780px) {
  .replay-dialog {
    grid-template-rows: auto minmax(260px, 1fr) 140px;
  }

  .map-editor-toolbar {
    align-items: stretch;
  }
}
