:root {
  --ink: #1e293b;
  --ink-soft: #475569;
  --hud-bg: rgba(18, 24, 38, 0.90);
  --hud-border: rgba(255, 255, 255, 0.22);
  --cream: #faf6eb;
  --cream-2: #f1ead8;
  --fire: #ef4444;
  --fire-2: #f97316;
  --gold: #f59e0b;
  --hp-green: #22c55e;
  --hp-yellow: #eab308;
  --hp-red: #ef4444;
  --sky: #38bdf8;
}

* { box-sizing: border-box; user-select: none; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  background: #101827; color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  overflow: hidden;
}

#bg-stage {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; overflow: hidden;
  background: #0f172a;
}
.bg-plate {
  position: absolute; inset: -4%;
  background-size: cover; background-position: center 52%; background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.85s ease;
  will-change: transform, opacity;
  filter: saturate(1.16) contrast(1.04) brightness(0.95);
}
.bg-plate.active { opacity: 1; }
#bg-stage[data-screen="map"] .bg-plate,
#bg-stage[data-screen="starter"] .bg-plate {
  filter: saturate(1.12) contrast(1.02) brightness(0.84) blur(1.2px);
}
#bg-stage[data-screen="trainer"] .bg-plate {
  filter: saturate(1.16) contrast(1.04) brightness(0.92);
}
#bg-stage[data-screen="battle"] .bg-plate {
  inset: 0;
  background-position: center center;
  filter: saturate(1.1) contrast(1.07) brightness(0.88);
}
#bg-stage[data-boss="1"] .bg-plate {
  filter: saturate(1.25) contrast(1.12) brightness(0.86);
}
.bg-hero-wrap {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 1;
  transition: opacity 0.7s ease;
}
.bg-hero-art {
  position: absolute;
  left: -36px;
  bottom: -18px;
  width: min(30vw, 340px); height: auto;
  object-fit: contain;
  opacity: 0;
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.45)) saturate(1.12);
  transition: opacity 0.75s ease, transform 0.75s ease;
  will-change: transform, opacity;
}
.bg-hero-art.visible { opacity: 0.42; }
#bg-stage[data-screen="title"] .bg-hero-art.visible { opacity: 0.48; }
#bg-stage[data-screen="victory"] .bg-hero-art.visible {
  left: 50%; bottom: auto; top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.44;
}
#bg-stage[data-screen="battle"] .bg-hero-wrap,
#bg-stage[data-screen="trainer"] .bg-hero-wrap { opacity: 0; }

.bg-flyers {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 2; overflow: hidden;
}
.bg-flyer {
  position: absolute; top: 0; left: 0;
  pointer-events: none;
  image-rendering: pixelated;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.38));
  will-change: transform, opacity;
  transition: opacity 0.6s ease;
}
.bg-flyer.is-walker {
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.52));
}
#bg-stage[data-screen="battle"] .bg-flyer {
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.28)) saturate(0.92);
}

#bg-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 5;
}
.bg-vignette {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(12, 16, 36, 0.48) 100%);
}

#vfx-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 80;
}

#app {
  position: relative; z-index: 1; width: 100%; height: 100%;
  display: flex; flex-direction: column;
  background: transparent;
}

.px { image-rendering: pixelated; }

/* ====== POKÉBONK FLOATING TOP HUD ====== */
.pk-hud {
  position: fixed; top: 12px; left: 16px; right: 16px;
  display: flex; align-items: flex-start; justify-content: space-between;
  pointer-events: none; z-index: 50; gap: 12px;
}
.pk-hud > * { pointer-events: auto; }

/* Top-Left PokéBonk Circular Portrait + Stat Plate */
.pk-profile {
  display: flex; align-items: center; position: relative;
}
.pk-avatar-ring {
  width: 74px; height: 74px; border-radius: 50%;
  background: linear-gradient(145deg, #fb923c, #dc2626);
  border: 3.5px solid #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.55), inset 0 0 10px rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 3; overflow: visible; flex-shrink: 0;
}
.pk-avatar-ring img {
  width: 60px; height: 60px; border-radius: 50%;
  image-rendering: pixelated; object-fit: cover; background: #1e293b;
}
.pk-lv-pill {
  position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  background: #111827; color: #fde68a; border: 2px solid #fff;
  border-radius: 999px; padding: 1px 8px; font-size: 10.5px; font-weight: 900;
  white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.pk-plate {
  margin-left: -18px; padding: 7px 14px 8px 26px;
  background: var(--hud-bg); border: 2px solid var(--hud-border);
  border-radius: 14px; min-width: 240px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.45); backdrop-filter: blur(8px);
}
.pk-plate-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px;
}
.pk-plate-name { font-size: 14px; font-weight: 900; letter-spacing: .3px; color: #fff; }
.pk-type-img { height: 15px; image-rendering: pixelated; vertical-align: middle; }

.pk-bar-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.pk-bar-tag {
  font-size: 10px; font-weight: 900; color: #fde68a; min-width: 22px; text-align: right;
  text-shadow: 0 1px 2px #000;
}
.pk-bar-track {
  flex: 1; height: 14px; border-radius: 999px;
  background: rgba(0,0,0,0.65); border: 1.5px solid rgba(255,255,255,0.28);
  position: relative; overflow: hidden;
}
.pk-bar-fill {
  height: 100%; border-radius: 999px; transition: width .28s ease-out;
}
.pk-bar-fill.hp-high { background: linear-gradient(90deg, #16a34a, #4ade80); }
.pk-bar-fill.hp-mid { background: linear-gradient(90deg, #ca8a04, #facc15); }
.pk-bar-fill.hp-low { background: linear-gradient(90deg, #b91c1c, #f87171); }
.pk-bar-fill.heat { background: linear-gradient(90deg, #f59e0b, #f97316, #ef4444); }
.pk-bar-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 900; color: #fff;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.pk-heat-mark {
  position: absolute; top: 0; bottom: 0; left: 80%; width: 2px; background: #fff; opacity: .85;
}

/* Top-Center PokéBonk Zone Banner */
.pk-zone-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.pk-zone-pill {
  background: var(--hud-bg); border: 2px solid var(--hud-border);
  border-radius: 14px; padding: 6px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.45); backdrop-filter: blur(8px);
}
.pk-zone-title { font-size: 14px; font-weight: 900; color: #fff; }
.pk-zone-sub { font-size: 11px; color: #cbd5e1; }
.pk-mode-badge {
  font-size: 10px; font-weight: 900; padding: 2px 7px; border-radius: 6px; letter-spacing: .5px;
  background: #16a34a; color: #fff;
}
.pk-mode-badge.elite { background: #ea580c; }
.pk-mode-badge.boss { background: #dc2626; }
.pk-pokeball-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.45); border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 900; color: #fff;
}
.pk-sub-strip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(15,23,42,0.82); border: 1.5px solid rgba(255,255,255,0.16);
  border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 800;
}
.pk-gold { color: #fde047; }

/* Top-Right Action Buttons & Square Slots */
.pk-right-col {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.pk-btn-row { display: flex; gap: 6px; }
.pk-btn {
  background: var(--hud-bg); color: #fff;
  border: 2px solid var(--hud-border); border-radius: 10px;
  padding: 6px 11px; font-size: 12px; font-weight: 800; cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  transition: transform .14s, border-color .14s, background .14s;
}
.pk-btn:hover { transform: translateY(-2px); border-color: #fb923c; background: rgba(30,41,59,0.96); }

.pk-slots-row { display: flex; align-items: center; gap: 6px; }
.pk-slot {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(18, 24, 38, 0.88); border: 2px solid rgba(255,255,255,0.28);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer; position: relative;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  transition: transform .15s, border-color .15s;
}
.pk-slot:hover { transform: scale(1.12); border-color: #fde047; z-index: 60; }
.pk-slot.empty { opacity: .35; cursor: default; }
.pk-slot.usable { border-color: #facc15; box-shadow: 0 0 12px rgba(250,204,21,0.5); }

/* Tooltip */
.tooltip-box {
  position: fixed; z-index: 250; pointer-events: none;
  background: rgba(15, 23, 42, 0.96); border: 2px solid #f59e0b;
  border-radius: 10px; padding: 9px 12px; max-width: 270px;
  font-size: 12.5px; line-height: 1.45; box-shadow: 0 12px 30px rgba(0,0,0,0.7);
  display: none;
}
.tooltip-box b { color: #fde68a; display: block; margin-bottom: 3px; font-size: 13.5px; }

/* ====== SCREENS ====== */
.screen {
  flex: 1; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.screen.scrollable { overflow-y: auto; }

/* Starter Selection Screen (Pokémon Lab / Stadium Style) */
.starter-screen {
  padding: 28px 32px 44px; align-items: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(251,146,60,0.28), transparent 52%),
    linear-gradient(180deg, #1a2438 0%, #0f172a 100%);
}
.hero-banner {
  text-align: center; margin-bottom: 20px;
  background: rgba(15,23,42,0.78); border: 2px solid rgba(255,255,255,0.2);
  border-radius: 18px; padding: 14px 28px; box-shadow: 0 12px 28px rgba(0,0,0,0.45);
}
.hero-banner h1 {
  margin: 0; font-size: 28px; font-weight: 900; color: #fff;
  text-shadow: 0 3px 0 #b91c1c;
}
.hero-banner p { margin: 6px 0 0; color: #cbd5e1; font-size: 13.5px; }

.starter-grid {
  display: grid; grid-template-columns: repeat(3, minmax(250px, 310px));
  gap: 16px; width: 100%; max-width: 980px; justify-content: center;
}
.starter-card {
  background: var(--cream); color: var(--ink);
  border: 3px solid #334155; border-radius: 16px;
  padding: 13px 15px; cursor: pointer; position: relative; overflow: hidden;
  box-shadow: 0 8px 0 rgba(15,23,42,0.55), 0 14px 24px rgba(0,0,0,0.4);
  transition: transform .18s cubic-bezier(.2,.85,.25,1), border-color .18s;
  display: flex; flex-direction: column; gap: 8px;
}
.starter-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: #f97316;
}
.starter-top { display: flex; align-items: center; gap: 12px; }
.starter-art-box {
  width: 74px; height: 74px; border-radius: 12px;
  background: radial-gradient(circle, #fff7ed, #fed7aa);
  border: 2px solid #fdba74;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.starter-art {
  max-width: 66px; max-height: 66px; image-rendering: pixelated; object-fit: contain;
  transform: scaleX(-1);
}
.starter-name { font-size: 16px; font-weight: 900; color: #0f172a; }
.starter-gen {
  font-size: 10.5px; font-weight: 800; color: #fff; background: #ea580c;
  padding: 2px 7px; border-radius: 999px; margin-left: 6px;
}
.starter-evo { font-size: 11.5px; color: #64748b; margin-top: 3px; font-weight: 600; }
.starter-desc {
  font-size: 12px; color: #334155; line-height: 1.45;
  background: var(--cream-2); border-radius: 9px; padding: 7px 9px;
}
.starter-mega-tag {
  position: absolute; top: 9px; right: 9px;
  font-size: 10px; font-weight: 900; padding: 2px 7px; border-radius: 999px;
  background: linear-gradient(90deg, #ec4899, #8b5cf6, #06b6d4); color: #fff;
}

/* Map Screen */
.map-screen {
  padding: 96px 28px 40px; align-items: center;
  background:
    radial-gradient(circle at 50% 20%, rgba(34,197,94,0.18), transparent 55%),
    linear-gradient(180deg, #1a2e22 0%, #101b1a 100%);
}
.map-container {
  width: 100%; max-width: 780px; display: flex; flex-direction: column-reverse; gap: 16px;
  margin-top: 10px; padding-bottom: 40px;
}
.map-row { display: flex; justify-content: center; gap: 24px; }
.map-node {
  width: 164px; padding: 12px 14px; border-radius: 14px;
  background: var(--cream); color: var(--ink);
  border: 3px solid #475569;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: not-allowed; opacity: .45; transition: all .18s;
  box-shadow: 0 5px 0 rgba(0,0,0,0.45);
}
.map-node.available {
  opacity: 1; cursor: pointer; border-color: #f97316;
  box-shadow: 0 5px 0 #9a3412, 0 0 22px rgba(249,115,22,0.55);
  animation: pulseNode 1.8s infinite;
}
.map-node.available:hover { transform: translateY(-4px) scale(1.04); }
.map-node.cleared { opacity: .72; border-color: #16a34a; background: #dcfce7; }
.map-node.boss { width: 240px; border-color: #dc2626; }
.map-node .node-ico { font-size: 24px; }
.map-node .node-title { font-weight: 900; font-size: 13.5px; }
.map-node .node-sub { font-size: 11px; color: #475569; font-weight: 600; }
@keyframes pulseNode {
  0%,100% { box-shadow: 0 5px 0 #9a3412, 0 0 12px rgba(249,115,22,0.4); }
  50% { box-shadow: 0 5px 0 #9a3412, 0 0 26px rgba(249,115,22,0.85); }
}

/* ====== BRIGHT, AUTHENTIC POKÉMON BATTLE ARENA ====== */
.battle-screen {
  position: relative; justify-content: space-between;
  background-size: cover; background-position: center 40%;
}
/* Subtle bottom gradient ONLY for hand readability — keep arena bright & vivid! */
.battle-screen::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(10,16,28,0.22) 0%,
    rgba(10,16,28,0.04) 48%,
    rgba(10,16,28,0.55) 78%,
    rgba(10,16,28,0.88) 100%);
}
.battle-screen.overheat-active::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 85px rgba(239,68,68,0.7);
  animation: overheatPulse 1s infinite alternate;
}
/* 天气效果由 #bg-canvas 实时绘制（日照光束、雨滴水花、雪花、沙暴、极光幕），不再使用全屏染色滤镜 */
@keyframes overheatPulse {
  from { box-shadow: inset 0 0 50px rgba(239,68,68,0.45); }
  to { box-shadow: inset 0 0 110px rgba(249,115,22,0.85); }
}

.weather-row {
  position: absolute; top: 96px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 20;
}
.weather-chip {
  padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 800;
  background: rgba(15,23,42,0.85); border: 2px solid rgba(255,255,255,0.25); color: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}
.weather-chip.sun { border-color: #facc15; color: #fef08a; background: rgba(133,77,14,0.85); }
.weather-chip.overheat { border-color: #ef4444; color: #fecaca; background: rgba(153,27,27,0.9); }
.weather-chip.cooldown { border-color: #38bdf8; color: #bae6fd; background: rgba(12,74,110,0.88); }

/* Stage Floor */
.stage-area {
  position: relative; z-index: 12; flex: 1;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 112px 9% 22px;
}

/* Player Side (Left, Facing RIGHT via scaleX(-1)!) */
.player-unit {
  display: flex; flex-direction: column; align-items: center; position: relative;
}
.battle-pad {
  position: relative; display: flex; align-items: flex-end; justify-content: center;
  min-width: 170px; min-height: 150px;
}
.ground-ring {
  position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 146px; height: 42px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.42) 0%, rgba(0,0,0,0.18) 55%, transparent 72%);
  border: 2.5px solid rgba(56, 189, 248, 0.72);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
  pointer-events: none;
}
.ground-ring.enemy-ring {
  border-color: rgba(255,255,255,0.28); box-shadow: none;
}
.enemy-unit.targeted .ground-ring.enemy-ring {
  border-color: #f97316;
  box-shadow: 0 0 22px rgba(249,115,22,0.85), inset 0 0 12px rgba(249,115,22,0.5);
}

.partner-sprite-2d {
  height: 142px; max-width: 165px; object-fit: contain;
  image-rendering: pixelated;
  transform: scaleX(-1); /* 关键修复：镜像朝右面向敌人！ */
  filter: drop-shadow(0 8px 10px rgba(0,0,0,0.55));
  position: relative; z-index: 2;
}
.player-buffs {
  margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; min-height: 24px;
}

/* Enemy Side (Right, Facing LEFT naturally!) */
.enemies-side {
  display: flex; align-items: flex-end; gap: 38px;
}
.enemy-unit {
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer; position: relative; transition: transform .18s;
}
.enemy-unit:hover { transform: translateY(-4px); }
.enemy-unit.dead { opacity: 0; pointer-events: none; transform: scale(0.65); transition: all .4s; }
.enemy-sprite-2d {
  height: 138px; max-width: 165px; object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,0.55));
  position: relative; z-index: 2;
}

/* PokéBonk Floating Enemy Stat Plate */
.enemy-plate {
  margin-top: 8px; padding: 6px 11px; border-radius: 11px;
  background: var(--hud-bg); border: 2px solid rgba(255,255,255,0.26);
  min-width: 168px; box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}
.enemy-unit.targeted .enemy-plate { border-color: #fb923c; }
.enemy-plate-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 12.5px; font-weight: 900; margin-bottom: 4px;
}
.match-badge {
  font-size: 10px; font-weight: 900; padding: 1px 5px; border-radius: 5px;
}
.match-badge.super { background: #16a34a; color: #fff; }
.match-badge.resist { background: #991b1b; color: #fecaca; }

.intent-pill {
  margin-bottom: 6px; padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 900; color: #fff;
  background: #dc2626; border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.45);
  display: inline-flex; align-items: center; gap: 5px;
}
.intent-pill.def { background: #0284c7; }
.intent-pill.buff { background: #7c3aed; }

.buff-row { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 5px; }
.buff-pill {
  font-size: 10.5px; font-weight: 900; padding: 2px 7px; border-radius: 6px;
  background: rgba(15,23,42,0.9); border: 1.5px solid rgba(255,255,255,0.25); color: #fff;
}
.buff-pill.block { border-color: #38bdf8; color: #7dd3fc; }
.buff-pill.burn { border-color: #f97316; color: #fdba74; }
.buff-pill.vuln { border-color: #ef4444; color: #fca5a5; }
.buff-pill.weak { border-color: #a855f7; color: #e9d5ff; }
.buff-pill.str { border-color: #facc15; color: #fef08a; }

/* Mirrored-safe Lunge & Hit Animations */
.lunge-right-mirrored { animation: lungeRMirrored .26s ease-out; }
.hit-flash { animation: hitFlash .28s ease-out; }
.screen-shake { animation: screenShake .26s ease-out; }
@keyframes lungeRMirrored {
  0% { transform: scaleX(-1) translateX(0); }
  45% { transform: scaleX(-1) translateX(-46px) scale(1.08); }
  100% { transform: scaleX(-1) translateX(0); }
}
@keyframes hitFlash {
  0% { filter: brightness(3.2) drop-shadow(0 0 18px #fff); transform: translateX(0); }
  30% { transform: translateX(-8px); }
  60% { transform: translateX(8px); }
  100% { filter: drop-shadow(0 8px 10px rgba(0,0,0,0.55)); transform: translateX(0); }
}
@keyframes screenShake {
  0%,100% { transform: translate(0,0); }
  25% { transform: translate(-5px, 3px); }
  50% { transform: translate(5px, -3px); }
  75% { transform: translate(-3px, -2px); }
}

/* ====== BOTTOM POKÉBONK CARD DOCK ====== */
.hand-dock {
  position: relative; z-index: 25; height: 272px;
  padding: 6px 24px 14px;
  display: flex; align-items: flex-end; justify-content: space-between;
}
.orb-col {
  display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 118px;
}
.energy-ring {
  width: 78px; height: 78px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fef08a, #f97316 55%, #b91c1c 100%);
  border: 4px solid #fff;
  box-shadow: 0 6px 0 #7c2d12, 0 0 26px rgba(249,115,22,0.75);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1;
}
.energy-num {
  font-size: 25px; font-weight: 900; color: #fff;
  text-shadow: -1.5px -1.5px 0 #7c2d12, 1.5px 1.5px 0 #7c2d12;
}
.energy-sub { font-size: 9.5px; font-weight: 900; color: #fef3c7; letter-spacing: .5px; }

.pile-btn {
  width: 114px; padding: 7px 10px; border-radius: 10px;
  background: var(--hud-bg); border: 2px solid var(--hud-border);
  color: #fff; font-size: 11.5px; font-weight: 800; cursor: pointer;
}
.pile-btn:hover { border-color: #facc15; }

.end-turn-btn {
  padding: 13px 20px; border-radius: 14px; border: 3px solid #fff;
  background: linear-gradient(180deg, #f97316, #dc2626);
  color: #fff; font-size: 15px; font-weight: 900; cursor: pointer;
  box-shadow: 0 5px 0 #7f1d1d, 0 10px 22px rgba(0,0,0,0.5);
  transition: transform .14s;
}
.end-turn-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.end-turn-btn:active { transform: translateY(2px); }
.end-turn-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ====== AUTHENTIC 2D POKÉMON BATTLE CARDS ====== */
.hand-row {
  flex: 1; display: flex; justify-content: center; align-items: flex-end;
  height: 252px; padding-bottom: 4px; overflow: visible;
}
.poke-card {
  width: 174px; height: 240px; margin: 0 -7px;
  border-radius: 14px; padding: 7px 8px 8px;
  background: var(--cream); color: var(--ink);
  border: 3.5px solid #94a3b8;
  display: flex; flex-direction: column; position: relative;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2,.85,.25,1), box-shadow .18s, margin .18s;
  box-shadow: 0 6px 0 rgba(15,23,42,0.55), 0 12px 24px rgba(0,0,0,0.5);
}
.poke-card.unplayable { opacity: .52; filter: grayscale(.4); cursor: not-allowed; }
.poke-card:not(.unplayable):hover {
  transform: translateY(-38px) scale(1.14) rotate(0deg) !important;
  z-index: 65; margin: 0 16px;
  box-shadow: 0 12px 0 rgba(15,23,42,0.5), 0 24px 40px rgba(0,0,0,0.75), 0 0 24px rgba(251,146,60,0.7);
}

/* 5-Tier Dynamic Rarity Borders + Mega Holo */
.poke-card.rarity-Gray { border-color: #94a3b8; }
.poke-card.rarity-Green { border-color: #16a34a; background: linear-gradient(180deg, #f0fdf4, #faf6eb); }
.poke-card.rarity-Blue { border-color: #2563eb; background: linear-gradient(180deg, #eff6ff, #faf6eb); }
.poke-card.rarity-Purple {
  border-color: #9333ea; background: linear-gradient(180deg, #f3e8ff, #faf5ff);
  box-shadow: 0 6px 0 #581c87, 0 0 22px rgba(168,85,247,0.45);
}
.poke-card.rarity-Gold {
  border-color: #d97706; background: linear-gradient(180deg, #fef3c7, #fffbeb);
  box-shadow: 0 6px 0 #92400e, 0 0 26px rgba(245,158,11,0.55);
}
.poke-card.rarity-Mega {
  border-color: #ec4899; background: linear-gradient(160deg, #fdf2f8, #eef2ff 50%, #ecfeff);
  box-shadow: 0 6px 0 #831843, 0 0 28px rgba(236,72,153,0.65);
}
.poke-card.rarity-Purple::after,
.poke-card.rarity-Gold::after,
.poke-card.rarity-Mega::after {
  content: ""; position: absolute; inset: 0; border-radius: 11px; pointer-events: none;
  background: linear-gradient(125deg, transparent 28%, rgba(255,255,255,0.45) 48%, transparent 68%);
  background-size: 240% 240%; animation: holoShine 3s linear infinite;
}
@keyframes holoShine { 0%{background-position:0% 0%} 100%{background-position:200% 200%} }

.card-cost {
  position: absolute; top: -10px; left: -10px;
  width: 31px; height: 31px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fef08a, #ea580c);
  border: 2.5px solid #fff; color: #fff; font-weight: 900; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.55); z-index: 6;
  text-shadow: 0 1px 2px #7c2d12;
}
.card-inspect-btn {
  position: absolute; top: 5px; right: 5px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(15,23,42,0.12); border: 1.5px solid rgba(15,23,42,0.22);
  color: #334155; font-size: 11px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; z-index: 6; cursor: pointer;
}
.card-inspect-btn:hover { background: #f97316; color: #fff; border-color: #f97316; }

.card-header {
  padding: 0 18px; font-size: 12.5px; font-weight: 900; color: #0f172a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-art-wrap {
  height: 92px; margin: 4px 0; border-radius: 9px;
  background:
    radial-gradient(circle at 50% 55%, rgba(255,255,255,0.92), rgba(254,215,170,0.65) 65%, rgba(251,146,60,0.35) 100%);
  border: 2px solid rgba(15,23,42,0.12);
  display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
}
/* Subtle Pokéball watermark inside every card art frame */
.card-art-wrap::before {
  content: ""; position: absolute; width: 68px; height: 68px; border-radius: 50%;
  border: 6px solid rgba(255,255,255,0.45); pointer-events: none;
}
.card-art-wrap img.card-sprite {
  max-width: 82px; max-height: 82px; object-fit: contain;
  image-rendering: pixelated; position: relative; z-index: 2;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,0.25));
}
.card-cat-badge {
  position: absolute; bottom: 3px; left: 4px; height: 15px; image-rendering: pixelated; z-index: 3;
}
.card-evo-badge {
  position: absolute; bottom: 3px; right: 4px; z-index: 3;
  font-size: 9.5px; font-weight: 900; padding: 1px 6px; border-radius: 6px;
  background: #1e293b; color: #fde68a;
}
.card-meta-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; font-weight: 800; color: #64748b; margin-bottom: 3px;
}
.card-types-mini { display: inline-flex; align-items: center; gap: 3px; }
.card-types-mini img { height: 12px; image-rendering: pixelated; }
.card-desc {
  flex: 1; font-size: 11px; line-height: 1.36; color: #1e293b; font-weight: 600;
  background: var(--cream-2); border: 1px solid rgba(15,23,42,0.1);
  border-radius: 7px; padding: 5px 6px; overflow-y: auto;
}

/* ====== MODALS ====== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(8, 13, 24, 0.78); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-panel {
  background: var(--cream); color: var(--ink);
  border: 4px solid #334155; border-radius: 18px;
  padding: 20px 24px; max-width: 980px; width: 100%; max-height: 88vh;
  overflow-y: auto; box-shadow: 0 10px 0 rgba(15,23,42,0.55), 0 24px 60px rgba(0,0,0,0.7);
}
.modal-title {
  margin: 0 0 12px; font-size: 20px; font-weight: 900; color: #0f172a;
  display: flex; align-items: center; justify-content: space-between;
}
.reward-cards-row {
  display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin: 16px 0;
}
.reward-cards-row .poke-card { margin: 0; }
.reward-cards-row .poke-card:hover { transform: translateY(-10px) scale(1.06) !important; margin: 0; }

.action-row { display: flex; gap: 12px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.btn-primary {
  padding: 10px 18px; border-radius: 11px; border: 2.5px solid #fff;
  background: linear-gradient(180deg, #f97316, #dc2626); color: #fff;
  font-size: 14px; font-weight: 900; cursor: pointer;
  box-shadow: 0 4px 0 #7f1d1d;
}
.btn-secondary {
  padding: 9px 16px; border-radius: 10px;
  background: #e2e8f0; border: 2px solid #94a3b8; color: #0f172a;
  font-size: 13px; font-weight: 800; cursor: pointer;
}
.btn-primary:hover, .btn-secondary:hover { filter: brightness(1.06); transform: translateY(-1px); }

.evo-splash { text-align: center; padding: 20px; }
.evo-compare {
  display: flex; align-items: center; justify-content: center; gap: 28px; margin: 16px 0;
}
.evo-compare > div > img {
  width: 112px; height: 112px; object-fit: contain; image-rendering: pixelated;
  filter: drop-shadow(0 6px 12px rgba(245,158,11,0.55));
}
.evo-arrow { font-size: 34px; color: #ea580c; font-weight: 900; }

.stage-list { display: flex; flex-direction: column; gap: 9px; }
.stage-item {
  background: var(--cream-2); border: 2px solid #cbd5e1;
  border-radius: 11px; padding: 10px 12px; font-size: 13px; color: #1e293b;
  display: flex; align-items: center; gap: 12px;
}
.stage-item.mega-item { border-color: #ec4899; background: #fdf2f8; }
.stage-thumb { width: 58px; height: 58px; image-rendering: pixelated; object-fit: contain; flex-shrink: 0; }

/* ====== POKÉBONK TITLE / HOME SCREEN ====== */
.title-screen {
  position: relative; align-items: center; justify-content: center; padding: 24px;
  background: transparent;
}
.title-screen::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 38%, rgba(15,23,42,0.18) 0%, rgba(10,16,28,0.78) 85%);
}
.title-card {
  position: relative; z-index: 5; width: 100%; max-width: 790px;
  background: rgba(16, 23, 38, 0.88); border: 3px solid rgba(255,255,255,0.28);
  border-radius: 26px; padding: 30px 36px 28px; text-align: center;
  box-shadow: 0 14px 0 rgba(9,13,22,0.65), 0 30px 70px rgba(0,0,0,0.75);
  backdrop-filter: blur(10px);
}
.title-badge-row {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.1); border: 1.5px solid rgba(255,255,255,0.22);
  padding: 4px 14px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #fde68a;
  margin-bottom: 12px;
}
.title-logo {
  margin: 0; font-size: 46px; font-weight: 900; letter-spacing: 2px; line-height: 1.15;
  background: linear-gradient(180deg, #fef08a 0%, #fb923c 55%, #ef4444 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 5px 0 #7c2d12);
}
.title-sub { margin: 8px 0 16px; font-size: 14.5px; color: #e2e8f0; font-weight: 600; }
.title-parade {
  display: flex; align-items: flex-end; justify-content: center; gap: 22px;
  height: 112px; margin: 6px 0 22px;
  background: radial-gradient(ellipse at 50% 85%, rgba(251,146,60,0.26), transparent 68%);
  border-radius: 16px; padding-bottom: 8px;
}
.title-parade img {
  max-height: 94px; image-rendering: pixelated; object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,0.6)); transition: transform .2s;
}
.title-parade img:hover { transform: translateY(-8px) scale(1.1); }
.title-parade img.flip { transform: scaleX(-1); }
.title-parade img.flip:hover { transform: scaleX(-1) translateY(-8px) scale(1.1); }
.title-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.title-play-btn {
  padding: 15px 38px; border-radius: 16px; border: 3px solid #fff;
  background: linear-gradient(180deg, #fb923c 0%, #ea580c 55%, #dc2626 100%);
  color: #fff; font-size: 19px; font-weight: 900; letter-spacing: 1px; cursor: pointer;
  box-shadow: 0 6px 0 #7f1d1d, 0 14px 28px rgba(234,88,12,0.5);
  transition: transform .15s, filter .15s;
}
.title-play-btn:hover { transform: translateY(-3px) scale(1.03); filter: brightness(1.08); }
.title-sec-btn {
  padding: 14px 24px; border-radius: 14px; border: 2.5px solid rgba(255,255,255,0.3);
  background: rgba(30,41,59,0.92); color: #fff; font-size: 15px; font-weight: 800; cursor: pointer;
  box-shadow: 0 5px 0 rgba(0,0,0,0.45); transition: transform .15s, border-color .15s;
}
.title-sec-btn:hover { transform: translateY(-2px); border-color: #fde047; }

/* ====== TRAINER (CLASS) SELECT SCREEN ====== */
.trainer-screen {
  padding: 24px 32px 40px; align-items: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(249,115,22,0.24), transparent 55%),
    linear-gradient(180deg, #162033 0%, #0d1320 100%);
}
.trainer-layout {
  display: grid; grid-template-columns: 310px 1fr; gap: 22px;
  width: 100%; max-width: 1000px; align-items: start;
}
.trainer-list { display: flex; flex-direction: column; gap: 12px; }
.trainer-option {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: 14px; background: var(--cream); color: var(--ink);
  border: 3px solid #475569; cursor: pointer; transition: transform .15s, border-color .15s;
  box-shadow: 0 5px 0 rgba(0,0,0,0.45);
}
.trainer-option.selected { border-color: #f97316; box-shadow: 0 5px 0 #9a3412, 0 0 20px rgba(249,115,22,0.45); transform: translateX(4px); }
.trainer-option.locked { opacity: .55; filter: grayscale(.45); }
.trainer-option img.tr-ico {
  width: 52px; height: 52px; image-rendering: pixelated; object-fit: contain;
  background: #e2e8f0; border-radius: 10px; border: 2px solid #cbd5e1;
}
.trainer-detail {
  background: var(--cream); color: var(--ink);
  border: 3.5px solid #f97316; border-radius: 20px; padding: 20px 24px;
  box-shadow: 0 8px 0 rgba(15,23,42,0.55), 0 20px 44px rgba(0,0,0,0.55);
}
.trainer-stage-box {
  display: flex; align-items: flex-end; justify-content: center; gap: 22px;
  height: 148px; border-radius: 14px; padding: 12px; margin: 12px 0 14px;
  background: linear-gradient(180deg, #e0f2fe 0%, #f5f3ff 65%, #ede9fe 100%);
  border: 2.5px solid #334155;
}
.trainer-stage-box img { max-height: 112px; image-rendering: pixelated; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.65)); }
.arch-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.arch-chip {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800;
  background: #ffedd5; color: #9a3412; border: 1.5px solid #fdba74;
}

/* ====== SEPARATED STACKED KEYWORD TOOLTIP CARDS ====== */
.tooltip-box {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  max-width: 290px !important;
  display: none;
  flex-direction: column;
  gap: 7px;
  animation: tipFadeIn .16s ease-out;
}
@keyframes tipFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.kw-card {
  background: rgba(15, 22, 36, 0.96);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  padding: 8px 11px;
  color: #f1f5f9;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.65);
}
.kw-card.evo-card { border-left-color: #22c55e; }
.kw-card-title {
  font-size: 13px; font-weight: 900; color: #fde68a; margin-bottom: 2px;
}
.kw-card.evo-card .kw-card-title { color: #86efac; }

/* ====== TRAINER + SUMMONED POKÉMON STAGE ====== */
.player-stage-pair {
  display: flex; align-items: flex-end; gap: 18px; position: relative;
}
.trainer-on-field {
  height: 134px; image-rendering: pixelated; object-fit: contain;
  transform: scaleX(-1);
  filter: drop-shadow(0 8px 10px rgba(0,0,0,0.6));
  position: relative; z-index: 2;
}
.trainer-throw { animation: trainerThrow .32s ease-out; }
@keyframes trainerThrow {
  0% { transform: scaleX(-1) translateX(0) rotate(0deg); }
  40% { transform: scaleX(-1) translateX(-16px) rotate(-8deg); }
  100% { transform: scaleX(-1) translateX(0) rotate(0deg); }
}
.summon-pad {
  position: relative; display: flex; align-items: flex-end; justify-content: center;
  min-width: 150px; min-height: 146px;
}
.summon-sprite {
  height: 136px; max-width: 160px; object-fit: contain;
  image-rendering: pixelated;
  transform: scaleX(-1);
  filter: drop-shadow(0 8px 10px rgba(0,0,0,0.55));
  position: relative; z-index: 2;
}
.summon-pop { animation: summonPop .28s cubic-bezier(.2,1.25,.4,1); }
@keyframes summonPop {
  0% { transform: scaleX(-1) scale(0.15); filter: brightness(4) drop-shadow(0 0 24px #ef4444); opacity: 0.4; }
  65% { transform: scaleX(-1) scale(1.12); filter: brightness(1.8) drop-shadow(0 0 18px #fff); opacity: 1; }
  100% { transform: scaleX(-1) scale(1); filter: drop-shadow(0 8px 10px rgba(0,0,0,0.55)); opacity: 1; }
}
.summon-recall { animation: summonRecall .24s ease-in forwards; }
@keyframes summonRecall {
  0% { transform: scaleX(-1) scale(1); filter: brightness(2) drop-shadow(0 0 18px #ef4444); opacity: 1; }
  100% { transform: scaleX(-1) scale(0.1); filter: brightness(4); opacity: 0; }
}

/* ====== V3 STAGE PROPORTIONS: TRAINER ANCHOR + 5-TIER POKÉMON SCALE ====== */
:root {
  --stage-trainer-h: clamp(168px, 23vh, 214px);
}
.trainer-on-field,
.enemy-trainer-on-field {
  height: var(--stage-trainer-h);
  width: auto;
  object-fit: contain;
  object-position: bottom center;
}
.battle-pad {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 124px;
  min-height: 0;
  padding-bottom: 12px;
}
.ground-ring {
  bottom: 0;
}
.enemy-sprite-2d,
.summon-sprite {
  width: auto;
  height: calc(var(--stage-trainer-h) * 1.0);
  max-height: 44vh;
  max-width: calc(var(--stage-trainer-h) * 1.72);
  min-height: 68px;
  object-fit: contain;
  object-position: bottom center;
  zoom: 1;
}
.enemy-sprite-2d[data-size="xs"],
.summon-sprite[data-size="xs"] {
  height: calc(var(--stage-trainer-h) * 0.58);
  max-width: calc(var(--stage-trainer-h) * 0.96);
}
.enemy-sprite-2d[data-size="s"],
.summon-sprite[data-size="s"] {
  height: calc(var(--stage-trainer-h) * 0.78);
  max-width: calc(var(--stage-trainer-h) * 1.28);
}
.enemy-sprite-2d[data-size="m"],
.summon-sprite[data-size="m"] {
  height: calc(var(--stage-trainer-h) * 1.02);
  max-width: calc(var(--stage-trainer-h) * 1.6);
}
.enemy-sprite-2d[data-size="l"],
.summon-sprite[data-size="l"] {
  height: calc(var(--stage-trainer-h) * 1.22);
  max-width: calc(var(--stage-trainer-h) * 1.88);
}
.enemy-sprite-2d[data-size="xl"],
.summon-sprite[data-size="xl"] {
  height: calc(var(--stage-trainer-h) * 1.40);
  max-width: calc(var(--stage-trainer-h) * 2.15);
}

/* Multi-Summon Squad Formation (up to 4 Pokémon attacking together side-by-side!) */
.summon-squad {
  position: relative;
  width: 320px;
  height: calc(var(--stage-trainer-h) * 1.44);
}
.summon-slot-item {
  position: absolute;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 112px;
  padding-bottom: 12px;
  pointer-events: none;
}
.summon-slot-0 { left: 10px;  bottom: 4px;  z-index: 4; }
.summon-slot-1 { left: 126px; bottom: 28px; z-index: 3; }
.summon-slot-2 { left: 54px;  bottom: 56px; z-index: 2; }
.summon-slot-3 { left: 168px; bottom: 0px;  z-index: 5; }

/* ====== BATTLE FIELD BAR (WEATHER / TERRAIN / HAZARDS TOP-CENTER) ====== */
.battle-field-bar {
  position: absolute;
  top: clamp(68px, 8.8vh, 92px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 18;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: min(640px, 72vw);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.34);
  pointer-events: auto;
}
.field-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  background: rgba(30, 41, 59, 0.85);
  color: #f8fafc;
  white-space: nowrap;
  cursor: help;
}
.field-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  flex-shrink: 0;
}
.field-badge.sun { border-color: #fb923c; color: #fed7aa; background: rgba(154, 52, 18, 0.82); }
.field-badge.rain { border-color: #38bdf8; color: #bae6fd; background: rgba(7, 89, 133, 0.82); }
.field-badge.snow { border-color: #a5f3fc; color: #ecfeff; background: rgba(21, 94, 117, 0.82); }
.field-badge.sand { border-color: #fbbf24; color: #fef3c7; background: rgba(120, 53, 15, 0.82); }
.field-badge.grassy { border-color: #4ade80; color: #dcfce7; background: rgba(20, 83, 45, 0.82); }
.field-badge.electric { border-color: #facc15; color: #fef9c3; background: rgba(113, 63, 18, 0.82); }
.field-badge.psychic { border-color: #e879f9; color: #fae8ff; background: rgba(112, 26, 117, 0.82); }
.field-badge.aurora { border-color: #67e8f9; color: #cffafe; background: rgba(14, 116, 144, 0.82); }
.field-badge.hazard { border-color: #f87171; color: #fee2e2; background: rgba(127, 29, 29, 0.82); }

/* ====== DELAYED HP BAR TRAIL (WHITE CATCH-UP BAR) ====== */
.pk-bar-track {
  position: relative;
  overflow: hidden;
}
.pk-bar-trail {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(254, 240, 138, 0.95));
  border-radius: inherit;
  transition: width 0.52s cubic-bezier(0.22, 1, 0.36, 1) 0.14s;
  pointer-events: none;
}
.pk-bar-fill {
  position: relative;
  z-index: 2;
  transition: width 0.14s ease-out;
}
.pk-bar-text {
  z-index: 3;
}

/* Stronger Hit-Stop & Knockback Squash/Stretch */
.hit-heavy { animation: hitHeavy .34s cubic-bezier(.15,.9,.25,1); }
@keyframes hitHeavy {
  0%   { filter: brightness(4) drop-shadow(0 0 24px #fff); transform: translateX(0) scale(1); }
  18%  { filter: brightness(3.2) drop-shadow(0 0 20px #fb923c); transform: translateX(22px) scaleX(0.82) scaleY(1.14); }
  45%  { transform: translateX(-8px) scaleX(1.08) scaleY(0.94); }
  75%  { transform: translateX(5px) scale(1); }
  100% { filter: drop-shadow(0 8px 10px rgba(0,0,0,0.55)); transform: translateX(0) scale(1); }
}
.screen-shake-heavy { animation: screenShakeHeavy .32s ease-out; }
@keyframes screenShakeHeavy {
  0%,100% { transform: translate(0,0); }
  15% { transform: translate(-11px, 7px); }
  35% { transform: translate(10px, -7px); }
  55% { transform: translate(-7px, -4px); }
  75% { transform: translate(6px, 4px); }
}

/* Redesigned Clean Big-Art Pokémon Card (Bigger Pokémon, Zero Clutter!) */
.poke-card {
  width: 178px !important;
  height: 248px !important;
  padding: 6px 8px 8px !important;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1px 18px 2px 20px !important;
  font-size: 13px !important;
}
.card-art-wrap {
  height: 130px !important;
  margin: 3px 0 6px !important;
  border-radius: 10px !important;
}
.card-art-wrap img.card-sprite {
  width: auto !important;
  height: auto !important;
  max-width: 118px !important;
  max-height: 118px !important;
  zoom: 1.55;
}
.card-meta-row { display: none !important; }
.card-evo-badge { display: none !important; }
.card-desc {
  font-size: 11.5px !important;
  line-height: 1.4 !important;
  padding: 6px 7px !important;
}

/* ====== PLAYER ON-FIELD STATUS PLATE (SLAY THE SPIRE STYLE BELOW TRAINER) ====== */
.player-plate {
  margin-top: 8px;
  padding: 7px 12px;
  border-radius: 12px;
  background: var(--hud-bg);
  border: 2px solid rgba(56, 189, 248, 0.55);
  min-width: 225px;
  max-width: 320px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.55);
  align-self: flex-start;
}
.player-plate-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12.5px; font-weight: 900; margin-bottom: 5px; color: #fff;
}
.player-plate .pk-bar-track { margin-bottom: 4px; }
.pk-bar-fill.tide { background: linear-gradient(90deg, #0284c7, #38bdf8, #7dd3fc); }
.pk-bar-fill.tide-high { background: linear-gradient(90deg, #2563eb, #06b6d4, #fde047); }
.pk-bar-fill.grass-res { background: linear-gradient(90deg, #15803d, #22c55e, #86efac); }
.buff-pill.tide { border-color: #38bdf8; color: #bae6fd; background: rgba(12,74,110,0.92); }
.buff-pill.tide-high { border-color: #fde047; color: #fef08a; background: rgba(29,78,216,0.92); }
.buff-pill.heat { border-color: #f97316; color: #fed7aa; background: rgba(154,52,18,0.9); }
.buff-pill.overheat { border-color: #ef4444; color: #fecaca; background: rgba(153,27,27,0.95); }
.buff-pill.grass { border-color: #22c55e; color: #bbf7d0; background: rgba(20,83,45,0.92); }
.buff-pill.sun { border-color: #facc15; color: #fef08a; background: rgba(133,77,14,0.92); }
.buff-pill.para { border-color: #facc15; color: #fef08a; }
.buff-pill.sleep { border-color: #818cf8; color: #c7d2fe; }
.card-cost.reduced {
  background: radial-gradient(circle at 35% 30%, #bbf7d0, #16a34a) !important;
}

/* ====== SCRY / UNDERCURRENT (潜流/预见) SELECTION ====== */
.scry-card-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  position: relative;
}
.scry-card-wrap .poke-card.scry-discard {
  opacity: 0.42;
  filter: grayscale(0.7);
  border-color: #ef4444 !important;
  transform: scale(0.94);
}
.scry-tag {
  font-size: 11.5px; font-weight: 900; padding: 2px 9px; border-radius: 999px;
}
.scry-tag.keep { background: #dbeafe; color: #1d4ed8; }
.scry-tag.discard { background: #fee2e2; color: #b91c1c; }

/* ====== BRANCHED EVOLUTION CHOICE CARDS ====== */
.branch-evo-grid {
  display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 16px 0;
}
.branch-choice-card {
  width: 280px; background: var(--cream-2);
  border: 3px solid #3b82f6; border-radius: 16px; padding: 14px 16px;
  cursor: pointer; text-align: center;
  box-shadow: 0 6px 0 rgba(30,58,138,0.45);
  transition: transform .16s, border-color .16s;
}
.branch-choice-card:hover {
  transform: translateY(-6px) scale(1.03);
  border-color: #f97316;
}
.branch-catalyst-pill {
  display: inline-block; font-size: 11px; font-weight: 900;
  padding: 2px 9px; border-radius: 999px;
  background: #1e293b; color: #fde68a; margin-bottom: 8px;
}
.branch-choice-card img.branch-sprite {
  height: 96px; object-fit: contain; image-rendering: pixelated;
  display: block; margin: 6px auto 8px;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,0.3));
}


/* ====== OFFICIAL POKÉMON PIXEL ITEM ICONS (ZERO EMOJI) ====== */
.item-ico {
  width: 24px; height: 24px;
  image-rendering: pixelated;
  object-fit: contain;
  vertical-align: middle;
}
.pk-slot .item-ico { width: 26px; height: 26px; }
.map-node .node-ico img.item-ico { width: 32px; height: 32px; }

/* ====== FULL-CARD EVOLUTION COMPARISON MODAL ====== */
.evo-card-compare {
  gap: 24px !important;
  margin: 18px 0 22px !important;
  align-items: center;
}
.evo-card-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.evo-card-col .poke-card {
  margin: 0 !important;
  cursor: default !important;
  text-align: left;
}
.evo-card-col .poke-card:hover {
  transform: none !important;
  margin: 0 !important;
}
.evo-card-col .poke-card .card-inspect-btn {
  display: none;
}
.evo-card-col .poke-card img.card-sprite {
  width: auto !important;
  height: auto !important;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,0.25)) !important;
}
.evo-card-col .poke-card .card-types-mini img {
  width: auto !important;
  height: 12px !important;
  filter: none !important;
}
.evo-card-col .poke-card .card-cat-badge {
  width: auto !important;
  height: 15px !important;
  filter: none !important;
}
.evo-new-card-col .poke-card {
  box-shadow: 0 8px 0 rgba(15,23,42,0.5), 0 0 28px rgba(245,158,11,0.55) !important;
  animation: evoCardPop .42s cubic-bezier(.2,1.25,.35,1);
}
.evo-new-card-col.is-mega .poke-card {
  box-shadow: 0 8px 0 #831843, 0 0 32px rgba(236,72,153,0.72) !important;
}
.evo-stage-label {
  font-size: 12px;
  font-weight: 900;
  padding: 2px 12px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
}
.evo-stage-label.new {
  background: linear-gradient(90deg, #f97316, #ea580c);
  color: #fff;
}
@keyframes evoCardPop {
  0%   { transform: scale(0.86); filter: brightness(1.6); }
  65%  { transform: scale(1.05); filter: brightness(1.1); }
  100% { transform: scale(1); filter: none; }
}

/* ====== FULL-HEIGHT REDESIGNED TRAINER SCREEN ====== */
.trainer-screen {
  height: 100vh !important;
  height: 100dvh !important;
  padding: 16px 24px 18px !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 12px !important;
}
.trainer-topbar {
  width: 100%;
  max-width: 1240px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--cream);
  color: var(--ink);
  border: 3px solid #334155;
  border-radius: 16px;
  padding: 10px 20px;
  box-shadow: 0 5px 0 rgba(15,23,42,0.45);
  flex-shrink: 0;
}
.trainer-topbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
}
.trainer-layout {
  width: 100% !important;
  max-width: 1240px !important;
  flex: 1 !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: 300px 1fr !important;
  gap: 18px !important;
  align-items: stretch !important;
}
.trainer-list-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background: rgba(15, 23, 42, 0.58);
  border: 2.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.trainer-list-head {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 900;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.72);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}
.trainer-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px !important;
  gap: 8px !important;
}
.trainer-option {
  width: 100%;
  text-align: left;
  padding: 9px 11px !important;
  border-radius: 12px !important;
  box-shadow: 0 3px 0 rgba(0,0,0,0.35) !important;
}
.trainer-option img.tr-ico {
  width: 46px !important;
  height: 46px !important;
  flex-shrink: 0;
}
.trainer-detail {
  height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  padding: 18px 22px !important;
  overflow: hidden !important;
}
.trainer-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.trainer-stat-pills {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.t-stat-pill {
  font-size: 12px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--cream-2);
  border: 1.5px solid #cbd5e1;
  color: #1e293b;
}
.trainer-stage-box {
  height: 124px !important;
  margin: 0 !important;
  gap: 24px !important;
  flex-shrink: 0;
}
.trainer-stage-box img.stage-trainer-sp {
  height: 98px;
  transform: scaleX(-1);
  image-rendering: pixelated;
}
.trainer-stage-box img.stage-poke-sp {
  max-height: 82px;
  image-rendering: pixelated;
  transform: scaleX(-1);
}
.trainer-gear-row {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 10px;
  flex-shrink: 0;
}
.gear-box {
  background: var(--cream-2);
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  padding: 9px 12px;
}
.gear-box.relic-box {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gear-potion-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--cream);
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
  color: #1e293b;
  cursor: help;
}
.trainer-deck-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trainer-deck-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
  flex-shrink: 0;
}
.trainer-deck-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
  align-content: start;
  padding-right: 4px;
}
.roster-card {
  background: var(--cream-2);
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: transform .14s, border-color .14s;
}
.roster-card:hover {
  transform: translateY(-2px);
  border-color: #f97316;
}
.roster-card.starter-slot {
  background: linear-gradient(180deg, #fff7ed, #ffedd5);
  border-color: #fb923c;
  cursor: default;
}
.roster-card.starter-slot:hover { transform: none; }
.roster-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.roster-sp-box {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: radial-gradient(circle, #fff, rgba(254,215,170,0.55));
  border: 1.5px solid rgba(15,23,42,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.roster-sp-box img {
  max-width: 44px;
  max-height: 44px;
  image-rendering: pixelated;
  object-fit: contain;
}
.roster-mini-group {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 50px;
}
.roster-mini-sp {
  width: 34px;
  height: 34px;
  image-rendering: pixelated;
  object-fit: contain;
}
.roster-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.roster-cost {
  font-size: 11px;
  font-weight: 900;
  padding: 1px 7px;
  border-radius: 999px;
  background: #ea580c;
  color: #fff;
}
.roster-count {
  font-size: 12px;
  font-weight: 900;
  padding: 1px 7px;
  border-radius: 999px;
  background: #1e293b;
  color: #fde68a;
}
.roster-name {
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
}
.roster-eff {
  font-size: 11px;
  line-height: 1.35;
  color: #475569;
}
.trainer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 2px solid #e2e8f0;
  flex-shrink: 0;
}

/* ====== ENEMY TRAINER ON FIELD (STANDING BESIDE POKÉMON, NO BOX) & 3-ACT STEPPER ====== */
.enemy-stage-pair {
  display: flex;
  align-items: flex-end;
  gap: 28px;
}
.enemy-trainer-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin-bottom: 6px;
}
.enemy-trainer-on-field {
  height: 134px;
  image-rendering: pixelated;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,0.6));
  position: relative;
  z-index: 2;
}
.enemy-trainer-ring {
  border-color: rgba(248, 113, 113, 0.65) !important;
  box-shadow: 0 0 16px rgba(248, 113, 113, 0.35) !important;
}
.enemy-trainer-unit.is-boss .enemy-trainer-ring {
  border-color: rgba(250, 204, 21, 0.85) !important;
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.55) !important;
}
.enemy-speech-bubble {
  position: relative;
  max-width: 220px;
  margin-bottom: 8px;
  padding: 6px 11px;
  border-radius: 12px;
  background: rgba(250, 246, 235, 0.94);
  border: 2px solid #334155;
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.enemy-speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: rgba(250, 246, 235, 0.94);
  border-right: 2px solid #334155;
  border-bottom: 2px solid #334155;
}
.enemy-trainer-plate {
  margin-top: 8px;
  padding: 5px 11px;
  border-radius: 10px;
  background: var(--hud-bg);
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  text-align: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}
.enemy-trainer-unit.is-boss .enemy-trainer-plate {
  border-color: #f59e0b;
}
.enemy-trainer-name {
  font-size: 12px;
  font-weight: 900;
  color: #fde68a;
  white-space: nowrap;
}
.boss-balls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
}
.boss-ball-dot {
  width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: opacity .2s, transform .2s;
}
.boss-ball-dot img {
  width: 17px;
  height: 17px;
  image-rendering: pixelated;
}
.boss-ball-dot.status-active {
  box-shadow: 0 0 8px rgba(251, 146, 60, 0.9);
  transform: scale(1.12);
}
.boss-ball-dot.status-fainted {
  opacity: 0.28;
  filter: grayscale(1);
}
.boss-balls-count {
  font-size: 10.5px;
  font-weight: 800;
  color: #cbd5e1;
  margin-left: 3px;
}
.ace-badge {
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 5px;
  background: #dc2626;
  color: #fef08a;
  margin-left: 3px;
}
.route-act-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}
.act-step {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 12px;
  background: rgba(250, 246, 235, 0.72);
  border: 2px solid rgba(51, 65, 85, 0.2);
  color: #64748b;
  font-size: 12px;
}
.act-step span {
  font-size: 10.5px;
  font-weight: 900;
  padding: 1px 7px;
  border-radius: 999px;
  background: #cbd5e1;
  color: #334155;
}
.act-step strong {
  font-weight: 800;
}
.act-step.current {
  background: #fff;
  border-color: #ea580c;
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.2);
}
.act-step.current span {
  background: #ea580c;
  color: #fff;
}
.act-step.done {
  background: #dcfce7;
  border-color: #16a34a;
  color: #166534;
}
.act-step.done span {
  background: #16a34a;
  color: #fff;
}
.act-step-sep {
  color: #94a3b8;
  font-weight: 900;
}
.route-region {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.route-tier-tag {
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.14);
  color: #334155;
}
.route-node.legendary-slot {
  border-color: #9333ea !important;
  box-shadow: 0 0 14px rgba(147, 51, 234, 0.35);
}

/* ==================== SPRITE STYLE RENDERING & SETTINGS MODAL ==================== */
html[data-sprite-style="official"] .px,
html[data-sprite-style="official"] .card-sprite,
html[data-sprite-style="official"] .enemy-sprite-2d,
html[data-sprite-style="official"] .starter-ring-art,
html[data-sprite-style="official"] .branch-sprite,
html[data-sprite-style="official"] .dex-evo-thumb,
html[data-sprite-style="official"] .roster-mini-sp,
html[data-sprite-style="official"] .roster-sp-box img,
html[data-sprite-style="ani"] .px,
html[data-sprite-style="ani"] .card-sprite,
html[data-sprite-style="ani"] .enemy-sprite-2d,
html[data-sprite-style="ani"] .starter-ring-art,
html[data-sprite-style="ani"] .branch-sprite,
html[data-sprite-style="ani"] .dex-evo-thumb,
html[data-sprite-style="ani"] .roster-mini-sp,
html[data-sprite-style="ani"] .roster-sp-box img,
html[data-sprite-style="home"] .px,
html[data-sprite-style="home"] .card-sprite,
html[data-sprite-style="home"] .enemy-sprite-2d,
html[data-sprite-style="home"] .starter-ring-art,
html[data-sprite-style="home"] .branch-sprite,
html[data-sprite-style="home"] .dex-evo-thumb,
html[data-sprite-style="home"] .roster-mini-sp,
html[data-sprite-style="home"] .roster-sp-box img {
  image-rendering: auto !important;
}

.settings-modal .settings-section {
  margin-top: 14px;
}
.settings-modal .settings-section-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 800;
  color: var(--uni-ink, #1e293b);
}
.settings-style-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.settings-style-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.88);
  text-align: left;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.settings-style-card:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.65);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}
.settings-style-card.is-active {
  border-color: #2563eb;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(219, 234, 254, 0.85));
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.16);
}
.settings-style-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 112px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.06);
  padding: 4px;
}
.settings-sprite-prev {
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
  image-rendering: auto;
}
.settings-sprite-prev.is-pixel {
  image-rendering: pixelated;
}
.settings-style-info {
  flex: 1;
  min-width: 0;
}
.settings-style-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.settings-style-head strong {
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
}
.settings-style-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}
.settings-style-info p {
  margin: 0;
  font-size: 12.5px;
  color: #475569;
  line-height: 1.4;
}
.settings-style-check {
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 900;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: #475569;
}
.settings-style-card.is-active .settings-style-check {
  background: #2563eb;
  color: #fff;
}
.settings-audio-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  font-weight: 800;
  color: var(--uni-ink, #1e293b);
}

/* ---- PTCG Full-Art Alt-Art Selector in Pokedex Detail ---- */
.dex-wiki-altarts {
  margin-top: 14px;
}
.dex-altart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.dex-altart-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.dex-altart-item:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(250, 204, 21, 0.65);
}
.dex-altart-item.is-equipped {
  border-color: #facc15;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.25);
  background: rgba(30, 41, 59, 0.85);
}
.dex-altart-item.is-previewing {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
  opacity: 1 !important;
  filter: none !important;
}
.dex-altart-item.is-locked {
  opacity: 0.55;
  cursor: pointer;
  filter: grayscale(0.7);
}
.dex-altart-item.is-locked:hover {
  opacity: 0.9;
  filter: grayscale(0.2);
}
.dex-altart-item img {
  width: 100%;
  aspect-ratio: 63 / 88;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.dex-altart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 63 / 88;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
}
.dex-altart-label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

/* ---- Dual-Layer 3D Popout for Alt-Art Cards ---- */
.card-art {
  transform-style: preserve-3d;
}
.card-sprite.card-altart-bg {
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), filter 0.24s ease;
}
.card-sprite.card-altart-fg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 2;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), filter 0.24s ease;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}
.poke-card:hover .card-sprite.card-altart-bg,
.dex-showcase-card:hover .card-sprite.card-altart-bg {
  transform: translateZ(-10px) scale(0.97);
  filter: brightness(0.9);
}
.poke-card:hover .card-sprite.card-altart-fg,
.dex-showcase-card:hover .card-sprite.card-altart-fg {
  transform: translateZ(28px) scale(1.07);
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.6));
}
