/* SETOR: Interface. Estilos base da página (antes ficavam dentro do index.html). */

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Polimento visual: contraste consistente, profundidade e foco no combate. */
:root { color-scheme: dark; --panel-edge: rgba(148, 163, 184, .24); --cyan: #55d6f5; }

:root {
  --bg-deep: #090c11;
  --gold: #f5d378;
  --cyan: #38bdf8;
}

body {
  background: radial-gradient(ellipse at 50% -20%, #1c2b3c 0, #0b111a 48%, #070a0f 100%);
  color: #f8fafc;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.app-shell {
  width: 100%;
  max-width: 1560px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
button:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ARENA PRINCIPAL EM TELA CHEIA COM HUD SOBREPOSTA */
.battle-arena {
  position: relative;
  width: 100%;
  height: 620px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #2b352c;
  background-color: #3b7a2a;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(132, 204, 22, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 75% 70%, rgba(20, 83, 45, 0.38) 0%, transparent 50%),
    linear-gradient(to right, rgba(15, 35, 12, 0.35) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 35, 12, 0.35) 1px, transparent 1px),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 6px, rgba(0, 0, 0, 0.035) 6px, rgba(0, 0, 0, 0.035) 12px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px, 20px 20px;
  box-shadow: 0 22px 52px rgba(0, 0, 0, .56), inset 0 0 48px rgba(10, 24, 10, .55), 0 0 0 1px rgba(255,255,255,.035);
  user-select: none;
}
.battle-arena::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 42%, transparent 28%, rgba(5, 12, 8, 0.12) 72%, rgba(5, 10, 8, 0.38) 100%),
    radial-gradient(ellipse at 18% 12%, rgba(255, 255, 220, 0.11), transparent 48%);
  animation: arenaLight 8s ease-in-out infinite alternate;
}
@keyframes arenaLight { from { opacity: .55; } to { opacity: 1; } }
.battle-arena.arena-shake { animation: arenaMicroShake 0.22s ease-out; }
@keyframes arenaMicroShake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-4px, 2px); }
  55% { transform: translate(4px, -2px); }
  80% { transform: translate(-2px, -1px); }
}
.battle-arena.biome-rock { background-color: #4b5563; border-color: #374151; }
.battle-arena.biome-inferno { background-color: #451a1a; border-color: #7f1d1d; }
.battle-arena.biome-sanctuary { background-color: #3f4e4f; border-color: #2c3639; }
.battle-arena.boss-mode {
  background-color: #160b0a;
  background-image:
    radial-gradient(ellipse at 52% 78%, rgba(255, 75, 20, 0.3) 0%, transparent 35%),
    radial-gradient(ellipse at 14% 30%, rgba(184, 45, 18, 0.22) 0%, transparent 32%),
    radial-gradient(ellipse at 88% 22%, rgba(255, 100, 24, 0.16) 0%, transparent 30%),
    linear-gradient(180deg, rgba(5, 5, 8, 0.72) 0%, rgba(37, 17, 15, 0.28) 50%, rgba(12, 8, 8, 0.82) 100%),
    repeating-linear-gradient(164deg, transparent 0 38px, rgba(255, 80, 24, 0.1) 39px 41px, transparent 42px 76px);
  border-color: #ef4444;
  box-shadow: 0 0 42px rgba(239, 68, 68, 0.7), inset 0 0 90px rgba(127, 29, 29, 0.65);
}
.battle-arena.boss-mode::after {
  background:
    radial-gradient(ellipse at 50% 60%, transparent 10%, rgba(4, 4, 6, 0.16) 55%, rgba(3, 3, 5, 0.72) 100%),
    radial-gradient(ellipse at 50% 92%, rgba(255, 89, 22, 0.18), transparent 48%);
  animation: infernoBreath 3.4s ease-in-out infinite alternate;
}
@keyframes infernoBreath { from { opacity: .72; } to { opacity: 1; } }

/* BARRA SUPERIOR CENTRALIZADA (ESTILO MENU DE ÍCONES) */
.hud-top-bar {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: linear-gradient(180deg, rgba(22, 31, 43, .94), rgba(9, 14, 22, .9));
  border: 1px solid var(--panel-edge);
  border-radius: 10px;
  backdrop-filter: blur(12px) saturate(1.2);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.65);
  flex-wrap: wrap;
  max-width: calc(100% - 400px);
}
.hud-top-btn {
  background: linear-gradient(180deg, rgba(37, 49, 66, .96), rgba(21, 29, 41, .96));
  border: 1px solid rgba(148, 163, 184, .3);
  color: #e2e8f0;
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.hud-top-btn:hover,
.hud-top-btn.active {
  border-color: #facc15;
  color: #fde047;
  background: rgba(51, 65, 85, 0.95);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(250, 204, 21, .16);
}
.hud-top-btn.speed-fast {
  border-color: #facc15;
  background: rgba(133, 77, 14, 0.9);
  color: #fef08a;
}
.repeat-stage-btn { width: 100%; padding: 6px 4px; font-size: 10px; }
.repeat-stage-btn.active { border-color: #facc15; background: rgba(133, 77, 14, 0.9); color: #fef08a; }

/* SALDO E CLASSE ATIVA */
.mini-bar-track {
  height: 7px;
  background: #090c12;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.mini-bar-fill { height: 100%; transition: width 0.2s ease-out; }
.fill-hp { background: linear-gradient(90deg, #16a34a, #4ade80); }
.fill-xp { background: linear-gradient(90deg, #9333ea, #e879f9); }

/* HOTBAR INFERIOR CENTRALIZADA */
.hud-bottom-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(180deg, rgba(20, 28, 39, .94), rgba(8, 12, 19, .94));
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 11px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.78);
  flex-wrap: wrap;
  backdrop-filter: blur(12px);
}
.hotbar-slot {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #18202c;
  border: 1.5px solid #475569;
  display: grid;
  place-items: center;
  font-size: 16px;
  position: relative;
}
.hotbar-slot.special-ready {
  border-color: #f472b6;
  box-shadow: 0 0 12px rgba(244, 114, 182, 0.55);
}
.hotbar-label {
  font-size: 11px;
  font-weight: 800;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

/* ATRIBUTOS ATUAIS DA CLASSE ABAIXO DA ARENA */
.pet-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  background: linear-gradient(135deg, rgba(21, 31, 44, .98), rgba(9, 14, 21, .98));
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 13px;
  padding: 10px;
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
}
.stat-box {
  background: linear-gradient(155deg, #1b2532, #111720);
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 10px;
  padding: 9px 7px;
  text-align: center;
  transition: border-color .18s ease, transform .18s ease;
}
.stat-box:hover { border-color: rgba(85,214,245,.42); transform: translateY(-2px); }
.stat-box-label { font-size: 10px; font-weight: 800; color: #94a3b8; }
.stat-box-val { font-size: 15px; font-weight: 900; color: var(--gold); margin-top: 2px; }

/* CENÁRIO, ENTIDADES E EFEITOS TIBIA */
.boss-banner {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(127, 29, 29, 0.95);
  border: 1.5px solid #fde047;
  border-radius: 6px;
  padding: 5px 16px;
  font-size: 12px;
  font-weight: 900;
  color: #fffbeb;
  z-index: 33;
  display: none;
  white-space: nowrap;
}
.boss-banner.active { display: block; }

.map-props-layer { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.battle-arena.boss-mode .map-props-layer { opacity: 0; transition: opacity .45s ease; }
.boss-arena-layer { position: absolute; inset: 0; z-index: 4; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .5s ease; }
.battle-arena.boss-mode .boss-arena-layer { opacity: 1; }
.boss-crag {
  position: absolute; bottom: 0; width: 31%; height: 62%;
  background: linear-gradient(150deg, #2b1918 0%, #130e10 58%, #08090d 100%);
  filter: drop-shadow(0 0 16px rgba(255, 62, 18, .16));
  clip-path: polygon(0 100%, 0 52%, 15% 44%, 24% 18%, 34% 39%, 45% 0, 58% 38%, 66% 23%, 80% 48%, 100% 57%, 100% 100%);
}
.boss-crag.left { left: -8%; height: 72%; transform: scaleX(-1); }
.boss-crag.right { right: -7%; height: 78%; width: 34%; }
.boss-crag.far-left { left: 15%; width: 22%; height: 48%; opacity: .75; }
.boss-crag.far-right { right: 17%; width: 24%; height: 52%; opacity: .72; transform: scaleX(-1); }
.boss-lava-pool {
  position: absolute; left: 50%; bottom: -8%; width: 46%; height: 22%; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(ellipse, rgba(255, 88, 20, .55), rgba(197, 34, 13, .28) 45%, transparent 72%);
  filter: blur(12px); animation: lavaGlow 2.8s ease-in-out infinite alternate;
}
.boss-lava-rift {
  position: absolute; height: 4px; border-radius: 50%;
  background: linear-gradient(90deg, transparent, #c72d16 18%, #ffb341 49%, #f0441c 78%, transparent);
  box-shadow: 0 0 12px 3px rgba(255, 64, 19, .45); opacity: .86;
  animation: riftFlicker 1.8s ease-in-out infinite alternate;
}
.boss-lava-rift.rift-a { left: 8%; bottom: 18%; width: 28%; transform: rotate(-15deg); }
.boss-lava-rift.rift-b { right: 9%; bottom: 28%; width: 24%; transform: rotate(18deg); animation-delay: -.7s; }
.boss-lava-rift.rift-c { left: 34%; bottom: 8%; width: 33%; transform: rotate(5deg); animation-delay: -.3s; }
@keyframes lavaGlow { from { opacity: .55; } to { opacity: 1; } }
@keyframes riftFlicker { from { opacity: .45; filter: brightness(.8); } to { opacity: 1; filter: brightness(1.35); } }

.map-prop {
  position: absolute;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.55));
  animation: treeSway 4.2s ease-in-out infinite;
}
@keyframes treeSway {
  0%, 100% { transform: translate(-50%, -50%) rotate(-0.8deg); }
  50% { transform: translate(-50%, -50%) rotate(0.9deg); }
}
.grass-tuft {
  position: absolute;
  width: 14px;
  height: 8px;
  border-bottom: 2px solid rgba(163, 230, 53, 0.5);
  border-left: 2px solid rgba(163, 230, 53, 0.38);
  border-radius: 50%;
  pointer-events: none;
}

.entity {
  position: absolute;
  transform: translate3d(-50%, -50%, 0);
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform;
  backface-visibility: hidden;
  contain: layout style;
}
.target-tile-ring {
  position: absolute;
  bottom: 4px;
  width: 44px;
  height: 44px;
  border: 2px solid #ef4444;
  background: rgba(239, 68, 68, 0.18);
  pointer-events: none;
  z-index: -1;
}
.rpg-overhead {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2px;
  pointer-events: none;
  white-space: nowrap;
}
.rpg-name-pet {
  font-size: 11px;
  font-weight: 800;
  color: #6ee7b7;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.rpg-name-mob {
  font-size: 11px;
  font-weight: 800;
  color: #fb923c;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.entity.is-boss .rpg-name-mob { font-size: 13px; color: #fde047; }
.entity.is-boss .rpg-name-mob { font-size: 16px; letter-spacing: .4px; text-shadow: 0 0 8px rgba(255, 82, 27, .9), -1px -1px 0 #000, 1px 1px 0 #000; }
.rpg-name-tamer {
  font-size: 11px;
  font-weight: 800;
  color: #f8fafc;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.rpg-guild-tamer {
  font-size: 9.5px;
  font-weight: 700;
  color: #e2e8f0;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.rpg-hp-bar { width: 44px; height: 5px; background: #111; border: 1px solid #000; margin-top: 1px; overflow: hidden; }
.entity.is-boss .rpg-hp-bar { width: 168px; height: 12px; border: 2px solid #fca5a5; box-shadow: 0 0 14px rgba(239, 68, 68, .55); }
.rpg-hp-fill { height: 100%; transition: width 0.14s ease-out; }
.hp-green { background: #22c55e; }
.hp-yellow { background: #eab308; }
.hp-red { background: #ef4444; }

.sprite-wrap {
  position: relative;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 8px 5px rgba(0, 0, 0, .58)) drop-shadow(0 0 7px rgba(255,255,255,.08));
  transition: transform 0.16s cubic-bezier(.2,.8,.2,1), filter 0.16s ease-out;
}
.entity.is-boss .sprite-wrap { filter: drop-shadow(0 0 22px rgba(255, 71, 25, .78)) drop-shadow(0 10px 8px rgba(0, 0, 0, .82)); }
.entity.is-boss .sprite-wrap::before {
  content: ""; position: absolute; width: 190px; height: 160px; border-radius: 50%; z-index: -1;
  background: radial-gradient(ellipse, rgba(255, 73, 21, .28), rgba(180, 28, 18, .15) 45%, transparent 72%);
  animation: bossAura 2.1s ease-in-out infinite alternate;
}
@keyframes bossAura { from { opacity: .55; transform: scale(.82); } to { opacity: 1; transform: scale(1.18); } }
.entity.is-boss:not(.is-walking) .sprite-svg { animation: bossPresence 1.9s ease-in-out infinite alternate; }
@keyframes bossPresence { from { transform: translateY(0) scale(1); } to { transform: translateY(-5px) scale(1.045); } }
.entity.is-casting .sprite-wrap {
  transform: translateY(-3px) scale(1.14);
  filter: drop-shadow(0 0 16px rgba(254, 240, 138, 0.96)) drop-shadow(0 5px 4px rgba(0, 0, 0, 0.7));
}
.entity.is-casting .sprite-wrap::before {
  content: "";
  position: absolute;
  inset: 8px 5px 2px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(56,189,248,.42), rgba(168,85,247,.18) 48%, transparent 72%);
  filter: blur(4px);
  animation: castAura .42s ease-in-out infinite alternate;
  z-index: -1;
}
@keyframes castAura { from { opacity: .45; transform: scale(.82); } to { opacity: 1; transform: scale(1.24); } }
.entity:not(.mob-dead):not(.is-walking):not(.is-casting) .sprite-svg { animation: idleBounce 0.95s ease-in-out infinite; }
.entity.is-walking:not(.mob-dead):not(.is-casting) .sprite-svg { animation: walkBob 0.28s ease-in-out infinite; }
@keyframes idleBounce {
  0%, 100% { transform: translateY(0px) scaleY(1); }
  50% { transform: translateY(-3px) scaleY(1.03); }
}
@keyframes walkBob {
  0%, 100% { transform: translateY(0px) rotate(-3deg) scale(1.03, 0.96); }
  50% { transform: translateY(-6px) rotate(3deg) scale(0.97, 1.04); }
}
.entity.facing-left:not(.mob-dead):not(.is-walking):not(.is-casting) .sprite-svg { animation: idleBounceLeft 0.95s ease-in-out infinite; }
.entity.facing-left.is-walking:not(.mob-dead):not(.is-casting) .sprite-svg { animation: walkBobLeft 0.32s ease-in-out infinite; }
.entity.facing-left.is-casting .sprite-svg { transform: scaleX(-1); }
@keyframes idleBounceLeft {
  0%, 100% { transform: scaleX(-1) translateY(0px); }
  50% { transform: scaleX(-1) translateY(-3px); }
}
@keyframes walkBobLeft {
  0%, 100% { transform: scaleX(-1) translateY(0px) rotate(-3deg) scale(1.03, 0.96); }
  50% { transform: scaleX(-1) translateY(-6px) rotate(3deg) scale(0.97, 1.04); }
}
.mob-dead .sprite-wrap { transform: rotate(90deg) translateY(8px) scale(0.88); opacity: 0.35; filter: grayscale(1); }
.hit-flash { animation: hurtJolt .16s linear 2; filter: brightness(2.6) drop-shadow(0 0 10px #ef4444) !important; }
@keyframes hurtJolt { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.float-dmg, .shockwave-fx, .loot-drop-fx, .dust-puff-fx, .crit-burst-fx, .levelup-ring-fx, .fire-aoe-fx, .fire-ember-fx, .trail-ghost-fx, .skill-callout-fx, .pet-aura-explosion-fx, .tibia-wave-cone, .tibia-wave-tile, .tibia-area-ring, .tibia-area-tile, .boss-portal-fx {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  white-space: nowrap;
}

.tibia-wave-cone {
  transform: translate(-50%, -50%) rotate(var(--wave-angle, 0deg));
  width: 156px;
  height: 82px;
  z-index: 27;
  background: radial-gradient(ellipse at 10% 50%, rgba(254, 249, 195, 0.96) 0%, rgba(56, 189, 248, 0.82) 38%, rgba(249, 115, 22, 0.56) 72%, transparent 100%);
  clip-path: polygon(0% 34%, 100% 0%, 100% 100%, 0% 66%);
  filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.85));
  animation: tibiaWaveSweep 0.42s ease-out forwards;
}
@keyframes tibiaWaveSweep {
  0% { opacity: 0.98; transform: translate(-50%, -50%) rotate(var(--wave-angle, 0deg)) scaleX(0.35) scaleY(0.6); }
  55% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--wave-angle, 0deg)) scaleX(1.08) scaleY(1.05); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--wave-angle, 0deg)) scaleX(1.22) scaleY(1.12); }
}
.tibia-wave-tile {
  width: 34px; height: 34px; border-radius: 5px; z-index: 26;
  border: 1.5px solid rgba(254, 240, 138, 0.9);
  background: radial-gradient(circle, rgba(254, 249, 195, 0.9) 0%, rgba(249, 115, 22, 0.72) 60%, rgba(56, 189, 248, 0.35) 100%);
  animation: tibiaTileFlash 0.38s ease-out forwards;
}
.tibia-area-ring {
  width: 184px; height: 118px; border-radius: 50%; z-index: 26;
  background: radial-gradient(circle, rgba(254, 240, 138, 0.36) 0%, rgba(249, 115, 22, 0.62) 50%, rgba(168, 85, 247, 0.34) 76%, transparent 100%);
  border: 2px solid rgba(254, 240, 138, 0.95);
  box-shadow: 0 0 26px rgba(249, 115, 22, 0.85);
  animation: tibiaAreaPulse 0.48s ease-out forwards;
}
@keyframes tibiaAreaPulse {
  0% { opacity: 0.96; transform: translate(-50%, -50%) scale(0.32); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.26); }
}
.tibia-area-tile {
  width: 32px; height: 32px; border-radius: 4px; z-index: 25;
  border: 1.5px solid rgba(253, 224, 71, 0.85);
  background: rgba(249, 115, 22, 0.45);
  animation: tibiaTileFlash 0.42s ease-out forwards;
}
@keyframes tibiaTileFlash {
  0% { opacity: 0.95; transform: translate(-50%, -50%) scale(0.5); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
}
.pet-aura-explosion-fx {
  width: 132px; height: 132px; border-radius: 50%; z-index: 25;
  background: radial-gradient(circle, rgba(254, 240, 138, 0.98) 0%, rgba(255, 106, 0, 0.85) 38%, rgba(239, 68, 68, 0.58) 68%, transparent 100%);
  animation: petAroundExplosion 0.5s ease-out forwards;
}
@keyframes petAroundExplosion {
  0% { opacity: 0.98; transform: translate(-50%, -50%) scale(0.42); }
  45% { opacity: 1; transform: translate(-50%, -50%) scale(1.28); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.62); }
}
.fire-aoe-fx {
  width: 78px; height: 44px; border-radius: 50%; z-index: 22;
  background: radial-gradient(circle, rgba(254, 249, 195, 0.92) 0%, rgba(249, 115, 22, 0.75) 42%, transparent 70%);
  animation: fireGroundBurst 0.55s ease-out forwards;
}
@keyframes fireGroundBurst {
  0% { opacity: 0.95; transform: translate(-50%, -45%) scale(0.35); }
  40% { opacity: 1; transform: translate(-50%, -45%) scale(1.18); }
  100% { opacity: 0; transform: translate(-50%, -45%) scale(1.42); }
}
.fire-ember-fx {
  width: 8px; height: 8px; border-radius: 50%; z-index: 26;
  background: radial-gradient(circle, #fef08a 15%, #f97316 65%, #dc2626 100%);
  animation: emberRise 0.52s ease-out forwards;
}
@keyframes emberRise {
  0% { opacity: 1; transform: translate(-50%, -40%) scale(1.1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--ex, 12px)), calc(-50% - var(--ey, 28px))) scale(0.2); }
}
.skill-callout-fx {
  font-size: 11px; font-weight: 900; z-index: 36;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  animation: skillFloat 0.85s ease-out forwards;
}
@keyframes skillFloat {
  0% { opacity: 1; transform: translate(-50%, -20%) scale(0.88); }
  100% { opacity: 0; transform: translate(-50%, -125%) scale(1.06); }
}
.dust-puff-fx {
  width: 10px; height: 6px; border-radius: 50%; background: rgba(226, 232, 240, 0.45);
  animation: dustFade 0.45s ease-out forwards; z-index: 15;
}
@keyframes dustFade {
  0% { opacity: 0.7; transform: translate(-50%, -50%) scale(0.6); }
  100% { opacity: 0; transform: translate(-50%, -85%) scale(1.9); }
}
.trail-ghost-fx {
  width: 28px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle, rgba(134, 239, 172, 0.35) 0%, transparent 70%);
  animation: trailFade 0.34s ease-out forwards; z-index: 12;
}
@keyframes trailFade {
  0% { opacity: 0.7; transform: translate(-50%, -50%) scale(0.95); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.45); }
}
.crit-burst-fx {
  width: 44px; height: 44px; border-radius: 50%; z-index: 29;
  background: radial-gradient(circle, var(--skill) 0%, color-mix(in srgb, var(--skill) 55%, transparent) 45%, transparent 75%);
  animation: critPop 0.32s ease-out forwards;
}
@keyframes critPop {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.35); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.55); }
}
.levelup-ring-fx {
  width: 66px; height: 34px; border: 3px solid #86efac; border-radius: 50%; z-index: 31;
  animation: levelRingExpand 0.75s ease-out forwards;
}
@keyframes levelRingExpand {
  0% { opacity: 1; transform: translate(-50%, -20%) scale(0.45); }
  100% { opacity: 0; transform: translate(-50%, -95%) scale(1.65); }
}
.shockwave-fx {
  width: 22px; height: 12px; border: 2px solid rgba(254, 240, 138, 0.9); border-radius: 50%; z-index: 24;
  animation: shockRing 0.34s ease-out forwards;
}
.boss-portal-fx {
  width: 170px; height: 204px; z-index: 28; border: 5px solid rgba(255, 190, 96, .95); border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 244, 205, .94) 0%, rgba(255, 112, 35, .58) 36%, rgba(139, 31, 22, .28) 62%, transparent 76%);
  box-shadow: 0 0 28px 9px rgba(255, 76, 25, .65), inset 0 0 25px rgba(255, 237, 190, .72);
  animation: bossPortalArrival .86s cubic-bezier(.18,.72,.24,1) forwards;
}
@keyframes bossPortalArrival { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.16); } 32% { opacity: 1; transform: translate(-50%, -50%) scale(1.18); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.65); } }
@keyframes shockRing {
  0% { opacity: 0.95; transform: translate(-50%, -50%) scale(0.5); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.3); }
}
.loot-drop-fx {
  font-size: 15px; z-index: 29;
  animation: lootPopCollect 0.85s ease-out forwards;
}
@keyframes lootPopCollect {
  0% { opacity: 0; transform: translate(-50%, -35%) scale(0.5); }
  35% { opacity: 1; transform: translate(-50%, -85%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -135%) scale(0.8); }
}
.float-dmg {
  font-weight: 900; font-size: 14px; z-index: 35;
  text-shadow: -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000;
  animation: floatUp 0.92s ease-out forwards;
}
.float-dmg.big { font-size: 18px; }
@keyframes floatUp {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.92); }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(1.14); }
}

/* SELEÇÃO DE CLASSE */
.picker-overlay {
  position: fixed; inset: 0; background: rgba(5, 8, 13, 0.84);
  backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 500;
}
.picker-overlay { z-index: 999; }
.hidden { display: none !important; }
.picker-box {
  width: 100%; max-width: 820px; background: radial-gradient(ellipse at 50% 0, rgba(34,197,94,.12), transparent 48%), linear-gradient(165deg, #1d2732, #0d131b);
  border: 1px solid rgba(74,222,128,.7); border-radius: 18px; padding: 26px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 28px 90px rgba(0,0,0,.62), 0 0 36px rgba(34,197,94,.08), inset 0 1px rgba(255,255,255,.06);
}
.picker-header { text-align: center; }
.picker-header h1 { font-size: clamp(22px, 3vw, 30px); color: #a7f3d0; margin-bottom: 6px; letter-spacing: .02em; text-shadow: 0 0 24px rgba(74,222,128,.2); }
.picker-header p { font-size: 12.5px; color: #cbd5e1; }
.pet-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; }
.pet-choice-card {
  background: linear-gradient(150deg, rgba(38, 51, 65, .98), rgba(20, 29, 39, .98)); border: 1px solid rgba(148,163,184,.28); border-radius: 14px; padding: 14px;
  text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.pet-choice-card:hover { transform: translateY(-3px); border-color: rgba(85,214,245,.62); box-shadow: 0 12px 26px rgba(0,0,0,.24); }
.pet-choice-card.selected { border-color: #4ade80; background: linear-gradient(150deg, #1d3b30, #12241f); box-shadow: 0 0 0 1px rgba(74,222,128,.32), 0 0 24px rgba(74,222,128,.12); }
.choice-name { font-size: 15px; font-weight: 900; color: var(--gold); }
.choice-role { font-size: 11px; color: #86efac; font-weight: 700; }
.picker-input { background: #0d1016; border: 1px solid #475569; border-radius: 8px; padding: 10px 12px; color: #fff; font-size: 14px; }
.picker-entry { display: grid; gap: 8px; }
.picker-name-feedback { margin: 0; color: #ffd1d8; font-size: 13px; min-height: 1.2em; }
.picker-input[aria-invalid="true"] { border-color: #f295a5; }
.start-game-btn:disabled { opacity: .65; cursor: wait; }
.start-game-btn {
  background: linear-gradient(100deg, #16a34a, #0f8d52 55%, #147d46); color: #fff; border: 1px solid #86efac;
  border-radius: 10px; padding: 13px; font-size: 14px; font-weight: 900; cursor: pointer;
  box-shadow: 0 8px 20px rgba(22,163,74,.2); transition: transform .16s ease, filter .16s ease;
}
.start-game-btn:hover { transform: translateY(-1px); filter: brightness(1.12); }

@media (max-width: 960px) {
  .hud-top-bar { max-width: calc(100% - 20px); top: auto; bottom: 64px; }
}
@media (max-width: 640px) {
  body { padding: 6px; }
  .app-shell { gap: 7px; }
  .battle-arena { height: min(74vh, 540px); min-height: 430px; border-radius: 12px; }
  .hud-radar-circle { width: 64px; height: 64px; font-size: 8px; }
  .hud-top-bar { gap: 4px; padding: 4px 6px; max-width: calc(100% - 12px); }
  .hud-top-btn { padding: 5px 6px; font-size: 9px; }
  .hud-bottom-bar { gap: 5px; padding: 5px 7px; }
  .hotbar-slot { width: 32px; height: 32px; }
  .hotbar-label { max-width: 42vw; font-size: 9px; }
  .pet-stats-strip { grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 7px; }
  .stat-box { padding: 7px 4px; }
  .stat-box-label { font-size: 9px; }
  .stat-box-val { font-size: 14px; }
  .picker-box { padding: 17px; gap: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
  .pet-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pet-choice-card { padding: 9px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
