:root {
  --ink: #0c1515;
  --panel: #111f20;
  --panel-edge: #3b4c48;
  --gold: #efd399;
  --muted: #aeccc1;
  --jade: #8ce6ba;
  --cyan: #a1f2cb;
}

body {
  background: radial-gradient(ellipse at 50% -12%, #263b34, transparent 55%), #0a1112;
  padding: 18px clamp(10px, 3vw, 34px);
}

.app-shell { max-width: 1300px; gap: 12px; }
.game-header {
  display: grid;
  grid-template-columns: minmax(250px, .86fr) minmax(0, 1.42fr);
  align-items: center;
  gap: 13px 22px;
  padding: clamp(11px, 2vw, 20px);
  border: 1px solid #687253;
  border-radius: 18px;
  background:
    linear-gradient(98deg, #132622bf, #101d22d9 48%, #10191fef 82%),
    url('https://static.wixstatic.com/media/9932ce_737bbb5894c6469da092f208c284d8d1~mv2.png') center 34% / cover,
    #182d29;
  box-shadow: 0 12px 30px #02090a91, inset 0 1px #e9d4a035;
}
.game-title { display: flex; align-items: center; gap: 11px; color: var(--gold); }
.hud-emblem {
  flex: 0 0 51px;
  height: 51px;
  display: grid;
  place-items: center;
  border: 1px solid #ac935c;
  border-radius: 14px;
  background: radial-gradient(ellipse at top, #655439, #23342d 70%);
  box-shadow: 0 5px 15px #040c0b80, inset 0 0 12px #c58a3a34;
}
.game-title h1, .picker-header h1 {
  font: 600 clamp(25px, 3.15vw, 37px)/1.12 Georgia, serif;
  letter-spacing: -.026em;
  color: var(--gold);
}
.game-title h1 { font-size: clamp(25px, 2.6vw, 34px); text-shadow: 0 3px 10px #070e0d; }
.hud-icon {
  --icon-size: 25px;
  flex: 0 0 var(--icon-size);
  display: block;
  width: var(--icon-size);
  height: var(--icon-size);
  background: url('../sprites/hud-icons.png') var(--icon-x, 0%) var(--icon-y, 0%) / 400% 400% no-repeat;
}
.icon-grimoire { --icon-size: 44px; }
.icon-classes { --icon-x: 33.3333%; }
.icon-bag { --icon-x: 66.6667%; }
.icon-shop { --icon-x: 100%; }
.icon-map { --icon-y: 33.3333%; }
.icon-moon { --icon-x: 33.3333%; --icon-y: 33.3333%; }
.icon-reset { --icon-x: 66.6667%; --icon-y: 33.3333%; }
.icon-attack { --icon-y: 66.6667%; }
.icon-defense { --icon-x: 33.3333%; --icon-y: 66.6667%; }
.icon-speed { --icon-x: 66.6667%; --icon-y: 66.6667%; }
.icon-special { --icon-x: 100%; --icon-y: 66.6667%; }
.icon-gold { --icon-y: 100%; }
.icon-gem { --icon-y: 100%; --icon-x: 33.3333%; }
.icon-health { --icon-y: 100%; --icon-x: 66.6667%; }
.icon-experience { --icon-y: 100%; --icon-x: 100%; }
.game-profile {
  display: grid;
  grid-template: "identity meters wallet" auto / minmax(123px, .97fr) minmax(132px, 1.34fr) minmax(104px, .72fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid #53665a;
  border-radius: 12px;
  background: linear-gradient(135deg, #25392ff5, #142128f5 77%);
  box-shadow: 0 5px 15px #05110f7f, inset 0 1px #b4c39c24;
}
.hud-identity { grid-area: identity; display: flex; align-items: center; gap: 8px; min-width: 0; }
.hud-portrait {
  flex: 0 0 52px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #8e8d65;
  border-radius: 13px;
  background: radial-gradient(ellipse at 50% 72%, #516348, #182628 80%);
}
.hud-portrait svg { width: 100%; height: auto; }
.hud-identity-copy { min-width: 0; }
#hud-character-name { display: block; overflow-wrap: anywhere; color: #faecd1; font-size: 15px; line-height: 1.15; }
.hud-identity-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; margin-top: 2px; color: #c5d9d0; font-size: 10px; }
.hud-level { padding: 1px 4px; border-radius: 4px; background: #483e2d; color: #f6d69b; font-weight: 750; white-space: nowrap; }
.hud-meters { grid-area: meters; min-width: 0; display: grid; gap: 5px; }
.hud-meter {
  display: grid;
  grid-template-columns: 17px auto minmax(0, 1fr);
  align-items: center;
  column-gap: 4px;
  font-size: 11px;
  line-height: 1.15;
}
.hud-meter .hud-icon { --icon-size: 19px; grid-row: span 2; }
.hud-meter-label { font-weight: 800; color: var(--meter-label); }
.hud-meter-hp { --meter-label: #ffc0bd; }
.hud-meter-xp { --meter-label: #ffdf9c; }
.hud-meter-value { min-width: 0; text-align: right; color: #f2efe2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hud-meter .mini-bar-track { grid-column: 2 / -1; height: 7px; }
.hud-wallet { grid-area: wallet; display: grid; gap: 4px; min-width: 0; }
.hud-wallet > div {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  column-gap: 4px;
  padding: 3px 6px;
  border: 1px solid color-mix(in srgb, var(--wallet-color), #2b3937 68%);
  border-radius: 7px;
  background: #101b1ed9;
}
.hud-wallet-gold { --wallet-color: #ffdb86; }
.hud-wallet-gems { --wallet-color: #a4e9ff; }
.hud-wallet .hud-icon { --icon-size: 22px; grid-row: span 2; }
.hud-wallet dt { color: #c5d2ca; font-size: 9px; }
.hud-wallet dd { color: var(--wallet-color); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hud-encounter {
  position: absolute;
  z-index: 36;
  inset: 13px auto auto 50%;
  width: min(530px, calc(100% - 475px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  pointer-events: none;
}
.hud-encounter-item {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 3px 6px 3px 4px;
  border: 1px solid #4b6859;
  border-radius: 7px;
  background: #142326;
}
.hud-encounter-icon {
  --icon-size: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
}
.hud-encounter-icon > svg { width: 100%; height: auto; }
.hud-encounter-copy { display: grid; gap: 2px; min-width: 0; line-height: 1.15; }
.hud-encounter-copy > span { color: #b9d9c7; font-size: 10px; }
.hud-encounter-copy > strong { color: #f4ebce; font-size: 11px; overflow-wrap: anywhere; }
.hud-wave-count-mob {
  color: #ffda80;
  font-size: 12px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hud-current-enemy[data-kind="boss"] { border-color: #b38654; background: #3a2b23; }
.hud-current-enemy[data-kind="boss"] .hud-encounter-copy > span { color: #ffda8c; }
.hud-boss-crown {
  width: 24px;
  height: 19px;
  clip-path: polygon(0 23%, 28% 49%, 50% 0, 72% 49%, 100% 23%, 86% 100%, 14% 100%);
  background: linear-gradient(#fff4a6, #ecb856 68%, #966331 69% 78%, #ffd77c 79%);
}
.game-nav {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid #a4b38436;
}
.hud-top-btn {
  border-color: #485b52;
  background: linear-gradient(#23332f, #162420);
  color: #f0f6ed;
  border-radius: 8px;
  padding: 8px 13px;
  min-height: 34px;
  font-size: 12px;
  font-weight: 650;
}
.hud-top-btn:hover, .hud-top-btn[aria-pressed="true"] {
  border-color: #d1ac68;
  color: #fae5b3;
  background: #353423;
  box-shadow: 0 4px 15px #0006;
}
.hud-top-btn:active { transform: translateY(1px); }
.hud-top-btn[data-hud-unread] { position: relative; }
.hud-top-btn[data-hud-unread]::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffd881;
  box-shadow: 0 0 5px #ffd881b0;
}
.game-nav .nav-map { --nav-color: #e3ecab; --nav-bg: #3d4727; }
.combat-menu .nav-classes { --nav-color: #d8b6ff; --nav-bg: #3d2855; }
.combat-menu .nav-inventory { --nav-color: #a0ebbc; --nav-bg: #1f4b37; }
.combat-menu .nav-skills { --nav-color: #f6d696; --nav-bg: #51412c; }
.game-nav .nav-shop { --nav-color: #ffdb8e; --nav-bg: #563c22; }
.game-nav .nav-market { --nav-color: #ffc0e5; --nav-bg: #582d4b; }
.game-nav .nav-market img { display: block; width: 86%; height: 86%; object-fit: contain; image-rendering: pixelated; }
.game-nav .nav-snooze { --nav-color: #add7ff; --nav-bg: #233e65; }
.game-nav .nav-reset { --nav-color: #ffb6af; --nav-bg: #512d30; }
:is(.game-nav, .combat-menu) .hud-top-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  min-width: 0;
  padding: 5px 7px;
  border-color: color-mix(in srgb, var(--nav-color) 42%, var(--nav-bg));
  background: linear-gradient(160deg, var(--nav-bg), #141a22);
  color: var(--nav-color);
}
:is(.game-nav, .combat-menu) .hud-top-btn:hover,
:is(.game-nav, .combat-menu) .hud-top-btn[aria-pressed="true"] {
  border-color: var(--nav-color);
  background: linear-gradient(160deg, color-mix(in srgb, var(--nav-bg), var(--nav-color) 18%), #171c25);
}
:is(.game-nav, .combat-menu) .hud-top-btn:focus-visible {
  outline: 2px solid var(--nav-color);
  outline-offset: 2px;
}
:is(.game-nav, .combat-menu) .nav-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid color-mix(in srgb, var(--nav-color) 23%, #12191b);
  border-radius: 7px;
  background: color-mix(in srgb, var(--nav-color) 13%, #10151b);
}
.game-nav .nav-snooze[aria-pressed="true"] .nav-icon {
  box-shadow: 0 0 8px #8cc9ff8c, inset 0 0 0 1px #bcddffb3;
}
.combat-menu { display: flex; justify-content: center; gap: 5px; margin-bottom: 5px; }
.combat-menu .hud-top-btn {
  min-height: 34px;
  padding: 3px 8px;
  gap: 4px;
  font-size: 11px;
  pointer-events: auto;
}
.combat-menu .nav-icon { width: 23px; height: 23px; }
.combat-menu .hud-icon { --icon-size: 20px; }

#skill-points-dialog {
  width: min(570px, calc(100% - 24px));
  overflow-y: auto;
  border-color: #938261;
  background: radial-gradient(ellipse at 0 0, #3b4d3a, transparent 70%), #131f23;
}
.skill-points-content { padding: clamp(12px, 2vw, 21px); }
.skill-points-content h2 { display: flex; align-items: center; gap: 6px; }
.skill-points-content h2 .hud-icon { --icon-size: 31px; }
.skill-points-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-points-summary > * {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid #66765e;
  border-radius: 7px;
  background: #182a28;
  color: #e2ecd9;
  font-size: 11px;
}
.skill-points-summary strong { color: #ffe0a3; font-variant-numeric: tabular-nums; }
.skill-points-summary .hud-icon { --icon-size: 18px; }
.skill-points-cost, .skill-points-low-gold { margin-top: 8px; color: #d7e2d4; font-size: 12px; }
.skill-points-low-gold { display: none; color: #ff9abb; }
.skill-points-insufficient .skill-points-low-gold { display: block; }
.skill-point-list { display: grid; gap: 6px; padding: 0; margin: 9px 0 0; list-style: none; }
.skill-point-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid #4d675b;
  border-radius: 8px;
  background: linear-gradient(130deg, #293c34, #17262a 82%);
  color: #f9ebd1;
}
.skill-point-icon {
  --stat-color: #a4e1c0;
  display: grid;
  place-items: center;
  min-height: 31px;
  border: 1px solid #63775f;
  border-radius: 6px;
  background: #1c312d;
}
.skill-point-copy, .skill-point-assigned { display: grid; min-width: 0; gap: 2px; }
.skill-point-copy { font: 700 14px/1.12 Georgia, serif; overflow-wrap: anywhere; }
.skill-point-copy small, .skill-point-assigned small { color: #c7ddd0; font: 10px/1.1 system-ui, sans-serif; }
.skill-point-stepper {
  display: grid;
  grid-template-columns: 33px minmax(43px, auto) 33px;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid #64745e;
  border-radius: 7px;
  background: #132422;
  text-align: center;
}
.skill-point-assigned strong { color: #f9daa2; font: 700 14px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.skill-point-stepper button { display: grid; place-items: center; min-height: 32px; padding: 3px; }
.skill-point-stepper button:disabled { opacity: .45; cursor: default; }
.skill-point-plus { color: #abe7b7; }
.skill-point-minus { color: #ffb7a0; }
.skill-point-symbol { position: relative; width: 14px; height: 14px; }
.skill-point-symbol::before, .skill-point-plus .skill-point-symbol::after {
  content: ""; position: absolute; inset: 6px 0; border-radius: 2px; background: currentColor;
}
.skill-point-plus .skill-point-symbol::after { transform: rotate(90deg); }
#skill-points-feedback:empty { display: none; }
.skill-point-confirmation {
  width: min(385px, calc(100% - 28px));
  border-color: #a2885a;
}
.skill-point-confirmation::backdrop { background: #080e1082; backdrop-filter: none; }
.skill-point-confirmation h2 { color: #f4d7a1; font: 700 22px/1.15 Georgia, serif; }
.skill-point-confirmation p { margin-block: 9px 14px; color: #e3ecdf; font-size: 14px; line-height: 1.4; }
.skill-point-confirm-actions { display: flex; justify-content: flex-end; gap: 7px; }
.skill-point-confirm-actions button { min-width: 66px; min-height: 37px; }
.skill-point-confirm-yes { border-color: #85aa80; background: #375b43; }
@media (max-width: 420px) {
  .skill-point-row { grid-template-columns: 28px minmax(0, 1fr) auto; padding-inline: 4px; gap: 4px; }
  .skill-point-stepper { grid-template-columns: 29px minmax(35px, auto) 29px; }
  .skill-point-copy { font-size: 12px; }
}

.battle-arena {
  height: clamp(510px, 64vh, 655px);
  border: 1px solid #526849;
  border-radius: 17px;
  overflow: hidden;
  isolation: isolate;
  background-color: #31533b;
  background-image:
    radial-gradient(ellipse at 48% 43%, #a8d36c38, transparent 54%),
    radial-gradient(ellipse at 87% 85%, #0d241b99, transparent 62%),
    radial-gradient(ellipse at 5% 4%, #c2dd6c24, transparent 40%),
    repeating-linear-gradient(27deg, #d3e8800a 0 2px, transparent 2px 9px),
    repeating-linear-gradient(90deg, #0a211728 0 1px, transparent 1px 46px),
    repeating-linear-gradient(0deg, #0a211728 0 1px, transparent 1px 46px);
  background-size: auto;
  box-shadow: 0 22px 44px #0008, inset 0 0 100px #050f09a6;
  --skill: #ff686b;
}
.battle-arena[data-class="wolf"] { --skill: #6cc9ff; }
.battle-arena:is([data-class="dog"], [data-class="rabbit"]) { --skill: #ffe36a; }
.battle-arena.biome-rock { background-color: #505759; border-color: #697170; }
.battle-arena.biome-inferno { background-color: #66352e; border-color: #965d44; }
.battle-arena.biome-sanctuary { background-color: #385a5b; border-color: #65918c; }
.battle-arena.boss-mode { border-color: #bc6750; box-shadow: 0 0 38px #94342266, inset 0 0 90px #180909; }
.battle-arena.arena-shake { animation: none; }
.arena-shake #entities-layer { animation: arenaMicroShake .22s ease-out; }
.arena-motes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background-image: radial-gradient(circle, #d4f196b0 0 1px, transparent 2px), radial-gradient(circle, #a4ffc680 0 1px, transparent 2px);
  background-size: 151px 119px, 213px 147px;
  opacity: .32;
  animation: motes-drift 18s linear infinite;
}
.boss-mode .arena-motes { filter: hue-rotate(290deg); }
@keyframes motes-drift { to { background-position: 151px -119px, -213px -147px; } }
.arena-shortcuts {
  position: absolute;
  z-index: 36;
  inset: 13px 13px auto auto;
  display: grid;
  gap: 6px;
  width: min(220px, 42%);
}
.arena-shortcut {
  --shortcut-accent: #b9cfad;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 4px 8px 4px 5px;
  border: 1px solid color-mix(in srgb, var(--shortcut-accent) 53%, #26352e);
  border-radius: 9px;
  background: linear-gradient(125deg, #283a31fa, #152026fa 85%);
  box-shadow: 0 5px 13px #080e0ad0, inset 0 1px #ecf1cc20;
  color: #edf5eb;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.arena-shortcut:hover:not(:disabled), .arena-shortcut:focus-visible { border-color: var(--shortcut-accent); }
.arena-shortcut:focus-visible { outline: 2px solid var(--shortcut-accent); outline-offset: 2px; }
.arena-shortcut:disabled { cursor: default; border-color: #6f7b6b; }
.arena-shortcut-copy { display: grid; gap: 3px; min-width: 0; }
.arena-shortcut-copy strong { font-size: 12px; line-height: 1.1; }
.arena-shortcut-copy span { color: var(--shortcut-accent); font-size: 10px; line-height: 1.15; }
.arena-shortcut-boss { --shortcut-accent: #f4d198; grid-template-columns: 38px minmax(0, 1fr); }
.arena-shortcut-boss:disabled { --shortcut-accent: #bcc9bf; }
.arena-shortcut-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 37px;
  border: 1px solid color-mix(in srgb, var(--shortcut-accent) 41%, #273831);
  border-radius: 7px;
  background: radial-gradient(ellipse at top, color-mix(in srgb, var(--shortcut-accent) 27%, #223530), #172428 84%);
}
.arena-shortcut-icon > svg { width: 100%; height: auto; }
.arena-shortcut:disabled .arena-shortcut-icon { filter: saturate(.45); }
.arena-shortcut-advance { --shortcut-accent: #f2cd86; }
.arena-shortcut-advance[aria-pressed="true"] { --shortcut-accent: #a3e6af; }
.arena-advance-symbol { position: relative; width: 21px; height: 14px; }
.arena-advance-symbol::before, .arena-advance-symbol::after {
  content: "";
  position: absolute;
  top: 2px;
  width: 10px;
  height: 10px;
  border-top: 3px solid var(--shortcut-accent);
  border-right: 3px solid var(--shortcut-accent);
  transform: rotate(45deg);
}
.arena-advance-symbol::before { left: 0; }
.arena-advance-symbol::after { left: 7px; }
.arena-toggle {
  display: flex;
  align-items: center;
  width: 25px;
  height: 14px;
  padding: 2px;
  border: 1px solid #a68f62;
  border-radius: 10px;
  background: #2b2c24;
}
.arena-toggle::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--shortcut-accent);
  transition: transform .18s ease;
}
.arena-shortcut-advance[aria-pressed="true"] .arena-toggle { border-color: #77b889; background: #254f3e; }
.arena-shortcut-advance[aria-pressed="true"] .arena-toggle::after { transform: translateX(11px); }
@media (prefers-reduced-motion: reduce) {
  .arena-toggle::after { transition: none; }
}

.hud-bottom-bar, .pet-stats-strip {
  background: linear-gradient(145deg, #1a2926f5, #0d1718f8);
  border: 1px solid #61715d;
  border-radius: 11px;
  box-shadow: 0 8px 20px #0007, inset 0 1px #c9e2ae15;
}
.mini-bar-track { height: 6px; background: #070e0f; border-color: #48594e; }
.mini-bar-fill { border-radius: inherit; }
.fill-hp { background: linear-gradient(90deg, #b63b4e, #f6847e); }
.fill-xp { background: linear-gradient(90deg, #c58d4a, #ffdb91); }
#bar-special { background: linear-gradient(90deg, #536982, var(--skill)); }
.boss-banner { top: 62px; border-color: #b88a68; color: #ffe2b7; background: #542b26; }

.hud-bottom-bar { padding: 9px 11px; flex-wrap: nowrap; justify-content: space-between; border-color: #8a805c; }
.arena-combat-dock {
  position: absolute;
  inset: auto 12px 12px;
  z-index: 35;
  display: grid;
  grid-template: "supplies runes skills report" / minmax(137px, 1fr) 64px minmax(235px, 630px) minmax(140px, 1fr);
  align-items: end;
  column-gap: 8px;
  pointer-events: none;
}
.arena-combat-dock .hud-bottom-bar { grid-area: skills; }
.arena-consumables {
  grid-area: supplies;
  justify-self: start;
  width: min(220px, 100%);
  min-width: 0;
  padding: 7px;
  border: 1px solid #798263;
  border-radius: 10px;
  background: linear-gradient(155deg, #1c302af7, #111e22f7);
  box-shadow: 0 8px 18px #0008;
}
.arena-consumables h2 { margin: 0 0 4px 2px; color: #f4d9a4; font: 700 15px/1.1 Georgia, serif; }
.arena-consumables ul { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.arena-consumables li {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 2px 4px;
  border: 1px solid #5372666b;
  border-radius: 5px;
  background: #26383382;
}
.arena-consumables .item-art { --item-size: 22px; }
.arena-stock-copy { display: grid; min-width: 0; line-height: 1.13; }
.arena-stock-copy strong { color: #f5f1df; font-size: 10px; overflow-wrap: anywhere; }
.arena-stock-copy small { color: #a9ecae; font-size: 9px; }
.arena-consumables li.arena-stock-consumable { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.arena-stock-switch {
  min-width: 28px;
  min-height: 25px;
  padding: 2px 3px;
  border: 1px solid #6c857c;
  border-radius: 6px;
  background: #202a2a;
  color: #e1eae5;
  font: 800 10px/1 system-ui, sans-serif;
  cursor: pointer;
  pointer-events: auto;
}
.arena-stock-switch[aria-checked="true"] { background: #244839; color: #b7ffbf; border-color: #86bb91; }
.arena-stock-switch:focus-visible, .arena-rune-tile:focus-visible { outline: 2px solid #ffd886; outline-offset: 1px; }
.arena-stock-count { color: #ffda98; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.arena-rune-tray {
  grid-area: runes;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border: 1px solid #665b72;
  border-radius: 8px;
  background: #161e21e8;
}
.arena-rune-tile {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 26px;
  padding: 0;
  border: 1px solid #555360;
  border-radius: 6px;
  background: linear-gradient(145deg, #2b2d36, #181f25);
  opacity: .58;
  filter: saturate(.5);
  cursor: help;
  pointer-events: auto;
}
.arena-rune-tile:hover { border-color: #b09cc4; }
.arena-rune-tile[data-rune-state="equipped"] {
  border-color: var(--rune-tone);
  background: radial-gradient(circle, color-mix(in srgb, var(--rune-tone) 26%, #222531), #191f28 78%);
  box-shadow: 0 0 7px color-mix(in srgb, var(--rune-tone) 70%, transparent);
  opacity: 1;
  filter: none;
}
.arena-rune-glyph {
  width: 15px;
  height: 15px;
  background: linear-gradient(160deg, #fff, var(--rune-tone) 39%, color-mix(in srgb, var(--rune-tone) 65%, #131928));
  clip-path: var(--rune-shape);
}
.glyph-fire { --rune-shape: polygon(53% 0, 73% 32%, 62% 46%, 87% 29%, 97% 69%, 78% 96%, 24% 98%, 4% 71%, 29% 38%, 31% 58%); }
.glyph-water { --rune-shape: polygon(50% 0, 90% 58%, 94% 77%, 77% 94%, 50% 100%, 22% 94%, 6% 78%, 11% 58%); }
.glyph-ice { --rune-shape: polygon(50% 0, 59% 33%, 90% 16%, 72% 44%, 100% 50%, 72% 58%, 91% 84%, 59% 70%, 50% 100%, 42% 69%, 11% 87%, 28% 58%, 0 50%, 28% 42%, 10% 16%, 41% 33%); }
.glyph-earth { --rune-shape: polygon(0 81%, 36% 18%, 52% 45%, 67% 26%, 100% 81%, 88% 94%, 12% 94%); }
.glyph-wind .arena-rune-glyph { background: repeating-linear-gradient(170deg, transparent 0 3px, var(--rune-tone) 3px 5px); border-radius: 42%; }
.glyph-shadow .arena-rune-glyph {
  border-radius: 50%;
  background: radial-gradient(circle at 72% 27%, transparent 43%, var(--rune-tone) 46%);
}
.glyph-nature { --rune-shape: polygon(5% 94%, 39% 54%, 15% 67%, 18% 29%, 38% 10%, 95% 5%, 91% 59%, 73% 80%, 40% 75%, 15% 100%); }
.glyph-crystal { --rune-shape: polygon(49% 0, 93% 43%, 71% 78%, 50% 100%, 26% 79%, 7% 43%); }
.arena-rune-tooltip {
  position: fixed;
  z-index: 999;
  width: min(248px, calc(100vw - 16px));
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--rune-tone) 62%, #2a303b);
  border-radius: 8px;
  background: #182128;
  color: #f0f5ee;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 5px 18px #000b;
  pointer-events: none;
}
.arena-rune-tooltip strong { color: var(--rune-tone); }
.arena-rune-tooltip p { margin: 4px 0; }
.arena-rune-tooltip small { color: #c6d5ce; }
.arena-buff-report { margin-top: 5px; padding-top: 4px; border-top: 1px solid #606052; }
.arena-buff-report h3 { margin: 0 0 3px; color: #e9cf9a; font-size: 11px; font-weight: 750; }
.arena-active-buffs {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  max-height: 103px;
  overflow: auto;
  scrollbar-width: thin;
  list-style: none;
  color: #e1efda;
  font-size: 10px;
}
.arena-active-buffs li { display: flex; align-items: center; gap: 4px; min-width: 0; padding: 2px 4px; border-radius: 4px; background: #253b32; }
.arena-active-buffs li > span:last-child { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; color: #ffdaa6; }
.arena-active-buffs :is(.rune-art, img, .arena-buff-symbol) { flex: 0 0 18px; width: 18px; height: 18px; }
.arena-active-buffs .item-art { --item-size: 18px; --rune-icon-size: 17px; }
.arena-buff-symbol .legendary-symbol { transform: scale(.56); transform-origin: top left; }
.arena-combat-report {
  grid-area: report;
  justify-self: end;
  width: min(220px, 100%);
  min-width: 0;
  padding: 7px;
  border: 1px solid #847b59;
  border-radius: 10px;
  background: linear-gradient(155deg, #26332bf9, #111e22f7);
  box-shadow: 0 8px 18px #0008;
  pointer-events: auto;
}
.arena-combat-report h2 { margin: 0 0 4px; color: #f4d9a4; font: 700 14px/1.1 Georgia, serif; }
.combat-xp-lines { display: grid; gap: 2px; color: #fff; font-size: 10px; }
.combat-xp-lines > span { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 4px; }
.combat-xp-extra { color: #ffd66e; }
.combat-gear-report {
  max-height: 75px;
  margin-top: 4px;
  padding-top: 3px;
  border-top: 1px solid #566659;
  overflow: auto;
  scrollbar-width: thin;
  color: #d5e6da;
  font-size: 10px;
}
.combat-gear-report dl > div { display: flex; justify-content: space-between; gap: 3px; }
.combat-gear-report dd { margin: 0; color: #a9edaf; white-space: nowrap; }
.combat-miss-fx { color: #d0d3d4; text-shadow: 0 2px 3px #15191a, 0 0 5px #181b1c; }
.entity.is-rare .rpg-name-mob { color: #ffe18a; }
.entity.is-rare .sprite-wrap { filter: drop-shadow(0 2px 3px #231b10) drop-shadow(0 0 8px #e6a743b3); }
.combat-projectile.projectile-banana {
  width: 24px;
  height: 15px;
  border: 1px solid transparent;
  border-bottom: 6px solid #ffdc57;
  border-radius: 0 0 65% 75%;
  filter: drop-shadow(0 1px 1px #6d3a13) drop-shadow(0 0 4px #f7ae30);
}
.stat-accuracy { --stat-color: #a4e1c0; }
.accuracy-sigil {
  width: 22px; height: 22px; border: 2px solid var(--stat-color); border-radius: 50%;
  background: radial-gradient(circle, var(--stat-color) 0 21%, transparent 25%),
    linear-gradient(var(--stat-color), var(--stat-color)) center / 2px 100% no-repeat,
    linear-gradient(90deg, var(--stat-color), var(--stat-color)) center / 100% 2px no-repeat;
}
@media (max-width: 750px) {
  .battle-arena { height: clamp(690px, 90vh, 790px); }
  .arena-combat-dock {
    inset: auto 8px 8px;
    grid-template: "supplies report" "runes runes" "skills skills" / minmax(0, 1fr) minmax(0, 1fr);
    row-gap: 5px;
  }
  .arena-rune-tray { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; }
  .arena-consumables, .arena-combat-report { width: min(230px, 100%); padding: 5px; }
  .arena-consumables li { min-height: 22px; padding: 0 3px; }
  .arena-consumables li.arena-stock-consumable { column-gap: 2px; }
  .arena-stock-switch { min-width: 24px; padding-inline: 2px; font-size: 9px; }
  .arena-consumables .item-art { --item-size: 19px; }
  .combat-gear-report { max-height: 50px; }
  .arena-consumables h2 { font-size: 13px; }
}
.combat-status { flex: 1; min-width: 0; }
.special-label { display: flex; justify-content: space-between; color: var(--skill); font-size: 11px; font-weight: 750; margin-bottom: 4px; }
.combat-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 7px;
}
.hotbar-label { max-width: none; padding-inline: 3px; color: #c4dbce; font-size: 11px; line-height: 1.2; }
.skill-notices:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px 8px;
  margin-left: auto;
  padding-inline: 3px;
  color: #ffd493;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  text-align: right;
}
.pet-stats-strip { padding: 8px; gap: 7px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 640px) {
  .pet-stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stat-box {
  min-width: 0;
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 9px;
  padding: 8px;
  text-align: left;
  border-color: color-mix(in srgb, var(--stat-color) 32%, #263631);
  background: linear-gradient(120deg, color-mix(in srgb, var(--stat-color) 12%, #172522), #132024 87%);
}
.stat-box:hover { transform: none; border-color: color-mix(in srgb, var(--stat-color) 60%, #263631); }
.stat-attack { --stat-color: #ffad9e; }
.stat-defense { --stat-color: #a1dcff; }
.stat-speed { --stat-color: #ffe39a; }
.stat-special { --stat-color: #eac4ff; }
.stat-emblem {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 45px;
  height: 43px;
  border: 1px solid color-mix(in srgb, var(--stat-color) 35%, #273433);
  border-radius: 9px;
  background: radial-gradient(ellipse at top, color-mix(in srgb, var(--stat-color) 22%, #253434), #17282a 83%);
}
.stat-emblem .hud-icon { --icon-size: 41px; }
.stat-box-label { color: #c8dad2; font-size: 11px; line-height: 1.15; }
.stat-box-val {
  margin: 1px 0 0;
  color: var(--stat-color);
  font: 700 clamp(16px, 2.7vw, 24px)/1.1 Georgia, serif;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

#entities-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.entity { left: 0; top: 0; --direction: 1; }
.entity.facing-left { --direction: -1; }
.entity .sprite-wrap { transform-origin: 50% 88%; }
.entity .sprite-svg { transform-origin: 50% 87%; }
.entity.entity:not(.is-walking):not(.is-casting):not(.mob-dead):not(.player-defeated) .sprite-svg {
  animation: sprite-breathe 1.55s var(--idle-delay, 0s) ease-in-out infinite;
}
.entity.entity.is-walking:not(.is-casting):not(.mob-dead):not(.player-defeated) .sprite-svg {
  animation: sprite-stride .34s var(--idle-delay, 0s) ease-in-out infinite;
}
.entity.entity.is-boss:not(.is-walking):not(.mob-dead) .sprite-svg { animation-duration: 2.25s; }
.entity.entity.mob-dead .sprite-svg { animation: none; transform: scaleX(var(--direction)); }
.entity.mob-dead .sprite-wrap { transform: translateY(8px) rotate(29deg) scale(.8); opacity: .1; transition: transform .38s ease-in, opacity .38s ease; }
.entity.mob-dead .rpg-overhead { opacity: 0; transition: opacity .2s ease; }

.entity.player-defeated .sprite-wrap {
  transform: none;
  filter: none;
  opacity: 0;
  transition: none;
  animation: player-defeat-blink .52s steps(1, end) both;
}
.entity.player-defeated .rpg-overhead { visibility: hidden; }
@keyframes player-defeat-blink {
  0%, 38%, 76% { opacity: 1; }
  19%, 57%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .entity.player-defeated .sprite-wrap { animation: none; }
}

.entity.is-casting .sprite-wrap { filter: drop-shadow(0 0 12px var(--skill)); }
.combat-paused .entity .sprite-svg { animation-play-state: paused !important; }
@keyframes sprite-breathe {
  0%, 100% { transform: scaleX(var(--direction)) scaleY(.98); }
  50% { transform: scaleX(var(--direction)) translateY(-3px) scaleY(1.045); }
}
@keyframes sprite-stride {
  0%, 100% { transform: scaleX(var(--direction)) rotate(-4deg) scale(1.04, .95); }
  50% { transform: scaleX(var(--direction)) translateY(-6px) rotate(4deg) scale(.97, 1.04); }
}
.target-tile-ring {
  bottom: 0;
  height: 20px;
  width: 54px;
  border-radius: 50%;
  border-color: #ffd39b;
  background: #f7a84929;
  box-shadow: 0 0 9px #e9a547a6;
  transition: opacity .16s ease;
}
.is-boss .target-tile-ring { width: 106px; height: 28px; }
.rpg-hp-bar { border-radius: 6px; }
.arena-announcement {
  position: absolute;
  left: 50%;
  top: 67px;
  max-width: calc(100% - 26px);
  width: max-content;
  z-index: 32;
  padding: 6px 20px;
  border-block: 1px solid #a78652;
  background: linear-gradient(90deg, transparent, #111a18f5 14% 86%, transparent);
  color: var(--gold);
  font: 600 clamp(17px, 3.4vw, 26px)/1.3 Georgia, serif;
  text-align: center;
  opacity: 0;
  pointer-events: none;
}
.boss-mode .arena-announcement { top: 100px; }
.defeat-banner {
  position: absolute;
  z-index: 42;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(390px, calc(100% - 34px));
  padding: 14px 13px;
  border: 1px solid #e8756c;
  border-radius: 12px;
  background: radial-gradient(ellipse at top, #642a2ae8, #24191cf7 77%);
  box-shadow: 0 12px 38px #12080baf, 0 0 20px #e04e4552;
  text-align: center;
  pointer-events: none;
}
.defeat-banner strong {
  display: block;
  color: #ff8e83;
  font: 800 clamp(30px, 5.5vw, 47px)/1.1 Georgia, serif;
  text-shadow: 0 2px 4px #300f14, 0 0 18px #fb6d5890;
}
.defeat-banner span {
  display: block;
  margin-top: 6px;
  color: #fff0dd;
  font-size: clamp(12px, 2.6vw, 15px);
  font-weight: 700;
}
.arena-curtain {
  position: absolute;
  inset: 0;
  z-index: 43;
  overflow: hidden;
  pointer-events: none;
}
.arena-curtain::before, .arena-curtain::after {
  content: "";
  position: absolute;
  inset-block: 0;
  width: calc(50% + 1px);
  background: #000;
  transform: translateX(var(--curtain-rest));
}
.arena-curtain::before { left: 0; --curtain-rest: -100%; }
.arena-curtain::after { right: 0; --curtain-rest: 100%; }
.arena-curtain[data-phase="closing"]::before, .arena-curtain[data-phase="closing"]::after {
  transform: translateX(0);
  transition: transform .78s cubic-bezier(.52, 0, .34, 1);
}
.arena-curtain[data-phase="opening"]::before, .arena-curtain[data-phase="opening"]::after {
  transition: transform .68s cubic-bezier(.32, 0, .48, 1);
}
@media (prefers-reduced-motion: reduce) {
  .arena-curtain::before, .arena-curtain::after { transition: none !important; }
}
@media (prefers-reduced-motion: no-preference) {
  .defeat-banner:not([hidden]) { animation: defeat-notice-in .2s ease-out both; }
  @keyframes defeat-notice-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.94); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }
}
.cast-pulse-fx, .defeat-fx, .impact-sparks-fx { position: absolute; z-index: 76; pointer-events: none; }
.stage-teleport-charge, .stage-teleport-arrival {
  position: absolute;
  z-index: 4;
  width: 106px;
  height: 40px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  border: 1px solid #84e4ef;
  background: radial-gradient(ellipse, #dafaff91 0%, #54bfe54d 40%, transparent 73%);
  box-shadow: 0 0 10px #6adceb, inset 0 0 12px #82e9f6;
}
.stage-teleport-charge::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: conic-gradient(from -90deg, #e3ffff 0 var(--teleport-fill), transparent var(--teleport-fill));
  mask: radial-gradient(ellipse, transparent 60%, #000 64%, #000 69%, transparent 73%);
  animation: stage-teleport-fill var(--teleport-duration) linear both;
}
@property --teleport-fill {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
@keyframes stage-teleport-fill { to { --teleport-fill: 360deg; } }
.stage-teleport-arrival { animation: stage-teleport-arrival 420ms ease-out both; }
@keyframes stage-teleport-arrival {
  from { opacity: .8; transform: translate(-50%, -50%) scale(.68); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1.35); }
}
@media (prefers-reduced-motion: reduce) {
  .stage-teleport-charge::before, .stage-teleport-arrival { animation: none; }
}

.rune-impact-fx {
  position: absolute;
  z-index: 75;
  width: 16px;
  height: 16px;
  border: 1px solid var(--rune-tone);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: inset 0 0 4px var(--rune-tone), 0 0 4px var(--rune-tone);
  animation: rune-impact .48s ease-out both;
}
.rune-status-fx { z-index: 79; color: var(--rune-tone); font-size: 11px; text-shadow: 0 1px 3px #0b1016; }
.float-dmg.rune-damage-fx {
  z-index: 80;
  color: #ffcf59;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px #251502, 0 0 4px #6b430e;
}
.rune-impact-fire {
  width: 9px;
  height: 13px;
  border: 0;
  background: linear-gradient(#fff6a9, #ff9b36 52%, #ed391a);
  clip-path: polygon(52% 0, 61% 39%, 100% 49%, 67% 63%, 51% 100%, 40% 64%, 0 51%, 40% 40%);
}
.rune-impact-water {
  border: 1px solid #a2deff;
  border-radius: 38% 42% 55% 55%;
  background: radial-gradient(ellipse at 40% 25%, #dbf7ff, #347ece88 38%, transparent 66%);
}
.rune-impact-ice {
  border-radius: 0;
  background: conic-gradient(from 20deg, #defbff, #438fae55, #a4eaff, #438fae55, #defbff);
  clip-path: polygon(50% 0, 59% 34%, 93% 13%, 70% 47%, 100% 64%, 64% 64%, 50% 100%, 39% 66%, 7% 78%, 29% 51%, 7% 24%, 40% 39%);
}
.rune-impact-earth {
  border: 0;
  background: repeating-linear-gradient(138deg, #b28361 0 7px, #764c39 8px 13px, #eed4a0 14px);
  clip-path: polygon(50% 0, 90% 18%, 85% 73%, 50% 100%, 15% 73%, 10% 18%);
}
.rune-impact-wind {
  width: 22px;
  border: 1px solid transparent;
  border-top-color: #d9fff3;
  border-bottom-color: #71dfc1;
  box-shadow: none;
}
.rune-impact-shadow {
  border: 0;
  background: linear-gradient(135deg, #e5baff, #6e41b4 56%, #200d38);
  clip-path: polygon(9% 96%, 37% 48%, 50% 48%, 79% 4%, 73% 54%, 58% 62%, 45% 99%, 47% 71%);
}
.rune-impact-nature {
  border: 0;
  border-radius: 72% 20% 72% 20%;
  background:
    radial-gradient(circle at 34% 62%, #c6ff8a 0 12%, transparent 16%),
    radial-gradient(circle at 65% 30%, #f0ffab 0 9%, transparent 13%),
    linear-gradient(140deg, #bce472, #52894e 66%, #315338);
}
.rune-impact-crystal {
  border: 0;
  background: conic-gradient(from 43deg at 50% 50%, #fff3ff, #c06aae, #fed8e9, #824987, #fff3ff);
  clip-path: polygon(50% 0, 94% 43%, 50% 100%, 6% 43%);
}
.rune-mob-overlay {
  position: absolute;
  z-index: 2;
  left: 53%;
  bottom: 34%;
  width: 10px;
  height: 14px;
  pointer-events: none;
}
.entity.mob-burning .rune-mob-overlay {
  background:
    radial-gradient(circle at 70% 20%, #ffd175 0 10%, transparent 18%),
    radial-gradient(ellipse at 38% 68%, #fff4a8 0 19%, #fb8a33 31%, #ed4b2666 47%, transparent 60%);
  transform-origin: center bottom;
  animation: rune-flame-flicker .3s ease-in-out infinite alternate;
}
.entity.mob-poisoned .rune-mob-overlay {
  background:
    radial-gradient(circle at 18% 67%, #ccff73 0 5%, #5fc47869 8%, transparent 16%),
    radial-gradient(circle at 53% 91%, #7ad95c 0 7%, transparent 14%),
    radial-gradient(circle at 81% 42%, #a5e841 0 6%, transparent 14%);
}
@keyframes rune-flame-flicker {
  from { transform: translateY(2px) scale(.7); opacity: .58; }
  to { transform: translateY(-2px) scale(1); opacity: 1; }
}
@keyframes rune-impact {
  from { opacity: .9; transform: translate(-50%, -50%) scale(.45); }
  to { opacity: 0; transform: translate(-50%, -65%) scale(1.23); }
}
@media (prefers-reduced-motion: reduce) {
  .rune-impact-fx { animation: none; transform: translate(-50%, -50%); }
  .entity.mob-burning .rune-mob-overlay { animation: none; }
}
.cast-pulse-fx, .defeat-fx {
  width: 86px;
  height: 37px;
  background: radial-gradient(ellipse, transparent 42%, color-mix(in srgb, var(--skill) 70%, transparent) 67%, transparent 73%);
  animation: ground-pulse .39s ease-out both;
}
.defeat-fx { --skill: #ffe09b; animation-duration: .44s; }
.impact-sparks-fx { width: 80px; height: 32px; animation: impact-flare .36s ease-out both; }
.impact-sparks-fx::before, .impact-sparks-fx::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 13%, var(--skill) 50%, transparent 88%) center/100% 3px no-repeat;
  transform: rotate(24deg);
}
.impact-sparks-fx::after { transform: rotate(-31deg) scale(.76); }
.tibia-wave-cone {
  background: radial-gradient(ellipse at 25% 50%, #fff9e5 0, var(--skill) 33%, transparent 72%);
  filter: drop-shadow(0 0 10px var(--skill));
  clip-path: polygon(0 43%, 92% 9%, 100% 50%, 92% 91%, 0 57%);
}
.tibia-wave-tile, .tibia-area-tile {
  width: 18px;
  height: 18px;
  border: 1px solid color-mix(in srgb, var(--skill) 58%, transparent);
  border-radius: 50%;
  background: radial-gradient(circle, var(--skill), transparent 69%);
}
.tibia-area-ring {
  border-color: var(--skill);
  background: radial-gradient(ellipse, transparent 45%, color-mix(in srgb, var(--skill) 48%, transparent) 60%, transparent 73%);
  box-shadow: 0 0 22px color-mix(in srgb, var(--skill) 45%, transparent);
}
.pet-aura-explosion-fx { background: radial-gradient(circle, #fff1c9a6, color-mix(in srgb, var(--skill) 40%, transparent) 40%, transparent 68%); }
@keyframes ground-pulse {
  from { transform: translate(-50%, -50%) scale(.34); opacity: .95; }
  to { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}
@keyframes impact-flare {
  from { transform: translate(-50%, -50%) rotate(var(--aim)) scale(.34); opacity: 1; }
  to { transform: translate(-38%, -50%) rotate(var(--aim)) scale(1.12); opacity: 0; }
}

.picker-box, .shop-dialog { border-color: #66775e; background: linear-gradient(150deg, #22342d, #101a1c 57%); animation: panel-enter .24s ease-out both; }
.shop-dialog {
  margin: auto;
  width: min(100% - 26px, 500px);
  max-height: calc(100dvh - 26px);
  padding: 0;
  border: 1px solid #66775e;
  border-radius: 15px;
  color: #eff6ef;
  box-shadow: 0 18px 60px #000a;
}
.shop-dialog::backdrop { background: #05080dd4; backdrop-filter: blur(5px); }
.shop-content { padding: 15px; }
.shop-header { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; }
.shop-header h2 { margin-right: auto; font: 600 26px/1.2 Georgia, serif; color: var(--gold); }
.shop-balance { color: var(--muted); font-size: 12px; }
.shop-balance strong { margin-left: 4px; color: var(--gold); font-variant-numeric: tabular-nums; }
.shop-close { min-width: 34px; padding-inline: 8px; }
.shop-items { display: grid; gap: 8px; }
.shop-item {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid #465d50;
  border-radius: 10px;
  background: #0c16167d;
  padding: 9px;
}
.shop-icon { font-size: 20px; text-align: center; }
.shop-item h3 { font-size: 13px; }
.shop-item p, .shop-feedback { color: var(--muted); font-size: 11px; margin-top: 3px; }
.shop-feedback { min-height: 15px; margin-top: 10px; }
.shop-buy { color: var(--gold); }
.shop-buy:disabled { opacity: .45; cursor: default; transform: none; }
.inventory-auto {
  grid-column: 2 / -1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-top: 7px;
  border-top: 1px solid #465d50;
  color: var(--gold);
  font-size: 12px;
  cursor: pointer;
}
.inventory-auto input { width: 16px; height: 16px; accent-color: var(--jade); flex: 0 0 auto; }
.inventory-auto small { margin-left: 3px; color: var(--muted); font-size: 11px; }
.inventory-item[hidden] { display: none; }
.pet-choice-card { color: #f1f6ef; background: linear-gradient(155deg, #27392f, #172522); }
.pet-choice-card.selected { border-color: #ddb67a; background: linear-gradient(155deg, #334733, #1e2f27); }
.pet-choice-card.selected svg { animation: sprite-breathe 1.9s ease-in-out infinite; --direction: 1; }
.choice-stats {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 8px;
  border: 1px solid #63765b80;
  border-radius: 8px;
  background: #101d1aed;
  text-align: left;
}
.choice-stat {
  display: grid;
  grid-template-columns: minmax(0, 7em) minmax(12px, 1fr) 2ch;
  align-items: center;
  gap: 5px;
  color: #d0e2d5;
  font-size: 11px;
  line-height: 1.15;
}
.choice-stat strong { color: #f4e6c8; font-variant-numeric: tabular-nums; text-align: right; }
.choice-stat-track { height: 5px; background: #070f11; border-radius: 8px; overflow: hidden; }
.choice-stat-track > span { display: block; height: 100%; border-radius: inherit; background: var(--picker-stat-color); }
.choice-stat[data-stat="hp"] { --picker-stat-color: #8fca9c; }
.choice-stat[data-stat="atk"] { --picker-stat-color: #e98f81; }
.choice-stat[data-stat="def"] { --picker-stat-color: #77b4dc; }
.choice-stat[data-stat="spd"] { --picker-stat-color: #e3bd70; }
.choice-stat[data-stat="spAtk"] { --picker-stat-color: #c8a4e7; }
@media (max-width: 640px) {
  .choice-stats { gap: 6px; padding: 6px; }
  .choice-stat { font-size: 10px; }
}
.start-game-btn { color: #13221b; background: linear-gradient(105deg, #b8e5aa, #72c89f); border-color: #b8e5aa; }
@keyframes panel-enter {
  from { transform: translateY(8px) scale(.99); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@media (max-width: 960px) {
  .game-header { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .hud-encounter { width: min(530px, calc(100% - 16px)); }
  .arena-shortcuts { top: 69px; }
}
@media (max-width: 640px) {
  body { padding: 8px; }
  .app-shell { gap: 8px; }
  .game-header { gap: 9px; border-radius: 13px; }
  .game-title { gap: 8px; }
  .hud-emblem { flex-basis: 40px; height: 40px; border-radius: 10px; }
  .icon-grimoire { --icon-size: 34px; }
  .game-profile {
    grid-template: "identity wallet" auto "meters meters" auto / minmax(0, 1.2fr) minmax(84px, .9fr);
    gap: 6px 8px;
    padding: 7px;
  }
  .hud-portrait { flex-basis: 45px; height: 45px; }
  .hud-meters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hud-wallet > div { padding-block: 1px; }
  .hud-meter-value { font-size: 10px; }
  .hud-encounter {
    top: 8px;
  }
  .hud-encounter-item { gap: 3px; padding-inline: 2px; }
  .hud-encounter-icon { --icon-size: 24px; flex-basis: 24px; width: 24px; height: 24px; }
  .hud-encounter-copy > strong { font-size: 10px; }
  .hud-boss-crown { width: 19px; height: 15px; }
  .game-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    padding-top: 7px;
  }
  .game-nav .hud-top-btn {
    min-height: 48px;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
    padding: 4px 2px;
    font-size: 10px;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
  }
  .game-nav .nav-icon { width: 24px; height: 24px; }
  .game-nav .hud-icon { --icon-size: 23px; }
  .arena-shortcuts { inset: 62px 8px auto auto; width: min(182px, 51%); }
  .arena-shortcut { gap: 5px; padding-right: 5px; grid-template-columns: 30px minmax(0, 1fr) auto; }
  .arena-shortcut-boss { grid-template-columns: 30px minmax(0, 1fr); }
  .arena-shortcut-icon { width: 30px; height: 30px; }
  .arena-shortcut-copy strong, .arena-shortcut-copy span { font-size: 10px; }
  .boss-banner { font-size: 10px; top: 172px; padding-inline: 7px; }
  .arena-announcement { top: 174px; }
  .boss-mode .arena-announcement { top: 202px; }
  .hotbar-label { font-size: 10px; white-space: normal; }
  .stat-box { grid-template-columns: 33px minmax(0, 1fr); gap: 0 6px; padding: 6px; }
  .stat-emblem { width: 33px; height: 34px; }
  .stat-emblem .hud-icon { --icon-size: 30px; }
  .shop-content { padding: 10px; }
  .shop-item { grid-template-columns: 25px minmax(0, 1fr) auto; gap: 7px; }
  .shop-buy { padding-inline: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .arena-motes, .cast-pulse-fx, .defeat-fx, .impact-sparks-fx { display: none; }
  .entity .sprite-svg { animation: none !important; transform: scaleX(var(--direction)); }
}

.float-dmg.player-damage-fx {
  color: var(--skill);
  z-index: 80;
  font-size: clamp(17px, 2vw, 21px);
  animation-duration: 1.05s;
}
.float-dmg.player-damage-fx.big { font-size: clamp(20px, 2.5vw, 26px); }
.skill-callout-fx { color: var(--skill); }
.entity[data-kind="mob"] .hit-flash {
  filter: brightness(1.7) drop-shadow(0 0 9px var(--skill)) !important;
}
.float-dmg.xp-gain-fx,
.float-dmg.potion-heal-fx {
  z-index: 80;
  font-size: clamp(16px, 2.2vw, 22px);
  animation: arena-reward-rise 1.55s ease-out both;
}
.float-dmg.xp-gain-fx { color: #fff; }
.float-dmg.potion-heal-fx {
  color: #a9ffbd;
  animation-duration: 1.75s;
}
@keyframes arena-reward-rise {
  0% { opacity: 0; transform: translate(-50%, -40%); }
  10%, 68% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, calc(-40% - 32px)); }
}
.level-up-banner {
  position: absolute;
  top: 36%;
  left: 50%;
  z-index: 30;
  width: max-content;
  max-width: 95%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  text-align: center;
  color: #ffeda6;
  text-shadow: 0 2px 4px #000, 0 0 14px #54270d, 0 0 26px #1c150c;
}
.level-up-banner strong {
  display: block;
  font-size: clamp(26px, 5vw, 58px);
  line-height: 1.05;
}
.level-up-banner span {
  display: block;
  color: #fff6d9;
  font-size: clamp(14px, 2vw, 20px);
  font-weight: 800;
}
@media (prefers-reduced-motion: reduce) {
  .float-dmg.player-damage-fx,
  .float-dmg.xp-gain-fx,
  .float-dmg.potion-heal-fx { animation: none; }
}

.class-abilities {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}
@media (max-width: 950px) {
  .class-abilities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.class-ability {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  gap: 2px 7px;
  padding: 6px 7px 9px;
  border: 1px solid #515c52;
  border-radius: 8px;
  background: linear-gradient(140deg, #25342d, #111c20 82%);
  font-size: 11px;
  line-height: 1.2;
}
.class-ability::before, .class-ability::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 6px;
  width: calc(100% - 12px);
  height: 2px;
  border-radius: 4px;
  pointer-events: none;
}
.class-ability::before { background: #0a1114; }
.class-ability::after {
  background: var(--skill);
  transform: scaleX(var(--skill-charge, 1));
  transform-origin: left;
  transition: transform .2s ease-out;
}
.class-ability.skill-active { box-shadow: inset 0 0 0 1px #c5edac83; }
.class-ability.skill-active strong { color: #c5edac; }
.class-ability strong { color: #efe3d5; align-self: end; }
.class-ability-icon {
  grid-row: span 2;
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  border: 1px solid #966c54;
  border-radius: 7px;
  background: radial-gradient(ellipse at 50% 25%, #603d31, #211c20 76%);
  overflow: hidden;
}
.class-ability-icon :is(img, svg) {
  display: block;
  position: relative;
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px #090706c7);
}
.class-abilities[data-species] .class-ability.class-ability-legendary {
  --skill: #ffc75a;
  grid-template-rows: repeat(3, auto);
  border-color: #ba8743;
  background: linear-gradient(145deg, #493820, #231f1d 82%);
}
.class-abilities[data-species] .class-ability.class-ability-legendary.ready,
.class-abilities[data-species] .class-ability.class-ability-legendary.skill-active {
  border-color: #ffd778;
}
.class-abilities[data-species] .class-ability.class-ability-legendary strong,
.class-abilities[data-species] .class-ability.class-ability-legendary span { color: #ffe7a8; }
.class-abilities[data-species] .class-ability-legendary .class-ability-icon {
  grid-row: span 3;
  border-color: #d8a95e;
  background: radial-gradient(ellipse at 48% 23%, #674123, #24201b 77%);
}
.class-abilities[data-species] .class-ability.class-ability-legendary .class-ability-category {
  justify-self: start;
  max-width: 100%;
  padding: 1px 4px;
  border-radius: 4px;
  background: #4a2a66;
  color: #f0caff;
  font-size: 9px;
  font-weight: 750;
}
.legendary-symbol { position: relative; display: block; width: 32px; height: 32px; }
.legendary-symbol i, .legendary-visual i { position: absolute; display: block; }
.symbol-twin-bastion i, [data-legendary="twin-bastion"] .legendary-visual i {
  clip-path: polygon(50% 0, 97% 14%, 90% 60%, 72% 84%, 50% 100%, 26% 85%, 9% 60%, 3% 14%);
  background:
    linear-gradient(45deg, transparent 43%, #fff1b2 46% 53%, transparent 56%) center / 66% 66% no-repeat,
    linear-gradient(-45deg, transparent 43%, #fff1b2 46% 53%, transparent 56%) center / 66% 66% no-repeat,
    conic-gradient(from 38deg, #ffd786, #7c4c23, #ffe4a0, #aa712c, #ffd786);
}
.symbol-twin-bastion i { width: 15px; height: 20px; top: 5px; left: 2px; transform: rotate(-12deg); }
.symbol-twin-bastion i + i { top: 8px; left: 15px; transform: rotate(12deg); }
.symbol-glacial-prison i:first-child {
  inset: 4px;
  background: conic-gradient(from 32deg, #ebfcff, #5ca9ec, #235187, #a7edff, #ebfcff);
  clip-path: polygon(50% 0, 93% 23%, 90% 75%, 49% 100%, 7% 74%, 8% 24%);
}
.symbol-glacial-prison i + i {
  inset: 9px 6px 6px 10px;
  background: #f2fdffbd;
  clip-path: polygon(17% 8%, 25% 35%, 68% 23%, 52% 40%, 62% 96%, 40% 51%, 0 61%, 19% 42%);
}
.symbol-prism-bow i:first-child {
  background: linear-gradient(#fcbcff, #a1bbff 27%, #75f4d8 51%, #ffe37d 76%, #ff948d);
  clip-path: polygon(8% 0, 42% 8%, 80% 29%, 100% 50%, 80% 72%, 42% 92%, 8% 100%,
    35% 85%, 66% 64%, 77% 50%, 66% 37%, 35% 15%);
}
.symbol-prism-bow i:first-child { inset: 3px 4px 3px 8px; }
.symbol-prism-bow i + i { inset: 5px auto 5px 10px; width: 1px; background: #ffedba; }
.symbol-dual-essence i:first-child, [data-legendary="dual-essence"] .legendary-visual i:first-child {
  clip-path: polygon(0 12%, 29% 2%, 50% 19%, 73% 2%, 100% 12%, 100% 85%, 72% 78%, 50% 95%, 28% 78%, 0 87%);
  background: linear-gradient(90deg, #e9fbff, #8dcaff 47%, #28568b 49%, #ebfcff 54%, #7bbdff);
}
.symbol-dual-essence i:first-child { width: 23px; height: 16px; left: 2px; bottom: 4px; }
.symbol-dual-essence i + i, [data-legendary="dual-essence"] .legendary-visual i + i {
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f3ffdf, #a3ffc3 32%, #359977 74%);
}
.symbol-dual-essence i + i { width: 12px; height: 12px; top: 3px; right: 3px; box-shadow: 0 0 5px #8bffbd; }
.legendary-visual { display: none; position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.entity[data-legendary]:not([data-legendary=""]) .legendary-visual { display: block; }
[data-legendary="twin-bastion"] .legendary-visual i {
  top: 57%; left: calc(50% - 13px); width: 25px; height: 33px;
  animation: legendary-orbit 2.4s ease-in-out infinite;
}
[data-legendary="twin-bastion"] .legendary-visual i + i { animation-delay: -1.2s; }
@keyframes legendary-orbit {
  0%, 100% { transform: translate(-39px, -17px) rotate(-10deg) scale(.92); opacity: 1; }
  25% { transform: translate(0, -34px) scale(.74); opacity: .5; }
  50% { transform: translate(39px, -17px) rotate(10deg) scale(.92); opacity: 1; }
  75% { transform: translate(0, -1px) scale(1.02); opacity: 1; }
}
[data-legendary="glacial-prison"] .legendary-visual i:first-child {
  inset: 14% 18% 12%;
  background: linear-gradient(145deg, #f3ffffe8, #86def595 27%, #3267a679 58%, #b8f5ffc9);
  clip-path: polygon(25% 0, 75% 1%, 100% 34%, 88% 84%, 76% 100%, 18% 98%, 1% 70%, 2% 29%);
}
[data-legendary="glacial-prison"] .legendary-visual i + i {
  inset: 18% 23% 13%;
  background: #d7f7ffb8;
  clip-path: polygon(39% 0, 44% 32%, 75% 22%, 53% 41%, 60% 69%, 49% 53%, 26% 77%, 36% 51%, 5% 59%, 39% 39%);
}
[data-legendary="glacial-prison"] .sprite-svg { animation-play-state: paused !important; }
.glacial-shatter-fx {
  position: absolute;
  width: 160px;
  height: 114px;
  pointer-events: none;
  z-index: 75;
  background: repeating-conic-gradient(from 12deg, transparent 0deg 21deg, #d6fcff 22deg, #5dbbedb8 25deg, transparent 29deg 44deg);
  mask-image: radial-gradient(ellipse, transparent 16%, #000 31% 51%, transparent 72%);
  animation: glacial-shatter .63s ease-out both;
}
@keyframes glacial-shatter {
  from { opacity: 1; transform: translate(-50%, -50%) scale(.45); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1.65); }
}
[data-legendary="prism-bow"] .legendary-visual i:first-child {
  top: var(--archer-hand-y, 51%);
  left: var(--archer-hand-x, 70%);
  width: 15px;
  height: 15px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, #ffffe9ed 0 12%, #ffd390d4 28%, #ffab6280 44%, transparent 72%);
  mix-blend-mode: screen;
  animation: legendary-hand-light 1.5s ease-in-out infinite;
}
[data-legendary="prism-bow"].facing-left .legendary-visual { transform: scaleX(-1); }
@keyframes legendary-hand-light {
  0%, 100% { opacity: .9; filter: hue-rotate(0deg); }
  29% { opacity: .72; filter: hue-rotate(145deg); }
  67% { opacity: 1; filter: hue-rotate(220deg); }
}
[data-legendary="dual-essence"] .legendary-visual i:first-child { width: 21px; height: 15px; bottom: 27%; left: 32%; }
[data-legendary="dual-essence"] .legendary-visual i + i { width: 13px; height: 13px; top: 39%; right: 23%; }
[data-legendary="dual-essence"] .legendary-visual i { animation: legendary-essence .85s ease-in-out infinite alternate; }
[data-legendary="dual-essence"] .legendary-visual i + i { animation-delay: -.85s; }
[data-legendary="dual-essence"].facing-left .legendary-visual { transform: scaleX(-1); }
@keyframes legendary-essence {
  from { filter: sepia(1) saturate(3) hue-rotate(146deg) drop-shadow(0 0 5px #5caeff); }
  to { filter: sepia(1) saturate(3) hue-rotate(77deg) drop-shadow(0 0 5px #6dff97); }
}
@media (prefers-reduced-motion: reduce) {
  .legendary-visual i, .glacial-shatter-fx { animation: none !important; }
  [data-legendary="twin-bastion"] .legendary-visual i { transform: translate(-34px, -17px); }
  [data-legendary="twin-bastion"] .legendary-visual i + i { transform: translate(34px, -17px); }
  .glacial-shatter-fx { transform: translate(-50%, -50%); }
}
.tank-icon-dash .pixel-sprite { animation: tank-icon-dash 2.8s ease-out infinite; }
.tank-icon-dash::before {
  content: "";
  position: absolute;
  inset: 10px 5px;
  background: repeating-linear-gradient(0deg, transparent 0 4px, #ffb48da6 5px 6px, transparent 7px 9px);
  clip-path: polygon(0 47%, 95% 0, 74% 100%);
  animation: tank-icon-lines 2.8s ease-out infinite;
}
@keyframes tank-icon-dash {
  0%, 70%, 100% { transform: translateX(-2px); }
  11% { transform: translateX(5px); }
  28%, 56% { transform: translateX(2px); }
}
@keyframes tank-icon-lines {
  0%, 24%, 100% { opacity: 0; }
  7% { opacity: .85; }
}
@media (max-width: 480px) {
  .class-ability { grid-template-columns: 35px minmax(0, 1fr); gap: 2px 4px; padding-inline: 4px; }
  .class-ability-icon { width: 35px; height: 35px; }
  .class-ability-icon :is(img, svg) { width: 32px; height: 32px; }
}
.class-ability span { color: var(--muted); font-variant-numeric: tabular-nums; }
.class-ability.ready { border-color: #a66056; }
.class-ability.ready span { color: #ffb39d; }
@media (prefers-reduced-motion: reduce) {
  .hud-meter .mini-bar-fill, .class-ability::after { transition: none; }
}

.tank-sword-smoke, .tank-dash-trail, .tank-guard-burst {
  position: absolute;
  z-index: 74;
  pointer-events: none;
}
.tank-sword-smoke {
  width: 61px;
  height: 36px;
  background: radial-gradient(ellipse at 39% 58%, #d1c0ada8, transparent 52%),
    radial-gradient(ellipse at 62% 48%, #aaa097ba, transparent 52%),
    radial-gradient(ellipse at 48% 76%, #ff87614c, transparent 55%);
  animation: tank-smoke-rise .54s ease-out both;
}
@keyframes tank-smoke-rise {
  from { opacity: .22; transform: translate(-50%, -22%) scale(.5); }
  25% { opacity: .92; }
  to { opacity: 0; transform: translate(-42%, -99%) scale(1.38); }
}
.tank-dash-trail {
  width: 90px;
  height: 32px;
  clip-path: polygon(0 44%, 91% 0%, 100% 50%, 91% 100%, 14% 65%);
  background: linear-gradient(90deg, transparent, #ed594562, #ffd3a8b0);
  animation: tank-dash-fade .365s ease-out both;
}
@keyframes tank-dash-fade {
  from { opacity: .92; transform: translate(-62%, -50%) rotate(var(--aim)) scaleX(1); }
  to { opacity: 0; transform: translate(-74%, -50%) rotate(var(--aim)) scaleX(.6); }
}
.tank-guard-burst, .entity.tank-guard-active .sprite-wrap::after {
  width: 90px;
  height: 96px;
  border: 2px solid #f4d390a8;
  border-radius: 50%;
  background: radial-gradient(ellipse, transparent 51%, #f8cf7245 67%, transparent 72%);
}
.tank-guard-burst { animation: tank-guard-expand .54s ease-out both; }
@keyframes tank-guard-expand {
  from { opacity: .86; transform: translate(-50%, -50%) scale(.54); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1.38); }
}
.entity.tank-guard-active .sprite-wrap::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 13px #ffce6e49;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .tank-dash-trail, .tank-sword-smoke, .tank-guard-burst { display: none; }
  .tank-icon-dash .pixel-sprite, .tank-icon-dash::before { animation: none; }
}
.offline-result {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(420px, calc(100% - 24px));
  padding: 10px 12px;
  border: 1px solid #aa8b5c;
  border-radius: 9px;
  background: #171d25;
  color: #fff2c5;
  font-size: 13px;
  box-shadow: 0 8px 20px #0008;
}
.offline-result .hud-top-btn { flex: none; }
.class-abilities[data-species="wolf"] .class-ability.ready { border-color: #447e9b; }
.class-abilities[data-species="wolf"] .class-ability.ready span { color: #a7deff; }
.class-abilities[data-species="wolf"] .class-ability-icon {
  border-color: #5d7093;
  background: radial-gradient(ellipse at 50% 20%, #394267, #161b2c 76%);
}
.combat-projectile.projectile-meteor {
  width: 106px;
  height: 57px;
  background: radial-gradient(ellipse at 78% 50%, #53231d 0 11%, #ffb750 13% 17%, #ff5b20 21%, transparent 45%),
    linear-gradient(90deg, transparent 4%, #ff642f75 33%, #ffd982 76%, #fff1c1 83%, transparent 100%);
  clip-path: polygon(0 39%, 58% 20%, 79% 0, 96% 18%, 100% 55%, 88% 100%, 64% 76%);
  filter: drop-shadow(0 0 12px #ff6a24);
}
.mage-meteor-marker, .mage-meteor-impact, .mage-frost-trail, .mage-focus-burst {
  position: absolute;
  pointer-events: none;
  z-index: 73;
}
.mage-meteor-marker, .mage-meteor-impact {
  width: var(--spell-diameter);
  height: calc(var(--spell-diameter) * .61);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.mage-meteor-marker {
  border: 1px solid #ff9a576f;
  background: radial-gradient(ellipse, #ec532230, transparent 72%);
  animation: meteor-mark .8s ease-out both;
}
@keyframes meteor-mark {
  from { opacity: .45; }
  80% { opacity: 1; }
  to { opacity: 0; }
}
.mage-meteor-impact {
  background: radial-gradient(ellipse, #fff4b8 0%, #ffae45d9 20%, #ff532cc7 38%, transparent 73%);
  border: 3px solid #ff9538b5;
  box-shadow: 0 0 22px #f451236a;
  animation: meteor-burst .68s ease-out both;
}
@keyframes meteor-burst {
  from { opacity: 1; transform: translate(-50%, -50%) scale(.25); }
  42% { opacity: .9; }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1.17); }
}
.mage-frost-trail {
  width: var(--trail-length);
  height: var(--trail-width);
  transform-origin: left center;
  background: linear-gradient(90deg, #a5e6ff24, #b5effab0 46%, #e5fbff);
  clip-path: polygon(0 45%, 16% 35%, 24% 8%, 32% 28%, 44% 0, 52% 30%, 63% 14%, 70% 37%, 82% 16%, 100% 49%, 84% 78%, 71% 65%, 59% 96%, 48% 71%, 38% 100%, 27% 71%, 13% 73%, 0 55%);
  animation: frost-spread .62s ease-out both;
}
@keyframes frost-spread {
  from { opacity: .65; transform: translateY(-50%) rotate(var(--aim)) scaleX(.08); }
  25% { opacity: 1; transform: translateY(-50%) rotate(var(--aim)) scaleX(1); }
  to { opacity: 0; transform: translateY(-50%) rotate(var(--aim)) scaleX(1); }
}
.entity.mob-frozen .sprite-wrap {
  filter: drop-shadow(0 0 7px #55deff) saturate(.55) !important;
}
.entity.mob-frozen .sprite-svg { animation-play-state: paused !important; }
.entity.mob-frozen .sprite-wrap::after {
  content: "";
  position: absolute;
  bottom: 10%;
  width: 75%;
  height: 36%;
  border-radius: 45% 38% 27% 29%;
  background: linear-gradient(138deg, #d7fbffd9, #79d4ff50 46%, #b3edffcf);
  clip-path: polygon(1% 66%, 13% 24%, 27% 42%, 42% 0, 53% 49%, 70% 22%, 82% 42%, 93% 19%, 100% 76%, 82% 100%, 20% 94%);
  pointer-events: none;
}
.entity.mob-rune-frozen .sprite-wrap {
  filter: drop-shadow(0 0 2px #7cdaff) saturate(.76) !important;
}
.entity.mob-rune-frozen .sprite-wrap::after {
  bottom: 31%;
  left: 51%;
  width: 16px;
  height: 11px;
}
.mage-focus-burst, .entity.mage-focus-active .sprite-wrap::after {
  width: 83px;
  height: 102px;
  border: 2px solid #c698fff0;
  border-radius: 50%;
  background: radial-gradient(ellipse, transparent 54%, #a767fa48 68%, transparent 73%);
}
.mage-focus-burst { animation: tank-guard-expand .54s ease-out both; }
.entity.mage-focus-active .sprite-wrap::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 11px #aa75f369;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .mage-meteor-impact, .mage-frost-trail, .mage-focus-burst { display: none; }
}
.stat-box.is-buffed {
  background: linear-gradient(120deg, #294a3b, #162b28);
  border-color: #83c29b;
  box-shadow: 0 0 13px #487d6233, inset 0 0 0 1px #71a98943;
}
.stat-box.is-buffed .stat-box-val { color: #b9f4c7; }
.class-abilities[data-species="dog"] .class-ability.ready { border-color: #9a813e; }
.class-abilities[data-species="dog"] .class-ability.ready span { color: #ffeb9a; }
.class-abilities[data-species="dog"] .class-ability-icon {
  border-color: #8e7749;
  background: radial-gradient(ellipse at 50% 20%, #665431, #252017 76%);
}
.combat-projectile.projectile-aimed-arrow {
  width: 84px;
  height: 15px;
  background: linear-gradient(90deg, #ffbe3e14, #ffcf5bac 33%, #fff7d2 76%, #ffe065);
}
.archer-rain-zone, .archer-rain-arrow, .archer-haste-burst {
  position: absolute;
  pointer-events: none;
  z-index: 74;
}
.archer-rain-zone {
  width: var(--rain-diameter);
  height: calc(var(--rain-diameter) * .69);
  border: 1px solid #f6d768a6;
  border-radius: 50%;
  background: radial-gradient(ellipse, #ffe07833, #b07b240a 68%, transparent 72%);
  animation: archer-rain-zone .9s ease-out both;
}
@keyframes archer-rain-zone {
  0% { opacity: .3; transform: translate(-50%, -50%) scale(.9); }
  47% { opacity: .9; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.04); }
}
.archer-rain-arrow {
  width: 10px;
  height: 48px;
  clip-path: polygon(0 0, 49% 9%, 100% 0, 65% 16%, 60% 77%, 96% 74%, 50% 100%, 5% 76%, 39% 77%, 36% 16%);
  background: linear-gradient(#ffcf48b3 0%, #fff8ce 67%, #ffd663 100%);
  animation: archer-arrow-falls .38s var(--rain-delay) ease-in both;
}
@keyframes archer-arrow-falls {
  0% { opacity: 0; transform: translate(-380%, -445%) rotate(-17deg); }
  20% { opacity: 1; }
  65% { opacity: 1; transform: translate(-50%, -97%) rotate(-17deg); }
  100% { opacity: 0; transform: translate(-50%, -95%) rotate(-17deg); }
}
.archer-haste-burst, .entity.archer-haste-active .sprite-wrap::after {
  width: 92px;
  height: 69px;
  border: 2px solid #ffdb72bb;
  border-radius: 50%;
  background: radial-gradient(ellipse, transparent 53%, #ffe47845 68%, transparent 75%);
}
.archer-haste-burst { animation: tank-guard-expand .54s ease-out both; }
.entity.archer-haste-active .sprite-wrap::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 65%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px #ffdc5c70;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .archer-rain-arrow, .archer-haste-burst { display: none; }
}
.class-abilities[data-species="rabbit"] .class-ability.ready { border-color: #a68b56; }
.class-abilities[data-species="rabbit"] .class-ability.ready span { color: #fff4a8; }
.class-abilities[data-species="rabbit"] .class-ability-icon {
  border-color: #91704d;
  background: radial-gradient(ellipse at 50% 20%, #5e4b31, #252024 76%);
}
.spirit-channel-fx, .spirit-pulse-fx, .spirit-beam-marker, .spirit-beam-impact, .spirit-heal-aura {
  position: absolute;
  pointer-events: none;
  z-index: 74;
}
.spirit-channel-fx {
  width: 112px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(ellipse, #fff7b778, #ffdd5f22 49%, transparent 67%);
  box-shadow: 0 0 10px #fff07d47;
  animation: spirit-gather .6s ease-in both;
}
@keyframes spirit-gather {
  from { opacity: .25; transform: translate(-50%, -79%) scale(1.14); }
  to { opacity: .92; transform: translate(-50%, -79%) scale(.72); }
}
.spirit-pulse-fx, .spirit-beam-marker, .spirit-beam-impact {
  width: var(--light-width);
  height: var(--light-height);
  border-radius: 50%;
}
.spirit-pulse-fx {
  border: 3px solid #fff4a6b8;
  background: radial-gradient(ellipse, #fff4a34a 0%, transparent 43%, #ffdf5b82 64%, transparent 74%);
  box-shadow: 0 0 18px #f6ce5588, inset 0 0 20px #f6ce5555;
  animation: spirit-pulse-release .74s ease-out both;
}
@keyframes spirit-pulse-release {
  from { opacity: .95; transform: translate(-50%, -50%) scale(.15); }
  65% { opacity: .72; }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}
.spirit-beam-marker {
  border: 1px solid #ffdb6687;
  background: radial-gradient(ellipse, #ffe57236, #f9d9671b 60%, transparent 72%);
  transform: translate(-50%, -50%);
  animation: meteor-mark .67s ease-out both;
}
.spirit-beam-impact {
  border: 2px solid #fff0a69e;
  background: radial-gradient(ellipse, #fffbd7 0%, #ffe766bd 20%, #ffd34373 43%, transparent 72%);
  transform: translate(-50%, -50%);
  animation: spirit-beam-ground .76s ease-out both;
}
.spirit-beam-impact::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: clamp(86px, 13vw, 148px);
  height: clamp(170px, 40vh, 270px);
  transform-origin: center top;
  background: linear-gradient(90deg, transparent, #ffd44790 18%, #fff7b5 42%, #fffbdc 57%, #f6c73a90 79%, transparent),
    radial-gradient(ellipse at 50% 98%, #fff7bf, transparent 54%);
  clip-path: polygon(22% 0, 80% 0, 99% 97%, 59% 100%, 5% 96%);
  filter: drop-shadow(0 0 13px #ffdb6b);
  animation: spirit-beam-descent .66s ease-out both;
}
@keyframes spirit-beam-descent {
  0% { opacity: 0; transform: translate(-50%, -35%) scaleY(.21); }
  35% { opacity: 1; transform: translate(-50%, 0) scaleY(1); }
  100% { opacity: 0; transform: translate(-50%, 0) scaleY(1); }
}
@keyframes spirit-beam-ground {
  from { opacity: .96; }
  to { opacity: 0; }
}
.spirit-heal-aura {
  width: 100px;
  height: 108px;
  border: 2px solid #c7f4a1d9;
  border-radius: 50%;
  background: radial-gradient(ellipse, transparent 42%, #abd86b7a 62%, transparent 71%);
  animation: tank-guard-expand .76s ease-out both;
}
@media (prefers-reduced-motion: reduce) {
  .spirit-channel-fx, .spirit-pulse-fx, .spirit-beam-impact, .spirit-heal-aura { display: none; }
}

/* ---------- Teleporte do herói entre fases (pisca → some → reaparece) ---------- */
.entity.hero-teleport-out .sprite-wrap { animation: hero-teleport-out var(--hero-teleport-ms, 1250ms) ease-in both; }
.entity.hero-teleport-in .sprite-wrap { animation: hero-teleport-in var(--hero-teleport-ms, 520ms) ease-out both; }
.entity.hero-teleport-out .rpg-overhead { opacity: 0; transition: opacity .25s ease .3s; }
.entity.hero-teleport-in .rpg-overhead { animation: hero-teleport-label var(--hero-teleport-ms, 520ms) ease-out both; }
@keyframes hero-teleport-out {
  0% { opacity: 1; filter: none; transform: none; }
  10% { opacity: .25; filter: brightness(2.2) drop-shadow(0 0 10px #8ff0ff); }
  20% { opacity: 1; filter: none; }
  30% { opacity: .25; filter: brightness(2.2) drop-shadow(0 0 10px #8ff0ff); }
  40% { opacity: 1; filter: none; }
  50% { opacity: .3; filter: brightness(2.6) drop-shadow(0 0 12px #8ff0ff); }
  60% { opacity: 1; filter: brightness(3) drop-shadow(0 0 16px #b8f7ff); transform: none; }
  82% { opacity: .9; filter: brightness(4) drop-shadow(0 0 20px #d8fbff); transform: scale(.18, 1.35); }
  100% { opacity: 0; filter: brightness(5) drop-shadow(0 0 24px #e8fdff); transform: scale(.04, 1.7); }
}
@keyframes hero-teleport-in {
  0% { opacity: 0; filter: brightness(5) drop-shadow(0 0 24px #e8fdff); transform: scale(.04, 1.7); }
  45% { opacity: 1; filter: brightness(3) drop-shadow(0 0 16px #b8f7ff); transform: scale(1.12, .92); }
  70% { filter: brightness(1.5) drop-shadow(0 0 8px #8ff0ff); transform: scale(.96, 1.04); }
  100% { opacity: 1; filter: none; transform: none; }
}
@keyframes hero-teleport-label { 0%, 50% { opacity: 0; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .entity.hero-teleport-out .sprite-wrap { animation: none; opacity: 0; transition: opacity .3s ease; }
  .entity.hero-teleport-in .sprite-wrap, .entity.hero-teleport-in .rpg-overhead { animation: none; }
}
