:root {
  color-scheme: light;
  --bg: #f4f2ea;
  --ink: #1f2625;
  --muted: #66706c;
  --panel: #ffffff;
  --line: #d8d3c6;
  --light: #e6d8b8;
  --dark: #527b69;
  --accent: #b8473b;
  --accent-2: #236c7a;
  --legal: #f6c343;
  --danger: #9d2d28;
  --shadow: 0 18px 50px rgba(38, 43, 39, .14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(82, 123, 105, .18), transparent 35%),
    linear-gradient(315deg, rgba(184, 71, 59, .14), transparent 40%),
    var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

button, input, select {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent-2);
  color: white;
  font-weight: 800;
  cursor: pointer;
  padding: 0 16px;
  transition: transform .15s ease, filter .15s ease;
}

button:hover { filter: brightness(1.06); box-shadow: 0 0 0 3px rgba(35,108,122,.12), 0 10px 24px rgba(35,108,122,.18); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .48; cursor: not-allowed; }

button.secondary {
  background: #e9ece6;
  color: var(--ink);
  border: 1px solid var(--line);
}

button.danger { background: var(--danger); }

input, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfaf6;
  color: var(--ink);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.app {
  width: min(1160px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  align-items: center;
}

.panel {
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(216, 211, 198, .9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hidden { display: none !important; }

.menu-panel {
  position: relative;
  overflow: hidden;
  width: min(680px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 5vw, 36px);
}

.menu-panel > *:not(.lobby-stage) {
  position: relative;
  z-index: 1;
}

.lobby-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 74% 20%, rgba(246,195,67,.22), transparent 20%),
    radial-gradient(circle at 14% 80%, rgba(35,108,122,.22), transparent 24%);
}

.lobby-king {
  position: absolute;
  right: -22px;
  top: -28px;
  color: rgba(31, 38, 37, .08);
  font-size: clamp(160px, 34vw, 300px);
  line-height: 1;
  animation: kingFloat 5.8s ease-in-out infinite;
}

.particle {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f6c343;
  box-shadow: 0 0 18px #f6c343;
  animation: particleDrift 4.4s ease-in-out infinite;
}

.p1 { left: 16%; top: 20%; }
.p2 { left: 70%; top: 64%; animation-delay: .8s; background: #236c7a; box-shadow: 0 0 18px #236c7a; }
.p3 { left: 40%; top: 12%; animation-delay: 1.4s; }
.p4 { left: 86%; top: 34%; animation-delay: 2.1s; background: #b8473b; box-shadow: 0 0 18px #b8473b; }

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 26px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 8px;
  background: var(--ink);
  color: #f9f0df;
  font-weight: 900;
}

h1, h2, p { margin: 0; }

h1 {
  font-size: clamp(36px, 8vw, 64px);
  line-height: .95;
}

.brand p, .hint, .selected-card p {
  color: var(--muted);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.variant-cards {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.variant-card {
  min-height: 96px;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px;
  text-align: left;
  background: rgba(255,255,255,.72);
  color: var(--ink);
  border: 1px solid rgba(216,211,198,.9);
}

.variant-card strong {
  font-size: 14px;
}

.variant-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.28;
}

.variant-card.active {
  background: linear-gradient(135deg, rgba(35,108,122,.95), rgba(184,71,59,.88));
  color: white;
  box-shadow: 0 0 30px rgba(35,108,122,.28);
}

.variant-card.active span {
  color: rgba(255,255,255,.84);
}

.join-row {
  grid-column: 1 / -1;
}

.join-row span {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.hint {
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.45;
}

.rank-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.rank-badge {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #5d6b73, #1f2625);
  box-shadow: 0 0 18px rgba(35,108,122,.24);
}

.rank-badge.bronze { background: linear-gradient(135deg, #8b5d33, #4e3423); }
.rank-badge.silver { background: linear-gradient(135deg, #9aa6ad, #52616b); }
.rank-badge.gold { background: linear-gradient(135deg, #f6c343, #a46b19); }
.rank-badge.platinum { background: linear-gradient(135deg, #57c7bd, #236c7a); }
.rank-badge.diamond { background: linear-gradient(135deg, #7dd3fc, #4f46e5); }
.rank-badge.master { background: linear-gradient(135deg, #b8473b, #1f2625); }

.game-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.sidebar {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.status-block, .selected-card, .history-card {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.message {
  min-height: 48px;
  border-radius: 8px;
  background: #f1f4ee;
  border: 1px solid var(--line);
  padding: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.ability-panel {
  display: grid;
  gap: 8px;
}

.history-card {
  max-height: 170px;
  overflow: auto;
}

.history-card ol {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.history-card li::marker {
  color: var(--accent-2);
  font-weight: 900;
}

.history-card li.history-evolution {
  color: #236c7a;
  font-weight: 850;
}

.history-card li.history-evolution::before {
  content: "EV ";
  color: #b8473b;
  font-weight: 950;
}

.ability-panel h3 {
  margin: 0;
  font-size: 15px;
}

.ability-panel label {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--ink);
}

.ability-panel input {
  width: 18px;
  min-height: 18px;
}

.ability-button {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 8px 10px;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 20%, rgba(246,195,67,.3), transparent 28%),
    linear-gradient(135deg, #236c7a, #1f2625);
}

.ability-button::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, #f6c343, transparent);
  animation: abilityGlow 1.6s ease-in-out infinite;
}

.ability-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: conic-gradient(#b8473b var(--cooldown-progress), rgba(255,255,255,.22) 0);
  color: #fff8e7;
  font-size: 24px;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.18);
}

.ability-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ability-copy strong,
.ability-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ability-copy small {
  opacity: .78;
  font-size: 11px;
  font-weight: 650;
}

.evolution-points {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.evolution-points strong {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: 8px;
  color: #fff8e7;
  background: linear-gradient(135deg, #236c7a, #1f2625);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}

.evolution-tree {
  display: grid;
  gap: 8px;
}

.evolution-option {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 8px 10px;
  text-align: left;
  background: #e9ece6;
  color: var(--ink);
  border: 1px solid var(--line);
}

.evolution-option span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.evolution-option.ready {
  background: linear-gradient(135deg, rgba(246,195,67,.95), rgba(35,108,122,.92));
  color: #fff8e7;
  animation: evolveGlow 1.4s ease-in-out infinite;
}

.evolution-option.ready span {
  color: rgba(255,255,255,.86);
}

.evolution-option.locked {
  opacity: .52;
}

.cooldown {
  opacity: .9;
  font-size: 12px;
}

.replay-controls {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 8px;
  margin-top: 8px;
}

.replay-plus {
  grid-template-columns: 1fr 80px 1fr;
}

#replayTimeline {
  width: 100%;
  min-height: 24px;
  padding: 0;
  accent-color: var(--accent-2);
}

.replay-controls button {
  min-height: 36px;
  padding: 0 8px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.actions button:last-child {
  grid-column: 1 / -1;
}

.board-wrap {
  position: relative;
  width: min(78vh, 100%);
  margin: 0 auto;
  aspect-ratio: 1;
}

.board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: 100%;
  height: 100%;
  border: 10px solid #272f2d;
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  touch-action: manipulation;
}

.square {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  user-select: none;
}

.square.light { background: var(--light); }
.square.dark { background: var(--dark); }
.square.selected { outline: 4px solid var(--accent); outline-offset: -4px; }
.square.legal::after {
  content: "";
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: rgba(246, 195, 67, .82);
  position: absolute;
}
.square.capture::after {
  content: "";
  width: 78%;
  height: 78%;
  border-radius: 50%;
  border: 5px solid rgba(246, 195, 67, .78);
  position: absolute;
}
.square.targeting { box-shadow: inset 0 0 0 5px #b8473b; }
.square.fog .piece { opacity: .18; filter: grayscale(1); }
.square.in-check {
  animation: checkPulse .7s ease-in-out infinite alternate;
}

.piece {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: clamp(32px, 7vw, 72px);
  line-height: 1;
  cursor: grab;
  text-shadow: 0 2px 0 rgba(255,255,255,.28);
}

.piece.black { color: #171b1a; }
.piece.white { color: #fffaf0; text-shadow: 0 2px 2px rgba(0,0,0,.3); }
.piece.evolved {
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(125,211,252,.75), 0 0 18px rgba(125,211,252,.35);
}
.piece.evo-tier-2 {
  box-shadow: inset 0 0 0 3px rgba(168,85,247,.82), 0 0 22px rgba(168,85,247,.42);
}
.piece.evo-tier-3 {
  box-shadow: inset 0 0 0 3px rgba(246,195,67,.95), 0 0 28px rgba(246,195,67,.72);
  animation: finalEvolutionGlow 1.5s ease-in-out infinite;
}
.evolution-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 4;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(31,38,37,.86);
  color: #fff8e7;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
}
.evolution-aura {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  pointer-events: none;
  border: 2px solid rgba(246,195,67,.7);
  animation: auraSpin 2.4s linear infinite;
}
.piece.frozen::before,
.piece.shielded::after {
  position: absolute;
  top: 12%;
  right: 12%;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 13px;
  color: white;
}
.piece.frozen::before { content: "!";
  background: #236c7a;
}
.piece.shielded::after { content: "+";
  background: #b8473b;
}

.effect {
  position: absolute;
  inset: 8%;
  z-index: 3;
  pointer-events: none;
  border-radius: 8px;
}

.dash-trail {
  background: linear-gradient(180deg, transparent, rgba(246, 195, 67, .75), transparent);
  animation: dashTrail .72s ease-out forwards;
}

.dash-impact {
  border: 4px solid rgba(246, 195, 67, .9);
  animation: popRing .62s ease-out forwards;
}

.teleport {
  background:
    radial-gradient(circle, rgba(35, 108, 122, .9), transparent 56%),
    conic-gradient(from 90deg, transparent, rgba(255,255,255,.9), transparent);
  animation: teleportBlink .72s ease-out forwards;
}

.freeze-crystal {
  border: 4px solid rgba(125, 211, 252, .95);
  background:
    linear-gradient(45deg, transparent 44%, rgba(255,255,255,.95) 45%, rgba(255,255,255,.95) 55%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, rgba(125, 211, 252, .85) 45%, rgba(125, 211, 252, .85) 55%, transparent 56%);
  animation: crystalLock .76s ease-out forwards;
}

.shield-bubble {
  border: 4px solid rgba(184, 71, 59, .9);
  background: radial-gradient(circle, rgba(255,255,255,.35), rgba(184, 71, 59, .16), transparent 68%);
  border-radius: 50%;
  animation: shieldBloom .76s ease-out forwards;
}

.blast-wave {
  inset: -18%;
  border: 5px solid rgba(184, 71, 59, .82);
  border-radius: 50%;
  animation: shockwave .7s ease-out forwards;
}

.blast-hit {
  background: rgba(184, 71, 59, .28);
  animation: blastHit .42s ease-out forwards;
}

.evolution-flare {
  inset: -8%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(246,195,67,.9), transparent 48%),
    conic-gradient(from 0deg, rgba(35,108,122,.9), transparent, rgba(184,71,59,.9), transparent);
  animation: evolutionFlare .82s ease-out forwards;
}

.damage-number {
  position: absolute;
  z-index: 5;
  top: 12%;
  left: 50%;
  color: #fff8e7;
  background: rgba(184, 71, 59, .92);
  border-radius: 999px;
  padding: 2px 7px;
  font-weight: 950;
  transform: translateX(-50%);
  animation: damageRise .82s ease-out forwards;
}

.particle-burst {
  position: fixed;
  z-index: 20;
  pointer-events: none;
}

.particle-burst span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f6c343;
  box-shadow: 0 0 18px #f6c343;
  animation: burstOut .75s ease-out forwards;
}

.particle-burst.explosion span {
  background: #b8473b;
  box-shadow: 0 0 18px #b8473b;
}

.screen-shake {
  animation: screenShake .34s linear;
}

.evolution-flash::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background: radial-gradient(circle, rgba(246,195,67,.42), transparent 58%);
  animation: flashFade .5s ease-out forwards;
}

.game-shell.checkmate-active::after {
  content: "CHECKMATE";
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: #fff8e7;
  background: rgba(31, 38, 37, .42);
  font-size: clamp(40px, 11vw, 128px);
  font-weight: 950;
  text-shadow: 0 8px 32px rgba(0,0,0,.5);
  animation: checkmateScreen 1.1s ease-out forwards;
}

.fight-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(31,38,37,.62);
  backdrop-filter: blur(6px);
}

.fight-panel {
  width: min(760px, 100%);
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.fighters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.fighter-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 14px;
  border-radius: 8px;
  color: #fff8e7;
  background: linear-gradient(135deg, #236c7a, #1f2625);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}

.fighter-card.defender {
  background: linear-gradient(135deg, #b8473b, #1f2625);
}

.hp-bar {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0,0,0,.32);
}

.hp-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #f6c343, #7dd3fc);
  transition: width .45s ease;
}

.fight-log {
  max-height: 160px;
  overflow: auto;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.45;
}

.crit-text {
  min-height: 24px;
  color: #b8473b;
  font-weight: 950;
  text-align: center;
  animation: critPop .55s ease-out;
}

.fight-damage-text {
  min-height: 28px;
  text-align: center;
  color: #236c7a;
  font-size: 24px;
  font-weight: 950;
  animation: damageRise .52s ease-out;
}

.fight-round-text {
  text-align: center;
  color: var(--muted);
  font-weight: 900;
}

.fight-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.fight-action {
  min-height: 52px;
  border: 1px solid rgba(35,108,122,.22);
  color: #fff8e7;
  background: linear-gradient(135deg, #236c7a, #1f2625);
}

.fight-action.heavy { background: linear-gradient(135deg, #b8473b, #1f2625); }
.fight-action.guard { background: linear-gradient(135deg, #668f5b, #1f2625); }
.fight-action.dodge { background: linear-gradient(135deg, #7dd3fc, #1f2625); }
.fight-action.special { background: linear-gradient(135deg, #f6c343, #7b4b22); }
.fight-action:disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(.35);
}

.fight-victory {
  display: block;
  text-align: center;
  color: var(--accent-2);
  font-size: 20px;
}

@keyframes critPop {
  0% { transform: scale(.85); opacity: 0; }
  35% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: .9; }
}

@keyframes damageRise {
  0% { opacity: 0; transform: translateY(12px) scale(.9); }
  40% { opacity: 1; transform: translateY(-2px) scale(1.08); }
  100% { opacity: .9; transform: translateY(0) scale(1); }
}

.coords {
  position: absolute;
  pointer-events: none;
  color: rgba(255,255,255,.76);
  font-size: 11px;
  font-weight: 900;
}
.files {
  left: 18px;
  right: 18px;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  text-align: center;
}
.ranks {
  top: 18px;
  bottom: 18px;
  left: 13px;
  display: grid;
  grid-template-rows: repeat(8, 1fr);
  align-items: center;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
  max-width: min(560px, calc(100vw - 28px));
}

dialog::backdrop { background: rgba(31, 38, 37, .35); }

dialog form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

@media (max-width: 860px) {
  .app { padding: 8px; align-items: start; }
  .game-shell { grid-template-columns: 1fr; }
  .sidebar {
    order: 2;
    position: sticky;
    bottom: 0;
    z-index: 5;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 10px;
    max-height: 42vh;
    overflow: auto;
    border-radius: 8px 8px 0 0;
  }
  .status-block, .selected-card, .history-card { padding-bottom: 8px; }
  .message, .ability-panel, .selected-card, .history-card, .actions { grid-column: 1 / -1; }
  .history-card { max-height: 96px; }
  .ability-button, .actions button, button { min-height: 50px; }
  .ability-panel {
    position: sticky;
    bottom: 0;
    background: rgba(255,255,255,.94);
    padding-top: 6px;
  }
  .fight-panel { width: min(94vw, 560px); padding: 18px; }
  .fighters { grid-template-columns: 1fr; }
  .fight-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-wrap { width: min(100%, calc(100vh - 230px)); min-width: 300px; }
  .board { border-width: 6px; }
  .piece { font-size: clamp(30px, 10vw, 58px); }
  .menu-grid { grid-template-columns: 1fr; }
  .variant-cards { grid-template-columns: 1fr; }
}

@keyframes kingFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(16px) rotate(2deg); }
}

@keyframes particleDrift {
  0%, 100% { opacity: .35; transform: translate3d(0,0,0) scale(.8); }
  50% { opacity: 1; transform: translate3d(18px,-24px,0) scale(1.25); }
}

@keyframes abilityGlow {
  0%, 100% { opacity: .25; transform: translateX(-45%); }
  50% { opacity: 1; transform: translateX(45%); }
}

@keyframes evolveGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(246,195,67,0); }
  50% { box-shadow: 0 0 24px rgba(246,195,67,.48); }
}

@keyframes evolutionFlare {
  from { opacity: 0; transform: scale(.2) rotate(0deg); }
  45% { opacity: 1; }
  to { opacity: 0; transform: scale(1.35) rotate(220deg); }
}

@keyframes finalEvolutionGlow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(246,195,67,0)); }
  50% { filter: drop-shadow(0 0 10px rgba(246,195,67,.8)); }
}

@keyframes auraSpin {
  from { transform: rotate(0deg) scale(.95); opacity: .5; }
  50% { transform: rotate(180deg) scale(1.08); opacity: 1; }
  to { transform: rotate(360deg) scale(.95); opacity: .5; }
}

.low-graphics .particle-burst,
.low-graphics .evolution-aura,
.low-graphics .piece.evo-tier-3 {
  animation-duration: .01ms !important;
}

@keyframes dashTrail {
  from { opacity: 0; transform: scaleY(.2); }
  40% { opacity: 1; }
  to { opacity: 0; transform: scaleY(1.2); }
}

@keyframes popRing {
  from { opacity: 1; transform: scale(.35); }
  to { opacity: 0; transform: scale(1.18); }
}

@keyframes teleportBlink {
  from { opacity: 0; transform: rotate(0deg) scale(.3); }
  50% { opacity: 1; }
  to { opacity: 0; transform: rotate(180deg) scale(1.25); }
}

@keyframes crystalLock {
  from { opacity: 0; transform: scale(.45) rotate(0deg); }
  45% { opacity: 1; }
  to { opacity: 0; transform: scale(1.08) rotate(45deg); }
}

@keyframes shieldBloom {
  from { opacity: 0; transform: scale(.2); }
  45% { opacity: 1; }
  to { opacity: 0; transform: scale(1.35); }
}

@keyframes shockwave {
  from { opacity: .95; transform: scale(.2); }
  to { opacity: 0; transform: scale(1.3); }
}

@keyframes blastHit {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

@keyframes damageRise {
  from { opacity: 0; transform: translate(-50%, 10px) scale(.8); }
  30% { opacity: 1; }
  to { opacity: 0; transform: translate(-50%, -24px) scale(1.1); }
}

@keyframes burstOut {
  from { opacity: 1; transform: rotate(var(--a)) translateX(0) scale(1); }
  to { opacity: 0; transform: rotate(var(--a)) translateX(58px) scale(.2); }
}

@keyframes screenShake {
  0%, 100% { transform: translate(0,0); }
  20% { transform: translate(-5px, 3px); }
  40% { transform: translate(4px, -4px); }
  60% { transform: translate(-3px, -2px); }
  80% { transform: translate(3px, 4px); }
}

@keyframes flashFade {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes checkPulse {
  from { box-shadow: inset 0 0 0 0 rgba(157,45,40,.2); }
  to { box-shadow: inset 0 0 0 8px rgba(157,45,40,.76); }
}

@keyframes checkmateScreen {
  from { opacity: 0; letter-spacing: 0; transform: scale(.92); }
  to { opacity: 1; letter-spacing: 0; transform: scale(1); }
}
