@font-face {
  font-family: Battle;
  src: url("./assets/fonts/bangers.ttf") format("truetype");
  font-display: swap;
}
:root {
  color-scheme: dark;
  --ink: #142b38;
  --deep: #0c2530;
  --panel: #243e4c;
  --steel: #789ba9;
  --light: #c5e5e7;
  --cyan: #42d8fa;
  --gold: #ffdb65;
  --cream: #eff6df;
  --muted: #b8cbd0;
  --font: Battle, "Arial Black", sans-serif;
  --frame: 0 0 0 3px #132936, 0 6px 0 #142933, 0 10px 22px #0007;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--deep);
  color: var(--cream);
  font:
    15px/1.45 "Trebuchet MS",
    system-ui,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
  border: 0;
  touch-action: manipulation;
}
button:disabled {
  cursor: not-allowed;
  filter: saturate(0.35) brightness(0.7);
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible,
select:focus-visible {
  outline: 3px solid #ffed72;
  outline-offset: 4px;
}
button:active:not(:disabled) {
  translate: 0 2px;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font);
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 1.12;
}
a {
  color: var(--cyan);
}
[hidden] {
  display: none !important;
}
.ui-mark {
  width: 32px;
  height: 32px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 0 #071f2a70);
}
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding: 11px 24px;
  min-height: 48px;
  border: 4px solid #87b9c7;
  border-top-color: #d0eff3;
  border-radius: 10px;
  background: linear-gradient(#19c6ec 0 44%, #009dcf 45% 100%);
  color: #083447;
  font: 26px/1 var(--font);
  letter-spacing: 0.6px;
  text-shadow: 0 1px #a9efff;
  box-shadow:
    inset 0 0 0 2px #14779b,
    var(--frame);
}
.btn:hover:not(:disabled) {
  filter: brightness(1.15);
  border-color: #e0faff;
}
.btn.secondary {
  background: linear-gradient(#567481 0 45%, #3a5663 46%);
  color: #d9f7f6;
  text-shadow: 0 2px #122b37;
  box-shadow:
    inset 0 0 0 2px #263d4b,
    var(--frame);
}
.btn.subtle {
  background: #263e4a;
  color: #c2dce0;
  font-size: 21px;
}
.btn.large {
  min-width: 240px;
  min-height: 62px;
  font-size: 36px;
}
.btn .ui-mark {
  width: 24px;
  height: 24px;
}
.icon-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  background: linear-gradient(150deg, #588da2, #254d63);
  border: 4px solid #81c1d1;
  border-top-color: #c2f2f3;
  border-radius: 9px;
  box-shadow:
    inset 0 0 0 2px #12384e,
    0 3px 0 #122b36,
    0 4px 6px #0008;
  font: 25px var(--font);
  color: #d9faff;
}
.icon-btn:hover {
  filter: brightness(1.2);
}
.icon-btn .ui-mark {
  width: 29px;
  height: 29px;
}
.text-button {
  background: none;
  color: #d7f5f5;
  padding: 8px 10px;
  font: 20px var(--font);
  text-shadow: 1px 2px #102c3e;
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.wrap {
  flex-wrap: wrap;
}
.spread {
  justify-content: space-between;
}
.small {
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1.4px;
  color: #9cdbea;
}
.description {
  color: #d0e3e3;
  margin: 8px 0 20px;
  line-height: 1.6;
}
.error {
  color: #ffba94;
}
.separator {
  border: 0;
  border-top: 1px solid #66848c;
  margin: 20px 0;
}
.portrait {
  display: block;
  background-size: cover;
  background-repeat: no-repeat;
  width: 100%;
  height: 100%;
}
.portrait-alden {
  background-image: url("./assets/art-v4/alden.webp");
  background-position: center 16%;
}
.portrait-mira {
  background-image: url("./assets/art-v4/mira.webp");
  background-position: center 16%;
}
.portrait-thane {
  background-image: url("./assets/art-v4/thane.webp");
  background-position: center 16%;
}
/* Title screen */
.home {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: url("./assets/art-v7/campaign-nature.webp") center/cover no-repeat;
  overflow: hidden;
  padding: 50px 20px 100px;
}
.home-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    #0b233b26,
    #0b233b00 25%,
    #071b2e66 65%,
    #071b2ef0
  );
  box-shadow: inset 0 0 180px #052036aa;
  pointer-events: none;
}
.home-corner {
  position: absolute;
  top: 20px;
  right: 20px;
}
.game-logo {
  position: relative;
  text-align: center;
  transform: rotate(-3deg);
  filter: drop-shadow(0 9px 0 #153243) drop-shadow(0 10px 18px #0008);
  margin: 0 auto 28px;
}
.logo-crown {
  display: block;
  height: 84px;
}
.logo-crown .ui-mark {
  width: 88px;
  height: 88px;
}
.game-logo h1 {
  font: clamp(70px, 10vw, 140px) / 0.82 var(--font);
  letter-spacing: 3px;
  color: #ffe58c;
  -webkit-text-stroke: 4px #1b3544;
  paint-order: stroke fill;
  text-shadow: 3px 5px #b57832;
}
.game-logo h1 span {
  display: block;
  font-size: 0.43em;
  letter-spacing: 2px;
  line-height: 1.4;
  color: #d9f6f3;
  -webkit-text-stroke: 3px #173649;
  text-shadow: 2px 3px #518797;
}
.game-logo p {
  font: clamp(22px, 3vw, 34px) var(--font);
  letter-spacing: 5px;
  color: #ffeaa3;
  background: #193849;
  border: 3px solid #a0b9b6;
  display: inline-block;
  padding: 3px 25px;
  transform: rotate(3deg);
}
.home-actions {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}
.home-actions .secondary {
  font-size: 23px;
}
.home-footer {
  position: absolute;
  bottom: 22px;
  text-align: center;
  font-size: 11px;
  color: #b8c9d0;
  line-height: 1.8;
}
.home-footer p {
  color: #dfd5ae;
  font-size: 12px;
}
/* The map is the menu; HTML flags remain fully keyboard accessible. */
.campaign-screen {
  position: relative;
  min-height: 100svh;
  background: #164559;
}
.campaign-scroll {
  overflow: auto;
  overscroll-behavior: contain;
  height: 100svh;
  scrollbar-width: thin;
}
.campaign-map {
  position: relative;
  width: max(100%, calc(100svh * 16 / 9));
  height: 100svh;
  min-width: 1100px;
  min-height: 620px;
  overflow: hidden;
}
.world-art {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.campaign-map:after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 75px #082b3770;
  pointer-events: none;
}
.campaign-road {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.world-hud {
  position: absolute;
  top: 17px;
  left: 19px;
  right: 19px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
.world-hud > * {
  pointer-events: auto;
}
.star-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0d2535dc;
  border-radius: 6px;
  padding: 4px 14px 4px 5px;
  font: 29px var(--font);
  color: #fff8d8;
}
.star-count .ui-mark {
  width: 39px;
  height: 39px;
}
.world-title {
  text-align: center;
  font: 29px var(--font);
  color: #fff4c8;
  text-shadow: 2px 3px #163a48;
  letter-spacing: 2px;
}
.world-title small {
  display: block;
  font-size: 16px;
  letter-spacing: 3px;
  color: #a6e3ea;
}
.world-label {
  position: absolute;
  font: clamp(18px, 2vw, 30px) var(--font);
  color: #e9e7bd;
  text-shadow:
    2px 2px #1e3d35,
    -1px -1px #1e3d35;
  pointer-events: none;
  letter-spacing: 2px;
  opacity: 0.86;
}
.forest-label {
  left: 12%;
  top: 69%;
}
.frost-label {
  left: 44%;
  top: 72%;
}
.ash-label {
  left: 77%;
  top: 73%;
}
.mission {
  --pin-size: clamp(58px, 3.8vw, 112px);
  position: absolute;
  translate: -50% -70%;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  padding: 0;
  width: calc(var(--pin-size) * 2.35);
  z-index: 2;
  filter: drop-shadow(0 3px 2px #071a27);
}
.mission:active:not(:disabled) {
  translate: -50% -68%;
}
.mission:before {
  content: "";
  position: absolute;
  top: 5%;
  left: 50%;
  translate: -50%;
  width: calc(var(--pin-size) * 1.65);
  height: calc(var(--pin-size) * 1.65);
  border-radius: 50%;
  background: radial-gradient(
    ellipse,
    #061b30c9 0 35%,
    #061b3066 54%,
    transparent 72%
  );
  z-index: -1;
  pointer-events: none;
}
.mission-stars {
  display: flex;
  gap: 1px;
  position: relative;
  z-index: 2;
  justify-content: center;
  margin-bottom: 5px;
  padding: 1px 5px;
  background: #0b253bed;
  border: 1px solid #799da8;
  border-radius: 8px;
}
.mission-stars i,
.brief-stars i {
  display: block;
  opacity: 0.24;
  filter: grayscale(1);
}
.mission-stars .earned,
.brief-stars .earned {
  opacity: 1;
  filter: none;
}
.mission-stars .ui-mark {
  width: calc(var(--pin-size) * 0.34);
  height: calc(var(--pin-size) * 0.34);
}
.mission-emblem { position: relative; display: block; }
.mission-challenges {
  position: absolute;
  left: calc(100% - 10px);
  top: 38%;
  display: flex;
  gap: 3px;
  z-index: 3;
}
.challenge-badge {
  display: grid;
  place-items: center;
  width: calc(var(--pin-size) * .46);
  height: calc(var(--pin-size) * .46);
  min-width: 24px;
  min-height: 24px;
  border: 2px solid #99eaff;
  border-radius: 50%;
  background: linear-gradient(#278fca, #15466f);
  color: #fff2ac;
  font: calc(var(--pin-size) * .31) / 1 var(--font);
  text-shadow: 1px 2px #112d42;
  box-shadow: 0 2px 0 #071a27, inset 0 0 0 2px #11354b;
}
.challenge-badge.iron {
  background: linear-gradient(#849cae, #3a4d62);
  border-color: #e0eff5;
  color: #fff;
}
.mode-check { color: #adf596; margin-left: auto; font: 700 16px / 1 system-ui, sans-serif; }
.challenge-complete { color: #c3f7aa; font: 20px var(--font); margin: 8px 0 0; }
.mission-flag {
  position: relative;
  display: grid;
  place-items: center;
  background: linear-gradient(110deg, #50bce7, #1674ac 65%, #114166);
  width: var(--pin-size);
  height: calc(var(--pin-size) * 1.1);
  border: 3px solid #112b3c;
  clip-path: polygon(0 0, 100% 0, 94% 80%, 50% 100%, 6% 80%);
  box-shadow: inset 0 0 0 3px #d3f5f7;
  transform: rotate(-4deg);
}
.mission-flag .ui-mark {
  position: absolute;
  right: 4px;
  bottom: 9px;
  width: calc(var(--pin-size) * 0.25);
  height: calc(var(--pin-size) * 0.25);
}
.mission-flag em {
  margin-bottom: 8px;
  font: calc(var(--pin-size) * 0.62) / 1 var(--font);
  color: #fff9dc;
  text-shadow:
    2px 3px #092434,
    -1px -1px #092434;
}
.mission:after {
  content: "";
  position: absolute;
  top: calc(var(--pin-size) * 1.32);
  width: 5px;
  height: 16px;
  background: #eedb9f;
  border: 2px solid #343935;
  z-index: -1;
}
.mission.current .mission-flag {
  background: linear-gradient(110deg, #f56c43, #c42f29 65%, #912a2d);
  box-shadow: inset 0 0 0 4px #ffe99a;
}
.mission.current {
  animation: flag-call 2s ease-in-out infinite;
  z-index: 3;
}
.mission.current .mission-name {
  border-color: #ffe18b;
  color: #fff3aa;
}
.mission.locked {
  opacity: 1;
  filter: drop-shadow(0 3px 2px #071a27);
}
.mission.locked .mission-flag {
  background: #3c5263;
  box-shadow: inset 0 0 0 3px #a3bbc3;
}
.mission.locked .mission-stars {
  visibility: hidden;
}
.mission.locked .mission-name {
  opacity: 0;
}
.mission-name {
  display: block;
  position: relative;
  margin-top: 7px;
  max-width: 100%;
  font: clamp(17px, 1.1vw, 32px) / 1.12 var(--font);
  color: #fff4d0;
  background: #0c283cf5;
  border: 2px solid #a8c5cd;
  box-shadow: 0 3px 0 #071a27;
  padding: 4px 8px;
  border-radius: 5px;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.15s;
}
.mission:hover .mission-name,
.mission:focus-visible .mission-name {
  opacity: 1;
}
.recovery-note {
  display: block;
  color: #b2eab4;
  margin-top: 5px;
}
.world-nav {
  position: absolute;
  bottom: 46px;
  left: 50%;
  translate: -50%;
  display: flex;
  gap: 25px;
  align-items: end;
  z-index: 3;
}
.world-menu-button {
  background: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  min-width: 84px;
  transition: transform 0.15s;
}
.world-menu-button:hover {
  transform: translateY(-5px);
}
.menu-medallion {
  height: 83px;
  width: 83px;
  overflow: hidden;
  border: 5px solid #86d8e4;
  border-top-color: #cefbf7;
  border-radius: 50%;
  background: radial-gradient(at 35% 20%, #44a9cb, #1c526b);
  box-shadow:
    0 0 0 3px #133e51,
    inset 0 0 0 3px #246c8a,
    0 6px 9px #052a3b90;
  display: grid;
  place-items: center;
}
.menu-medallion > .ui-mark {
  width: 58px;
  height: 58px;
}
.menu-medallion > img {
  width: 75px;
  height: 75px;
  object-fit: contain;
}
.menu-medallion .portrait {
  width: 100%;
  height: 145%;
}
.world-menu-button b {
  font: 24px var(--font);
  color: #d6fbf4;
  text-shadow:
    2px 3px #12394a,
    -1px -1px #12394a;
  letter-spacing: 1px;
  margin-top: 5px;
}
.world-bottom {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  z-index: 3;
}
.world-bottom:before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -18px;
  right: -18px;
  bottom: -9px;
  height: 160px;
  background: linear-gradient(transparent, #092b3be8);
  pointer-events: none;
}
.difficulty-control {
  background: #1a3949da;
  border: 2px solid #80a7b1;
  border-radius: 6px;
  padding: 5px 9px;
  min-height: 36px;
  display: flex;
  gap: 7px;
  align-items: center;
  color: #cbeaf0;
  font-size: 12px;
  text-shadow: 1px 1px #0c2d3a;
}
.difficulty-control select,
select {
  border: 2px solid #779ca9;
  background: #203e50;
  color: #e0faff;
  padding: 6px 10px;
  border-radius: 6px;
  min-height: 36px;
}
.resume-link {
  color: #ffe58b;
}
.world-bottom .text-button {
  font-size: 18px;
}
/* Shared forged-steel panels. */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: #061b2ac9;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 24px;
  overflow-y: auto;
  backdrop-filter: blur(3px);
}
.modal {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100svh - 80px);
  overflow: auto;
  padding: 28px;
  border: 8px solid #6c929e;
  border-top-color: #a4c8d0;
  border-bottom-color: #416779;
  border-radius: 24px;
  background:
    repeating-linear-gradient(
      118deg,
      transparent 0 90px,
      #708e9110 90px 93px,
      transparent 93px 155px
    ),
    linear-gradient(135deg, #23343b, #172a33);
  box-shadow:
    0 0 0 3px #162c3a,
    inset 0 0 0 3px #162c3a,
    0 15px 45px #0009;
  scrollbar-width: thin;
  scrollbar-color: #648a96 #203745;
}
.modal.wide {
  width: min(1000px, 100%);
}
.modal-head:after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 7px;
  background: radial-gradient(
      circle at 4px 3px,
      #a3c7cf 0 2px,
      #153745 2px 3px,
      transparent 3px
    )
    0 0/70px 7px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  position: relative;
  border-bottom: 3px solid #5c7d89;
  padding: 0 50px 10px;
  margin-bottom: 22px;
}
.modal-head h2 {
  background: linear-gradient(#7599a6 0 12%, #456977 13%);
  padding: 12px 42px 6px;
  clip-path: polygon(9% 0, 91% 0, 100% 38%, 100% 100%, 0 100%, 0 38%);
  font-size: 36px;
  color: #70e2f5;
  -webkit-text-stroke: 1.5px #142d39;
  paint-order: stroke fill;
  text-shadow: 1px 3px #142d39;
  text-align: center;
}
.modal-head .icon-btn {
  position: absolute;
  right: -15px;
  top: -15px;
  border-color: #9abcc5;
  background: #446674;
}
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tabs button {
  background: #1c3442;
  border: 2px solid #6f929d;
  border-radius: 8px;
  color: #bed6db;
  padding: 9px 15px;
  min-height: 44px;
  font: 21px var(--font);
}
.tabs button.active {
  border-color: #ffee82;
  box-shadow: 0 0 8px #ffde5d75;
  color: #fff4bb;
  background: #4f6971;
}
.tabs button:hover:not(:disabled) {
  border-color: #c8f5f2;
}
.modal-briefing {
  padding: 0 0 20px;
  overflow: auto;
}
.modal-briefing .modal-head {
  padding: 14px 58px 12px;
  margin: 0;
  border-bottom: 0;
}
.modal-briefing .modal-head h2 {
  color: #b4ed78;
  font-size: 31px;
}
.modal-briefing .modal-head .icon-btn {
  right: 6px;
  top: 6px;
  z-index: 2;
}
.mission-art {
  position: relative;
  margin: 0 8px;
  border: 3px solid #132d3c;
  border-radius: 12px;
  overflow: hidden;
}
.brief-map {
  display: block;
  width: 100%;
  height: 270px;
  object-fit: cover;
  object-position: center 42%;
}
.brief-stars {
  position: absolute;
  top: 0;
  left: 50%;
  translate: -50%;
  display: flex;
  gap: 5px;
  padding: 5px 18px 7px;
  border-radius: 0 0 20px 20px;
  background: #233f4dea;
  border: 3px solid #6c929e;
  border-top: 0;
}
.brief-stars .ui-mark {
  width: 34px;
  height: 34px;
}
.brief-story {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #092b2bd6;
  padding: 15px 22px;
  font: 20px/1.35 var(--font);
  letter-spacing: 0.5px;
  color: #f3f6d5;
}
.brief-controls {
  display: flex;
  gap: 20px;
  padding: 18px 22px;
}
.brief-controls .tabs {
  flex-direction: column;
  min-width: 100px;
}
.brief-controls .tabs button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  font-size: 18px;
}
.brief-controls .tabs .ui-mark {
  width: 29px;
  height: 29px;
}
.brief-details {
  flex: 1;
  min-width: 0;
}
.brief-stats {
  display: flex;
  align-items: center;
  gap: 18px;
  font: 21px var(--font);
  color: #dcf4e8;
}
.brief-stats .ui-mark {
  width: 24px;
  height: 24px;
}
.enemy-line {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
  flex-wrap: wrap;
}
.enemy-line > b {
  font: 17px var(--font);
  color: #8ab8c2;
}
.enemy-line > span {
  position: relative;
  background: #142c37;
  border: 1px solid #466574;
  border-radius: 5px;
  padding: 2px;
}
.enemy-line img {
  height: 36px;
  width: 36px;
  object-fit: contain;
}
.enemy-line > span > span {
  display: none;
}
.unlock-note {
  font-size: 11px;
  color: #e5d7a4;
  margin-top: 7px;
}
.brief-footer {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  justify-content: space-between;
}
.brief-hero {
  display: flex;
  align-items: center;
  gap: 9px;
  background: none;
  padding: 0;
}
.brief-hero > .portrait {
  width: 48px;
  height: 55px;
  border: 3px solid #88bbca;
  border-radius: 6px;
}
.brief-hero > span:last-child {
  font: 20px var(--font);
  text-align: left;
}
.brief-hero small {
  display: block;
  font:
    11px "Trebuchet MS",
    sans-serif;
  color: var(--muted);
}
.fight-button {
  min-width: 166px;
  font-size: 35px;
  border-color: #b8e3eb;
  box-shadow:
    0 0 0 3px #173d4e,
    0 5px 0 #142f40,
    0 0 15px #daf86065;
}
/* Heroes and permanent training. */
.hero-roster {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.roster-button {
  position: relative;
  width: 90px;
  height: 97px;
  border: 4px solid #6b919f;
  border-radius: 8px;
  background: #12303e;
  padding: 0;
}
.roster-button > .portrait {
  height: 100%;
  border-radius: 3px;
}
.roster-button > span:not(.portrait) {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #102d3ce0;
  font: 19px var(--font);
  text-align: center;
}
.roster-button.selected {
  border-color: #ffdf6c;
  box-shadow: 0 0 10px #ffde6b66;
}
.roster-button > em {
  position: absolute;
  top: -9px;
  left: 2px;
  right: 2px;
  background: #356f6a;
  color: #d6ffc6;
  font: 11px "Trebuchet MS";
  border: 1px solid #b3d3aa;
  border-radius: 3px;
}
.roster-button > .ui-mark {
  position: absolute;
  right: 1px;
  top: 3px;
  width: 24px;
  height: 24px;
}
.hero-roster > p {
  margin-left: auto;
  font: 24px var(--font);
  color: #a7d9e1;
  line-height: 1.2;
  text-align: right;
}
.hero-roster > p span {
  font:
    12px "Trebuchet MS",
    sans-serif;
  color: #a3bac5;
}
.hero-detail {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 26px;
}
.hero-art {
  position: relative;
  min-height: 375px;
  border: 5px solid #658793;
  border-top-color: #b1ced3;
  box-shadow:
    inset 0 0 0 2px #0f293a,
    0 0 0 2px #142e3d;
  border-radius: 11px;
  overflow: hidden;
}
.hero-art > .portrait {
  position: absolute;
  inset: 0;
  background-position: center top;
}
.hero-level {
  position: absolute;
  top: 10px;
  left: 10px;
  font: 40px/0.9 var(--font);
  text-align: center;
  background: #122d3dda;
  padding: 6px 10px;
  border: 2px solid #a6c3be;
  border-radius: 8px;
  color: #ffdf7a;
}
.hero-level small {
  display: block;
  font: 10px sans-serif;
  letter-spacing: 1px;
  color: #dbe6d8;
}
.hero-art-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, #0b2335 40%);
  padding: 40px 18px 14px;
}
.hero-art-name h3 {
  font-size: 47px;
  color: #ffe299;
  text-shadow: 2px 3px #182b37;
}
.hero-art-name span {
  font: 20px var(--font);
  color: #c3e8ea;
}
.hero-information > h3 {
  font-size: 31px;
  color: #e8efcd;
  margin: 4px 0 15px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  border-block: 2px solid #54717d;
  padding: 10px 0;
  margin-bottom: 16px;
}
.hero-stats > div {
  display: grid;
  grid-template-columns: 31px auto;
  align-items: center;
  column-gap: 5px;
}
.hero-stats .ui-mark {
  grid-row: 1/3;
  width: 29px;
  height: 29px;
}
.hero-stats b {
  font: 26px var(--font);
}
.hero-stats small {
  font-size: 10px;
  color: #a7c2c8;
}
.hero-skill {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 0;
}
.hero-skill > .ui-mark {
  padding: 7px;
  border: 3px solid #718c9c;
  background: #142e41;
  width: 51px;
  height: 51px;
  border-radius: 10px;
}
.hero-skill h4 {
  font-size: 23px;
  color: #a0e3e9;
  margin-bottom: 3px;
}
.hero-skill p {
  font-size: 13px;
  line-height: 1.5;
  color: #d2e0dd;
}
.hero-skill small {
  display: block;
  font-size: 10px;
  color: #a5b6bd;
  margin-top: 4px;
}
.hero-experience {
  font-size: 11px;
  color: #bad0d3;
  margin: 16px 0;
}
.xp-bar,
.track {
  height: 8px;
  border: 2px solid #0e2c3b;
  background: #132c3a;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 5px;
}
.xp-bar span,
.track i {
  display: block;
  height: 100%;
  background: linear-gradient(#b5eb7f, #56af52);
}
.hero-select {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
}
.hero-select .btn {
  font-size: 24px;
  flex: 1;
  padding: 9px;
}
.upgrade-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 24px;
  color: #b8d0d7;
  font-size: 13px;
}
.upgrade-tree {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.upgrade-track {
  text-align: center;
  border-right: 1px solid #476370;
  padding-right: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.upgrade-track:last-child {
  border: 0;
  padding: 0;
}
.upgrade-emblem {
  width: 84px;
  height: 84px;
  border: 4px solid #6f9eae;
  border-radius: 50%;
  background: radial-gradient(#5d8a91, #1d3a4d);
  box-shadow: 0 0 0 2px #0e2a3b;
}
.upgrade-emblem img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}
.upgrade-track h3 {
  font-size: 23px;
  color: #dcf1db;
  margin: 12px 0 6px;
  min-height: 48px;
}
.upgrade-track p {
  font-size: 11px;
  color: #adc4cd;
  min-height: 64px;
  line-height: 1.4;
}
.rank-chain {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  position: relative;
  margin: 10px 0 20px;
}
.rank-chain:before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 6px;
  translate: -50%;
  background: #122c3c;
  border-inline: 1px solid #6f919b;
}
.rank-node {
  position: relative;
  border: 3px solid #547582;
  box-shadow: 0 2px 0 #132b38;
  border-radius: 8px;
  background: #1b3345;
  color: #7693a0;
  display: grid;
  place-items: center;
  font: 22px var(--font);
  width: 42px;
  height: 42px;
}
.rank-node.trained {
  background: #3a756b;
  border-color: #b3d99d;
}
.rank-node.next {
  border-color: #d7c571;
  color: #f6e5a7;
}
.rank-node .ui-mark {
  width: 29px;
  height: 29px;
}
.upgrade-track .btn {
  font-size: 19px;
  min-height: 40px;
  padding: 7px 9px;
  border-width: 3px;
}
.upgrade-track .btn .ui-mark {
  width: 19px;
  height: 19px;
}
.upgrade-footer {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 25px;
}
.upgrade-footer > span {
  margin-right: auto;
}
.upgrade-footer .btn {
  font-size: 22px;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.guide-entry {
  background: #172f3dd9;
  border: 2px solid #52727e;
  border-radius: 9px;
  padding: 18px;
  overflow: hidden;
}
.guide-entry h3 {
  font-size: 27px;
  color: #9ee4e7;
  margin-bottom: 8px;
}
.guide-entry p {
  font-size: 13px;
  margin: 7px 0;
  color: #cfddda;
}
.tower-portrait {
  width: 78px;
  height: 90px;
  object-fit: contain;
  float: left;
  margin: 0 15px 8px 0;
}
.guide-entry .stats {
  font-size: 11px;
  color: #e3dba4;
}
.settings-row {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid #52717d;
}
.settings-row p,
.setting-info {
  font-size: 12px;
  color: #b1cbd2;
  margin: 5px 0;
}
.settings-row .btn {
  font-size: 21px;
}
.setting-info {
  margin: 15px 0;
}
textarea {
  display: block;
  width: 100%;
  height: 90px;
  border: 2px solid #658b9a;
  border-radius: 6px;
  background: #112d3e;
  padding: 10px;
  color: #def3f5;
  margin-top: 5px;
}
.result-stars {
  text-align: center;
  font-size: 60px;
  color: #ffdf6d;
  filter: drop-shadow(0 3px #94652d);
  letter-spacing: 8px;
}
.result-title {
  text-align: center;
  font-size: 30px;
}
.result-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0 25px;
}
.result-stat-grid > div {
  text-align: center;
  background: #17313f;
  border: 2px solid #547782;
  border-radius: 7px;
  padding: 12px 5px;
}
.result-stat-grid b {
  display: block;
  font: 29px var(--font);
  color: #ffe493;
}
.result-stat-grid span {
  font-size: 10px;
  color: #aac2ca;
}
.damage-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  margin-top: 10px;
}
.damage-row > span {
  width: 110px;
}
.damage-row .track {
  flex: 1;
}
.damage-row > b {
  width: 45px;
  text-align: right;
}
/* Battlefield, uninterrupted from edge to edge. */
body:has(.battle-screen) {
  background: #081b24;
}
.battle-screen {
  position: relative;
  width: min(100vw, calc(100svh * 5 / 3));
  margin: auto;
  min-height: 0;
}
.battle-layout,
.battle-main,
.battle-board {
  position: relative;
}
.battle-board {
  width: 100%;
  aspect-ratio: 5/3;
  overflow: hidden;
}
#battle-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.battle-top {
  position: absolute;
  inset: 14px 17px auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  pointer-events: none;
  z-index: 3;
}
.battle-top > * {
  pointer-events: auto;
}
.battle-counters {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}
.resource-row {
  display: flex;
  gap: 18px;
  background: #0d2631da;
  padding: 3px 14px 3px 5px;
  border-radius: 5px;
}
.counter {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 65px;
  color: #fff8dd;
  font: 27px var(--font);
  text-shadow: 2px 2px #142c37;
}
.counter .ui-mark {
  width: 29px;
  height: 29px;
}
.counter b {
  font-weight: 400;
}
.wave-counter {
  font-size: 23px;
  background: #0d2631da;
  padding: 1px 10px 1px 5px;
  border-radius: 4px;
  min-width: 94px;
}
.wave-counter .ui-mark {
  width: 23px;
  height: 23px;
}
.battle-tools {
  display: flex;
  gap: 9px;
}
.battle-tools .icon-btn {
  width: 43px;
  height: 43px;
  min-width: 43px;
  border-width: 3px;
  font-size: 24px;
}
.battle-tools .ui-mark {
  width: 27px;
  height: 27px;
}
.battle-title {
  margin: 0 0 0 auto;
  padding: 5px 12px;
  color: #ecf7d6;
  text-shadow: 1px 2px #163749;
  font: 21px var(--font);
  opacity: 0;
  transition: opacity 0.2s;
}
.battle-top:hover .battle-title {
  opacity: 1;
}
.control-bar {
  position: absolute;
  left: 20px;
  bottom: 27px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  z-index: 3;
}
.ability {
  width: 65px;
  height: 65px;
  border: 4px solid #a9d6df;
  border-bottom-color: #577a92;
  border-radius: 11px;
  background: linear-gradient(135deg, #366886, #122e4a);
  box-shadow:
    inset 0 0 0 2px #1c425b,
    0 0 0 2px #123245,
    0 5px 0 #152d3c,
    0 6px 9px #0b243b88;
  position: relative;
  padding: 7px;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.ability:hover:not(:disabled) {
  border-color: #e2ffff;
  filter: brightness(1.1);
}
.ability > .ui-mark {
  width: 47px;
  height: 47px;
}
.ability.active {
  border-color: #fff18c;
  box-shadow:
    0 0 0 2px #495c31,
    0 0 15px #ffed7f,
    inset 0 0 10px #6eb3a8;
}
.ability:disabled {
  filter: brightness(0.78) saturate(0.55);
}
.ability kbd {
  position: absolute;
  top: -9px;
  left: -7px;
  padding: 1px 4px;
  border: 1px solid #b3cad1;
  background: #1a3849;
  color: #e2f2e8;
  font: 11px var(--font);
  border-radius: 3px;
  z-index: 2;
}
.hero-portrait-button {
  width: 81px;
  height: 94px;
  border-radius: 25px 25px 13px 13px;
  padding: 0;
  margin-right: 7px;
}
.hero-portrait-button > .portrait {
  border-radius: 20px 20px 8px 8px;
  overflow: hidden;
}
.hero-hp-track {
  position: absolute;
  bottom: 1px;
  left: 4px;
  right: 4px;
  height: 9px;
  background: #112c3c;
  border: 2px solid #adcbd2;
  border-radius: 3px;
  z-index: 2;
}
.hero-hp-track i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(#b6fb6b, #4ca84b);
}
.hero-level-plaque {
  position: absolute;
  left: -6px;
  bottom: -4px;
  z-index: 3;
  background: #25394a;
  border: 2px solid #a7ccd1;
  border-radius: 3px;
  font: 17px var(--font);
  width: 25px;
}
.power-tooltip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 12px);
  width: 190px;
  background: #143445f5;
  border: 2px solid #9cbdc6;
  border-radius: 7px;
  padding: 10px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 5px 15px #0008;
  transition: opacity 0.15s;
  text-align: left;
  z-index: 10;
}
.power-tooltip b {
  display: block;
  font: 22px var(--font);
  color: #f8e6a2;
}
.power-tooltip small {
  display: block;
  font-size: 11px;
  color: #c8dce1;
  line-height: 1.4;
  margin-top: 3px;
}
.ability:hover .power-tooltip,
.ability:focus-visible .power-tooltip {
  visibility: visible;
  opacity: 1;
}
.cooldown {
  position: absolute;
  inset: 0;
  background: #0a2337bd;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font: 29px var(--font);
  color: #e2f6ff;
  text-shadow: 2px 2px #092239;
  z-index: 1;
}
.crossed-swords {
  position: relative;
  display: block;
  width: 49px;
  height: 49px;
}
.crossed-swords .ui-mark {
  position: absolute;
  inset: 0;
  width: 49px;
  height: 49px;
}
.crossed-swords .ui-mark:last-child {
  transform: scaleX(-1);
}
.wave-call {
  position: absolute;
  bottom: 30px;
  right: 26px;
  z-index: 3;
  background: radial-gradient(at 40% 20%, #dc623c, #94372f);
  border: 4px solid #edc572;
  border-top-color: #fff0a8;
  box-shadow:
    0 0 0 3px #463831,
    inset 0 0 0 3px #622f29,
    0 5px 0 #302f2e,
    0 5px 12px #0007;
  color: #fff3ce;
  border-radius: 50%;
  width: 77px;
  height: 77px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  animation: wave-call 2.4s ease-in-out infinite;
}
.wave-call > .ui-mark {
  width: 47px;
  height: 47px;
}
.wave-call b {
  position: absolute;
  bottom: -17px;
  white-space: nowrap;
  font: 22px var(--font);
  text-shadow:
    2px 2px #273036,
    -1px -1px #273036;
  color: #fff5b8;
}
.wave-call small {
  position: absolute;
  top: -31px;
  right: -10px;
  min-width: 125px;
  max-width: 180px;
  white-space: nowrap;
  font:
    12px "Trebuchet MS",
    sans-serif;
  color: #f9f1cb;
  padding: 4px 7px;
  background: #132d32db;
  border-radius: 4px;
  pointer-events: none;
}
.wave-call:disabled {
  animation: none;
  filter: brightness(0.8) saturate(0.6);
}
.wave-preview {
  position: absolute;
  top: 94px;
  left: 17px;
  background: #142e3dde;
  border: 1px solid #84a49c65;
  border-radius: 5px;
  width: 174px;
  z-index: 3;
  padding: 0;
  box-shadow: 0 2px 5px #17333355;
}
.wave-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  text-align: left;
  background: none;
  padding: 6px 8px;
  width: 100%;
  color: #eddfab;
  font: 15px var(--font);
}
.wave-heading > span:first-child {
  font-size: 13px;
  color: #b4dce1;
  white-space: nowrap;
}
.wave-heading b {
  display: none;
}
.wave-heading > span:last-child {
  margin-left: auto;
  font-size: 20px;
  line-height: 1;
}
.wave-preview.named .wave-heading { flex-wrap: wrap; }
.wave-preview.named .wave-heading b {
  display: block;
  order: 3;
  width: 100%;
  margin-left: 0;
  font: 16px/1.15 var(--font);
  color: #fff0b6;
}
.wave-preview.expanded {
  width: 238px;
}
.wave-preview.expanded .wave-heading {
  flex-wrap: wrap;
}
.wave-preview.expanded .wave-heading b {
  display: block;
  order: 3;
  width: 100%;
  font: 21px var(--font);
  color: #fff0b6;
}
.wave-units {
  display: none;
  padding: 0 9px 8px;
  gap: 8px;
  flex-wrap: wrap;
}
.wave-preview.expanded .wave-units {
  display: flex;
}
.wave-units > span {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1px;
}
.wave-units img {
  width: 31px;
  height: 34px;
  object-fit: contain;
}
.wave-units b {
  font: 20px var(--font);
}
.wave-units small {
  position: absolute;
  left: 2px;
  bottom: -3px;
  font: 9px var(--font);
  background: #354a59;
  border-radius: 2px;
  padding: 0 3px;
}
.wave-preview p {
  font-size: 11px;
  color: #c8d9d4;
  margin: 0 9px 10px;
  line-height: 1.5;
}
.battle-hint {
  position: absolute;
  bottom: 3px;
  left: 20px;
  right: 20px;
  pointer-events: none;
  text-align: center;
  font-size: 10px;
  color: #eef4d2;
  text-shadow:
    1px 1px #183c31,
    0 1px 5px #183c31;
}
.battle-hint strong {
  background: #123039c9;
  display: inline-block;
  padding: 2px 9px;
  border-radius: 3px;
  font-weight: 400;
}
.portrait-help {
  display: none;
}
.boss-strip {
  position: absolute;
  top: 30px;
  left: 30%;
  right: 23%;
  z-index: 3;
  background: #392c42e8;
  border: 2px solid #ba9697;
  border-radius: 6px;
  padding: 5px 10px;
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 11px;
}
.boss-strip strong {
  font: 21px var(--font);
  color: #ffcab0;
}
.boss-strip progress {
  flex: 1;
  min-width: 70px;
  height: 9px;
  accent-color: #e36962;
}
.boss-strip span {
  font-size: 10px;
  color: #e3bdbe;
}
/* Radial construction and specialization; the center stays transparent. */
#inspector {
  position: absolute;
  z-index: 5;
  isolation: isolate;
}
#inspector.radial-inspector {
  width: 208px;
  height: 208px;
  pointer-events: none;
}
.radial-menu {
  position: relative;
  width: 208px;
  height: 208px;
  pointer-events: none;
}
.radial-menu:before {
  content: "";
  position: absolute;
  inset: 38px;
  border: 10px solid #244456d9;
  border-top-color: #7595a3e8;
  border-left-color: #55778ae8;
  border-radius: 50%;
  box-shadow:
    0 0 0 3px #102b3bd9,
    inset 0 0 0 3px #102b3bd9,
    0 4px 4px #142b3d66;
  pointer-events: none;
}
.radial-option {
  position: absolute;
  left: var(--x);
  top: var(--y);
  translate: -50% -50%;
  width: 62px;
  height: 61px;
  padding: 3px;
  border: 3px solid #a6c2cb;
  border-bottom-color: #527287;
  border-radius: 14px;
  background: radial-gradient(at 40% 15%, #547d8a, #233f52 80%);
  box-shadow:
    0 0 0 2px #142b3b,
    0 4px 0 #142e3b;
  pointer-events: auto;
  display: grid;
  place-items: center;
  transition: filter 0.15s;
}
.radial-option:active:not(:disabled) {
  translate: -50% -47%;
}
.radial-option:hover:not(:disabled),
.radial-option:focus-visible {
  border-color: #fff2a2;
  filter: brightness(1.15);
  z-index: 5;
}
.radial-option > img {
  width: 56px;
  height: 59px;
  object-fit: contain;
  margin-top: -12px;
  filter: drop-shadow(1px 2px 0 #112d3b);
}
.radial-option > .ui-mark {
  width: 40px;
  height: 40px;
  margin-top: -4px;
}
.radial-option > strong {
  position: absolute;
  bottom: -8px;
  left: 50%;
  translate: -50%;
  min-width: 43px;
  padding: 1px 5px;
  background: #143142;
  border: 2px solid #809aa2;
  border-radius: 4px;
  color: #ffe482;
  font: 20px/1.05 var(--font);
  text-shadow: 1px 1px #3b2b24;
}
.radial-option:disabled > strong {
  color: #f3aaa0;
}
.radial-close {
  position: absolute;
  left: 88px;
  top: 95px;
  width: 32px;
  height: 32px;
  border: 2px solid #bdd9d8;
  border-radius: 50%;
  background: #244657ed;
  pointer-events: auto;
  opacity: 0.9;
  padding: 6px;
  box-shadow: 0 0 0 2px #122a38;
}
.radial-close .ui-mark {
  width: 16px;
  height: 16px;
}
.radial-tooltip {
  position: absolute;
  bottom: calc(100% + 15px);
  left: 50%;
  translate: -50%;
  width: 170px;
  padding: 7px 9px;
  font:
    12px/1.4 "Trebuchet MS",
    sans-serif;
  background: #153342f5;
  color: #e6f1df;
  border: 2px solid #91b0b8;
  border-radius: 6px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 3px 8px #0006;
}
.radial-option:hover .radial-tooltip,
.radial-option:focus-visible .radial-tooltip {
  visibility: visible;
  opacity: 1;
}
.skill-ranks {
  position: absolute;
  top: -11px;
  font-size: 13px;
  letter-spacing: 2px;
  color: #b9ef71;
  background: #163346;
  border-radius: 3px;
  line-height: 1.2;
}
.selection-info {
  position: absolute;
  left: 50%;
  translate: -35%;
  bottom: 27px;
  z-index: 4;
  background: #0e2a36eb;
  border: 2px solid #7d9ba688;
  border-radius: 7px;
  padding: 8px 13px;
  width: 300px;
  box-shadow: 0 3px 9px #16314566;
}
.selection-info h3 {
  font: 22px var(--font);
  color: #fff3c4;
}
.selection-info h3 small {
  font: 10px "Trebuchet MS";
  color: #adc6d1;
  margin-left: 6px;
}
.selection-info p {
  font-size: 11px;
  line-height: 1.4;
  color: #cbdad8;
  margin: 3px 0;
}
.selection-stats {
  display: flex;
  gap: 15px;
  align-items: center;
  font: 16px var(--font);
  color: #bfe6e1;
  margin-top: 3px;
}
.selection-stats .ui-mark {
  width: 20px;
  height: 20px;
}
.target-choice {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 10px;
  margin-top: 4px;
  color: #a9c3ca;
}
.target-choice select {
  font: 12px "Trebuchet MS";
  padding: 2px 6px;
  min-height: 25px;
  border-width: 1px;
}
#rally-support {
  display: block;
  margin-top: 4px;
  color: #ffe49b;
  font-size: 11px;
}
#soldier-state {
  font-size: 10px;
  color: #b5c8cf;
}
.enemy-inspector {
  width: 210px;
  padding: 13px;
  background: #1b394aef;
  border: 4px solid #89a7af;
  border-radius: 13px;
  box-shadow: var(--frame);
  text-align: center;
}
.enemy-inspect-icon img {
  height: 66px;
  width: 70px;
  object-fit: contain;
}
.enemy-inspector h2 {
  font-size: 24px;
  color: #ffdf9c;
  margin: 0 0 8px;
}
.inspect-stats {
  display: flex;
  justify-content: center;
  gap: 9px;
  font-size: 10px;
  color: #c4d7d7;
}
.inspect-stats b {
  display: block;
  font: 21px var(--font);
  color: #eff5e4;
}
.enemy-inspector p {
  font-size: 10px;
  margin: 7px 0;
  color: #c1d3d6;
}
.enemy-inspector .btn {
  font-size: 20px;
  padding: 6px 10px;
  min-height: 38px;
}
.menu-close {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 29px;
  height: 29px;
  padding: 5px;
  background: #1e3d4c;
  border: 1px solid #91b3ba;
  border-radius: 5px;
}
.menu-close .ui-mark {
  height: 17px;
  width: 17px;
}
.loading {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
  background: radial-gradient(ellipse, #244b5b, #0b2334);
}
.loading h1 {
  font-size: 45px;
  color: #e3eebc;
}
.loading p {
  color: #aacbd6;
}
.sigil {
  font-size: 65px;
  color: #9be5f2;
}
.loading-track {
  width: 220px;
  height: 8px;
  border: 2px solid #7c9aa5;
  border-radius: 6px;
  background: #183545;
  overflow: hidden;
  margin: 15px 0;
}
.loading-track i {
  display: block;
  height: 100%;
  width: 45%;
  background: #8fd9f0;
  animation: gather 1.3s ease-in-out infinite alternate;
}
#toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  background: #18394bf5;
  color: #fff0c9;
  border: 3px solid #88acb7;
  border-radius: 9px;
  box-shadow: 0 5px 16px #0007;
  padding: 11px 18px;
  max-width: min(90vw, 460px);
  font-size: 14px;
  text-align: center;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@keyframes gather {
  to {
    transform: translateX(125%);
  }
}
@keyframes flag-call {
  50% {
    filter: drop-shadow(0 0 10px #fff79b);
  }
}
@keyframes wave-call {
  50% {
    box-shadow:
      0 0 0 3px #463831,
      inset 0 0 0 3px #622f29,
      0 5px 0 #302f2e,
      0 0 15px #ffe87799;
  }
}
@media (min-aspect-ratio: 5/3) {
  body:has(.battle-screen) {
    display: grid;
    min-height: 100svh;
    align-items: center;
  }
}
@media (max-width: 1000px) {
  .modal {
    padding: 22px;
  }
  .hero-detail {
    gap: 18px;
  }
  .hero-art {
    min-height: 355px;
  }
  .upgrade-tree {
    gap: 8px;
  }
  .upgrade-track {
    padding-right: 7px;
  }
  .upgrade-emblem {
    width: 68px;
    height: 68px;
  }
  .upgrade-emblem img {
    width: 65px;
    height: 65px;
  }
  .upgrade-track h3 {
    font-size: 20px;
  }
  .upgrade-track p {
    font-size: 10px;
  }
  .control-bar {
    left: 14px;
    bottom: 22px;
    gap: 9px;
  }
  .ability {
    width: 55px;
    height: 55px;
    border-width: 3px;
  }
  .ability > .ui-mark {
    width: 39px;
    height: 39px;
  }
  .hero-portrait-button {
    width: 69px;
    height: 80px;
  }
  .crossed-swords,
  .crossed-swords .ui-mark {
    width: 41px;
    height: 41px;
  }
  .selection-info {
    width: 270px;
    translate: -20%;
    bottom: 23px;
  }
  .wave-call {
    width: 65px;
    height: 65px;
    right: 20px;
    bottom: 27px;
  }
  .wave-call b {
    font-size: 19px;
  }
  .battle-top {
    top: 10px;
    left: 12px;
    right: 12px;
  }
  .battle-title {
    display: none;
  }
  .wave-preview {
    left: 12px;
    top: 86px;
  }
  .wave-heading {
    padding: 3px 7px;
  }
  .modal-briefing {
    padding: 0 0 18px;
  }
  .brief-map {
    height: 230px;
  }
}
@media (max-width: 700px) {
  .world-nav {
    gap: 16px;
    bottom: 66px;
  }
  .menu-medallion {
    width: 66px;
    height: 66px;
    border-width: 4px;
  }
  .menu-medallion > .ui-mark {
    width: 46px;
    height: 46px;
  }
  .menu-medallion > img {
    width: 58px;
    height: 58px;
  }
  .world-menu-button {
    min-width: 62px;
  }
  .world-menu-button b {
    font-size: 19px;
  }
  .world-title {
    font-size: 22px;
    letter-spacing: 1px;
  }
  .world-title small {
    font-size: 13px;
  }
  .world-hud {
    top: 12px;
    left: 12px;
    right: 12px;
  }
  .star-count {
    font-size: 24px;
    padding-right: 8px;
    gap: 4px;
  }
  .star-count .ui-mark {
    width: 31px;
    height: 31px;
  }
  .world-bottom {
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    bottom: 8px;
  }
  .world-bottom:before {
    height: 190px;
  }
  .world-bottom .difficulty-control {
    font-size: 11px;
  }
  .modal-backdrop {
    padding: 15px 8px;
    align-items: flex-start;
  }
  .modal {
    max-height: calc(100svh - 30px);
    padding: 18px 13px;
    border-width: 6px;
    border-radius: 17px;
    margin: auto 0;
  }
  .modal-head {
    padding: 0 42px 15px;
    margin-bottom: 16px;
  }
  .modal-head h2 {
    font-size: 29px;
  }
  .modal-head .icon-btn {
    right: -8px;
    top: -9px;
    width: 42px;
    height: 42px;
    min-width: 42px;
  }
  .hero-roster {
    gap: 10px;
    margin-bottom: 17px;
  }
  .roster-button {
    width: 73px;
    height: 83px;
  }
  .hero-roster > p {
    display: none;
  }
  .hero-detail {
    grid-template-columns: 1fr 1.45fr;
    gap: 14px;
  }
  .hero-art {
    min-height: 380px;
  }
  .hero-information > h3 {
    font-size: 25px;
  }
  .hero-art-name h3 {
    font-size: 37px;
  }
  .hero-art-name span {
    font-size: 16px;
  }
  .hero-stats {
    gap: 3px;
  }
  .hero-stats > div {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-stats .ui-mark {
    display: none;
  }
  .hero-stats b {
    font-size: 22px;
  }
  .hero-skill {
    gap: 7px;
  }
  .hero-skill > .ui-mark {
    display: none;
  }
  .hero-skill h4 {
    font-size: 21px;
  }
  .hero-skill p {
    font-size: 11px;
  }
  .hero-select {
    gap: 8px;
  }
  .hero-select .btn {
    font-size: 21px;
    padding: 8px 10px;
  }
  .hero-level {
    font-size: 29px;
    padding: 5px;
  }
  .upgrade-tree {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px 10px;
  }
  .upgrade-track:nth-child(3) {
    border: 0;
  }
  .upgrade-track h3 {
    min-height: 23px;
  }
  .upgrade-track p {
    min-height: 42px;
    max-width: 120px;
  }
  .rank-chain {
    flex-direction: row;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 8px 0 12px;
    max-width: 120px;
  }
  .rank-chain:before {
    display: none;
  }
  .rank-node {
    width: 29px;
    height: 29px;
    font-size: 16px;
    border-width: 2px;
    border-radius: 5px;
  }
  .rank-node .ui-mark {
    width: 21px;
    height: 21px;
  }
  .upgrade-footer {
    gap: 9px;
    flex-wrap: wrap;
  }
  .upgrade-footer > span {
    width: 100%;
  }
  .upgrade-footer .btn {
    font-size: 20px;
  }
  .upgrade-intro {
    font-size: 11px;
    gap: 10px;
  }
  .guide-grid {
    grid-template-columns: 1fr;
  }
  .guide-entry {
    padding: 15px;
  }
  .modal-briefing {
    padding: 0 0 18px;
  }
  .modal-briefing .modal-head h2 {
    font-size: 25px;
  }
  .brief-map {
    height: 215px;
  }
  .brief-story {
    font-size: 16px;
    padding: 12px;
  }
  .brief-controls {
    padding: 14px 12px;
    gap: 12px;
  }
  .brief-controls .tabs {
    min-width: 80px;
  }
  .brief-controls .tabs button {
    font-size: 16px;
    padding: 5px;
  }
  .brief-controls .tabs .ui-mark {
    width: 23px;
    height: 23px;
  }
  .brief-stats {
    gap: 8px;
    font-size: 17px;
    flex-wrap: wrap;
  }
  .brief-stats .ui-mark {
    width: 19px;
    height: 19px;
  }
  .brief-details .small {
    font-size: 11px;
  }
  .brief-footer {
    padding: 0 13px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .brief-footer .difficulty-control {
    font-size: 11px;
  }
  .fight-button {
    min-width: 130px;
    font-size: 30px;
    margin-left: auto;
  }
  .enemy-line {
    gap: 5px;
  }
  .enemy-line img {
    width: 27px;
    height: 29px;
  }
  .result-stat-grid {
    gap: 7px;
    grid-template-columns: repeat(2, 1fr);
  }
  .home-footer {
    bottom: 17px;
  }
  .game-logo h1 {
    -webkit-text-stroke: 3px #1b3544;
  }
  .game-logo h1 span {
    -webkit-text-stroke: 2px #1b3544;
  }
  .world-title {
    display: none;
  }
}
@media (max-width: 600px) and (orientation: portrait) {
  .battle-screen {
    width: 100%;
    min-height: 100svh;
    padding-top: 66px;
    background: linear-gradient(#173c4f, #0e293a);
  }
  .battle-top {
    top: -56px;
    left: 9px;
    right: 9px;
  }
  .battle-counters {
    flex-direction: row;
    gap: 7px;
    align-items: center;
  }
  .resource-row {
    gap: 10px;
    padding: 4px;
  }
  .counter {
    min-width: 45px;
    font-size: 22px;
    gap: 2px;
  }
  .counter .ui-mark {
    width: 23px;
    height: 23px;
  }
  .wave-counter {
    font-size: 20px;
    min-width: 62px;
    padding: 5px;
  }
  .wave-counter .ui-mark {
    width: 19px;
    height: 19px;
  }
  .battle-tools {
    gap: 5px;
  }
  .battle-tools .icon-btn {
    width: 39px;
    height: 39px;
    min-width: 39px;
  }
  .fullscreen-button {
    display: none;
  }
  .battle-board {
    box-shadow: 0 4px 0 #071e2c;
  }
  .battle-main {
    padding-bottom: 260px;
  }
  .wave-preview {
    top: calc(60vw + 96px);
    left: 12px;
    width: calc(100% - 24px);
    border-color: #658a975c;
    background: #1c3c4f;
  }
  .wave-heading {
    padding: 6px 10px;
  }
  .wave-heading b {
    display: block;
    font-size: 17px;
    margin-left: auto;
    color: #f4e2ab;
  }
  .wave-preview.expanded {
    width: calc(100% - 24px);
  }
  .wave-preview.expanded .wave-heading b {
    order: 0;
    width: auto;
    font-size: 17px;
  }
  .control-bar {
    top: calc(60vw + 18px);
    left: 14px;
    bottom: auto;
    gap: 9px;
  }
  .ability {
    width: 49px;
    height: 49px;
    padding: 4px;
    border-width: 3px;
    border-radius: 8px;
  }
  .ability > .ui-mark {
    width: 37px;
    height: 37px;
  }
  .hero-portrait-button {
    width: 58px;
    height: 65px;
    border-radius: 16px 16px 8px 8px;
    margin-right: 3px;
  }
  .hero-portrait-button > .portrait {
    border-radius: 12px 12px 5px 5px;
  }
  .crossed-swords,
  .crossed-swords .ui-mark {
    width: 38px;
    height: 38px;
  }
  .wave-call {
    top: calc(60vw + 18px);
    bottom: auto;
    right: 17px;
    width: 55px;
    height: 55px;
    border-width: 3px;
    padding: 7px;
  }
  .wave-call > .ui-mark {
    width: 34px;
    height: 34px;
  }
  .wave-call b {
    font-size: 15px;
    bottom: -19px;
  }
  .wave-call small {
    display: none;
  }
  .selection-info {
    bottom: auto;
    top: calc(60vw + 147px);
    left: 12px;
    right: 12px;
    width: auto;
    translate: 0;
    z-index: 3;
    padding: 8px 12px;
    border-color: #668b99;
    background: #17394b;
  }
  .selection-info h3 {
    font-size: 23px;
  }
  .selection-info p {
    font-size: 12px;
  }
  .selection-info .target-choice {
    position: absolute;
    right: 10px;
    bottom: 8px;
  }
  .selection-info .target-choice select {
    min-height: 31px;
  }
  .selection-info .selection-stats {
    padding-right: 85px;
    font-size: 14px;
    gap: 8px;
  }
  .battle-hint {
    bottom: auto;
    top: calc(60vw + 256px);
    font-size: 11px;
    left: 12px;
    right: 12px;
  }
  .portrait-help {
    display: block;
    text-align: center;
    font-size: 11px;
    color: #84a8b9;
    padding: 35px 24px 20px;
  }
  .boss-strip {
    top: 3px;
    left: 20%;
    right: 3%;
    padding: 3px 6px;
  }
  .boss-strip strong {
    font-size: 18px;
  }
  .boss-strip span {
    display: none;
  }
  .radial-tooltip {
    display: none;
  }
  .power-tooltip {
    width: 150px;
  }
  .hero-roster {
    justify-content: center;
  }
  .hero-detail {
    grid-template-columns: 1fr;
  }
  .hero-art {
    min-height: 270px;
    max-height: 270px;
    width: 100%;
  }
  .hero-art > .portrait {
    height: 400px;
    background-size: cover;
  }
  .hero-art-name {
    padding: 30px 18px 10px;
  }
  .hero-information > .eyebrow,
  .hero-information > h3 {
    display: none;
  }
  .hero-stats {
    margin-bottom: 10px;
  }
  .hero-stats > div {
    grid-template-columns: 29px auto;
    text-align: left;
  }
  .hero-stats .ui-mark {
    display: block;
  }
  .hero-skill > .ui-mark {
    display: block;
  }
  .hero-information .hero-select {
    position: sticky;
    bottom: -18px;
    background: #213c4d;
    padding: 10px 0;
  }
  .hero-experience {
    margin: 10px 0;
  }
  .hero-art-name h3 {
    font-size: 42px;
  }
}
@media (max-height: 550px) and (orientation: landscape) {
  .campaign-scroll {
    height: calc(100svh - 132px);
    border-bottom: 2px solid #64818b;
  }
  .mission {
    --pin-size: 50px;
    translate: -50% -45%;
  }
  .mission-name {
    font-size: 15px;
  }
  .world-hud {
    top: 10px;
    left: 12px;
    right: 12px;
  }
  .world-nav {
    bottom: 36px;
    gap: 20px;
  }
  .menu-medallion {
    width: 59px;
    height: 59px;
    border-width: 3px;
  }
  .menu-medallion > .ui-mark {
    width: 43px;
    height: 43px;
  }
  .menu-medallion > img {
    width: 54px;
    height: 54px;
  }
  .world-menu-button {
    min-width: 60px;
  }
  .world-menu-button b {
    font-size: 18px;
    margin-top: 2px;
  }
  .world-title {
    font-size: 21px;
  }
  .world-title small {
    display: none;
  }
  .world-bottom {
    bottom: 4px;
  }
  .world-bottom .text-button {
    font-size: 16px;
  }
  .world-bottom .difficulty-control {
    font-size: 10px;
  }
  .difficulty-control select {
    min-height: 29px;
    padding: 3px 7px;
  }
  .modal-backdrop {
    padding: 14px;
  }
  .modal {
    max-height: calc(100svh - 28px);
    padding: 18px;
  }
  .modal-head {
    margin-bottom: 15px;
    padding-bottom: 12px;
  }
  .modal-head h2 {
    font-size: 27px;
  }
  .modal-head .icon-btn {
    top: -7px;
    right: -7px;
    width: 38px;
    height: 38px;
    min-width: 38px;
  }
  .modal-briefing {
    padding: 0 0 16px;
    max-width: 750px;
  }
  .brief-map {
    height: 135px;
  }
  .brief-story {
    font-size: 15px;
    padding: 7px 12px;
  }
  .brief-controls {
    padding: 12px 18px;
    gap: 16px;
  }
  .brief-controls .tabs {
    flex-direction: row;
    min-width: 80px;
    align-content: start;
    max-width: 95px;
  }
  .brief-controls .tabs button {
    font-size: 15px;
    min-height: 32px;
    width: 100%;
    padding: 2px 5px;
  }
  .brief-controls .tabs .ui-mark {
    width: 22px;
    height: 22px;
  }
  .brief-footer {
    padding: 0 18px;
  }
  .brief-stats {
    font-size: 18px;
  }
  .enemy-line {
    margin: 6px 0;
  }
  .enemy-line img {
    height: 25px;
    width: 25px;
  }
  .brief-footer .btn {
    min-height: 41px;
    font-size: 27px;
    padding: 6px 16px;
  }
  .brief-hero > .portrait {
    width: 40px;
    height: 45px;
  }
  .battle-top {
    top: 7px;
    left: 8px;
    right: 8px;
  }
  .resource-row {
    gap: 12px;
    padding: 1px 8px 1px 3px;
  }
  .counter {
    font-size: 22px;
    min-width: 49px;
  }
  .counter .ui-mark {
    width: 24px;
    height: 24px;
  }
  .wave-counter {
    font-size: 19px;
    padding: 0 8px 0 4px;
    min-width: 79px;
  }
  .wave-counter .ui-mark {
    width: 19px;
    height: 19px;
  }
  .battle-tools {
    gap: 6px;
  }
  .battle-tools .icon-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-width: 3px;
    font-size: 21px;
  }
  .battle-tools .ui-mark {
    width: 23px;
    height: 23px;
  }
  .wave-preview {
    top: 70px;
    left: 8px;
    width: 148px;
  }
  .wave-heading {
    font-size: 14px;
    padding: 2px 6px;
  }
  .wave-heading > span:first-child {
    font-size: 12px;
  }
  .control-bar {
    bottom: 19px;
    left: 10px;
    gap: 8px;
  }
  .ability {
    width: 47px;
    height: 47px;
    padding: 4px;
  }
  .ability > .ui-mark {
    width: 35px;
    height: 35px;
  }
  .hero-portrait-button {
    width: 56px;
    height: 66px;
    margin-right: 3px;
  }
  .crossed-swords,
  .crossed-swords .ui-mark {
    width: 36px;
    height: 36px;
  }
  .hero-level-plaque {
    font-size: 14px;
    width: 22px;
  }
  .wave-call {
    bottom: 23px;
    right: 17px;
    width: 56px;
    height: 56px;
    padding: 7px;
    border-width: 3px;
  }
  .wave-call > .ui-mark {
    width: 37px;
    height: 37px;
  }
  .wave-call b {
    font-size: 17px;
  }
  .wave-call small {
    font-size: 10px;
    top: -25px;
    min-width: 105px;
  }
  .selection-info {
    bottom: 20px;
    width: 235px;
    left: 50%;
    translate: -30%;
    padding: 6px 9px;
  }
  .selection-info h3 {
    font-size: 18px;
  }
  .selection-info p {
    font-size: 10px;
  }
  .selection-stats {
    font-size: 13px;
    gap: 10px;
  }
  .selection-stats .ui-mark {
    width: 17px;
    height: 17px;
  }
  .selection-info h3 small {
    font-size: 8px;
  }
  .target-choice select {
    min-height: 22px;
    padding: 0 4px;
  }
  .battle-hint {
    bottom: 1px;
    font-size: 8px;
  }
  .radial-tooltip {
    max-width: 150px;
    font-size: 10px;
    padding: 5px;
  }
  .hero-roster {
    margin-bottom: 15px;
  }
  .hero-art {
    min-height: 330px;
  }
  .home {
    padding-top: 25px;
    padding-bottom: 60px;
  }
  .logo-crown {
    height: 40px;
  }
  .logo-crown .ui-mark {
    height: 47px;
    width: 47px;
  }
  .game-logo {
    margin-bottom: 15px;
  }
  .game-logo h1 {
    font-size: 75px;
  }
  .game-logo p {
    font-size: 20px;
    letter-spacing: 3px;
  }
  .home-actions {
    gap: 10px;
  }
  .home-actions .btn.large {
    min-height: 45px;
    font-size: 28px;
  }
  .home-actions .secondary {
    min-height: 36px;
    font-size: 21px;
  }
  .home-footer {
    bottom: 9px;
    font-size: 9px;
  }
  .home-footer p {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* The codex presents real tower tiers; difficulty choices map to simulation rules. */
.enemy-name {
  font-size: 10px;
  padding: 4px 6px !important;
  color: #d6e7d7;
}
.difficulty-control strong {
  color: #fff0ac;
  font: 18px var(--font);
}
.difficulty-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.difficulty-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: center;
  align-items: center;
  background: #2f4c59;
  border: 4px solid #779ba8;
  border-radius: 12px;
  padding: 12px 16px 36px;
  box-shadow: inset 0 0 0 2px #172e3b;
}
.difficulty-card.selected {
  border-color: #e4e6a1;
  box-shadow: 0 0 12px #a4db8166;
}
.difficulty-art {
  display: grid;
  place-items: center;
  width: 100%;
  height: 190px;
  background: radial-gradient(#45636a, #112b38);
  border: 2px solid #a7bfc0;
  border-radius: 6px;
  margin-bottom: 14px;
}
.difficulty-art img {
  width: 90%;
  height: 95%;
  object-fit: contain;
}
.difficulty-card h3 {
  font-size: 31px;
  color: #d6f4f0;
}
.difficulty-card p {
  font-size: 13px;
  color: #b7d8de;
  line-height: 1.5;
  margin-top: 10px;
}
.difficulty-selected {
  position: absolute;
  bottom: 10px;
  color: #b4ec7b;
  font: 18px var(--font);
}
.tower-roster {
  display: flex;
  gap: 12px;
  background: #142d39;
  border: 3px solid #678996;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 22px;
}
.tower-roster-button {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  background: #2b4a5b;
  border: 3px solid #7897a0;
  border-radius: 7px;
  padding: 4px 7px;
  font: 21px var(--font);
  color: #caeaf0;
}
.tower-roster-button.selected,
.tower-tiers button.selected,
.tower-branches button.selected {
  border-color: #ffe283;
  box-shadow: 0 0 8px #ffe76d66;
}
.tower-roster-button img {
  width: 48px;
  height: 56px;
  object-fit: contain;
}
.tower-detail {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 24px;
}
.tower-showcase {
  background: radial-gradient(
    ellipse at 50% 50%,
    #7e9c8c,
    #284f5b 57%,
    #102d3f
  );
  border: 5px solid #809fa8;
  border-radius: 11px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-shadow: 0 0 0 2px #122d3b;
}
.tower-showcase > img {
  width: 100%;
  height: 270px;
  object-fit: contain;
  filter: drop-shadow(0 12px 8px #092a3888);
}
.tower-showcase h3 {
  font-size: 31px;
  text-align: center;
  color: #ffebaa;
  margin: 14px 0 4px;
}
.tower-showcase > span {
  color: #bee1e2;
  font-size: 12px;
}
.tower-information > h3 {
  font-size: 34px;
  color: #ffdf80;
  margin: 7px 0;
}
.tower-information > p {
  font-size: 13px;
  color: #c8d7d5;
  margin-bottom: 15px;
}
.tower-information > h4 {
  font-size: 21px;
  color: #a6e4ed;
  margin-bottom: 10px;
}
.tower-tiers {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.tower-tiers button {
  flex: 1;
  border: 3px solid #648797;
  border-radius: 7px;
  background: #163545;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font: 18px var(--font);
}
.tower-tiers img {
  width: 65px;
  height: 65px;
  object-fit: contain;
}
.tower-tiers small {
  font: 10px "Trebuchet MS";
  color: #e1d4a2;
  margin-top: 3px;
}
.tower-branches {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}
.tower-branches button {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  background: #163545;
  border: 3px solid #648797;
  border-radius: 7px;
  font: 18px var(--font);
  text-align: left;
}
.tower-branches img {
  width: 49px;
  height: 56px;
  object-fit: contain;
}
.tower-branches small {
  display: block;
  font: 10px "Trebuchet MS";
  color: #dfcf9b;
  margin-top: 5px;
}
.catalog-skills > div {
  display: flex;
  gap: 10px;
  margin-top: 11px;
}
.catalog-skills h4 {
  font-size: 21px;
  color: #a7dfec;
}
.catalog-skills p {
  font-size: 12px;
  color: #c4d7d9;
  margin: 3px 0;
}
.catalog-skills small {
  font-size: 10px;
  color: #dccea3;
}
.catalog-skills .ui-mark {
  width: 36px;
  height: 36px;
  padding: 4px;
  background: #1e4358;
  border: 2px solid #7aa0b0;
  border-radius: 7px;
}
.modal-towers .hero-stats {
  margin: 17px 0;
}
.modal-towers .hero-stats > div {
  grid-template-columns: 29px auto;
}
@media (max-width: 700px) {
  .modal-head h2 {
    padding: 9px 18px 5px;
  }
  .difficulty-cards {
    gap: 10px;
  }
  .difficulty-card {
    padding: 6px 8px 32px;
    border-width: 3px;
  }
  .difficulty-art {
    height: 125px;
    margin-bottom: 10px;
  }
  .difficulty-card h3 {
    font-size: 24px;
  }
  .difficulty-card p {
    font-size: 11px;
  }
  .difficulty-selected {
    font-size: 16px;
  }
  .tower-roster {
    gap: 7px;
    padding: 8px;
    margin-bottom: 16px;
  }
  .tower-roster-button {
    flex-direction: column;
    font-size: 16px;
    padding: 4px;
  }
  .tower-roster-button img {
    height: 47px;
    width: 44px;
  }
  .tower-detail {
    grid-template-columns: 1fr 1.6fr;
    gap: 13px;
  }
  .tower-showcase {
    padding: 12px;
    min-height: 300px;
  }
  .tower-showcase > img {
    height: 200px;
  }
  .tower-showcase h3 {
    font-size: 24px;
  }
  .tower-information > h3 {
    font-size: 28px;
  }
  .tower-tiers {
    gap: 6px;
  }
  .tower-tiers img {
    width: 45px;
    height: 50px;
  }
  .tower-branches {
    gap: 6px;
    flex-wrap: wrap;
  }
  .tower-branches button {
    font-size: 17px;
    min-width: 120px;
  }
  .tower-branches img {
    height: 44px;
    width: 38px;
  }
  .tower-information .hero-stats .ui-mark {
    display: none;
  }
  .tower-information .hero-stats > div {
    grid-template-columns: 1fr;
  }
  .tower-information .hero-stats b {
    font-size: 22px;
  }
  .catalog-skills p {
    font-size: 11px;
  }
  .difficulty-control {
    font-size: 11px;
    min-height: 34px;
  }
  .difficulty-control strong {
    font-size: 17px;
  }
}
@media (max-width: 450px) {
  .tower-detail {
    grid-template-columns: 1fr;
  }
  .tower-showcase {
    min-height: 220px;
    position: relative;
    padding: 10px;
  }
  .tower-showcase > img {
    height: 180px;
  }
  .tower-showcase h3 {
    font-size: 27px;
    margin: 5px 0;
  }
  .difficulty-cards {
    grid-template-columns: 1fr;
  }
  .difficulty-card {
    display: grid;
    grid-template-columns: 95px 1fr;
    gap: 3px 12px;
    text-align: left;
    padding: 8px 12px 22px;
    align-items: center;
  }
  .difficulty-art {
    grid-row: 1/3;
    width: 95px;
    height: 105px;
    margin: 0;
  }
  .difficulty-card p {
    margin: 0;
  }
  .difficulty-selected {
    bottom: 7px;
    right: 12px;
  }
  .difficulty-card h3 {
    font-size: 29px;
  }
  .hero-art > .portrait {
    background-position: center 15%;
  }
  .hero-roster .portrait,
  .hero-portrait-button .portrait,
  .brief-hero .portrait {
    background-position: center 15%;
  }
}
@media (min-width: 1900px) {
  .world-nav {
    scale: 1.35;
    transform-origin: bottom center;
  }
  .world-hud {
    zoom: 1.25;
  }
  .world-bottom {
    zoom: 1.2;
  }
  .battle-top,
  .control-bar,
  .wave-preview,
  .wave-call {
    zoom: 1.2;
  }
  .selection-info {
    zoom: 1.15;
  }
}
@media (min-width: 1001px) and (min-height: 700px) {
  .modal-towers {
    padding: 22px;
    max-width: 1040px;
  }
  .modal-towers .modal-head {
    margin-bottom: 16px;
    padding-bottom: 6px;
  }
  .modal-towers .tower-roster {
    padding: 8px;
    margin-bottom: 18px;
  }
  .modal-towers .tower-information > .hero-stats {
    margin: 12px 0;
    padding: 7px 0;
  }
  .modal-towers .tower-tiers img {
    height: 52px;
  }
  .modal-towers .tower-branches {
    margin: 9px 0;
  }
  .modal-towers .tower-showcase {
    min-height: 340px;
  }
  .modal-towers .tower-detail {
    gap: 22px;
  }
  .modal-towers .row:last-child {
    margin-top: 12px !important;
  }
}

/* Hero progression: a separate, refundable ability budget for every champion. */
.portrait-selene,
.portrait-ember {
  background-image: url("./assets/art-v5/v5-portraits.webp");
  background-size: 200% 100%;
}
.portrait.portrait-selene { background-position: left center; }
.portrait.portrait-ember { background-position: right center; }
.modal-heroes.wide { width: min(1120px, 100%); }
.modal-heroes .hero-roster { gap: 12px; margin-bottom: 18px; }
.modal-heroes .roster-button { flex: 0 0 76px; width: 76px; height: 82px; }
.roster-level {
  position: absolute; left: 3px; top: 3px; padding: 2px 4px;
  background: #0e293ee8; color: #ffe49a; border-radius: 3px; font: bold 11px "Trebuchet MS", sans-serif;
}
.modal-heroes .hero-roster > p { font-size: 22px; }
.hero-overview { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; }
.modal-heroes .hero-overview .hero-art {
  min-height: 0; max-height: none; height: 230px; width: 100%;
}
.modal-heroes .hero-overview .hero-art > .portrait { height: 100%; background-size: cover; }
.modal-heroes .hero-overview .hero-art > .portrait-selene,
.modal-heroes .hero-overview .hero-art > .portrait-ember { background-size: 200% 100%; }
.modal-heroes .hero-art-name { padding: 30px 12px 10px; }
.modal-heroes .hero-art-name h3 { font-size: 37px; }
.modal-heroes .hero-art-name span { font-size: 17px; }
.modal-heroes .hero-level { font-size: 30px; top: 8px; left: 8px; }
.modal-heroes .hero-stats { margin: 5px 0 10px; padding: 8px 0; }
.level-explanation { font: 13px/1.45 "Trebuchet MS", sans-serif; }
.level-explanation b { display: block; color: #ffdf8d; }
.level-explanation span { display: block; color: #d3e1df; }
.modal-heroes .hero-experience { margin: 10px 0; font-size: 12px; }
.hero-experience small { display: block; margin-top: 4px; color: #acbec5; }
.hero-tactics { display: flex; gap: 7px 12px; align-items: center; flex-wrap: wrap; }
.hero-tactics label { font-size: 12px; font-weight: bold; }
.hero-tactics select { min-height: 34px; padding: 4px 10px; font-size: 12px; }
.hero-tactics small { flex-basis: 100%; font-size: 11px; color: #b6ced2; }
.hero-ability-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.hero-ability-summary article { padding: 10px 13px; border: 1px solid #527482; border-radius: 7px; background: #102633b8; }
.hero-ability-summary h4 { display: flex; align-items: center; gap: 7px; font-size: 22px; color: #aee9f1; }
.hero-ability-summary h4 > .ui-mark { width: 25px; height: 25px; flex-shrink: 0; }
.hero-ability-summary h4 small { font: bold 10px "Trebuchet MS", sans-serif; margin-left: auto; color: #ffe49b; white-space: nowrap; }
.hero-ability-summary p { margin: 5px 0 0; color: #d4e4e2; font: 12px/1.5 "Trebuchet MS", sans-serif; }
.talent-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 14px 0 12px; }
.talent-heading h3 { color: #ffe199; font-size: 29px; }
.talent-heading p { font-size: 12px; color: #c0d1d3; margin-top: 4px; }
.hero-point-bank { display: flex; gap: 10px; align-items: center; padding: 8px 15px; background: #112d40; border: 2px solid #cebd77; border-radius: 8px; flex-shrink: 0; }
.hero-point-bank b { font: 38px/1 var(--font); color: #ffe392; }
.hero-point-bank span { font: bold 11px "Trebuchet MS", sans-serif; color: #ffefba; }
.hero-point-bank small { display: block; margin-top: 3px; color: #b8d3d8; font-weight: normal; }
.hero-talents { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.talent-card { display: grid; grid-template-columns: 45px minmax(0,1fr) 94px; align-items: center; gap: 10px; padding: 12px; border: 2px solid #526c79; border-radius: 9px; background: linear-gradient(125deg,#203e50,#102a39); }
.talent-card.trained { border-color: #9eaa77; background: linear-gradient(125deg,#2d4a49,#142c36); }
.talent-icon { display: grid; place-items: center; width: 45px; height: 48px; background: #122938; border: 2px solid #95b6be; border-radius: 8px; }
.talent-icon .ui-mark { width: 32px; height: 32px; }
.talent-copy h4 { color: #d9f3e7; font: 22px var(--font); }
.talent-copy p { font: 12px/1.4 "Trebuchet MS", sans-serif; color: #c8dada; margin-top: 5px; }
.talent-copy p b { color: #a7c9d1; }
.talent-ranks { display: flex; align-items: center; gap: 4px; margin: 4px 0; }
.talent-ranks i { width: 20px; height: 6px; border: 1px solid #66808a; background: #0e2330; border-radius: 2px; }
.talent-ranks i.earned { background: #f9d35a; border-color: #fff2a4; box-shadow: 0 0 5px #ffda5344; }
.talent-ranks span { color: #a8c9cb; font-size: 10px; margin-left: 4px; }
.talent-buy.btn { font-size: 19px; min-height: 42px; padding: 7px 5px; }
.talent-buy:disabled { opacity: 0.7; }
.hero-build-note { padding: 12px 0; }
.hero-build-note p { color: #adccd0; font: 12px/1.5 "Trebuchet MS", sans-serif; }
.hero-build-actions { display: flex; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid #587983; }
.hero-build-actions > .btn { font-size: 20px; }
.hero-build-actions > small { font-size: 10px; line-height: 1.5; color: #c6d9d1; }
.hero-build-actions .hero-select { margin-left: auto; }
.hero-build-actions .hero-select .btn { flex: auto; white-space: nowrap; font-size: 21px; min-width: 95px; }
.hero-reward { display: flex; gap: 14px; align-items: center; padding: 12px; margin-bottom: 20px; background: #15333d; border: 1px solid #90b6b1; border-radius: 8px; }
.hero-reward > .portrait { width: 65px; height: 65px; flex-shrink: 0; border: 2px solid #d0bf77; border-radius: 8px; }
.hero-reward b { font: 24px var(--font); color: #ffe69d; }
.hero-reward p { font-size: 14px; color: #b9e3d6; margin: 3px 0; }
.hero-reward small { font-size: 11px; color: #bad1d7; }
@media (max-width: 740px) {
  .modal-heroes .hero-roster { gap: 7px; justify-content: flex-start; }
  .modal-heroes .roster-button { flex: 1 1 0; max-width: 76px; min-width: 0; height: 73px; border-width: 3px; }
  .modal-heroes .roster-button > span:not(.portrait) { font-size: 16px; }
  .modal-heroes .hero-roster > p { display: none; }
  .modal-heroes .roster-button > em { font-size: 9px; }
  .roster-level { font-size: 9px; padding: 1px 2px; }
  .hero-overview { grid-template-columns: 120px minmax(0,1fr); gap: 12px; }
  .modal-heroes .hero-overview .hero-art { height: 180px; }
  .modal-heroes .hero-art-name { padding: 20px 7px 8px; }
  .modal-heroes .hero-art-name h3 { font-size: 28px; }
  .modal-heroes .hero-art-name span { font-size: 12px; }
  .modal-heroes .hero-information > .eyebrow { display: block; font-size: 9px; letter-spacing: 1px; }
  .modal-heroes .hero-stats > div { display: block; text-align: center; }
  .modal-heroes .hero-stats .ui-mark { display: none; }
  .modal-heroes .hero-stats b { display: block; font-size: 23px; }
  .modal-heroes .hero-stats small { font-size: 9px; }
  .level-explanation { font-size: 11px; }
  .modal-heroes .hero-experience { font-size: 10px; }
  .hero-tactics { gap: 5px; }
  .hero-tactics select { width: 100%; }
  .hero-ability-summary { grid-template-columns: 1fr; gap: 8px; margin: 14px 0; }
  .hero-talents { grid-template-columns: 1fr; }
  .talent-heading h3 { font-size: 26px; }
  .talent-heading p { font-size: 11px; }
  .hero-point-bank { padding: 7px 9px; gap: 6px; }
  .hero-point-bank b { font-size: 32px; }
  .hero-point-bank span { font-size: 9px; }
  .talent-card { grid-template-columns: 36px minmax(0,1fr) 78px; padding: 9px; gap: 8px; }
  .talent-icon { width: 36px; height: 42px; }
  .talent-icon .ui-mark { width: 27px; height: 27px; }
  .talent-copy h4 { font-size: 21px; }
  .talent-copy p { font-size: 11px; }
  .talent-buy.btn { font-size: 17px; }
  .hero-build-actions { flex-wrap: wrap; }
  .hero-build-actions > .btn { font-size: 18px; }
  .hero-build-actions .hero-select { width: 100%; margin: 0; background: none; padding: 0; }
  .hero-build-actions .hero-select .btn { flex: 1; }
}
@media (min-width: 741px) {
  .modal-heroes { padding: 20px 28px; }
  .modal-heroes .modal-head { margin-bottom: 16px; padding-bottom: 7px; }
  .modal-heroes .hero-roster { margin-bottom: 14px; }
  .modal-heroes .hero-overview .hero-art { height: 215px; }
  .hero-ability-summary { margin: 14px 0; }
  .talent-card { padding: 10px 12px; }
}
@media (max-width: 740px) {
  .hero-overview { grid-template-columns: 110px minmax(0,1fr); gap: 9px 12px; }
  .hero-overview .hero-information { display: contents; }
  .modal-heroes .hero-overview .hero-art { grid-column: 1; grid-row: 1 / 3; height: 145px; }
  .hero-overview .hero-information > .eyebrow { grid-column: 2; align-self: end; }
  .hero-overview .hero-stats { grid-column: 2; align-self: start; }
  .hero-overview .level-explanation,
  .hero-overview .hero-experience,
  .hero-overview .hero-tactics { grid-column: 1 / -1; }
  .hero-overview .hero-experience { margin: 2px 0; }
  .hero-overview .level-explanation { margin-top: 4px; font-size: 12px; }
  .hero-overview .hero-tactics { display: grid; grid-template-columns: auto 1fr; margin-top: 6px; }
  .hero-overview .hero-tactics small { grid-column: 1 / -1; }
  .modal-heroes .hero-level { font-size: 23px; padding: 4px 7px; }
  .modal-heroes .hero-art-name h3 { font-size: 26px; }
  .modal-heroes .hero-art-name span { font-size: 11px; }
}
@media (max-width: 740px) {
  .modal-heroes .hero-level { top: 4px; left: auto; right: 4px; padding: 3px 5px; font-size: 18px; }
  .modal-heroes .hero-level small { font-size: 7px; }
}

/* ==========================================================================
   Kingdom Rush Alliance Parity Pass (v1.8.0)
   - World Map 3-zone bottom bar + notification badges
   - Visual connected Upgrade Tech Tree + parchment callout
   - Achievements modal
   - On-map directional Wave Call skull markers with radial countdown ring
   - Compact KRA-style bottom-center info bar with armor/ward shield pips
   ========================================================================== */

.world-nav {
  bottom: 58px !important;
  left: 18px !important;
  right: 18px !important;
  translate: none !important;
  transform: none !important;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}
.world-nav-left,
.world-nav-center,
.world-nav-right {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  pointer-events: auto;
}
.menu-badge {
  position: absolute;
  top: -4px;
  right: 2px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5f43, #c9281c);
  border: 2px solid #fff6d2;
  color: #fffef5;
  font: 700 12px/18px "Trebuchet MS", sans-serif;
  text-align: center;
  box-shadow: 0 2px 6px #07131a99;
  z-index: 2;
}
.world-nav-right .menu-badge {
  background: linear-gradient(180deg, #2b6b8d, #183d54);
  border-color: #ffd35c;
  font-size: 11px;
}

.brief-medal {
  opacity: 0.35;
  filter: grayscale(0.8);
}
.brief-medal.earned {
  opacity: 1;
  filter: none;
}

/* KRA Visual Tech Tree Upgrades */
.kra-upgrade-tree {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 12px;
  background: radial-gradient(circle at 50% 0%, #1d3948 0%, #112430 100%);
  border: 2px solid #496c7e;
  border-radius: 10px;
  box-shadow: inset 0 2px 14px #06101799;
}
.kra-tree-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.kra-tree-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.kra-tree-head img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.kra-tree-head span {
  font: 14px var(--font);
  letter-spacing: 0.7px;
  color: #b7dfe8;
  text-transform: uppercase;
}
.kra-tree-nodes {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 4px 0;
}
.kra-tree-nodes::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 50%;
  width: 4px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #5d8194, #2c4a59);
  border-radius: 2px;
  z-index: 0;
}
.kra-node {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 10px;
  border: 2.5px solid #4d6775;
  background: linear-gradient(180deg, #273e4c, #172731);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.kra-node:hover {
  transform: translateY(-2px);
  border-color: #9ed4e6;
}
.kra-node.locked {
  filter: saturate(0.25) brightness(0.76);
}
.kra-node.next {
  border-color: #7ccbe8;
  box-shadow: 0 0 0 2px #7ccbe833;
}
.kra-node.affordable {
  border-color: #ffd559;
  box-shadow: 0 0 12px #ffd55966;
}
.kra-node.trained {
  border-color: #ffd34c;
  background: linear-gradient(180deg, #4b7438, #284726);
  box-shadow: 0 0 10px #ffd34c55;
}
.kra-node.capstone {
  border-radius: 14px;
}
.kra-node.selected {
  outline: 3px solid #fff3b0;
  outline-offset: 2px;
}
.kra-node-icon img,
.kra-node-icon .ui-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.kra-node-cost {
  position: absolute;
  bottom: -7px;
  right: -7px;
  min-width: 22px;
  height: 20px;
  padding: 0 4px;
  border-radius: 6px;
  background: #0f212b;
  border: 1.5px solid #7ea6b8;
  color: #ffe998;
  font: 700 11px/17px "Trebuchet MS", sans-serif;
  text-align: center;
}
.kra-node.trained .kra-node-cost {
  background: #2f6c2e;
  border-color: #c8ff9a;
  color: #ecffd4;
}
.kra-upgrade-callout {
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbf0cf, #eddca8);
  border: 2px solid #8c6c39;
  color: #261b0e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 14px #08131a55;
}
.kra-callout-copy .eyebrow {
  color: #7d4f16;
  font-weight: 700;
}
.kra-callout-copy h3 {
  margin: 2px 0 4px;
  font: 24px var(--font);
  color: #1f160b;
  letter-spacing: 0.6px;
}
.kra-callout-copy p {
  margin: 0 0 4px;
  font: 600 14px/1.35 "Trebuchet MS", sans-serif;
  color: #2f2314;
}
.kra-callout-copy small {
  color: #654c28;
  font: 12px "Trebuchet MS", sans-serif;
}
.trained-pill {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 6px;
  background: #2f6c2e;
  color: #f0ffd9;
  font: 18px var(--font);
  letter-spacing: 1px;
}
.modal-upgrades .upgrade-footer {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.modal-upgrades .upgrade-footer .star-count small {
  font: 12px "Trebuchet MS", sans-serif;
  color: #b4dce6;
  margin-left: 4px;
}

/* Achievements modal */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.achievement-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #132836;
  border: 1.5px solid #355769;
  opacity: 0.72;
}
.achievement-card.unlocked {
  opacity: 1;
  background: linear-gradient(180deg, #1b3b4c, #132c3a);
  border-color: #f3c84c;
  box-shadow: 0 0 12px #f3c84c26;
}
.achievement-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #0d1d27;
  border: 1.5px solid #486e82;
  display: grid;
  place-items: center;
}
.achievement-card.unlocked .achievement-icon {
  border-color: #ffd34c;
  background: #264830;
}
.achievement-icon .ui-mark {
  width: 30px;
  height: 30px;
}
.achievement-body h3 {
  margin: 0 0 2px;
  font: 20px var(--font);
  color: #fff4c6;
}
.achievement-body p {
  margin: 0 0 6px;
  font: 12px/1.3 "Trebuchet MS", sans-serif;
  color: #b6d9e2;
}
.achievement-bar {
  height: 6px;
  border-radius: 999px;
  background: #0a1720;
  overflow: hidden;
  margin-bottom: 4px;
}
.achievement-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #65c6e8, #ffd34c);
}
.achievement-body small {
  font: 700 11px "Trebuchet MS", sans-serif;
  color: #9ec8d4;
  text-transform: uppercase;
}
.achievement-card.unlocked .achievement-body small {
  color: #a9f089;
}

/* On-Map Directional KRA Wave Call Markers */
.battle-board {
  position: relative;
}
.wave-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}
.kra-wave-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  padding: 0;
  border: none;
  background: none;
  pointer-events: auto;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.kra-wave-marker:disabled {
  opacity: 0.45;
  cursor: default;
}
.kra-wave-arrow {
  position: absolute;
  inset: -6px;
  pointer-events: none;
}
.kra-wave-arrow::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid #ff6338;
  filter: drop-shadow(0 0 2px #1a0b07);
}
.kra-wave-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.kra-wave-ring .ring-bg {
  fill: #24100ee8;
  stroke: #5b231b;
  stroke-width: 4.5;
}
.kra-wave-ring .ring-fill {
  fill: none;
  stroke: #ff6933;
  stroke-width: 4.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.16s linear;
}
.kra-wave-skull {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}
.kra-wave-skull .ui-mark {
  width: 22px;
  height: 22px;
}
.kra-wave-marker.pulse .kra-wave-ring {
  animation: kraPulse 1.3s ease-in-out infinite;
}
@keyframes kraPulse {
  0%, 100% { transform: rotate(-90deg) scale(1); }
  50% { transform: rotate(-90deg) scale(1.1); }
}
.kra-wave-tip {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  min-width: 190px;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fbf0cf;
  border: 2px solid #7d5b2b;
  color: #241a0d;
  text-align: left;
  box-shadow: 0 6px 16px #07121999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
  z-index: 10;
}
.kra-wave-marker.tip-left .kra-wave-tip {
  right: 54px;
}
.kra-wave-marker.tip-right .kra-wave-tip {
  left: 54px;
}
.kra-wave-marker:hover .kra-wave-tip,
.kra-wave-marker:focus-visible .kra-wave-tip {
  opacity: 1;
}
.kra-wave-tip strong {
  display: block;
  font: 16px var(--font);
  color: #6b2413;
}
.kra-wave-tip span {
  display: block;
  margin-top: 2px;
  font: 600 12px/1.3 "Trebuchet MS", sans-serif;
  color: #2c2011;
}
.kra-wave-tip em {
  display: block;
  margin-top: 4px;
  font: 700 11px "Trebuchet MS", sans-serif;
  font-style: normal;
  color: #8a5607;
}

/* KRA-Style Bottom-Center Info Bar + Resist Shield Pips */
.selection-info {
  bottom: 44px;
  width: 344px;
  translate: -50%;
}
.kra-info-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.kra-info-icon,
.kra-info-portrait {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 8px;
  background-color: #0d1f2a;
  border: 2px solid #6b93a6;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.delta-chip {
  white-space: nowrap;
}
.kra-info-icon img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.kra-info-main {
  flex: 1;
  min-width: 0;
}
.kra-info-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kra-info-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.kra-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 700 12px "Trebuchet MS", sans-serif;
  color: #f4f2d8;
}
.kra-stat .ui-mark {
  width: 15px;
  height: 15px;
}
.kra-hp-bar {
  position: relative;
  min-width: 96px;
  height: 16px;
  border-radius: 4px;
  background: #0b1820;
  border: 1px solid #4d7284;
  overflow: hidden;
}
.kra-hp-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #4db848, #8ce05a);
}
.kra-hp-bar b {
  position: absolute;
  inset: 0;
  font: 700 11px/14px "Trebuchet MS", sans-serif;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 1px 2px #051017;
}
.resist-meter {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.resist-meter .resist-icon .ui-mark {
  width: 14px;
  height: 14px;
}
.resist-meter em {
  width: 8px;
  height: 10px;
  border-radius: 2px;
  background: #1c313d;
  border: 1px solid #4d6b7a;
}
.resist-armor em.on {
  background: #e6b84c;
  border-color: #fff0a8;
}
.resist-ward em.on {
  background: #53c7f5;
  border-color: #c2f1ff;
}
.upgrade-delta {
  margin: 4px 0 0 !important;
  font: 600 12px/1.3 "Trebuchet MS", sans-serif;
  color: #cbe6ec;
}
.upgrade-delta em {
  font-style: normal;
  color: #9df77c;
  font-weight: 700;
}
.barracks-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

@media (max-width: 740px) {
  .kra-upgrade-tree {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .achievement-grid {
    grid-template-columns: 1fr;
  }
  .kra-upgrade-callout {
    flex-direction: column;
    align-items: flex-start;
  }
  .world-nav {
    left: 8px !important;
    right: 8px !important;
  }
  .world-nav-left,
  .world-nav-center,
  .world-nav-right {
    gap: 6px;
  }
}

/* ==========================================================================
   v1.9.0 — Dual-Hero Equipped Bar & KRA Towers Loadout Wheel
   ========================================================================== */
.kra-equipped-heroes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #0f2430;
  border: 2px solid #5c8498;
}
.kra-equipped-heroes .equipped-label {
  font: 700 10px "Trebuchet MS", sans-serif;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: #a8d9e6;
}
.equipped-slots {
  display: flex;
  gap: 8px;
}
.equipped-slot {
  position: relative;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 8px;
  border: 2px solid #78a8bd;
  background-color: #132c3a;
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.equipped-slot.selected {
  border-color: #ffd559;
  box-shadow: 0 0 8px #ffd55988;
}
.equipped-slot .portrait {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
}
.equipped-slot small {
  position: absolute;
  bottom: 1px;
  right: 2px;
  padding: 0 4px;
  border-radius: 4px;
  background: #0b1c26dd;
  color: #ffe88a;
  font: 700 10px/14px "Trebuchet MS", sans-serif;
}
.equipped-slot.empty {
  border-style: dashed;
  color: #7ca3b3;
  font: 22px var(--font);
  cursor: default;
}
.hero2-portrait-button {
  border-color: #c89ef5 !important;
}
.brief-hero .portrait + .portrait {
  margin-left: -10px;
}

/* KRA Towers Radial Loadout Wheel & Stat Bars */
.kra-tower-detail {
  grid-template-columns: 170px 210px minmax(0, 1fr) !important;
}
.kra-tower-wheel-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px;
  border-radius: 8px;
  background: #0f2430;
  border: 1.5px solid #416578;
  text-align: center;
}
.kra-tower-wheel-panel small {
  font: 11px/1.3 "Trebuchet MS", sans-serif;
  color: #9ec8d4;
}
.kra-tower-wheel {
  position: relative;
  width: 146px;
  height: 146px;
  border-radius: 50%;
  border: 4px solid #3c5f70;
  background: radial-gradient(circle, #173444 0%, #0d1f2a 70%);
}
.kra-wheel-slot {
  position: absolute;
  left: var(--wx);
  top: var(--wy);
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  padding: 4px;
  border-radius: 10px;
  border: 2px solid #638b9e;
  background: #173342;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.kra-wheel-slot:hover {
  transform: translate(-50%, -50%) scale(1.08);
  border-color: #a8e2f4;
}
.kra-wheel-slot.selected {
  border-color: #ffd559;
  background: #284f36;
  box-shadow: 0 0 10px #ffd55977;
}
.kra-wheel-slot img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.kra-stat-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 14px;
  padding: 10px 12px;
  border-radius: 7px;
  background: #0f2430;
  border: 1px solid #3c5f70;
}
.kra-stat-bars > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
}
.kra-stat-bars span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 700 12px "Trebuchet MS", sans-serif;
  color: #bce0ea;
}
.kra-stat-bars .ui-mark {
  width: 15px;
  height: 15px;
}
.kra-stat-bars .kra-bar {
  height: 8px;
  border-radius: 999px;
  background: #09161f;
  overflow: hidden;
}
.kra-stat-bars .kra-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f0b63e, #ffe778);
  border-radius: 999px;
}
.kra-stat-bars b {
  text-align: right;
  font: 700 12px "Trebuchet MS", sans-serif;
  color: #fff3c0;
}
@media (max-width: 820px) {
  .kra-tower-detail {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   v1.10.0 — KRA Enemy Discovery Polaroid Card, Achievement Banner & Reset UI
   ========================================================================== */
.enemy-discovery {
  position: absolute;
  top: 74px;
  right: 17px;
  left: auto;
  z-index: 6;
  width: 276px;
  animation: kraSlideIn 0.28s cubic-bezier(0.2, 0.85, 0.3, 1);
}
@keyframes kraSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}
.discovery-card {
  background: linear-gradient(180deg, #fbf0cf, #ead7a1);
  border: 2.5px solid #7d5928;
  border-radius: 9px;
  color: #24190c;
  box-shadow: 0 8px 20px #06131aaa;
  overflow: hidden;
}
.discovery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px 5px 10px;
  background: linear-gradient(90deg, #9f2a1d, #c94426);
  color: #fff6d2;
}
.discovery-tag {
  font: 16px var(--font);
  letter-spacing: 1px;
}
.discovery-close {
  background: none;
  border: none;
  padding: 2px;
  width: 22px;
  height: 22px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.discovery-close .ui-mark {
  width: 14px;
  height: 14px;
}
.discovery-body {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  align-items: center;
}
.discovery-art {
  width: 56px;
  height: 56px;
  border-radius: 7px;
  background: #172e3a;
  border: 2px solid #7d5928;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.discovery-art img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.discovery-copy h4 {
  margin: 0 0 3px;
  font: 20px var(--font);
  color: #26190a;
}
.discovery-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font: 700 11px "Trebuchet MS", sans-serif;
  color: #4a3114;
}
.discovery-stats .ui-mark {
  width: 13px;
  height: 13px;
}
.air-tag {
  padding: 1px 5px;
  border-radius: 4px;
  background: #275d80;
  color: #e6f7ff;
  font-size: 10px;
}
.discovery-copy p {
  margin: 0;
  font: 600 11px/1.3 "Trebuchet MS", sans-serif;
  color: #3b2a14;
}
.result-achievements {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}
.result-ach-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, #274b32, #18352a);
  border: 1.5px solid #ffd34c;
  color: #fff6cf;
}
.result-ach-pill .ui-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
}
.result-ach-pill b {
  display: block;
  font: 17px var(--font);
  color: #ffe374;
}
.result-ach-pill small {
  font: 12px "Trebuchet MS", sans-serif;
  color: #d7f2dc;
}
.seen-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #25573a;
  border: 1px solid #82d99a;
  color: #dcffe6;
  font: 700 10px/14px "Trebuchet MS", sans-serif;
  vertical-align: middle;
}
.btn.danger {
  background: linear-gradient(180deg, #d84a36, #9b2419);
  border-color: #ff9c87;
  color: #fff8ee;
}

/* ==========================================================================
   v2.0.0 — Kingdom Rush Alliance Visual & Upgrade Chrome Overhaul
   - Riveted steel-plate modal frames with raised KRA sky-blue title crest
   - Glossy 3D beveled arcade buttons
   - Glowing gold upgrade tech-tree energy pipes
   - Heavy iron radial tower ring + warm KRA parchment tooltips
   - Clean edge-to-edge centered desktop battlefield framing
   ========================================================================== */

body:has(.battle-screen) {
  display: grid;
  place-items: center;
  min-height: 100svh;
  background: radial-gradient(circle at 50% 45%, #132530, #071016 80%);
}

/* Riveted Steel-Plate KRA Modal Frame */
.modal {
  background: linear-gradient(180deg, #1b2832 0%, #121c24 100%);
  border: 4px solid #7f97a6;
  border-top-color: #b4cbd9;
  border-bottom-color: #465d6c;
  border-radius: 14px;
  box-shadow:
    0 0 0 3px #0c141a,
    inset 0 0 0 2px #0f181f,
    0 18px 46px #000000b8;
}
.modal-head {
  position: relative;
  justify-content: center;
  border-bottom: 2px solid #2c414f;
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.modal-head h2 {
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: 1.5px;
  color: #7ee3ff;
  text-shadow:
    0 3px 0 #0a1e2e,
    2px 0 0 #0a1e2e,
    -2px 0 0 #0a1e2e,
    0 -2px 0 #0a1e2e;
}
.modal-head .icon-btn {
  position: absolute;
  right: 0;
  top: -2px;
  background: linear-gradient(180deg, #98b0be, #5f7887);
  border: 2.5px solid #d5e8f2;
  border-bottom-color: #364955;
  box-shadow: 0 0 0 2px #0c161d, 0 3px 0 #0c161d;
}

/* Glossy 3D KRA Arcade Buttons */
.btn {
  background: linear-gradient(180deg, #5fd0ff 0%, #2798dc 52%, #1977b8 100%);
  border: 2.5px solid #a9ebff;
  border-bottom-color: #0e4c78;
  border-radius: 9px;
  color: #ffffff;
  text-shadow:
    0 2px 0 #092c46,
    1px 0 0 #092c46,
    -1px 0 0 #092c46;
  box-shadow:
    inset 0 2px 0 #d5f6ff88,
    0 0 0 2px #0a1924,
    0 4px 0 #0a1924;
  letter-spacing: 0.9px;
}
.btn:hover:not(:disabled) {
  filter: brightness(1.1);
}
.btn.secondary {
  background: linear-gradient(180deg, #54758a 0%, #314b5c 52%, #233847 100%);
  border-color: #93b5c7;
  border-bottom-color: #162631;
}
.btn.subtle {
  background: linear-gradient(180deg, #3b505e 0%, #23333d 100%);
  border-color: #6f8a99;
  border-bottom-color: #121c22;
}
.btn.danger {
  background: linear-gradient(180deg, #f2684b 0%, #c83321 55%, #9b2014 100%);
  border-color: #ffb8a3;
  border-bottom-color: #5e110a;
}

/* KRA Glowing Gold Energy Pipes in Upgrades Tree */
.kra-tree-head small {
  font: 700 11px "Trebuchet MS", sans-serif;
  color: #ffe37a;
  background: #0b1821;
  border: 1px solid #48687a;
  border-radius: 999px;
  padding: 1px 7px;
}
.kra-tree-nodes::after {
  content: "";
  position: absolute;
  bottom: 18px;
  left: 50%;
  width: 6px;
  height: calc((100% - 36px) * var(--lit, 0) / 100);
  transform: translateX(-50%);
  background: linear-gradient(0deg, #ffbd2e, #fff199);
  border-radius: 3px;
  box-shadow: 0 0 10px #ffd44d99;
  z-index: 0;
  transition: height 0.25s ease;
}

/* Heavy Dark-Iron KRA Radial Ring + Parchment Tooltips */
.radial-menu:before {
  border: 11px solid #1e2930eb;
  border-top-color: #5e7685f0;
  border-left-color: #465d6bf0;
  box-shadow:
    0 0 0 3px #0a1217f0,
    inset 0 0 0 3px #0a1217f0,
    0 6px 14px #00000088;
}
.radial-option {
  border: 3px solid #96b0be;
  border-bottom-color: #3f5563;
  background: radial-gradient(at 40% 18%, #476070, #1c2933 82%);
  box-shadow:
    0 0 0 2.5px #0c141a,
    0 4px 0 #0c141a,
    0 8px 14px #00000066;
}
.radial-option > strong {
  background: #101c24;
  border: 2px solid #93acb9;
  color: #ffe375;
}
.radial-tooltip {
  background: linear-gradient(180deg, #fbf0cf, #ebd8a3);
  color: #24190c;
  border: 2.5px solid #7d5928;
  font-weight: 700;
  box-shadow: 0 6px 16px #06131aaa;
}

/* Compact Top-Left KRA Resource Pill */
.battle-counters {
  background: #0d171ee3;
  border: 2px solid #5c7585;
  border-radius: 9px;
  padding: 5px 10px;
  box-shadow: 0 4px 12px #00000077;
}
.wave-preview {
  top: 126px;
}
.selection-info {
  background: linear-gradient(180deg, #16222bf2, #0d161cf5);
  border: 2.5px solid #7a94a3;
  border-radius: 10px;
  box-shadow: 0 0 0 2px #091117, 0 8px 20px #00000088;
}

/* ==========================================================================
   v2.2.0 — KRA Riveted Boss Health Plate & Responsive Touch Polish
   ========================================================================== */
#boss-bar.kra-boss-bar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  width: min(390px, calc(100% - 340px));
  min-width: 240px;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}
.boss-focus-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, #2b181af2, #170d10f5);
  border: 2.5px solid #a8483c;
  box-shadow: 0 0 0 2px #091117, 0 8px 20px #00000099;
  color: #fff2d6;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.boss-focus-btn:hover {
  border-color: #ffd36b;
  transform: translateY(-1px);
}
#boss-bar.focused .boss-focus-btn {
  border-color: #ffe37a;
  box-shadow: 0 0 0 2px #091117, 0 0 16px #ffd36b88;
}
.boss-skull {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: linear-gradient(180deg, #8e241b, #57120e);
  border: 2px solid #d97654;
  display: grid;
  place-items: center;
}
.boss-skull .ui-mark {
  width: 20px;
  height: 20px;
}
.boss-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.boss-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.boss-head strong {
  font: 18px var(--font);
  letter-spacing: 0.7px;
  color: #ffe8ad;
  text-shadow: 0 2px 0 #140808;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.boss-stance {
  font: 800 10px "Trebuchet MS", sans-serif;
  letter-spacing: 0.6px;
  padding: 2px 5px;
  border-radius: 4px;
  font-style: normal;
}
.boss-stance.armored {
  background: #30495a;
  color: #d4f0ff;
  border: 1px solid #75b3d1;
}
.boss-stance.warded {
  background: #462a64;
  color: #ebd5ff;
  border: 1px solid #b588ee;
}
.boss-pips {
  margin-left: auto;
  display: flex;
  gap: 3px;
}
.boss-pip {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #3d2125;
  border: 1px solid #8a4b49;
}
.boss-pip.active {
  background: #ffcf56;
  border-color: #fff2b2;
  box-shadow: 0 0 6px #ffbe3b99;
}
.boss-track {
  position: relative;
  height: 15px;
  border-radius: 5px;
  background: #14090c;
  border: 1.5px solid #6b3030;
  overflow: hidden;
}
.boss-fill {
  display: block;
  height: 100%;
  background: linear-gradient(180deg, #f25544, #b01e1c);
  transition: width 0.14s linear;
}
.boss-track b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 800 10.5px "Trebuchet MS", sans-serif;
  color: #fff6e0;
  text-shadow: 0 1px 2px #000;
}

/* Responsive Touch & Narrow Viewport Polish */
@media (max-width: 740px) {
  #boss-bar.kra-boss-bar {
    top: 62px;
    width: min(300px, calc(100% - 24px));
    min-width: 200px;
  }
  .enemy-discovery {
    top: 64px;
    right: 8px;
    width: min(248px, calc(100% - 16px));
  }
  .control-bar .ability {
    min-width: 44px;
    min-height: 44px;
  }
  .control-bar .ability kbd {
    display: none;
  }
  .battle-tools .icon-btn {
    min-width: 40px;
    min-height: 40px;
  }
  .wave-preview {
    position: absolute !important;
    top: calc(60vw + 94px) !important;
    left: 12px !important;
    width: calc(100% - 24px) !important;
    margin: 0 !important;
  }
  .selection-info {
    position: absolute !important;
    top: calc(60vw + 138px) !important;
    left: 12px !important;
    bottom: auto !important;
    translate: none !important;
    transform: none !important;
    width: calc(100% - 24px) !important;
    margin: 0 !important;
  }
  .selection-info select,
  .selection-info .priority-select {
    position: static !important;
    inset: auto !important;
    margin: 0 !important;
  }
  .kra-wave-marker {
    width: 32px !important;
    height: 32px !important;
  }
  .kra-wave-marker .kra-wave-ring {
    width: 32px !important;
    height: 32px !important;
  }
  .kra-wave-marker .ui-mark {
    width: 15px !important;
    height: 15px !important;
  }
  .radial-menu {
    transform: scale(0.76);
    transform-origin: center center;
  }
  .radial-node {
    min-width: 44px;
    min-height: 44px;
  }
  .battle-hint {
    display: none;
  }
  .kra-upgrade-tree {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
}

/* ==========================================================================
   v2.2.2 — KRA Arcade Pause & Options Game Menus
   ========================================================================== */
.modal-pause,
.modal-settings {
  max-width: 440px !important;
  width: min(440px, calc(100vw - 24px)) !important;
}
.kra-pause-banner {
  background: linear-gradient(180deg, #1b2e3b, #101d26);
  border: 2px solid #486475;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  box-shadow: inset 0 2px 6px #060d12aa, 0 2px 0 #071016;
}
.kra-pause-stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.kra-pause-stage strong {
  font: 22px var(--font);
  letter-spacing: 0.7px;
  color: #ffe799;
  text-shadow: 0 2px 0 #0b141a;
}
.kra-pause-mode {
  font: 800 10.5px "Trebuchet MS", sans-serif;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 5px;
  background: #0c171f;
  border: 1.5px solid #4c6c7e;
  color: #9ed8f5;
  white-space: nowrap;
}
.kra-pause-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.kra-pause-stats span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 6px;
  border-radius: 7px;
  background: #0c161d;
  border: 1px solid #2b4252;
  font: 800 13px "Trebuchet MS", sans-serif;
  color: #edf7fc;
}
.kra-pause-stats .ui-mark {
  width: 15px;
  height: 15px;
}
.kra-pause-time {
  color: #b7d3e3 !important;
}
.kra-pause-notice {
  background: linear-gradient(180deg, #523b16, #38270d);
  border: 1.5px solid #d7a64b;
  border-radius: 8px;
  padding: 7px 10px;
  margin-bottom: 12px;
  font: 700 12px "Trebuchet MS", sans-serif;
  color: #ffeab3;
  text-align: center;
}
.kra-audio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.kra-audio-tile {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, #273c4a, #172630);
  border: 2px solid #59798c;
  box-shadow: inset 0 1px 0 #8fb7cc55, 0 4px 0 #0b141a;
  color: #e8f5fc;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.12s ease, border-color 0.15s ease;
}
.kra-audio-tile:hover {
  filter: brightness(1.1);
  border-color: #8cc5e3;
}
.kra-audio-tile:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #0b141a;
}
.kra-audio-tile.off {
  background: linear-gradient(180deg, #242b31, #151a1f);
  border-color: #46535d;
  color: #93a7b5;
}
.kra-toggle-svg {
  width: 24px;
  height: 24px;
  flex: none;
  color: #79d2ff;
}
.kra-audio-tile.off .kra-toggle-svg {
  color: #7c8d99;
}
.kra-tile-label {
  font: 19px var(--font);
  letter-spacing: 0.8px;
  text-shadow: 0 2px 0 #0b141a;
}
.kra-tile-pill {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 999px;
  font: 800 11px "Trebuchet MS", sans-serif;
  letter-spacing: 0.6px;
}
.kra-audio-tile.on .kra-tile-pill {
  background: linear-gradient(180deg, #3ac96c, #1f8a45);
  border: 1.5px solid #9ef5b9;
  color: #ffffff;
  box-shadow: 0 0 8px #34c76866;
}
.kra-audio-tile.off .kra-tile-pill {
  background: #2c1b1d;
  border: 1.5px solid #8a4245;
  color: #f09b9e;
}
.kra-pause-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kra-resume-btn {
  width: 100%;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 26px !important;
  letter-spacing: 1.2px !important;
  background: linear-gradient(180deg, #4cd964 0%, #27a444 55%, #1c7d32 100%) !important;
  border: 2.5px solid #a8f7b2 !important;
  box-shadow: inset 0 2px 0 #ffffff66, 0 5px 0 #0f471c, 0 8px 18px #00000077 !important;
  color: #ffffff !important;
  text-shadow: 0 2px 0 #0e401a !important;
}
.kra-resume-btn:hover {
  filter: brightness(1.08);
}
.kra-resume-btn:active {
  transform: translateY(2px);
  box-shadow: inset 0 2px 0 #ffffff55, 0 3px 0 #0f471c !important;
}
.kra-pause-sub {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kra-sub-btn {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 19px !important;
  letter-spacing: 0.7px !important;
}
.kra-btn-svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.kra-options-section {
  background: #0f1c24;
  border: 1.5px solid #385161;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}
.kra-section-tag {
  display: inline-block;
  font: 800 11px "Trebuchet MS", sans-serif;
  letter-spacing: 1.1px;
  color: #8cc2de;
  margin-bottom: 9px;
}
.kra-options-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 10px;
}
.kra-opt-btn {
  width: 100%;
  min-height: 42px;
  font-size: 17px !important;
}
.kra-import-fold {
  border-top: 1px solid #293f4d;
  padding-top: 8px;
}
.kra-import-fold summary {
  cursor: pointer;
  font: 700 13px "Trebuchet MS", sans-serif;
  color: #a9cce0;
  user-select: none;
}
.kra-import-body {
  margin-top: 8px;
}
.kra-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #2a404f;
  font: 700 11.5px "Trebuchet MS", sans-serif;
  color: #8ba6b8;
}
.kra-saved-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9be6b2;
}
.kra-saved-dot i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #44d977;
  box-shadow: 0 0 6px #44d977bb;
}
