:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #293f36;
  background: #f4f1e8;
  font-synthesis: none;
  --muted: #687369;
  --green: #294b3d;
  --line: #dedfd1;
  --gold: #ae8547;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.65;
}
[hidden] {
  display: none !important;
}
a {
  color: inherit;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #ad894d;
  outline-offset: 4px;
}
.masthead {
  max-width: 1320px;
  margin: auto;
  padding: 32px 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  text-decoration: none;
  font-family: Georgia, serif;
  font-size: 21px;
  font-weight: bold;
  letter-spacing: 2px;
}
.brand small {
  display: block;
  margin-top: 6px;
  font-family: Arial, sans-serif;
  font-size: 8px;
  letter-spacing: 2.1px;
  color: var(--muted);
}
.edition {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
}
.wiki-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid #b08b49; border-radius: 7px; background: #ecd29a; color: #283e33; font-size: 13px; font-weight: bold; text-decoration: none; white-space: nowrap; box-shadow: 0 2px 0 #b08b4930; }
.wiki-link svg { flex: none; }
.wiki-link:hover { background: #e6c17c; border-color: #8e6b32; }
.account-wiki { width: 100%; justify-content: center; margin-top: 14px; }
.edition span {
  color: var(--gold);
  margin-left: 17px;
  font-size: 17px;
}
main {
  max-width: 1200px;
  min-height: calc(100vh - 191px);
  margin: auto;
  padding: 45px 40px 55px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 74px;
  align-items: center;
}
.eyebrow {
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #788270;
  display: flex;
  gap: 10px;
  align-items: center;
}
.eyebrow > span {
  width: 23px;
  height: 1px;
  background: var(--gold);
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 4vw, 55px);
  line-height: 1.14;
  font-weight: normal;
  letter-spacing: -1.8px;
  margin: 23px 0;
}
h1 em {
  font-weight: normal;
  color: #6c8261;
}
.intro {
  font-size: 15px;
  line-height: 1.85;
  color: var(--muted);
}
.landscape {
  margin: 18px -25px 0;
  text-align: center;
}
.landscape svg {
  width: 100%;
  max-height: 320px;
}
.landscape-caption {
  font-size: 8px;
  letter-spacing: 2.5px;
  color: #7b8774;
}
.world-notes {
  display: flex;
  justify-content: center;
  gap: 43px;
  margin-top: 30px;
}
.world-notes span {
  font-size: 11px;
  line-height: 1.9;
  color: var(--muted);
}
.world-notes span + span {
  border-left: 1px solid var(--line);
  padding-left: 43px;
}
.world-notes b {
  display: block;
  color: #455747;
  font-weight: normal;
  font-family: Georgia, serif;
  font-size: 16px;
}
.account-card {
  padding: 32px 34px;
  background: #fffcf5;
  border: 1px solid #dfdfcf;
  border-radius: 13px;
  box-shadow: 0 12px 35px #3e4c2f08;
  min-width: 0;
}
.mode-switch {
  padding: 4px;
  background: #eeeee4;
  border-radius: 7px;
  display: flex;
  margin-bottom: 35px;
  gap: 4px;
}
.mode-switch button {
  border: 0;
  background: transparent;
  flex: 1;
  padding: 11px 5px;
  border-radius: 5px;
  color: #71796c;
  font-size: 12px;
  font-weight: bold;
}
.mode-switch button[aria-pressed="true"] {
  background: #fffcf5;
  color: #294b3d;
  box-shadow: 0 1px 4px #2c392015;
}
.card-eyebrow {
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 1.6px;
}
h2 {
  font:
    normal 29px/1.2 Georgia,
    serif;
  letter-spacing: -0.6px;
  margin: 14px 0 10px;
}
.card-description {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 26px;
}
label {
  display: block;
  font-size: 12px;
  font-weight: bold;
  margin: 20px 0 9px;
}
input {
  display: block;
  width: 100%;
  border: 1px solid #d8dcce;
  border-radius: 5px;
  background: #fffef9;
  color: #293f36;
  height: 44px;
  padding: 0 12px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input::placeholder {
  color: #929a8b;
  font-size: 12px;
}
input:focus {
  outline: none;
  border-color: #6d896e;
  box-shadow: 0 0 0 3px #6d896e20;
}
input[aria-invalid="true"] {
  border-color: #a84435;
}
small {
  display: block;
  font-size: 10px;
  color: #79806f;
  line-height: 1.5;
  margin-top: 8px;
}
.password-input {
  position: relative;
}
.password-input input {
  padding-right: 59px;
}
.password-input button {
  position: absolute;
  right: 3px;
  top: 3px;
  height: 38px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  font-size: 10px;
  color: #57694e;
}
.primary,
.secondary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 15px 17px;
  margin-top: 27px;
  border: 1px solid var(--green);
  border-radius: 5px;
  background: var(--green);
  color: #fffdf5;
  font-size: 12px;
  font-weight: bold;
  transition:
    background 0.15s,
    transform 0.15s;
}
.primary:hover {
  background: #38604e;
}
.primary:active {
  transform: translateY(1px);
}
.primary span {
  font-size: 18px;
  line-height: 10px;
  color: #d1c598;
}
.account-note {
  border-top: 1px solid #e8e6da;
  margin: 24px 0 0;
  padding-top: 20px;
  text-align: center;
  color: #7a806f;
  font-size: 10px;
  line-height: 1.85;
}
.error {
  color: #923b2d;
  font-size: 12px;
  line-height: 1.6;
  background: #fbede5;
  padding: 10px 12px;
  border-radius: 5px;
}
.welcome-crest {
  color: var(--gold);
  font-size: 40px;
  margin-bottom: 30px;
}
.account-summary {
  padding: 22px;
  background: #edf1e6;
  border: 1px solid #dce4d4;
  border-radius: 6px;
  margin-top: 25px;
}
.account-summary > span,
.next-chapter > span {
  font-size: 9px;
  letter-spacing: 2px;
  color: #73816b;
}
.account-summary strong {
  display: block;
  margin-top: 12px;
  font:
    20px Georgia,
    serif;
}
.account-summary p,
.next-chapter p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}
.next-chapter {
  margin: 30px 0;
}
h3 {
  font:
    22px Georgia,
    serif;
  margin: 10px 0;
}
.secondary {
  justify-content: center;
  background: transparent;
  color: var(--green);
}
.secondary:hover {
  background: #eef1e6;
}
footer {
  max-width: 1200px;
  padding: 20px 40px 26px;
  margin: auto;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: #88907e;
  font-size: 10px;
}
footer > span + span {
  font-size: 8px;
  letter-spacing: 1.8px;
}
footer span span {
  padding: 0 10px;
  color: var(--gold);
}
.lanterns {
  animation: glow 4s ease-in-out infinite;
}
@keyframes glow {
  50% {
    opacity: 0.55;
  }
}
.colony-stats {
  display: flex;
  gap: 40px;
  padding: 24px;
  margin: 25px 0;
  background: #edf1e6;
  border: 1px solid #dce4d4;
  border-radius: 6px;
}
.colony-stats strong { display: block; font: 30px Georgia, serif; }
.colony-stats span { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.territory-list { list-style: none; padding: 0; margin: 15px 0 25px; }
.territory-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.territory-list strong { font: 17px Georgia, serif; }
.territory-list span { color: var(--muted); font-size: 12px; }
#account-actions .secondary { margin-top: 14px; }
.world-screen {
  max-width: none;
  min-height: calc(100vh - 185px);
  margin: auto;
  padding: 15px 40px 40px;
}
.world-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
}
.world-heading h1 { margin: 12px 0 0; font-size: 40px; }
.world-heading-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.world-heading-actions .secondary { width: auto; margin: 0; padding: 11px 15px; white-space: nowrap; }
.world-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.map-card { --water-color: #6e8fb8; background: #efeadd; border: 1px solid #cbd7cd; border-radius: 10px; overflow: hidden; }
#map-viewport { height: clamp(360px, 65vh, 850px); overflow: hidden; touch-action: none; user-select: none; cursor: grab; background: var(--water-color); }
#map-viewport:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.map-controls { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 6px; z-index: 2; }
.map-controls button { width: 44px; height: 44px; border: 1px solid #627560; border-radius: 8px; background: #fff8e5; color: #304536; font-size: 26px; touch-action: manipulation; }
.connection-status { padding: 10px 14px; background: #fff1bd; color: #543e25; border-radius: 8px; }
#map-viewport.is-dragging, #map-viewport.is-dragging .map-region, #map-viewport.is-dragging .map-object { cursor: grabbing; }
#world-map { display: block; width: 100%; height: 100%; }
.map-region.blizzard-active .region-border { fill: #e8f7ffaa; }
.blizzard-label { text-anchor: middle; font: bold 11px Arial, sans-serif; fill: #244f70; stroke: #f4fcff; stroke-width: 3px; paint-order: stroke; pointer-events: none; }
.map-region.blight-active .region-border { fill: #8c4b3230; }
.blight-label { text-anchor: middle; font: bold 11px Arial, sans-serif; fill: #783a24; stroke: #fff0cf; stroke-width: 3px; paint-order: stroke; pointer-events: none; }
.blighted-farm .building-figure { opacity: .45; filter: grayscale(1); }
.blight-farm-status { pointer-events: none; }
.map-geography text { text-anchor: middle; font-size: 11px; letter-spacing: 4px; fill: #849887; }
.map-geography .sea-name, .sea-name { text-anchor: middle; font: italic 20px Georgia, serif; letter-spacing: 2px; fill: #41676a; stroke: none; }
.lake-water { fill: var(--water-color); stroke: #f9f6e9; stroke-width: 2.5; stroke-dasharray: none; }
.water-ripples { fill: none; stroke: #83a59a; stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: none; opacity: .3; }
.sea-routes { fill: none; pointer-events: none; }
.sea-routes path { vector-effect: non-scaling-stroke; stroke-dasharray: 5 5; stroke-linecap: round; }
.sea-route-outline { stroke: #34546d; stroke-width: 3.5; }
.sea-route-line { stroke: #fff0c9; stroke-width: 1.8; }
.map-region { cursor: pointer; outline: none; }
.region-border { stroke: #f3edd6; stroke-width: 1.8; stroke-linejoin: round; transition: fill .15s, stroke .15s; pointer-events: all; }
.biome-fertile-plains { --terrain-color: #ded5aa; }
.biome-wooded-valley { --terrain-color: #bdccb0; }
.biome-mountain-pass { --terrain-color: #cec0a7; }
.biome-barren-peaks { --terrain-color: #c4d1d5; }
.region-border { fill: transparent; }
.region-outline { fill: none; stroke-width: 4; stroke-linejoin: round; pointer-events: none; }
.region-outline.move-target { stroke: #f9d67d; stroke-dasharray: 5 3; }
.region-outline.attack-target { stroke: #da795d; }
.region-outline.selected { stroke: #b4863c; stroke-dasharray: none; }
.region-outline.focused { stroke: #253e31; stroke-dasharray: 5 3; }
.owner-banner { cursor: help; outline: none; }
.banner-pole { fill: none; stroke: #5d523a; stroke-width: 2.5; stroke-linecap: round; }
.banner-cloth { fill: var(--player-color); stroke: #fff7df; stroke-width: 1.5; stroke-linejoin: round; }
.owner-banner:hover .banner-cloth, .owner-banner:focus-visible .banner-cloth { stroke: #b4863c; stroke-width: 2.5; }
.region-label { fill: #293e31; stroke: #f3eddb; stroke-width: 3px; stroke-opacity: .8; paint-order: stroke; font: 18px Georgia, serif; text-anchor: middle; pointer-events: none; }
#region-slots { display: grid; gap: 7px; list-style: none; padding: 0; margin: 0 0 18px; }
.building-slot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; border: 1px dashed #b9c6b1; border-radius: 5px; font-size: 12px; }
.building-slot.built { border-style: solid; background: #eef1e5; }
.building-slot button { padding: 0; border: 0; background: transparent; color: var(--green); font: inherit; text-decoration: underline; }
.building-slot small { color: var(--muted); font-size: 10px; }
.building-slot { flex-wrap: wrap; }
.building-slot .build-button { width: 100%; padding: 8px; border: 1px solid #91a486; border-radius: 4px; background: #e8eedc; text-decoration: none; }
.building-slot.constructing { border-color: #b4863c; background: #faf0d5; }
.construction-scaffold { fill: none; stroke: #b4863c; stroke-width: 2; }
.under-construction .building-figure { opacity: .45; }
.empty-building-slot .building-figure { opacity: .7; filter: drop-shadow(0 0 1px #fff7df); }
.empty-building-slot:hover .building-figure,
.empty-building-slot:focus-visible .building-figure { opacity: .95; }
.building-actions { position: fixed; z-index: 20; width: 230px; max-height: min(300px, 60vh); overflow-y: auto; padding: 12px; border: 1px solid #a4b198; border-radius: 8px; background: #fffbee; box-shadow: 0 6px 24px #243c342b; color: var(--green); }
.building-actions header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.building-actions h3 { margin: 0; font: bold 15px Georgia, serif; }
.building-actions header button { border: 0; background: transparent; color: var(--green); padding: 2px 6px; font-size: 20px; cursor: pointer; }
.building-actions #region-slot-count, .building-actions .building-slot > span { display: none; }
.building-actions #region-slots { margin: 0; }
.building-actions .building-slot { border: 0; padding: 0; gap: 8px; }
.building-actions .map-hint { margin: 6px 0; font-size: 11px; }
.building-actions .fortress-production { margin: 8px 0 0; padding: 8px 0 0; border-bottom: 0; }
.building-actions .fortress-production p { margin: 5px 0; font-size: 11px; }
.building-actions .production-choice { margin-top: 7px; padding: 9px; gap: 8px; }
.building-actions .production-choice small { font-size: 10px; }
.destroy-building { width: 100%; margin-top: 10px; padding: 8px; border: 1px solid #b9806d; border-radius: 4px; background: #faeee1; color: #853f31; cursor: pointer; }
.destroy-building:disabled { opacity: .55; cursor: default; }
.building-actions #production-title { display: none; }
.building-actions #building-status, .building-actions #demolition-note { font-size: 10px; line-height: 1.4; margin: 4px 0; }
.building-actions #fortress-production { margin-top: 6px; padding-top: 0; border: 0; }
.building-actions .destroy-building { font-size: 12px; }
.under-demolition .building-figure { stroke: #b05a40; }
.demolition-progress .production-fill { fill: #db8c66; }
.dwarf-figure { stroke-linejoin: round; stroke-linecap: round; }
.dwarf-armor, .dwarf-helmet { fill: var(--player-color, #526d61); stroke: #33483e; stroke-width: 1.4; }
.dwarf-trim { fill: none; stroke: #ebd095; stroke-width: 1.6; }
.dwarf-face { fill: #edc19a; stroke: #9d7050; stroke-width: .7; }
.dwarf-beard { fill: #865332; stroke: #593c2a; stroke-width: 1; }
.dwarf-beard-detail { fill: none; stroke: #bd8753; stroke-width: 1; }
.dwarf-brows { fill: none; stroke: #593c2a; stroke-width: 1.5; }
.dwarf-count-badge { fill: #fff8e5; stroke: #627560; stroke-width: 1; }
.dwarf-count, .combat-multiplier-value { fill: #304536; font: bold 13px Arial, sans-serif; text-anchor: start; }
.region-button, .map-object { outline: none; }
.map-object { cursor: pointer; }
.object-outline { fill: transparent; stroke: transparent; stroke-width: 2; pointer-events: all; }
.map-object:hover .object-outline { fill: #ffffff20; stroke: #fff5d3; }
.map-object.selected .object-outline { fill: #fff1bd30; stroke: #ffdd87; stroke-width: 3; }
.map-object:focus-visible .object-outline { stroke: #253e31; stroke-width: 3; stroke-dasharray: 3 2; }
.building-figure { stroke: #4b5b4e; stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
.production-progress { pointer-events: none; }
.progress-meter, .progress-status { pointer-events: all; cursor: help; outline: none; }
.progress-hit-area { fill: transparent; }
.progress-activity-icon { fill: none; stroke: #294b3d; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.demolition-progress .progress-activity-icon { stroke: #a04b36; }
.progress-status rect { fill: #294b3d; stroke: #789280; stroke-width: 1; }
.progress-status text { text-anchor: middle; font: bold 10px Arial, sans-serif; fill: #fff8df; pointer-events: none; }
.progress-status path { fill: none; stroke: #fff8df; stroke-width: 1.5; stroke-linecap: round; pointer-events: none; }
.combat-charge-reduced rect { fill: #754936; }
.combat-tactical-limit rect { fill: #75602e; }
.food-limited .food-status path { stroke: #ffda82; }
.food-paused .food-status path { stroke: #ffb4a0; }
.progress-meter:hover .production-track, .progress-meter:focus-visible .production-track,
.progress-status:hover rect, .progress-status:focus-visible rect { stroke: #fff5d3; stroke-width: 2; }
.production-track { fill: #294b3d; stroke: #789280; stroke-width: 1; }
.production-fill { fill: #f1cf79; }
.progress-paused .production-fill { fill: #9ca99e; }
.fortress-production { margin: 22px 0; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fortress-production p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.fortress-production .production-note { font-size: 10px; margin-bottom: 0; }
#production-controls { margin: 0; padding: 0; border: 0; min-width: 0; }
.production-choice { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 13px; text-align: left; border: 1px solid #c9d3c1; border-radius: 6px; background: #f5f5eb; color: var(--green); }
.production-choice[aria-checked="true"] { border-color: #5c8067; background: #e6eddd; }
.production-choice strong { font-size: 13px; }
.production-choice small { margin-top: 4px; }
.production-choice-dot { width: 14px; height: 14px; flex-shrink: 0; border: 1px solid #859a7a; border-radius: 50%; }
.production-choice[aria-checked="true"] .production-choice-dot { border: 4px solid #52714b; background: #eef2de; }
.region-button:hover .region-border { fill: #fff7df18; }
.map-region.selected .region-border, .region-button:focus-visible .region-border { stroke: #b4863c; stroke-width: 4; }
.map-region.move-target .region-border { stroke: #f9d67d; stroke-width: 4; stroke-dasharray: 5 3; }
.choosing-destination .map-region:not(.move-target):not(.selected) { opacity: .4; }
.move-target-label { display: none; fill: #294b3d; stroke: #fff3d2; stroke-width: 2px; paint-order: stroke; font: bold 8px Arial, sans-serif; text-anchor: middle; pointer-events: none; }
.move-target .move-target-label { display: block; }
.map-region.attack-target .region-border { stroke: #da795d; }
.attack-target .move-target-label { fill: #882f24; }
.combat-marker { pointer-events: none; }
.combat-army { pointer-events: all; cursor: help; outline: none; }
.combat-army:hover .object-outline, .combat-army:focus-visible .object-outline { stroke: #fff5d3; }
.combat-marker > g[role="img"] { pointer-events: all; cursor: help; }
.combat-swords { animation: combat-bounce 1.2s ease-in-out infinite; }
.combat-multiplier-icon { fill: #fff8e5; stroke: #294b3d; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.combat-multiplier-badge { fill: #fff; }
.combat-multipliers > g { pointer-events: all; cursor: help; outline: none; }
.combat-multipliers > g:focus-visible .combat-multiplier-badge { stroke-width: 2; }
.combat-blades { fill: #fff2ce; stroke: #783b31; stroke-width: 1.7; stroke-linejoin: round; }
.combat-hilts { fill: none; stroke: #9b5137; stroke-width: 3; stroke-linecap: round; }
@keyframes combat-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.movement-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; font-size: 12px; line-height: 1.5; }
.movement-notice { margin-bottom: 16px; background: #e9f0df; border: 1px solid #b4c6a4; border-radius: 7px; color: #294b3d; }
.movement-notice button { border: 1px solid #b3c2a7; background: #fffaf0; color: #294b3d; border-radius: 4px; padding: 6px 10px; font-size: 11px; flex-shrink: 0; }
#defeat-prompt { flex-wrap: wrap; }
#defeat-prompt > div { flex: 1 1 280px; min-width: 0; }
#defeat-prompt p { margin: 4px 0 0; }
#restart-world { width: auto; margin: 0; justify-content: center; }
.gold-overview > strong { color: #916921; font: 32px Georgia, serif; }
.gold-overview a { color: var(--green); font-size: 12px; }
.map-stage { position: relative; }
.leaderboards { min-width: 0; margin: 0; background: #fffcf5; border: 1px solid #dfdfcf; border-radius: 8px; color: var(--green); }
.leaderboards > summary { padding: 12px 14px; font: bold 13px Georgia, serif; cursor: pointer; }
.leaderboard-lists { padding: 0 14px 12px; max-height: 220px; overflow-y: auto; overscroll-behavior: contain; }
.score-legend { display: flex; gap: 12px; }
.score-active { color: #41764b; }
.score-best { color: #916921; }
.leaderboards p { font-size: 10px; line-height: 1.5; color: var(--muted); margin: 6px 0; }
.leaderboards table { width: 100%; border-collapse: collapse; font-size: 11px; }
.leaderboards th, .leaderboards td { padding: 6px 3px; text-align: left; border-bottom: 1px solid #e2e5d7; overflow-wrap: anywhere; }
.leaderboards .player-name { font-weight: bold; }
.leaderboards table { table-layout: fixed; }
.leaderboards th, .leaderboards td { white-space: nowrap; }
.leaderboards th:first-child { width: 18px; }
.leaderboards th:nth-child(3) { width: 64px; font-size: 10px; }
.leaderboards th:last-child { width: 45px; }
.player-identity { display: flex; align-items: center; min-width: 0; }
.player-identity > .player-color-swatch { flex-shrink: 0; }
.player-identity > .player-best-star { width: 13px; height: 13px; margin-left: -2px; margin-right: 3px; border: none; border-radius: 0; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 94%, 50% 72%, 21% 94%, 32% 57%, 2% 35%, 39% 35%); }
.player-name-text { overflow: hidden; text-overflow: ellipsis; }
.player-activity { font-size: 10px; font-weight: normal; color: var(--muted); }
.leaderboards th:last-child, .leaderboards td:last-child { text-align: right; font-variant-numeric: tabular-nums; color: #916921; }
.leaderboards .your-score { background: #e9f0df; font-weight: bold; }
.movement-routes { pointer-events: none; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.movement-route-outline { stroke: #fff7df; stroke-width: 5; opacity: .8; }
.movement-route { stroke: #bd7625; stroke-width: 2; stroke-dasharray: 5 4; }
.movement-route.blocked { stroke: #a74b36; }
.movement-phase-background { fill: #294b3d; stroke: #e9d4a0; stroke-width: 1; }
.movement-map-label { text-anchor: middle; font: bold 9px Arial, sans-serif; fill: #fff4d4; }
.blocked .dwarf-count-badge, .blocked .movement-phase-background { stroke: #b34e37; }
.moving-stack { pointer-events: none; }
.moving-stack[data-status="moving"] .dwarf-body { transform-box: fill-box; transform-origin: 50% 100%; animation: dwarf-walk .85s ease-in-out infinite; }
.moving-stack.world-paused .dwarf-body { animation-play-state: paused; }
@keyframes dwarf-walk { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
#move-dialog, #abandon-dialog { width: min(420px, calc(100vw - 32px)); padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: #fffcf5; color: var(--green); box-shadow: 0 20px 80px #17281a50; }
#move-dialog::backdrop, #abandon-dialog::backdrop { background: #17281a66; }
#abandon-dialog { max-height: calc(100dvh - 32px); overflow: auto; }
#abandon-dialog p { font-size: 13px; line-height: 1.6; margin: 16px 0; }
button.secondary.danger { color: #903f35; border-color: #b8897d; }
button.primary.danger { background: #903f35; }
#leader-dialog { width: min(780px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: clamp(18px, 4vw, 32px); border: 1px solid var(--line); border-radius: 12px; background: #fffcf5; color: var(--green); box-shadow: 0 20px 80px #17281a50; }
#leader-dialog::backdrop { background: #17281aaa; }
#leader-description { font-size: 13px; line-height: 1.7; color: var(--muted); margin-bottom: 22px; }
#leader-controls { border: 0; padding: 0; margin: 0; min-width: 0; }
#leader-controls legend { font-size: 12px; margin-bottom: 12px; }
.leader-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 14px; }
.leader-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 14px 20px; margin: 0; border: 2px solid #dde1d1; border-radius: 9px; background: #fffdf7; text-align: center; cursor: pointer; }
.leader-card:hover { border-color: #96ab8a; }
.leader-card:has(input:checked) { border-color: var(--green); background: #edf2e5; box-shadow: 0 0 0 1px var(--green); }
.leader-card:has(input:focus-visible) { outline: 3px solid #bc913c; outline-offset: 3px; }
.leader-card input { position: absolute; top: 10px; right: 10px; margin: 0; width: 18px; height: 18px; padding: 0; accent-color: var(--green); }
.leader-portrait { display: block; width: 110px; height: 121px; flex-shrink: 0; }
.leader-card strong { font: 20px Georgia, serif; }
.leader-title { font-size: 11px; color: #94702f; }
.leader-description { font-size: 12px; font-weight: normal; line-height: 1.6; color: var(--muted); }
.leader-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.leader-actions button { width: auto; margin: 0; justify-content: center; }
.leader-overview { display: flex; align-items: center; gap: 14px; }
.leader-overview .leader-portrait { width: 60px; height: 66px; }
.leader-overview .eyebrow { font-size: 9px; margin: 0 0 7px; }
.leader-overview strong { font: 18px Georgia, serif; }
.leader-overview .map-hint { margin: 5px 0 0; }
#move-controls { padding: 0; border: 0; margin: 0; min-width: 0; }
#move-dialog .map-hint { margin-top: 12px; }
#move-timing { white-space: pre-line; }
.move-summary { font-size: 12px; padding: 12px; background: #eef0df; border-radius: 5px; line-height: 1.6; }
.move-actions { display: flex; gap: 10px; }
.move-actions button { justify-content: center; }
.region-button:focus-visible .region-border { stroke: #253e31; stroke-dasharray: 5 3; }
.map-compass { stroke: #97a998; stroke-width: 1; fill: none; }
.map-compass .compass-needle { fill: #97a998; }
.map-compass text { fill: #839783; stroke: none; text-anchor: middle; font: 14px Georgia, serif; }
.map-legend { display: flex; flex-wrap: wrap; gap: 17px; padding: 16px 22px; border-top: 1px solid #cedad0; color: #687c69; font-size: 10px; }
.map-legend span { display: flex; align-items: center; gap: 7px; }
.map-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }
.legend-own { background: #4d7861; }.legend-other { background: #bf9076; }.legend-free { background: #bdc9ad; }
.biome-legend { gap: 12px 18px; background: #f2f3e9; }
.legend-plains { background: #ded5aa; }.legend-woodland { background: #bdccb0; }.legend-pass { background: #cec0a7; }.legend-peaks { background: #c4d1d5; }
.legend-route { margin-left: auto; }
.world-sidebar { display: grid; gap: 10px; }
.colony-overview, .region-details, .own-regions { background: #fffcf5; border: 1px solid #dfdfcf; border-radius: 8px; padding: 14px; min-width: 0; }
.colony-overview .colony-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0; margin: 0; border: none; background: none; }
.colony-overview .colony-stats strong { font-size: 22px; overflow-wrap: anywhere; }
.colony-overview .colony-stats span { margin-top: 3px; }
.compact-food { font-size: 12px; font-weight: bold; margin: 12px 0 3px; }
.food-gauge-summary { display: flex; flex-wrap: wrap; gap: 3px 8px; justify-content: space-between; margin-top: 9px; font-size: 11px; }
.food-gauge-summary > span { color: var(--muted); }
.food-gauge { position: relative; margin-top: 17px; height: 14px; }
.food-gauge-zones { display: flex; height: 100%; overflow: hidden; border-radius: 4px; outline: 1px solid #294b3d30; }
.food-zone { display: block; height: 100%; }
.food-zone-green { --zone-color: #72aa70; }
.food-zone-yellow { --zone-color: #e1c454; }
.food-zone-orange { --zone-color: #de964b; }
.food-zone-red { --zone-color: #c76b5b; }
.food-zone { background: var(--zone-color); }
.food-zone-stopped { background: repeating-linear-gradient(135deg, #984c4938 0 3px, transparent 3px 7px), var(--zone-color); }
.food-gauge-population { position: absolute; top: -13px; transform: translateX(-50%); font-size: 14px; line-height: 14px; color: #243d32; text-shadow: 0 1px #fff; }
.food-gauge-capacity { position: absolute; top: -2px; bottom: -2px; width: 3px; transform: translateX(-50%); background: #fffdf5; box-shadow: 0 0 0 1px #294b3d; }
.food-gauge-scale { display: flex; justify-content: space-between; font-size: 9px; color: var(--muted); margin-top: 5px; }
.food-gauge-legend { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 5px; font-size: 10px; }
.food-gauge-legend > span::before { content: ""; display: inline-block; width: 7px; height: 7px; background: var(--zone-color); border-radius: 1px; margin-right: 3px; }
.food-gauge-note { margin: 7px 0 0; font-size: 10px; line-height: 1.6; color: var(--muted); }
.panel-details > summary { cursor: pointer; font-size: 12px; color: var(--green); }
.region-details > .panel-details, .colony-overview > .panel-details { margin-top: 12px; }
.panel-details[open] > summary { margin-bottom: 10px; }
.panel-details .leader-overview { margin-top: 10px; }
#territory-list { max-height: 220px; overflow-y: auto; overscroll-behavior: contain; }
.building-slot small { margin: 0; }
.world-sidebar .fortress-production { margin: 12px 0; padding: 10px 0; }
.world-sidebar .fortress-production p { margin: 6px 0; font-size: 11px; }
.world-sidebar h3 { margin-bottom: 10px; }
.world-sidebar .eyebrow { font-size: 8px; letter-spacing: 1.3px; margin-top: 0; }
.region-details h2 { font-size: 23px; margin: 8px 0 12px; }
.selection-location { padding: 0; border: 0; background: transparent; color: #536a50; font-size: 11px; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
#region-contents-section { margin-bottom: 14px; }
.region-details dl { margin: 18px 0 0; padding-top: 8px; border-top: 1px solid #dfdfcf; }
.region-details dl div { display: flex; justify-content: space-between; gap: 12px; margin: 10px 0; font-size: 12px; }
.region-details .selection-location { margin-bottom: 14px; }
#building-status { margin-top: 18px; }
.region-details dt { color: var(--muted); }
.region-details dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.world-sidebar h3 { font-size: 17px; margin-top: 0; }
.region-neighbors { display: flex; flex-wrap: wrap; gap: 7px; }
.region-neighbors button { border: 1px solid #dfe3d5; background: #eff1e7; color: #536a50; border-radius: 4px; font-size: 10px; padding: 7px 9px; }
.region-neighbors button:hover { background: #e2e8d6; }
.world-sidebar .territory-list { margin: 0; }
.world-sidebar .territory-list li { padding: 0; border: none; }
.territory-list button { width: 100%; text-align: left; border: none; background: transparent; padding: 10px 0; color: var(--green); font-size: 12px; }
.territory-list button:hover { text-decoration: underline; }
.map-hint { font-size: 11px; line-height: 1.8; color: var(--muted); margin: 0 4px; }
@media (max-width: 1000px) {
  .world-screen { padding: 15px 24px 30px; }
  .world-layout { grid-template-columns: minmax(0, 1fr); }
  .world-sidebar { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .building-actions { left: 8px; right: 8px; top: auto; bottom: max(8px, env(safe-area-inset-bottom)); width: auto; max-width: none; max-height: 45dvh; overflow-y: auto; overscroll-behavior: contain; border-radius: 14px; }
  .building-actions button, .world-heading-actions button, .region-neighbors button { min-height: 44px; }
  .building-actions header { position: sticky; top: 0; background: #fff8e5; }
  .building-actions #building-actions-close { min-width: 44px; }
  #move-dialog input { font-size: 16px; }
  .world-screen { padding: 10px 16px 30px; }
  .world-heading { align-items: flex-start; flex-direction: column; }
  .world-heading h1 { font-size: 34px; }
  .world-heading .eyebrow { font-size: 8px; letter-spacing: 1px; }
  .world-sidebar { grid-template-columns: 1fr; }
  .region-details { grid-row: auto; }
  .map-legend { padding: 15px; gap: 12px; }
  .legend-route { margin-left: 0; }
}
@media (min-width: 1400px) {
  main {
    gap: 110px;
  }
  .account-card {
    padding: 38px;
  }
}
@media (max-width: 900px) {
  .masthead {
    padding: 25px 30px;
  }
  main {
    gap: 35px;
    padding: 30px;
  }
  .account-card {
    padding: 26px;
  }
  .world-notes {
    gap: 20px;
  }
  .world-notes span + span {
    padding-left: 20px;
  }
  .desktop-break {
    display: none;
  }
}
@media (max-width: 680px) {
  .masthead {
    padding: 22px;
  }
  .brand {
    font-size: 17px;
  }
  .edition {
    display: none;
  }
  main {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 15px 22px 40px;
    max-width: 500px;
  }
  .story {
    text-align: center;
  }
  .story > .eyebrow {
    justify-content: center;
    font-size: 8px;
  }
  h1 {
    font-size: 39px;
  }
  .intro {
    font-size: 13px;
  }
  .landscape {
    margin: 0;
  }
  .landscape svg {
    max-height: 190px;
  }
  .landscape-caption,
  .world-notes {
    display: none;
  }
  .account-card {
    text-align: left;
    padding: 26px;
  }
  footer {
    padding: 20px 22px;
    font-size: 9px;
  }
  footer > span + span {
    font-size: 7px;
  }
}
/* Give the running world the window's remaining height after its compact header. */
body:has(#colony:not([hidden])) > .masthead { max-width: none; width: 100%; padding: 12px 28px; gap: 20px; }
body:has(#colony:not([hidden])) .brand { font-size: 18px; }
body:has(#colony:not([hidden])) .brand img { width: 32px; height: 32px; }
body:has(#colony:not([hidden])) .brand small { display: none; }
body:has(#colony:not([hidden])) > footer { display: none; }
.world-heading { margin-bottom: 14px; gap: 12px; }
.world-heading .eyebrow { margin: 0 0 6px; }
.world-heading h1 { margin: 0; font-size: 28px; }
.world-heading-actions .secondary { padding: 9px 12px; }
@media (min-width: 1001px) {
  body:has(#colony:not([hidden])) { height: 100dvh; display: flex; flex-direction: column; }
  body:has(#colony:not([hidden])) > .masthead { flex: none; }
  .world-screen { flex: 1; display: flex; flex-direction: column; min-height: 0; width: 100%; padding: 8px 28px 12px; }
  .world-heading, .world-screen > .error, #defeat-prompt { flex-shrink: 0; }
  .world-layout { flex: 1; min-height: 0; align-items: stretch; }
  .map-card { display: flex; flex-direction: column; min-height: 0; }
  .map-stage { flex: 1; min-height: 0; }
  #map-viewport { height: 100%; }
  .map-legend { flex-shrink: 0; padding: 10px 18px; }
  .world-sidebar { min-height: 0; overflow-y: auto; align-content: start; }
}
@media (max-width: 600px) {
  body:has(#colony:not([hidden])) > .masthead { padding: 10px 16px; gap: 12px; }
  body:has(#colony:not([hidden])) .brand { font-size: 15px; gap: 8px; }
  .world-heading-actions { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
.player-color-swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border: 1px solid #263e3855;
  border-radius: 2px;
  vertical-align: baseline;
}
