:root {
  color-scheme: dark;
  --ink: #241913;
  --paper: #ead8af;
  --paper-deep: #c79b62;
  --lacquer: #8f251d;
  --lacquer-bright: #d64c35;
  --jade: #5b8a75;
  --bronze: #c89245;
  --night: #18110e;
  --mist: rgba(253, 236, 190, 0.72);
  --panel: rgba(32, 21, 14, 0.82);
  --line: rgba(239, 200, 130, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  touch-action: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(205, 72, 41, 0.2), transparent 31%),
    linear-gradient(135deg, #21100c, #0f1512 54%, #301b11);
  color: #f9ecd0;
  font-family:
    "Noto Serif SC", "Songti SC", "PingFang SC", "Microsoft YaHei", system-ui,
    sans-serif;
}

body * {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

input {
  font: inherit;
}

input,
textarea,
select,
[contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
  touch-action: manipulation;
}

img,
canvas,
svg {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

.game-shell {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2vw, 24px);
}

.battle-card {
  width: min(1440px, 100%);
  height: min(920px, calc(100vh - 20px));
  min-height: 640px;
  display: grid;
  grid-template-rows: 72px 1fr 154px;
  overflow: hidden;
  border: 1px solid rgba(248, 203, 120, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(30, 18, 11, 0.92), rgba(24, 16, 11, 0.96)),
    var(--night);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48);
}

.map-card {
  width: min(1440px, 100%);
  height: min(920px, calc(100vh - 20px));
  min-height: 640px;
  display: grid;
  grid-template-rows: 72px 1fr;
  overflow: hidden;
  border: 1px solid rgba(248, 203, 120, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(29, 20, 13, 0.94), rgba(18, 15, 12, 0.98)),
    var(--night);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48);
}

.login-card {
  width: min(460px, calc(100vw - 28px));
  display: grid;
  gap: 16px;
  border: 1px solid rgba(248, 203, 120, 0.34);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(42, 25, 16, 0.96), rgba(18, 13, 10, 0.98));
  padding: 24px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48);
}

.login-brand {
  margin-bottom: 4px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tab {
  min-height: 42px;
  border: 1px solid rgba(255, 214, 131, 0.22);
  border-radius: 7px;
  background: rgba(15, 11, 9, 0.34);
  color: #f7dfac;
  cursor: pointer;
}

.tab.active {
  border-color: rgba(255, 214, 131, 0.58);
  background: rgba(180, 56, 39, 0.42);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form input {
  height: 46px;
  border: 1px solid rgba(255, 222, 148, 0.32);
  border-radius: 7px;
  background: rgba(10, 8, 7, 0.5);
  color: #ffe9bd;
  padding: 0 12px;
  outline: none;
}

.auth-form input:focus {
  border-color: rgba(255, 216, 118, 0.85);
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
}

.auth-code-row.hidden {
  display: none;
}

.auth-code-row button {
  min-height: 46px;
}

.auth-code-row button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.auth-message {
  min-height: 22px;
  margin: 0;
  color: rgba(255, 236, 198, 0.72);
  line-height: 1.5;
  text-align: center;
}

.map-card.hidden,
.battle-card.hidden,
.modal-layer.hidden {
  display: none;
}

.top-hud {
  display: grid;
  grid-template-columns: 1fr auto minmax(260px, 0.42fr);
  align-items: center;
  gap: 18px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(23, 12, 9, 0.96), rgba(53, 29, 15, 0.92));
}

.map-hud {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 18px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(23, 12, 9, 0.96), rgba(45, 35, 20, 0.92));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.seal {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 225, 154, 0.6);
  border-radius: 6px;
  background: var(--lacquer);
  box-shadow: inset 0 0 0 4px rgba(69, 15, 11, 0.42);
  color: #ffe9bd;
  font-weight: 800;
}

.brand strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(20px, 2.3vw, 30px);
  line-height: 1;
  letter-spacing: 0;
}

.guide-button {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 221, 143, 0.66);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 26%, rgba(255, 238, 179, 0.34), transparent 34%),
    linear-gradient(180deg, rgba(76, 39, 18, 0.92), rgba(26, 14, 10, 0.96));
  color: #ffe9b8;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(118, 54, 25, 0.22), 0 8px 18px rgba(0, 0, 0, 0.28);
}

.guide-button:hover {
  border-color: rgba(255, 231, 164, 0.95);
  color: #fff3cd;
  filter: brightness(1.12);
}

.brand span:last-child {
  display: block;
  margin-top: 6px;
  color: rgba(255, 236, 197, 0.64);
  font-size: 13px;
}

.resource-pill,
.wave-pill,
.kingdom-pill {
  min-height: 46px;
  border: 1px solid rgba(242, 195, 102, 0.34);
  border-radius: 6px;
  background: rgba(10, 10, 8, 0.34);
}

.resource-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
}

.kingdom-pill {
  display: grid;
  align-content: center;
  min-width: 126px;
  padding: 0 16px;
}

.lord-pill {
  min-width: 184px;
}

.resource-pill span,
.wave-pill span,
.kingdom-pill span {
  color: rgba(254, 231, 184, 0.72);
  font-size: 13px;
}

.resource-pill strong {
  color: #ffd47d;
  font-size: 24px;
}

.kingdom-pill strong {
  color: #ffd47d;
  font-size: 18px;
  line-height: 1.1;
}

.map-layout {
  display: grid;
  grid-template-columns: 1fr 326px;
  min-height: 0;
}

.world-panel {
  position: relative;
  margin: 16px 14px 16px 18px;
  overflow: auto;
  --map-width: 1320px;
  --map-height: 1980px;
  height: clamp(560px, 72vh, 760px);
  border: 1px solid rgba(250, 212, 141, 0.24);
  border-radius: 8px;
  background:
    radial-gradient(circle at 28% 26%, rgba(110, 137, 112, 0.28), transparent 17%),
    radial-gradient(circle at 72% 64%, rgba(165, 80, 47, 0.22), transparent 18%),
    linear-gradient(150deg, rgba(225, 194, 123, 0.17), rgba(24, 33, 27, 0.44)),
    #1d2119;
  box-shadow: inset 0 0 90px rgba(11, 8, 5, 0.54);
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
}

.world-panel::before {
  content: "";
  position: absolute;
  inset: 8%;
  opacity: 0.2;
  background:
    linear-gradient(38deg, transparent 49%, rgba(255, 226, 160, 0.28) 50%, transparent 51%),
    linear-gradient(145deg, transparent 49%, rgba(255, 226, 160, 0.16) 50%, transparent 51%);
  background-size: 120px 120px;
  pointer-events: none;
}

.route-layer,
.world-map {
  position: absolute;
  inset: 0;
}

.world-panel .route-layer {
  position: relative;
  display: block;
  width: var(--map-width);
  height: var(--map-height);
}

.world-panel .world-map {
  width: var(--map-width);
  height: var(--map-height);
}

.route-line {
  stroke: rgba(255, 222, 152, 0.11);
  stroke-width: 0.24;
  stroke-linecap: round;
}

.route-line.selected {
  stroke: rgba(255, 226, 156, 0.44);
  stroke-width: 0.4;
}

.route-line.open {
  stroke: rgba(239, 186, 92, 0.75);
  stroke-width: 0.46;
}

.city-node {
  position: absolute;
  width: 88px;
  min-height: 62px;
  translate: -50% -50%;
  padding: 7px 8px 8px;
  border: 1px solid rgba(255, 222, 148, 0.32);
  border-radius: 8px;
  background: rgba(31, 19, 12, 0.82);
  color: #ffe9bd;
  cursor: pointer;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.28);
  transition: transform 160ms ease, border-color 160ms ease, filter 160ms ease;
}

.city-node:hover,
.city-node.selected {
  border-color: rgba(255, 216, 118, 0.9);
  transform: translateY(-2px);
}

.city-node.owned {
  background: linear-gradient(180deg, rgba(85, 126, 94, 0.95), rgba(30, 48, 35, 0.95));
}

.city-node.frontier {
  box-shadow: 0 0 0 2px rgba(216, 75, 50, 0.26), 0 14px 24px rgba(0, 0, 0, 0.28);
}

.city-node.locked {
  opacity: 0.5;
  cursor: default;
}

.city-node strong,
.city-node span {
  display: block;
  pointer-events: none;
}

.city-node strong {
  font-size: 15px;
  line-height: 1.2;
}

.city-node span {
  margin-top: 4px;
  color: rgba(255, 234, 195, 0.72);
  font-size: 11px;
}

.city-node .city-stage {
  color: #ffe7a9;
  font-weight: 900;
}

.city-node .city-guard {
  margin-top: 2px;
  color: rgba(255, 234, 195, 0.66);
}

.city-progress {
  display: block;
  height: 4px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(35, 21, 14, 0.78);
}

.city-progress b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e0a347, #df4935);
}

.city-node.owned .city-progress b {
  background: linear-gradient(90deg, #8dd07f, #4f9b64);
}

.map-zoom-controls {
  position: sticky;
  left: calc(100% - 86px);
  top: 10px;
  z-index: 8;
  width: max-content;
  height: 0;
  display: flex;
  gap: 6px;
  margin: 0;
  pointer-events: auto;
}

.map-zoom-controls button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 224, 153, 0.4);
  border-radius: 999px;
  background: rgba(24, 13, 8, 0.86);
  color: #ffe9bd;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(10, 5, 3, 0.34);
  cursor: pointer;
}

.map-zoom-controls button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.strategy-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 16px 18px 16px 4px;
}

.wave-pill {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 0 14px;
}

.wave-track,
.fortress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 230, 167, 0.16);
}

.wave-track i,
.fortress-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--bronze), var(--lacquer-bright));
  transition: width 180ms ease;
}

.play-layout {
  display: grid;
  grid-template-columns: 1fr 292px;
  min-height: 0;
}

.battlefield-wrap {
  padding: 16px 14px 12px 18px;
  min-width: 0;
}

.battlefield {
  position: relative;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(250, 212, 141, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(31, 19, 13, 0.05), rgba(25, 12, 7, 0.34)),
    url("assets/battlefield.png") center/cover no-repeat;
  box-shadow: inset 0 0 90px rgba(15, 9, 5, 0.6);
  cursor: crosshair;
}

.battlefield::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(28, 13, 10, 0.15), transparent 28%, rgba(45, 17, 10, 0.18)),
    radial-gradient(ellipse at 50% 78%, rgba(254, 214, 128, 0.16), transparent 46%);
}

.fortress {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 3;
  width: min(380px, 62%);
  transform: translateX(-50%);
  padding: 12px 16px;
  border: 1px solid rgba(255, 218, 145, 0.38);
  border-radius: 7px;
  background: rgba(30, 14, 10, 0.62);
  text-align: center;
  backdrop-filter: blur(6px);
}

.fortress span {
  display: block;
  margin-bottom: 8px;
  color: #ffe2a3;
  font-weight: 700;
}

.lane-lines {
  position: absolute;
  inset: 96px 10% 132px;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  pointer-events: none;
}

.lane-lines i {
  border-right: 1px dashed rgba(255, 229, 170, 0.16);
}

.deployment-hint {
  position: absolute;
  left: 50%;
  bottom: 96px;
  z-index: 4;
  transform: translateX(-50%);
  max-width: min(92%, 520px);
  padding: 10px 14px;
  border: 1px solid rgba(255, 221, 143, 0.36);
  border-radius: 6px;
  background: rgba(36, 19, 10, 0.72);
  color: rgba(255, 235, 196, 0.82);
  font-size: 14px;
  text-align: center;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.deployment-hint.hidden {
  opacity: 0;
  transform: translate(-50%, 10px);
}

.deploy-zone {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 18px;
  height: 30%;
  z-index: 2;
  border: 1px dashed rgba(255, 235, 178, 0.28);
  border-radius: 8px;
  background: rgba(67, 37, 16, 0.12);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.deploy-zone.active {
  background: rgba(208, 134, 55, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 225, 145, 0.2);
}

.battle-engine-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.battle-engine-layer canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.engine-renderer-ready:not(.unit-assets-ready)::before {
  content: "士兵贴图加载中";
  position: absolute;
  left: 12px;
  top: 148px;
  z-index: 15;
  padding: 5px 8px;
  border: 1px solid rgba(255, 224, 153, 0.38);
  border-radius: 6px;
  background: rgba(33, 16, 10, 0.76);
  color: #ffe7b2;
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.battle-start-button {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 18;
  width: min(360px, 78%);
  min-height: 72px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 219, 143, 0.72);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(203, 72, 45, 0.96), rgba(128, 32, 22, 0.96));
  color: #fff0cf;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow:
    0 14px 30px rgba(35, 10, 5, 0.44),
    inset 0 0 0 1px rgba(255, 238, 181, 0.18);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.battle-start-button.hidden,
.barrack-action.hidden {
  display: none;
}

.battle-start-button:disabled {
  filter: grayscale(0.35) brightness(0.72);
  cursor: not-allowed;
}

button[data-busy="1"] {
  pointer-events: none;
  filter: saturate(0.72) brightness(0.82);
}

.battle-start-button[data-busy="1"] {
  background: linear-gradient(180deg, rgba(181, 107, 44, 0.96), rgba(110, 55, 22, 0.96));
}

.barrack-action {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 22;
  width: min(430px, 76%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 12px;
  align-items: center;
  transform: translateX(-50%);
  padding: 9px 10px;
  border: 1px solid rgba(255, 224, 153, 0.42);
  border-radius: 8px;
  background: rgba(31, 16, 10, 0.9);
  color: #ffe9bd;
  box-shadow: 0 14px 34px rgba(16, 7, 4, 0.38);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.barrack-action-close {
  position: absolute;
  right: -8px;
  top: -10px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 224, 153, 0.5);
  border-radius: 999px;
  background: rgba(22, 11, 7, 0.96);
  color: #fff0cf;
  font-size: 20px;
  line-height: 24px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(12, 6, 3, 0.34);
}

.barrack-action strong,
.barrack-action span {
  display: block;
}

.barrack-action strong {
  font-size: 14px;
}

.barrack-action span {
  margin-top: 2px;
  color: rgba(255, 231, 188, 0.72);
  font-size: 11px;
}

.barrack-action .restart-button {
  min-height: 34px;
  margin: 0;
  padding: 0 12px;
  white-space: nowrap;
}

.barrack-action .restart-button:disabled {
  filter: grayscale(0.35) brightness(0.72);
  cursor: not-allowed;
}

.battle-corner-actions {
  display: grid;
  gap: 8px;
}

.barrack-dismantle-button {
  border-color: rgba(255, 135, 115, 0.62);
  background: linear-gradient(180deg, rgba(147, 47, 34, 0.96), rgba(80, 24, 18, 0.98));
  color: #fff1df;
}

.sortie-button {
  position: relative;
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  border: 2px solid rgba(218, 171, 82, 0.86);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 229, 151, 0.24), transparent 30%),
    linear-gradient(180deg, #2f2717 0%, #17110b 52%, #463019 100%);
  color: #ffe7a9;
  font-weight: 900;
  box-shadow:
    inset 0 0 0 2px rgba(12, 8, 5, 0.82),
    inset 0 12px 22px rgba(255, 229, 148, 0.12),
    0 10px 22px rgba(11, 6, 4, 0.5);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.sortie-button::before {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: inherit;
}

.sortie-button::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  border: 1px solid rgba(255, 231, 170, 0.18);
  pointer-events: none;
}

.sortie-button:hover {
  filter: brightness(1.08);
}

.sortie-button:active {
  transform: translateY(1px) scale(0.97);
}

.sortie-button:disabled {
  filter: grayscale(0.45) brightness(0.68);
  cursor: not-allowed;
}

.sortie-button b {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: -1px;
  color: #ffe7a9;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.75);
}

.sortie-icon {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  display: block;
}

.sortie-icon i {
  position: absolute;
  display: block;
  background: #e5c47c;
  box-shadow: 0 1px 0 rgba(255, 248, 203, 0.35);
}

.sortie-head {
  left: 10px;
  top: 2px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.sortie-body {
  left: 12px;
  top: 11px;
  width: 6px;
  height: 13px;
  border-radius: 3px 3px 2px 2px;
}

.sortie-spear {
  left: 20px;
  top: 5px;
  width: 4px;
  height: 23px;
  border-radius: 999px;
  transform: rotate(42deg);
  transform-origin: center;
}

.sortie-leg {
  top: 22px;
  width: 4px;
  height: 8px;
  border-radius: 999px;
}

.sortie-leg.left {
  left: 10px;
  transform: rotate(28deg);
}

.sortie-leg.right {
  left: 17px;
  transform: rotate(-28deg);
}

.general-detail {
  position: absolute;
  left: 12px;
  top: 92px;
  z-index: 14;
  width: min(300px, 58%);
  padding: 10px;
  border: 1px solid rgba(255, 224, 153, 0.42);
  border-radius: 8px;
  background: rgba(29, 15, 10, 0.9);
  color: #ffe9bd;
  box-shadow: 0 14px 34px rgba(16, 7, 4, 0.36);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.general-detail.hidden {
  display: none;
}

.general-detail-head {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 8px;
  align-items: center;
  padding-right: 28px;
}

.general-detail-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 224, 153, 0.34);
  border-radius: 999px;
  background: rgba(78, 31, 21, 0.9);
  color: #ffe9bd;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.general-detail-head > span {
  width: 38px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 219, 148, 0.34);
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 26%, rgba(255, 224, 153, 0.9), transparent 29%),
    linear-gradient(180deg, var(--portrait-a), var(--portrait-b));
  color: #fff0ca;
  font-size: 18px;
  font-weight: 900;
}

.general-detail strong,
.general-detail small,
.general-detail label {
  display: block;
}

.general-detail strong {
  font-size: 14px;
}

.general-detail small {
  margin-top: 2px;
  color: rgba(255, 231, 188, 0.72);
  font-size: 10px;
}

.general-detail-bars {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.general-detail-bars label {
  color: rgba(255, 231, 188, 0.78);
  font-size: 10px;
  font-weight: 800;
}

.general-detail-bars b {
  float: right;
  color: #fff0c9;
  font-weight: 900;
}

.general-detail-bars i {
  display: block;
  height: 5px;
  margin-top: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(38, 18, 12, 0.72);
}

.general-detail-bars em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7fc87d, #ecd06c);
}

.general-detail-bars .mana em {
  background: linear-gradient(90deg, #5aa8ff, #9de1ff);
}

.general-detail-bars .xp em {
  background: linear-gradient(90deg, #d69128, #ffd866);
}

.general-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 8px;
}

.general-detail-stats span {
  padding: 4px 3px;
  border: 1px solid rgba(255, 218, 144, 0.2);
  border-radius: 5px;
  background: rgba(255, 231, 174, 0.08);
  color: rgba(255, 239, 207, 0.86);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.general-detail p {
  margin: 8px 0 0;
  color: rgba(255, 236, 198, 0.78);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
}

.entities {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.engine-renderer-ready .entities .unit,
.engine-renderer-ready .entities .effect,
.engine-renderer-ready .entities .barracks.enemy {
  opacity: 0;
}

.unit,
.barracks {
  position: absolute;
  translate: -50% -50%;
  will-change: transform, left, top;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.unit {
  width: 34px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 229, 167, 0.45);
  border-radius: 45% 45% 35% 35%;
  background:
    linear-gradient(180deg, rgba(255, 236, 176, 0.9), rgba(180, 95, 45, 0.9)),
    #a14c30;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.34);
  color: #28130e;
  font-size: 12px;
  font-weight: 900;
}

.unit.enemy {
  border-color: rgba(252, 165, 132, 0.5);
  background: linear-gradient(180deg, #d26043, #602019);
  color: #ffe9ce;
}

.unit.kind-spear {
  background: linear-gradient(180deg, #dbe8d4, #537962);
  color: #10231a;
}

.unit.kind-archer {
  border-color: rgba(185, 225, 172, 0.58);
  background: linear-gradient(180deg, #d8e8bd, #587a3c);
  color: #13200e;
}

.unit.kind-crossbow {
  border-color: rgba(255, 222, 139, 0.58);
  background: linear-gradient(180deg, #f0d28a, #7a5228);
  color: #241407;
}

.unit.kind-cavalry {
  width: 40px;
  background: linear-gradient(180deg, #ead18b, #7a3d23);
  color: #241105;
}

.unit.kind-sword {
  background: linear-gradient(180deg, #efc089, #8f4d32);
}

.unit.elite-soldier {
  border-color: rgba(255, 226, 139, 0.95);
  box-shadow:
    0 0 0 2px rgba(255, 224, 139, 0.34),
    0 0 16px rgba(255, 210, 100, 0.72),
    0 8px 18px rgba(0, 0, 0, 0.38);
}

.unit.elite-soldier::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 42px;
  height: 13px;
  translate: -50% 0;
  border: 1px solid rgba(255, 225, 132, 0.68);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 225, 132, 0.35), transparent 68%);
  box-shadow: 0 0 12px rgba(255, 211, 96, 0.42);
  pointer-events: none;
}

.unit.enemy.elite-soldier {
  border-color: rgba(255, 162, 105, 0.95);
  box-shadow:
    0 0 0 2px rgba(255, 154, 91, 0.32),
    0 0 16px rgba(255, 116, 68, 0.7),
    0 8px 18px rgba(0, 0, 0, 0.4);
}

.unit.enemy.elite-soldier::before {
  border-color: rgba(255, 164, 103, 0.72);
  background: radial-gradient(ellipse at center, rgba(255, 147, 83, 0.34), transparent 68%);
}

.unit.elite-tier-3 {
  border-color: rgba(190, 239, 255, 0.98);
  box-shadow:
    0 0 0 2px rgba(122, 218, 255, 0.36),
    0 0 18px rgba(120, 218, 255, 0.8),
    0 0 30px rgba(255, 236, 162, 0.3),
    0 8px 18px rgba(0, 0, 0, 0.42);
}

.unit.elite-tier-3::before {
  width: 48px;
  height: 15px;
  border-color: rgba(177, 236, 255, 0.8);
  background:
    radial-gradient(ellipse at center, rgba(161, 230, 255, 0.44), transparent 68%),
    radial-gradient(ellipse at center, rgba(255, 238, 172, 0.24), transparent 48%);
  box-shadow:
    0 0 14px rgba(136, 219, 255, 0.62),
    0 0 22px rgba(255, 228, 142, 0.34);
}

.unit.enemy.elite-tier-3 {
  border-color: rgba(255, 206, 154, 0.98);
  box-shadow:
    0 0 0 2px rgba(255, 178, 94, 0.36),
    0 0 18px rgba(255, 144, 82, 0.8),
    0 0 30px rgba(255, 227, 151, 0.28),
    0 8px 18px rgba(0, 0, 0, 0.42);
}

.unit.enemy.elite-tier-3::before {
  border-color: rgba(255, 202, 145, 0.84);
  background:
    radial-gradient(ellipse at center, rgba(255, 166, 91, 0.45), transparent 68%),
    radial-gradient(ellipse at center, rgba(255, 237, 166, 0.24), transparent 48%);
}

.unit.general {
  width: 52px;
  height: 60px;
  border: 2px solid #ffd77b;
  border-radius: 42% 42% 34% 34%;
  background: linear-gradient(180deg, #ffe0a1, #a43321);
  color: #25130d;
  font-size: 18px;
  pointer-events: auto;
}

.unit.general.enemy-contact {
  filter: brightness(1.2);
}

.unit .hp,
.barracks .hp {
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 42px;
  height: 5px;
  overflow: hidden;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(32, 8, 6, 0.55);
}

.unit-label {
  position: absolute;
  left: 50%;
  bottom: 100%;
  min-width: 76px;
  margin-bottom: 5px;
  transform: translateX(-50%);
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(28, 14, 8, 0.76);
  color: #fff0c9;
  font-size: 10px;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.unit-label b {
  display: block;
  color: #9ef0a3;
  font-size: 10px;
}

.unit-label b.mp {
  color: #8ec8ff;
}

.unit .hp i,
.barracks .hp i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: #79c37b;
}

.barracks .hp {
  bottom: -5px;
  width: 30px;
  height: 4px;
}

.barracks {
  width: 46px;
  height: 36px;
  z-index: 2;
  border: 0;
  border-radius: 9px;
  background: url("assets/barracks/player-barrack.png") center 53% / contain no-repeat;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.42));
  pointer-events: auto;
  cursor: pointer;
}

.barracks::before {
  display: none;
}

.barracks.enemy {
  background: url("assets/barracks/enemy-barrack.png") center 53% / contain no-repeat;
}

.barracks.enemy::before {
  display: none;
}

.barracks.enemy .hp i {
  background: linear-gradient(90deg, #d74b39, #f17b59);
}

.barracks::after {
  content: attr(data-name);
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: max-content;
  max-width: 48px;
  transform: translateX(-50%);
  color: #ffe6ad;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  text-shadow: 0 2px 4px rgba(20, 8, 4, 0.95);
}

.barracks.ready {
  filter: drop-shadow(0 0 5px rgba(255, 210, 94, 0.42)) drop-shadow(0 6px 8px rgba(0, 0, 0, 0.42));
}

.barracks.selected {
  outline: 2px solid rgba(255, 232, 142, 0.82);
  outline-offset: 2px;
  filter: drop-shadow(0 0 7px rgba(255, 232, 142, 0.68)) drop-shadow(0 7px 10px rgba(0, 0, 0, 0.46));
}

.barracks.arming {
  pointer-events: none;
  filter: brightness(0.92);
  filter: brightness(0.92) drop-shadow(0 0 8px rgba(118, 196, 255, 0.25));
}

.mission-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 16px 18px 12px 4px;
}

.panel-block {
  border: 1px solid rgba(244, 198, 111, 0.24);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 236, 174, 0.08);
}

.panel-kicker,
.panel-block.compact span {
  display: block;
  color: rgba(255, 220, 151, 0.62);
  font-size: 12px;
  font-weight: 700;
}

.panel-block h1 {
  margin: 8px 0 10px;
  color: #ffe4ad;
  font-size: 26px;
  line-height: 1.12;
  letter-spacing: 0;
}

.panel-block p {
  margin: 0;
  color: rgba(255, 236, 198, 0.72);
  font-size: 14px;
  line-height: 1.65;
}

.panel-block.compact {
  padding: 13px 14px;
}

.panel-block.compact strong {
  display: block;
  margin-top: 6px;
  color: #fff2cd;
  font-size: 15px;
  line-height: 1.35;
}

.loadout-control {
  display: grid;
  grid-template-columns: 1fr 68px 1fr;
  gap: 8px;
  margin-top: 10px;
}

.loadout-control .ghost-button {
  min-height: 34px;
  padding: 0 8px;
}

.loadout-control input {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid rgba(255, 222, 148, 0.28);
  border-radius: 7px;
  background: rgba(10, 8, 7, 0.46);
  color: #ffe9bd;
  text-align: center;
  outline: none;
}

.loadout-control input:focus {
  border-color: rgba(255, 216, 118, 0.85);
}

.restart-button {
  margin-top: auto;
  min-height: 46px;
  border: 1px solid rgba(255, 214, 131, 0.36);
  border-radius: 7px;
  background: linear-gradient(180deg, #b43827, #762016);
  color: #fff0cf;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms ease, filter 160ms ease;
}

.restart-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.35) brightness(0.72);
}

.ghost-button {
  min-height: 46px;
  border: 1px solid rgba(255, 214, 131, 0.24);
  border-radius: 7px;
  background: rgba(15, 11, 9, 0.34);
  color: #f7dfac;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease;
}

.ghost-button:hover {
  border-color: rgba(255, 214, 131, 0.55);
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.ghost-button.danger {
  border-color: rgba(214, 76, 53, 0.36);
  color: #ffc7b7;
}

.icon-action,
.primary-action {
  display: inline-grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-items: center;
  gap: 7px;
  line-height: 1;
}

.button-symbol {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 226, 158, 0.34);
  border-radius: 7px;
  background:
    radial-gradient(circle at 40% 28%, rgba(255, 234, 172, 0.34), transparent 36%),
    linear-gradient(180deg, rgba(129, 74, 31, 0.92), rgba(55, 27, 15, 0.94));
  color: #ffe8b2;
  font-size: 17px;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(25, 9, 3, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 180, 0.18),
    0 5px 10px rgba(6, 3, 1, 0.24);
}

.button-label {
  min-width: 0;
  color: inherit;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.ghost-button.danger .button-symbol {
  border-color: rgba(255, 143, 118, 0.42);
  background:
    radial-gradient(circle at 42% 28%, rgba(255, 190, 165, 0.32), transparent 36%),
    linear-gradient(180deg, rgba(118, 35, 25, 0.96), rgba(44, 16, 13, 0.96));
  color: #ffd1c4;
}

.save-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 10px;
}

.save-actions .ghost-button {
  min-height: 34px;
  padding: 0 8px;
  font-size: 13px;
}

.save-modal-card {
  width: min(360px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 42px));
  overflow: auto;
  position: relative;
  padding: 18px;
  border: 1px solid rgba(255, 218, 139, 0.32);
  border-radius: 10px;
  background:
    radial-gradient(circle at 22% 8%, rgba(174, 102, 45, 0.2), transparent 32%),
    linear-gradient(180deg, rgba(39, 21, 13, 0.98), rgba(16, 10, 8, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.56);
  color: #ffe7b0;
}

.save-modal-card h2 {
  margin: 5px 32px 6px 0;
  font-size: 22px;
}

.save-modal-card p {
  margin: 0 0 14px;
  color: rgba(255, 230, 188, 0.68);
  font-size: 13px;
  line-height: 1.45;
}

.save-slot-list {
  display: grid;
  gap: 8px;
}

.save-slot-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px 10px;
  align-items: center;
  width: 100%;
  padding: 9px;
  border: 1px solid rgba(244, 193, 105, 0.24);
  border-radius: 8px;
  background: rgba(20, 13, 9, 0.72);
  color: #ffe6ae;
  text-align: left;
  cursor: pointer;
}

.save-slot-item:hover {
  border-color: rgba(255, 216, 137, 0.58);
  filter: brightness(1.08);
}

.save-slot-item span {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(145, 83, 35, 0.94), rgba(64, 31, 16, 0.96));
  color: #ffe8b2;
  font-size: 16px;
  font-weight: 900;
}

.save-slot-item strong {
  min-width: 0;
  font-size: 15px;
}

.save-slot-item small {
  color: rgba(255, 230, 184, 0.58);
  font-size: 12px;
}

.save-slot-item.add {
  border-color: rgba(255, 221, 136, 0.42);
  background: rgba(61, 32, 16, 0.72);
}

.save-empty {
  margin: 4px 0 0;
  color: rgba(255, 230, 188, 0.58);
  font-size: 13px;
}

.save-slot-actions {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 213, 130, 0.22);
  border-radius: 8px;
  background: rgba(10, 7, 5, 0.5);
}

.save-slot-actions > strong {
  display: block;
  margin-bottom: 8px;
  color: #ffe8b2;
  font-size: 14px;
}

.save-slot-actions > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.save-slot-actions button {
  min-height: 42px;
}

.guide-modal-card {
  position: relative;
  width: min(560px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(255, 218, 139, 0.34);
  border-radius: 10px;
  background:
    radial-gradient(circle at 18% 8%, rgba(180, 54, 37, 0.2), transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(199, 155, 78, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(39, 22, 14, 0.98), rgba(15, 10, 8, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
  color: #ffe8b8;
}

.guide-modal-card h2 {
  margin: 5px 36px 6px 0;
  font-size: 24px;
  line-height: 1.15;
}

.guide-modal-card > p {
  margin: 0 0 14px;
  color: rgba(255, 232, 190, 0.72);
  font-size: 13px;
  line-height: 1.55;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.guide-grid article {
  min-height: 126px;
  padding: 12px;
  border: 1px solid rgba(244, 193, 105, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(45, 27, 16, 0.78), rgba(14, 10, 8, 0.72));
}

.guide-grid article span {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 24px;
  margin-bottom: 8px;
  padding: 0 8px;
  border: 1px solid rgba(255, 220, 139, 0.26);
  border-radius: 999px;
  background: rgba(143, 37, 29, 0.32);
  color: #ffd98f;
  font-size: 12px;
  font-weight: 800;
}

.guide-grid h3 {
  margin: 0 0 6px;
  color: #fff1c7;
  font-size: 16px;
  line-height: 1.2;
}

.guide-grid p {
  margin: 0;
  color: rgba(255, 234, 194, 0.72);
  font-size: 12px;
  line-height: 1.5;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 8, 6, 0.74);
  backdrop-filter: blur(8px);
}

#mapGeneralModal {
  z-index: 72;
}

#marketConfirmModal {
  z-index: 82;
}

.general-modal-card {
  position: relative;
  width: min(430px, 94vw);
  max-height: min(86vh, 700px);
  overflow: auto;
  border: 1px solid rgba(255, 222, 148, 0.46);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(49, 27, 16, 0.98), rgba(22, 15, 11, 0.98));
  color: #ffe9bd;
  padding: 18px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.52);
}

.general-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 222, 148, 0.44);
  border-radius: 50%;
  background: rgba(63, 33, 18, 0.9);
  color: #ffe7ad;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.map-general-head {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  padding-right: 36px;
}

.map-general-head > span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 231, 170, 0.46);
  border-radius: 8px;
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 245, 199, 0.38), transparent 28%),
    linear-gradient(180deg, var(--portrait-a), var(--portrait-b));
  color: #fff0ca;
  font-size: 24px;
  font-weight: 900;
  box-shadow: inset 0 0 20px rgba(255, 228, 143, 0.18);
}

.map-general-head strong {
  display: block;
  color: #fff0c9;
  font-size: 20px;
  line-height: 1.15;
}

.map-general-head strong em {
  color: #ffd866;
  font-style: normal;
}

.map-general-head small {
  display: block;
  margin-top: 5px;
  color: rgba(255, 236, 198, 0.7);
  font-size: 12px;
}

.map-general-metrics,
.map-general-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.map-general-section {
  margin-top: 14px;
}

.map-general-section h3 {
  margin: 0 0 8px;
  color: #ffd98a;
  font-size: 14px;
}

.map-general-section p {
  margin: 0;
  border: 1px solid rgba(255, 218, 144, 0.18);
  border-radius: 7px;
  background: rgba(255, 231, 174, 0.07);
  color: rgba(255, 236, 198, 0.86);
  padding: 10px;
  font-size: 12px;
  line-height: 1.55;
}

.metric {
  min-width: 0;
  border: 1px solid rgba(255, 218, 144, 0.18);
  border-radius: 7px;
  background: rgba(255, 231, 174, 0.07);
  padding: 7px 8px;
}

.metric i {
  display: block;
  color: rgba(255, 231, 188, 0.68);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.metric b {
  display: block;
  margin-top: 3px;
  color: #ffd866;
  font-size: 16px;
  font-weight: 900;
}

.metric small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 236, 198, 0.62);
  font-size: 9px;
  line-height: 1.25;
}

.bid-card {
  width: min(460px, 100%);
  border: 1px solid rgba(255, 222, 148, 0.42);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(49, 27, 16, 0.98), rgba(22, 15, 11, 0.98));
  padding: 22px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.52);
}

.market-modal-card {
  position: relative;
  width: min(620px, 96vw);
  max-height: min(86vh, 760px);
  overflow: auto;
  border: 1px solid rgba(255, 222, 148, 0.46);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(49, 27, 16, 0.98), rgba(22, 15, 11, 0.98));
  color: #ffe9bd;
  padding: 20px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.52);
}

.market-modal-card h2 {
  margin: 8px 42px 8px 0;
  color: #ffe4ad;
  font-size: 26px;
}

.market-modal-card p {
  margin: 0 42px 16px 0;
  color: rgba(255, 236, 198, 0.76);
  line-height: 1.55;
}

.market-list {
  display: grid;
  gap: 10px;
}

.market-empty {
  border: 1px dashed rgba(255, 222, 148, 0.28);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.market-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 88px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 222, 148, 0.22);
  border-radius: 8px;
  background: rgba(255, 231, 174, 0.06);
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.market-item.owned {
  opacity: 0.62;
}

.market-item:hover {
  border-color: rgba(255, 216, 118, 0.55);
  background: rgba(255, 231, 174, 0.1);
  transform: translateY(-1px);
}

.market-portrait {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 231, 170, 0.42);
  border-radius: 8px;
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 245, 199, 0.38), transparent 28%),
    linear-gradient(180deg, var(--portrait-a), var(--portrait-b));
  color: #fff0ca;
  font-size: 22px;
  font-weight: 900;
}

.market-info {
  min-width: 0;
}

.market-info strong {
  display: block;
  color: #fff0c9;
  font-size: 16px;
}

.market-info small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 236, 198, 0.66);
  font-size: 11px;
}

.market-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.market-stats span {
  border: 1px solid rgba(255, 222, 148, 0.18);
  border-radius: 999px;
  background: rgba(15, 9, 6, 0.42);
  color: rgba(255, 236, 198, 0.68);
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 800;
}

.market-stats b {
  color: #ffd866;
}

.market-item > button {
  min-height: 38px;
  padding: 0 8px;
  border-radius: 7px;
  cursor: pointer;
}

.bid-card h2 {
  margin: 8px 0 10px;
  color: #ffe4ad;
  font-size: 28px;
}

.bid-card p {
  margin: 0 0 18px;
  color: rgba(255, 236, 198, 0.75);
  line-height: 1.65;
}

.bid-card label,
.bid-card label span {
  display: block;
}

.bid-card label span {
  margin-bottom: 8px;
  color: rgba(255, 220, 151, 0.72);
  font-size: 13px;
  font-weight: 700;
}

.bid-card input {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(255, 222, 148, 0.32);
  border-radius: 7px;
  background: rgba(10, 8, 7, 0.5);
  color: #ffe9bd;
  padding: 0 12px;
  outline: none;
}

.bid-card input:focus {
  border-color: rgba(255, 216, 118, 0.85);
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.restart-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.hand-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  padding: 13px 16px 16px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(44, 24, 14, 0.96), rgba(23, 15, 11, 0.98));
}

.general-card {
  position: relative;
  min-width: 0;
  height: 125px;
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid rgba(240, 191, 103, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(94, 54, 27, 0.92), rgba(41, 22, 14, 0.94)),
    rgba(43, 26, 16, 0.9);
  color: #ffe9bd;
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 232, 174, 0.08), 0 6px 14px rgba(15, 7, 3, 0.22);
  transition: transform 160ms ease, border-color 160ms ease, filter 160ms ease, background 160ms ease;
}

.general-card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 220, 143, 0.18);
  border-radius: 6px;
  pointer-events: none;
}

.general-card:hover,
.general-card.selected {
  transform: translateY(-3px);
  border-color: rgba(255, 215, 121, 0.8);
  background:
    linear-gradient(180deg, rgba(111, 62, 30, 0.95), rgba(48, 25, 14, 0.96)),
    rgba(43, 26, 16, 0.94);
}

.general-card.disabled {
  cursor: not-allowed;
  filter: grayscale(0.35) brightness(0.72);
}

.portrait {
  position: relative;
  height: 100%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 219, 148, 0.32);
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 231, 166, 0.32), transparent 32%),
    linear-gradient(180deg, color-mix(in srgb, var(--portrait-a) 82%, #f5d08b), var(--portrait-b));
  box-shadow: inset 0 -18px 24px rgba(28, 12, 7, 0.3);
}

.portrait::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 226, 151, 0.18);
  border-radius: 5px;
}

.portrait span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 231, 167, 0.35);
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 230, 160, 0.34), transparent 38%),
    rgba(26, 11, 7, 0.28);
  color: #fff0ca;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 3px 8px rgba(16, 7, 3, 0.28);
}

.card-copy {
  min-width: 0;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.card-copy strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-title small,
.card-copy small {
  color: rgba(255, 229, 178, 0.65);
  white-space: nowrap;
}

.card-xp {
  display: grid;
  gap: 4px;
  margin-top: 7px;
}

.card-xp span {
  color: rgba(255, 236, 193, 0.78);
  font-size: 11px;
  line-height: 1;
}

.card-xp i {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(38, 16, 8, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 221, 137, 0.14);
}

.card-xp em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d69128, #ffd866);
}

.card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.card-stats span {
  padding: 3px 6px;
  border: 1px solid rgba(255, 218, 144, 0.2);
  border-radius: 4px;
  background: rgba(255, 231, 174, 0.08);
  color: rgba(255, 239, 207, 0.78);
  font-size: 12px;
}

.cooldown-mask {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 26px;
  height: 22px;
  display: none;
  place-items: center;
  border: 1px solid rgba(255, 224, 153, 0.45);
  border-radius: 999px;
  background: rgba(20, 12, 9, 0.82);
  color: #ffe4a3;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.24);
}

.general-card.cooling .cooldown-mask {
  display: grid;
}

.result-banner {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: min(560px, 82%);
  max-height: min(78vh, calc(100% - 24px));
  transform: translate(-50%, -50%);
  padding: 18px 22px;
  border: 1px solid rgba(255, 224, 153, 0.58);
  border-radius: 8px;
  background: rgba(33, 16, 10, 0.88);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
  color: #ffe7b2;
  text-align: center;
  backdrop-filter: blur(8px);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.result-banner.rest-banner {
  top: auto;
  bottom: 18px;
  width: min(460px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: 10px 12px;
  background: rgba(33, 16, 10, 0.78);
}

.result-banner.rest-banner strong {
  margin-bottom: 3px;
  font-size: 20px;
}

.result-banner.rest-banner span {
  font-size: 13px;
  line-height: 1.45;
}

.result-banner.rest-banner .result-actions {
  gap: 8px;
  margin-top: 8px;
}

.result-banner.rest-banner .restart-button,
.result-banner.rest-banner .ghost-button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

.result-banner strong {
  display: block;
  margin-bottom: 6px;
  font-size: 28px;
}

.battle-stats {
  flex: 1 1 auto;
  margin-top: 12px;
  overflow: auto;
  border: 1px solid rgba(255, 224, 153, 0.22);
  border-radius: 7px;
  background: rgba(14, 9, 7, 0.38);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.battle-stats h3 {
  margin: 0;
  padding: 8px 10px 5px;
  color: #ffd983;
  font-size: 13px;
  text-align: left;
}

.battle-stats table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.battle-stats th,
.battle-stats td {
  padding: 5px 8px;
  border-top: 1px solid rgba(255, 224, 153, 0.12);
  text-align: right;
  white-space: nowrap;
}

.battle-stats th:first-child {
  text-align: left;
}

.battle-stats thead th {
  color: rgba(255, 235, 190, 0.68);
  font-size: 11px;
  font-weight: 800;
}

.battle-stats tbody th {
  color: #fff1c7;
}

.battle-stats tbody td {
  color: #ffd866;
  font-weight: 900;
}

.result-actions {
  position: sticky;
  bottom: -18px;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px -8px -10px;
  padding: 12px 8px 10px;
  background: linear-gradient(180deg, rgba(33, 16, 10, 0), rgba(33, 16, 10, 0.94) 30%, rgba(33, 16, 10, 0.98));
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.result-actions .restart-button,
.result-actions .ghost-button {
  min-height: 44px;
  margin: 0;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .game-shell {
    min-height: 100%;
    align-items: start;
  }

  .battle-card,
  .map-card {
    height: auto;
    min-height: 940px;
    grid-template-rows: auto auto auto;
  }

  .top-hud,
  .map-hud {
    grid-template-columns: 1fr 1fr;
  }

  .brand {
    grid-column: 1 / -1;
  }

  .play-layout {
    grid-template-columns: 1fr;
  }

  .map-layout {
    grid-template-columns: 1fr;
  }

  .world-panel {
    height: 600px;
    margin: 12px;
  }

  .strategy-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0 12px 12px;
  }

  .strategy-panel .panel-block:first-child {
    grid-column: 1 / -1;
  }

  .battlefield-wrap {
    height: 620px;
    padding: 12px;
  }

  .mission-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0 12px 12px;
  }

  .panel-block:first-child {
    grid-column: 1 / -1;
  }

  .hand-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .general-card {
    height: 116px;
  }
}

@media (max-width: 560px) {
  .top-hud,
  .map-hud,
  .strategy-panel,
  .mission-panel,
  .hand-bar {
    grid-template-columns: 1fr;
  }

  .battlefield-wrap {
    height: 540px;
  }

  .result-banner {
    top: 10px;
    width: calc(100% - 20px);
    max-height: calc(100% - 20px);
    transform: translateX(-50%);
    padding: 12px 12px 10px;
  }

  .result-banner strong {
    font-size: 22px;
  }

  .battle-stats {
    margin-top: 9px;
  }

  .battle-stats th,
  .battle-stats td {
    padding: 4px 6px;
    font-size: 11px;
  }

  .result-actions {
    bottom: -10px;
    gap: 8px;
    margin: 10px -6px -8px;
    padding: 10px 6px 8px;
  }

  .result-actions .restart-button,
  .result-actions .ghost-button {
    min-height: 42px;
    font-size: 14px;
  }

  .general-card {
    grid-template-columns: 68px 1fr;
  }

  .world-panel {
    height: 520px;
  }

  .city-node {
    width: 72px;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }
}

/* Portrait-first mobile game shell */
body {
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(42, 18, 12, 0.72), rgba(10, 13, 10, 0.92)),
    radial-gradient(circle at 50% 12%, rgba(201, 87, 48, 0.22), transparent 32%),
    #11100c;
}

.game-shell {
  min-height: 100dvh;
  align-items: stretch;
  padding: 0;
}

.battle-card,
.map-card {
  width: min(460px, 100vw);
  height: 100dvh;
  min-height: 720px;
  border-radius: 0;
  border-left: 1px solid rgba(248, 203, 120, 0.24);
  border-right: 1px solid rgba(248, 203, 120, 0.24);
}

.battle-card {
  grid-template-rows: auto minmax(0, 1fr) 142px;
}

.map-card {
  grid-template-rows: auto minmax(0, 1fr);
  overflow: auto;
}

.top-hud,
.map-hud {
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px 10px;
}

.top-hud .brand,
.map-hud .brand {
  grid-column: 1 / 2;
}

.seal {
  width: 36px;
  height: 36px;
}

.brand strong {
  font-size: 20px;
}

.brand span:last-child {
  margin-top: 2px;
  font-size: 11px;
}

.resource-pill,
.kingdom-pill {
  min-height: 42px;
  padding: 0 10px;
}

.resource-pill strong {
  font-size: 18px;
}

.wave-pill {
  grid-column: 1 / -1;
  min-height: 34px;
  gap: 5px;
  padding: 5px 9px;
}

.play-layout,
.map-layout {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}

.battlefield-wrap {
  height: auto;
  min-height: 0;
  padding: 8px 8px 6px;
}

.battlefield {
  min-height: 0;
  border-radius: 8px;
}

.fortress {
  top: 10px;
  width: min(300px, 74%);
  padding: 8px 12px;
}

.fortress span {
  margin-bottom: 6px;
  font-size: 13px;
}

.lane-lines {
  inset: 76px 7% 106px;
}

.deployment-hint {
  bottom: 84px;
  max-width: 86%;
  padding: 8px 10px;
  font-size: 12px;
}

.deploy-zone {
  left: 7%;
  right: 7%;
  bottom: 12px;
  height: 29%;
}

.mission-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 0 8px 8px;
}

.mission-panel .panel-block:first-child {
  display: none;
}

.panel-block {
  border-radius: 7px;
  padding: 10px;
}

.panel-block.compact {
  padding: 9px 10px;
}

.panel-block.compact span {
  font-size: 10px;
}

.panel-block.compact strong {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.25;
}

.loadout-control {
  grid-template-columns: 42px 1fr 42px;
  gap: 5px;
  margin-top: 7px;
}

.loadout-control .ghost-button,
.loadout-control input {
  min-height: 30px;
  height: 30px;
  font-size: 12px;
}

.restart-button,
.mission-panel > .ghost-button {
  min-height: 40px;
  margin-top: 0;
  font-size: 13px;
}

.hand-bar {
  display: flex;
  gap: 9px;
  padding: 9px 8px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
}

.general-card {
  flex: 0 0 184px;
  height: 121px;
  grid-template-columns: 54px 1fr;
  gap: 8px;
  padding: 8px;
  scroll-snap-align: start;
}

.portrait span {
  width: 36px;
  height: 36px;
  font-size: 20px;
}

.card-copy strong {
  font-size: 17px;
}

.card-copy small {
  margin-top: 3px;
  font-size: 11px;
}

.card-stats {
  gap: 4px;
  margin-top: 7px;
}

.card-stats span {
  padding: 2px 5px;
  font-size: 10px;
}

.world-panel {
  height: auto;
  min-height: 500px;
  margin: 8px;
}

.strategy-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 8px 8px;
}

.strategy-panel .panel-block:first-child,
.strategy-panel .panel-block:last-child {
  grid-column: 1 / -1;
}

.city-node {
  width: 72px;
  min-height: 56px;
  padding: 6px;
}

.city-node strong {
  font-size: 14px;
}

.city-node span {
  font-size: 10px;
}

.unit {
  width: 32px;
  height: 39px;
  scale: 0.6;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #28130e;
  font-size: 11px;
}

.unit.general {
  width: 46px;
  height: 54px;
  border: 0;
  background: transparent;
  font-size: 15px;
}

.unit-body {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 235, 172, 0.48);
  border-radius: 44% 44% 34% 34%;
  background:
    linear-gradient(180deg, rgba(255, 241, 185, 0.92), rgba(173, 86, 45, 0.96)),
    #a14c30;
  box-shadow: inset 0 -10px 14px rgba(49, 17, 10, 0.24), 0 7px 13px rgba(0, 0, 0, 0.28);
}

.unit.enemy .unit-body {
  border-color: rgba(252, 165, 132, 0.56);
  background: linear-gradient(180deg, #db7658, #72271e);
  color: #ffe9ce;
}

.unit.general .unit-body {
  border: 2px solid #ffd77b;
  background: linear-gradient(180deg, #ffe0a1, #a43321);
}

.helmet {
  position: absolute;
  top: 4px;
  width: 58%;
  height: 20%;
  border-radius: 999px 999px 25% 25%;
  background: rgba(45, 22, 13, 0.38);
}

.unit b {
  position: relative;
  z-index: 1;
  font-weight: 900;
}

.elite-badge {
  position: absolute;
  left: 50%;
  top: -16px;
  z-index: 3;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  translate: -50% 0;
  border: 1px solid rgba(59, 27, 8, 0.88);
  border-radius: 4px;
  background: linear-gradient(135deg, #fff0a3, #d99632);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow: 0 0 9px rgba(255, 217, 110, 0.78);
  color: #3a1a08;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  text-indent: 0;
}

.weapon {
  position: absolute;
  right: -7px;
  top: 11px;
  width: 15px;
  height: 3px;
  border-radius: 999px;
  background: #f3dfae;
  rotate: -24deg;
  box-shadow: 0 0 0 1px rgba(35, 17, 10, 0.18);
}

.kind-spear .unit-body {
  background: linear-gradient(180deg, #e2ead6, #557e65);
  color: #10231a;
}

.kind-spear .weapon {
  width: 24px;
  right: -13px;
}

.kind-spear .weapon::after {
  content: "";
  position: absolute;
  right: -5px;
  top: -3px;
  border-left: 7px solid #f8efd0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.kind-archer .unit-body {
  border-color: rgba(185, 225, 172, 0.62);
  background: linear-gradient(180deg, #d8e8bd, #587a3c);
  color: #13200e;
}

.kind-archer .weapon {
  right: -9px;
  top: 9px;
  width: 17px;
  height: 20px;
  border: 2px solid #f3dfae;
  border-left: 0;
  border-radius: 0 999px 999px 0;
  background: transparent;
  rotate: 0deg;
}

.kind-crossbow .unit-body {
  border-color: rgba(255, 222, 139, 0.62);
  background: linear-gradient(180deg, #f0d28a, #7a5228);
  color: #241407;
}

.kind-crossbow .weapon {
  width: 18px;
  height: 12px;
  right: -10px;
  top: 12px;
  border-top: 3px solid #f3dfae;
  border-bottom: 3px solid #f3dfae;
  background: transparent;
  rotate: 0deg;
}

.kind-cavalry {
  width: 38px;
}

.kind-cavalry .unit-body {
  background: linear-gradient(180deg, #ead18b, #7a3d23);
  color: #241105;
}

.kind-cavalry .unit-body::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: 8px;
  border-radius: 0 0 999px 999px;
  background: rgba(43, 19, 10, 0.34);
}

.kind-sword .unit-body {
  background: linear-gradient(180deg, #efc089, #8f4d32);
}

.effect {
  position: absolute;
  z-index: 8;
  translate: -50% -50%;
  pointer-events: none;
  opacity: var(--life);
}

.effect.arrow,
.effect.bolt {
  width: 38px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 233, 168, 0.35) 18%, #ffe9a8 54%, #fff9db);
  box-shadow: 0 0 8px rgba(255, 225, 135, 0.65);
  transform-origin: center;
}

.effect.bolt {
  width: 32px;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 189, 113, 0.38) 16%, #ffbd71 52%, #fff0a3);
}

.effect.arrow::after,
.effect.bolt::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  translate: 0 -50%;
  border-left: 7px solid #fff4c3;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.effect.enemy.arrow,
.effect.enemy.bolt {
  background: linear-gradient(90deg, transparent, #ff9875 22%, #ffe0c9);
  box-shadow: 0 0 8px rgba(255, 116, 84, 0.65);
}

.effect.slash {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(255, 239, 181, 0.95);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  filter: drop-shadow(0 0 7px rgba(255, 225, 127, 0.5));
}

.effect.enemy.slash {
  border-top-color: rgba(255, 160, 132, 0.95);
  border-right-color: rgba(255, 160, 132, 0.95);
}

.effect.impact {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 246, 200, 0.95) 0 16%, rgba(245, 151, 71, 0.72) 17% 42%, transparent 44%),
    conic-gradient(from 20deg, transparent 0 12%, rgba(255, 215, 127, 0.95) 13% 18%, transparent 19% 36%, rgba(255, 215, 127, 0.95) 37% 43%, transparent 44% 100%);
}

.top-hud {
  grid-template-columns: minmax(0, 1fr) minmax(92px, 0.82fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 7px;
  padding: 8px;
  background:
    linear-gradient(180deg, rgba(28, 19, 13, 0.98), rgba(13, 12, 10, 0.98)),
    #15100d;
}

.battle-fort,
.battle-round {
  min-width: 0;
  min-height: 58px;
  border: 1px solid rgba(229, 187, 104, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(55, 36, 19, 0.76), rgba(15, 12, 10, 0.82)),
    rgba(16, 12, 10, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 239, 179, 0.08);
}

.battle-fort {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 7px;
  padding: 6px;
}

.battle-fort.enemy-fort {
  grid-template-columns: 1fr 38px;
}

.battle-fort.enemy-fort .seal {
  grid-column: 2;
  grid-row: 1;
}

.battle-fort.enemy-fort > div {
  grid-column: 1;
  grid-row: 1;
  text-align: right;
}

.battle-fort .seal {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
}

.battle-fort span,
.battle-round span {
  display: block;
  color: rgba(255, 226, 164, 0.74);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

.battle-fort strong {
  display: block;
  margin: 4px 0;
  color: #ffe9b4;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
}

.battle-round {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 6px 8px;
  text-align: center;
}

.battle-round strong {
  color: #ffe7aa;
  font-size: 13px;
  line-height: 1.15;
}

.fortress-bar.blue i {
  background: linear-gradient(90deg, #438ed2, #9bd0ff);
}

.fortress-bar.red i {
  background: linear-gradient(90deg, #903224, #e1654c);
}

.unit.attacking .unit-body {
  translate: 0 -2px;
  filter: brightness(1.16);
}

.unit.hit .unit-body,
.barracks.hit {
  filter: brightness(1.45) saturate(1.2);
}

.unit.stunned .unit-body {
  filter: grayscale(0.35) brightness(1.2);
}

.unit.stunned::after {
  content: "晕";
  position: absolute;
  left: 50%;
  top: -14px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 226, 136, 0.72);
  border-radius: 50%;
  background: rgba(50, 22, 8, 0.78);
  color: #ffe08a;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 0 10px rgba(255, 197, 87, 0.42);
}

.unit.burning .unit-body {
  filter: brightness(1.25) saturate(1.35) drop-shadow(0 0 5px rgba(255, 113, 45, 0.72));
}

.unit.burning::before {
  content: "燃";
  position: absolute;
  left: 50%;
  top: -30px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(131, 38, 14, 0.84);
  color: #ffd98a;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 0 10px rgba(255, 93, 36, 0.6);
}

.unit.poisoned .unit-body {
  filter: brightness(1.14) saturate(1.25) drop-shadow(0 0 5px rgba(98, 214, 93, 0.62));
}

.unit.poisoned::after {
  content: "毒";
  position: absolute;
  right: -7px;
  top: -13px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(29, 91, 34, 0.84);
  color: #bfffb0;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 0 10px rgba(98, 214, 93, 0.48);
}

.unit.slowed .unit-body {
  filter: brightness(0.86) saturate(0.82) drop-shadow(0 0 5px rgba(99, 174, 255, 0.42));
}

.unit.slowed::before {
  content: "缓";
  position: absolute;
  left: -7px;
  top: -13px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(25, 72, 115, 0.84);
  color: #cae7ff;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 0 10px rgba(99, 174, 255, 0.48);
}

.unit.muniu-liuma .unit-body {
  border-color: #ffe08a;
  background: linear-gradient(180deg, #d8aa5c, #6a3d1b);
  color: #fff3c7;
  filter: drop-shadow(0 0 7px rgba(255, 200, 89, 0.45));
}

.effect.damage {
  color: #ff7057;
  font-size: 13px;
  font-weight: 900;
  text-shadow: 0 2px 4px rgba(26, 7, 4, 0.88), 0 0 9px rgba(255, 185, 104, 0.45);
}

.effect.damage.enemy {
  color: #7fc8ff;
}

.effect.heal {
  color: #86f0a0;
  font-size: 13px;
  font-weight: 900;
  text-shadow: 0 2px 4px rgba(5, 26, 10, 0.88), 0 0 9px rgba(134, 240, 160, 0.45);
}

.effect.skill {
  min-width: 96px;
  padding: 3px 8px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 220, 133, 0.72);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(73, 31, 10, 0.86), rgba(28, 14, 7, 0.76));
  color: #ffe08a;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 0 14px rgba(255, 190, 85, 0.38);
  text-shadow: 0 2px 4px rgba(26, 7, 4, 0.92);
}

.hand-bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(62px, 1fr);
  grid-template-columns: repeat(5, minmax(62px, 1fr));
  gap: 6px;
  padding: 8px 8px 10px;
}

.general-card {
  flex: initial;
  min-width: 62px;
  height: 124px;
  grid-template-columns: 1fr;
  grid-template-rows: 55px 1fr;
  gap: 5px;
  padding: 6px;
  text-align: center;
}

.general-card:hover,
.general-card.selected {
  transform: translateY(-2px);
}

.portrait {
  height: 55px;
}

.portrait span {
  width: 34px;
  height: 34px;
  font-size: 19px;
}

.card-copy strong {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-copy small {
  display: none;
}

.card-stats {
  justify-content: center;
  gap: 3px;
  margin-top: 5px;
}

.card-stats span {
  padding: 2px 4px;
  font-size: 9px;
}

.card-stats span:nth-child(n + 3) {
  display: none;
}

@media (min-width: 760px) {
  .game-shell {
    padding: 18px 0;
  }

  .battle-card,
  .map-card {
    border-radius: 10px;
    height: min(920px, calc(100dvh - 36px));
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Battle fit pass: keep the whole phone game operable in one viewport. */
.battle-card {
  height: 100dvh;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) 132px;
  overflow: hidden;
}

.battle-card .top-hud {
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: auto;
  gap: 6px;
  padding: 6px;
}

.battle-card .battle-round {
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: 34px;
  order: 3;
}

.battle-card .battle-fort {
  min-height: 50px;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 6px;
  padding: 5px 6px;
}

.battle-card .battle-fort.enemy-fort {
  grid-template-columns: minmax(0, 1fr) 30px;
}

.battle-card .battle-fort .seal {
  width: 28px;
  height: 28px;
  font-size: 15px;
}

.battle-card .battle-fort span,
.battle-card .battle-round span {
  font-size: 10px;
}

.battle-card .battle-fort strong {
  margin: 3px 0;
  font-size: 13px;
}

.battle-card .battle-round strong {
  font-size: 12px;
}

.battle-card .wave-track,
.battle-card .fortress-bar {
  height: 6px;
}

.battle-card .play-layout {
  position: relative;
  display: block;
  min-height: 0;
  overflow: hidden;
}

.battle-card .battlefield-wrap {
  position: absolute;
  inset: 0;
  padding: 7px;
}

.battle-card .battlefield {
  width: 100%;
  height: 100%;
}

.battle-card .mission-panel {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 7px;
  z-index: 14;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0;
  pointer-events: none;
}

.battle-card .deployment-hint {
  pointer-events: none;
}

.battle-card .mission-panel > * {
  pointer-events: auto;
}

.battle-card .mission-panel .panel-block:first-child,
.battle-card .mission-panel .panel-block.compact:nth-of-type(2) {
  display: none;
}

.battle-card .mission-panel .panel-block.compact {
  min-height: 44px;
  padding: 7px 8px;
  background: rgba(24, 13, 8, 0.76);
  backdrop-filter: blur(6px);
}

.battle-card .mission-panel .panel-block.compact strong {
  font-size: 11px;
}

.battle-card .mission-panel .panel-block.compact:nth-of-type(4) {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 8px;
}

.battle-card .mission-panel .panel-block.compact:nth-of-type(4) > span {
  display: none;
}

.battle-card .mission-panel .panel-block.compact:nth-of-type(4) > strong {
  margin: 0;
  white-space: nowrap;
}

.battle-card .mission-panel .loadout-control {
  margin: 0;
  grid-template-columns: 42px 1fr 42px;
}

.battle-card .mission-panel .restart-button,
.battle-card .mission-panel > .ghost-button {
  min-height: 36px;
  font-size: 12px;
  background: rgba(22, 12, 8, 0.82);
  backdrop-filter: blur(6px);
}

.battle-card .mission-panel .restart-button {
  background: linear-gradient(180deg, rgba(186, 54, 38, 0.92), rgba(107, 28, 20, 0.92));
}

.battle-card .mission-panel .battle-corner-actions {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.battle-card .hand-bar {
  display: flex;
  gap: 5px;
  padding: 7px 6px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.battle-card .general-card {
  flex: 0 0 86px;
  height: 116px;
  grid-template-columns: 1fr;
  grid-template-rows: 50px 1fr;
  gap: 4px;
  padding: 5px;
  scroll-snap-align: start;
}

.battle-card .portrait {
  height: 50px;
}

.battle-card .portrait span {
  width: 30px;
  height: 30px;
  font-size: 17px;
}

.battle-card .card-copy strong {
  font-size: 13px;
}

.battle-card .card-stats span {
  font-size: 9px;
  padding: 2px 3px;
}

.battle-card .card-stats span:nth-child(n + 3) {
  display: none;
}

.battle-card .fortress {
  top: 8px;
  width: min(220px, 70%);
  padding: 6px 10px;
}

.battle-card .deploy-zone {
  bottom: 92px;
  height: 23%;
}

.battle-card .deployment-hint {
  bottom: 170px;
  padding: 7px 10px;
}

/* Game HUD pass: icon controls, long-press help, and more battlefield space. */
body:has(.battle-card:not(.hidden)) {
  overflow: hidden;
}

.battle-card {
  grid-template-rows: 88px minmax(0, 1fr) 98px;
}

.battle-card .top-hud {
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px 6px;
}

.battle-card .battle-round {
  min-height: 28px;
  padding: 3px 8px;
  gap: 2px;
}

.battle-card .battle-fort {
  min-height: 48px;
}

.battle-card .battle-fort strong {
  font-size: 12px;
}

.battle-card .battle-round strong {
  font-size: 12px;
}

.battle-card .battle-round span {
  display: block;
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.battle-card .battlefield-wrap {
  padding: 5px 6px;
}

.battle-card .fortress {
  top: 7px;
  width: min(210px, 66%);
  padding: 5px 9px;
}

.battle-card .fortress span {
  margin-bottom: 4px;
  font-size: 12px;
}

.battle-card .mission-panel {
  inset: 0;
  display: block;
  pointer-events: none;
}

.battle-card .mission-panel > * {
  pointer-events: auto;
}

.battle-card .mission-panel .panel-block,
.battle-card .mission-panel .battle-corner-actions {
  position: absolute;
}

.battle-card .mission-panel .panel-block:first-child,
.battle-card .mission-panel .panel-block.compact:nth-of-type(2) {
  display: none;
}

.battle-card .mission-panel .panel-block.compact:nth-of-type(3) {
  left: 8px;
  bottom: 8px;
  width: 150px;
  min-height: 38px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(24, 13, 8, 0.58);
}

.battle-card .mission-panel .panel-block.compact:nth-of-type(3) span {
  display: none;
}

.battle-card .mission-panel .panel-block.compact:nth-of-type(3) strong {
  margin: 0;
  font-size: 11px;
  line-height: 1.28;
}

.battle-card .mission-panel .panel-block.compact:nth-of-type(4) {
  left: 50%;
  bottom: 8px;
  width: 136px;
  min-height: 40px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(24, 13, 8, 0.62);
}

.battle-card .mission-panel .panel-block.compact:nth-of-type(4)::before {
  content: "兵";
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #d7a557, #7d3b22);
  color: #ffe9b7;
  font-weight: 900;
}

.battle-card .mission-panel .panel-block.compact:nth-of-type(4) > span {
  display: none;
}

.battle-card .mission-panel .panel-block.compact:nth-of-type(4) > strong {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  margin: 0;
  color: #fff0c9;
  font-size: 13px;
}

.battle-card .mission-panel .loadout-control {
  grid-column: 2;
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  gap: 3px;
  margin: 0;
}

.battle-card .mission-panel .loadout-control input {
  opacity: 0;
  pointer-events: none;
}

.battle-card .mission-panel .loadout-control .ghost-button {
  width: 30px;
  min-height: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
}

.battle-card .mission-panel .icon-control {
  right: 8px;
  width: 42px;
  min-height: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.battle-card .mission-panel .restart-button {
  bottom: 58px;
}

.battle-card .mission-panel > .ghost-button {
  bottom: 8px;
}

.battle-card .hand-bar {
  display: flex;
  gap: 4px;
  padding: 5px 5px 7px;
  overflow-x: auto;
  overflow-y: hidden;
}

.battle-card .general-card {
  flex: 0 0 84px;
  height: 86px;
  grid-template-rows: 42px 1fr;
  gap: 3px;
  padding: 4px;
  border-radius: 7px;
}

.battle-card .portrait {
  height: 42px;
}

.battle-card .portrait span {
  width: 28px;
  height: 28px;
  font-size: 16px;
}

.battle-card .card-copy strong {
  font-size: 12px;
}

.battle-card .card-title small {
  font-size: 9px;
}

.battle-card .card-xp {
  gap: 2px;
  margin-top: 2px;
}

.battle-card .card-xp span {
  font-size: 8px;
}

.battle-card .card-xp i {
  height: 4px;
}

.battle-card .card-stats {
  margin-top: 3px;
}

.battle-card .card-stats span {
  font-size: 8px;
  padding: 1px 3px;
}

.battle-card .deploy-zone {
  bottom: 58px;
  height: 25%;
}

.battle-card .battle-start-button {
  left: auto;
  right: 10px;
  top: 37%;
  width: 92px;
  min-height: 42px;
  transform: none;
  border-radius: 8px;
  font-size: 16px;
}

.battle-card .barrack-action {
  left: 10px;
  right: 70px;
  bottom: 72px;
  width: auto;
  max-height: 112px;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  transform: none;
  padding: 9px 44px 9px 10px;
  overflow: auto;
}

.battle-card .barrack-action-close {
  right: 6px;
  top: 6px;
  z-index: 2;
  width: 38px;
  height: 38px;
  font-size: 18px;
  line-height: 34px;
  background: rgba(38, 17, 10, 0.98);
  box-shadow: inset 0 0 0 1px rgba(255, 224, 153, 0.22), 0 8px 18px rgba(12, 6, 3, 0.34);
}

.battle-card .barrack-action strong {
  font-size: 12px;
}

.battle-card .barrack-action span {
  display: inline;
  margin-right: 8px;
  font-size: 10px;
}

.battle-card .barrack-action .sortie-button {
  width: 64px;
  height: 64px;
}

.battle-card .barrack-action .barrack-dismantle-button {
  width: min(118px, 100%);
  min-height: 36px;
  justify-self: start;
}

.battle-card .barrack-action .sortie-button b {
  font-size: 13px;
}

.battle-card .barrack-action .sortie-icon {
  width: 28px;
  height: 28px;
}

.battle-card .mission-panel .battle-corner-actions {
  right: 8px;
  bottom: 8px;
  z-index: 4;
  display: grid;
  gap: 8px;
  width: 48px;
  pointer-events: auto;
}

.battle-card .mission-panel .battle-corner-actions .icon-control {
  width: 48px;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 224, 153, 0.22), 0 8px 18px rgba(12, 6, 3, 0.34);
}

.battle-card .mission-panel .battle-corner-actions #restartButton {
  background: linear-gradient(180deg, rgba(195, 67, 45, 0.96), rgba(124, 32, 22, 0.96));
}

.battle-card .mission-panel .battle-corner-actions #returnMapButton {
  background: rgba(24, 13, 8, 0.92);
}

.battle-card .general-detail {
  left: 10px;
  top: 84px;
  width: min(280px, 58%);
  padding: 8px;
}

.battle-card .general-detail-head {
  grid-template-columns: 32px 1fr;
  gap: 6px;
}

.battle-card .general-detail-head > span {
  width: 32px;
  height: 38px;
  font-size: 15px;
}

.battle-card .general-detail strong {
  font-size: 12px;
}

.battle-card .general-detail small,
.battle-card .general-detail-bars label,
.battle-card .general-detail-stats span,
.battle-card .general-detail p {
  font-size: 9px;
}

.battle-card .deployment-hint {
  bottom: 118px;
  max-width: 70%;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(26, 14, 9, 0.58);
  font-size: 11px;
}

.touch-tip {
  position: fixed;
  z-index: 200;
  transform: translate(-50%, -100%);
  max-width: min(260px, calc(100vw - 28px));
  padding: 8px 10px;
  border: 1px solid rgba(255, 221, 143, 0.42);
  border-radius: 8px;
  background: rgba(18, 11, 8, 0.92);
  color: #fff0cf;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.touch-tip.hidden {
  display: none;
}

/* World map fit pass: keep start/save controls inside the phone viewport. */
.map-card {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.map-card .map-hud {
  grid-template-columns: 1fr repeat(3, 72px);
  gap: 6px;
  padding: 6px;
}

.map-card .brand {
  gap: 8px;
}

.map-card .brand strong {
  font-size: 18px;
}

.map-card .brand span:last-child {
  font-size: 10px;
  line-height: 1.25;
}

.map-card .kingdom-pill {
  min-width: 0;
  min-height: 42px;
  padding: 5px 6px;
}

.map-card .lord-pill {
  min-width: 118px;
  min-height: 56px;
  padding: 6px 7px;
}

.map-card .kingdom-pill span {
  font-size: 10px;
}

.map-card .kingdom-pill strong {
  font-size: 14px;
  white-space: nowrap;
}

.map-card .map-layout {
  position: relative;
  display: block;
  min-height: 0;
  overflow: hidden;
}

.map-card .world-panel {
  position: absolute;
  inset: 6px 6px 76px;
  height: auto;
  min-height: 0;
  margin: 0;
}

.map-card .strategy-panel {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  z-index: 10;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 84px;
  gap: 6px;
  min-height: 64px;
  padding: 0;
}

.map-card .strategy-panel .panel-block:nth-child(-n + 4) {
  display: none;
}

.map-card .strategy-panel .panel-block:nth-child(5) {
  min-height: 64px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(24, 13, 8, 0.72);
  backdrop-filter: blur(6px);
}

.map-card .strategy-panel .panel-block:nth-child(5) > span,
.map-card .strategy-panel .panel-block:nth-child(5) > strong {
  display: none;
}

.map-card .save-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin: 0;
  height: 100%;
}

.map-card .save-actions .ghost-button {
  min-height: 52px;
  padding: 0 7px;
  border-radius: 8px;
  font-size: 14px;
}

.map-card .map-troop-control {
  min-height: 64px;
  display: grid;
  grid-template-columns: 30px 28px 1fr 28px;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(244, 198, 111, 0.24);
  border-radius: 8px;
  background: rgba(24, 13, 8, 0.72);
  backdrop-filter: blur(6px);
}

.map-card .map-troop-control span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #d7a557, #7d3b22);
  color: #ffe9b7;
  font-size: 14px;
  font-weight: 900;
}

.map-card .map-troop-control strong {
  color: #fff0c9;
  font-size: 16px;
  text-align: center;
}

.map-card .map-troop-control .ghost-button {
  width: 28px;
  min-height: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
}

.map-card #mapPrimaryButton {
  min-height: 64px;
  margin: 0;
  border-radius: 8px;
  font-size: 18px;
}

.map-card #mapPrimaryButton.primary-action {
  grid-template-columns: auto auto;
  justify-content: center;
  padding: 0 11px;
}

.map-card #mapPrimaryButton .button-symbol {
  width: 30px;
  height: 30px;
  border-color: rgba(255, 231, 154, 0.42);
  background:
    radial-gradient(circle at 40% 28%, rgba(255, 237, 177, 0.38), transparent 37%),
    linear-gradient(180deg, rgba(178, 78, 47, 0.96), rgba(124, 40, 29, 0.98));
  font-size: 18px;
}

.map-card #mapPrimaryButton .button-label {
  font-size: 18px;
}

.map-card #mapPrimaryButton:disabled {
  opacity: 0.45;
  filter: grayscale(0.35);
  cursor: not-allowed;
}

.map-card .city-node {
  width: 68px;
  min-height: 56px;
}

.map-card .city-node strong {
  font-size: 14px;
}

.map-card .city-node span {
  font-size: 10px;
}

.map-card .map-troop-control,
.battle-card .mission-panel .panel-block.compact:nth-of-type(4) {
  display: none;
}

.map-card .strategy-panel {
  grid-template-columns: minmax(0, 1fr) 84px;
}

.map-card .world-panel {
  inset: 6px 6px 178px;
}

.troop-allocator {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 76px;
  z-index: 11;
  height: 96px;
  display: grid;
  grid-template-rows: 24px 1fr;
  gap: 5px;
  padding: 6px;
  border: 1px solid rgba(244, 198, 111, 0.24);
  border-radius: 8px;
  background: rgba(24, 13, 8, 0.78);
  backdrop-filter: blur(7px);
}

.troop-allocator.hidden {
  display: none;
}

.allocator-head {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: rgba(255, 226, 164, 0.78);
  font-size: 11px;
  font-weight: 800;
}

.allocator-head strong {
  color: #fff0c9;
  font-size: 12px;
}

.allocator-head em {
  min-width: 0;
  overflow: hidden;
  color: #ffd76f;
  font-style: normal;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recruit-button {
  min-height: 22px;
  padding: 0 8px;
  border-color: rgba(255, 205, 106, 0.42);
  color: #ffe8b3;
  font-size: 11px;
}

.allocator-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 86px;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
}

.allocator-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: 32px 28px;
  gap: 3px 5px;
  align-items: center;
  padding: 4px;
  border: 1px solid rgba(255, 218, 144, 0.2);
  border-radius: 7px;
  background: rgba(255, 231, 174, 0.08);
}

.allocator-item span {
  grid-row: 1 / 3;
  width: 28px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 224, 153, 0.9), transparent 29%),
    linear-gradient(180deg, var(--portrait-a), var(--portrait-b));
  color: #fff0ca;
  font-size: 16px;
  font-weight: 900;
}

.allocator-item b {
  min-width: 0;
  overflow: hidden;
  color: #ffe9bd;
  font-size: 12px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.allocator-item b small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 232, 184, 0.68);
  font-size: 10px;
  font-weight: 800;
}

.allocator-xp {
  display: block;
  height: 4px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(35, 18, 9, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 222, 148, 0.14);
}

.allocator-xp em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d28a22, #ffe070);
}

.allocator-item input {
  width: 100%;
  min-width: 0;
  height: 28px;
  border: 1px solid rgba(255, 222, 148, 0.28);
  border-radius: 6px;
  background: rgba(10, 8, 7, 0.52);
  color: #ffe9bd;
  font-size: 12px;
  text-align: center;
  outline: none;
}

.allocator-item input:focus {
  border-color: rgba(255, 216, 118, 0.86);
}

/* World map redesign v2: real game screen, no overlapping panels. */
.map-card {
  width: min(430px, 100vw);
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  overflow: hidden;
}

.map-card .map-hud {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px 62px 60px;
  gap: 5px;
  align-items: stretch;
  padding: 5px 6px;
}

.map-card .brand {
  grid-column: 1 / 2;
}

.map-card .treasury-pill {
  grid-column: 2 / 3;
}

.map-card .lord-pill {
  grid-column: 3 / 4;
}

.map-card .save-pill {
  grid-column: 4 / 5;
}

.map-card .brand {
  min-width: 0;
  gap: 7px;
}

.map-card .seal {
  width: 34px;
  height: 34px;
  font-size: 18px;
}

.map-card .brand strong {
  font-size: 17px;
  line-height: 1.05;
  white-space: nowrap;
}

.map-card .guide-button {
  width: 23px;
  height: 23px;
  font-size: 14px;
}

.map-card .brand span:last-child {
  max-width: 142px;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-card .kingdom-pill {
  min-width: 0;
  min-height: 0;
  padding: 5px 4px;
  border-radius: 7px;
}

.map-card .lord-pill {
  min-width: 0;
  min-height: 0;
  padding: 4px;
}

.map-card .kingdom-pill span {
  font-size: 9px;
}

.map-card .kingdom-pill strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-card .kingdom-pill small {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 238, 193, 0.8);
  font-size: 8px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-card .lord-pill small {
  display: block;
  overflow: hidden;
  color: rgba(255, 238, 193, 0.88);
  font-size: 7px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lord-xp-track {
  display: block;
  height: 3px;
  overflow: hidden;
  margin-top: 1px;
  border-radius: 999px;
  background: rgba(255, 226, 158, 0.16);
}

.lord-xp-track em {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f0b94f, #ffe6a3);
  box-shadow: 0 0 8px rgba(255, 210, 105, 0.55);
  transition: width 180ms ease;
}

.map-card .map-layout {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 154px 56px;
  gap: 6px;
  min-height: 0;
  padding: 6px;
  overflow: hidden;
}

.map-card .world-panel {
  position: relative;
  inset: auto;
  height: auto;
  min-height: 0;
  margin: 0;
  border-radius: 8px;
}

.map-card .troop-allocator {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 2;
  height: auto;
  min-height: 0;
  margin: 0;
  grid-template-rows: 36px minmax(0, 1fr);
  padding: 7px;
  overflow: hidden;
}

.map-card .allocator-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  font-size: 10px;
}

.map-card .allocator-head em {
  grid-column: 1 / 3;
  grid-row: 2;
  text-align: left;
}

.map-card .allocator-head .recruit-button {
  grid-column: 3;
  grid-row: 1 / 3;
}

.map-card .allocator-head strong {
  font-size: 11px;
}

.map-card .recruit-button {
  min-height: 20px;
  padding: 0 7px;
  font-size: 10px;
}

.map-card .allocator-list {
  grid-auto-columns: 128px;
  gap: 7px;
  padding-bottom: 2px;
}

.admin-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px;
  color: #ffe9bd;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(244, 198, 111, 0.24);
  border-radius: 8px;
  background: rgba(24, 13, 8, 0.82);
}

.admin-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.admin-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px;
  border: 1px solid rgba(244, 198, 111, 0.24);
  border-radius: 8px;
  background: rgba(24, 13, 8, 0.82);
}

.admin-panel label {
  display: grid;
  gap: 6px;
  color: rgba(255, 226, 164, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.admin-panel input,
.admin-panel select,
.admin-panel textarea {
  min-width: 0;
  border: 1px solid rgba(255, 222, 148, 0.28);
  border-radius: 7px;
  background: rgba(10, 8, 7, 0.52);
  color: #ffe9bd;
  outline: none;
}

.admin-panel input,
.admin-panel select {
  height: 36px;
  padding: 0 10px;
}

.admin-panel textarea {
  width: 100%;
  min-height: 78px;
  padding: 9px 10px;
  resize: vertical;
}

.admin-wide-field {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-section-head.compact {
  margin-top: 4px;
}

.admin-section-head span {
  display: block;
  color: rgba(255, 226, 164, 0.65);
  font-size: 12px;
  font-weight: 800;
}

.admin-section-head strong {
  display: block;
  margin-top: 3px;
  color: #fff0c9;
  font-size: 18px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-inline-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.admin-inline-actions button {
  flex: 1;
  min-height: 36px;
}

.skill-range-preview {
  display: grid;
  grid-column: span 2;
  grid-template-columns: minmax(210px, 300px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 218, 144, 0.18);
  border-radius: 8px;
  background: rgba(255, 231, 174, 0.055);
}

.skill-range-preview-head {
  display: grid;
  gap: 4px;
}

.skill-range-preview-head span {
  color: rgba(255, 226, 164, 0.65);
  font-size: 12px;
  font-weight: 900;
}

.skill-range-preview-head strong {
  color: #fff0c9;
  font-size: 16px;
}

.skill-range-preview p {
  margin: 0;
  color: rgba(255, 231, 188, 0.72);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

#skillRangePreview {
  width: 100%;
  aspect-ratio: 1;
  min-height: 210px;
  overflow: hidden;
  border: 1px solid rgba(255, 224, 153, 0.26);
  border-radius: 8px;
  background: #14150f;
  box-shadow: inset 0 0 0 1px rgba(255, 241, 186, 0.06);
}

#skillPreviewGrid path {
  fill: none;
  stroke: rgba(255, 232, 170, 0.08);
  stroke-width: 0.5;
}

.skill-preview-bg {
  fill: #15180f;
}

.skill-preview-grid {
  fill: url("#skillPreviewGrid");
}

.skill-preview-midline {
  stroke: rgba(255, 235, 176, 0.22);
  stroke-dasharray: 2 3;
  stroke-width: 0.7;
}

.skill-preview-area {
  fill: rgba(255, 190, 72, 0.32);
  stroke: rgba(255, 226, 136, 0.88);
  stroke-width: 1.2;
}

.skill-preview-explosion {
  fill: rgba(198, 58, 44, 0.22);
  stroke: rgba(255, 112, 90, 0.78);
  stroke-dasharray: 2 2;
  stroke-width: 1;
}

.skill-preview-target {
  fill: #ffe7a3;
  stroke: rgba(61, 18, 12, 0.75);
  stroke-width: 0.7;
}

.skill-preview-units circle {
  fill: rgba(180, 57, 42, 0.88);
  stroke: rgba(255, 223, 162, 0.86);
  stroke-width: 0.7;
}

.skill-preview-hero path {
  fill: rgba(108, 176, 116, 0.82);
  stroke: rgba(235, 255, 207, 0.7);
  stroke-width: 0.7;
}

.skill-preview-hero circle {
  fill: #f4d078;
  stroke: rgba(46, 30, 15, 0.82);
  stroke-width: 0.8;
}

.admin-city-select {
  display: none !important;
}

.admin-city-map-wrap {
  position: relative;
  min-height: 560px;
  overflow: auto;
  --admin-map-width: 1320px;
  --admin-map-height: 1980px;
  border: 1px solid rgba(255, 224, 153, 0.25);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(76, 83, 48, 0.3), transparent 42%),
    linear-gradient(225deg, rgba(98, 59, 34, 0.24), transparent 50%),
    #161a12;
}

.admin-city-map-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(32deg, transparent 48%, rgba(255, 232, 157, 0.05) 49%, transparent 51%) 0 0 / 96px 96px,
    radial-gradient(circle at 32% 38%, rgba(255, 220, 126, 0.12), transparent 28%),
    radial-gradient(circle at 72% 76%, rgba(255, 142, 77, 0.1), transparent 30%);
  pointer-events: none;
}

.admin-route-layer {
  position: relative;
  z-index: 1;
  display: block;
  width: var(--admin-map-width);
  height: var(--admin-map-height);
  pointer-events: none;
}

.admin-route-line {
  stroke: rgba(224, 190, 112, 0.18);
  stroke-width: 0.32;
}

.admin-city-map {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: var(--admin-map-width);
  height: var(--admin-map-height);
}

.admin-city-node {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 82px;
  min-height: 52px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 224, 153, 0.28);
  border-radius: 8px;
  background: rgba(26, 17, 12, 0.78);
  color: rgba(255, 232, 190, 0.76);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.admin-city-node.selected {
  border-color: rgba(255, 220, 112, 0.96);
  color: #fff0c9;
  background: linear-gradient(180deg, rgba(112, 45, 28, 0.92), rgba(48, 22, 14, 0.92));
  box-shadow: 0 0 0 3px rgba(255, 193, 72, 0.18), 0 10px 24px rgba(0, 0, 0, 0.34);
}

.admin-city-node strong,
.admin-city-node span {
  display: block;
}

.admin-city-node strong {
  font-size: 15px;
  line-height: 1.15;
}

.admin-city-node span {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 800;
}

.barrack-rows {
  display: grid;
  gap: 8px;
}

.admin-formation-board {
  position: relative;
  height: clamp(360px, 54vw, 620px);
  overflow: hidden;
  border: 1px solid rgba(255, 224, 153, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(37, 21, 12, 0.16), rgba(18, 10, 7, 0.32)),
    url("assets/battlefield.png") center/cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 241, 186, 0.08);
  touch-action: none;
}

.admin-formation-board::after {
  content: "";
  position: absolute;
  inset: 52% 6% 8%;
  border: 1px dashed rgba(255, 224, 153, 0.2);
  border-radius: 6px;
  pointer-events: none;
}

.admin-board-fort {
  position: absolute;
  left: 50%;
  top: 14px;
  z-index: 1;
  transform: translateX(-50%);
  width: min(320px, 54%);
  padding: 12px 16px;
  border: 1px solid rgba(255, 224, 153, 0.35);
  border-radius: 8px;
  background: rgba(48, 29, 19, 0.86);
  color: #ffe9bd;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.admin-board-enemy-zone {
  position: absolute;
  left: 12px;
  top: 78px;
  z-index: 1;
  padding: 6px 9px;
  border: 1px solid rgba(255, 224, 153, 0.2);
  border-radius: 999px;
  background: rgba(16, 10, 7, 0.44);
  color: rgba(255, 236, 198, 0.76);
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.admin-board-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.admin-board-lines i {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 235, 176, 0.18), transparent);
}

.admin-board-lines i:nth-child(1) { left: 20%; }
.admin-board-lines i:nth-child(2) { left: 40%; }
.admin-board-lines i:nth-child(3) { left: 60%; }
.admin-board-lines i:nth-child(4) { left: 80%; }

.admin-formation-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.admin-board-barrack {
  position: absolute;
  display: grid;
  grid-template-columns: 34px auto;
  grid-template-rows: auto auto;
  gap: 1px 7px;
  align-items: center;
  transform: translate(-50%, -50%);
  min-width: 116px;
  min-height: 58px;
  padding: 8px 10px;
  border: 2px solid rgba(255, 224, 153, 0.44);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(98, 48, 28, 0.94), rgba(47, 22, 12, 0.94));
  color: #ffe9bd;
  cursor: grab;
  box-shadow: 0 10px 22px rgba(13, 7, 4, 0.34);
  touch-action: none;
}

.admin-board-barrack.selected {
  border-color: rgba(255, 232, 142, 0.94);
  box-shadow: 0 0 0 4px rgba(255, 202, 92, 0.22), 0 12px 28px rgba(13, 7, 4, 0.42);
}

.admin-board-barrack span {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 40px;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 30%, rgba(255, 219, 151, 0.55), rgba(132, 44, 30, 0.88));
  color: #fff5d7;
  font-size: 18px;
  font-weight: 900;
}

.admin-board-barrack strong {
  font-size: 14px;
  line-height: 1.1;
}

.admin-board-barrack small {
  color: rgba(255, 231, 188, 0.72);
  font-size: 11px;
  font-weight: 800;
}

.admin-board-barrack em {
  position: absolute;
  right: -8px;
  top: -8px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #b83a29;
  color: #fff0cf;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.barrack-row {
  display: grid;
  grid-template-columns: 1.2fr 96px repeat(3, 0.75fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(255, 218, 144, 0.16);
  border-radius: 7px;
  background: rgba(255, 231, 174, 0.06);
}

.barrack-kind-pill {
  display: grid;
  place-items: center;
  min-height: 36px;
  border: 1px solid rgba(255, 218, 144, 0.2);
  border-radius: 7px;
  background: rgba(255, 231, 174, 0.08);
  color: #ffe9bd;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.barrack-row.selected {
  border-color: rgba(255, 220, 128, 0.74);
  background: rgba(255, 204, 104, 0.12);
}

.admin-note {
  margin: 0;
  color: rgba(255, 231, 188, 0.72);
  font-size: 12px;
  line-height: 1.55;
}

.admin-soldier-panel {
  overflow-x: auto;
}

.admin-general-panel {
  margin-bottom: 14px;
}

.admin-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.invite-code-list {
  display: grid;
  gap: 8px;
}

.invite-code-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  border: 1px solid rgba(255, 218, 144, 0.18);
  border-radius: 7px;
  background: rgba(255, 231, 174, 0.055);
}

.invite-code-row strong {
  color: #fff0c4;
  font-size: 15px;
  letter-spacing: 0.08em;
}

.invite-code-row span {
  color: rgba(255, 231, 188, 0.7);
  font-size: 12px;
  text-align: right;
}

.invite-code-row.unused {
  border-color: rgba(116, 216, 154, 0.32);
  background: rgba(79, 155, 109, 0.08);
}

.invite-code-row.used {
  opacity: 0.68;
}

.soldier-help-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 8px;
  min-width: 1280px;
}

.soldier-help-grid div {
  min-height: 76px;
  padding: 10px;
  border: 1px solid rgba(255, 218, 144, 0.16);
  border-radius: 7px;
  background: rgba(255, 231, 174, 0.055);
}

.soldier-help-grid strong,
.soldier-help-grid span {
  display: block;
}

.soldier-help-grid strong {
  color: #fff0c9;
  font-size: 13px;
}

.soldier-help-grid span {
  margin-top: 5px;
  color: rgba(255, 231, 188, 0.72);
  font-size: 11px;
  line-height: 1.45;
}

.soldier-kind-head,
.soldier-kind-row {
  display: grid;
  grid-template-columns: 92px 92px 54px repeat(7, minmax(66px, 1fr)) 118px 66px 76px 76px minmax(260px, 1.6fr) 48px;
  gap: 8px;
  align-items: center;
  min-width: 1540px;
}

.soldier-kind-head {
  color: rgba(255, 226, 164, 0.68);
  font-size: 11px;
  font-weight: 900;
  padding: 0 8px;
}

.soldier-kind-rows {
  display: grid;
  gap: 8px;
}

.soldier-kind-row {
  padding: 8px;
  border: 1px solid rgba(255, 218, 144, 0.16);
  border-radius: 7px;
  background: rgba(255, 231, 174, 0.06);
}

.soldier-kind-row textarea {
  min-height: 52px;
  resize: vertical;
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .admin-grid,
  .admin-form-grid,
  .barrack-row {
    grid-template-columns: 1fr;
  }

  .skill-range-preview {
    grid-column: auto;
    grid-template-columns: 1fr;
  }
}

.map-card .allocator-item {
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 30px;
  gap: 5px 7px;
  padding: 6px;
  min-height: 96px;
}

.map-card .allocator-item span {
  width: 30px;
  height: 74px;
  font-size: 15px;
}

.map-card .allocator-item b {
  align-self: end;
  font-size: 12px;
  line-height: 1.15;
  white-space: normal;
}

.map-card .allocator-item b small {
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.15;
}

.map-card .allocator-item input {
  height: 30px;
  font-size: 12px;
}

.map-card .strategy-panel {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 6px;
  min-height: 0;
  padding: 0;
}

.map-card .strategy-panel .panel-block:nth-child(-n + 4),
.map-card .map-troop-control {
  display: none;
}

.map-card .strategy-panel .panel-block:nth-child(5) {
  min-height: 0;
  padding: 4px;
  border-radius: 8px;
}

.map-card .save-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  height: 100%;
  margin: 0;
}

.map-card .save-actions .ghost-button {
  min-height: 0;
  height: 48px;
  grid-template-columns: 24px minmax(0, 1fr);
  justify-content: start;
  border-radius: 7px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 900;
}

.map-card #mapPrimaryButton {
  min-height: 0;
  height: 56px;
  border-radius: 8px;
  font-size: 16px;
}

.map-card .save-actions .button-symbol {
  width: 24px;
  height: 24px;
  font-size: 15px;
}

.map-card .save-actions .button-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #ffe7b3;
  font-size: 13px;
  line-height: 1.05;
  text-align: left;
  text-overflow: clip;
  white-space: normal;
}

.map-card .city-node {
  width: 62px;
  min-height: 54px;
  padding: 5px;
}

.map-card .city-node strong {
  font-size: 13px;
}

.map-card .city-node span {
  margin-top: 2px;
  font-size: 9px;
}

.map-card .world-panel .route-layer,
.map-card .world-panel .world-map {
  width: var(--map-width);
  height: var(--map-height);
}

.map-card .world-panel .route-layer {
  position: relative;
}

.map-card .world-panel .world-map {
  position: absolute;
}

.map-card .city-node {
  width: 86px;
  min-height: 64px;
  padding: 7px 8px 8px;
}

.map-card .city-node strong {
  font-size: 15px;
}

.map-card .city-node span {
  margin-top: 4px;
  font-size: 11px;
}

@media (max-width: 380px) {
  .map-card .map-hud {
    grid-template-columns: minmax(0, 1fr) 52px 52px 52px;
  }

  .map-card .allocator-list {
    grid-auto-columns: 116px;
  }
}

/* Strategic map polish */
.map-card .world-panel {
  border-color: rgba(246, 205, 132, 0.38);
  background:
    radial-gradient(ellipse at 18% 19%, rgba(122, 148, 101, 0.26), transparent 19%),
    radial-gradient(ellipse at 54% 32%, rgba(95, 123, 92, 0.2), transparent 20%),
    radial-gradient(ellipse at 68% 68%, rgba(151, 95, 51, 0.24), transparent 21%),
    radial-gradient(ellipse at 30% 75%, rgba(44, 79, 68, 0.2), transparent 23%),
    linear-gradient(132deg, rgba(229, 197, 120, 0.12), rgba(20, 32, 25, 0.7) 44%, rgba(67, 52, 27, 0.5)),
    #182117;
  box-shadow:
    inset 0 0 0 1px rgba(255, 231, 169, 0.08),
    inset 0 0 80px rgba(2, 6, 4, 0.62),
    0 18px 38px rgba(6, 4, 3, 0.28);
  scrollbar-color: rgba(207, 156, 83, 0.72) rgba(25, 17, 12, 0.76);
}

.map-card .world-panel::before {
  inset: 0;
  z-index: 0;
  opacity: 0.58;
  background:
    linear-gradient(110deg, transparent 0 44%, rgba(255, 232, 166, 0.1) 44.4% 44.8%, transparent 45.2% 100%),
    linear-gradient(31deg, transparent 0 48%, rgba(119, 155, 121, 0.12) 48.3% 48.8%, transparent 49.2% 100%),
    repeating-linear-gradient(0deg, rgba(255, 232, 166, 0.035) 0 1px, transparent 1px 60px),
    repeating-linear-gradient(90deg, rgba(255, 232, 166, 0.028) 0 1px, transparent 1px 60px);
  background-size: 480px 420px, 540px 520px, 120px 120px, 120px 120px;
}

.map-card .world-panel::after {
  content: "";
  position: sticky;
  left: 0;
  top: 0;
  z-index: 6;
  display: block;
  width: 100%;
  height: 100%;
  margin-bottom: -100%;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(12, 9, 6, 0.6), transparent 10%, transparent 90%, rgba(12, 9, 6, 0.5)),
    linear-gradient(180deg, rgba(12, 9, 6, 0.42), transparent 12%, transparent 86%, rgba(12, 9, 6, 0.54));
}

.map-card .world-panel .route-layer {
  z-index: 1;
  overflow: visible;
}

.map-card .world-panel .world-map {
  z-index: 2;
}

.map-card .world-map::before,
.map-card .world-map::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-card .world-map::before {
  opacity: 0.14;
  background:
    radial-gradient(ellipse at 60% 12%, transparent 0 25%, rgba(246, 212, 140, 0.05) 25.6% 26.2%, transparent 26.8%),
    radial-gradient(ellipse at 23% 42%, transparent 0 19%, rgba(246, 212, 140, 0.045) 19.4% 20%, transparent 20.6%),
    radial-gradient(ellipse at 70% 60%, transparent 0 22%, rgba(246, 212, 140, 0.04) 22.5% 23%, transparent 23.5%);
}

.map-card .world-map::after {
  opacity: 0.18;
  background:
    radial-gradient(ellipse at 42% 36%, rgba(122, 144, 116, 0.16), transparent 24%),
    radial-gradient(ellipse at 58% 70%, rgba(151, 117, 72, 0.18), transparent 26%);
}

.map-card .route {
  fill: none;
}

.map-card .route-track,
.map-card .route-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.map-card .route-track {
  stroke: rgba(18, 9, 3, 0.88);
  stroke-width: 7px;
  opacity: 0.92;
}

.map-card .route-line {
  stroke: rgba(238, 181, 85, 0.78);
  stroke-width: 3px;
  filter:
    drop-shadow(0 0 0.7px rgba(255, 214, 130, 0.54))
    drop-shadow(0 0 3px rgba(219, 131, 54, 0.18));
}

.map-card .route.open .route-track,
.map-card .route.frontier .route-track {
  stroke: rgba(39, 18, 8, 0.82);
  stroke-width: 8.2px;
}

.map-card .route.open .route-line {
  stroke: rgba(255, 209, 102, 0.94);
  stroke-width: 3.8px;
}

.map-card .route.frontier .route-line {
  stroke: rgba(255, 91, 91, 0.92);
  stroke-width: 4px;
  filter:
    drop-shadow(0 0 1px rgba(255, 86, 72, 0.72))
    drop-shadow(0 0 4px rgba(255, 182, 88, 0.32));
}

.map-card .route.selected .route-track {
  stroke: rgba(66, 28, 10, 0.9);
  stroke-width: 9px;
}

.map-card .route.selected .route-line {
  stroke: rgba(255, 226, 143, 0.98);
  stroke-width: 4.6px;
  filter:
    drop-shadow(0 0 1px rgba(255, 230, 152, 0.86))
    drop-shadow(0 0 6px rgba(255, 188, 72, 0.44));
}

.map-card .city-node {
  z-index: 4;
  width: 66px;
  min-height: 50px;
  translate: -50% calc(-100% + 22px);
  padding: 6px 7px 7px;
  border-color: rgba(239, 184, 99, 0.55);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(56, 34, 18, 0.93), rgba(24, 15, 10, 0.94)),
    rgba(28, 17, 11, 0.94);
  color: #fff0c8;
  box-shadow:
    0 10px 18px rgba(3, 2, 1, 0.32),
    inset 0 1px 0 rgba(255, 230, 158, 0.14);
  backdrop-filter: blur(3px);
}

.map-card .city-node::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 15px;
  height: 15px;
  transform: translateX(-50%) rotate(45deg);
  border: 1px solid rgba(246, 202, 117, 0.58);
  border-radius: 5px 5px 8px 5px;
  background:
    radial-gradient(circle at 42% 38%, #fff2bd 0 15%, #d39a42 17% 42%, rgba(95, 42, 24, 0.95) 44% 100%);
  box-shadow: 0 0 14px rgba(230, 164, 73, 0.34);
}

.map-card .city-node::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -20px;
  width: 42px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(1, 0, 0, 0.34), transparent 68%);
  pointer-events: none;
}

.map-card .city-node strong {
  color: #ffe7a9;
  font-size: 13px;
  line-height: 1.12;
  text-shadow: 0 2px 4px rgba(12, 4, 2, 0.86);
}

.map-card .city-node span {
  margin-top: 2px;
  font-size: 9px;
  line-height: 1.15;
}

.map-card .city-node .city-stage {
  color: rgba(255, 236, 178, 0.95);
}

.map-card .city-node .city-guard {
  color: rgba(255, 229, 184, 0.62);
}

.map-card .city-progress {
  height: 3px;
  margin-top: 4px;
  background: rgba(12, 8, 5, 0.82);
}

.map-card .city-progress b {
  background: linear-gradient(90deg, #e5ad4e, #f05a3d);
  box-shadow: 0 0 8px rgba(237, 91, 55, 0.38);
}

.map-card .city-node.owned {
  border-color: rgba(142, 210, 127, 0.62);
  background:
    linear-gradient(180deg, rgba(57, 99, 64, 0.96), rgba(21, 43, 30, 0.95)),
    rgba(24, 54, 34, 0.96);
}

.map-card .city-node.owned::before {
  border-color: rgba(157, 222, 139, 0.74);
  background:
    radial-gradient(circle at 42% 38%, #efffcf 0 16%, #78c76d 18% 44%, rgba(30, 83, 48, 0.98) 46% 100%);
  box-shadow: 0 0 14px rgba(126, 220, 108, 0.36);
}

.map-card .city-node.frontier {
  border-color: rgba(255, 139, 91, 0.82);
  box-shadow:
    0 0 0 1px rgba(221, 82, 51, 0.42),
    0 0 20px rgba(221, 82, 51, 0.18),
    0 10px 18px rgba(3, 2, 1, 0.32);
}

.map-card .city-node.locked {
  opacity: 0.42;
  filter: grayscale(0.35);
}

.map-card .city-node:hover,
.map-card .city-node.selected {
  z-index: 5;
  border-color: rgba(255, 226, 137, 0.96);
  transform: translateY(-4px) scale(1.04);
  filter: brightness(1.08);
}

.map-card .city-node.selected::before {
  box-shadow:
    0 0 0 4px rgba(255, 218, 112, 0.13),
    0 0 20px rgba(255, 201, 91, 0.54);
}

.map-card .map-zoom-controls {
  left: calc(100% - 74px);
  top: 12px;
  gap: 7px;
}

.map-card .map-zoom-controls button {
  width: 32px;
  height: 32px;
  border-color: rgba(255, 224, 153, 0.5);
  background: rgba(31, 18, 10, 0.86);
  box-shadow:
    0 8px 18px rgba(6, 3, 2, 0.38),
    inset 0 1px 0 rgba(255, 230, 169, 0.12);
}

.duel-shell {
  max-width: 1180px;
}

.duel-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.duel-control-panel {
  margin-bottom: 14px;
}

.duel-form-grid {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.duel-status {
  margin-bottom: 0;
  color: rgba(255, 236, 178, 0.84);
}

.duel-results {
  display: grid;
  gap: 14px;
}

.duel-run-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.duel-result-card {
  overflow: hidden;
}

.duel-summary {
  margin: 0;
  color: rgba(255, 236, 178, 0.7);
  font-size: 12px;
}

.duel-table-wrap {
  overflow: auto;
  border: 1px solid rgba(188, 132, 57, 0.34);
  border-radius: 8px;
  background: rgba(20, 12, 7, 0.7);
}

.duel-table-wrap.compact {
  max-height: 320px;
}

.duel-progress {
  height: 8px;
  margin: 0 0 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 216, 127, 0.32);
  border-radius: 999px;
  background: rgba(13, 8, 5, 0.82);
}

.duel-progress i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f0b846, #f0d66f);
  box-shadow: 0 0 12px rgba(240, 190, 70, 0.4);
  transition: width 180ms ease;
}

.duel-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  color: rgba(255, 241, 205, 0.9);
  font-size: 12px;
}

.duel-table th,
.duel-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(188, 132, 57, 0.2);
  text-align: left;
  white-space: nowrap;
}

.duel-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(50, 29, 15, 0.96);
  color: rgba(255, 221, 141, 0.95);
  font-weight: 700;
}

.duel-table tr:nth-child(even) td {
  background: rgba(255, 218, 140, 0.035);
}

.duel-win-rate,
.duel-gap {
  color: #ffd35f;
  font-weight: 800;
}

.duel-subtitle {
  margin: 14px 0 8px;
  color: rgba(255, 221, 141, 0.95);
  font-size: 14px;
}

#runDuelTest:disabled {
  cursor: wait;
  opacity: 0.68;
  filter: grayscale(0.25);
}

.battle-card .deployment-hint {
  display: none !important;
}

@media (max-width: 760px) {
  .duel-form-grid {
    grid-template-columns: 1fr;
  }

  .duel-summary {
    width: 100%;
  }
}

/* Auth entry screen */
.auth-page {
  min-height: 100dvh;
  overflow: auto;
  background:
    radial-gradient(circle at 18% 12%, rgba(206, 67, 42, 0.24), transparent 27%),
    radial-gradient(circle at 82% 18%, rgba(206, 143, 65, 0.18), transparent 26%),
    linear-gradient(160deg, #100b09 0%, #17100d 44%, #070807 100%);
}

.auth-page .game-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 34px);
}

.login-screen {
  position: relative;
  width: min(1040px, 100%);
  min-height: min(720px, calc(100dvh - 28px));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 440px);
  overflow: hidden;
  border: 1px solid rgba(247, 200, 116, 0.36);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(25, 14, 10, 0.46), rgba(18, 11, 8, 0.92) 58%, rgba(18, 11, 8, 0.98)),
    #120d0a;
  box-shadow: 0 32px 86px rgba(0, 0, 0, 0.58);
  isolation: isolate;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(180deg, rgba(10, 7, 5, 0.18), rgba(12, 8, 7, 0.66)),
    url("assets/battlefield.png") center / cover no-repeat;
  opacity: 0.72;
  filter: saturate(0.95) contrast(1.08);
}

.login-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 28% 24%, rgba(235, 177, 82, 0.22), transparent 22%),
    linear-gradient(90deg, transparent 0 42%, rgba(10, 7, 5, 0.74) 64%, rgba(10, 7, 5, 0.95) 100%);
  pointer-events: none;
}

.login-hero {
  position: relative;
  min-height: 100%;
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  align-items: flex-end;
}

.login-hero-city {
  position: absolute;
  left: 11%;
  right: 14%;
  top: 9%;
  height: 180px;
  border-bottom: 2px solid rgba(227, 164, 74, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 199, 102, 0.04), transparent 68%),
    linear-gradient(90deg, transparent 0 8%, rgba(39, 22, 14, 0.62) 8% 14%, transparent 14% 20%, rgba(39, 22, 14, 0.76) 20% 80%, transparent 80% 86%, rgba(39, 22, 14, 0.62) 86% 92%, transparent 92%),
    linear-gradient(180deg, transparent 0 38%, rgba(30, 18, 12, 0.88) 38% 54%, rgba(19, 12, 9, 0.88) 54% 100%);
  clip-path: polygon(0 100%, 0 54%, 8% 54%, 8% 41%, 16% 41%, 16% 30%, 26% 30%, 26% 18%, 50% 0, 74% 18%, 74% 30%, 84% 30%, 84% 41%, 92% 41%, 92% 54%, 100% 54%, 100% 100%);
  opacity: 0.72;
}

.login-banner {
  position: absolute;
  top: 22%;
  width: 12px;
  height: 154px;
  background: linear-gradient(180deg, #b7372b, #5e1712);
  box-shadow: 0 0 18px rgba(189, 57, 37, 0.42);
  transform-origin: top center;
}

.login-banner::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 10px;
  width: 66px;
  height: 72px;
  background: linear-gradient(135deg, rgba(217, 70, 48, 0.96), rgba(91, 22, 14, 0.92));
  clip-path: polygon(0 0, 100% 10%, 74% 50%, 100% 91%, 0 100%);
}

.banner-left {
  left: 13%;
  transform: rotate(-7deg);
}

.banner-right {
  right: 18%;
  transform: rotate(6deg) scaleX(-1);
}

.login-route-lines {
  position: absolute;
  inset: 42% 8% 10% 7%;
  opacity: 0.42;
  background:
    radial-gradient(circle at 14% 78%, rgba(238, 190, 103, 0.8) 0 4px, transparent 5px),
    radial-gradient(circle at 48% 50%, rgba(238, 190, 103, 0.75) 0 4px, transparent 5px),
    radial-gradient(circle at 78% 28%, rgba(238, 190, 103, 0.7) 0 4px, transparent 5px),
    linear-gradient(28deg, transparent 0 29%, rgba(238, 190, 103, 0.42) 29.2% 30%, transparent 30.3%),
    linear-gradient(-24deg, transparent 0 38%, rgba(238, 190, 103, 0.34) 38.2% 39%, transparent 39.3%);
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
}

.login-army-strip {
  position: absolute;
  left: 9%;
  right: 18%;
  bottom: 21%;
  display: flex;
  justify-content: space-between;
  opacity: 0.55;
}

.login-army-strip span {
  width: 82px;
  height: 42px;
  background:
    radial-gradient(circle at 18% 72%, rgba(14, 10, 8, 0.9) 0 6px, transparent 7px),
    radial-gradient(circle at 42% 56%, rgba(14, 10, 8, 0.9) 0 7px, transparent 8px),
    radial-gradient(circle at 66% 70%, rgba(14, 10, 8, 0.9) 0 6px, transparent 7px),
    linear-gradient(90deg, transparent 8%, rgba(124, 37, 27, 0.76) 8% 14%, transparent 14% 34%, rgba(124, 37, 27, 0.76) 34% 40%, transparent 40% 62%, rgba(124, 37, 27, 0.76) 62% 68%, transparent 68%);
}

.login-hero-copy {
  position: relative;
  width: min(560px, 100%);
  display: grid;
  gap: 12px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.72);
}

.login-hero-copy span {
  color: #f0c46f;
  font-size: 14px;
  font-weight: 800;
}

.login-hero-copy strong {
  color: #fff2c8;
  font-size: clamp(34px, 4.5vw, 50px);
  line-height: 1.08;
  letter-spacing: 0;
}

.login-hero-copy p {
  max-width: 390px;
  margin: 0;
  color: rgba(255, 238, 204, 0.8);
  font-size: 15px;
  line-height: 1.8;
}

.auth-page .login-card {
  align-self: center;
  justify-self: end;
  width: min(420px, calc(100% - 28px));
  margin: 22px;
  padding: 24px;
  gap: 15px;
  border-radius: 10px;
  border-color: rgba(255, 215, 138, 0.42);
  background:
    linear-gradient(180deg, rgba(73, 39, 20, 0.84), rgba(26, 15, 10, 0.96)),
    rgba(20, 12, 8, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 239, 188, 0.12),
    0 24px 58px rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(8px);
}

.auth-page .login-brand {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  margin: 0;
}

.login-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 1px solid rgba(255, 222, 147, 0.36);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38);
}

.auth-page .login-brand strong {
  display: block;
  color: #fff1c4;
  font-size: 25px;
  line-height: 1.15;
}

.auth-page .login-brand span {
  display: block;
  margin-top: 5px;
  color: rgba(255, 232, 188, 0.68);
  font-size: 13px;
}

.login-rally {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  gap: 8px;
  align-items: center;
  color: rgba(255, 226, 171, 0.76);
  font-size: 12px;
  font-weight: 800;
}

.login-rally i {
  height: 1px;
  background: linear-gradient(90deg, rgba(221, 161, 72, 0.18), rgba(221, 161, 72, 0.72), rgba(221, 161, 72, 0.18));
}

.auth-page .tabs {
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(255, 222, 148, 0.18);
  border-radius: 9px;
  background: rgba(12, 8, 7, 0.38);
}

.auth-page .tab {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 230, 184, 0.7);
  font-size: 15px;
  font-weight: 900;
}

.auth-page .tab.active {
  color: #fff1c8;
  background: linear-gradient(180deg, rgba(191, 67, 45, 0.96), rgba(113, 34, 24, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 230, 168, 0.24), 0 8px 18px rgba(120, 31, 22, 0.34);
}

.auth-page .auth-form {
  gap: 11px;
}

.auth-page .auth-form input {
  height: 48px;
  border-radius: 8px;
  border-color: rgba(255, 224, 153, 0.26);
  background:
    linear-gradient(180deg, rgba(13, 8, 7, 0.78), rgba(20, 11, 8, 0.62));
  color: #ffeec7;
  font-size: 15px;
  font-weight: 700;
  box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.26);
}

.auth-page .auth-form input::placeholder {
  color: rgba(255, 231, 191, 0.42);
  font-weight: 700;
}

.auth-page .auth-form input:focus {
  border-color: rgba(242, 190, 93, 0.95);
  box-shadow: 0 0 0 3px rgba(203, 107, 52, 0.2), inset 0 1px 6px rgba(0, 0, 0, 0.26);
}

.auth-page .auth-code-row {
  grid-template-columns: minmax(0, 1fr) 108px;
}

.auth-page .auth-code-row .ghost-button {
  min-height: 48px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

.auth-page .restart-button {
  min-height: 50px;
  border-radius: 9px;
  font-size: 17px;
  font-weight: 900;
  color: #fff3ca;
  box-shadow: inset 0 1px 0 rgba(255, 235, 178, 0.28), 0 12px 26px rgba(139, 35, 24, 0.42);
}

.android-download-link {
  min-height: 48px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(118, 204, 132, 0.26);
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(58, 96, 55, 0.3), rgba(16, 28, 17, 0.42)),
    rgba(10, 7, 6, 0.26);
  color: #def7c6;
  text-decoration: none;
}

.android-download-link span {
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(85, 145, 74, 0.24);
  color: rgba(226, 255, 203, 0.8);
  font-size: 12px;
  font-weight: 900;
}

.android-download-link strong {
  color: #f0ffd0;
  font-size: 15px;
  font-weight: 900;
  text-align: right;
}

.auth-page .auth-message {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 222, 148, 0.14);
  border-radius: 8px;
  background: rgba(10, 7, 6, 0.34);
  color: rgba(255, 232, 194, 0.72);
  font-size: 13px;
}

.auth-page .hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .auth-page .game-shell {
    padding: 0;
    align-items: stretch;
  }

  .login-screen {
    width: 100vw;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(210px, 32dvh) auto;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .login-screen::after {
    background:
      linear-gradient(180deg, transparent 0 24%, rgba(9, 6, 5, 0.48) 40%, rgba(9, 6, 5, 0.92) 68%, rgba(9, 6, 5, 0.98) 100%);
  }

  .login-hero {
    min-height: 210px;
    padding: 24px 22px 18px;
    align-items: flex-end;
  }

  .login-hero-city {
    left: 16%;
    right: 12%;
    top: 6%;
    height: 112px;
  }

  .login-banner {
    top: 16%;
    height: 104px;
    transform: rotate(-5deg) scale(0.76);
  }

  .banner-right {
    transform: rotate(5deg) scaleX(-1) scale(0.76);
  }

  .login-route-lines,
  .login-army-strip {
    display: none;
  }

  .login-hero-copy {
    gap: 7px;
  }

  .login-hero-copy span {
    font-size: 12px;
  }

  .login-hero-copy strong {
    font-size: clamp(30px, 9vw, 36px);
  }

  .login-hero-copy p {
    max-width: 320px;
    font-size: 13px;
    line-height: 1.65;
  }

  .auth-page .login-card {
    width: calc(100% - 24px);
    justify-self: center;
    align-self: start;
    margin: -8px 12px 18px;
    padding: 18px;
  }

  .auth-page .login-brand {
    grid-template-columns: 48px 1fr;
  }

  .login-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
  }

.auth-page .login-brand strong {
  font-size: 22px;
  }
}

body.auth-page .login-hero-copy strong {
  font-size: clamp(32px, 4vw, 46px);
}

@media (max-width: 760px) {
  body.auth-page .login-hero-copy strong {
    font-size: clamp(28px, 8vw, 32px);
  }
}
