:root {
  --fire: #f05b36;
  --water: #39b9e8;
  --earth: #83ad42;
  --air: #ad99e5;
  --gold: #ffd659;
  --wood: #674122;
  --wood-dark: #3d2617;
  --cream: #fff0b5;
  --blue: #3b9be2;
  --red: #e34746;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #183c29; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  background: radial-gradient(circle at 50% 10%, #6e9b48, #173b29 68%);
  overflow: hidden;
}
button { font: inherit; }
button:focus-visible, .grid-cell:focus-visible { outline: 4px solid #fff38a; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.game-shell {
  position: relative;
  width: min(100%, 560px);
  height: 100vh;
  height: 100dvh;
  min-height: 620px;
  margin: 0 auto;
  background: #75bf36;
  box-shadow: 0 24px 80px rgba(3, 18, 11, .5);
  overflow: hidden;
}

.battlefield {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(23, 71, 28, .11), transparent 22%, transparent 78%, rgba(30, 63, 22, .18)),
    url("assets/battlefield.webp");
  background-size: auto 100%;
  background-position: center 50%;
  isolation: isolate;
  transition: background-size 1.1s ease, background-position 1.1s ease;
}

.sun-wash {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at 72% 17%, rgba(255, 252, 195, .25), transparent 24%),
    linear-gradient(110deg, transparent 43%, rgba(255, 255, 218, .09) 50%, transparent 57%);
  pointer-events: none;
}

.topbar {
  position: absolute;
  z-index: 40;
  top: max(7px, env(safe-area-inset-top));
  right: 8px;
  left: 8px;
  display: grid;
  grid-template-columns: 47px 1fr auto;
  align-items: center;
  gap: 8px;
  filter: drop-shadow(0 4px 3px rgba(39, 54, 21, .34));
}

.stage-badge {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #fff5c6;
  font-size: 19px;
  font-weight: 900;
  text-shadow: 0 2px 0 #4e2b17;
  border: 3px solid #ffe9a1;
  border-radius: 16px 8px 17px 8px;
  background: linear-gradient(145deg, #8b5b2f, #58341e);
  box-shadow: inset 0 2px rgba(255,255,255,.25), 0 3px 0 #3d2718;
  transform: rotate(-3deg);
}

.stage-badge::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255,232,158,.38);
  border-radius: 11px 5px 12px 5px;
}

.stage-badge > span { z-index: 1; }
.streak-badge {
  position: absolute;
  z-index: 3;
  right: -7px;
  bottom: -7px;
  min-width: 27px;
  padding: 3px 5px 2px;
  color: #5a2819;
  font-family: Menlo, monospace;
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-shadow: none;
  border: 2px solid #fff1a5;
  border-radius: 8px 4px 8px 4px;
  background: linear-gradient(#ffdd68, #f4a936);
  box-shadow: 0 2px 0 #8c4a22, 0 0 10px rgba(255, 213, 82, .45);
  transform: rotate(5deg);
}
.stage-badge.boss-wave {
  border-color: #fff078;
  background: linear-gradient(145deg, #8e3d5d, #4b2347);
  box-shadow: inset 0 2px rgba(255,255,255,.25), 0 3px 0 #321a31, 0 0 16px rgba(255, 109, 185, .52);
  animation: warden-stage 1.25s ease-in-out infinite alternate;
}

.squad-meter {
  display: grid;
  grid-template-columns: 24px 1fr 21px;
  height: 33px;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 4px 5px;
  color: white;
  border: 2px solid #ffe8a5;
  border-radius: 18px 8px 18px 8px;
  background: linear-gradient(#704825, #4c2e1c);
  box-shadow: inset 0 2px rgba(255,255,255,.16), 0 3px 0 rgba(55,32,18,.72);
}

.heart-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #ff6b64;
  font-size: 17px;
  text-shadow: 0 2px #7e211d;
}
.heart-icon.hit { animation: heart-hit .32s ease; }

.meter-rail {
  height: 9px;
  padding: 2px;
  border: 1px solid #322116;
  border-radius: 99px;
  background: #241a13;
  overflow: hidden;
}
.meter-rail span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(#88ef75, #3cb547);
  box-shadow: inset 0 2px rgba(255,255,255,.35);
  transform-origin: left center;
  transition: transform .2s ease;
}
.squad-meter small {
  color: #fff0bd;
  font-family: Menlo, monospace;
  font-size: 8px;
  text-align: right;
}

.gold-pill {
  display: flex;
  height: 33px;
  align-items: center;
  gap: 6px;
  padding: 0 10px 0 6px;
  color: #fff7ce;
  border: 2px solid #ffe8a5;
  border-radius: 18px 7px 18px 7px;
  background: linear-gradient(#704825, #4c2e1c);
  box-shadow: inset 0 2px rgba(255,255,255,.16), 0 3px 0 rgba(55,32,18,.72);
}
.gold-pill strong { font-size: 14px; text-shadow: 0 1px #432615; }

.sound-button {
  position: absolute;
  z-index: 42;
  top: max(49px, calc(env(safe-area-inset-top) + 49px));
  right: 10px;
  display: grid;
  width: 31px;
  height: 29px;
  place-items: center;
  padding: 0;
  color: #fff5c8;
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 900;
  border: 2px solid #ffe8a5;
  border-radius: 10px 5px 10px 5px;
  background: linear-gradient(#704825, #4c2e1c);
  box-shadow: inset 0 1px rgba(255,255,255,.17), 0 3px 0 rgba(55,32,18,.72);
  cursor: pointer;
  transform: rotate(2deg);
}
.sound-button.muted { color: #d8cdb0; filter: saturate(.5); }
.sound-button:not(.muted):hover { filter: brightness(1.1); transform: translateY(-1px) rotate(2deg); }

.coin, .mini-coin {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid #c47a18;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff6ae 0 8%, #ffd658 12% 56%, #e49d29 59%);
  box-shadow: inset 0 0 0 2px #ffe996, 0 2px 2px rgba(0,0,0,.24);
}
.mini-coin { width: 12px; height: 12px; border-width: 2px; }

.enemy-row {
  position: absolute;
  z-index: 12;
  top: 12%;
  right: 11%;
  left: 11%;
  display: flex;
  height: 185px;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(4px, 2.5vw, 17px);
  transition: opacity .18s ease;
}

.setup-enemy {
  position: relative;
  width: 105px;
  min-width: 0;
  padding-top: 103px;
  text-align: center;
  filter: drop-shadow(0 10px 5px rgba(35, 54, 18, .28));
  animation: setup-float 2.1s ease-in-out infinite alternate;
}
.setup-enemy:nth-child(2) { margin-top: 25px; animation-delay: -.7s; }
.setup-enemy:nth-child(3) { margin-top: 3px; animation-delay: -1.2s; }
.setup-enemy:nth-child(4) { margin-top: 27px; animation-delay: -.3s; }
.setup-enemy.boss {
  z-index: 3;
  transform: scale(1.18);
  filter: drop-shadow(0 0 13px rgba(255, 83, 167, .68)) drop-shadow(0 12px 6px rgba(35, 54, 18, .3));
}
.setup-enemy.boss .monster-art { width: 116px; height: 116px; }
.boss-badge, .combat-boss-badge {
  position: absolute;
  z-index: 8;
  top: -3px;
  left: 50%;
  padding: 3px 7px;
  color: #fff7bd;
  font-family: Menlo, monospace;
  font-size: 6px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .08em;
  border: 2px solid #ffe595;
  border-radius: 7px 3px 7px 3px;
  background: linear-gradient(#a83f75, #642c64);
  box-shadow: 0 2px 0 #462044, 0 0 10px rgba(255, 99, 191, .5);
  transform: translateX(-50%);
  text-transform: uppercase;
  white-space: nowrap;
}
.setup-enemy .monster-art {
  position: absolute;
  top: 0;
  left: 50%;
  width: 105px;
  height: 105px;
  object-fit: contain;
  transform: translateX(-50%) scaleX(-1);
  filter: drop-shadow(0 0 5px rgba(255, 81, 58, .72));
}
.setup-level {
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 8px;
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  color: white;
  font-family: Menlo, monospace;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
  text-shadow: 0 1px #64231e;
  border: 2px solid #fff0b0;
  border-radius: 7px 4px 7px 4px;
  background: #df4a42;
  box-shadow: 0 2px 0 rgba(79,35,21,.4);
}
.enemy-health {
  display: block;
  width: 72px;
  height: 7px;
  margin: 3px auto 0;
  border: 2px solid rgba(64, 38, 19, .88);
  border-radius: 99px;
  background: #38261a;
  overflow: hidden;
}
.enemy-health span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(#ffbd52, #e9483d);
}

.deployment-zone {
  position: absolute;
  z-index: 2;
  top: 35%;
  right: 8%;
  bottom: 132px;
  left: 8%;
  border: 2px solid rgba(224, 246, 255, .72);
  border-radius: 18% 15% 17% 14%;
  background-color: rgba(62, 151, 219, .4);
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.16) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.16) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,.16) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.16) 75%);
  background-size: 44px 44px;
  background-position: 0 0, 0 22px, 22px -22px, -22px 0;
  box-shadow: inset 0 0 30px rgba(66, 138, 197, .16), 0 6px 18px rgba(37, 85, 37, .12);
  transform: perspective(500px) rotateX(4deg);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.formation-band {
  position: absolute;
  right: 7px;
  display: flex;
  min-width: 98px;
  align-items: baseline;
  justify-content: space-between;
  gap: 7px;
  padding: 4px 6px 3px;
  color: rgba(255, 255, 225, .9);
  font-family: Menlo, monospace;
  line-height: 1;
  border: 1px solid rgba(236, 249, 255, .5);
  border-radius: 7px 3px 7px 3px;
  background: rgba(28, 83, 104, .34);
  box-shadow: 0 2px 5px rgba(30, 69, 41, .12);
  text-shadow: 0 1px rgba(30, 64, 44, .55);
  text-transform: uppercase;
}
.formation-band b { font-size: 6px; letter-spacing: .05em; }
.formation-band small { font-size: 5px; opacity: .78; }
.front-band { top: 7px; }
.rear-band { top: calc(50% + 7px); background: rgba(98, 75, 140, .3); }
.merge-grid {
  position: absolute;
  z-index: 10;
  top: 36%;
  right: 10%;
  bottom: 139px;
  left: 10%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 0 4px;
  transition: opacity .18s ease;
}

.grid-cell {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform .16s ease;
}
.grid-cell::before {
  content: "";
  position: absolute;
  right: 12%;
  bottom: 12%;
  left: 12%;
  height: 13%;
  border-radius: 50%;
  background: rgba(40, 75, 26, .22);
  filter: blur(3px);
}
.grid-cell[data-formation="front"]::before { background: rgba(31, 91, 132, .27); }
.grid-cell[data-formation="rear"]::before { background: rgba(83, 63, 120, .23); }
.grid-cell::after {
  content: "";
  position: absolute;
  inset: 9%;
  border: 3px dashed rgba(236, 249, 255, .82);
  border-radius: 50%;
  opacity: 0;
  transform: scale(.78);
  transition: opacity .16s ease, transform .16s ease;
}
.grid-cell.selected { transform: translateY(-7px); }
.grid-cell.selected::after, .grid-cell.merge-ready::after, .grid-cell.drag-over::after { opacity: 1; transform: scale(1); }
.grid-cell.move-ready::after { opacity: .38; transform: scale(.72); border-width: 2px; border-style: dotted; }
.grid-cell.selected::after { border-color: #fff079; box-shadow: 0 0 18px rgba(255, 237, 83, .55); }
.grid-cell.merge-ready::after {
  border-color: #fff079;
  box-shadow: 0 0 18px rgba(255, 237, 83, .55);
  animation: ready-pulse 1s ease-in-out infinite;
}
.grid-cell.merge-available::after {
  opacity: .66;
  border-color: #fff079;
  border-style: solid;
  box-shadow: 0 0 14px rgba(255, 237, 83, .38);
  transform: scale(.82);
  animation: merge-invite 1.5s ease-in-out infinite;
}

.riftling {
  --element: var(--air);
  --depth: 1;
  position: relative;
  z-index: 3;
  width: min(116%, 122px);
  aspect-ratio: 1;
  user-select: none;
  touch-action: none;
  cursor: grab;
  filter: drop-shadow(0 10px 5px rgba(37, 61, 21, .32));
  transform: scale(var(--depth));
  animation: unit-idle 2s ease-in-out infinite alternate;
}
.grid-cell:nth-child(-n+4) .riftling { --depth: .9; }
.grid-cell:nth-child(n+5) .riftling { --depth: 1.03; }
.grid-cell:nth-child(2n) .riftling { animation-delay: -.65s; }
.grid-cell:nth-child(3n) .riftling { animation-delay: -1.15s; }
.riftling:active { cursor: grabbing; }
.riftling.fire { --element: var(--fire); }
.riftling.water { --element: var(--water); }
.riftling.earth { --element: var(--earth); }
.riftling.air { --element: var(--air); }
.monster-art { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.captain-badge {
  position: absolute;
  z-index: 7;
  top: 8%;
  right: 7%;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: #fff7a8;
  font-size: 13px;
  line-height: 1;
  border: 2px solid #fff0a1;
  border-radius: 50% 43% 50% 44%;
  background: radial-gradient(circle at 35% 30%, #d895ff, #7d41bc 62%, #4e2d78);
  box-shadow: 0 2px 0 #49305d, 0 0 12px rgba(205, 143, 255, .7);
  text-shadow: 0 1px #593278, 0 0 5px white;
  transform: rotate(7deg);
}
.riftling.captain { filter: drop-shadow(0 0 8px rgba(224, 168, 255, .72)) drop-shadow(0 10px 5px rgba(37, 61, 21, .32)); }
.level-badge, .combat-level {
  position: absolute;
  z-index: 5;
  top: 8%;
  left: 8%;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: white;
  font-family: Menlo, monospace;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-shadow: 0 1px #5b2a18;
  border: 2px solid #fff2b6;
  border-radius: 8px 4px 8px 4px;
  background: color-mix(in srgb, var(--element) 74%, #4c281b);
  box-shadow: 0 2px 0 rgba(75, 43, 22, .4);
}

.controls {
  position: absolute;
  z-index: 30;
  right: 8px;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 8px;
  display: grid;
  justify-items: center;
  gap: 7px;
  transition: opacity .18s ease, transform .18s ease;
}
.controls.battling { opacity: 0; pointer-events: none; transform: translateY(30px); }
.controls-row { display: flex; align-items: flex-end; justify-content: center; gap: 8px; }
.tactics-ribbon {
  display: grid;
  width: min(100%, 400px);
  min-height: 42px;
  grid-template-columns: 24px minmax(0, 1fr) auto auto auto auto;
  align-items: center;
  gap: 7px;
  padding: 6px 7px;
  color: #fff7cf;
  border: 2px solid rgba(255, 237, 167, .86);
  border-radius: 12px 5px 12px 5px;
  background: linear-gradient(100deg, rgba(67, 45, 26, .92), rgba(44, 67, 42, .92));
  box-shadow: inset 0 1px rgba(255,255,255,.14), 0 4px 10px rgba(37, 54, 24, .25);
  backdrop-filter: blur(4px);
}
.tactics-icon {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: #fff079;
  font-size: 16px;
  text-shadow: 0 0 8px rgba(255, 235, 94, .7);
}
.tactics-copy { display: grid; min-width: 0; line-height: 1.05; }
.tactics-copy strong { font-size: 10.5px; letter-spacing: .02em; }
.tactics-copy small { margin-top: 2px; overflow: hidden; font-size: 7.5px; opacity: .82; text-overflow: ellipsis; white-space: nowrap; }
.tactics-ribbon.has-actions {
  grid-template-columns: 24px minmax(0, 1fr) auto auto auto;
  row-gap: 5px;
}
.tactics-ribbon.has-actions .tactics-copy small {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.2;
  text-overflow: clip;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.tactics-ribbon.has-actions .tactics-actions {
  grid-column: 1 / -1;
  justify-self: end;
}
.plan-button {
  display: grid;
  min-width: 46px;
  min-height: 32px;
  place-items: center;
  align-content: center;
  gap: 1px;
  padding: 2px 5px;
  color: #fff6cc;
  font-family: Menlo, monospace;
  font-weight: 900;
  letter-spacing: .03em;
  border: 1px solid rgba(255,246,188,.9);
  border-radius: 7px 3px 7px 3px;
  box-shadow: 0 2px 0 rgba(50,35,22,.4);
  cursor: pointer;
  text-transform: uppercase;
}
.plan-button small { max-width: 48px; font-size: 5px; line-height: 1; opacity: .76; white-space: nowrap; }
.plan-button b { font-size: 7px; line-height: 1; text-transform: uppercase; }
.plan-button.balanced { background: linear-gradient(#66899b, #3e6073); }
.plan-button.guard { background: linear-gradient(#65a65e, #3f7141); }
.plan-button.rush { background: linear-gradient(#ed7951, #b64a3f); }
.plan-button.best-plan small { color: #fff18b; opacity: 1; }
.plan-button:not(:disabled):hover { filter: brightness(1.1); transform: translateY(-1px); }
.plan-button:disabled { opacity: .55; cursor: default; }
.plan-advice-button {
  display: grid;
  min-width: 54px;
  min-height: 32px;
  place-items: center;
  align-content: center;
  gap: 1px;
  padding: 2px 5px;
  color: #fffbe0;
  font-family: Menlo, monospace;
  font-weight: 900;
  letter-spacing: .02em;
  border: 1px solid #fff07a;
  border-radius: 3px 7px 3px 7px;
  box-shadow: 0 2px 0 rgba(50,35,22,.4), 0 0 0 2px rgba(255,232,92,.22), 0 0 10px rgba(255,221,74,.3);
  cursor: pointer;
  text-transform: uppercase;
}
.plan-advice-button small { font-size: 5px; line-height: 1; color: #fff4a3; }
.plan-advice-button b { font-size: 6px; line-height: 1; white-space: nowrap; }
.plan-advice-button.balanced { background: linear-gradient(#769bad, #466c7f); }
.plan-advice-button.guard { background: linear-gradient(#72b66a, #477c48); }
.plan-advice-button.rush { background: linear-gradient(#fa865e, #c95345); }
.plan-advice-button:not(:disabled):hover { filter: brightness(1.1); transform: translateY(-1px); }
.plan-advice-button:disabled { opacity: .55; cursor: default; }
.forecast-badge {
  min-width: 40px;
  padding: 6px 6px 5px;
  color: #58351e;
  font-family: Menlo, monospace;
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .04em;
  text-align: center;
  border: 1px solid rgba(255,246,188,.9);
  border-radius: 7px 3px 7px 3px;
  background: #ffd966;
  box-shadow: 0 2px 0 rgba(50,35,22,.4);
  text-transform: uppercase;
}
.forecast-badge.edge { background: #8df0a1; }
.forecast-badge.even { background: #ffe36c; }
.forecast-badge.risk { color: white; background: #e55c58; }
.tactics-actions { display: flex; align-items: center; gap: 4px; }
.captain-button,
.forge-button,
.release-button {
  min-height: 32px;
  padding: 0 9px;
  color: #fff4c4;
  font-size: 7.5px;
  font-weight: 900;
  border: 2px solid #f7d487;
  border-radius: 8px 4px 8px 4px;
  background: linear-gradient(#a4603e, #754027);
  box-shadow: 0 2px 0 #4d2a1c;
  cursor: pointer;
  text-transform: uppercase;
}
.captain-button {
  color: #fff5c9;
  border-color: #e9c9ff;
  background: linear-gradient(#9861c8, #633b92);
  box-shadow: 0 2px 0 #422c64;
}
.forge-button {
  color: #4c2a17;
  border-color: #fff0a8;
  background: linear-gradient(#ffe875, #efa83b);
  box-shadow: 0 2px 0 #9a5d23, 0 0 9px rgba(255, 217, 91, .28);
}
.forge-button b::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 2px;
  border: 1px solid #fff2a9;
  border-radius: 50%;
  background: #d98a1d;
  box-shadow: inset 0 0 0 1px rgba(126, 69, 18, .24);
}
.captain-button:disabled,
.forge-button:disabled { color: #fff7a7; opacity: .58; cursor: default; filter: grayscale(.35); }
.release-button b { color: #ffe36c; }
.release-button.confirming {
  color: #fff8d8;
  border-color: #ffd78e;
  background: linear-gradient(#dc644f, #9c392f);
  box-shadow: 0 2px 0 #6e2722, 0 0 0 3px rgba(255, 216, 123, .2);
  animation: confirm-release-pulse .8s ease-in-out infinite alternate;
}
@keyframes confirm-release-pulse {
  to { filter: brightness(1.16); box-shadow: 0 2px 0 #6e2722, 0 0 0 5px rgba(255, 216, 123, .3); }
}
.summon-deck { display: flex; gap: 5px; }
.element-summon {
  --card: #777;
  --card-dark: #444;
  position: relative;
  width: 58px;
  height: 77px;
  padding: 0;
  color: white;
  border: 3px solid #fff0ad;
  border-radius: 12px 6px 12px 6px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--card) 68%, white), var(--card));
  box-shadow: inset 0 2px rgba(255,255,255,.3), 0 5px 0 var(--card-dark), 0 9px 13px rgba(41, 52, 24, .26);
  cursor: pointer;
  overflow: hidden;
  transition: transform .14s ease, filter .14s ease, opacity .14s ease;
}
.element-summon::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: -35%;
  bottom: -35%;
  left: -80%;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  transform: rotate(18deg);
  animation: card-shine 4.6s ease-in-out infinite;
  pointer-events: none;
}
.element-summon:nth-child(2)::before { animation-delay: -1.1s; }
.element-summon:nth-child(3)::before { animation-delay: -2.2s; }
.element-summon:nth-child(4)::before { animation-delay: -3.3s; }
.element-summon:disabled::before { display: none; }
.element-summon.recommended {
  border-color: #fff57a;
  box-shadow: inset 0 2px rgba(255,255,255,.38), 0 5px 0 var(--card-dark), 0 0 0 3px rgba(255, 241, 92, .26), 0 9px 15px rgba(41, 52, 24, .3);
}
.counter-badge,
.mastery-badge {
  position: absolute;
  z-index: 5;
  top: 3px;
  padding: 2px 4px;
  color: #5a3a1b;
  font-family: Menlo, monospace;
  font-size: 6px;
  font-style: normal;
  font-weight: 900;
  border: 1px solid #fff8a5;
  border-radius: 5px 3px 5px 3px;
  background: #fff06b;
  box-shadow: 0 1px 0 rgba(69, 49, 21, .45);
}
.counter-badge { right: 3px; }
.mastery-badge {
  left: 3px;
  color: #fff6bc;
  border-color: #f0d5ff;
  background: linear-gradient(#a85cce, #67409a);
  box-shadow: 0 1px 0 rgba(57, 36, 83, .55), 0 0 7px rgba(222, 166, 255, .5);
}
.element-summon img {
  position: absolute;
  top: -3px;
  left: 2px;
  width: 52px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 3px 2px rgba(50, 42, 21, .28));
  pointer-events: none;
}
.element-summon small {
  position: absolute;
  right: 0;
  bottom: 3px;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: Menlo, monospace;
  font-size: 8px;
  text-shadow: 0 1px var(--card-dark);
}
.element-summon:not(:disabled):hover { transform: translateY(-4px); filter: brightness(1.06); }
.element-summon:not(:disabled):active { transform: translateY(1px); }
.element-summon:disabled { opacity: .48; filter: grayscale(.65); cursor: not-allowed; }
.fire-card { --card: #e95a3c; --card-dark: #8f3025; }
.water-card { --card: #39b9e3; --card-dark: #1d7097; }
.earth-card { --card: #87ae48; --card-dark: #506c2e; }
.air-card { --card: #a38fde; --card-dark: #625298; }

.battle-button {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  align-content: center;
  color: white;
  border: 4px solid #ffeaa2;
  border-radius: 50% 42% 50% 45%;
  background: radial-gradient(circle at 37% 28%, #ff8b72, #e94643 50%, #b82839 76%);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.12), 0 6px 0 #852536, 0 10px 18px rgba(49, 44, 22, .34);
  cursor: pointer;
  transition: transform .14s ease, filter .14s ease, opacity .14s ease;
}
.battle-button span { height: 35px; font-size: 30px; line-height: 1; text-shadow: 0 3px #8c2732; }
.battle-button small { font-size: 8px; font-weight: 900; letter-spacing: .08em; text-shadow: 0 2px #8c2732; text-transform: uppercase; }
.battle-button:not(:disabled):hover { transform: translateY(-4px) scale(1.02); filter: brightness(1.06); }
.battle-button:disabled { opacity: .5; filter: grayscale(.6); cursor: not-allowed; }

.battlefield.is-battling { background-size: auto 106%; background-position: center 46%; }
.battlefield.is-battling .deployment-zone { opacity: 0; transform: scale(.92); }
.battle-hidden { opacity: 0; pointer-events: none; }

.battle-banner {
  position: absolute;
  z-index: 48;
  top: 42%;
  left: 50%;
  width: 116%;
  padding: 13px 0;
  color: #fff6c5;
  font-size: 34px;
  font-style: italic;
  font-weight: 900;
  letter-spacing: .05em;
  text-align: center;
  text-shadow: 0 3px 0 #8a2c29, 0 6px 14px rgba(53,45,20,.35);
  background: linear-gradient(90deg, transparent, rgba(217,55,54,.88) 25%, rgba(236,80,54,.94) 50%, rgba(217,55,54,.88) 75%, transparent);
  transform: translate(-50%, -50%) rotate(-2deg);
  animation: battle-banner-in .52s ease both;
  pointer-events: none;
}

.combat-layer {
  position: absolute;
  z-index: 18;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.combat-unit {
  --aura: rgba(173, 153, 229, .35);
  --unit-size: 86px;
  position: absolute;
  top: 0;
  left: 0;
  width: var(--unit-size);
  height: var(--unit-size);
  filter: drop-shadow(0 9px 5px rgba(37, 57, 21, .32));
  will-change: transform;
}
.combat-unit.fire { --aura: rgba(255, 92, 51, .42); }
.combat-unit.water { --aura: rgba(57, 185, 232, .4); }
.combat-unit.earth { --aura: rgba(131, 173, 66, .38); }
.combat-unit.air { --aura: rgba(173, 153, 229, .42); }
.combat-unit::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--aura), transparent 68%);
  filter: blur(4px);
  animation: aura-pulse 1.4s ease-in-out infinite alternate;
}
.combat-unit::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: 15%;
  bottom: 5%;
  left: 15%;
  height: 15%;
  border-radius: 50%;
  background: rgba(35, 62, 22, .34);
  filter: blur(3px);
}
.combat-unit .monster-art { position: relative; z-index: 1; width: var(--unit-size); height: var(--unit-size); }
.combat-unit.foe .monster-art { transform: scaleX(-1); filter: drop-shadow(0 0 5px rgba(255, 72, 54, .7)); }
.combat-unit.boss::before { inset: 0; box-shadow: inset 0 0 0 3px rgba(255, 106, 190, .55); }
.combat-boss-badge { top: -13px; }
.combat-captain-badge { top: 6px; right: 1px; width: 22px; height: 22px; font-size: 10px; }
.combat-unit.captain::before { box-shadow: inset 0 0 0 2px rgba(231, 192, 255, .5), 0 0 12px rgba(187, 118, 235, .48); }
.combat-unit.shielded::before {
  box-shadow: inset 0 0 0 3px rgba(144, 239, 255, .82), 0 0 13px rgba(93, 217, 255, .72);
}
.combat-unit.player.formation-front::after { background: rgba(39, 103, 133, .34); }
.combat-unit.player.formation-rear::after { background: rgba(87, 62, 126, .3); }
.combat-unit.burning .monster-art { filter: drop-shadow(0 0 8px #ff7a36) brightness(1.08); }
.combat-unit.foe.burning .monster-art { filter: drop-shadow(0 0 8px #ff7a36) brightness(1.08); }
.combat-unit.slowed { filter: drop-shadow(0 9px 5px rgba(37, 57, 21, .32)) saturate(.72) hue-rotate(12deg); }
.unit-health {
  position: absolute;
  z-index: 6;
  top: -3px;
  left: 12%;
  width: 76%;
  height: 8px;
  border: 2px solid rgba(55, 33, 17, .85);
  border-radius: 99px;
  background: #302117;
  overflow: hidden;
}
.unit-health span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(#76ecff, #298cd8);
  transform-origin: left center;
  transition: transform .15s ease;
}
.combat-unit.foe .unit-health span { background: linear-gradient(#ffb753, #e73e39); }
.unit-health.warning span { background: linear-gradient(#ffe36a, #e9a52d); }
.unit-health.critical span { background: linear-gradient(#ff6c5e, #d52c35); animation: health-pulse .5s ease-in-out infinite alternate; }
.combat-level { top: 7px; left: 5px; width: 20px; height: 20px; font-size: 8px; }

.battle-shot {
  position: absolute;
  z-index: 22;
  width: 16px;
  height: 16px;
  border: 2px solid white;
  border-radius: 50% 10% 50% 50%;
  background: var(--shot, var(--gold));
  box-shadow: 0 0 17px var(--shot, var(--gold));
  transition: transform var(--shot-time, 210ms) linear, opacity var(--shot-time, 210ms) ease;
}
.battle-shot.chain { border-radius: 50%; box-shadow: 0 0 20px #e4d3ff; }
.battle-shot.chain::before {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid rgba(238, 223, 255, .75);
  border-radius: 50%;
}
.battle-shot::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 9px;
  width: 29px;
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--shot, var(--gold)));
  filter: blur(2px);
  opacity: .72;
}
.damage-pop {
  position: absolute;
  z-index: 24;
  color: #fff7cc;
  font-size: 15px;
  font-weight: 900;
  text-shadow: 0 2px 0 #712c22, 0 3px 7px rgba(0,0,0,.35);
  transform: translateX(-50%);
  animation: damage-rise .6s ease-out forwards;
}
.damage-pop.advantage { color: #fff26b; font-size: 19px; }
.damage-pop.shield { color: #a8f2ff; font-size: 10px; letter-spacing: .06em; }
.damage-pop.burn { color: #ffb04f; }
.damage-pop.chain { color: #dac6ff; }
.damage-pop.surge { color: #fff6a5; font-size: 18px; }
.impact-ring {
  position: absolute;
  z-index: 23;
  width: 18px;
  height: 18px;
  border: 4px solid var(--impact, white);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--impact, white);
  transform: translate(-50%, -50%) scale(.2);
  animation: impact-pop .38s ease-out forwards;
}
.impact-ring.advantage { border-width: 6px; box-shadow: 0 0 20px #fff16c; }

.team-bars {
  position: absolute;
  z-index: 35;
  right: 12px;
  bottom: max(15px, env(safe-area-inset-bottom));
  left: 12px;
  display: grid;
  grid-template-columns: 1fr 34px 1fr;
  align-items: center;
  gap: 6px;
}
.team-bar {
  height: 12px;
  padding: 2px;
  border: 2px solid #fff0b4;
  border-radius: 99px;
  background: rgba(58, 38, 22, .76);
  box-shadow: 0 3px 5px rgba(42, 52, 21, .28);
  overflow: hidden;
}
.team-bar span { display: block; width: 100%; height: 100%; border-radius: inherit; transform-origin: left center; transition: transform .16s ease; }
.player-bar span { background: linear-gradient(#74dbff, #3198e3); }
.enemy-bar span { margin-left: auto; background: linear-gradient(#ffae4c, #e8443f); transform-origin: right center; }
.team-versus { color: #fff4bd; font-size: 9px; text-align: center; text-shadow: 0 2px #56341e; }

.rift-button {
  --charge: 0;
  --rift: var(--fire);
  position: absolute;
  z-index: 38;
  left: 13px;
  bottom: max(40px, calc(env(safe-area-inset-bottom) + 28px));
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  align-content: center;
  gap: 1px;
  padding: 5px;
  color: white;
  border: 3px solid #fff0b2;
  border-radius: 50% 44% 50% 45%;
  background: conic-gradient(var(--rift) calc(var(--charge) * 1%), rgba(55, 38, 29, .82) 0);
  box-shadow: 0 5px 0 #513027, 0 9px 16px rgba(45,44,23,.3);
  cursor: default;
  transition: filter .16s ease, transform .16s ease;
}
.rift-orb {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 2px solid rgba(255, 246, 195, .82);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--rift) 48%, white), color-mix(in srgb, var(--rift) 72%, #40233a));
  box-shadow: inset 0 2px 5px rgba(255,255,255,.4), 0 0 11px color-mix(in srgb, var(--rift) 66%, transparent);
}
.rift-orb b { font-size: 19px; text-shadow: 0 2px 0 rgba(65,31,37,.55), 0 0 7px white; }
.rift-button small {
  margin-top: -2px;
  font-family: Menlo, monospace;
  font-size: 6px;
  font-weight: 900;
  letter-spacing: .04em;
  text-shadow: 0 1px #4e2b28;
  text-transform: uppercase;
}
.rift-button.ready {
  cursor: pointer;
  filter: brightness(1.12);
  animation: rift-ready .7s ease-in-out infinite alternate;
}
.rift-button.ready:hover { transform: translateY(-3px) scale(1.03); }
.rift-button:disabled { opacity: 1; }

.speed-button {
  position: absolute;
  z-index: 38;
  right: 13px;
  bottom: max(40px, calc(env(safe-area-inset-bottom) + 28px));
  display: grid;
  width: 56px;
  height: 46px;
  place-items: center;
  align-content: center;
  color: white;
  border: 3px solid #ffe9bd;
  border-radius: 10px 5px 10px 5px;
  background: linear-gradient(#f55cae, #b72e7b);
  box-shadow: inset 0 2px rgba(255,255,255,.23), 0 4px 0 #7e245b, 0 7px 12px rgba(45,44,23,.26);
  cursor: pointer;
}
.speed-button b { height: 20px; font-size: 22px; line-height: .8; }
.speed-button span { font-size: 9px; }

.rift-surge-effect {
  position: absolute;
  z-index: 32;
  inset: 0;
  background:
    radial-gradient(circle at 50% 53%, color-mix(in srgb, var(--surge) 56%, white) 0 4%, transparent 5%),
    radial-gradient(circle at 50% 53%, transparent 0 12%, color-mix(in srgb, var(--surge) 64%, transparent) 13% 17%, transparent 18% 27%, color-mix(in srgb, var(--surge) 38%, transparent) 28% 31%, transparent 32%);
  opacity: 0;
  animation: rift-surge .72s ease-out forwards;
  pointer-events: none;
}
.rift-surge-effect::after {
  content: attr(data-label);
  position: absolute;
  top: 47%;
  left: 50%;
  color: #fff8ca;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .08em;
  text-shadow: 0 3px 0 color-mix(in srgb, var(--surge) 55%, #3d2340), 0 6px 18px rgba(40,31,25,.42);
  transform: translate(-50%, -50%) rotate(-2deg);
  text-transform: uppercase;
  white-space: nowrap;
}

.result-panel {
  position: absolute;
  z-index: 50;
  top: 43%;
  left: 50%;
  display: flex;
  width: min(76%, 310px);
  flex-direction: column;
  align-items: center;
  padding: 25px 18px 20px;
  color: white;
  border: 4px solid #7ce6ed;
  border-radius: 26px 10px 26px 10px;
  background: linear-gradient(155deg, rgba(36, 69, 94, .97), rgba(42, 32, 76, .97));
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.18), 0 20px 50px rgba(22,38,20,.46);
  transform: translate(-50%, -50%);
  overflow: hidden;
}
.result-rays {
  position: absolute;
  inset: -70%;
  background: repeating-conic-gradient(rgba(131,244,237,.15) 0 8deg, transparent 8deg 18deg);
  animation: result-spin 12s linear infinite;
}
.result-panel > *:not(.result-rays) { position: relative; z-index: 1; }
.result-panel small { font-size: 8px; letter-spacing: .14em; text-transform: uppercase; opacity: .76; }
#resultTitle { margin: 3px 0 8px; color: #8df8ef; font-size: 33px; text-shadow: 0 3px #19667c; }
.result-stats {
  display: grid;
  width: min(100%, 220px);
  justify-items: center;
  gap: 3px;
  margin: 0 0 12px;
  padding: 8px 10px 7px;
  color: #fff5c5;
  border: 1px solid rgba(139, 236, 237, .55);
  border-radius: 10px 4px 10px 4px;
  background: rgba(20, 42, 70, .42);
  box-shadow: inset 0 1px rgba(255,255,255,.08);
}
.result-stats b { font-size: 10px; letter-spacing: .02em; text-shadow: 0 2px rgba(30, 34, 65, .6); }
.result-stats small { font-family: Menlo, monospace; font-size: 6px; letter-spacing: .02em; opacity: .72; text-transform: uppercase; }
.reward-coin { display: flex; align-items: center; gap: 7px; margin-bottom: 14px; color: #ffe578; }
.reward-coin b { font-size: 18px; }
.result-panel button {
  min-width: 150px;
  min-height: 45px;
  color: white;
  font-weight: 900;
  border: 3px solid #f8df92;
  border-radius: 15px 6px 15px 6px;
  background: linear-gradient(#a850e4, #7135b4);
  box-shadow: 0 4px 0 #4d277d;
  cursor: pointer;
}

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 148px;
  max-width: calc(100% - 32px);
  padding: 9px 15px;
  color: #fff8d6;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  border: 2px solid rgba(255,239,179,.78);
  border-radius: 99px;
  background: rgba(66,45,24,.9);
  box-shadow: 0 6px 14px rgba(35,48,20,.28);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.visible { transform: translate(-50%, 0); opacity: 1; }

.merge-burst {
  position: absolute;
  z-index: 8;
  inset: 4%;
  border: 4px solid var(--burst, var(--gold));
  border-radius: 50%;
  box-shadow: 0 0 22px var(--burst, var(--gold));
  pointer-events: none;
  animation: merge-burst .6s ease-out forwards;
}
.merge-burst::before,
.merge-burst::after {
  content: "✦";
  position: absolute;
  color: var(--burst, var(--gold));
  font-size: 24px;
  text-shadow: 0 0 8px white;
}
.merge-burst::before { top: -10px; left: 5px; }
.merge-burst::after { right: -7px; bottom: 2px; font-size: 18px; }
.merge-label {
  position: absolute;
  z-index: 12;
  top: 4%;
  left: 50%;
  color: #fff6a5;
  font-family: Menlo, monospace;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-shadow: 0 2px 0 #783c24, 0 4px 9px rgba(50,45,18,.35);
  transform: translateX(-50%);
  pointer-events: none;
  animation: merge-label-rise .8s ease-out forwards;
}

@keyframes rift-ready { to { box-shadow: 0 5px 0 #513027, 0 0 0 4px color-mix(in srgb, var(--rift) 35%, transparent), 0 0 23px color-mix(in srgb, var(--rift) 75%, transparent); filter: brightness(1.18); } }
@keyframes rift-surge {
  0% { opacity: 0; transform: scale(.55); }
  18% { opacity: 1; }
  70% { opacity: .82; }
  100% { opacity: 0; transform: scale(1.22); }
}
@keyframes warden-stage { to { filter: brightness(1.14); transform: rotate(3deg) scale(1.03); } }
@keyframes setup-float { to { transform: translateY(-7px) rotate(1deg); } }
@keyframes unit-idle { to { transform: translateY(-6px) rotate(1deg) scale(var(--depth)); } }
@keyframes ready-pulse { 50% { transform: scale(.9); opacity: .55; } }
@keyframes merge-invite { 50% { transform: scale(.93); opacity: .94; } }
@keyframes heart-hit { 35% { transform: scale(1.25) rotate(-8deg); filter: brightness(1.7); } 70% { transform: rotate(7deg); } }
@keyframes merge-burst { from { transform: scale(.2) rotate(0); opacity: 1; } to { transform: scale(1.35) rotate(65deg); opacity: 0; } }
@keyframes merge-label-rise { from { opacity: 0; transform: translate(-50%, 16px) scale(.75); } 30% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -24px) scale(1.08); } }
@keyframes damage-rise { from { transform: translate(-50%, 0) scale(.8); opacity: 1; } to { transform: translate(-50%, -40px) scale(1.12); opacity: 0; } }
@keyframes impact-pop { to { transform: translate(-50%, -50%) scale(2.2); opacity: 0; } }
@keyframes result-spin { to { transform: rotate(360deg); } }
@keyframes card-shine { 0%, 70% { left: -80%; opacity: 0; } 78% { opacity: .8; } 92%, 100% { left: 145%; opacity: 0; } }
@keyframes aura-pulse { to { transform: scale(1.16); opacity: .62; } }
@keyframes health-pulse { to { opacity: .64; } }
@keyframes battle-banner-in {
  0% { opacity: 0; transform: translate(-62%, -50%) rotate(-2deg) scale(.88); }
  25%, 72% { opacity: 1; transform: translate(-50%, -50%) rotate(-2deg) scale(1); }
  100% { opacity: 0; transform: translate(-38%, -50%) rotate(-2deg) scale(1.06); }
}

@media (max-width: 390px) {
  .topbar { right: 7px; left: 7px; grid-template-columns: 48px 1fr auto; gap: 6px; }
  .stage-badge { width: 46px; height: 46px; }
  .gold-pill { padding-right: 7px; }
  .deployment-zone { right: 5%; left: 5%; }
  .merge-grid { right: 7%; left: 7%; }
  .element-summon { width: 53px; }
  .element-summon img { left: 1px; width: 49px; }
  .battle-button { width: 71px; height: 71px; }
  .controls, .controls-row { gap: 6px; }
  .tactics-ribbon { width: min(100%, 345px); gap: 4px; }
  .plan-button { min-width: 36px; padding-right: 3px; padding-left: 3px; }
  .plan-button b { font-size: 5px; }
  .captain-button, .forge-button, .release-button { padding-right: 5px; padding-left: 5px; }
  .formation-band { right: 5px; min-width: 88px; gap: 4px; }
  .formation-band small { font-size: 4.5px; }
}

@media (max-height: 700px) {
  .enemy-row { top: 10%; }
  .deployment-zone { top: 32%; bottom: 126px; }
  .merge-grid { top: 33%; bottom: 133px; }
  .riftling { width: min(106%, 105px); }
  .tactics-ribbon { min-height: 30px; padding-top: 3px; padding-bottom: 3px; }
  .element-summon { height: 72px; }
  .battle-button { width: 68px; height: 68px; }
}

@media (min-width: 760px) {
  body { padding: 24px; }
  .game-shell {
    height: calc(100dvh - 48px);
    min-height: 660px;
    border: 4px solid rgba(255,244,190,.34);
    border-radius: 30px;
  }
}

/* Touch devices trade always-on paint effects for cooler, steadier gameplay. */
.mobile-performance .sun-wash { display: none; }
.mobile-performance .topbar,
.mobile-performance .setup-enemy,
.mobile-performance .riftling,
.mobile-performance .combat-unit { filter: none; }
.mobile-performance .riftling.captain { filter: drop-shadow(0 0 5px rgba(224, 168, 255, .55)); }
.mobile-performance .setup-enemy,
.mobile-performance .riftling,
.mobile-performance .merge-grid .merge-available::after,
.mobile-performance .merge-grid .merge-ready::after,
.mobile-performance .stage-badge.boss-wave,
.mobile-performance .rift-button.ready,
.mobile-performance .result-rays { animation: none; }
.mobile-performance .element-summon::before { display: none; }
.mobile-performance .tactics-ribbon { backdrop-filter: none; }
.mobile-performance .combat-unit::before {
  filter: none;
  animation: none;
  opacity: .42;
}
.mobile-performance .combat-unit::after {
  filter: none;
  opacity: .45;
}
.mobile-performance .combat-unit .monster-art,
.mobile-performance .combat-unit.foe .monster-art,
.mobile-performance .combat-unit.burning .monster-art,
.mobile-performance .combat-unit.foe.burning .monster-art { filter: none; }
.mobile-performance .battle-shot { box-shadow: 0 0 8px var(--shot, var(--gold)); }
.mobile-performance .battle-shot::after { filter: none; opacity: .55; }
.mobile-performance .impact-ring { box-shadow: 0 0 6px var(--impact, white); }
.mobile-performance .impact-ring.advantage { box-shadow: 0 0 10px #fff16c; }
.mobile-performance .rift-surge-effect {
  background: radial-gradient(circle at 50% 53%, color-mix(in srgb, var(--surge) 48%, white) 0 6%, color-mix(in srgb, var(--surge) 24%, transparent) 7% 26%, transparent 27%);
}
.mobile-performance .rift-surge-effect::after { text-shadow: 0 2px 0 rgba(61, 35, 64, .7); }

.battle-low-effects .combat-unit::before,
.battle-low-effects .battle-shot::after { display: none; }
.battle-low-effects .battle-shot,
.battle-low-effects .impact-ring { box-shadow: none; }

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