:root {
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: #e8e9dd;
  background: #121b19;
  font-synthesis: none;
  --accent: #c5d69b;
  --muted: #89978d;
  --line: #ffffff12;
  --blue: #72bac4;
  --red: #d68269;
  --panel: #1b2622;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 2px solid #dbeaab;
  outline-offset: 4px;
}
button {
  transition:
    background 0.18s,
    transform 0.18s,
    border-color 0.18s;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
a {
  color: inherit;
  text-decoration: none;
}
svg {
  display: block;
}
button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app {
  max-width: 1536px;
  margin: 0 auto;
  padding: 0 42px;
}
.masthead {
  height: 104px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.brand > svg {
  width: 35px;
  height: 42px;
  color: var(--accent);
}
.brand strong {
  display: block;
  font-size: 29px;
  font-weight: 700;
  letter-spacing: 5px;
  line-height: 1.1;
}
.brand-dot {
  color: var(--accent);
  letter-spacing: 0;
}
.brand small {
  font-size: 9px;
  letter-spacing: 3px;
  display: block;
  margin-top: 7px;
  color: #a2b09e;
}
.masthead-caption {
  font-size: 12px;
  letter-spacing: 3px;
  color: #8b9a8f;
}
.mode-tag {
  font-size: 11px;
  letter-spacing: 1px;
  border: 1px solid #a2b58b30;
  border-radius: 30px;
  padding: 9px 13px;
  color: #b8c5ac;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mode-tag i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.scenario-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 27px 0 24px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 7px;
}
.scenario-header h1 {
  font-size: 25px;
  font-weight: 550;
  letter-spacing: 2px;
  margin: 0;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 32px;
  font-size: 11px;
  letter-spacing: 1px;
  color: #647568;
}
.steps li {
  display: flex;
  gap: 8px;
  align-items: center;
}
.steps span {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  border: 1px solid #ffffff14;
  border-radius: 50%;
  padding: 5px;
}
.steps .active {
  color: var(--accent);
}
.steps .active span {
  background: #c5d69b16;
  border-color: #c5d69b40;
}
.battle-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 258px;
  gap: 25px;
  align-items: start;
}
.battlefield {
  min-width: 0;
}
.scoreboard {
  height: 72px;
  background: #1c2723;
  border: 1px solid #ffffff0a;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  padding: 0 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.army-score {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
}
.army-score.enemy {
  justify-content: flex-end;
  text-align: right;
}
.army-score strong {
  font-size: 23px;
  font-family: ui-monospace, "Segoe UI", monospace;
  display: block;
  line-height: 1.3;
  font-weight: 600;
}
.army-score strong small {
  font-size: 12px;
  font-weight: 400;
  color: #687a6c;
}
.army-name {
  font-size: 10px;
  letter-spacing: 1px;
  color: #b9c8bc;
}
.team-mark {
  width: 31px;
  height: 35px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  clip-path: polygon(0 0, 100% 0, 100% 75%, 50% 100%, 0 75%);
  color: var(--blue);
  background: #75bcca15;
  border: 1px solid #75bcca26;
}
.enemy .team-mark {
  background: #d6826915;
  color: var(--red);
}
.squad-total {
  font-size: 10px;
  color: #758679;
  margin-left: 6px;
}
.clock {
  text-align: center;
  min-width: 80px;
}
.clock > span {
  font-size: 9px;
  letter-spacing: 2px;
  color: #a9b88b;
}
.clock > b {
  font-size: 15px;
  font-family: ui-monospace, monospace;
  display: block;
  margin-top: 4px;
  letter-spacing: 2px;
  font-weight: 400;
  color: #d4d9ce;
}
.strength {
  height: 3px;
  display: flex;
  background: #263229;
  gap: 3px;
}
.strength span {
  height: 100%;
  flex: 1;
  transform-origin: left;
  transition: transform 0.2s;
  background: #508f9c;
}
.strength span + span {
  transform-origin: right;
  background: #b9644f;
}
.board-shell {
  position: relative;
  aspect-ratio: 1200 / 760;
  background: #cac7ad;
  overflow: hidden;
  isolation: isolate;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
canvas.battling {
  cursor: default;
}
canvas.dragging {
  cursor: grabbing;
}
.board-corner {
  position: absolute;
  top: 15px;
  left: 16px;
  display: flex;
  gap: 7px;
  align-items: center;
  color: #3e504a;
  font-size: 10px;
  letter-spacing: 1px;
  pointer-events: none;
  background: #e1decdcc;
  border: 1px solid #68755e1a;
  padding: 7px 10px;
  border-radius: 4px;
  backdrop-filter: blur(5px);
}
.board-dot {
  width: 5px;
  height: 5px;
  background: #5c8d83;
  border-radius: 50%;
}
.fullscreen-button {
  position: absolute;
  right: 12px;
  top: 12px;
  display: grid;
  place-items: center;
  color: #445149;
  background: #e1decdcc;
  border: 1px solid #68755e2e;
  border-radius: 6px;
  width: 34px;
  height: 34px;
}
.fullscreen-button:hover {
  background: #edead9;
}
.field-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  padding: 13px 15px;
  background: #1b2622;
  border: 1px solid #ffffff0a;
  border-top: 0;
  border-radius: 0 0 10px 10px;
  color: #8b9b8d;
  letter-spacing: 0.5px;
}
.field-footer > span:first-child {
  display: flex;
  gap: 7px;
  align-items: center;
}
.field-footer i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 1px;
}
.legend-blue {
  background: var(--blue);
}
.legend-red {
  background: var(--red);
  margin-left: 10px;
}
.map-coordinate {
  font-size: 8px;
  letter-spacing: 1.5px;
  color: #63766a;
}
.battle-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  gap: 12px;
}
.control-note {
  display: flex;
  align-items: center;
  gap: 12px;
}
.note-number {
  font-size: 25px;
  font-family: Georgia, serif;
  color: #5c7160;
  font-style: italic;
}
.control-note strong {
  font-size: 12px;
  letter-spacing: 1px;
  font-weight: 500;
}
.control-note small {
  display: block;
  font-size: 10px;
  color: #7a8e7f;
  margin-top: 5px;
}
.control-actions {
  display: flex;
  gap: 8px;
}
.icon-button,
.secondary-button {
  height: 46px;
  background: #202c25;
  border: 1px solid #ffffff12;
  color: #c2cdbb;
  border-radius: 7px;
}
.icon-button {
  width: 43px;
  display: grid;
  place-items: center;
}
.secondary-button {
  font-family: ui-monospace, monospace;
  padding: 0 13px;
  font-size: 15px;
}
.secondary-button span {
  font-family: system-ui, sans-serif;
  font-size: 10px;
  margin-left: 4px;
  color: #93a28b;
}
.icon-button:hover,
.secondary-button:hover {
  background: #2b3b2e;
}
.primary-button {
  border: 1px solid #c7d79e;
  background: var(--accent);
  color: #243025;
  border-radius: 7px;
  min-height: 46px;
  padding: 0 23px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
}
.primary-button:hover {
  background: #d6e5b3;
}
.primary-button svg {
  width: 14px;
  height: 14px;
}
.status-line {
  font-size: 11px;
  color: #809482;
  margin: 13px 0 0;
  line-height: 1.7;
  min-height: 19px;
}
.status-line.error {
  color: #e1a08b;
}
.command-panel {
  background: #1a2520;
  border: 1px solid #ffffff0b;
  border-radius: 12px;
  padding: 22px 17px 18px;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-heading .eyebrow {
  font-size: 8px;
  color: #7e907c;
}
.panel-heading h2 {
  font-size: 17px;
  letter-spacing: 1px;
  font-weight: 550;
  margin: 0;
}
.count-badge {
  font:
    20px Georgia,
    serif;
  font-style: italic;
  color: #71856c;
}
.panel-intro {
  font-size: 10px;
  color: #8b9c85;
  margin: 14px 0 16px;
  line-height: 1.7;
}
.roster {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.squad-card {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 1px solid #ffffff08;
  background: #202d24;
  color: #d8e0d0;
  text-align: left;
  padding: 11px 12px;
  border-radius: 7px;
  position: relative;
  overflow: hidden;
  min-height: 62px;
}
.squad-card:hover {
  background: #29392b;
  border-color: #c5d69b38;
}
.squad-card[aria-pressed="true"] {
  border-color: #afc4938c;
  background: #2c3b2b;
}
.squad-card[aria-pressed="true"]:before {
  content: "";
  position: absolute;
  width: 3px;
  top: 14px;
  bottom: 14px;
  left: 0;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.squad-symbol {
  width: 30px;
  height: 35px;
  color: #b6caa4;
  display: grid;
  place-items: center;
  background: #ffffff06;
  border-radius: 4px;
}
.squad-symbol svg {
  width: 22px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.squad-copy {
  flex: 1;
  min-width: 0;
}
.squad-copy strong {
  font-size: 11px;
  font-weight: 550;
  display: block;
  letter-spacing: 0.5px;
}
.squad-copy small {
  display: block;
  font-size: 8px;
  color: #8f9e88;
  margin-top: 5px;
  letter-spacing: 0.5px;
}
.squad-count {
  font:
    14px ui-monospace,
    monospace;
  color: #bdd1a6;
}
.squad-count small {
  font-size: 9px;
  color: #73866e;
}
.squad-card.defeated {
  opacity: 0.4;
}
.unit-intel {
  margin-top: 21px;
  padding-top: 17px;
  border-top: 1px solid #ffffff10;
}
.intel-heading {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  color: #97ad84;
  letter-spacing: 1px;
}
.intel-heading span + span {
  color: #74836e;
}
.unit-intel h3 {
  font-size: 20px;
  letter-spacing: 2px;
  font-weight: 500;
  margin: 9px 0;
}
.unit-intel p {
  font-size: 10px;
  line-height: 1.9;
  color: #92a18a;
  margin: 0 0 14px;
}
.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  font-size: 9px;
  color: #87987e;
}
.stat-row > span {
  width: 24px;
}
.stat-track {
  flex: 1;
  height: 3px;
  background: #ffffff0b;
  border-radius: 3px;
  overflow: hidden;
}
.stat-track i {
  display: block;
  height: 100%;
  background: #93aa7c;
}
.stat-row b {
  font:
    10px ui-monospace,
    monospace;
  width: 28px;
  text-align: right;
  color: #b6c5a9;
}
.tactical-note {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #ffffff0c;
}
.tactical-note > span {
  font-size: 9px;
  color: #adbda0;
  letter-spacing: 2px;
}
.tactical-note p {
  font-size: 10px;
  color: #71856e;
  line-height: 1.9;
  margin: 7px 0 0;
}
.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 28px 0 25px;
  color: #5f7462;
  font-size: 9px;
  letter-spacing: 1px;
}
.page-footer i {
  font-style: normal;
  padding: 0 8px;
  color: #354c3d;
}
.page-footer > span + span {
  letter-spacing: 0.5px;
}
.pause-curtain {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 17px;
  background: #17221c7a;
  backdrop-filter: blur(3px);
  color: #f0f0df;
}
.pause-curtain[hidden] {
  display: none;
}
.pause-curtain > span {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 4px;
}
.pause-curtain button {
  background: #e2e7d3;
  border: 0;
  border-radius: 6px;
  padding: 12px 22px;
  color: #273823;
  font-size: 12px;
  letter-spacing: 1px;
}
.pause-curtain button span {
  margin-left: 20px;
}
dialog {
  width: min(430px, calc(100vw - 36px));
  border: 1px solid #9aaf7866;
  border-radius: 16px;
  background: #1c2a22;
  color: #e7ecd9;
  padding: 32px;
  text-align: center;
  box-shadow: 0 30px 120px #0008;
}
dialog::backdrop {
  background: #0c1516a8;
  backdrop-filter: blur(6px);
}
.result-emblem {
  color: var(--accent);
  font-size: 40px;
  margin-bottom: 13px;
}
.result-emblem.enemy {
  color: var(--red);
}
dialog .eyebrow {
  color: #92a980;
}
dialog h2 {
  font-size: 30px;
  letter-spacing: 4px;
  margin: 10px 0 12px;
}
dialog > p:not(.eyebrow) {
  font-size: 12px;
  color: #a3b496;
  line-height: 1.8;
  margin: 0;
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 26px 0;
  padding: 20px 0;
  border-top: 1px solid #ffffff13;
  border-bottom: 1px solid #ffffff13;
}
.result-stats b {
  display: block;
  font:
    23px ui-monospace,
    monospace;
  color: #dae5ca;
}
.result-stats span {
  display: block;
  font-size: 10px;
  color: #8fa47f;
  margin-top: 8px;
}
dialog > .primary-button {
  width: 100%;
}
.text-button {
  border: 0;
  background: none;
  color: #9baa8b;
  font-size: 11px;
  padding: 17px 10px 0;
  letter-spacing: 1px;
}
.board-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  background: #252e26;
}
.board-shell:fullscreen canvas {
  width: 100%;
  height: 100%;
}
.board-shell:fullscreen .board-corner {
  font-size: 12px;
}
.board-shell:fullscreen .fullscreen-button {
  width: 44px;
  height: 44px;
}
@media (min-width: 1600px) {
  .app {
    padding: 0 48px;
  }
  .masthead {
    height: 115px;
  }
  .scenario-header {
    padding: 32px 0;
  }
  .battle-layout {
    grid-template-columns: minmax(0, 1fr) 275px;
    gap: 30px;
  }
  .command-panel {
    padding: 24px 20px;
  }
  .squad-card {
    min-height: 66px;
  }
}
@media (max-width: 1100px) {
  .app {
    padding: 0 24px;
  }
  .battle-layout {
    grid-template-columns: minmax(0, 1fr) 226px;
    gap: 17px;
  }
  .command-panel {
    padding: 17px 13px;
  }
  .squad-total {
    display: none;
  }
  .control-note {
    display: none;
  }
  .control-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .primary-button {
    flex: 1;
  }
  .status-line {
    font-size: 10px;
  }
  .scoreboard {
    padding: 0 15px;
  }
  .field-footer {
    font-size: 9px;
  }
  .map-coordinate {
    display: none;
  }
  .scenario-header {
    padding: 22px 0;
  }
  .masthead {
    height: 90px;
  }
}
@media (max-width: 760px) {
  .app {
    padding: 0 16px;
  }
  .masthead {
    height: 77px;
    gap: 10px;
  }
  .brand > svg {
    width: 28px;
    height: 34px;
  }
  .brand {
    gap: 9px;
  }
  .brand strong {
    font-size: 24px;
    letter-spacing: 4px;
  }
  .brand small {
    font-size: 7px;
    letter-spacing: 2px;
  }
  .masthead-caption {
    display: none;
  }
  .mode-tag {
    font-size: 9px;
    padding: 7px 10px;
  }
  .scenario-header {
    padding: 22px 0 18px;
  }
  .scenario-header h1 {
    font-size: 21px;
  }
  .scenario-header .eyebrow {
    font-size: 8px;
  }
  .steps {
    gap: 10px;
    font-size: 10px;
  }
  .steps span {
    font-size: 8px;
    padding: 4px;
  }
  .battle-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .battlefield {
    width: 100%;
  }
  .scoreboard {
    height: 64px;
    padding: 0 12px;
    gap: 5px;
  }
  .army-score {
    gap: 7px;
  }
  .army-score strong {
    font-size: 20px;
  }
  .army-name {
    font-size: 9px;
  }
  .team-mark {
    width: 25px;
    height: 29px;
    font-size: 10px;
  }
  .clock {
    min-width: 66px;
  }
  .clock b {
    font-size: 12px;
  }
  .clock > span {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .board-corner {
    top: 9px;
    left: 9px;
    padding: 5px 7px;
    font-size: 8px;
    letter-spacing: 0;
  }
  .fullscreen-button {
    top: 7px;
    right: 7px;
    width: 32px;
    height: 32px;
  }
  .field-footer {
    padding: 10px;
    font-size: 8px;
    gap: 4px;
  }
  .field-footer > span:first-child {
    gap: 5px;
  }
  .legend-red {
    margin-left: 5px;
  }
  .battle-controls {
    margin-top: 15px;
  }
  .primary-button {
    font-size: 12px;
    gap: 14px;
    padding: 0 15px;
  }
  .control-actions {
    gap: 7px;
  }
  .icon-button {
    width: 45px;
  }
  .secondary-button {
    padding: 0 10px;
  }
  .status-line {
    margin-top: 10px;
    line-height: 1.8;
    min-height: 34px;
  }
  .command-panel {
    width: 100%;
    padding: 17px;
  }
  .panel-heading h2 {
    font-size: 16px;
  }
  .panel-heading .eyebrow {
    font-size: 7px;
  }
  .panel-intro {
    margin: 10px 0 12px;
    font-size: 10px;
  }
  .roster {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  .squad-card {
    min-height: 72px;
    padding: 9px;
    gap: 5px;
    flex-wrap: wrap;
  }
  .squad-symbol {
    width: 24px;
    height: 26px;
    background: transparent;
  }
  .squad-symbol svg {
    width: 20px;
    height: 22px;
  }
  .squad-copy strong {
    font-size: 10px;
    letter-spacing: 0;
  }
  .squad-copy small {
    font-size: 7px;
    margin-top: 3px;
  }
  .squad-count {
    width: 100%;
    text-align: right;
    font-size: 12px;
    line-height: 10px;
  }
  .squad-count small {
    font-size: 8px;
  }
  .unit-intel {
    margin-top: 16px;
    padding-top: 13px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 22px;
  }
  .intel-heading {
    grid-column: 1/-1;
  }
  .unit-intel h3 {
    grid-column: 1;
    margin: 8px 0;
    font-size: 17px;
  }
  .unit-intel p {
    grid-column: 1;
    grid-row: 3 / 6;
    font-size: 10px;
    margin: 0;
    line-height: 1.8;
  }
  .stat-row {
    grid-column: 2;
    margin: 8px 0;
  }
  .stat-row:nth-of-type(2) {
    grid-row: 2;
  }
  .stat-row:nth-of-type(3) {
    grid-row: 3;
  }
  .stat-row:nth-of-type(4) {
    grid-row: 4;
  }
  .tactical-note {
    margin-top: 15px;
    padding-top: 13px;
  }
  .tactical-note p {
    font-size: 9px;
    line-height: 1.8;
  }
  .page-footer {
    padding: 23px 0;
    font-size: 8px;
    flex-wrap: wrap;
  }
  .page-footer > span + span {
    font-size: 8px;
  }
  .pause-curtain > span {
    font-size: 18px;
  }
  .pause-curtain button {
    padding: 10px 16px;
  }
}
@media (min-width: 761px) {
  .masthead {
    height: 80px;
  }
  .scenario-header {
    padding: 18px 0;
  }
  .scoreboard {
    height: 64px;
  }
  .board-shell {
    width: 100%;
    max-height: calc(100dvh - 380px);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
  dialog::backdrop,
  .pause-curtain {
    backdrop-filter: none;
  }
}
