:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1c2126;
  background: #eef1f2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  min-height: 100vh;
}

.board-pane {
  min-width: 0;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 700;
}

h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5c6670;
}

#phaseLabel {
  margin-top: 3px;
  color: #65717c;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #cbd3d8;
  border-radius: 6px;
  background: #ffffff;
  color: #2f3840;
}

.toggle input {
  accent-color: #2f6f7e;
}

.map-frame {
  min-height: calc(100vh - 84px);
  border: 1px solid #bdc8ce;
  border-radius: 8px;
  overflow: hidden;
  background: #a8ccd7;
}

#board {
  display: block;
  width: 100%;
  height: calc(100vh - 84px);
  min-height: 560px;
}

.map-water {
  fill: #a8ccd7;
}

.adjacency line {
  stroke: rgba(44, 57, 67, 0.24);
  stroke-width: 1.1;
}

.province {
  cursor: pointer;
}

.province-body {
  stroke: rgba(33, 39, 45, 0.72);
  stroke-width: 1.4;
}

.province.sea .province-body {
  stroke: rgba(30, 74, 88, 0.48);
}

.province.selected .province-body {
  stroke: #101820;
  stroke-width: 3;
}

.supply-center {
  fill: #fbf8ef;
  stroke: #30353a;
  stroke-width: 1.2;
}

.province-label {
  fill: #20272d;
  font-size: 11px;
  font-weight: 800;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.78);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.hide-labels .province-label {
  display: none;
}

.unit-body {
  stroke: #111820;
  stroke-width: 1.4;
}

.unit-label {
  fill: #ffffff;
  font-size: 11px;
  font-weight: 800;
  text-anchor: middle;
  pointer-events: none;
}

.side-pane {
  border-left: 1px solid #cbd3d8;
  background: #f8f9f8;
  padding: 18px;
}

.panel + .panel {
  margin-top: 24px;
}

.selection {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.selected-title {
  font-size: 20px;
  font-weight: 700;
}

.meta-row,
.unit-row {
  color: #34404a;
  line-height: 1.35;
}

.unit-row,
.power-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.swatch {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, 0.24);
  border-radius: 50%;
  flex: 0 0 auto;
}

.power-list {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}

.power-row {
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid #d8dee1;
  border-radius: 6px;
  background: #ffffff;
  color: #1f282f;
  text-align: left;
}

.power-name {
  flex: 1;
}

.power-count {
  color: #596670;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 840px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-pane {
    border-left: 0;
    border-top: 1px solid #cbd3d8;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-frame,
  #board {
    min-height: 470px;
    height: 62vh;
  }
}
