﻿

.battle-screen {
  position: fixed; inset: 0; z-index: 4; display: flex; padding: 0;
  background: #0a0810;
}
.battle-wrap { position: absolute; inset: 0; }

.battle-screen.quake { animation: quake .46s cubic-bezier(.36,.07,.19,.97); }
.battle-screen.quake-hard { animation: quakeHard .62s cubic-bezier(.36,.07,.19,.97); }
.battle-screen.quake::after, .battle-screen.quake-hard::after {
  content: ''; position: absolute; inset: 0; z-index: 30; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 50%, transparent 45%, rgba(180,20,20,.42));
  animation: quakeFlash .5s ease-out forwards;
}
@keyframes quakeFlash { from { opacity: 1; } to { opacity: 0; } }
@keyframes quake {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-9px, 5px); }
  30% { transform: translate(8px, -6px); }
  45% { transform: translate(-6px, -3px); }
  60% { transform: translate(5px, 4px); }
  80% { transform: translate(-3px, 2px); }
}
@keyframes quakeHard {
  0%, 100% { transform: translate(0, 0) scale(1); }
  10% { transform: translate(-16px, 9px) scale(1.012); }
  22% { transform: translate(15px, -12px) scale(1.012); }
  34% { transform: translate(-13px, -7px) scale(1.008); }
  46% { transform: translate(11px, 9px) scale(1.008); }
  58% { transform: translate(-8px, 5px) scale(1.004); }
  72% { transform: translate(6px, -4px); }
  86% { transform: translate(-3px, 2px); }
}
@media (prefers-reduced-motion: reduce) {
  .battle-screen.quake, .battle-screen.quake-hard { animation: none; }
}

.b-top {
  position: absolute; z-index: 12; top: 0; left: 0; right: 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: clamp(10px, 1.4vh, 18px) clamp(12px, 1.6vw, 26px);
  pointer-events: none;
  background: linear-gradient(rgba(4,3,8,.62), transparent);
}
.b-top > * { pointer-events: auto; }

.bt-round {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 13px; border-radius: 999px;
  background: rgba(8,7,14,.5); border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(3px);
}
.bt-lab {
  font-family: 'PixelTitle', monospace; font-size: 9px; color: var(--dim);
  letter-spacing: 1.5px; line-height: 1.4;
}
.bt-round b {
  font-family: 'PixelTitle', monospace; font-size: 15px; color: var(--t3);
  text-shadow: 2px 2px 0 #000;
}
.b-top.boss .bt-round { border-color: rgba(255,140,50,.5); }
.b-top.boss .bt-round b { color: var(--torch); }

.bt-right {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(8,7,14,.5); border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(3px);
}
.bt-em { display: flex; align-items: center; gap: 7px; }
.bt-em-ico { width: 20px; height: 24px; object-fit: contain; image-rendering: pixelated;
  filter: drop-shadow(0 0 7px rgba(79,214,106,.6)); }
.bt-em b { font-family: 'PixelTitle', monospace; font-size: 13px; color: var(--em); text-shadow: 1px 1px 0 #000; }
.bt-right .icon-btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); }

.turn-box {
  position: absolute; z-index: 7; right: clamp(12px, 1.6vw, 26px); bottom: clamp(10px, 1.6vh, 20px);
  display: flex; flex-direction: column; align-items: stretch; gap: 7px;
  width: clamp(260px, 28vw, 400px); pointer-events: none;
  padding: 9px 11px; border-radius: 10px;
  background: rgba(8,7,14,.55); border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(3px);
  box-shadow: 0 10px 26px rgba(0,0,0,.5);
}
.turn-order { display: flex; align-items: flex-end; gap: 5px; min-height: 44px; }
.to-chip {
  position: relative; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 5px;
  border: 1px solid rgba(255,255,255,.16); background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; opacity: .55;
  transition: transform .18s ease, opacity .18s ease;
}
.to-chip img { max-width: 26px; max-height: 26px; object-fit: contain; image-rendering: pixelated; }
.to-chip.hero { border-color: #5ecf5e; }
.to-chip.now { opacity: 1; border-color: var(--gold); box-shadow: 0 0 10px rgba(255,216,61,.8); transform: scale(1.16) translateY(-3px); }
.to-chip.done { opacity: .22; }
.to-st {
  position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  display: flex; gap: 1px;
}
.to-st-ico { width: 10px; height: 10px; filter: drop-shadow(0 1px 1px #000); }
.to-st-ico svg { width: 100%; height: 100%; }
.to-st-ico.good { color: #8fe08f; }
.to-st-ico.bad { color: #ff9d9d; }

.to-now { border-top: 1px solid rgba(255,255,255,.10); padding-top: 7px; }
.to-name {
  display: block; font-family: 'PixelTitle', monospace; font-size: 10px;
  color: var(--gold); letter-spacing: 1px; margin-bottom: 4px;
}
.to-name.friend { color: #8fe08f; }

.scene {
  position: absolute; inset: 0;
  overflow: hidden;
  background: #0d0b13;
  touch-action: manipulation;
}
.scene-bg {
  position: absolute; left: -4%; right: -4%; top: -4%; height: 74%;
  background-position: center 38%;
  background-repeat: no-repeat;
  filter: saturate(.75) blur(5px) brightness(.7);
  transform: scale(1.04);
}
.scene-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(rgba(6,4,10,.35), rgba(6,4,10,.9));
}
.scene.art .scene-bg {
  left: 0; right: 0; top: 0; height: 100%;
  background-position: center bottom;
  filter: none; transform: none;
}
.scene.art .scene-bg::after { background: linear-gradient(rgba(6,4,10,.12), rgba(6,4,10,.34)); }
.scene.art .scene-floor, .scene.art .scene-fog { display: none; }
.scene.art::after { background: radial-gradient(95% 85% at 50% 55%, transparent 55%, rgba(4,3,8,.6) 100%); }

.scene-fog {
  position: absolute; left: 0; right: 0; top: 44%; height: 26%;
  background: linear-gradient(transparent, rgba(150,160,190,.16) 45%, transparent);
  filter: blur(6px); pointer-events: none;
}
.scene-floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 46%;
  overflow: hidden;
  perspective: 320px; perspective-origin: 50% 0%;
}
.sf-tiles {
  position: absolute; left: -40%; right: -40%; top: 0; bottom: -60%;
  background-repeat: repeat; background-size: 54px 54px;
  transform: rotateX(66deg); transform-origin: 50% 0%;
  filter: brightness(.5) saturate(.85);
  image-rendering: pixelated;
}
.scene-floor::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(rgba(8,6,12,.92), rgba(8,6,12,.25) 30%, rgba(8,6,12,.6));
}
.scene-light { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; }
.scene::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(85% 75% at 50% 55%, transparent 40%, rgba(4,3,8,.75) 100%);
}

.side { position: absolute; bottom: max(15%, 132px); }
.side-hero {
  z-index: 6;
  left: 6%; width: 32%; display: flex; align-items: flex-end; gap: 4px;
}
.side-hero .unit:nth-child(2) { margin: 0 0 46px -22px; z-index: -1; }

.side-enemies { z-index: 2; right: 4%; width: 56%; height: 58%; }
.side-enemies .unit { position: absolute; bottom: 0; }
.side-enemies .unit { pointer-events: none; }
.side-enemies .unit-sprite,
.side-enemies .unit-name,
.side-enemies .unit-bar { pointer-events: auto; }
.side-enemies .unit:hover, .side-enemies .unit.targeted { z-index: 60 !important; }

.unit {
  position: relative; display: flex; flex-direction: column; align-items: center;
  transition: transform .18s ease, opacity .4s ease;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.unit, .unit * { outline: none; }
.unit img { -webkit-user-drag: none; user-select: none; }
.unit-plate {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  margin-bottom: 6px; pointer-events: none;
}
.unit-sprite { display: flex; align-items: flex-end; justify-content: center; }
.unit-sprite img {
  display: block; object-fit: contain; image-rendering: pixelated;
  filter: drop-shadow(0 6px 5px rgba(0,0,0,.65));
  transition: filter .12s;
}
.unit-name {
  font-size: 13px; color: #e8e2d6; text-shadow: 1px 1px 0 #000;
  max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.unit-bar {
  width: 62px; height: 6px;
  background: #1a0d0d; border: 1px solid #000; border-radius: 2px; overflow: hidden;
}
.unit-bar .fill {
  height: 100%; width: 100%;
  background: linear-gradient(#ff6b6b, var(--hp));
  transition: width .3s ease;
}
.unit.boss .unit-bar { width: 92px; height: 7px; }
.unit.boss .unit-bar .fill { background: linear-gradient(#ffb03c, #d9412a); }
.unit.boss .unit-name { color: var(--gold); font-family: 'PixelTitle', monospace; font-size: 9px; }
.unit-status { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; min-height: 14px; }
.st-pill {
  display: flex; align-items: center; gap: 3px;
  padding: 1px 4px 1px 3px; border-radius: 4px;
  background: rgba(8,7,14,.7); border: 1px solid rgba(255,255,255,.14);
  pointer-events: auto;
}
.st-pill b { font-family: 'PixelTitle', monospace; font-size: 8px; color: #fff; line-height: 1; }
.st-ico { width: 11px; height: 11px; }
.st-ico svg { width: 100%; height: 100%; }
.st-pill.good { border-color: rgba(99,194,104,.55); }
.st-pill.good .st-ico { color: #8fe08f; }
.st-pill.bad { border-color: rgba(224,69,69,.55); }
.st-pill.bad .st-ico { color: #ff9d9d; }
.st-pill.last { animation: stLast .8s ease-in-out infinite; }
@keyframes stLast { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.unit.enemy .unit-sprite::before {
  content: ''; position: absolute; left: 50%; bottom: 2px;
  width: 62%; height: 12px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0,0,0,.55), transparent 70%);
  pointer-events: none;
}

.unit.acting .unit-sprite img { filter: drop-shadow(0 6px 5px rgba(0,0,0,.65)) drop-shadow(0 0 8px rgba(255,216,61,.9)); }
.unit.acting { animation: bob .7s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

@keyframes aim { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.unit-name, .unit-bar, .unit-sprite, .unit-status {
  border: 0; outline: 0; background-clip: padding-box;
}
.unit ::selection { background: transparent; }
.unit-name::selection { background: transparent; }

.unit.hit { animation: shake .3s ease; }
.unit.hit .unit-sprite img { filter: drop-shadow(0 6px 5px rgba(0,0,0,.65)) brightness(2.6) saturate(.2); }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-7px); } 45% { transform: translateX(6px); }
  70% { transform: translateX(-3px); }
}
.unit.lunge-r { transform: translateX(34px) scale(1.04); }
.unit.lunge-l { transform: translateX(-30px) scale(1.04); }
.unit.dead { opacity: 0; transform: translateY(14px) rotate(9deg) scale(.85); }
.unit.spawn { animation: spawnIn .45s ease; }
@keyframes spawnIn { from { opacity: 0; transform: translateY(-18px) scale(.8); } to { opacity: 1; } }

.fx-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.fx-num {
  position: absolute; transform: translate(-50%, -50%);
  font-family: 'PixelTitle', monospace; font-size: 13px; color: #fff;
  text-shadow: 2px 2px 0 #000, 0 0 8px rgba(0,0,0,.9);
  animation: floatUp 1s ease-out forwards;
}
.fx-num.crit { font-size: 18px; color: #ffd83d; }
.fx-num.heal { color: #7de08a; }
.fx-num.mana { color: var(--mana); }
.fx-num.dot { font-size: 13px; color: #b58cff; }
.fx-num.gone { font-size: 13px; color: rgba(255,255,255,.7); }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); }
  25% { opacity: 1; transform: translate(-50%, -70%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(1); }
}
.fx-gem {
  position: absolute; width: 22px; height: 26px;
  object-fit: contain; image-rendering: pixelated; pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(79,214,106,.75));
  will-change: transform, opacity;
}
.hchip.em.pop { animation: emPop .22s ease; }
@keyframes emPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.16); box-shadow: 0 0 18px rgba(79,214,106,.55); }
  100% { transform: scale(1); }
}
.hchip.ar.pop { animation: arPop .22s ease; }
@keyframes arPop {
  0% { transform: scale(1); }
  45% { transform: scale(.9); }
  100% { transform: scale(1); }
}
.hchip.ar.kept { animation: arKept .7s ease; }
@keyframes arKept {
  0%, 100% { border-color: rgba(255,255,255,.12); }
  35% { border-color: #63c268; box-shadow: 0 0 18px rgba(99,194,104,.6); }
}

.fx-slash {
  position: absolute; width: 66px; height: 66px; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,255,255,.95) 0%, rgba(255,220,140,.55) 35%, transparent 70%);
  animation: pop .3s ease-out forwards;
}
.fx-magic {
  position: absolute; inset: 0;
  background: radial-gradient(60% 60% at 50% 55%, rgba(150,110,255,.55), transparent 70%);
  animation: flash .5s ease-out forwards;
}
.fx-flash { position: absolute; inset: 0; background: rgba(255,255,255,.75); animation: flash .28s ease-out forwards; }
.fx-arrow {
  position: absolute; width: 26px; height: 3px; background: linear-gradient(90deg, transparent, #ffe9b0);
  box-shadow: 0 0 6px rgba(255,220,150,.9);
}
@keyframes pop { from { opacity: 1; transform: translate(-50%,-50%) scale(.4); } to { opacity: 0; transform: translate(-50%,-50%) scale(1.5); } }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

.banner {
  position: absolute; left: 0; right: 0; top: 38%; z-index: 8; text-align: center;
  font-family: 'PixelTitle', monospace; font-size: 15px; color: #fff;
  text-shadow: 2px 2px 0 #000, 0 0 20px rgba(255,120,40,.9);
  animation: bannerIn 1.1s ease forwards; pointer-events: none;
}
@keyframes bannerIn {
  0% { opacity: 0; transform: scale(.6); }
  20% { opacity: 1; transform: scale(1.08); }
  75% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.02); }
}

.b-center {
  position: absolute; z-index: 11;
  left: clamp(12px, 1.6vw, 26px); bottom: calc(clamp(10px, 1.6vh, 20px) + var(--safe-b));
  width: min(420px, 28vw); text-align: left; pointer-events: none;
}
.b-log {
  display: flex; flex-direction: column; gap: 2px;
  min-height: 56px; font-size: 13px; line-height: 1.35;
}
.lg-line {
  color: rgba(239,232,220,.42); animation: lgIn .18s ease;
  transition: color .25s ease;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lg-line.now { color: #efe8dc; }
.lg-line b { color: rgba(255,255,255,.6); }
.lg-line.now b { color: #fff; }
.lg-line .lg-dim { color: inherit; opacity: .72; }
@keyframes lgIn { from { opacity: 0; transform: translateY(4px); } }

.b-hud {
  position: absolute; z-index: 11;
  left: 50%; transform: translateX(-50%);
  bottom: calc(clamp(10px, 1.6vh, 20px) + var(--safe-b));
  display: flex; align-items: center; gap: 14px;
}
.hud-side { display: flex; flex-direction: column; gap: 7px; }
.hchip {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 999px;
  background: rgba(8,7,14,.55); border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(3px);
}
.hchip b {
  font-family: 'PixelNum', 'PixelTitle', monospace; font-size: 26px; color: #fff;
  text-shadow: 2px 2px 0 #000; line-height: .8;
}
.hchip span {
  font-family: 'PixelNum', 'PixelTitle', monospace; font-size: 18px; color: var(--dim);
  letter-spacing: 1px; line-height: .8;
}
.hchip-ico { width: 20px; height: 22px; object-fit: contain; image-rendering: pixelated; }
.hchip.em b { color: var(--em); }
.hchip.em .hchip-ico { filter: drop-shadow(0 0 7px rgba(79,214,106,.6)); }
.hchip.ar b { color: #e8dfc8; }
.hchip.lv b { color: var(--gold); }
.hchip.mp b { color: var(--mana); }
.hchip-mana {
  width: 16px; height: 16px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: radial-gradient(circle at 40% 35%, #9fd0ff, var(--mana));
  box-shadow: 0 0 8px rgba(79,168,255,.7);
}

.hud-heart { position: relative; width: 92px; height: 92px; }
.hh {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; image-rendering: pixelated;
}
.hh-empty { filter: brightness(.85) drop-shadow(0 3px 4px rgba(0,0,0,.6)); }
.hh-clip {
  position: absolute; inset: 0;
  clip-path: inset(0 0 0 0);
  transition: clip-path .35s cubic-bezier(.2,.8,.3,1);
  filter: drop-shadow(0 0 12px rgba(224,52,60,.5));
}
.hud-heart.low .hh-clip { animation: heartBeat .9s ease-in-out infinite; }
.hud-heart.low .hh-full { filter: brightness(1.2) saturate(1.3); }
@keyframes heartBeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.hh-text {
  position: absolute; left: 0; right: 0; top: 32%; text-align: center;
  font-family: 'PixelNum', 'PixelTitle', monospace; font-size: 30px; color: #fff;
  line-height: 1; letter-spacing: 1px;
  text-shadow: 2px 2px 0 rgba(0,0,0,.9), 0 0 10px rgba(0,0,0,.85);
}

.bt-left { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.tags { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 260px; }
.tag {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 11px 6px 9px; border-radius: 7px; font-size: 13px;
  background: rgba(8,7,14,.62); border: 1px solid rgba(255,255,255,.12);
  border-left-width: 3px; backdrop-filter: blur(3px);
  box-shadow: 0 6px 16px rgba(0,0,0,.45);
  animation: tagIn .22s ease;
}
@keyframes tagIn { from { opacity: 0; transform: translateX(-8px); } }
.tag-ico { width: 17px; height: 17px; flex: 0 0 auto; }
.tag-ico svg { width: 100%; height: 100%; }
.tag-n { color: #efe8dc; }
.tag-t {
  margin-left: auto; font-family: 'PixelTitle', monospace; font-size: 9px;
  color: var(--dim); letter-spacing: .5px;
}
.tag.good { border-left-color: #63c268; }
.tag.good .tag-ico { color: #8fe08f; }
.tag.bad { border-left-color: #e04545; }
.tag.bad .tag-ico { color: #ff9d9d; }

.aim-hint {
  min-height: 26px; line-height: 1.4; margin-top: 5px;
  font-size: 13px; color: rgba(232,226,214,.7);
  text-shadow: 0 2px 6px rgba(0,0,0,.95);
}
.aim-hint b { color: var(--gold); }

.unit.pick { cursor: pointer; }
.unit.pick .unit-sprite::after {
  content: ''; position: absolute; left: 50%; bottom: -6px;
  width: 74%; height: 14px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(255,216,61,.55), transparent 70%);
  animation: aim 1.6s ease-in-out infinite; pointer-events: none;
}
.unit.pick-self .unit-sprite::after { background: radial-gradient(ellipse at center, rgba(110,220,140,.55), transparent 70%); }
.unit.pick:hover .unit-sprite img,
.unit.targeted .unit-sprite img {
  filter: drop-shadow(0 6px 5px rgba(0,0,0,.65)) drop-shadow(0 0 12px rgba(255,216,61,.95));
}
.unit.pick-self.targeted .unit-sprite img,
.unit.pick-self:hover .unit-sprite img {
  filter: drop-shadow(0 6px 5px rgba(0,0,0,.65)) drop-shadow(0 0 12px rgba(110,220,140,.95));
}

.unit-menu {
  position: absolute; z-index: 9; min-width: 220px; max-width: 280px;
  overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none;
  padding: 8px; border-radius: 10px;
  background: linear-gradient(rgba(18,15,26,.97), rgba(10,9,16,.99));
  border: 2px solid #55506a;
  box-shadow: 0 14px 34px rgba(0,0,0,.75), inset 0 1px 0 rgba(255,255,255,.06);
  animation: uaIn .14s ease-out;
}
@keyframes uaIn { from { opacity: 0; transform: translate(-50%, -100%) scale(.94); } }
.unit-menu.below { animation: uaInDown .14s ease-out; }
@keyframes uaInDown { from { opacity: 0; transform: translate(-50%, 0) scale(.94); } }
.unit-menu::after {
  content: ''; position: absolute; left: 50%; bottom: -9px; margin-left: -8px;
  border: 8px solid transparent; border-top-color: #55506a;
}
.unit-menu::-webkit-scrollbar { display: none; }
.unit-menu.below::after { bottom: auto; top: -9px; border-top-color: transparent; border-bottom-color: #55506a; }
.unit-menu.inset::after { display: none; }
.unit-menu.inset { box-shadow: 0 0 0 2px rgba(255,216,61,.35), 0 14px 34px rgba(0,0,0,.8); }

.ua-head {
  font-family: 'PixelTitle', monospace; font-size: 9px; color: var(--gold);
  padding: 6px 6px 10px; margin-bottom: 4px; text-align: center;
  letter-spacing: 1px; line-height: 1.7;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-shadow: 1px 1px 0 #000;
}
.ua {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: rgba(255,255,255,.04); border: 1px solid transparent; border-radius: 7px;
  padding: 9px 10px; margin-bottom: 5px; cursor: pointer;
  color: var(--text); font-family: inherit; text-align: left;
  transition: background .12s, border-color .12s, transform .1s;
}
.ua:last-child { margin-bottom: 0; }
.ua:hover:not(.off) { background: rgba(255,216,61,.14); border-color: var(--gold); transform: translateX(2px); }
.ua.off { opacity: .42; cursor: default; }
.ua-ico { font-size: 19px; flex: 0 0 auto; width: 24px; text-align: center; }

.ua-art {
  --rar: var(--t1);
  position: relative; flex: 0 0 auto;
  width: 48px; height: 48px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, color-mix(in srgb, var(--rar) 28%, transparent), transparent 70%),
              linear-gradient(145deg, #2a2738, #14121d);
  border: 1px solid #514c63;
}
.ua-art.tier-1 { --rar: var(--t1); } .ua-art.tier-2 { --rar: var(--t2); }
.ua-art.tier-3 { --rar: var(--t3); } .ua-art.tier-4 { --rar: var(--t4); }
.ua-art.tier-5 { --rar: var(--t5); }
.ua-img { max-width: 40px; max-height: 40px; object-fit: contain; image-rendering: pixelated;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.8)); }
.ua:hover:not(.off) .ua-art { border-color: var(--rar); box-shadow: 0 0 14px color-mix(in srgb, var(--rar) 45%, transparent); }
.ua-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ua-name { font-size: 13.5px; font-weight: bold; color: #fff; display: flex; align-items: center; gap: 7px; }
.ua-tag {
  font-family: 'PixelTitle', monospace; font-size: 9px; color: #1a1000;
  background: var(--torch); border-radius: 3px; padding: 2px 4px; letter-spacing: .5px;
}
.ua.aoe .ua-sub { color: #ffc98a; }

.unit.aoe-mark .unit-sprite img {
  filter: drop-shadow(0 6px 5px rgba(0,0,0,.65)) drop-shadow(0 0 14px rgba(255,154,61,.95));
}
.ua-sub { font-size: 13px; color: var(--dim); line-height: 1.3; }
.ua.off .ua-sub { color: #ff9d9d; }
.ua-empty { font-size: 13px; color: var(--dim); padding: 6px 8px 8px; text-align: center; }

@media (min-width: 900px) {
  .hud-heart { width: 104px; height: 104px; }
  .b-log { font-size: 15px; }
  .aim-hint { font-size: 14px; }
  .to-chip { width: 34px; height: 34px; }
  .to-chip img { max-width: 28px; max-height: 28px; }
  .unit-menu { min-width: 250px; max-width: 320px; }
  .ua-name { font-size: 14px; }
}

@media (max-width: 820px) {
  .hud-heart { width: 72px; height: 72px; }
  .hchip b { font-size: 21px; }
  .hh-text { font-size: 18px; }
  .turn-box { bottom: auto; top: 62px; }
  .b-center { width: min(92vw, 560px); left: 50%; transform: translateX(-50%); text-align: center; bottom: auto; top: 110px; }
}