:root {
  --select-stroke: #f4fdff;
  --plaque: linear-gradient(180deg, #182630, #0c1218);
  --plaque-border: #3ec4ff;
  --plaque-shadow: inset 0 0 0 1px rgba(62, 196, 255, 0.16), 0 0 18px rgba(62, 196, 255, 0.14);
  --head-height: 80px;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #090c10;
  color: #e7eef2;
  overflow: hidden;
}

body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  font: 16px/1.4 "Avenir Next Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
}

#panel {
  padding: 12px 18px 14px;
  background:
    linear-gradient(180deg, rgba(62, 196, 255, 0.08), transparent 28px),
    #10161c;
  border-bottom: 2px solid #1d4e66;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

body.is-enemy-turn #panel {
  background:
    linear-gradient(180deg, rgba(255, 77, 77, 0.14), transparent 28px),
    #141016;
  border-bottom-color: #8a3030;
}

#top {
  display: flex;
  align-items: stretch;
  gap: 16px;
  height: var(--head-height);
}

#top > * {
  box-sizing: border-box;
  height: 100%;
}

#brand {
  position: relative;
  flex: none;
  width: 280px;
}

#logo {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 44.5%;
  mix-blend-mode: lighten;
}

#logo-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

#logo-beta {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 1px;
  margin: 0;
  padding-left: 0.2em;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.2em;
  text-align: center;
  color: #ffffff;
  text-shadow:
    0 0 4px #ffffff,
    0 0 10px rgba(255, 255, 255, 0.95),
    0 0 18px rgba(255, 255, 255, 0.7);
  pointer-events: none;
}

.logo-glow {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(90, 205, 255, 0.6) 0%, rgba(40, 130, 255, 0.25) 38%, rgba(40, 120, 255, 0) 70%);
  filter: blur(6px);
  opacity: 0;
}

#status,
#readout-name,
#readout-detail {
  margin: 0;
}

#status,
#readout-detail {
  color: #b7d0de;
}

#bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
}

#status {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  letter-spacing: 0.06em;
}

#sound {
  display: flex;
  gap: 8px;
  flex: none;
}

#surrender {
  width: 72px;
  height: 36px;
  padding: 0;
  color: #7ec8ff;
  background: var(--plaque);
  border: 1px solid var(--plaque-border);
  box-shadow: var(--plaque-shadow);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

#surrender:hover {
  background: #143044;
}

.mute {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: #7ec8ff;
  background: var(--plaque);
  border: 1px solid var(--plaque-border);
  box-shadow: var(--plaque-shadow);
  cursor: pointer;
}

.mute:hover {
  background: #143044;
}

.mute svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mute-slash {
  display: none;
}

.mute[aria-pressed="false"] {
  color: #6d7c86;
  border-color: #2a4558;
  box-shadow: none;
}

.mute[aria-pressed="false"] .mute-slash {
  display: inline;
  stroke: #ff6b6b;
}

.mute[aria-pressed="false"] .mute-waves {
  display: none;
}

#round {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  padding: 6px 14px 6px 16px;
  background: var(--plaque);
  border: 1px solid var(--plaque-border);
  box-shadow: var(--plaque-shadow);
}

#round-label {
  color: #7ec8ff;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

#round-count {
  min-width: 1.5ch;
  color: #f4fdff;
  font-size: 42px;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: 0.04em;
  text-shadow: 0 0 16px rgba(126, 200, 255, 0.45);
}

#turn-name {
  padding: 7px 10px;
  color: #d7f4ff;
  background: #102833;
  border: 1px solid #3ec4ff;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body.is-enemy-turn #round {
  border-color: #ff5a5a;
  box-shadow: inset 0 0 0 1px rgba(255, 90, 90, 0.2), 0 0 18px rgba(255, 70, 70, 0.16);
}

body.is-enemy-turn #round-label,
body.is-enemy-turn #round-count {
  color: #ffd0d0;
  text-shadow: 0 0 16px rgba(255, 90, 90, 0.4);
}

body.is-enemy-turn #turn-name {
  color: #ffe4e4;
  background: #3a1416;
  border-color: #ff5a5a;
}

body.is-enemy-turn #readout {
  border-color: #ff5a5a;
  box-shadow: inset 0 0 0 1px rgba(255, 90, 90, 0.2), 0 0 18px rgba(255, 70, 70, 0.16);
}

body.is-enemy-turn #status,
body.is-enemy-turn #readout-detail {
  color: #e7b8b8;
}

body.is-enemy-turn #readout-name {
  color: #ffd0d0;
  text-shadow: 0 0 16px rgba(255, 90, 90, 0.4);
}

#readout {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  padding: 6px 16px;
  background: var(--plaque);
  border: 1px solid var(--plaque-border);
  box-shadow: var(--plaque-shadow);
}

#readout img,
#readout-sprite {
  flex: none;
  width: 64px;
  height: 64px;
  object-fit: cover;
  background: #1a222b;
  border: 1px solid #3ec4ff;
  box-shadow: 0 0 12px rgba(62, 196, 255, 0.28);
}

#readout-sprite[hidden] {
  display: none;
}

#readout-name {
  color: #f4fdff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 16px rgba(126, 200, 255, 0.45);
}

#readout-copy {
  min-width: 0;
  flex: 1;
}

#readout-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#readout-detail {
  min-width: 0;
}

#readout-match {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

#readout-match[hidden] {
  display: none;
}

#readout-match::before {
  content: "vs";
  color: #7ec8ff;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.match-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 26px;
  padding: 2px 4px 1px;
  background: #0c1218;
  border: 1px solid #2a4558;
  line-height: 1;
}

.match-chip span {
  color: #8aa8b8;
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.match-chip strong {
  color: #d7f4ff;
  font-size: 14px;
  font-weight: 700;
}

.match-chip.is-mid strong {
  color: #ffd15a;
  text-shadow: 0 0 8px rgba(255, 209, 90, 0.55);
}

.match-chip.is-high strong {
  color: #ff5a5a;
  text-shadow: 0 0 8px rgba(255, 59, 59, 0.7);
}

.match-chip.is-low strong {
  color: #6d7c86;
}

#readout-health {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  flex: none;
  min-width: 148px;
  margin-left: 8px;
}

#readout-health[hidden] {
  display: none;
}

#readout-health-label {
  color: #7ec8ff;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

#readout-health-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  color: #f7feff;
  line-height: 0.9;
}

#readout-health-value strong {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 0 14px rgba(62, 207, 255, 0.55);
}

#readout-health-value span {
  color: #9fd4ea;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

#readout-health-track {
  display: block;
  height: 12px;
  background: #070b10;
  border: 1px solid #d7f4ff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45), 0 0 10px rgba(62, 196, 255, 0.28);
}

#readout-health-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: #3ecfff;
  box-shadow: 0 0 10px rgba(62, 207, 255, 0.85);
}

#readout-health.is-mid #readout-health-value strong {
  text-shadow: 0 0 14px rgba(255, 209, 90, 0.55);
}

#readout-health.is-mid #readout-health-fill {
  background: #ffd15a;
  box-shadow: 0 0 10px rgba(255, 209, 90, 0.85);
}

#readout-health.is-low #readout-health-value strong {
  color: #ffd6d6;
  text-shadow: 0 0 14px rgba(255, 59, 59, 0.7);
}

#readout-health.is-low #readout-health-fill {
  background: #ff3b3b;
  box-shadow: 0 0 10px rgba(255, 59, 59, 0.9);
}

#view {
  overflow: auto;
  overscroll-behavior: contain;
  min-height: 0;
  background: #090c10;
  scrollbar-width: none;
}

#view::-webkit-scrollbar {
  display: none;
}

#scaler {
  width: 0;
  height: 0;
}

#board {
  display: block;
  transform-origin: 0 0;
  will-change: transform;
}

.hex {
  fill: #6d6438;
  stroke: none;
  cursor: pointer;
}

.hex-selected {
  stroke: var(--select-stroke);
  stroke-width: 4.5;
  stroke-linejoin: round;
  filter:
    brightness(1.72)
    saturate(1.15)
    drop-shadow(0 0 5px #d7f4ff)
    drop-shadow(0 0 14px rgba(62, 196, 255, 0.95));
}

.hex-neighbor {
  stroke: none;
  filter: brightness(1.28) saturate(1.08);
}

#flags {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
  padding: 6px 14px;
  background: var(--plaque);
  border: 1px solid var(--plaque-border);
  box-shadow: var(--plaque-shadow);
}

#flags[hidden] {
  display: none;
}

#flags-label {
  color: #7ec8ff;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.flag-score {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 58px;
}

.flag-score-name {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.flag-score.is-player .flag-score-name,
.flag-score.is-player .flag-score-of {
  color: #7ec8ff;
}

.flag-score.is-bot .flag-score-name,
.flag-score.is-bot .flag-score-of {
  color: #ff8d8d;
}

.flag-score-value {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.flag-score strong {
  display: inline-block;
  color: #f4fdff;
  font-size: 28px;
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: 0.04em;
}

.flag-score.is-player strong {
  color: #d7f4ff;
  text-shadow: 0 0 12px rgba(62, 196, 255, 0.55);
}

.flag-score.is-bot strong {
  color: #ffd0d0;
  text-shadow: 0 0 12px rgba(255, 70, 70, 0.5);
}

.flag-score-of {
  font-size: 13px;
  letter-spacing: 0.06em;
}

.flag-score strong.is-banked {
  animation: flag-bank 0.48s ease-out;
}

.point-mark,
.flag-pennant,
.flag-take {
  pointer-events: none;
}

.point-ring {
  display: none;
  fill: none;
  stroke-width: 2.4;
  stroke-linejoin: round;
}

.point-mark.is-raising.is-player .point-ring {
  display: inline;
  stroke: #3ec4ff;
  stroke-dasharray: 10 8;
  filter: drop-shadow(0 0 5px #3ec4ff);
}

.point-mark.is-raising.is-bot .point-ring {
  display: inline;
  stroke: #ff3e3e;
  stroke-dasharray: 10 8;
  filter: drop-shadow(0 0 5px #ff3e3e);
}

.flag-shadow {
  fill: #000000;
  opacity: 0.42;
}

.flag-base {
  fill: url(#point-metal);
  stroke: #0c1218;
  stroke-width: 1.2;
}

.hq-floor {
  fill: url(#hq-plate);
  stroke: none;
}

.hq-rear,
.hq-wing,
.hq-keep,
.hq-gatehouse,
.hq-tower {
  fill: #6e8494;
  stroke: #e8f2f6;
  stroke-width: 0.9;
}

.hq-roof {
  fill: #e7f1f6;
  stroke: #9eb0bc;
  stroke-width: 0.7;
}

.hq-panel {
  fill: #152028;
  stroke: #c5d5df;
  stroke-width: 0.7;
}

.hq-pad-ring {
  fill: none;
  stroke: #f4fdff;
  stroke-width: 1.15;
}

.hq-seam {
  fill: none;
  stroke: #f4fdff;
  stroke-width: 0.7;
  opacity: 0.55;
}

.hq-border {
  fill: none;
  stroke-width: 2.8;
  stroke-linejoin: round;
}

.point-mark.is-player .hq-border {
  stroke: #3ec4ff;
  filter:
    drop-shadow(0 0 1px #f4fdff)
    drop-shadow(0 0 3px #3ec4ff)
    drop-shadow(0 0 8px #3ec4ff);
}

.point-mark.is-bot .hq-border {
  stroke: #ff3e3e;
  filter:
    drop-shadow(0 0 1px #fff4f4)
    drop-shadow(0 0 3px #ff3e3e)
    drop-shadow(0 0 8px #ff3e3e);
}


.hq-gate {
  fill: #070b10;
  stroke: #0c1218;
  stroke-width: 1;
}

.hq-antenna,
.flag-mast {
  fill: url(#point-pole);
  stroke: #1a242c;
  stroke-width: 0.4;
}

.hq-rivet {
  fill: #d5e2ea;
  stroke: #12181e;
  stroke-width: 0.6;
}

.flag-base-lip {
  fill: #c5d5df;
  stroke: none;
}

.flag-finial {
  fill: #f4fdff;
  stroke: #5c7080;
  stroke-width: 0.8;
}

.point-mark.is-player .hq-trim {
  fill: #3ec4ff;
}

.point-mark.is-bot .hq-trim {
  fill: #ff3e3e;
}

.hq-core {
  stroke-width: 1;
}

.point-mark.is-player .hq-core {
  fill: #f4fdff;
  stroke: #083044;
}

.point-mark.is-bot .hq-core {
  fill: #fff4f4;
  stroke: #4a1010;
}

.point-mark.is-player .hq-slit {
  fill: #3ec4ff;
}

.point-mark.is-bot .hq-slit {
  fill: #ff3e3e;
}

.flag-cloth-main,
.flag-cloth-fold {
  stroke-linejoin: round;
  stroke-width: 1;
}

.flag-pennant.is-neutral .flag-cloth-main,
.point-mark.is-neutral .flag-cloth-main {
  fill: #d7e2ea;
  stroke: #243038;
}

.flag-pennant.is-neutral .flag-cloth-fold,
.point-mark.is-neutral .flag-cloth-fold {
  fill: #7f95a4;
  stroke: #243038;
}

.flag-pennant.is-player .flag-cloth-main,
.point-mark.is-player .flag-cloth-main {
  fill: #3ec4ff;
  stroke: #083044;
}

.flag-pennant.is-player .flag-cloth-fold,
.point-mark.is-player .flag-cloth-fold {
  fill: #1478a4;
  stroke: #083044;
}

.flag-pennant.is-bot .flag-cloth-main,
.point-mark.is-bot .flag-cloth-main {
  fill: #ff3e3e;
  stroke: #4a1010;
}

.flag-pennant.is-bot .flag-cloth-fold,
.point-mark.is-bot .flag-cloth-fold {
  fill: #a11616;
  stroke: #4a1010;
}

.flag-sleeve {
  stroke: none;
}

.flag-pennant.is-neutral .flag-sleeve {
  fill: #8ea2b0;
}

.flag-pennant.is-player .flag-sleeve {
  fill: #0c6488;
}

.flag-pennant.is-bot .flag-sleeve {
  fill: #8a1414;
}

.flag-hem {
  fill: none;
  stroke-width: 1.3;
  stroke-linecap: round;
}

.flag-pennant.is-neutral .flag-hem {
  stroke: #5c7080;
}

.flag-pennant.is-player .flag-hem {
  stroke: #f4fdff;
}

.flag-pennant.is-bot .flag-hem {
  stroke: #fff4f4;
}

.flag-cloth {
  transform-box: fill-box;
  transform-origin: 0px 50%;
  animation: flag-wave 1.6s ease-in-out infinite;
}

.point-mark.is-raising .flag-cloth,
.is-flag-flyer .flag-cloth {
  animation-duration: 0.32s;
}

.point-mark.is-raising .flag-cloth-main {
  animation: flag-raise 1s ease-in-out infinite;
}

.flag-take {
  fill: none;
  stroke-width: 2.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: hit-ring 0.5s ease-out forwards;
}

.flag-take.is-player {
  stroke: #d7f4ff;
}

.flag-take.is-bot {
  stroke: #ffd0d0;
}

.flag-spark {
  pointer-events: none;
}

.flag-spark.is-player {
  fill: #d7f4ff;
}

.flag-spark.is-bot {
  fill: #ffd0d0;
}

.hex-reach {
  stroke: #d8ffe9;
  stroke-width: 3;
  stroke-linejoin: round;
  filter:
    brightness(1.46)
    saturate(1.35)
    drop-shadow(0 0 3px #eafff3)
    drop-shadow(0 0 11px rgba(48, 255, 156, 0.95));
}

.hex-attack {
  stroke: #ffd4d4;
  stroke-width: 3.5;
  stroke-linejoin: round;
  filter:
    brightness(1.45)
    saturate(1.4)
    drop-shadow(0 0 3px #ffe8e8)
    drop-shadow(0 0 12px rgba(255, 32, 48, 0.95));
}

.hex-raid {
  stroke: #ffe7a3;
  stroke-width: 4.2;
  animation: hex-raid 0.9s ease-in-out infinite;
}

.hq-raid-ring,
.hq-raid-flash {
  pointer-events: none;
  fill: none;
  transform-box: fill-box;
  transform-origin: center;
}

.hq-raid-ring {
  stroke-width: 3;
  animation: hq-raid-ring 0.7s ease-out forwards;
}

.hq-raid-flash {
  stroke-width: 5;
  animation: hq-raid-flash 0.7s ease-out forwards;
}

.hq-raid-ring.is-player,
.hq-raid-flash.is-player {
  stroke: #d7f4ff;
}

.hq-raid-ring.is-bot,
.hq-raid-flash.is-bot {
  stroke: #ffd0d0;
}

.point-mark.is-headquarters.is-raided .hq-border {
  animation: hq-border-raid 0.72s ease-out;
}

#end-round {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #d7f4ff;
  background: linear-gradient(180deg, #183040, #0c1218);
  border: 1px solid var(--plaque-border);
  box-shadow: var(--plaque-shadow);
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}

#end-round kbd {
  padding: 2px 7px;
  color: #7ec8ff;
  border: 1px solid #3ec4ff;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
}

#end-round:hover:not(:disabled) {
  background: #143044;
}

#end-round:disabled {
  color: #6d7c86;
  background: #10161c;
  border-color: #2a4558;
  box-shadow: none;
  cursor: default;
}

#end-round:disabled kbd {
  color: #6d7c86;
  border-color: #2a4558;
}

body.is-away #panel,
body.is-away #view,
body.is-away #end-round,
body.is-away #battle-end {
  display: none;
}

body.is-over #end-round,
body.is-over #surrender {
  visibility: hidden;
}

#battle-end {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(4, 8, 12, 0.62);
  animation: battle-end-in 320ms ease-out;
}

#battle-end[hidden] {
  display: none;
}

.battle-end-card {
  --tone: #3ec4ff;
  --tone-text: #d9f6ff;
  width: min(440px, calc(100vw - 32px));
  padding: 26px 40px 30px;
  text-align: center;
  background: var(--plaque);
  border: 1px solid var(--tone);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 40px color-mix(in srgb, var(--tone) 35%, transparent);
}

#battle-end[data-tone="defeat"] .battle-end-card {
  --tone: #ff4d4d;
  --tone-text: #ffd9d9;
}

.battle-end-kicker {
  margin: 0;
  color: #8fa7b5;
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

#battle-end-title {
  margin: 6px 0 4px;
  color: var(--tone-text);
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 0 22px color-mix(in srgb, var(--tone) 60%, transparent);
}

#battle-end-text {
  margin: 0 0 18px;
  color: #b7d0de;
  font-size: 17px;
}

.battle-end-summary {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  text-align: left;
}

.battle-end-summary div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.battle-end-summary dt {
  margin: 0;
  color: #8fa7b5;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.battle-end-summary dd {
  margin: 0;
  color: #d7f4ff;
  font-size: 16px;
}

.battle-end-log-title {
  margin: 0 0 8px;
  color: #8fa7b5;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-align: left;
  text-transform: uppercase;
}

#battle-end-log {
  max-height: 168px;
  margin: 0 0 22px;
  padding: 0;
  overflow: auto;
  list-style: none;
  color: #b7d0de;
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
}

#battle-end-log li + li {
  margin-top: 6px;
}

#restart {
  padding: 12px 28px;
  color: #d7f4ff;
  background: linear-gradient(180deg, #183040, #0c1218);
  border: 1px solid var(--tone);
  box-shadow: var(--plaque-shadow);
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}

#restart:hover,
#restart:focus-visible {
  background: #143044;
  outline: none;
}

@keyframes battle-end-in {
  from {
    opacity: 0;
  }
}

body.is-keys,
body.is-keys * {
  cursor: none;
}

#hex-cursor {
  fill: rgba(198, 242, 255, 0.2);
  stroke: #f7feff;
  stroke-width: 4.5;
  stroke-linejoin: round;
  pointer-events: none;
  filter:
    drop-shadow(0 0 4px #ffffff)
    drop-shadow(0 0 10px #8eebff)
    drop-shadow(0 0 22px rgba(62, 196, 255, 0.95));
}

.unit-token {
  cursor: pointer;
}

.unit-token.is-aimed {
  filter: brightness(1.35);
}

.unit-token.is-spent {
  filter: saturate(0.7) brightness(0.78);
}

.unit-token.is-flying,
.unit-token.is-spent.is-flying {
  filter:
    brightness(1.22)
    drop-shadow(0 14px 5px rgba(0, 0, 0, 0.55));
}

.unit-token.is-flying .scout-exhaust,
.unit-token.is-flying .scout-core {
  animation-duration: 0.28s;
}

.unit-token.is-struck {
  filter:
    drop-shadow(0 0 4px #fff0e0)
    drop-shadow(0 0 12px rgba(255, 48, 48, 0.95));
}

.unit-token.is-hit {
  animation: unit-hit 0.48s ease-out;
}

.unit-token.is-destroyed {
  animation: unit-break 0.46s ease-in forwards;
  pointer-events: none;
}

.unit-health {
  pointer-events: none;
}

.unit-health-plate {
  fill: #070b10;
  stroke: #f4fdff;
  stroke-width: 1.6;
}

.unit-health-track {
  fill: #101820;
  stroke: none;
}

.unit-health-num {
  font-size: 18px;
  font-weight: 700;
  stroke: #070b10;
  stroke-width: 4px;
  paint-order: stroke;
}

.hit-burst {
  pointer-events: none;
}

.hit-flash {
  fill: rgba(255, 48, 56, 0.55);
  animation: hit-flash 0.42s ease-out forwards;
}

.hit-ring {
  fill: none;
  stroke: #ffd0d0;
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: center;
  animation: hit-ring 0.55s ease-out forwards;
}

.hit-damage {
  fill: #fff4f4;
  stroke: #6a0810;
  stroke-width: 3px;
  paint-order: stroke;
  font-size: 22px;
  font-weight: 700;
  text-anchor: middle;
  animation: hit-float 0.7s ease-out forwards;
}

@keyframes unit-hit {
  0% { filter: brightness(2.6) saturate(0.2); }
  20% { filter: brightness(1) drop-shadow(0 0 10px #ff2a32); }
  45% { filter: brightness(2.2) drop-shadow(0 0 14px #ff4048); }
  100% { filter: drop-shadow(0 0 8px rgba(255, 48, 48, 0.8)); }
}

@keyframes unit-break {
  0% { opacity: 1; filter: brightness(2.4); }
  100% { opacity: 0; filter: brightness(0.3); }
}

@keyframes hit-flash {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}

@keyframes hit-ring {
  0% { transform: scale(0.35); opacity: 1; }
  100% { transform: scale(1.85); opacity: 0; }
}

@keyframes hit-float {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-34px); }
}

@keyframes flag-raise {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@keyframes flag-wave {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(11deg); }
}

@keyframes hex-raid {
  0%, 100% { filter: drop-shadow(0 0 4px #ffe7a3) drop-shadow(0 0 10px #ffb020); }
  50% { filter: drop-shadow(0 0 2px #fff4d2) drop-shadow(0 0 16px #ffd15a); }
}

@keyframes hq-raid-ring {
  0% { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

@keyframes hq-raid-flash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes hq-border-raid {
  0% { stroke-width: 8; }
  100% { stroke-width: 2.8; }
}

@keyframes flag-bank {
  0% { transform: scale(1); }
  35% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

.unit-token .unit-ring {
  opacity: 0;
  stroke-dasharray: 3 4;
}

.unit-token.is-selected .unit-ring {
  opacity: 1;
  stroke: #f4fdff;
  stroke-width: 2.4;
  filter:
    drop-shadow(0 0 4px #ffffff)
    drop-shadow(0 0 10px rgba(62, 196, 255, 0.95));
}

.scout-exhaust {
  animation: scout-thrust 1.15s ease-in-out infinite;
}

.scout-core {
  animation: scout-thrust 1.15s ease-in-out infinite;
}

@keyframes scout-thrust {
  0%,
  100% { opacity: 0.4; }
  50% { opacity: 1; }
}
