:root {
  color-scheme: light;
  --ink: #1f2b2e;
  --muted: #657275;
  --paper: #f6f0e3;
  --panel: #fffaf0;
  --line: #d5c5a9;
  --land: #d8c08d;
  --land-2: #c3a66d;
  --healthy: #9aae78;
  --exposed: #d9a441;
  --infected: #b94b3f;
  --quarantined: #5d6f7f;
  --closed: #292f33;
  --focus: #135f72;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(194, 111, 65, 0.18), transparent 34rem),
    linear-gradient(135deg, #efe3cb 0%, #f8f2e6 58%, #d8e5e4 100%);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

button {
  min-height: 44px;
  border: 1px solid #a99368;
  border-radius: 6px;
  background: #f8edd7;
  color: var(--ink);
  cursor: pointer;
  font: 700 0.95rem/1.1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #755d36;
  background: #fff7e8;
}

button:focus-visible,
.region:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.primary {
  border-color: #193b42;
  background: #1d5c69;
  color: white;
}

.primary:hover:not(:disabled) {
  background: #164d58;
}

.game-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 34px;
}

.masthead {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #6f4f2d;
  font: 700 0.75rem/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(3rem, 8vw, 6.4rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.lede {
  max-width: 760px;
  margin-bottom: 0;
  color: #405052;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.45;
}

.round-panel {
  display: grid;
  place-items: center;
  width: 112px;
  aspect-ratio: 1;
  border: 2px solid #876c3e;
  background: rgba(255, 250, 240, 0.8);
  box-shadow: 0 12px 30px rgba(51, 39, 22, 0.14);
}

.round-label {
  align-self: end;
  font: 700 0.8rem/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
}

.round-panel strong {
  align-self: start;
  font-size: 3rem;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.year-fact {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid #b08d55;
  border-radius: 8px;
  background: #233f45;
  color: #fff8e8;
  padding: 12px 16px;
  box-shadow: 0 16px 40px rgba(35, 63, 69, 0.18);
}

.year-fact span {
  display: grid;
  place-items: center;
  min-width: 70px;
  min-height: 42px;
  border: 1px solid rgba(255, 248, 232, 0.44);
  border-radius: 6px;
  font: 800 1rem/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.year-fact p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.78);
  padding: 12px 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font: 700 0.73rem/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 1.55rem;
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: stretch;
}

.map-wrap,
.command-panel,
.guide {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.82);
  box-shadow: 0 20px 60px rgba(48, 34, 18, 0.14);
}

.map-wrap {
  min-height: 620px;
  overflow: hidden;
}

#colony-map {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 620px;
}

.ocean {
  fill: url(#sea);
}

.coastline {
  fill: #efe1bc;
  filter: url(#soft-shadow);
  opacity: 0.88;
}

#routes path {
  fill: none;
  stroke: rgba(43, 54, 48, 0.4);
  stroke-dasharray: 8 8;
  stroke-linecap: round;
  stroke-width: 5;
}

#routes path.closed {
  stroke: var(--closed);
  stroke-dasharray: 2 10;
  stroke-width: 7;
}

.region {
  fill: var(--healthy);
  stroke: #5f563d;
  stroke-width: 3;
  cursor: pointer;
  transition: fill 160ms ease, transform 160ms ease, filter 160ms ease;
}

.region:hover {
  filter: brightness(1.06);
}

.region.selected {
  stroke: #132d35;
  stroke-width: 6;
}

.region.exposed {
  fill: var(--exposed);
}

.region.infected {
  fill: var(--infected);
}

.region.quarantined {
  fill: var(--quarantined);
}

.region-label {
  pointer-events: none;
  fill: #1d292b;
  font: 700 18px/1.1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-anchor: middle;
}

.port {
  fill: #f3e6c7;
  stroke: #143a42;
  stroke-width: 3;
}

.port.closed {
  fill: #263236;
  stroke: #f3e6c7;
}

.command-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.selected-region {
  min-height: 150px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.selected-region span {
  display: block;
  color: var(--muted);
  font: 700 0.75rem/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
}

.selected-region strong {
  display: block;
  margin: 7px 0;
  font-size: 1.8rem;
}

.selected-region p {
  margin-bottom: 0;
  color: #4e5f62;
  line-height: 1.45;
}

.actions,
.turn-actions {
  display: grid;
  gap: 9px;
}

.log {
  min-height: 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.log h2,
.guide h2 {
  margin-bottom: 8px;
  font: 800 0.82rem/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
}

.log ol {
  display: grid;
  gap: 8px;
  max-height: 250px;
  margin: 0;
  overflow: auto;
  padding: 0 0 0 20px;
  color: #415154;
  line-height: 1.35;
}

.guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
  padding: 16px;
}

.guide p {
  margin-bottom: 0;
  color: #4d5d60;
  line-height: 1.45;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(22, 31, 33, 0.56);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: min(440px, 100%);
  border: 1px solid #c8b58d;
  border-radius: 8px;
  background: var(--panel);
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.modal-card h2 {
  margin-bottom: 10px;
  font-size: 2rem;
}

.modal-card p {
  color: #3d4d50;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .masthead,
  .board-layout,
  .guide {
    grid-template-columns: 1fr;
  }

  .round-panel {
    width: 92px;
    justify-self: start;
  }

  .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-wrap,
  #colony-map {
    min-height: 520px;
  }
}

@media (max-width: 560px) {
  .game-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

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

  .year-fact {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .year-fact span {
    place-self: start;
  }

  .metric {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }

  .map-wrap,
  #colony-map {
    min-height: 430px;
  }
}
