:root {
  --ink: #25312e;
  --muted: #626a60;
  --paper: #e6dfcd;
  --panel: #f2ecdc;
  --line: #b5ae98;
  --gold: #d3b36c;
  --ocean: #496c75;
  --attack: #e4a069;
  --move: #bdd8ac;
  --radius: 4px;
  --shadow: 0 8px 28px #14242345;
  --z-panel: 10;
  --z-tooltip: 20;
  --z-notice: 30;
  font:
    14px/1.45 "Avenir Next",
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: #293b3c;
  font-variant-numeric: tabular-nums;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
select,
input {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 10px;
}
button {
  background: #e9e2cf;
  color: var(--ink);
  cursor: pointer;
}
button:hover:not(:disabled) {
  background: #fcf4df;
  border-color: #6e7766;
}
button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #e7b04b;
  outline-offset: 3px;
}
button.primary {
  background: #344940;
  border-color: #344940;
  color: #faf3de;
  font-weight: 700;
  padding: 10px 15px;
}
.chosen,
button[aria-pressed="true"] {
  outline: 2px solid #917031;
  background: #f1dfa8;
}
.eyebrow {
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.8px;
}
h1,
h2,
h3,
p {
  margin: 0 0 10px;
}
h2 {
  font-family: "Arial Narrow", "Avenir Next Condensed", sans-serif;
  font-size: 22px;
  line-height: 1.15;
}
h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 16px;
}
small {
  font-size: 11px;
  color: var(--muted);
}
.game-header {
  height: 94px;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 3px double #8b927e;
}
.wordmark {
  min-width: 194px;
}
.wordmark h1 {
  font-family: Georgia, serif;
  letter-spacing: 1.3px;
  font-size: 21px;
  margin: 0;
}
.wordmark small {
  font-size: 9px;
  letter-spacing: 3px;
}
.wordmark .eyebrow {
  font-size: 8px;
  color: #636b5f;
}
.turn-block {
  display: flex;
  align-items: center;
  gap: 13px;
  flex: 1;
}
.turn-block h2 {
  margin: 4px 0 0;
  font-size: 25px;
}
.nation-emblem {
  display: grid;
  place-items: center;
  width: 47px;
  height: 50px;
  background: var(--nation);
  color: #fff7de;
  clip-path: polygon(0 0, 100% 0, 100% 75%, 50% 100%, 0 75%);
  font: bold 18px Georgia;
}
.treasury {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0 8px;
  align-items: center;
}
.treasury strong {
  grid-row: span 2;
  font-size: 35px;
  font-family: Georgia, serif;
}
.treasury span {
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 1px;
}
.progression {
  max-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.progression small {
  font-size: 10px;
  line-height: 1.2;
  max-height: 25px;
  overflow: auto;
}
.nation-bar {
  height: 44px;
  display: flex;
  background: #253c3c;
  padding: 0 20px;
  gap: 0;
  border-bottom: 1px solid #7e917e;
}
.nation-status {
  border: 0;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
  background: transparent;
  color: #e0e6d7;
  font-size: 11px;
  position: relative;
}
.nation-status:hover:not(:disabled) {
  background: #3a5150;
  color: white;
}
.nation-status.active:after {
  content: "";
  position: absolute;
  bottom: 0;
  height: 3px;
  left: 10%;
  right: 10%;
  background: var(--nation);
}
.nation-status small {
  font-size: 8px;
  color: #b7c1b2;
}
.nation-status b {
  font-size: 11px;
}
.nation-code {
  border: 1px solid var(--nation);
  background: var(--nation);
  color: white;
  padding: 2px 4px;
  font-size: 9px;
}
.board-host {
  height: calc(100dvh - 176px);
  min-height: 420px;
  position: relative;
  overflow: hidden;
  background: var(--ocean);
}
.world-map {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
.world-map:active {
  cursor: grabbing;
}
.region {
  vector-effect: non-scaling-stroke;
  transition:
    fill 0.2s,
    stroke 0.15s;
  cursor: pointer;
}
.region.land {
  stroke: #3b4a43;
  stroke-width: 1.15;
  fill-opacity: 0.94;
}
.region.sea {
  stroke: #b1c8c2;
  stroke-width: 0.6;
  stroke-opacity: 0.45;
  stroke-dasharray: 6 4;
}
.region:hover {
  filter: brightness(1.12);
  stroke: #ede5cb;
  stroke-width: 2;
}
.region.selected {
  stroke: #f8df8e;
  stroke-width: 3;
  filter: brightness(1.12);
}
.region.legal {
  stroke: var(--move);
  stroke-width: 3;
  stroke-dasharray: 3 3;
}
.region.combat-route,
.region.attack {
  stroke: var(--attack);
  stroke-dasharray: 8 3;
}
.region.placement,
.region.landing {
  stroke: #c1e5e0;
  stroke-width: 4;
}
.region.emphasis {
  stroke: #f2d382;
  stroke-width: 3;
}
.map-labels,
.route-layer,
.connection-layer {
  pointer-events: none;
}
.map-labels text {
  font-family: "Arial Narrow", "Avenir Next Condensed", sans-serif;
  font-size: 9px;
  font-weight: 650;
  fill: #1c2a27;
  paint-order: stroke;
  stroke: #dfd8bf;
  stroke-width: 1px;
  stroke-opacity: 0.4;
  letter-spacing: 0.15px;
}
.map-labels .sea text {
  fill: #e1e6d8;
  font: bold 13px Georgia;
  stroke: #385b65;
  stroke-width: 2px;
}
.map-labels .map-value {
  font-size: 7px;
  font-weight: 500;
}
.map-labels .strategic-marker {
  font-size: 12px;
  fill: #fff0b4;
  stroke: #334b45;
  stroke-width: 2px;
}
.world-map[data-detail="far"] .map-value {
  display: none;
}
.world-map[data-detail="close"] .map-labels text {
  font-size: 10px;
}
.unit-stack {
  cursor: pointer;
  filter: drop-shadow(0 1.5px 1px #1d2e3060);
}
.unit-stack:hover .piece-base,
.unit-stack:focus .piece-base {
  stroke: #f3da88;
  stroke-width: 2;
}
.piece-base {
  stroke: #39443b;
  stroke-width: 0.7;
}
.unit-stack.chosen .piece-base {
  stroke: #fadd81;
  stroke-width: 2.5;
}
.stack-count {
  font:
    bold 9px "Arial",
    sans-serif;
  fill: #1b2925;
}
.damage-mark {
  fill: #9b3027;
  font: bold 12px Arial;
}
.cargo-mark {
  fill: #324a63;
  font: bold 9px Arial;
}
.more-stacks {
  font: bold 9px Arial;
  fill: #f9edcb;
  stroke: #294644;
  stroke-width: 2;
  paint-order: stroke;
  pointer-events: none;
}
.logical-link {
  stroke: #f0e4b3;
  stroke-width: 1;
  opacity: 0.55;
  fill: none;
}
.neighbor-dot {
  fill: #d9d7ad;
  stroke: #324c44;
  stroke-width: 1;
}
.route {
  fill: none;
  stroke: #dfe2c8;
  stroke-width: 2;
  opacity: 0.65;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.route.preview {
  stroke: #ffe195;
  stroke-width: 3;
  stroke-dasharray: 7 5;
  opacity: 1;
}
.route.amphibious {
  stroke: #b9ddea;
  stroke-dasharray: 3 3;
}
.battle-marker {
  cursor: pointer;
  filter: drop-shadow(0 2px 2px #23352d);
}
.battle-marker rect {
  fill: #8d4436;
  stroke: #ffdab1;
  stroke-width: 1.3;
}
.battle-marker text {
  fill: #fff5d6;
  font-size: 17px;
}
.battle-marker.active rect {
  stroke-width: 3;
}
.chart-caption {
  font: 9px Georgia;
  letter-spacing: 1.3px;
  fill: #d3d9c6;
}
.debug-id {
  font-size: 7px !important;
  fill: #ffec90 !important;
}
.board-tools {
  position: absolute;
  top: 14px;
  left: 18px;
  right: 18px;
  display: flex;
  gap: 5px;
  pointer-events: none;
  z-index: var(--z-panel);
}
.board-tools > * {
  pointer-events: auto;
  box-shadow: 0 1px 5px #19353530;
}
.board-tools input {
  width: 230px;
  background: #f2ecdde8;
}
.board-tools button,
.board-tools select {
  background: #f2ecdde8;
  font-size: 11px;
}
.context-panel {
  position: absolute;
  right: 18px;
  top: 64px;
  bottom: 18px;
  width: 318px;
  padding: 17px;
  background: linear-gradient(120deg, #f3ecdbee, #e8e0cefa);
  border: 1px solid #b8b398;
  box-shadow: var(--shadow);
  border-radius: 5px;
  overflow: auto;
  z-index: var(--z-panel);
  scrollbar-width: thin;
  backdrop-filter: blur(8px);
}
.context-panel[hidden] {
  display: none;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 9px;
  border-bottom: 1px solid #bfb69d;
  padding-bottom: 7px;
}
.panel-heading button {
  border: 0;
  padding: 0 5px;
  background: none;
  font-size: 20px;
}
.hint {
  font-size: 12px;
  color: var(--muted);
}
.location-facts {
  font-size: 11px;
}
.selection-tools {
  display: flex;
  gap: 5px;
  margin: 10px 0;
}
.selection-tools button {
  font-size: 11px;
}
.stack-details {
  margin-top: 7px;
  border-bottom: 1px solid #cbc2a9;
  padding-bottom: 7px;
}
.stack-details summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 650;
}
.stack-details summary:before {
  content: "▸";
}
.stack-details[open] summary:before {
  content: "▾";
}
.unit-piece {
  flex-shrink: 0;
  filter: drop-shadow(0 2px 1px #43483935);
}
.unit-card {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 7px;
  margin: 5px 0;
  border: 1px solid #c4bda8;
  background: #eae3d0;
  border-radius: 4px;
  text-align: left;
}
.unit-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.unit-copy strong {
  font-size: 12px;
}
.unit-copy small {
  font-size: 10px;
  overflow-wrap: anywhere;
}
.select-type {
  font-size: 10px;
  margin: 7px 0;
}
.neighbor-list {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.neighbor-list button {
  font-size: 10px;
  padding: 4px;
}
.facility,
.capacity-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  background: #dcd7c3;
  padding: 7px;
  margin: 7px 0;
}
.transport-box {
  border: 1px solid #afac96;
  padding: 9px;
  margin: 8px 0;
  font-size: 12px;
}
.transport-box summary {
  font-weight: 700;
}
.cargo-chain {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
}
.force-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.force-summary span {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}
.landing-alert,
.decision-banner {
  padding: 10px;
  background: #e5d6ab;
  border-left: 3px solid #997438;
  margin: 12px 0;
  font-size: 12px;
}
.decision-banner {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-top: 12px;
}
summary {
  cursor: pointer;
}
details {
  margin-top: 12px;
}
details button {
  margin: 4px 3px 0 0;
}
.route-summary {
  font-size: 17px;
  font-family: Georgia, serif;
  line-height: 1.5;
  padding: 12px 0;
}
.confirmation-row {
  display: flex;
  gap: 7px;
  margin-top: 16px;
}
.purchase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.purchase-card {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 9px;
  border: 1px solid #c2b9a2;
  border-radius: 3px;
  background: linear-gradient(145deg, #f2ead7, #ddd6c0);
  gap: 3px;
  align-items: center;
}
.purchase-card svg {
  grid-column: span 2;
}
.purchase-card strong {
  font-size: 11px;
  grid-column: span 2;
}
.purchase-card small {
  font-size: 9px;
  grid-column: span 2;
  letter-spacing: 0.3px;
}
.purchase-card .price {
  font-size: 10px;
}
.purchase-card input {
  width: 49px;
  padding: 3px;
  background: #f8f1df;
}
.purchase-total {
  position: sticky;
  bottom: -17px;
  background: #e8dfc9;
  padding: 12px 0;
  font-weight: 700;
  font-size: 12px;
  z-index: 1;
}
.purchase-grid + .purchase-total + button {
  width: 100%;
}
.income-total {
  font: bold 40px Georgia;
  color: #3b5541;
  margin: 25px 0;
}
.ledger-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px;
}
.battle-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.battle-nav button {
  font-size: 11px;
}
.battle-forces {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.battle-forces .unit-card {
  flex-direction: column;
  align-items: flex-start;
  padding: 6px;
}
.battle-forces h3 {
  font-size: 11px;
}
.battle-forces .unit-copy strong {
  font-size: 10px;
}
.dice-tray {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 8px;
  background: #dcd3bb;
  border-radius: 3px;
}
.die-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 49px;
}
.die {
  font-size: 35px;
  line-height: 1;
  color: #f7f0dc;
  text-shadow: 0 1px 2px #354035;
}
.die-result.hit .die {
  color: #364f3f;
  text-shadow: 0 1px 1px #fff;
}
.die-result small {
  font-size: 8px;
}
.die-result b {
  font-size: 8px;
  color: #6b6d5f;
}
.die-result.hit b {
  color: #2f593c;
}
.decision-piece {
  display: flex;
  align-items: center;
  gap: 8px;
}
.battle-outcome,
.victory-banner {
  padding: 14px;
  background: #dcd8b8;
  border: 1px solid #929c7e;
}
.board-footer {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: #263c3b;
  color: #e1e1c9;
  font-size: 11px;
}
.board-footer button {
  background: none;
  color: #e1e1c9;
  border: 0;
  padding: 3px 7px;
  font-size: 10px;
}
.selection-breadcrumb {
  flex: 1;
}
.notifications {
  position: fixed;
  bottom: 51px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: var(--z-notice);
  max-width: 400px;
}
.toast {
  background: #ede4ce;
  box-shadow: var(--shadow);
  text-align: left;
  font-size: 12px;
  border-left: 4px solid #9c8450;
}
.map-tooltip {
  position: fixed;
  z-index: var(--z-tooltip);
  width: 280px;
  padding: 12px;
  background: #f4efdf;
  color: #273b32;
  box-shadow: var(--shadow);
  border: 1px solid #b7b197;
  font-size: 11px;
  pointer-events: none;
}
.map-tooltip strong {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
}
#message {
  position: absolute;
  bottom: 15px;
  left: 20px;
  right: 355px;
  padding: 12px;
  background: #f0d7c7;
  color: #743e32;
  border-left: 4px solid #9e5443;
  z-index: var(--z-notice);
  font-size: 12px;
}
#message:empty {
  display: none;
}
.command-dialog {
  width: min(760px, 90vw);
  max-height: 85dvh;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid #9c9f89;
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 24px;
}
.command-dialog::backdrop {
  background: #13292980;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.dialog-heading button {
  border: 0;
  background: none;
  font-size: 22px;
  padding: 0 8px;
}
.setup-body > select {
  width: 100%;
}
.setup-powers {
  display: grid;
  gap: 8px;
  margin: 20px 0;
}
.setup-powers label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #c9c1ad;
}
.setup-powers span {
  font-weight: bold;
}
.setup-body > button {
  margin-right: 8px;
}
.legend i {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 0 9px -3px 0;
  border: 1px solid #415747;
}
.legend p {
  margin-top: 15px;
}
.unit-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.unit-gallery > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
}
.history-list {
  max-height: 55vh;
  overflow: auto;
}
.history-list summary {
  font-size: 12px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
  max-height: 60vh;
  overflow: auto;
}
textarea {
  width: 100%;
  min-height: 160px;
}
.world-map[data-overlay="economy"] .map-value {
  display: block;
  font-size: 11px;
}
.world-map[data-overlay="production"] .strategic-marker,
.world-map[data-overlay="victory"] .strategic-marker {
  font-size: 17px;
}
@media (min-width: 1800px) {
  .context-panel {
    width: 340px;
  }
  .game-header {
    padding-inline: 32px;
  }
  .board-tools {
    left: 26px;
    right: 26px;
  }
}
@media (max-width: 1150px) {
  .game-header {
    gap: 16px;
    padding-inline: 14px;
  }
  .wordmark {
    min-width: 150px;
  }
  .wordmark h1 {
    font-size: 17px;
  }
  .turn-block h2 {
    font-size: 20px;
  }
  .nation-status {
    gap: 7px;
  }
  .nation-status small {
    display: none;
  }
  .board-tools input {
    width: 180px;
  }
  .board-tools {
    right: 10px;
    left: 10px;
  }
  .context-panel {
    right: 10px;
    width: 290px;
  }
  .treasury strong {
    font-size: 29px;
  }
  .progression {
    max-width: 190px;
  }
  .board-tools button {
    padding: 7px;
  }
  .board-footer {
    gap: 3px;
  }
}
@media (max-width: 850px) {
  .wordmark {
    display: none;
  }
  .nation-status > span:not(.nation-code) {
    display: none;
  }
  .nation-status {
    gap: 10px;
  }
  .context-panel {
    width: 280px;
    max-height: 70vh;
  }
  .board-tools input {
    width: 150px;
  }
  .board-tools select {
    display: none;
  }
  .board-footer .selection-breadcrumb {
    max-width: 210px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .game-header {
    height: 90px;
  }
  .nation-bar {
    height: 40px;
  }
  .board-host {
    height: calc(100dvh - 168px);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.location-index {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 60vh;
  overflow: auto;
  margin-top: 15px;
}
.location-index button {
  text-align: left;
  font-size: 12px;
}
.orders-visible .world-map {
  width: calc(100% - 345px);
}
.orders-visible .board-tools {
  right: 350px;
  flex-wrap: wrap;
}
.world-map {
  background-image: radial-gradient(
    ellipse at 50% 30%,
    #88a09310,
    transparent 70%
  );
}
@media (min-width: 1800px) {
  .orders-visible .world-map {
    width: calc(100% - 370px);
  }
}
@media (max-width: 1150px) {
  .orders-visible .world-map {
    width: calc(100% - 305px);
  }
  .orders-visible .board-tools {
    right: 315px;
  }
  .board-tools input {
    width: 160px;
  }
}
@media (max-width: 850px) {
  .orders-visible .world-map {
    width: 100%;
  }
  .orders-visible .board-tools {
    right: 10px;
  }
  .context-panel {
    top: 105px;
    bottom: 12px;
  }
  .location-index {
    grid-template-columns: 1fr;
  }
}
.location-label {
  pointer-events: auto;
  cursor: pointer;
}
.strategic-symbols {
  pointer-events: none;
}
.strategic-icon {
  fill: #eee1ad;
  stroke: #384c3b;
  stroke-width: 1.4;
  fill-rule: evenodd;
}
.factory-icon {
  fill: #ede4c8;
  stroke: #35493b;
  stroke-width: 1.4;
}
.chart-decoration text {
  fill: #d4dac6;
  opacity: 0.22;
  font: italic 18px Georgia;
  letter-spacing: 5px;
}
.region.impassable {
  fill: #adaf9e;
  fill-opacity: 0.9;
  stroke-dasharray: 2 2;
}
.world-map[data-overlay="production"] .factory-icon {
  fill: #ffe48c;
  stroke-width: 2;
}
.world-map[data-overlay="victory"] .strategic-icon {
  fill: #ffe48c;
  stroke-width: 2;
}
.stack-nation {
  font: bold 5.5px Arial;
  fill: #334039;
  pointer-events: none;
}
.unit-stack .damage-mark {
  transform: translate(0, -14px);
}
.unit-stack .cargo-mark {
  transform: translate(0, -14px);
}
.more-stacks {
  pointer-events: auto;
  cursor: pointer;
}
.route.hover-route {
  stroke: #efe5b8;
  stroke-width: 2;
  stroke-dasharray: 2 5;
  opacity: 0.85;
}
.setup-body .eyebrow {
  display: block;
  font-size: 12px;
  margin: 15px 0;
}
.setup-body > p {
  font:
    22px Georgia,
    serif;
  line-height: 1.4;
  margin-bottom: 22px;
}
button.primary:hover:not(:disabled) {
  background: #233b31;
  color: #fff5d9;
  border-color: #233b31;
}
.map-labels text {
  stroke: #eee5ce;
  stroke-opacity: 0.85;
  stroke-width: 1.4;
  fill: #192823;
}
.map-labels .sea text {
  fill: #eef0df;
  stroke: #385b65;
  stroke-opacity: 1;
  stroke-width: 2;
}
