@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Libre+Caslon+Display&display=swap");

:root {
  --paper: #f5f2e9;
  --paper-light: #faf8f0;
  --ink: #344438;
  --muted: #8b8d7d;
  --green: #42644e;
  --line: #dedfd1;
  --gold: #ae925b;
  --serif:
    "Libre Caslon Display", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "DM Sans", "Trebuchet MS", sans-serif;
}
* {
  box-sizing: border-box;
}
.game-version {
  font: 10px/1.5 var(--sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1px;
  white-space: nowrap;
}
.game-version-badge {
  position: absolute;
  left: 12px;
  bottom: 6px;
  padding: 2px 7px;
  color: var(--theme-muted, #63715f);
  background: var(--theme-overlay, #faf8efd9);
  border-radius: 3px;
  pointer-events: none;
}
.desktop-layout .game-version-badge {
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
}
body.cinematic .game-version-badge {
  display: none;
}
.game-menu-version {
  margin: 16px 0 0;
  text-align: center;
  color: var(--theme-muted, #63715f);
}
.game-menu-home .game-menu-version {
  color: #c5cfb7;
}
.cloud-save-symbol {
  --cloud-saved: #4d7853;
  --cloud-saving: #507e9e;
  --cloud-pending: #a47b2c;
  --cloud-error: #ad594c;
  color: var(--cloud-pending);
}
.cloud-save-symbol.saved {
  color: var(--cloud-saved);
}
.cloud-save-symbol.saving {
  color: var(--cloud-saving);
}
.cloud-save-symbol.offline,
.cloud-save-symbol.conflict,
.cloud-save-symbol.signed-out {
  color: var(--cloud-error);
}
[data-theme="dark"] .cloud-save-symbol,
.game-menu-home .cloud-save-symbol {
  --cloud-saved: #a3c596;
  --cloud-saving: #94bbd6;
  --cloud-pending: #dfbf77;
  --cloud-error: #eca395;
}
.cloud-save-indicator {
  position: fixed;
  z-index: 30;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 6px;
  border: 0;
  border-radius: 50%;
  background: var(--theme-overlay, #faf8efd9);
}
.cloud-save-indicator:hover {
  background: var(--paper-light);
}
.cloud-save-indicator .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
body.cinematic .cloud-save-indicator {
  display: none;
}
@media (max-width: 1180px), (max-width: 1440px) and (any-pointer: coarse) {
  .cloud-save-indicator {
    display: none;
  }
}
.game-menu-cloud {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #c5cfb726;
  font-size: 11px;
}
.game-menu-cloud-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  color: #e3e6d6;
}
.game-menu-cloud-message {
  margin: 10px 0 0;
  color: #c5cfb7;
  line-height: 1.6;
}
.game-menu-cloud-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 16px;
  margin-top: 4px;
}
.game-menu-cloud-actions a,
.game-menu-cloud-actions button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: #c9b77f;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer .game-version {
  display: block;
  margin-top: 4px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button {
  transition:
    background 0.16s,
    box-shadow 0.16s,
    transform 0.16s;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--theme-line-strong, #497968);
  outline-offset: 3px;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
button span[data-icon],
span[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hidden {
  display: none !important;
}
.app {
  height: 100dvh;
  min-height: 650px;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 91px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 29px;
  gap: 24px;
  background: var(--paper-light);
}
.brand {
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 258px;
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: -0.8px;
  line-height: 1.05;
}
.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.welcome-card .brand-logo {
  width: 150px;
  max-width: 100%;
  margin: 0 auto;
}
.brand i {
  font-size: 24px;
  color: var(--theme-muted, #8d916e);
}
.brand small {
  font-family: var(--sans);
  display: block;
  font-size: 8px;
  letter-spacing: 2px;
  font-weight: 500;
  line-height: 1;
  margin-top: 10px;
}
.brand-crest {
  width: 39px;
  height: 45px;
  background: #405e49;
  color: #e4dab7;
  clip-path: polygon(0 0, 100% 0, 100% 73%, 50% 100%, 0 73%);
  padding-bottom: 6px;
}
.brand-crest svg {
  width: 26px;
  height: 26px;
  stroke-width: 1.3;
}
.resource-bar {
  display: flex;
  gap: 12px;
  align-items: center;
}
.resource {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  min-width: 111px;
  background: var(--theme-surface, #efeee4);
  border: 1px solid var(--theme-line, #e6e5d9);
  border-radius: 7px;
}
.resource-icon {
  color: var(--theme-muted, #958569);
}
.resource-icon svg {
  width: 23px;
  height: 23px;
}
.resource strong {
  font-size: 16px;
  font-weight: 600;
  display: block;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.resource small {
  color: var(--muted);
  font-size: 9px;
  display: block;
  margin-top: 4px;
}
.resource-rate {
  font-size: 10px;
  color: var(--theme-muted, #638663);
  margin-left: auto;
  align-self: flex-end;
  margin-bottom: 1px;
  white-space: nowrap;
}
.resource-rate.negative {
  color: var(--theme-danger, #b27053);
}
.top-actions {
  display: flex;
  gap: 5px;
}
.icon-button {
  border: 0;
  background: transparent;
  width: 31px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  color: var(--theme-muted, #808774);
}
.icon-button:hover {
  background: var(--theme-surface, #e8e9dc);
  color: var(--ink);
}
.icon-button svg {
  width: 18px;
  height: 18px;
}
.game-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 268px minmax(300px, 1fr) 247px;
}
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  padding: 27px 20px 0;
  background: var(--paper);
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 1.65px;
  font-weight: 600;
  color: var(--theme-muted, #90927e);
}
.village-heading h1 {
  font-family: var(--serif);
  font-size: 36px;
  letter-spacing: -0.7px;
  font-weight: 400;
  margin: 8px 0 6px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.leaf-mark {
  color: var(--theme-muted, #859269);
  transform: rotate(20deg);
}
.leaf-mark svg {
  width: 22px;
  height: 22px;
}
.settlement-rank {
  font-size: 10px;
  color: var(--theme-muted, #8c907d);
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-dot,
.live-dot {
  width: 5px;
  height: 5px;
  display: inline-block;
  border-radius: 50%;
  background: #8caa72;
}
.village-stats {
  margin: 23px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px 0;
}
.village-stats button {
  background: transparent;
  border: 0;
  display: grid;
  grid-template-columns: 24px auto;
  gap: 2px 3px;
  text-align: left;
  padding: 0 14px;
}
.village-stats button + button {
  border-left: 1px solid var(--line);
}
.village-stats svg {
  width: 18px;
  height: 18px;
  color: var(--theme-muted, #919978);
}
.village-stats strong {
  font-size: 16px;
  font-weight: 500;
}
.village-stats small {
  font-size: 11px;
  font-weight: 400;
  color: var(--theme-muted, #a0a18e);
}
.stat-label {
  grid-column: 2;
  font-size: 9px;
  color: var(--muted);
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-heading h2 {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}
.tiny-ornament {
  font-size: 21px;
  color: var(--theme-muted, #9a9e83);
}
.build-tabs {
  display: flex;
  gap: 4px;
  margin: 15px 0 12px;
  background: var(--theme-surface, #eaece1);
  padding: 4px;
  border-radius: 6px;
}
.build-tabs button {
  flex: 1;
  background: transparent;
  border: 0;
  font-size: 10px;
  padding: 6px 2px;
  color: var(--theme-muted, #8a907d);
  border-radius: 4px;
}
.build-tabs button[aria-selected="true"] {
  color: var(--theme-ink, #4e654d);
  background: var(--paper-light);
  box-shadow: 0 1px 4px #3c502010;
}
.build-list {
  overflow-y: auto;
  flex: 1;
  min-height: 70px;
  padding: 1px 2px 14px 0;
  scrollbar-width: thin;
  scrollbar-color: #d1d4c1 transparent;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.build-card {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--theme-raised, #f8f6ed);
  border: 1px solid var(--theme-line, #e1e2d5);
  border-radius: 6px;
  padding: 11px 10px;
  position: relative;
  flex-shrink: 0;
}
.build-card:hover {
  background: var(--theme-raised, #fffdf5);
  border-color: var(--theme-line, #abb79a);
  box-shadow: 0 3px 9px #3f512c09;
}
.build-card.selected {
  border-color: var(--theme-line-strong, #57775c);
  background: var(--theme-surface, #e8ecdd);
  box-shadow: inset 0 0 0 1px #57775c;
}
.build-card.unaffordable {
  opacity: 0.63;
}
.build-illustration {
  height: 39px;
  width: 41px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  background: var(--theme-surface, #ecebdc);
  border-radius: 5px;
}
.build-illustration svg {
  width: 29px;
  height: 29px;
  stroke-width: 1.3;
}
.build-card h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
}
.build-card .build-detail {
  font-size: 9px;
  color: var(--theme-muted, #939580);
  display: block;
  margin: 3px 0 5px;
}
.cost {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10px;
  color: var(--theme-muted, #8c907a);
}
.cost span {
  display: flex;
  align-items: center;
  gap: 3px;
}
.cost svg {
  width: 11px;
  height: 11px;
  stroke-width: 1.8;
}
.cost .missing {
  color: var(--theme-danger, #af684f);
}
.build-card .build-plus {
  margin-left: auto;
  color: var(--theme-muted, #a0a68f);
  font-size: 16px;
}
.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  color: var(--theme-muted, #8d927e);
  padding: 15px 0;
  border-top: 1px solid var(--line);
}
.sidebar-foot svg {
  width: 16px;
  height: 16px;
}
.sidebar-foot strong {
  font-weight: 500;
  color: var(--theme-ink, #566f52);
}
.info-dot {
  margin-left: auto;
  border: 1px solid var(--theme-line, #b4b9a5);
  border-radius: 50%;
  width: 12px;
  height: 12px;
  font: 9px Georgia;
  text-align: center;
}
.world-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--theme-surface, #d4ddbb);
}
#world {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#world:active {
  cursor: grabbing;
}
#world.building {
  cursor: crosshair;
}
.world-heading {
  position: absolute;
  left: 27px;
  top: 29px;
  pointer-events: none;
}
.region-tag {
  font-size: 9px;
  letter-spacing: 1.8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--theme-ink, #586d4c);
}
.region-tag svg {
  width: 17px;
  height: 17px;
}
.world-subtitle {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--theme-muted, #6f8062);
  margin-top: 6px;
}
.map-badge {
  position: absolute;
  right: 22px;
  top: 29px;
  display: flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--theme-line, #b8c5a7);
  background: var(--theme-overlay, #eff0d876);
  font-size: 10px;
  padding: 7px 10px;
  border-radius: 5px;
  color: var(--theme-ink, #687c59);
  pointer-events: none;
}
.map-badge svg {
  width: 14px;
  height: 14px;
}
.charter-card {
  position: absolute;
  left: 21px;
  bottom: 44px;
  width: 267px;
  background: var(--theme-overlay, #f9f6e9ee);
  border: 1px solid var(--theme-line, #e5e4cc);
  border-radius: 7px;
  padding: 16px 17px;
  box-shadow: 0 5px 20px #4b5b3410;
  backdrop-filter: blur(8px);
}
.charter-heading {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 8px;
  letter-spacing: 1.3px;
  font-weight: 600;
  color: var(--theme-muted, #96916d);
}
.charter-heading svg {
  width: 14px;
  height: 14px;
}
.charter-heading small {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--theme-muted, #a7a68a);
}
.charter-card h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  margin: 8px 0 6px;
}
.charter-card p {
  font-size: 10px;
  line-height: 1.6;
  color: var(--theme-muted, #878b73);
  margin: 0 0 10px;
}
.charter-checks {
  display: flex;
  gap: 12px;
  font-size: 9px;
  color: var(--theme-muted, #909780);
}
.charter-checks span {
  display: flex;
  gap: 5px;
  align-items: center;
}
.charter-checks svg {
  width: 12px;
  height: 12px;
}
.charter-checks .done {
  color: var(--theme-accent, #4b7951);
}
.claim-button {
  width: 100%;
  background: #49664e;
  color: #f7f4e6;
  border: 0;
  border-radius: 4px;
  padding: 8px;
  margin-top: 10px;
  font-size: 10px;
}
.welcome-card {
  position: absolute;
  left: 50%;
  top: 20%;
  transform: translateX(-50%);
  text-align: center;
  width: 304px;
  padding: 25px 26px 20px;
  background: var(--theme-overlay, #faf7ebef);
  border: 1px solid var(--theme-line, #e6e4ce);
  border-radius: 10px;
  box-shadow: 0 14px 60px #485b3220;
  backdrop-filter: blur(9px);
  z-index: 3;
  animation: arrive 0.7s ease-out;
}
.welcome-card h2 {
  font-family: var(--serif);
  font-size: 33px;
  font-weight: 400;
  line-height: 1.07;
  margin: 13px 0;
}
.welcome-card p {
  font-size: 11px;
  line-height: 1.9;
  color: var(--theme-muted, #878b73);
  margin: 0 0 20px;
}
.primary-button {
  background: #45694e;
  color: #f9f5e3;
  padding: 12px 18px;
  border: 1px solid var(--theme-line-strong, #45694e);
  border-radius: 5px;
  font-size: 11px;
  display: inline-flex;
  gap: 30px;
  align-items: center;
  justify-content: center;
}
.primary-button:hover {
  background: #34563e;
}
.welcome-note {
  display: block;
  margin-top: 13px;
  color: var(--theme-muted, #a3a58d);
  font-size: 8px;
  letter-spacing: 1px;
}
.map-controls {
  position: absolute;
  right: 20px;
  bottom: 50px;
  display: flex;
  flex-direction: column;
  background: var(--theme-overlay, #f6f4e7d9);
  border: 1px solid var(--theme-line, #d5dbc0);
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 3px 12px #4b5b3410;
}
.map-controls .icon-button {
  font-size: 21px;
  width: 27px;
  height: 28px;
}
.map-controls > span {
  border-top: 1px solid var(--line);
  margin: 4px;
}
.map-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 33px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 22px;
  background: var(--theme-overlay, #d8dfc584);
  border-top: 1px solid var(--theme-line, #b8c5a33d);
  font-size: 8px;
  color: var(--theme-muted, #7b8868);
  pointer-events: none;
}
.map-footer > span:first-child {
  display: flex;
  gap: 7px;
  align-items: center;
}
.map-tip b {
  padding: 0 6px;
  font-weight: 400;
}
.right-sidebar {
  border-left: 1px solid var(--line);
  padding: 25px 20px 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}
.season-card {
  text-align: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}
.season-art {
  margin: 2px auto 18px;
  position: relative;
  width: 66px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    circle,
    var(--theme-warm, #eee7c7) 0,
    var(--theme-overlay, #eeecd780) 55%,
    transparent 70%
  );
}
.season-art:before,
.season-art:after {
  content: "";
  position: absolute;
  width: 30px;
  height: 15px;
  border-bottom: 1px solid var(--theme-line, #b9bea0);
  border-radius: 50%;
  bottom: 5px;
  left: -6px;
  transform: rotate(20deg);
}
.season-art:after {
  left: auto;
  right: -6px;
  transform: rotate(-20deg);
}
.season-art svg {
  width: 38px;
  height: 38px;
  color: var(--theme-gold, #b39d59);
  stroke-width: 1;
}
.season-card h2 {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.1;
  font-weight: 400;
  margin: 10px 0;
}
.season-card p {
  font-size: 10px;
  color: var(--theme-muted, #8e947e);
  line-height: 1.8;
  margin: 9px 0 18px;
}
.season-progress {
  height: 4px;
  background: var(--theme-surface, #e5e7d9);
  border-radius: 4px;
  overflow: hidden;
}
.season-progress span {
  display: block;
  height: 100%;
  width: 3%;
  background: #9dac7c;
  border-radius: 4px;
  transition: width 0.3s;
}
.season-day {
  display: flex;
  justify-content: space-between;
  color: var(--theme-muted, #92967e);
  font-size: 8px;
  margin-top: 8px;
}
.journal-heading {
  margin: 22px 0 18px;
}
.journal-heading svg {
  width: 16px;
  height: 16px;
  color: var(--theme-muted, #9c9f88);
}
.journal {
  flex: 1;
  min-height: 100px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #d1d4c1 transparent;
  padding-right: 3px;
  mask-image: linear-gradient(#000 90%, transparent);
}
.journal-item {
  position: relative;
  border-left: 1px solid var(--theme-line, #dedfce);
  padding: 0 0 19px 13px;
  margin-left: 3px;
}
.journal-item:before {
  content: "";
  position: absolute;
  left: -3px;
  top: 3px;
  width: 5px;
  height: 5px;
  background: var(--theme-soft, #afb795);
  border-radius: 50%;
  outline: 4px solid var(--paper);
}
.journal-item small {
  font-size: 8px;
  color: var(--theme-muted, #a5a891);
  letter-spacing: 0.7px;
}
.journal-item p {
  font-size: 10px;
  line-height: 1.7;
  margin: 5px 0 0;
  color: var(--theme-muted, #858d78);
}
.gather-card {
  background: var(--theme-surface, #edeee1);
  border: 1px solid var(--theme-line, #e0e3d2);
  border-radius: 6px;
  padding: 15px;
  margin-top: 18px;
}
.gather-card .eyebrow {
  font-size: 8px;
}
.gather-card h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  margin: 8px 0;
}
.gather-card p {
  font-size: 9px;
  line-height: 1.7;
  color: var(--theme-muted, #8a927a);
  margin: 5px 0 12px;
}
.gather-card > div {
  display: flex;
  gap: 7px;
}
.gather-card button {
  border: 1px solid var(--theme-line, #d8ddc9);
  border-radius: 4px;
  padding: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  background: var(--theme-raised, #f7f5e9);
  flex: 1;
  justify-content: center;
}
.gather-card button:hover {
  background: var(--theme-raised, #fffdf4);
}
.gather-card svg {
  width: 13px;
  height: 13px;
  color: var(--theme-muted, #8c9773);
}
.gather-card > span:last-child {
  display: block;
  text-align: center;
  font-size: 8px;
  color: var(--theme-muted, #9ba288);
  margin-top: 9px;
}
.trade-button {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  display: flex;
  text-align: left;
  gap: 10px;
  align-items: center;
  padding: 18px 0 0;
  margin-top: 18px;
  font-size: 10px;
}
.trade-button > span[data-icon] {
  width: 30px;
  height: 30px;
  background: var(--theme-surface, #e8eadb);
  border-radius: 5px;
  color: var(--theme-muted, #83916c);
}
.trade-button small {
  display: block;
  font-size: 8px;
  color: var(--theme-muted, #a1a58b);
  margin-top: 5px;
}
.trade-button b {
  margin-left: auto;
  font-size: 16px;
  color: var(--theme-muted, #9ba388);
  font-weight: 400;
}
.bottom-bar {
  height: 49px;
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--paper-light);
  gap: 10px;
}
.time-controls {
  display: flex;
  gap: 4px;
  align-items: center;
}
.time-label {
  font-size: 8px;
  letter-spacing: 1.2px;
  color: var(--theme-muted, #9c9f89);
  margin-right: 10px;
}
.time-controls button {
  border: 0;
  background: transparent;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 10px;
  color: var(--theme-muted, #929980);
  height: 27px;
}
.time-controls button.active {
  background: var(--theme-surface, #e5e9d9);
  color: var(--theme-ink, #57734c);
}
.time-controls svg {
  width: 12px;
  height: 12px;
}
.bottom-bar p {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--theme-muted, #9b9e86);
  margin: 0;
  font-style: italic;
}
.save-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--theme-muted, #a0a68e);
  font-size: 8px;
  white-space: nowrap;
}
.save-status svg {
  width: 12px;
  height: 12px;
}
.selection-card {
  position: absolute;
  right: 20px;
  top: 80px;
  width: 238px;
  background: var(--theme-overlay, #faf7edf5);
  border: 1px solid var(--theme-line, #dadfc9);
  border-radius: 7px;
  padding: 18px;
  z-index: 4;
  box-shadow: 0 8px 35px #445b3220;
}
.selection-card .close-button {
  position: absolute;
  right: 7px;
  top: 7px;
}
.selection-card h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  margin: 7px 0 9px;
}
.selection-card p {
  font-size: 10px;
  line-height: 1.8;
  color: var(--theme-muted, #8b927b);
  margin: 0 0 12px;
}
.worker-control {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 10px;
}
.worker-control > div {
  display: flex;
  align-items: center;
  gap: 11px;
}
.worker-control button {
  width: 23px;
  height: 23px;
  border: 1px solid var(--theme-line, #d8ddc9);
  border-radius: 4px;
  background: var(--theme-raised, #f3f2e4);
  font-size: 14px;
}
.production-line {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--theme-muted, #68915e);
  margin-bottom: 10px;
}
.production-line svg {
  width: 14px;
  height: 14px;
}
.demolish-button {
  font-size: 9px;
  color: var(--theme-danger, #ae8567);
  background: transparent;
  border: 0;
  padding: 13px 0 0;
}
.build-hint {
  position: absolute;
  top: 82px;
  left: 50%;
  transform: translateX(-50%);
  background: #3f5e49ee;
  color: #f2edd4;
  border-radius: 6px;
  padding: 10px 12px 10px 15px;
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
  box-shadow: 0 4px 15px #233d2420;
  font-size: 10px;
}
.build-hint button {
  border: 0;
  background: var(--theme-overlay, #ffffff12);
  color: #edead7;
  width: 21px;
  height: 21px;
  border-radius: 3px;
}
.toast-stack {
  position: absolute;
  left: 50%;
  top: 125px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 8;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}
.toast {
  padding: 11px 16px;
  border: 1px solid var(--theme-line, #c8d2b6);
  background: var(--theme-overlay, #fcf9efef);
  border-radius: 6px;
  box-shadow: 0 5px 20px #3b4a2b15;
  color: var(--theme-ink, #60774e);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
  animation: toast-in 0.25s ease-out;
}
.toast.error {
  color: var(--theme-danger, #a16c53);
  border-color: var(--theme-line, #dbc8ac);
}
dialog {
  background: var(--paper-light);
  border: 1px solid var(--theme-line, #d9ddc6);
  border-radius: 12px;
  padding: 0;
  width: 450px;
  max-width: calc(100vw - 28px);
  color: var(--ink);
  box-shadow: 0 25px 100px #243d3540;
}
dialog::backdrop {
  background: #283e3b66;
  backdrop-filter: blur(5px);
}
.modal-content {
  padding: 32px;
  position: relative;
}
.modal-content h2 {
  font-family: var(--serif);
  font-size: 37px;
  font-weight: 400;
  margin: 12px 0 14px;
  line-height: 1.05;
}
.modal-content > p {
  font-size: 12px;
  line-height: 1.85;
  color: var(--theme-muted, #818d77);
}
.modal-content .close-button {
  position: absolute;
  top: 13px;
  right: 13px;
}
.modal-content h3 {
  font-size: 12px;
  font-weight: 600;
}
.help-step {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin: 19px 0;
}
.help-step > span {
  border-radius: 50%;
  background: var(--theme-surface, #e8ebdc);
  min-width: 27px;
  height: 27px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-muted, #758a66);
}
.help-step p {
  margin: 3px 0;
  font-size: 11px;
  line-height: 1.7;
  color: var(--theme-muted, #8a927d);
}
.help-step strong {
  display: block;
  font-size: 12px;
  color: var(--theme-ink, #5b7153);
  margin-bottom: 4px;
}
.help-shortcuts {
  background: var(--theme-surface, #eaeddf);
  padding: 12px;
  border-radius: 5px;
  font-size: 10px;
  color: var(--theme-muted, #859277);
  line-height: 1.8;
  margin: 22px 0;
}
.event-choice {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--theme-line, #dbe0c9);
  background: var(--theme-raised, #f0f1e4);
  border-radius: 6px;
  text-align: left;
  margin-top: 9px;
  display: block;
}
.event-choice:hover {
  background: var(--theme-surface, #e5ead8);
}
.event-choice strong {
  font-size: 12px;
  display: block;
  font-weight: 500;
}
.event-choice small {
  font-size: 10px;
  display: block;
  color: var(--theme-muted, #919a7f);
  margin-top: 5px;
}
.event-icon {
  display: flex;
  justify-content: center;
  margin: 3px 0 24px;
  color: var(--theme-gold, #a18e56);
}
.event-icon svg {
  width: 49px;
  height: 49px;
  stroke-width: 1;
}
.trade-row {
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
}
.trade-row > svg {
  color: var(--theme-muted, #a69b77);
}
.trade-row > span {
  flex: 1;
  font-size: 12px;
  text-transform: capitalize;
}
.trade-row button {
  font-size: 10px;
  padding: 8px;
  border: 1px solid var(--theme-line, #d7ddc7);
  background: var(--theme-surface, #edf0e0);
  border-radius: 4px;
}
.modal-note {
  font-size: 10px !important;
  color: var(--theme-muted, #939c83) !important;
}
.settings-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.settings-row button,
.secondary-button {
  background: var(--theme-surface, #e9edde);
  border: 1px solid var(--theme-line, #d5ddc6);
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 11px;
}
.danger-button {
  color: var(--theme-danger, #a16653);
  background: var(--theme-surface, #f0e7da) !important;
  border-color: var(--theme-line, #dfcdbc) !important;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
canvas.over-object:not(.building):not(.panning):not(.rotating) {
  cursor: pointer;
}
.resident-heading {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 18px 0;
}
.resident-heading h2 {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  outline: none;
}
.resident-portrait {
  width: 86px;
  height: 100px;
  flex: 0 0 86px;
  background: var(--theme-surface, #e9edde);
  border: 1px solid var(--line);
  border-radius: 48% 48% 10% 10%;
}
.resident-heading .resident-role {
  margin: 0;
  color: var(--theme-muted, #78866b);
  font-size: 11px;
}
.resident-character {
  border-left: 2px solid var(--theme-gold, #a18e56);
  padding: 5px 0 5px 14px;
  font-style: italic;
  font-size: 12px;
  line-height: 1.8;
}
.resident-facts {
  margin: 22px 0;
}
.resident-facts > div {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.resident-facts dt {
  color: var(--theme-muted, #78866b);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.resident-facts dd {
  font-size: 12px;
  margin: 0;
  overflow-wrap: anywhere;
}
.resident-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.resident-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.resident-actions svg {
  width: 14px;
  height: 14px;
}
.resident-roster {
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding-top: 10px;
}
.resident-roster h3 {
  font: 20px var(--serif);
  margin-bottom: 10px;
}
.resident-roster ul {
  padding: 0;
  margin: 14px 0;
  list-style: none;
}
.resident-roster li + li {
  border-top: 1px solid var(--line);
}
.resident-roster li button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 4px;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--ink);
}
.resident-roster li button:hover {
  background: var(--theme-surface, #e9edde);
}
.resident-roster strong,
.resident-roster small {
  display: block;
}
.resident-roster strong {
  font-size: 12px;
  font-weight: 500;
}
.resident-roster small {
  font-size: 10px;
  color: var(--theme-muted, #78866b);
  margin-top: 5px;
}
.resident-pages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
}
.sheet-grip {
  display: none;
}
.sheet-dragging {
  transform: translateY(var(--sheet-offset, 0px)) !important;
  transition: none;
  user-select: none;
}
.sheet-settling {
  transform: translateY(var(--sheet-offset, 0px)) !important;
  transition: transform 160ms ease-out;
}
.keyboard-tile {
  font-size: 9px;
  color: var(--theme-muted, #859476);
}
.paused-label {
  color: var(--theme-gold, #9b805e) !important;
}
.building-tooltip {
  position: fixed;
  z-index: 12;
  background: var(--theme-raised, #fcf9f0);
  border: 1px solid var(--theme-line, #dce0cd);
  border-radius: 6px;
  padding: 13px 15px;
  width: 210px;
  box-shadow: 0 6px 25px #40502b18;
  pointer-events: none;
}
.building-tooltip strong {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
}
.building-tooltip p {
  font-size: 10px;
  line-height: 1.7;
  color: var(--theme-muted, #8d957c);
  margin: 7px 0 0;
}
@keyframes arrive {
  from {
    opacity: 0;
    translate: 0 8px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@keyframes toast-in {
  from {
    opacity: 0;
    translate: 0 -7px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@media (min-width: 1600px) {
  .game-layout {
    grid-template-columns: 285px minmax(300px, 1fr) 270px;
  }
  .sidebar,
  .right-sidebar {
    padding-left: 25px;
    padding-right: 25px;
  }
  .build-card {
    padding: 13px 11px;
  }
  .brand {
    font-size: 32px;
  }
  .resource {
    min-width: 125px;
  }
  .resource-bar {
    gap: 18px;
  }
}
@media (max-width: 1200px) {
  .game-layout {
    grid-template-columns: 238px minmax(300px, 1fr) 216px;
  }
  .sidebar {
    padding: 24px 15px 0;
  }
  .right-sidebar {
    padding: 22px 15px 16px;
  }
  .topbar {
    padding: 0 20px;
    gap: 15px;
  }
  .brand {
    min-width: 223px;
    font-size: 26px;
  }
  .brand small {
    font-size: 7px;
    letter-spacing: 1.6px;
  }
  .resource {
    min-width: 94px;
    padding: 8px;
    gap: 6px;
  }
  .resource-bar {
    gap: 7px;
  }
  .resource-rate {
    font-size: 8px;
  }
  .top-actions {
    gap: 0;
  }
  .bottom-bar p {
    font-size: 12px;
  }
  .world-subtitle {
    font-size: 15px;
  }
  .map-badge {
    top: 65px;
    right: 20px;
  }
  .charter-card {
    width: 240px;
  }
  .map-tip {
    display: none;
  }
  .world-heading {
    left: 21px;
  }
  .village-stats button {
    padding: 0 10px;
  }
  .season-card h2 {
    font-size: 23px;
  }
}
@media (max-width: 1000px) {
  .right-sidebar {
    display: none;
  }
  .game-layout {
    grid-template-columns: 240px minmax(300px, 1fr);
  }
  .topbar {
    height: 80px;
  }
  .brand {
    min-width: auto;
    font-size: 24px;
  }
  .brand-crest {
    width: 33px;
    height: 40px;
  }
  .brand small {
    font-size: 6px;
  }
  .resource {
    min-width: 80px;
  }
  .resource strong {
    font-size: 14px;
  }
  .resource-icon svg {
    width: 19px;
  }
  .top-actions .icon-button {
    width: 27px;
  }
  .bottom-bar p {
    display: none;
  }
  .map-badge {
    top: 29px;
  }
  .bottom-bar:after {
    content: "Trade: T · Gather food: F · Gather wood: G";
    font-size: 9px;
    color: var(--theme-muted, #90987f);
    order: 1;
  }
  .save-status {
    order: 2;
  }
  .charter-card {
    width: 260px;
  }
  .welcome-card {
    top: 17%;
  }
}
@media (max-width: 740px) {
  .app {
    min-height: 690px;
    height: 100dvh;
  }
  .topbar {
    height: auto;
    min-height: 110px;
    flex-wrap: wrap;
    padding: 14px 16px 12px;
    gap: 13px;
  }
  .brand {
    font-size: 24px;
    gap: 9px;
  }
  .brand small {
    letter-spacing: 1.3px;
  }
  .brand-crest {
    width: 30px;
    height: 35px;
  }
  .brand-crest svg {
    width: 22px;
  }
  .top-actions {
    margin-left: auto;
  }
  .resource-bar {
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }
  .resource {
    flex: 1;
    min-width: 0;
    padding: 7px 8px;
  }
  .resource strong {
    font-size: 13px;
  }
  .resource small {
    font-size: 8px;
  }
  .resource-rate {
    font-size: 8px;
  }
  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(320px, 1fr) 190px;
  }
  .world-panel {
    grid-row: 1;
  }
  .sidebar {
    grid-row: 2;
    padding: 10px 13px 0;
    border-right: 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 130px 1fr;
    grid-template-rows: 29px 1fr 25px;
    gap: 0 12px;
  }
  .village-heading {
    grid-column: 1;
    grid-row: 1/3;
    padding-top: 9px;
  }
  .village-heading > .eyebrow {
    font-size: 7px;
  }
  .village-heading h1 {
    font-size: 24px;
    margin: 6px 0;
  }
  .leaf-mark {
    display: none;
  }
  .settlement-rank {
    font-size: 8px;
  }
  .village-stats {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    margin: 0 0 9px;
    border: 0;
    padding: 0;
  }
  .village-stats button {
    padding: 0 4px;
    grid-template-columns: 15px auto;
    gap: 1px;
  }
  .village-stats svg {
    width: 13px;
    height: 13px;
  }
  .village-stats strong {
    font-size: 12px;
  }
  .stat-label {
    font-size: 7px;
  }
  .village-stats small {
    font-size: 9px;
  }
  .section-heading:not(.journal-heading) {
    display: none;
  }
  .build-tabs {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    padding: 2px;
    height: 27px;
    max-width: 270px;
  }
  .build-tabs button {
    font-size: 9px;
    padding: 4px;
  }
  .build-list {
    grid-column: 2;
    grid-row: 2;
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 0;
    gap: 7px;
  }
  .build-card {
    width: 105px;
    flex-direction: column;
    gap: 5px;
    padding: 7px;
    align-items: flex-start;
  }
  .build-illustration {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 23px;
    height: 23px;
    background: transparent;
  }
  .build-illustration svg {
    width: 21px;
    height: 21px;
  }
  .build-card > div:nth-child(2) {
    padding-top: 28px;
  }
  .build-card h3 {
    font-size: 10px;
  }
  .build-detail {
    font-size: 7px !important;
  }
  .build-plus {
    display: none;
  }
  .cost {
    font-size: 8px;
    gap: 5px;
  }
  .cost svg {
    width: 9px;
    height: 9px;
  }
  .sidebar-foot {
    grid-column: 1/3;
    grid-row: 3;
    padding: 3px 0;
    font-size: 8px;
  }
  .sidebar-foot svg {
    width: 12px;
    height: 12px;
  }
  .info-dot {
    display: none;
  }
  .bottom-bar {
    height: 40px;
    padding: 0 12px;
  }
  .time-label {
    font-size: 6px;
    letter-spacing: 0.5px;
    margin-right: 2px;
  }
  .bottom-bar:after {
    display: none;
  }
  .time-controls {
    gap: 0;
  }
  .save-status {
    font-size: 7px;
  }
  .world-heading {
    top: 15px;
    left: 17px;
  }
  .region-tag {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .world-subtitle {
    font-size: 13px;
    margin-top: 3px;
  }
  .map-badge {
    top: 16px;
    right: 15px;
    font-size: 8px;
    padding: 5px 7px;
  }
  .map-badge svg {
    width: 12px;
    height: 12px;
  }
  .charter-card {
    left: 12px;
    bottom: 34px;
    width: 190px;
    padding: 10px 12px;
  }
  .charter-card h3 {
    font-size: 20px;
    margin: 5px 0;
  }
  .charter-card p {
    font-size: 8px;
    margin-bottom: 6px;
  }
  .charter-heading {
    font-size: 6px;
    letter-spacing: 1px;
  }
  .charter-heading svg {
    width: 11px;
    height: 11px;
  }
  .charter-heading small {
    font-size: 7px;
  }
  .charter-checks {
    gap: 6px;
    font-size: 7px;
  }
  .map-controls {
    right: 12px;
    bottom: 39px;
  }
  .map-controls .icon-button {
    height: 25px;
    width: 23px;
  }
  .map-footer {
    height: 26px;
    font-size: 7px;
    padding: 0 14px;
  }
  .welcome-card {
    width: 265px;
    top: 65px;
    padding: 18px 22px;
    z-index: 5;
  }
  .welcome-card h2 {
    font-size: 28px;
    margin: 9px 0;
  }
  .welcome-card p {
    font-size: 10px;
    margin-bottom: 13px;
  }
  .welcome-card .eyebrow {
    font-size: 7px;
  }
  .welcome-note {
    font-size: 7px;
    margin-top: 10px;
  }
  .primary-button {
    padding: 10px 17px;
    font-size: 10px;
  }
  .selection-card {
    width: 210px;
    right: 12px;
    top: 57px;
    padding: 15px;
  }
  .selection-card h2 {
    font-size: 24px;
  }
  .selection-card p {
    font-size: 9px;
  }
  .build-hint {
    top: 59px;
    font-size: 9px;
    padding: 7px 10px;
    gap: 8px;
  }
  .toast-stack {
    top: 100px;
  }
  .toast {
    font-size: 10px;
    padding: 8px 12px;
  }
  .modal-content {
    padding: 26px;
  }
  .modal-content h2 {
    font-size: 32px;
  }
  .building-tooltip {
    display: none;
  }
  .claim-button {
    font-size: 9px;
    padding: 6px;
  }
}
.quick-actions {
  display: none;
  position: absolute;
  right: 20px;
  top: 70px;
  gap: 5px;
}
.quick-actions button {
  background: var(--theme-overlay, #f4f3e5cf);
  border: 1px solid var(--theme-line, #c4cfb2);
  border-radius: 5px;
  width: 31px;
  height: 29px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-muted, #7c8d67);
}
.quick-actions svg {
  width: 15px;
  height: 15px;
}
@media (max-width: 1000px) {
  .quick-actions {
    display: flex;
  }
  .world-panel:has(.selection-card:not(.hidden)) .quick-actions {
    display: none;
  }
}
@media (max-width: 740px) {
  .quick-actions {
    right: 14px;
    top: 50px;
  }
  .world-panel:has(.build-hint:not(.hidden)) .quick-actions {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.camera-controls {
  position: absolute;
  right: 18px;
  bottom: 50px;
  width: 154px;
  margin-right: 46px;
  padding: 11px 12px 8px;
  background: var(--theme-overlay, #f7f4e9ed);
  border: 1px solid var(--theme-line, #b5bea3);
  border-radius: 8px;
  box-shadow: 0 3px 12px #42543c12;
  color: var(--theme-ink, #50634e);
  z-index: 2;
  user-select: none;
}
.camera-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 1.6px;
  margin-bottom: 7px;
}
.camera-heading output {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  color: var(--theme-muted, #78826a);
}
.camera-directions {
  display: flex;
  gap: 5px;
}
.camera-directions button {
  flex: 1;
  height: 29px;
  border: 1px solid var(--theme-line, #c6cdb7);
  background: transparent;
  border-radius: 4px;
  color: var(--theme-ink, #5e7059);
  font:
    12px Georgia,
    serif;
  cursor: pointer;
}
.camera-directions button:hover {
  background: var(--theme-surface, #e7ecdc);
}
.camera-directions button[aria-pressed="true"] {
  background: #496a57;
  border-color: var(--theme-line-strong, #496a57);
  color: #fff6d9;
}
.camera-controls small {
  display: block;
  margin-top: 8px;
  text-align: center;
  font-size: 8px;
  color: var(--theme-muted, #849078);
  letter-spacing: 0.2px;
}
#world.rotating {
  cursor: ew-resize;
}
@media (max-width: 740px) {
  .camera-controls {
    top: 112px;
    bottom: auto;
    right: 12px;
    margin: 0;
    width: 136px;
    padding: 8px 10px;
  }
  .camera-controls small {
    display: none;
  }
  .camera-directions button {
    height: 28px;
  }
}

.daylight-badge {
  display: table;
  margin-top: 10px;
  padding: 4px 8px;
  border: 1px solid var(--theme-line, #b8c2a755);
  background: var(--theme-overlay, #f7f4e9cc);
  border-radius: 12px;
  font-size: 9px;
  letter-spacing: 0.5px;
  color: var(--theme-ink, #596e60);
}
@media (max-width: 740px) {
  .daylight-badge {
    margin-top: 6px;
    font-size: 8px;
    padding: 3px 7px;
  }
}

.world-heading .region-tag,
.world-heading .world-subtitle {
  transition: color 2s;
}
.is-night .world-heading .region-tag,
.is-night .world-heading .world-subtitle {
  color: #d4ddce;
}

/* Winter stores: a small ledger beside the seasonal calendar. */
.winter-card {
  flex-shrink: 0;
  margin-top: 18px;
  padding: 15px 13px;
  border: 1px solid var(--theme-line, #d7ddc7);
  border-radius: 6px;
  background: var(--theme-surface, #edf0e3);
  color: var(--theme-ink, #4b624e);
}
.winter-card .eyebrow {
  font-size: 8px;
  letter-spacing: 1.1px;
  color: var(--theme-muted, #748169);
}
.winter-card h3 {
  font: 400 24px var(--serif);
  margin: 5px 0 13px;
}
.winter-supply + .winter-supply {
  margin-top: 11px;
}
.winter-supply > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
}
.winter-supply > div > span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.winter-supply svg {
  width: 14px;
  height: 14px;
}
.winter-supply strong {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.winter-supply small {
  font-size: 10px;
  font-weight: 400;
  color: var(--theme-muted, #7d886f);
}
.winter-supply progress {
  appearance: none;
  display: block;
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 7px;
  background: var(--theme-surface, #dce2ce);
  color: var(--theme-muted, #7f9670);
}
.winter-supply progress::-webkit-progress-bar {
  background: var(--theme-surface, #dce2ce);
}
.winter-supply progress::-webkit-progress-value {
  background: #7f9670;
  border-radius: 4px;
}
.winter-supply progress::-moz-progress-bar {
  background: #7f9670;
  border-radius: 4px;
}
.winter-card > p {
  font-size: 10px;
  line-height: 1.6;
  margin: 11px 0 9px;
}
.winter-card > button {
  width: 100%;
  border: 1px solid var(--theme-line, #bbc7ab);
  border-radius: 4px;
  background: var(--theme-raised, #faf8ed);
  padding: 9px 6px;
  font-size: 10px;
  text-align: left;
}
.winter-card > button:hover {
  background: var(--theme-raised, #fffdf6);
}
.winter-card.needs-supplies {
  border-color: var(--theme-line, #d5b48b);
  background: var(--theme-warm, #f2e9d8);
  color: var(--theme-gold, #88613e);
}
.winter-button {
  position: relative;
}
.winter-button.needs-supplies {
  background: var(--theme-warm, #eee0c7);
  color: var(--theme-gold, #926438);
}
.winter-button.reward-ready:after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #54734d;
  outline: 2px solid var(--paper-light);
}
.winter-reserves {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding: 18px 0;
  border-block: 1px solid var(--line);
  margin-top: 18px;
}
.winter-reserves .winter-supply {
  margin: 0;
}
.winter-reserves .winter-supply > div {
  font-size: 12px;
}
.winter-reserves .winter-supply strong {
  font-size: 17px;
}
.winter-reserves .winter-supply p {
  font-size: 10px;
  line-height: 1.6;
  margin: 9px 0 0;
}
.modal-content .winter-forecast {
  font-weight: 600;
  color: var(--theme-ink, #52704f);
  margin-bottom: 8px;
}
.modal-content .winter-forecast.needs-supplies {
  color: var(--theme-danger, #9a623c);
}
.winter-advice {
  padding-left: 18px;
  font-size: 11px;
  line-height: 1.8;
  color: var(--theme-ink, #6e795f);
  margin-top: 0;
}
.winter-advice li + li {
  margin-top: 5px;
}
.winter-challenge {
  margin: 20px 0 15px;
  background: var(--theme-surface, #edf0e3);
  border-left: 3px solid var(--theme-line-strong, #81956c);
  padding: 15px 17px;
}
.winter-challenge p {
  font-size: 12px;
  margin: 9px 0 !important;
}
.winter-challenge > strong {
  font: 400 22px var(--serif);
}
.winter-challenge > small {
  display: block;
  color: var(--theme-muted, #738168);
  margin-top: 10px;
  font-size: 10px;
}
.winter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
@media (max-width: 740px) {
  .winter-reserves {
    gap: 15px;
  }
  .winter-actions > button {
    flex: 1;
    gap: 6px;
  }
  .winter-button {
    width: 28px;
  }
}
.winter-rate {
  white-space: nowrap;
}
dialog:has(.winter-reserves) {
  width: min(540px, calc(100% - 32px));
}
.modal-content:has(.winter-reserves) {
  padding-top: 24px;
  padding-bottom: 24px;
}
.winter-reserves {
  padding-block: 14px;
}
.winter-challenge {
  margin-top: 16px;
  margin-bottom: 12px;
}
.winter-actions {
  margin-top: 16px;
}

/* A living postcard: the village becomes the whole frame. */
.cinema-launch {
  position: absolute;
  left: 22px;
  top: 101px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--theme-line, #c6cbb5);
  background: var(--theme-overlay, #faf7e8d9);
  border-radius: 20px;
  padding: 7px 12px;
  color: var(--theme-ink, #61725c);
  font-size: 10px;
  box-shadow: 0 2px 8px #293b2610;
  backdrop-filter: blur(8px);
}
.cinema-launch:hover {
  background: var(--theme-raised, #fffbed);
  box-shadow: 0 3px 16px #293b2620;
}
.cinema-launch > span {
  font-size: 17px;
  line-height: 10px;
}
.cinema-overlay[hidden] {
  display: none;
}
.cinema-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  color: #fff2d2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(
    #101e2560,
    transparent 19%,
    transparent 60%,
    #0e1c2aae
  );
  padding: 32px 40px 28px;
  text-shadow: 0 2px 14px #0b19277a;
}
.cinema-masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.cinema-masthead > span {
  font-size: 11px;
  letter-spacing: 4px;
}
.cinema-overlay button {
  pointer-events: auto;
  color: #f8f0d9;
  backdrop-filter: blur(16px);
  border: 1px solid var(--theme-line, #e6e6cd40);
  background: #132a2d80;
  border-radius: 5px;
  min-height: 38px;
  font-size: 11px;
  padding: 10px 15px;
  text-shadow: none;
}
.cinema-overlay button:hover {
  background: #355047cc;
  border-color: var(--theme-line, #eeedd580);
}
.cinema-masthead button {
  display: flex;
  gap: 28px;
  align-items: center;
}
.cinema-caption {
  margin-top: auto;
  margin-bottom: 28px;
}
.cinema-caption .eyebrow {
  color: #e3d9bd;
  font-size: 9px;
  letter-spacing: 3px;
}
.cinema-caption h2 {
  font: 400 clamp(32px, 4.6vw, 68px)/1.1 var(--serif);
  letter-spacing: -0.8px;
  margin: 12px 0 9px;
}
.cinema-caption p {
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #e5e2cc;
  margin: 0;
}
.cinema-dock {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--theme-line, #fff4d826);
  padding-top: 18px;
}
.cinema-scenes {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.cinema-scenes button[aria-pressed="true"] {
  background: var(--theme-warm, #f0e3bf);
  color: var(--theme-ink, #354638);
  border-color: var(--theme-line, #f0e3bf);
  box-shadow: 0 2px 18px #f4cf8c18;
}
.cinema-tools {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px 12px;
  font-size: 9px;
  color: #e1dfcc;
}
.cinema-tools button {
  grid-row: 1/3;
  min-height: 42px;
}
.cinema-tools button[aria-pressed="true"] {
  border-color: var(--theme-line, #bacead);
  background: #436347a8;
}
.cinema-tools small {
  font-size: 8px;
  letter-spacing: 0.5px;
  opacity: 0.8;
}
body.cinematic .topbar,
body.cinematic .sidebar,
body.cinematic .right-sidebar,
body.cinematic .bottom-bar {
  display: none;
}
body.cinematic .app {
  min-height: 0;
  height: 100dvh;
}
body.cinematic .game-layout {
  display: block;
  height: 100%;
  flex: 1;
}
body.cinematic .world-panel {
  width: 100%;
  height: 100%;
  border: 0;
}
body.cinematic .world-panel > :not(#world):not(.cinema-overlay) {
  display: none !important;
}
@media (max-width: 740px) {
  .cinema-launch {
    top: 81px;
    left: 16px;
    font-size: 9px;
    padding: 6px 10px;
  }
  .cinema-overlay {
    padding: 20px 18px;
  }
  .cinema-masthead > span {
    font-size: 9px;
    letter-spacing: 2px;
  }
  .cinema-masthead button {
    font-size: 10px;
    padding: 8px 11px;
    gap: 12px;
  }
  .cinema-caption {
    margin-bottom: 22px;
  }
  .cinema-caption .eyebrow {
    font-size: 7px;
    letter-spacing: 2px;
  }
  .cinema-caption h2 {
    font-size: 37px;
    max-width: 300px;
  }
  .cinema-caption p {
    font-size: 10px;
  }
  .cinema-dock {
    display: block;
    padding-top: 14px;
  }
  .cinema-scenes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }
  .cinema-scenes button {
    font-size: 10px;
    padding: 9px 7px;
  }
  .cinema-tools {
    margin-top: 12px;
    grid-template-columns: auto 1fr;
  }
  .cinema-tools button {
    font-size: 10px;
  }
  .cinema-tools span {
    font-size: 8px;
  }
  .cinema-tools small {
    font-size: 7px;
  }
}
.cinema-masthead > div {
  display: flex;
  gap: 8px;
}
.cinema-masthead #cinema-save {
  background: var(--theme-overlay, #e6d4a51a);
}
@media (max-width: 740px) {
  .cinema-masthead {
    gap: 10px;
  }
  .cinema-masthead > div {
    gap: 6px;
  }
  .cinema-masthead button {
    padding-inline: 9px;
    gap: 6px;
  }
}
.postcard-preview {
  display: block;
  width: 100%;
  max-height: 55dvh;
  object-fit: contain;
  border-radius: 5px;
  margin: 18px 0 12px;
}
.postcard-download {
  text-decoration: none;
}
dialog:has(.postcard-preview) {
  width: min(760px, calc(100% - 32px));
}
.cinema-tools {
  grid-template-columns: auto auto 1fr;
}
.cinema-tools > #cinema-orbit {
  grid-column: 1;
}
.cinema-zoom {
  display: flex;
  grid-column: 2;
  grid-row: 1/3;
  gap: 3px;
}
.cinema-zoom button {
  padding: 8px 10px;
  font-size: 17px;
}
.cinema-tools > span {
  grid-column: 3;
  grid-row: 1;
}
.cinema-tools > small {
  grid-column: 3;
  grid-row: 2;
}
@media (max-width: 740px) {
  .cinema-tools {
    gap: 5px 8px;
    grid-template-columns: auto auto 1fr;
  }
  .cinema-zoom button {
    padding: 7px 9px;
  }
  .cinema-tools > small {
    line-height: 1.5;
  }
}

/* The explorers' ledger shares the village's ink, timber and parchment. */
.adventure-launch {
  position: absolute;
  left: 22px;
  top: 140px;
  display: flex;
  gap: 9px;
  align-items: center;
  background: #324c3d;
  color: #fff3d4;
  border: 1px solid var(--theme-line-strong, #223a2c);
  border-radius: 7px;
  padding: 10px 14px;
  box-shadow: 0 3px 14px #213e3425;
  text-align: left;
}
.adventure-launch svg {
  width: 26px;
  height: 26px;
}
.adventure-launch strong {
  display: block;
  font:
    18px Georgia,
    serif;
}
.adventure-launch small {
  display: block;
  font-size: 9px;
  margin-top: 4px;
  color: #d0d9b8;
}
.adventure-launch:hover {
  background: #42614c;
}
.adventure-launch.party-home {
  background: #856027;
  border-color: var(--theme-line-strong, #b5914c);
}
.cinematic .adventure-launch {
  display: none;
}
dialog:has(.adventure-book) {
  width: min(850px, calc(100% - 28px));
}
.adventure-heading {
  padding: 2px 0 16px;
}
.adventure-heading h2 {
  margin: 12px 0 6px;
}
.adventure-heading p {
  margin-bottom: 0;
  font-style: italic;
}
.adventure-tabs {
  display: flex;
  border-bottom: 1px solid var(--theme-line, #c8cdb6);
  margin: 0 0 22px;
  gap: 20px;
}
.adventure-tabs button {
  padding: 12px 0;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--theme-muted, #75816a);
  font-size: 12px;
  cursor: pointer;
}
.adventure-tabs button[aria-pressed="true"] {
  border-color: var(--theme-line-strong, #567447);
  color: var(--theme-ink, #344a30);
  font-weight: 700;
}
.trail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}
.trail-card {
  border: 1px solid var(--theme-line, #c7cbb5);
  border-radius: 8px;
  overflow: hidden;
  background: var(--theme-raised, #fbf8eb);
  display: flex;
  flex-direction: column;
}
.trail-art {
  height: 110px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 15% 140%, #4e6c58 0 50%, transparent 51%),
    radial-gradient(ellipse at 90% 120%, #738568 0 55%, transparent 56%),
    var(--theme-surface, #d9dfc6);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #faf3d8;
}
.trail-art > svg {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 2px 3px #23382966);
}
.trail-art > span {
  position: absolute;
  bottom: 9px;
  left: 12px;
  font-size: 8px;
  letter-spacing: 1.4px;
}
.trail-ruins .trail-art {
  background:
    radial-gradient(ellipse at 0 120%, #778780 0 50%, transparent 51%),
    radial-gradient(ellipse at 95% 120%, #4a6770 0 60%, transparent 61%),
    var(--theme-surface, #cfdbd4);
}
.trail-ridge .trail-art {
  background: conic-gradient(
    from 140deg at 70% 0%,
    #b59b69,
    var(--theme-soft, #ddd2ad),
    #67716c,
    #b59b69
  );
}
.trail-locked .trail-art {
  filter: saturate(0.3);
}
.trail-copy {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.adventure-book h3 {
  font:
    23px/1.1 Georgia,
    serif;
  color: var(--theme-ink, #384a35);
  margin: 8px 0 12px;
}
.trail-copy .eyebrow {
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: 1px;
}
.trail-meta {
  font-size: 10px;
  color: var(--theme-ink, #657354);
}
.trail-copy p {
  font-size: 11px;
  line-height: 1.6;
  min-height: 53px;
}
.trail-copy .cost {
  margin: 7px 0 15px;
  gap: 10px;
}
.trail-copy .primary-button {
  font-size: 11px;
  padding: 11px 9px;
  margin-top: auto;
  width: 100%;
}
.trail-requirement {
  font-size: 10px;
  line-height: 1.5;
  margin-top: 10px;
  color: var(--theme-gold, #8a6444);
}
.book-close {
  margin-top: 12px;
}
.journey-progress,
.homecoming {
  border: 1px solid var(--theme-line, #abb88e);
  padding: 20px;
  background: var(--theme-surface, #e9edd8);
  border-radius: 7px;
  margin-bottom: 20px;
}
.journey-progress progress {
  width: 100%;
  height: 7px;
  accent-color: #64804b;
}
.journey-progress p,
.homecoming p {
  font-size: 12px;
}
.reward-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.reward-choices .event-choice {
  margin: 0;
  background: var(--theme-raised, #fbf8eb);
}
.reward-choices .event-choice small {
  line-height: 1.5;
}
.improvement-list,
.discovery-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}
.improvement-row,
.discovery {
  display: flex;
  gap: 14px;
  border: 1px solid var(--theme-line, #c7cbb5);
  background: var(--theme-raised, #faf8ed);
  padding: 17px;
  border-radius: 7px;
}
.improvement-icon svg,
.discovery > span svg {
  height: 28px;
  width: 28px;
  color: var(--theme-muted, #72876a);
}
.improvement-row h3,
.discovery h3 {
  font-size: 21px;
}
.improvement-row p,
.discovery p {
  font-size: 11px;
}
.improvement-row .cost {
  margin: 10px 0;
}
.improvement-row .secondary-button {
  font-size: 10px;
  padding: 9px 11px;
}
.improvement-row .eyebrow,
.discovery .eyebrow {
  font-size: 8px;
  letter-spacing: 1px;
}
.discovery small {
  font-size: 10px;
  color: var(--theme-muted, #7f8b73);
}
.discovered {
  background: var(--theme-surface, #e9edd8);
  border-color: var(--theme-line-strong, #a7b28b);
}
.improved-label {
  display: inline-block;
  font: 10px sans-serif;
  color: var(--theme-accent, #547142);
  background: var(--theme-surface, #e6ecd6);
  border-radius: 4px;
  padding: 5px 7px;
  vertical-align: middle;
}
.upgrade-detail {
  border-top: 1px solid var(--theme-line, #c7cbb5);
  margin-top: 14px;
  padding-top: 13px;
}
.upgrade-detail > strong {
  font:
    17px Georgia,
    serif;
}
.upgrade-detail .cost {
  margin: 9px 0;
}
.selection-card {
  max-height: calc(100% - 110px);
  overflow-y: auto;
}
@media (max-width: 740px) {
  .adventure-launch {
    left: 16px;
    top: 114px;
    padding: 8px 10px;
    gap: 7px;
  }
  .adventure-launch strong {
    font-size: 15px;
  }
  .adventure-launch small {
    font-size: 8px;
  }
  .adventure-launch svg {
    width: 21px;
    height: 21px;
  }
  .adventure-tabs {
    gap: 15px;
    margin-bottom: 17px;
  }
  .adventure-tabs button {
    font-size: 10px;
  }
  .trail-grid,
  .improvement-list,
  .discovery-list,
  .reward-choices {
    grid-template-columns: 1fr;
  }
  .trail-card {
    display: grid;
    grid-template-columns: 76px 1fr;
  }
  .trail-art {
    height: 100%;
    min-height: 240px;
  }
  .trail-art > svg {
    width: 40px;
    height: 40px;
  }
  .trail-art > span {
    writing-mode: vertical-rl;
    bottom: 14px;
    left: 9px;
  }
  .trail-copy p {
    min-height: 0;
  }
  .trail-copy h3 {
    font-size: 23px;
  }
  .trail-copy .primary-button {
    margin-top: 0;
  }
  .adventure-heading .eyebrow {
    font-size: 8px;
    letter-spacing: 1.3px;
  }
  .adventure-heading h2 {
    font-size: 34px;
  }
  .selection-card {
    max-height: calc(100% - 92px);
  }
  .world-panel:has(.selection-card:not(.hidden)) .adventure-launch {
    display: none;
  }
}

.audio-settings {
  padding: 16px 0 20px;
  border-bottom: 1px solid var(--theme-line, #d6dac8);
}
.audio-settings label {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: var(--theme-ink, #526749);
  margin: 4px 0 10px;
}
.audio-settings output {
  font-size: 10px;
  color: var(--theme-muted, #718264);
}
.audio-settings input[type="range"] {
  width: 100%;
  margin: 0 0 20px;
  accent-color: #58724c;
  cursor: pointer;
}
.audio-settings .secondary-button {
  font-size: 11px;
  padding: 9px 14px;
}
.audio-settings .modal-note {
  line-height: 1.65;
}

/* A pocket-sized valley: the map stays open; the village lives in sheets. */
.mobile-dock,
.mobile-calendar {
  display: none;
}
.mobile-sheet h3 {
  font: 28px var(--serif);
  font-weight: 400;
  margin: 18px 0 12px;
}
.mobile-sheet > p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--theme-muted, #77806d);
}
.mobile-build-tabs {
  display: flex;
  gap: 7px;
  margin: 22px 0 14px;
}
.mobile-build-tabs button {
  flex: 1;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  font-size: 12px;
}
.mobile-build-tabs button[aria-pressed="true"] {
  background: var(--green);
  border-color: var(--green);
  color: var(--paper-light);
}
.mobile-build-list {
  display: grid;
  gap: 9px;
  grid-template-columns: 1fr 1fr;
}
.mobile-build-list .build-card {
  width: auto;
  min-width: 0;
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px;
  border-radius: 10px;
}
.mobile-build-list .build-card .build-illustration {
  position: static;
  width: 32px;
  height: 32px;
  background: none;
}
.mobile-build-list .build-illustration svg {
  width: 30px;
  height: 30px;
}
.mobile-build-list .build-card > div:nth-child(2) {
  padding: 0;
}
.mobile-build-list .build-card h3 {
  font: 19px var(--serif);
  margin: 0 0 5px;
}
.mobile-build-list .build-detail {
  font-size: 10px !important;
  line-height: 1.4;
}
.mobile-build-list .cost {
  font-size: 11px;
  margin-top: 10px;
  gap: 9px;
}
.mobile-build-list .cost svg {
  height: 12px;
  width: 12px;
}
.mobile-build-list .build-plus {
  display: none;
}
.mobile-village-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0;
}
.mobile-village-stats button {
  padding: 17px 10px;
  background: var(--theme-surface, #ebefdf);
  border: 1px solid var(--theme-line, #d7dec8);
  border-radius: 9px;
  text-align: left;
}
.mobile-village-stats strong {
  display: block;
  font: 29px var(--serif);
}
.mobile-village-stats span {
  display: block;
  font-size: 10px;
  color: var(--theme-muted, #77806d);
  margin-top: 5px;
}
.mobile-ledger {
  border-block: 1px solid var(--line);
  padding: 8px 0;
}
.mobile-ledger > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.mobile-ledger svg {
  width: 18px;
  height: 18px;
  color: var(--theme-muted, #8c906a);
}
.mobile-ledger span {
  flex: 1;
  font-size: 12px;
}
.mobile-ledger strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.mobile-ledger small {
  width: 76px;
  text-align: right;
  font-size: 10px;
  color: var(--theme-muted, #778b62);
}
.mobile-ledger .negative {
  color: var(--theme-danger, #a1654f);
}
.mobile-charter {
  margin: 22px 0;
  padding: 19px;
  background: var(--theme-surface, #eee9d8);
  border: 1px solid var(--theme-line, #ded5bb);
  border-radius: 10px;
}
.mobile-charter h3 {
  margin: 9px 0;
}
.mobile-charter p {
  font-size: 12px;
  line-height: 1.65;
}
.mobile-charter .charter-checks {
  font-size: 10px;
  gap: 12px;
  flex-wrap: wrap;
}
.mobile-charter .primary-button {
  margin-top: 15px;
  width: 100%;
}
.mobile-menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 13px;
  min-height: 70px;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}
.mobile-menu-item > span:first-child {
  background: var(--theme-surface, #e8eddc);
  border-radius: 9px;
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--theme-ink, #627951);
}
.mobile-menu-item > span:nth-child(2) {
  flex: 1;
}
.mobile-menu-item strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
}
.mobile-menu-item small {
  display: block;
  font-size: 10px;
  line-height: 1.5;
  color: var(--theme-muted, #87917a);
  margin-top: 4px;
}
.mobile-menu-item b {
  font-weight: 400;
  color: var(--theme-muted, #8b9b76);
}
.mobile-journal .journal-item {
  padding: 12px 0;
}
.mobile-journal .journal-item p {
  font-size: 12px;
  line-height: 1.65;
}
.mobile-journal .journal-item small {
  font-size: 9px;
}
.mobile-sheet-close {
  width: 100%;
  margin-top: 22px;
  min-height: 46px !important;
}
.mobile-gather {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.mobile-gather button {
  flex: 1;
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 8px;
  background: var(--theme-surface, #eeeade);
  border: 1px solid var(--theme-line, #d8d8c4);
  border-radius: 7px;
  font-size: 11px;
}
.mobile-gather svg {
  width: 17px;
  height: 17px;
}
.mobile-speed {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}
.mobile-speed button {
  flex: 1;
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.mobile-speed button[aria-pressed="true"] {
  background: var(--green);
  color: var(--paper-light);
}
.mobile-speed button:last-child {
  flex: 2;
}
.gesture-guide {
  margin: 24px 0;
  padding: 4px 17px;
  background: var(--theme-surface, #e9eddf);
  border-radius: 9px;
}
.gesture-guide p {
  font-size: 12px;
  line-height: 1.7;
}
.gesture-guide strong {
  display: block;
  font-weight: 500;
  color: var(--theme-ink, #3f6049);
}
.mobile-directions,
.mobile-camera-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.mobile-directions button,
.mobile-camera-actions button {
  flex: 1;
  min-height: 48px;
  border: 1px solid var(--theme-line, #c5cfb7);
  border-radius: 8px;
  background: transparent;
}
.mobile-directions button {
  font: 23px var(--serif);
}
.mobile-directions button[aria-pressed="true"] {
  background: var(--green);
  color: var(--paper-light);
}
.mobile-camera-actions button:nth-child(2) {
  flex: 4;
  font-size: 12px;
}
/* Keep compact-layout media queries in sync with app.js. Touch tablets retain this layout with a trackpad attached. */
@media (max-width: 1180px), (max-width: 1440px) and (any-pointer: coarse) {
  html:has(.app),
  body:has(.app) {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }
  .app {
    height: 100dvh;
    min-height: 0;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) 0
      env(safe-area-inset-left);
    background: var(--paper-light);
  }
  .topbar {
    height: 60px;
    min-height: 60px;
    padding: 7px 12px;
    gap: 0;
    border-bottom: 1px solid var(--theme-line, #d9dec9);
    position: relative;
    z-index: 3;
  }
  .topbar .brand,
  .topbar .top-actions,
  .sidebar,
  .right-sidebar,
  .bottom-bar {
    display: none;
  }
  .resource-bar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
    order: 0;
  }
  .resource {
    min-width: 0;
    min-height: 44px;
    padding: 5px 6px;
    gap: 6px;
    background: none;
    border: 0;
    border-radius: 5px;
    justify-content: center;
    overflow: hidden;
  }
  .resource-icon svg {
    width: 17px;
    height: 20px;
  }
  .resource strong {
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
  }
  .resource small {
    font-size: 8px;
    line-height: 1.1;
    margin-top: 3px;
  }
  .resource {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: auto auto auto;
    column-gap: 5px;
    row-gap: 0;
    padding-block: 2px;
    align-content: center;
  }
  .resource .resource-details,
  .resource .resource-caption {
    display: contents;
  }
  .resource-icon {
    grid-column: 1;
    grid-row: 1 / 3;
  }
  .resource strong {
    grid-column: 2;
    grid-row: 1;
  }
  .resource small {
    grid-column: 2;
    grid-row: 2;
    margin-top: 1px;
  }
  .resource-rate {
    display: block;
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: center;
    margin: 2px 0 0;
    font-size: 10px;
    line-height: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--theme-accent, #496e45);
  }
  .resource-rate.negative {
    color: var(--theme-danger, #9b503a);
  }
  .resource-rate-unit {
    margin-left: 2px;
    font-size: 8px;
    font-weight: 400;
  }
  .resource > span:nth-child(2) {
    min-width: 0;
  }
  .resource strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .game-layout {
    display: block;
    position: relative;
    flex: 1;
    min-height: 0;
  }
  .world-panel {
    height: 100%;
    width: 100%;
    border: 0;
    border-radius: 0;
    overflow: hidden;
  }
  #world {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
  }
  .world-heading,
  .map-badge,
  .world-panel > .charter-card,
  .camera-controls,
  .map-controls,
  .map-footer,
  .quick-actions,
  .adventure-launch,
  .cinema-launch {
    display: none !important;
  }
  .mobile-calendar {
    display: block;
    position: absolute;
    top: 13px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 10px;
    letter-spacing: 0.4px;
    color: var(--theme-ink, #506552);
    background: var(--theme-overlay, #f6f4e6d9);
    border: 1px solid var(--theme-line, #f7f6ed99);
    padding: 6px 11px;
    border-radius: 20px;
    pointer-events: none;
  }
  .mobile-dock {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 52px;
    gap: 7px;
    align-items: center;
    padding: 9px 14px calc(9px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--theme-line, #d4dbc5);
    background: var(--paper-light);
    flex-shrink: 0;
    z-index: 5;
  }
  .mobile-dock button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    min-width: 44px;
    min-height: 49px;
    background: none;
    border: 0;
    border-radius: 9px;
    color: var(--theme-ink, #5c7152);
    font-size: 10px;
  }
  .mobile-dock button:first-child {
    background: #3f6049;
    color: #fff4d8;
  }
  .mobile-dock button > span:first-child svg {
    width: 21px;
    height: 21px;
  }
  .mobile-dock #mobile-pause {
    border: 1px solid var(--theme-line, #d7ddc8);
    min-height: 44px;
    width: 44px;
    justify-self: end;
  }
  .mobile-dock #mobile-pause svg {
    width: 17px;
    height: 17px;
  }
  .mobile-dock i {
    position: absolute;
    top: 5px;
    right: calc(50% - 17px);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b89543;
    border: 1px solid var(--paper-light);
  }
  .mobile-dock i[hidden] {
    display: none;
  }
  .welcome-card {
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(300px, calc(100% - 40px));
    padding: 24px;
    max-height: calc(100% - 24px);
    overflow: auto;
  }
  .welcome-card h2 {
    font-size: 32px;
  }
  .welcome-card p {
    font-size: 12px;
    line-height: 1.6;
  }
  .welcome-card .primary-button {
    min-height: 46px;
    font-size: 12px;
  }
  .welcome-note {
    font-size: 9px;
  }
  .selection-card {
    top: auto;
    bottom: 12px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: min(58dvh, 420px);
    overflow: auto;
    border-radius: 16px;
    padding: 22px;
    overscroll-behavior: contain;
    box-shadow: 0 8px 40px #283d3533;
  }
  .selection-card h2 {
    font-size: 29px;
    padding-right: 35px;
  }
  .selection-card p {
    font-size: 12px;
  }
  .selection-card .close-button {
    min-width: 44px;
    min-height: 44px;
  }
  .selection-card button {
    min-height: 44px;
  }
  .selection-card .worker-control button {
    width: 44px;
  }
  .selection-card .modal-note {
    font-size: 11px !important;
  }
  .build-hint {
    top: auto;
    bottom: 12px;
    left: 12px;
    right: 12px;
    transform: none;
    white-space: normal;
    z-index: 4;
    padding: 12px;
    gap: 8px;
    border-radius: 12px;
    box-shadow: 0 6px 25px #253f3430;
  }
  .build-hint > span {
    flex: 1;
    min-width: 0;
  }
  .build-hint strong {
    font-size: 13px;
    font-weight: 500;
    display: block;
  }
  .build-hint small {
    font-size: 10px;
    line-height: 1.5;
    color: #d9e2c9;
    display: block;
    margin-top: 4px;
  }
  .build-hint button {
    height: 44px;
    min-width: 44px;
    width: auto;
    padding: 0 12px;
    font-size: 11px;
  }
  .build-hint #touch-place {
    background: var(--theme-warm, #f1e8c8);
    color: var(--theme-ink, #3e573a);
  }
  .build-hint #cancel-build {
    padding: 0;
    font-size: 22px;
  }
  .toast-stack {
    top: 48px;
    left: 16px;
    right: 16px;
    width: auto;
    transform: none;
    pointer-events: none;
  }
  .toast {
    font-size: 11px;
    line-height: 1.5;
    padding: 11px 14px;
    max-width: 100%;
    white-space: normal;
  }
  dialog {
    position: fixed;
    inset: auto 0 0;
    margin: 0 auto;
    width: 100%;
    max-width: 540px;
    max-height: calc(100dvh - env(safe-area-inset-top) - 18px);
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    overscroll-behavior: contain;
    animation: mobile-sheet-in 0.2s ease-out;
  }
  dialog:has(.adventure-book),
  dialog:has(.postcard-preview) {
    width: 100%;
    max-width: 540px;
  }
  .modal-content {
    padding: 30px 22px calc(24px + env(safe-area-inset-bottom));
  }
  .modal-content:before {
    content: "";
    display: block;
    position: absolute;
    top: 10px;
    left: calc(50% - 18px);
    width: 36px;
    height: 3px;
    background: var(--theme-soft, #cbd1bc);
    border-radius: 3px;
  }
  .modal-content > .close-button {
    top: 17px;
    right: 12px;
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
  .modal-content h2 {
    font-size: 35px;
    padding-right: 24px;
    margin: 14px 0;
  }
  .modal-content .eyebrow {
    font-size: 8px;
    letter-spacing: 1.5px;
  }
  .modal-content button,
  .modal-content .primary-button,
  .modal-content .secondary-button {
    min-height: 44px;
  }
  .modal-content input[type="range"] {
    min-height: 30px;
  }
  .modal-content .settings-row {
    font-size: 12px;
  }
  .modal-content .trade-row button {
    font-size: 11px;
    padding: 8px;
  }
  .modal-content .audio-settings label {
    font-size: 12px;
  }
  .modal-content .trail-art {
    min-height: 220px;
  }
  .cinematic .mobile-dock,
  .cinematic .mobile-calendar {
    display: none;
  }
  .cinematic .app {
    padding: 0;
  }
  .cinema-overlay {
    padding: calc(15px + env(safe-area-inset-top))
      calc(16px + env(safe-area-inset-right))
      calc(16px + env(safe-area-inset-bottom))
      calc(16px + env(safe-area-inset-left));
  }
  .cinema-overlay button {
    min-height: 44px;
  }
}
@media (max-width: 374px) {
  .resource {
    padding-inline: 2px;
    gap: 4px;
  }
  .resource strong {
    font-size: 12px;
  }
  .mobile-dock {
    padding-inline: 10px;
  }
  .modal-content {
    padding-inline: 18px;
  }
}
@media (max-width: 1000px) and (max-height: 500px) {
  .topbar {
    height: 48px;
    min-height: 48px;
    padding-block: 2px;
  }
  .mobile-dock {
    padding-top: 4px;
    padding-bottom: calc(4px + env(safe-area-inset-bottom));
    grid-template-columns: 1fr 1fr 1fr 52px;
  }
  .mobile-dock button {
    min-height: 44px;
    flex-direction: row;
    gap: 9px;
  }
  .welcome-card {
    padding: 15px 22px;
  }
  .welcome-card h2 {
    font-size: 26px;
  }
  .welcome-card p,
  .welcome-note {
    display: none;
  }
  .selection-card {
    max-height: 70dvh;
  }
  .mobile-calendar {
    top: 8px;
  }
}
@keyframes mobile-sheet-in {
  from {
    opacity: 0;
    translate: 0 20px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

/* Tablets keep the valley edge-to-edge, with floating controls and roomy ledgers. */
@media (min-width: 741px) and (max-width: 1180px) and (min-height: 501px),
  (min-width: 741px) and (max-width: 1440px) and (min-height: 501px) and (any-pointer: coarse) {
  .app {
    position: relative;
  }
  .topbar {
    position: absolute;
    top: calc(16px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    width: min(600px, calc(100% - 64px));
    height: 64px;
    min-height: 64px;
    padding: 8px 16px;
    border: 1px solid var(--theme-line, #d6dcc7);
    border-radius: 15px;
    background: var(--theme-overlay, #faf8f0f2);
    box-shadow: 0 5px 24px #2a493521;
    backdrop-filter: blur(12px);
  }
  .resource-bar {
    gap: 12px;
  }
  .resource {
    column-gap: 10px;
    min-height: 46px;
    padding: 2px 9px;
  }
  .resource-icon svg {
    width: 22px;
    height: 24px;
  }
  .resource strong {
    font-size: 16px;
  }
  .resource small {
    font-size: 9px;
    margin-top: 1px;
  }
  .mobile-calendar {
    top: 91px;
    font-size: 11px;
    padding: 7px 13px;
  }
  .mobile-dock {
    position: absolute;
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: 460px;
    max-width: calc(100% - 48px);
    padding: 8px 10px;
    grid-template-columns: 1fr 1fr 1fr 50px;
    gap: 8px;
    border: 1px solid var(--theme-line, #d6dcc7);
    border-radius: 17px;
    background: var(--theme-overlay, #faf8f0f2);
    box-shadow: 0 8px 32px #2a49352e;
    backdrop-filter: blur(12px);
  }
  .mobile-dock button {
    flex-direction: row;
    gap: 9px;
    min-height: 50px;
    font-size: 12px;
    border-radius: 10px;
  }
  .mobile-dock #mobile-pause {
    width: 46px;
    min-height: 46px;
  }
  .mobile-dock i {
    top: 8px;
    right: 10px;
  }
  .selection-card {
    left: auto;
    right: 24px;
    bottom: 108px;
    width: 340px;
    max-height: calc(100% - 244px);
    padding: 24px;
    border-radius: 16px;
  }
  .selection-card h2 {
    font-size: 31px;
  }
  .selection-card p {
    font-size: 12px;
  }
  .selection-card .worker-control {
    font-size: 12px;
  }
  .selection-card .production-line {
    font-size: 12px;
  }
  .selection-card .cost {
    font-size: 11px;
  }
  .selection-card .cost svg {
    width: 13px;
    height: 13px;
  }
  .build-hint {
    bottom: 108px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 460px;
    max-width: calc(100% - 48px);
    padding: 14px 16px;
  }
  .build-hint strong {
    font-size: 14px;
  }
  .build-hint small {
    font-size: 11px;
  }
  .toast-stack {
    top: 137px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 410px;
    max-width: calc(100% - 48px);
  }
  .toast {
    font-size: 12px;
    text-align: center;
  }
  .welcome-card {
    width: 360px;
    padding: 30px;
    max-height: calc(100% - 240px);
  }
  .welcome-card h2 {
    font-size: 39px;
  }
  .welcome-card p {
    font-size: 13px;
  }
  dialog {
    inset: auto 24px calc(104px + env(safe-area-inset-bottom)) auto;
    margin: 0;
    width: 480px;
    max-width: calc(100vw - 48px);
    max-height: calc(
      100dvh - 144px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
    );
    border: 1px solid var(--theme-line, #d9ddc6);
    border-radius: 20px;
    box-shadow: 0 18px 80px #213c3545;
  }
  dialog:has([data-sheet="build"]) {
    width: 680px;
    max-width: calc(100vw - 48px);
  }
  dialog:has(.adventure-book),
  dialog:has(.postcard-preview) {
    width: 820px;
    max-width: calc(100vw - 48px);
  }
  .modal-content {
    padding: 30px 28px 28px;
  }
  .modal-content h2 {
    font-size: 39px;
  }
  .modal-content:before {
    display: none;
  }
  .modal-content > .close-button {
    top: 17px;
    right: 15px;
  }
  .modal-content > p,
  .modal-content .mobile-sheet > p {
    font-size: 13px;
  }
  .mobile-build-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  .mobile-build-list .build-card {
    padding: 15px;
    min-height: 140px;
  }
  .mobile-build-list .build-card h3 {
    font-size: 21px;
  }
  .mobile-build-list .build-detail {
    font-size: 11px !important;
  }
  .mobile-build-list .cost {
    font-size: 12px;
  }
  .mobile-menu-item {
    min-height: 86px;
    gap: 11px;
  }
  .mobile-menu-item strong {
    font-size: 14px;
  }
  .mobile-menu-item small {
    font-size: 11px;
  }
  .mobile-menu-item > span:first-child {
    width: 42px;
    height: 42px;
  }
  .mobile-build-tabs {
    max-width: 400px;
  }
  .mobile-gather {
    margin-top: 24px;
  }
  .mobile-gather button {
    font-size: 12px;
    min-height: 48px;
  }
  .mobile-sheet-close {
    margin-top: 24px;
    font-size: 12px;
  }
  .mobile-village-stats span {
    font-size: 11px;
  }
  .mobile-ledger small {
    font-size: 11px;
    width: 90px;
  }
  .mobile-charter .charter-checks {
    font-size: 11px;
  }
  .mobile-journal .journal-item small {
    font-size: 10px;
  }
  .modal-content .help-step p {
    font-size: 12px;
  }
  .modal-content .help-step strong {
    font-size: 13px;
  }
  .modal-content .help-shortcuts {
    font-size: 11px;
  }
  .cinema-caption h2 {
    font-size: 54px;
  }
  .cinema-dock {
    gap: 20px;
  }
  .cinema-scenes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .cinema-scenes button {
    min-width: 120px;
  }
  .cinematic .mobile-dock {
    display: none;
  }
}

/* Village health stays in sight without opening another panel. */
.mobile-status {
  display: none;
}
@media (max-width: 1180px), (max-width: 1440px) and (any-pointer: coarse) {
  .mobile-status {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 420px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 0 5px;
    background: var(--theme-overlay, #f6f4e6ed);
    border: 1px solid var(--theme-line, #dce1cdaa);
    border-radius: 12px;
    color: var(--theme-ink, #506552);
    box-shadow: 0 3px 12px #2a493512;
  }
  .mobile-status button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 78px;
    min-height: 44px;
    padding: 5px 7px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    text-align: left;
  }
  .mobile-status button:hover {
    background: var(--theme-surface, #e4e9d7);
  }
  .mobile-status button > span:first-child {
    color: var(--theme-muted, #778a64);
  }
  .mobile-status svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
  }
  .mobile-status strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .mobile-status small {
    display: block;
    font-size: 8px;
    margin-top: 3px;
    color: var(--theme-muted, #7e8874);
  }
  .mobile-status .mobile-calendar {
    position: static;
    transform: none;
    display: block;
    width: auto;
    padding: 3px 7px;
    margin: 0;
    border: 0;
    border-inline: 1px solid var(--theme-line, #d8deca);
    border-radius: 0;
    background: none;
    text-align: center;
    font-size: 9px;
    line-height: 1.5;
    letter-spacing: 0;
    white-space: normal;
  }
  .toast-stack {
    top: 62px;
  }
}
@media (min-width: 741px) and (max-width: 1180px) and (min-height: 501px),
  (min-width: 741px) and (max-width: 1440px) and (min-height: 501px) and (any-pointer: coarse) {
  .mobile-status {
    top: 91px;
    width: 420px;
    padding-inline: 8px;
  }
  .mobile-status button {
    min-width: 94px;
    gap: 9px;
  }
  .mobile-status strong {
    font-size: 13px;
  }
  .mobile-status small {
    font-size: 9px;
  }
  .mobile-status .mobile-calendar {
    font-size: 11px;
  }
  .toast-stack {
    top: 147px;
  }
}

.startup-error {
  max-width: 520px;
  margin: 15vh auto;
  padding: 30px;
  text-align: center;
}
.startup-error h1 {
  font: 40px var(--serif);
}
.startup-error button {
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: var(--paper-light);
  padding: 12px 20px;
}

/* Desktop: a full valley, with small parchment instruments around its edges. */
.desktop-panel-heading {
  display: none;
}
.desktop-layout {
  --floating-paper: var(--theme-overlay, #faf8eff2);
  position: relative;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.desktop-layout .game-layout {
  display: block;
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
}
.desktop-layout .world-panel {
  height: 100%;
  width: 100%;
}
.desktop-layout .topbar {
  position: absolute;
  inset: 24px 24px auto;
  height: 64px;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 22px;
  z-index: 5;
  pointer-events: none;
  background: none;
}
.desktop-layout .topbar > * {
  pointer-events: auto;
}
.desktop-layout .brand {
  min-width: 0;
  justify-self: start;
  gap: 11px;
  font: 500 13px var(--sans);
  letter-spacing: 0;
  height: 48px;
  align-self: center;
  background: var(--floating-paper);
  padding: 0 18px;
  border: 1px solid var(--theme-line, #f9f8ecbb);
  border-radius: 14px;
  box-shadow: 0 4px 24px #27453514;
  backdrop-filter: blur(16px);
}
.desktop-layout .brand small {
  display: none;
}
.desktop-layout .brand-crest {
  width: 31px;
  height: 37px;
}
.desktop-layout .brand-crest svg {
  width: 22px;
  height: 22px;
}
.desktop-layout .resource-bar {
  gap: 0;
  padding: 8px 5px;
  background: var(--floating-paper);
  border: 1px solid var(--theme-line, #f9f8ecbb);
  border-radius: 14px;
  box-shadow: 0 4px 24px #27453514;
  backdrop-filter: blur(16px);
}
.desktop-layout .resource {
  min-width: 119px;
  background: none;
  border: 0;
  border-radius: 0;
  gap: 10px;
  padding: 3px 14px;
  cursor: pointer;
}
.desktop-layout .resource + .resource {
  border-left: 1px solid var(--theme-line, #dbe0cf);
}
.desktop-layout .resource:hover {
  background: var(--theme-overlay, #e7ecdb80);
  border-radius: 7px;
}
.desktop-layout .resource strong {
  font-size: 16px;
}
.desktop-layout .resource small {
  font-size: 9px;
  color: var(--theme-muted, #7b846e);
}
.desktop-layout .resource-icon svg {
  width: 21px;
  height: 23px;
}
.desktop-layout .resource-rate {
  font-size: 10px;
  align-self: center;
  margin: 0 0 0 4px;
}
.desktop-layout .top-actions {
  justify-self: end;
  align-self: center;
  gap: 3px;
  padding: 7px;
  background: var(--floating-paper);
  border: 1px solid var(--theme-line, #f9f8ecbb);
  border-radius: 13px;
  box-shadow: 0 4px 24px #27453514;
  backdrop-filter: blur(16px);
}
.desktop-layout .top-actions .icon-button {
  width: 35px;
  height: 36px;
  border-radius: 8px;
  color: var(--theme-ink, #63745c);
}
.desktop-layout .right-sidebar,
.desktop-layout .sidebar,
.desktop-layout .world-heading,
.desktop-layout .map-badge,
.desktop-layout .charter-card,
.desktop-layout .adventure-launch,
.desktop-layout .quick-actions,
.desktop-layout .map-footer {
  display: none;
}
.desktop-settlement {
  position: absolute;
  top: 116px;
  left: 32px;
  color: var(--theme-accent, #304d39);
  pointer-events: none;
  text-shadow: 0 1px 16px #f4f3d8;
}
.desktop-settlement > .eyebrow {
  font-size: 9px;
  letter-spacing: 2.4px;
  color: var(--theme-ink, #5c7354);
}
.desktop-settlement h1 {
  display: flex;
  align-items: center;
  gap: 13px;
  font: 44px/1.1 var(--serif);
  font-weight: 400;
  letter-spacing: -0.9px;
  margin: 8px 0 12px;
  max-width: min(420px, 40vw);
}
.settlement-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.village-heading h1,
.cinema-caption h2,
.mobile-sheet h2 {
  overflow-wrap: anywhere;
}
.settlement-sprig {
  color: var(--theme-muted, #72895e);
}
.settlement-sprig svg {
  width: 23px;
  height: 23px;
  transform: rotate(22deg);
}
.desktop-vitals {
  display: flex;
  align-items: center;
  gap: 9px;
}
.desktop-vitals button {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: var(--theme-overlay, #f8f5e8c9);
  border-radius: 8px;
  min-height: 34px;
  padding: 6px 9px;
  color: var(--theme-ink, #4d6747);
  box-shadow: 0 2px 10px #29493208;
}
.desktop-vitals button:hover {
  background: var(--theme-raised, #faf8ef);
}
.desktop-vitals svg {
  width: 16px;
  height: 16px;
}
.desktop-vitals strong {
  font-size: 12px;
  font-weight: 600;
}
.desktop-vitals small {
  font-size: 10px;
  font-weight: 400;
  color: var(--theme-ink, #6c7e5e);
}
.vitals-divider {
  display: none;
}
.settlement-health {
  font-size: 10px;
  color: var(--theme-accent, #536e46);
  margin-left: 2px;
}
.desktop-season {
  position: absolute;
  right: 24px;
  top: 110px;
  width: 244px;
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  padding: 15px 17px;
  border: 1px solid var(--theme-line, #f6f5e6bc);
  border-radius: 14px;
  background: var(--theme-overlay, #faf8efe8);
  box-shadow: 0 4px 20px #2745350d;
  backdrop-filter: blur(16px);
  color: var(--theme-ink, #425e40);
}
.desktop-season:hover {
  background: var(--theme-raised, #faf8ef);
}
.desktop-season-icon {
  width: 31px;
  flex-shrink: 0;
  color: var(--theme-muted, #8e976b);
}
.desktop-season-icon svg {
  width: 29px;
  height: 29px;
  stroke-width: 1.2;
}
.desktop-season-copy {
  flex: 1;
}
.desktop-season .eyebrow {
  font-size: 8px;
  letter-spacing: 1.5px;
  color: var(--theme-muted, #7c886e);
}
.desktop-season .eyebrow span {
  padding: 0 6px;
  color: var(--theme-muted, #b6bca4);
}
.desktop-season strong {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 24px var(--serif);
  margin-top: 5px;
}
.desktop-season strong small {
  margin-left: auto;
  font: 9px var(--sans);
  color: var(--theme-muted, #7f8c70);
}
.desktop-season-track {
  display: block;
  height: 2px;
  background: var(--theme-surface, #dee3d2);
  margin-top: 10px;
  overflow: hidden;
}
.desktop-season-track i {
  display: block;
  height: 100%;
  background: #8b9c71;
}
.season-notice {
  position: absolute;
  right: 12px;
  bottom: -12px;
  border: 1px solid var(--theme-line, #dbc9a0);
  border-radius: 12px;
  background: var(--theme-warm, #f5eccf);
  color: var(--theme-gold, #8b6c31);
  padding: 4px 9px;
  font-size: 9px;
}
.desktop-dock {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--theme-line, #f5f3e4db);
  border-radius: 17px;
  background: var(--floating-paper);
  box-shadow: 0 8px 40px #28473424;
  backdrop-filter: blur(18px);
}
.desktop-dock button {
  position: relative;
  border: 0;
  background: transparent;
  border-radius: 10px;
  min-height: 48px;
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  font-size: 12px;
  color: var(--theme-ink, #536b4d);
}
.desktop-dock svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.5;
}
.desktop-dock button:hover {
  background: var(--theme-surface, #e7ecdc);
}
.desktop-dock .build-command {
  background: #3e5d48;
  color: #fdf4da;
  padding-inline: 19px;
  box-shadow: 0 2px 7px #2845341c;
}
.desktop-dock .build-command:hover,
.desktop-dock .build-command.is-active {
  background: #304e3b;
}
.dock-plus {
  font-size: 17px;
  font-weight: 400;
  margin-left: 6px;
  opacity: 0.65;
}
.dock-divider {
  width: 1px;
  height: 25px;
  background: var(--theme-surface, #d9dfcc);
  margin: 0 3px;
}
.dock-notice {
  width: 6px;
  height: 6px;
  position: absolute;
  right: 9px;
  top: 9px;
  background: #b89343;
  border-radius: 50%;
}
.desktop-charter {
  position: absolute;
  left: 24px;
  bottom: 110px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 282px;
  width: 260px;
  padding: 14px;
  text-align: left;
  border: 1px solid var(--theme-line, #f4f0dad1);
  border-radius: 13px;
  background: var(--theme-overlay, #faf8eddc);
  color: var(--theme-ink, #526443);
  box-shadow: 0 4px 20px #28473410;
  backdrop-filter: blur(14px);
}
.desktop-charter:hover {
  background: var(--theme-raised, #faf8ef);
  translate: 0 -2px;
}
.charter-seal {
  display: grid;
  place-items: center;
  width: 34px;
  height: 36px;
  border: 1px solid var(--theme-line, #d9d2b9);
  border-radius: 50% 50% 43% 43%;
  color: var(--theme-gold, #9a8555);
  background: var(--theme-warm, #efe9d4);
}
.charter-seal svg {
  width: 18px;
  height: 18px;
}
.desktop-charter small {
  display: block;
  font-size: 7px;
  letter-spacing: 1.5px;
  color: var(--theme-muted, #8c896d);
}
.desktop-charter strong {
  display: block;
  font: 22px var(--serif);
  margin-top: 5px;
}
.charter-arrow {
  margin-left: auto;
  font-size: 18px;
  color: var(--theme-muted, #909a7a);
}
.desktop-charter.reward-ready {
  border-color: var(--theme-line, #c9b773);
  background: var(--theme-warm, #faf1d5);
}
.desktop-layout .bottom-bar {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 5;
  width: auto;
  height: 66px;
  padding: 8px 10px;
  border: 1px solid var(--theme-line, #f5f3e4db);
  border-radius: 15px;
  background: var(--floating-paper);
  box-shadow: 0 8px 35px #28473415;
  backdrop-filter: blur(16px);
}
.desktop-layout .time-label,
.desktop-layout #bottom-tip {
  display: none;
}
.desktop-layout .time-controls {
  gap: 4px;
}
.desktop-layout .time-controls button {
  min-width: 34px;
  height: 38px;
  border-radius: 8px;
  font-size: 11px;
}
.desktop-layout .time-controls #pause-button {
  width: 38px;
  margin-right: 6px;
  border-right: 1px solid var(--theme-line, #d9dfcc);
}
.desktop-layout .time-controls button.active {
  background: var(--theme-surface, #e5ebd7);
  color: var(--theme-accent, #46613d);
}
.desktop-layout .save-status {
  position: absolute;
  left: 8px;
  bottom: -18px;
  gap: 4px;
  white-space: nowrap;
  font-size: 8px;
  color: var(--theme-ink, #536c48);
  opacity: 0.85;
}
.desktop-layout .save-status svg {
  width: 10px;
  height: 10px;
}
.desktop-layout .camera-controls {
  right: 86px;
  bottom: 24px;
  left: auto;
  top: auto;
  width: 172px;
  padding: 9px 10px;
  border: 1px solid var(--theme-line, #f5f3e4db);
  border-radius: 13px;
  background: var(--floating-paper);
  box-shadow: 0 8px 32px #28473415;
  backdrop-filter: blur(16px);
}
.desktop-layout .camera-controls small {
  display: none;
}
.desktop-layout .camera-heading {
  font-size: 7px;
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.desktop-layout .camera-heading output {
  font-size: 8px;
}
.desktop-layout .camera-directions {
  gap: 5px;
}
.desktop-layout .camera-directions button {
  height: 28px;
  font-size: 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
}
.desktop-layout .camera-directions button[aria-pressed="true"] {
  background: var(--theme-surface, #e3ead6);
  color: var(--theme-accent, #42603d);
}
.desktop-layout .map-controls {
  right: 24px;
  bottom: 24px;
  gap: 3px;
  padding: 6px;
  border: 1px solid var(--theme-line, #f5f3e4db);
  border-radius: 13px;
  background: var(--floating-paper);
  box-shadow: 0 8px 32px #28473415;
}
.desktop-layout:has(.cloud-save-indicator) .map-controls {
  bottom: 64px;
}
.desktop-layout .map-controls .icon-button {
  width: 34px;
  height: 32px;
}
.desktop-layout .map-controls > span {
  margin: 0;
}
.desktop-layout .cinema-launch {
  left: auto;
  top: auto;
  right: 88px;
  bottom: 108px;
  padding: 8px 12px;
  border: 1px solid var(--theme-line, #f5f3e4c9);
  border-radius: 20px;
  background: var(--theme-overlay, #faf8efd9);
  color: var(--theme-ink, #536c49);
  font-size: 10px;
  box-shadow: none;
}
.desktop-layout .cinema-launch:hover {
  background: var(--theme-raised, #faf8ef);
}
.desktop-layout .selection-card {
  left: auto;
  right: 24px;
  top: 224px;
  bottom: auto;
  width: 326px;
  max-height: calc(100% - 380px);
  padding: 25px;
  background: var(--floating-paper);
  border: 1px solid var(--theme-line, #f6f4e2);
  border-radius: 17px;
  box-shadow: 0 10px 40px #29453526;
}
.desktop-layout .selection-card h2 {
  font-size: 31px;
  padding-right: 15px;
}
.desktop-layout .selection-card p {
  font-size: 12px;
  line-height: 1.65;
}
.desktop-layout .selection-card .close-button {
  width: 34px;
  height: 34px;
  right: 12px;
  top: 12px;
}
.desktop-layout .selection-card .production-line {
  font-size: 12px;
}
.desktop-layout .selection-card button {
  min-height: 34px;
}
.desktop-layout .selection-card .upgrade-detail p {
  font-size: 11px;
}
.desktop-layout .build-hint {
  top: auto;
  bottom: 112px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 14px 12px 20px;
  border-radius: 12px;
  background: #36523ff2;
  box-shadow: 0 7px 26px #29453520;
  font-size: 12px;
  gap: 22px;
}
.desktop-layout .build-hint button {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}
.desktop-layout .toast-stack {
  top: 114px;
  left: 50%;
  transform: translateX(-50%);
  width: 380px;
  pointer-events: none;
}
.desktop-layout .toast {
  border-radius: 11px;
  padding: 13px 17px;
  font-size: 12px;
  box-shadow: 0 6px 30px #29453520;
}
.desktop-layout .welcome-card {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 360px;
  padding: 34px;
  background: var(--theme-overlay, #faf8eff2);
  border: 1px solid var(--theme-line, #f6f3df);
  border-radius: 20px;
  max-height: calc(100% - 250px);
  overflow: auto;
}
.desktop-layout .welcome-card h2 {
  font-size: 41px;
}
.desktop-layout .welcome-card p {
  font-size: 13px;
  line-height: 1.8;
}
.desktop-layout .welcome-card .primary-button {
  font-size: 12px;
  min-height: 44px;
}
.desktop-building .sidebar {
  display: flex;
  position: absolute;
  z-index: 6;
  left: 24px;
  top: 110px;
  bottom: 112px;
  width: 326px;
  min-height: 0;
  padding: 20px 20px 0;
  border: 1px solid var(--theme-line, #f8f5e7);
  border-radius: 18px;
  background: var(--floating-paper);
  box-shadow: 0 12px 55px #29453526;
  backdrop-filter: blur(20px);
  animation: desktop-panel-in 0.18s ease-out;
}
.desktop-building .sidebar .village-heading,
.desktop-building .sidebar .village-stats,
.desktop-building .tiny-ornament,
.desktop-building .desktop-settlement,
.desktop-building .desktop-charter {
  display: none;
}
.desktop-building .desktop-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.desktop-panel-heading .eyebrow {
  font-size: 8px;
  letter-spacing: 1.6px;
}
.desktop-panel-heading button {
  font-size: 22px;
}
.desktop-building .sidebar .section-heading h2 {
  font: 32px var(--serif);
}
.desktop-building .build-tabs {
  margin: 17px 0 13px;
  padding: 4px;
  background: var(--theme-surface, #e8eddf);
}
.desktop-building .build-tabs button {
  font-size: 11px;
  padding: 8px 2px;
}
.desktop-building .build-list {
  gap: 8px;
  padding-right: 4px;
  overscroll-behavior: contain;
}
.desktop-building .build-card {
  padding: 13px 11px;
  border-radius: 10px;
  background: var(--theme-overlay, #fffdf46b);
  border-color: var(--theme-line, #dce1cf);
}
.desktop-building .build-card:hover {
  background: var(--theme-raised, #fffdf4);
  border-color: var(--theme-line, #aab99a);
}
.desktop-building .build-card h3 {
  font-size: 12px;
}
.desktop-building .build-detail {
  font-size: 10px;
  margin: 5px 0 7px;
}
.desktop-building .build-illustration {
  background: var(--theme-surface, #e8ecde);
}
.desktop-building .sidebar-foot {
  font-size: 10px;
  padding: 16px 0;
}
.desktop-building .building-tooltip {
  z-index: 8;
}
.desktop-dialog {
  border: 1px solid var(--theme-line, #e5e5d2);
  border-radius: 21px;
  box-shadow: 0 24px 110px #1d392c45;
  width: 520px;
  max-height: calc(100dvh - 80px);
}
.desktop-dialog .modal-content {
  padding: 36px;
}
.desktop-dialog h2 {
  font-size: 39px;
}
.desktop-dialog .close-button {
  right: 18px;
  top: 18px;
  width: 34px;
  height: 34px;
}
.desktop-dialog .mobile-menu-item {
  min-height: 83px;
}
.desktop-dialog .mobile-menu-item strong {
  font-size: 13px;
}
.desktop-dialog .mobile-menu-item small {
  font-size: 11px;
}
.desktop-dialog::backdrop {
  background: #213b2d42;
  backdrop-filter: blur(5px);
}
body.cinematic .desktop-dock {
  display: none;
}
body.cinematic .desktop-layout .sidebar {
  display: none;
}
@keyframes desktop-panel-in {
  from {
    opacity: 0;
    translate: 0 9px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .desktop-building .sidebar {
    animation: none;
  }
  .desktop-charter {
    transition: none;
  }
}
@media (max-height: 700px) {
  .desktop-layout .desktop-settlement {
    top: 104px;
  }
  .desktop-layout .desktop-settlement h1 {
    font-size: 36px;
    margin-block: 5px 9px;
  }
  .desktop-layout .selection-card {
    top: 205px;
    max-height: calc(100% - 318px);
  }
  .desktop-layout .desktop-season {
    top: 105px;
    padding-block: 12px;
  }
  .desktop-building .sidebar {
    top: 102px;
    bottom: 108px;
  }
  .desktop-layout .desktop-charter {
    bottom: 106px;
    padding: 10px 13px;
  }
  .desktop-layout .welcome-card {
    padding: 24px;
    max-height: calc(100% - 190px);
  }
}
.desktop-layout .is-night .desktop-settlement {
  color: #f8efd6;
  text-shadow: 0 2px 18px #173028;
}
.desktop-layout .is-night .desktop-settlement > .eyebrow,
.desktop-layout .is-night .settlement-health {
  color: #e0e4c5;
}
.desktop-layout .is-night .settlement-sprig {
  color: #c5cfa5;
}
.desktop-layout .resource-bar {
  width: 560px;
}
.desktop-layout .resource {
  flex: 1;
  min-width: 0;
  padding-inline: 12px;
  gap: 10px;
}
.desktop-layout .resource-icon {
  flex-shrink: 0;
}
.desktop-layout .resource-details {
  flex: 1;
  min-width: 0;
}
.desktop-layout .resource strong {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  line-height: 1.2;
}
.desktop-layout .resource-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-top: 5px;
}
.desktop-layout .resource small {
  margin: 0;
  white-space: nowrap;
  color: var(--theme-ink, #63735b);
}
.desktop-layout .resource-rate {
  flex-shrink: 0;
  align-self: auto;
  max-width: none;
  margin: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  color: var(--theme-accent, #496e45);
}
.desktop-layout .resource-rate.negative {
  color: var(--theme-danger, #9b503a);
}
.desktop-layout:has(.is-night) .save-status {
  color: #e1e8cb;
}

@media (max-height: 600px) {
  .welcome-card .brand-logo {
    width: 115px;
  }
}

.build-hint.path-planner {
  width: max-content;
  max-width: calc(100% - 32px);
  white-space: normal;
  flex-wrap: wrap;
  gap: 8px;
}
.build-hint.path-planner > span {
  min-width: 0;
  flex: 1 1 250px;
}
.build-hint.path-planner strong {
  display: block;
  font-size: 13px;
}
.build-hint.path-planner small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.5;
}
.build-hint.path-planner button {
  width: auto;
  padding: 8px 12px;
  font: 500 12px var(--sans);
  min-height: 40px;
}
.build-hint.path-planner #confirm-path {
  background: var(--theme-warm, #f1e8c8);
  color: var(--theme-ink, #3e573a);
  border-radius: 6px;
}
.build-hint.path-planner #confirm-path:disabled {
  opacity: 0.5;
}
.build-hint.path-planner #cancel-build {
  margin-left: auto;
}
@media (max-width: 740px) {
  .build-hint.path-planner {
    width: calc(100% - 24px);
    max-width: none;
  }
  .build-hint.path-planner > span {
    flex-basis: 100%;
  }
}

/* Shared UI palette. Light mode keeps the authored colours via token fallbacks.
   World lighting and the supplied artwork have their own palettes. */
:root {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #18251f;
  --paper-light: #233229;
  --ink: #e6eadc;
  --muted: #b0bba8;
  --green: #a9cea5;
  --line: #435447;
  --gold: #d7ba80;
  --theme-ink: #e6eadc;
  --theme-muted: #b0bba8;
  --theme-accent: #a9cea5;
  --theme-danger: #f1ad98;
  --theme-gold: #d7ba80;
  --theme-line: #435447;
  --theme-line-strong: #70876b;
  --theme-surface: #233229;
  --theme-raised: #28392f;
  --theme-soft: #304236;
  --theme-overlay: #24352df5;
  --theme-warm: #443b29;
}
.theme-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink);
  font: 13px var(--sans);
}
.theme-picker .theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  font: inherit;
  color: var(--ink);
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
}
.theme-picker .theme-toggle:hover {
  color: var(--theme-accent, #497968);
  border-color: currentColor;
}
.theme-toggle svg {
  width: 24px;
  height: 24px;
}
.theme-picker .theme-toggle:focus-visible {
  outline: 2px solid var(--theme-accent, #497968);
  outline-offset: 3px;
}
.theme-picker.compact {
  gap: 8px;
  font-size: 11px;
}
.settings-row > .theme-picker {
  width: 100%;
}
:root[data-theme="dark"] .desktop-settlement {
  background: #18251fdb;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
:root[data-theme="dark"] .world-heading {
  color: var(--ink);
  text-shadow: 0 1px 4px #000;
}
:root[data-theme="dark"] dialog::backdrop {
  background: #08140dcc;
}
@media (max-width: 700px) {
  .site-header nav {
    gap: 12px;
  }
}
.settings-row a {
  color: var(--theme-accent, #456044);
  text-underline-offset: 4px;
}
:root[data-theme="dark"] .desktop-layout .save-status {
  background: #18251feb;
  color: var(--ink);
  opacity: 1;
  border-radius: 4px;
  padding: 2px 5px;
  bottom: -21px;
}
:root[data-theme="dark"] .theme-picker .theme-toggle {
  border-color: var(--theme-line-strong);
}

/* The pause menu is shared by mouse, keyboard, and touch layouts. */
dialog:has(.game-menu) {
  inset: 0;
  margin: auto;
  width: 600px;
  max-width: calc(100vw - 32px);
  max-height: calc(
    100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
  );
  border-radius: 10px;
  border: 1px solid var(--line);
}
dialog:has(.game-menu)::backdrop {
  background: #10271dbb;
  backdrop-filter: blur(7px);
}
dialog:has(.game-menu) .modal-content {
  padding: 30px;
}
dialog:has(.game-menu) .modal-content::before {
  display: none;
}
dialog:has(.game-menu-home) {
  width: 420px;
  background: #21392e;
  color: #f4eedc;
  border-color: #73856b;
  box-shadow: 0 24px 100px #071c1977;
}
.game-menu-home {
  text-align: center;
}
.game-menu-home .brand-logo {
  width: 120px;
  margin: 0 auto 10px;
}
.game-menu-home h2 {
  font: 28px/1.1 var(--serif);
  margin: 0 0 7px;
}
.game-menu-village {
  font-size: 11px;
  color: #c5cfb7;
  margin: 0 0 19px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.game-menu .close-button {
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
}
.game-menu-home .close-button {
  color: #c5cfb7;
}
.game-menu-resume {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  background: #e9dab2;
  color: #243e32;
  border: 1px solid #e9dab2;
  border-radius: 3px;
  font-size: 14px;
  margin-bottom: 12px;
}
.game-menu-resume:hover {
  background: #f8ebc9;
}
.game-menu-links {
  display: flex;
  flex-direction: column;
}
.game-menu-links > button,
.game-menu-exit {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 9px 10px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #8b9b7938;
  color: #f4eedc;
  text-align: left;
  text-decoration: none;
}
.game-menu-links > button > svg,
.game-menu-exit > svg {
  color: #c9b77f;
  flex-shrink: 0;
  width: 19px;
  height: 19px;
}
.game-menu-links > button > span:nth-child(2) {
  flex: 1;
}
.game-menu-links strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
}
.game-menu-links small {
  display: block;
  font-size: 10px;
  color: #c5cfb7;
  margin-top: 3px;
}
.game-menu-links > button > span:last-child {
  color: #c9b77f;
  font-size: 20px;
}
.game-menu-links > button:hover,
.game-menu-exit:hover {
  background: #dae5b912;
}
.game-menu-exit {
  margin-top: 8px;
  font-size: 13px;
  border-bottom: 0;
}
.game-menu-exit > span {
  margin-left: auto;
}
.game-menu-save-note {
  margin: 12px 0 0;
  color: #c5cfb7;
  font-size: 10px;
  line-height: 1.5;
}
.game-menu-home button:focus-visible,
.game-menu-home a:focus-visible {
  outline: 2px solid #e9dab2;
  outline-offset: 3px;
}
.game-menu-back {
  background: transparent;
  border: 0;
  padding: 8px 0;
  min-height: 44px;
  color: var(--theme-accent, #496846);
  font-size: 12px;
  margin: -8px 0 12px;
}
.game-menu-section h2 {
  font: 38px/1.1 var(--serif);
  margin: 0 0 28px;
}
.game-menu-section h2:focus {
  outline: 0;
}
.game-options-section + .game-options-section {
  margin-top: 28px;
}
.game-options-section h3 {
  font: 600 11px var(--sans);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 0 0 10px;
  color: var(--theme-muted, #63715f);
}
.game-menu .modal-note {
  line-height: 1.8;
}
.game-menu .audio-settings {
  margin-top: 20px;
}
.game-menu-return {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--theme-surface, #e9edde);
  color: var(--ink);
  font-size: 13px;
}
.game-menu-description {
  color: var(--theme-muted, #63715f);
  line-height: 1.8;
  font-size: 13px;
}
.game-menu .settings-row strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
}
.game-menu .settings-row small {
  display: block;
  color: var(--theme-muted, #63715f);
  line-height: 1.5;
  margin-top: 5px;
  font-size: 11px;
}
.game-menu .settings-row > button {
  flex-shrink: 0;
  min-height: 44px;
}
.game-menu-account {
  display: inline-block;
  padding-block: 12px;
  color: var(--theme-accent, #496846);
  text-underline-offset: 4px;
  font-size: 12px;
}
.game-controls-list {
  margin: 0;
}
.game-controls-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
  font-size: 12px;
  line-height: 1.5;
}
.game-controls-list dd {
  margin: 0;
  text-align: right;
  color: var(--theme-muted, #63715f);
}
.village-actions-section {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 18px;
}
@media (max-width: 600px) {
  dialog:has(.game-menu) .modal-content {
    padding: 24px;
  }
  .game-menu-section h2 {
    font-size: 34px;
  }
  .game-menu-links > button {
    min-height: 52px;
  }
  .game-controls-list > div {
    font-size: 11px;
    gap: 16px;
  }
}
@media (max-height: 740px) {
  .game-menu-home .brand-logo {
    width: 92px;
    margin-bottom: 8px;
  }
  .game-menu-home .game-menu-village {
    margin-bottom: 12px;
  }
  dialog:has(.game-menu-home) .modal-content {
    padding-block: 20px;
  }
}

.build-hint #rotate-building {
  width: auto;
  min-width: 66px;
  min-height: 44px;
  padding: 0 10px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.build-hint #rotate-building > span {
  font-size: 20px;
  vertical-align: -2px;
  margin-right: 3px;
}

/* Construction commands stay beside their live preview, in one quiet toolbar. */
.build-hint.construction-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 22px;
  width: min(680px, calc(100% - 32px));
  padding: 16px 18px 12px;
  background: #20392ff5;
  border: 1px solid #d6bf8045;
  border-radius: 12px;
  box-shadow: 0 12px 36px #13291f35;
  color: #f4efdc;
  white-space: normal;
  backdrop-filter: blur(18px);
}
.placement-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.placement-symbol {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 38px;
  color: #d7c591;
  border-right: 1px solid #d6bf8030;
  padding-right: 10px;
}
.placement-symbol svg {
  width: 23px;
  height: 23px;
}
.placement-title {
  min-width: 0;
}
.build-hint .placement-title small {
  display: block;
  font-size: 8px;
  letter-spacing: 1.6px;
  color: #b4bda3;
  margin: 0 0 3px;
}
.build-hint .placement-title strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}
.placement-cost {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
  margin-left: auto;
  font-size: 11px;
  color: #d7c99e;
}
.placement-cost > span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.placement-cost svg {
  width: 13px;
  height: 13px;
}
.placement-cost .missing {
  color: #efb197;
}
.placement-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.build-hint.construction-controls .placement-actions button {
  height: 40px;
  min-height: 40px;
  width: auto;
  min-width: 40px;
  padding: 0 10px;
  background: #ffffff08;
  border: 1px solid #dfe5ce24;
  border-radius: 6px;
  color: #e7e9d6;
  font-size: 11px;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.1s;
}
.build-hint.construction-controls .placement-actions button:hover {
  background: #ffffff16;
  border-color: #d6bf8080;
}
.build-hint.construction-controls .placement-actions button:active {
  transform: translateY(1px);
}
.build-hint.construction-controls .placement-actions button:focus-visible {
  outline: 2px solid #e6cd87;
  outline-offset: 3px;
}
.build-hint.construction-controls #repeat-build[aria-pressed="true"] {
  background: #d8c48a;
  color: #27392c;
  border-color: #d8c48a;
}
.build-hint.construction-controls #cancel-build {
  font-size: 23px;
  padding: 0;
  min-width: 34px;
  width: 34px;
  background: transparent;
  border-color: transparent;
}
.build-hint.construction-controls #touch-place {
  background: #dfcc98;
  color: #243c2d;
  border-color: #dfcc98;
  font-weight: 600;
}
.build-hint.construction-controls #touch-place:disabled {
  opacity: 0.4;
}
.placement-feedback {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #d6bf8024;
  padding-top: 10px;
  font-size: 10px;
  line-height: 1.5;
  color: #b7c3ae;
}
.placement-status {
  display: flex;
  align-items: center;
  gap: 7px;
}
.placement-status i {
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #a8c19a;
}
.placement-feedback[data-invalid="true"] .placement-status {
  color: #f0b69b;
}
.placement-feedback[data-invalid="true"] .placement-status i {
  background: #efaa89;
}
.placement-shortcuts {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  color: #9dac98;
  font-size: 9px;
}
.placement-shortcuts kbd {
  border: 1px solid #c7d1b530;
  border-radius: 3px;
  padding: 1px 4px;
  font: inherit;
  font-size: 9px;
  color: #d9ddc5;
}
.placement-shortcuts kbd:not(:first-child) {
  margin-left: 6px;
}
.desktop-dock kbd {
  font: 9px var(--sans);
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 2px 4px;
  margin-left: 4px;
  opacity: 0.45;
}
.desktop-dock button {
  transition:
    background 0.16s,
    color 0.16s,
    transform 0.12s;
}
.desktop-dock button:active {
  transform: translateY(1px);
}
#world.panning {
  cursor: grabbing !important;
}
.desktop-layout:has(.construction-controls:not(.hidden)) .desktop-charter {
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 1180px), (max-width: 1440px) and (any-pointer: coarse) {
  .build-hint.construction-controls {
    grid-template-columns: 1fr;
    gap: 10px;
    width: auto;
    padding: 12px 14px;
  }
  .placement-actions {
    grid-row: 2;
  }
  .build-hint.construction-controls .placement-actions button {
    min-height: 44px;
    white-space: nowrap;
  }
  .build-hint.construction-controls #touch-place {
    margin-left: auto;
    min-width: 94px;
  }
  .build-hint.construction-controls #cancel-build {
    min-width: 40px;
  }
  .placement-feedback {
    padding-top: 8px;
    font-size: 11px;
  }
  .placement-cost {
    flex-wrap: nowrap;
  }
  .build-hint .placement-title small {
    display: none;
  }
  .placement-symbol {
    height: 28px;
  }
}
@media (max-width: 360px) {
  .build-hint.construction-controls .placement-actions button {
    padding: 0 7px;
  }
  .build-hint.construction-controls #rotate-building {
    min-width: 56px;
  }
  .build-hint.construction-controls #touch-place {
    min-width: 84px;
  }
  .build-hint.construction-controls #cancel-build {
    min-width: 34px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .desktop-dock button,
  .build-hint.construction-controls .placement-actions button {
    transition: none;
  }
}

/* Release notes read like a fresh page in the village journal. */
dialog:has(.game-update) {
  width: min(560px, calc(100vw - 32px));
  background: var(--paper-light);
  border-color: var(--theme-line-strong, #a2b195);
}
.game-update .release-ornament {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border: 1px solid var(--theme-line, #dedfd1);
  border-radius: 50%;
  color: var(--theme-accent, #42644e);
  background: var(--theme-surface, #e9edde);
}
.game-update h2 {
  margin: 10px 0 14px;
  max-width: 390px;
  font: 42px/1.06 var(--serif);
  color: var(--theme-ink, #344438);
}
.game-update h2:focus {
  outline: none;
}
.game-update-intro {
  margin: 0 0 26px;
  color: var(--theme-muted, #63715f);
  font-size: 13px;
  line-height: 1.8;
}
.release-entry + .release-entry {
  margin-top: 22px;
}
.release-entry {
  border-top: 1px solid var(--theme-line, #dedfd1);
  padding-top: 16px;
}
.release-entry-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.release-entry h3 {
  margin: 0;
  font: 24px/1.2 var(--serif);
  color: var(--theme-ink, #344438);
}
.release-entry time {
  flex-shrink: 0;
  color: var(--theme-muted, #63715f);
  font-size: 10px;
}
.release-entry ul {
  margin: 14px 0 0;
  padding-left: 17px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--theme-ink, #344438);
}
.release-entry li + li {
  margin-top: 8px;
}
.release-entry li::marker {
  color: var(--theme-accent, #42644e);
}
.game-update-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}
.game-update-actions button {
  min-height: 44px;
  padding: 12px 18px;
}
.game-update-actions .primary-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.game-update-error {
  margin-top: 18px;
  color: var(--theme-danger, #a24d43);
  font-size: 12px;
  line-height: 1.7;
}
.game-update-footnote {
  margin: 16px 0 0;
  color: var(--theme-muted, #63715f);
  font-size: 10px;
  line-height: 1.6;
}
.changelog-update-link {
  margin-bottom: 16px;
  border: 0;
  padding: 8px 0;
  min-height: 44px;
  background: none;
  color: var(--theme-accent, #42644e);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (max-width: 520px) {
  dialog:has(.game-update) {
    width: 100%;
  }
  .game-update h2 {
    font-size: 36px;
  }
  .game-update-actions {
    flex-direction: column;
  }
  .game-update-actions button {
    width: 100%;
  }
}

/* The settlement ledger: permanent recognition and the next civic ambition. */
.settlement-progress {
  margin: 22px 0;
  padding: 20px;
  border: 1px solid var(--theme-line, #d4dacb);
  border-radius: 8px;
  background: var(--paper-light);
  color: var(--theme-ink, #344438);
}
.settlement-stage-heading {
  display: flex;
  align-items: center;
  gap: 15px;
}
.stage-emblem {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  height: 48px;
  border: 1px solid var(--theme-gold, #91703e);
  border-radius: 50%;
  color: var(--theme-gold, #91703e);
}
.stage-emblem svg {
  width: 24px;
  height: 24px;
}
.settlement-stage-heading h3 {
  margin: 4px 0;
  font: 25px var(--serif);
}
.settlement-progress p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.65;
}
.settlement-stage-heading p {
  color: var(--theme-muted, #6b7965);
}
.settlement-stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  padding: 0;
  margin: 22px 0 18px;
}
.settlement-stages li {
  position: relative;
  text-align: center;
  color: var(--theme-muted, #6b7965);
}
.settlement-stages li::before {
  content: "";
  position: absolute;
  top: 15px;
  left: -50%;
  width: 100%;
  height: 1px;
  background: var(--theme-line, #d4dacb);
}
.settlement-stages li:first-child::before {
  display: none;
}
.settlement-stages li > span {
  display: grid;
  position: relative;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 0 auto 8px;
  border: 1px solid var(--theme-line, #d4dacb);
  border-radius: 50%;
  background: var(--paper-light);
}
.settlement-stages svg {
  width: 16px;
  height: 16px;
}
.settlement-stages strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}
.settlement-stages small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
}
.settlement-stages .reached {
  color: var(--theme-ink, #344438);
}
.settlement-stages .reached > span {
  color: var(--theme-accent, #517555);
  border-color: var(--theme-accent, #517555);
}
.settlement-stages [aria-current="step"] > span {
  color: var(--theme-gold, #91703e);
  border-color: var(--theme-gold, #91703e);
}
.stage-benefit strong,
.stage-next strong {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
  color: var(--theme-ink, #344438);
}
.settlement-progress .stage-next {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--theme-line, #d4dacb);
}
.stage-next small {
  display: block;
  margin-top: 8px;
  color: var(--theme-muted, #6b7965);
  font-size: 11px;
}
.charter-rewards {
  margin: 16px 0;
}
.charter-rewards > .eyebrow {
  display: block;
  margin-bottom: 8px;
}
.charter-rewards .cost {
  gap: 14px;
}
.charter-unlock {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 0 0;
}
.charter-unlock svg {
  flex: 0 0 18px;
  margin-top: 2px;
}
.charter-unlock strong {
  display: block;
  color: var(--theme-ink, #344438);
}
.mobile-charter .claim-button {
  width: 100%;
  margin-top: 10px;
}
.build-card:disabled {
  opacity: 0.65;
  cursor: default;
}
.build-card:disabled .build-plus {
  display: none;
}
@media (max-width: 520px) {
  .settlement-progress {
    padding: 16px;
  }
  .settlement-stage-heading {
    gap: 12px;
  }
  .settlement-stages strong {
    font-size: 11px;
  }
}
.starter-guide {
  position: absolute;
  z-index: 8;
  top: 88px;
  left: 12px;
  right: 12px;
  max-width: 360px;
  padding: 16px 18px;
  border: 1px solid var(--theme-line, #d8ddc9);
  border-radius: 16px;
  background: var(--theme-raised, #faf8ef);
  color: var(--theme-ink, #344438);
  box-shadow: 0 8px 30px #29453520;
}
.starter-guide .eyebrow {
  padding-right: 24px;
}
.starter-guide h3 {
  margin: 8px 24px 6px 0;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 400;
  line-height: 1.15;
}
.starter-guide p {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.6;
}
.guide-dismiss {
  position: absolute;
  right: 8px;
  top: 8px;
}
.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.guide-actions .secondary-button {
  padding: 9px 12px;
  min-height: 40px;
  font-size: 12px;
}
.desktop-layout .starter-guide {
  top: 252px;
  left: 24px;
  right: auto;
  width: 290px;
}
.village-improvements h2 {
  margin-bottom: 12px;
}
@media (min-width: 741px) and (max-width: 1180px) and (min-height: 501px),
  (min-width: 741px) and (max-width: 1440px) and (min-height: 501px) and (any-pointer: coarse) {
  .starter-guide {
    top: 156px;
    left: 24px;
    right: auto;
    width: 320px;
  }
}
@media (max-height: 560px) {
  .starter-guide {
    max-width: 290px;
    padding: 10px 14px;
  }
  .starter-guide h3 {
    font-size: 18px;
  }
  .starter-guide p {
    font-size: 11px;
    line-height: 1.4;
    margin-bottom: 8px;
  }
  .desktop-layout .starter-guide {
    top: 242px;
    max-height: calc(100% - 370px);
    overflow-y: auto;
  }
}

/* Phone drawers use the same handle and dismissal gestures throughout the game. */
@media (max-width: 740px), (max-width: 1000px) and (max-height: 500px) {
  dialog,
  .selection-card {
    --swipe-dismiss: 1;
  }
  dialog .close-button,
  dialog .mobile-sheet-close,
  dialog button.primary-button[data-close],
  .selection-card .close-button {
    display: none;
  }
  dialog .sheet-grip,
  .selection-card .sheet-grip {
    display: block;
    position: sticky;
    top: 0;
    z-index: 2;
    width: 100%;
    height: 28px;
    min-height: 28px;
    border: 0;
    padding: 0;
    background: inherit;
    cursor: grab;
    touch-action: none;
  }
  .sheet-grip::before {
    content: "";
    position: absolute;
    top: 10px;
    left: calc(50% - 18px);
    width: 36px;
    height: 3px;
    background: var(--theme-soft, #cbd1bc);
    border-radius: 3px;
  }
  .sheet-grip:active {
    cursor: grabbing;
  }
  .sheet-grip:focus-visible {
    outline: none;
  }
  .sheet-grip:focus-visible::before {
    background: var(--theme-accent, #42644e);
    height: 4px;
  }
  dialog .sheet-grip:disabled {
    display: none;
  }
  dialog .modal-content::before {
    display: none;
  }
  dialog .modal-content,
  dialog:has(.game-menu) .modal-content {
    padding-top: 8px;
  }
  dialog .modal-content h2,
  .selection-card h2 {
    padding-right: 0;
  }
  .selection-card .sheet-grip {
    margin-top: -18px;
  }
  dialog:has(.game-menu) {
    inset: auto 0 0;
    margin: 0 auto;
    width: 100%;
    max-width: 540px;
    max-height: calc(100dvh - env(safe-area-inset-top) - 18px);
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sheet-settling {
    transition: none;
  }
}

/* Graphics preferences share the village's quiet, parchment-like menu. */
.graphics-settings {
  color: var(--theme-ink, #344438);
}
.graphics-preset {
  display: grid;
  gap: 9px;
  font-weight: 600;
  margin-top: 20px;
}
.graphics-settings select {
  width: 100%;
  min-height: 44px;
  padding: 10px 30px 10px 12px;
  border: 1px solid var(--theme-line, #d4dacb);
  border-radius: 7px;
  background: var(--theme-raised, #faf8ef);
  color: var(--theme-ink, #344438);
  font: inherit;
  font-size: 13px;
}
.graphics-settings select:focus-visible {
  outline: 2px solid var(--theme-accent, #42644e);
  outline-offset: 3px;
}
.graphics-summary,
.graphics-control p {
  color: var(--theme-muted, #63715f);
  font-size: 12px;
  line-height: 1.6;
}
.graphics-preview-note {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  margin: 20px 0;
  border-left: 2px solid var(--theme-gold, #91703e);
  background: var(--theme-soft, #e8eddf);
}
.graphics-preview-note > span {
  font-size: 24px;
  color: var(--theme-gold, #91703e);
}
.graphics-preview-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}
.graphics-group {
  margin: 28px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.graphics-group legend {
  padding: 0 0 10px;
  font-family: var(--font-display, Georgia, serif);
  font-size: 22px;
  color: var(--theme-ink, #344438);
}
.graphics-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  padding: 16px 0;
  border-top: 1px solid var(--theme-line, #d4dacb);
  align-items: center;
}
.graphics-control label {
  font-size: 13px;
  font-weight: 600;
}
.graphics-control p {
  grid-column: 1 / -1;
  margin: 0;
}
.graphics-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.graphics-measurement {
  font-variant-numeric: tabular-nums;
  color: var(--theme-accent, #42644e);
  font-size: 13px;
}
.graphics-performance {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 3;
  pointer-events: none;
  padding: 7px 10px;
  border-radius: 6px;
  background: var(--theme-raised, #f5f2e9);
  color: var(--theme-ink, #344438);
  border: 1px solid var(--theme-line, #d4dacb);
  font: 11px monospace;
  font-variant-numeric: tabular-nums;
}
.desktop-layout .graphics-performance {
  top: auto;
  bottom: 46px;
}
@media (max-width: 500px) {
  .graphics-control {
    grid-template-columns: 1fr;
  }
  .graphics-control p {
    grid-column: 1;
  }
  .graphics-actions > button {
    flex: 1 1 140px;
  }
}

/* The same naming control is shared by guest, reset, and cloud creation. */
.village-name-field {
  margin: 0 0 20px;
  text-align: left;
}
.village-name-field label {
  display: block;
  margin-bottom: 8px;
  font: 11px/1.5 var(--sans);
  font-weight: 600;
  color: var(--theme-ink, #344438);
}
.village-name-controls {
  display: flex;
  gap: 8px;
  min-width: 0;
}
.village-name-controls input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--theme-line, #c6cebb);
  border-radius: 5px;
  padding: 10px 12px;
  background: var(--theme-raised, #faf8f0);
  color: var(--theme-ink, #344438);
  font: 16px/1.3 var(--serif);
}
.village-name-random {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--theme-line, #c6cebb);
  border-radius: 5px;
  background: var(--theme-surface, #ecebdd);
  color: var(--theme-ink, #344438);
  font: 11px var(--sans);
}
.village-name-random:hover {
  border-color: var(--theme-accent, #497968);
}
.village-name-controls :focus-visible {
  outline: 2px solid var(--theme-accent, #497968);
  outline-offset: 3px;
}
.village-name-error {
  display: block;
  font: 11px/1.5 var(--sans);
  color: var(--theme-danger, #9b503a);
  margin-top: 8px;
}
.estate-introduction .village-name-field label,
.estate-introduction .village-name-error {
  color: #f5efdc;
}

/* A village's book of knowledge: three illustrated leaves, one for each age. */
dialog:has(.research-book) {
  width: 1080px;
  max-width: calc(100vw - 40px);
}
.research-book .game-menu-back {
  display: block;
  min-height: 32px;
  margin: 0 0 8px;
}
.research-book h2 {
  margin-bottom: 12px;
}
.research-intro {
  max-width: 680px;
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
}
.research-ledger {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 18px 0 12px;
  padding: 15px 0;
  border-block: 1px solid var(--line);
}
.research-ledger strong,
.research-ledger small {
  display: block;
}
.research-ledger strong {
  font: 27px/1.3 var(--serif);
  margin: 5px 0;
}
.research-ledger small,
.research-time-note,
.research-blocked,
.research-prerequisites,
.age-visual-unlock {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}
.research-current progress {
  width: 100%;
  height: 5px;
  accent-color: var(--green);
}
.research-time-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 24px;
}
.research-time-note svg,
.research-appearance svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.research-ages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.research-age {
  display: grid;
  grid-template-rows: auto repeat(3, 1fr);
  gap: 12px;
  min-width: 0;
}
.research-age-header {
  padding: 12px 16px;
  border-top: 2px solid var(--gold);
  background: var(--paper-light);
  text-align: center;
}
.research-age-number {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--green);
}
.research-age-number span {
  font: 25px var(--serif);
}
.research-age-number small {
  font-size: 9px;
  letter-spacing: 1px;
}
.age-architecture {
  width: 100%;
  max-width: 240px;
  height: 90px;
  object-fit: contain;
  display: block;
  margin: 3px auto;
}
.research-age-header h3 {
  font: 30px var(--serif);
  margin: 0;
}
.research-age-header p {
  font-size: 11px;
  margin: 6px 0 8px;
}
.age-requirement {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
}
.age-visual-unlock {
  display: block;
  margin-top: 5px;
}
.age-locked .research-age-header {
  border-top-color: var(--line);
}
.research-tech {
  display: flex;
  flex-direction: column;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-light);
}
.research-tech .eyebrow {
  font-size: 8px;
  letter-spacing: 1.4px;
}
.research-tech h4 {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 10px 0;
  font-size: 14px;
  color: var(--ink);
}
.research-tech h4 svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.research-tech p {
  font-size: 12px;
  line-height: 1.65;
  margin: 0 0 12px;
}
.research-appearance {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--green);
  margin-bottom: 12px;
}
.research-prerequisites {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: auto;
}
.research-prerequisites span {
  display: block;
}
.requirement-met,
.research-done {
  color: var(--green);
}
.research-tech-action {
  margin-top: 12px;
}
.research-tech-action .cost {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 11px;
}
.research-tech-action .cost small {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
}
.research-tech-action button {
  width: 100%;
  min-height: 38px;
}
.research-blocked {
  display: block;
  margin-top: 9px;
}
.research-done {
  font-size: 11px;
}
.tech-running {
  border-color: var(--gold);
  box-shadow: inset 0 3px var(--gold);
}
.tech-learned {
  border-color: var(--green);
}
@media (max-width: 760px) {
  dialog:has(.research-book) {
    max-width: 100vw;
    width: 100%;
  }
  .research-ages {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .research-age {
    grid-template-rows: auto;
  }
  .research-ledger {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .research-tech {
    padding: 20px;
  }
}
.site-page {
  min-height: 100dvh;
  background: var(--theme-raised, #f5f2e9);
  color: var(--theme-ink, #304639);
}

/* Account atlas: a village portrait, a compact ledger, and quieter records. */
.account-estate .account-main {
  max-width: 1440px;
  padding: 42px 5% 76px;
}
.estate-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 32px;
}
.estate-heading .site-eyebrow {
  margin-bottom: 14px;
  font-size: 9px;
}
.estate-heading h1 {
  font: 42px/1.1 var(--serif);
  letter-spacing: -0.7px;
  margin: 0;
}
.estate-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 12px;
  color: var(--theme-muted, #63715f);
  overflow-wrap: anywhere;
}
.estate-identity .site-text-button {
  padding: 7px 0;
}
.village-estate {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.5fr);
  border: 1px solid var(--theme-line, #c6cebb);
}
.estate-introduction {
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 3.5vw, 52px);
  background: #243e32;
  color: #f5efdc;
  min-width: 0;
}
.estate-kicker {
  font-size: 9px;
  letter-spacing: 2px;
  color: #c8d2ba;
}
.estate-title {
  margin: auto 0;
  padding: 38px 0;
}
.estate-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  color: #c1a46b;
  margin-bottom: 22px;
}
.estate-rule::after {
  content: "";
  width: 72px;
  border-top: 1px solid #9c8a5d;
}
.estate-title h2 {
  font: clamp(40px, 4.6vw, 66px)/1.02 var(--serif);
  letter-spacing: -1.3px;
  overflow-wrap: anywhere;
  margin: 0 0 20px;
}
.estate-title p {
  font-size: 12px;
  line-height: 1.8;
  color: #c8d2ba;
  margin: 0;
}
.estate-introduction .estate-play {
  background: #e9dab2;
  color: #263e32;
  border-radius: 2px;
  justify-content: space-between;
  gap: 15px;
  padding-inline: 20px;
  width: 100%;
}
.estate-introduction .estate-play:hover {
  background: #f8ebc9;
}
.estate-save-note {
  font-size: 10px;
  line-height: 1.6;
  color: #c8d2ba;
  margin-top: 12px;
}
.village-portrait {
  position: relative;
  min-width: 0;
  min-height: 420px;
  overflow: hidden;
  background: #b4c394;
}
.village-portrait canvas {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  display: block;
}
.portrait-caption {
  position: absolute;
  bottom: 18px;
  left: 20px;
  max-width: calc(100% - 90px);
  padding: 7px 10px;
  background: #203c30e6;
  color: #f5efdc;
  font-size: 10px;
  overflow-wrap: anywhere;
}
.portrait-compass {
  position: absolute;
  right: 20px;
  bottom: 16px;
  color: #203c30;
  display: grid;
  text-align: center;
  font: 12px var(--serif);
  text-shadow: 0 1px 4px #f5efdc;
}
.portrait-compass span {
  font-size: 29px;
  line-height: 1;
}
.estate-ledger {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr) 1.3fr;
  background: var(--theme-surface, #ecebdd);
  margin: 0;
  padding: 27px 0;
}
.estate-ledger > div {
  padding: 0 clamp(20px, 3vw, 42px);
  min-width: 0;
}
.estate-ledger > div + div {
  border-left: 1px solid var(--theme-line, #cbd0bd);
}
.estate-ledger dt {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--theme-muted, #63715f);
  margin-bottom: 9px;
}
.estate-ledger dd {
  font: 33px/1.1 var(--serif);
  margin: 0;
}
.estate-ledger dd span {
  font: 11px var(--sans);
  color: var(--theme-muted, #63715f);
  margin-left: 7px;
}
.estate-save-record dd {
  font-size: 22px;
}
.estate-save-record time span {
  display: block;
  margin: 5px 0 0;
}
.estate-records {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 90px);
  margin-top: 48px;
}
.estate-records section + section {
  border-left: 1px solid var(--theme-line, #cbd0bd);
  padding-left: clamp(32px, 6vw, 90px);
}
.estate-records .site-eyebrow {
  margin-bottom: 17px;
  font-size: 9px;
}
.estate-records h2,
.estate-guest-import h2 {
  font: 30px/1.15 var(--serif);
  letter-spacing: -0.3px;
  margin: 0 0 14px;
}
.estate-records p,
.estate-guest-import p {
  color: var(--theme-muted, #63715f);
  font-size: 13px;
  line-height: 1.8;
  max-width: 48ch;
  margin: 0 0 12px;
}
.estate-records .site-text-button {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  min-height: 44px;
}
.estate-management {
  margin-top: 20px;
  border-top: 1px solid var(--theme-line, #cbd0bd);
  font-size: 11px;
}
.estate-management summary {
  cursor: pointer;
  padding: 16px 0;
  color: var(--theme-muted, #63715f);
}
.estate-management summary:focus-visible {
  outline: 2px solid var(--theme-accent, #497968);
  outline-offset: 3px;
}
.estate-management .village-management {
  border: 0;
  margin: 0;
  padding: 0 0 10px;
}
.estate-guest-import {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--theme-line, #cbd0bd);
  padding: 32px 0;
}
.account-estate .account-notice,
.account-estate .account-panel {
  max-width: none;
}
@media (max-width: 850px) {
  .estate-heading {
    align-items: flex-start;
  }
  .estate-heading h1 {
    font-size: 34px;
  }
  .village-estate {
    grid-template-columns: minmax(270px, 0.95fr) minmax(0, 1fr);
  }
  .estate-ledger dd span {
    display: block;
    margin: 5px 0 0;
  }
}
@media (max-width: 600px) {
  .account-estate .account-main {
    padding: 25px 6% 44px;
  }
  .estate-heading {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 22px;
  }
  .estate-heading h1 {
    font-size: 32px;
  }
  .estate-identity {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    font-size: 11px;
  }
  .estate-identity button {
    flex-shrink: 0;
  }
  .village-estate {
    grid-template-columns: 1fr;
  }
  .estate-introduction {
    padding: 26px;
  }
  .estate-title {
    padding: 20px 0 24px;
  }
  .estate-rule {
    margin-bottom: 14px;
  }
  .estate-title h2 {
    font-size: 46px;
    margin-bottom: 12px;
  }
  .village-portrait {
    min-height: 270px;
  }
  .estate-ledger {
    grid-template-columns: 1fr 1fr;
    padding: 0;
  }
  .estate-ledger > div {
    padding: 22px;
  }
  .estate-ledger > div:nth-child(3) {
    border-left: 0;
  }
  .estate-ledger > div:nth-child(n + 3) {
    border-top: 1px solid var(--theme-line, #cbd0bd);
  }
  .estate-ledger dd {
    font-size: 30px;
  }
  .estate-save-record dd {
    font-size: 21px;
  }
  .estate-records {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-top: 32px;
  }
  .estate-records section + section {
    border-left: 0;
    border-top: 1px solid var(--theme-line, #cbd0bd);
    padding: 28px 0 0;
  }
  .estate-guest-import {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}
.site-header {
  height: 80px;
  max-width: 1600px;
  padding: 0 5%;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-brand {
  display: flex;
  gap: 13px;
  align-items: center;
  font: 32px var(--serif);
  text-decoration: none;
  color: inherit;
}
.site-header nav {
  display: flex;
  gap: 40px;
  align-items: center;
}
.site-header nav a {
  color: inherit;
  text-decoration: none;
  font-size: 13px;
}
.site-header nav .site-account-link {
  padding: 12px 19px;
  border: 1px solid var(--theme-line, #bec6b6);
  border-radius: 6px;
}
.site-eyebrow {
  font: 600 10px var(--sans);
  letter-spacing: 2.2px;
  color: var(--theme-muted, #75836b);
  display: block;
  margin-bottom: 28px;
}
.account-heading h1 em {
  font-weight: 400;
  color: var(--theme-gold, #987e4c);
}
.site-button {
  appearance: none;
  border: 0;
  background: #375440;
  color: #fffdf2;
  padding: 17px 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  text-decoration: none;
  font: 500 13px var(--sans);
  min-height: 50px;
}
.site-button:hover {
  background: #263f30;
}
.site-button.secondary {
  background: var(--theme-surface, #ececdf);
  color: var(--theme-ink, #354a3b);
  border: 1px solid var(--theme-line, #c6cbbb);
}
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 25px 5%;
  border-top: 1px solid var(--theme-line, #d9ddcd);
  font-size: 11px;
  color: var(--theme-ink, #606953);
}
.site-footer a {
  color: inherit;
  text-underline-offset: 4px;
}
.site-footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.site-footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
}
.medieval-page {
  --home-edge: clamp(20px, 4vw, 64px);
  --chronicle-paper: #eee4cb;
  --chronicle-ink: #443d2d;
  --chronicle-muted: #6f6148;
  --chronicle-rule: #b9a57c;
  --chronicle-rust: #924b36;
  background-color: var(--chronicle-paper);
  background-image:
    radial-gradient(ellipse at 0 40%, #b3956420, transparent 50%),
    radial-gradient(ellipse at 100% 80%, #b3956422, transparent 45%),
    repeating-linear-gradient(0deg, #846c4d04 0 1px, transparent 1px 4px);
  color: var(--theme-ink, #2c3e31);
}
:root[data-theme="dark"] .medieval-page {
  --chronicle-paper: #292b23;
  --chronicle-ink: #e7dcc0;
  --chronicle-muted: #c2b699;
  --chronicle-rule: #71654c;
  --chronicle-rust: #dea186;
}
.home-hero {
  display: grid;
  grid-template-columns: clamp(320px, 32vw, 480px) minmax(0, 1fr);
  height: 100svh;
  height: 100dvh;
  min-height: 100svh;
  min-height: 100dvh;
  width: 100%;
}
.home-copy {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  z-index: 1;
  padding: clamp(24px, 3.5vh, 48px) clamp(28px, 3vw, 48px);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.2vh, 28px);
  align-items: stretch;
  background: #263e32;
  background-image: repeating-linear-gradient(
    90deg,
    #e9dab204 0 1px,
    transparent 1px 5px
  );
  color: #f6edcf;
}
.home-copy::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 3px double #bba27365;
  pointer-events: none;
}
.home-copy h1 {
  margin: 0;
  width: 100%;
}
.home-copy .brand-logo {
  width: clamp(140px, 22vh, 225px);
  max-width: 100%;
  margin-inline: auto;
}
.home-story {
  margin-block: auto;
}
.home-introduction h2 {
  font: clamp(32px, 4.6vh, 48px)/1.08 var(--serif);
  letter-spacing: -0.3px;
  margin: 0 0 16px;
}
.home-introduction h2 em {
  font-weight: 400;
  color: #e0c599;
}
.home-introduction > p {
  max-width: 36ch;
  font:
    14px/1.7 Georgia,
    serif;
  color: #dfd5b8;
  margin: 0;
}
.home-details {
  display: grid;
  gap: 14px;
  margin: 24px 0 0;
  padding-top: 22px;
  border-top: 1px solid #bba27365;
}
.home-details > div {
  padding-left: 16px;
  border-left: 1px solid #bba27380;
}
.home-details dt {
  font: 16px/1.3 var(--serif);
  color: #ead9b1;
  margin-bottom: 4px;
}
.home-details dd {
  font:
    12px/1.65 Georgia,
    serif;
  color: #cbd0bb;
  margin: 0;
  max-width: 38ch;
}
.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}
.homepage .hero-actions .site-button {
  width: 100%;
  justify-content: space-between;
  border-radius: 2px;
  background: #e9dab2;
  color: #263e32;
  font:
    15px Georgia,
    serif;
  min-height: 52px;
  padding: 15px 20px;
  box-shadow:
    inset 0 0 0 1px #aa905d,
    inset 0 0 0 4px #ffffff16;
}
.homepage .hero-actions .site-button:hover {
  background: #f8ebc9;
}
.home-play-note {
  font:
    italic 11px/1.5 Georgia,
    serif;
  color: #dfd5b8;
  margin: 0;
}
.home-save-note {
  font:
    11px/1.65 Georgia,
    serif;
  color: #cbd0bb;
  margin: 2px 0 0;
}
.home-copy a:not(.site-button) {
  color: inherit;
  text-underline-offset: 3px;
}
.home-panel-footer {
  padding-top: 12px;
  border-top: 1px solid #bba27365;
  color: #cbd0bb;
}
.home-panel-links {
  display: flex;
  align-items: center;
  gap: 8px 20px;
  flex-wrap: wrap;
  font:
    11px Georgia,
    serif;
}
.home-panel-links > a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
}
.home-panel-links .theme-picker {
  margin-left: auto;
}
.homepage .theme-picker .theme-toggle {
  color: #dfd5b8;
  background: transparent;
  border-color: #bba27365;
}
.homepage .theme-picker .theme-toggle:hover {
  background: #dfd5b815;
}
.home-panel-footer > .game-version {
  display: block;
  font-size: 9px;
  margin-top: 4px;
  opacity: 0.65;
  white-space: normal;
}
.home-world {
  position: relative;
  min-width: 0;
  margin: 0;
  background: var(--theme-soft, #b4c394);
  display: flex;
  flex-direction: column;
}
.home-scene {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  display: block;
}
.home-scene-window {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
@media (max-height: 860px) and (min-width: 701px) {
  .home-copy {
    padding-block: 24px;
    gap: 14px;
  }
  .home-copy .brand-logo {
    width: 140px;
  }
  .home-introduction h2 {
    font-size: 34px;
    margin-bottom: 12px;
  }
  .home-introduction > p {
    font-size: 13px;
    line-height: 1.6;
  }
  .home-details {
    margin-top: 18px;
    padding-top: 16px;
    gap: 10px;
  }
  .home-details dd {
    line-height: 1.5;
  }
  .home-panel-footer {
    padding-top: 8px;
  }
}
@media (max-height: 760px) and (min-width: 701px) {
  .home-details dt,
  .home-details dd {
    display: inline;
  }
  .home-details dt {
    margin-right: 7px;
  }
}
@media (max-width: 1000px) and (min-width: 701px) {
  .home-hero {
    grid-template-columns: 310px minmax(0, 1fr);
  }
  .home-copy {
    padding-inline: 28px;
  }
}
@media (max-width: 700px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, auto) minmax(180px, 1fr);
  }
  .home-copy {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 14px 24px;
    padding: 24px;
  }
  .home-copy h1 {
    align-self: center;
  }
  .home-copy .brand-logo {
    width: 100px;
  }
  .home-story,
  .home-introduction {
    display: contents;
  }
  .home-introduction h2 {
    align-self: center;
    font-size: 32px;
    margin: 0;
  }
  .home-introduction > p,
  .home-details,
  .hero-actions,
  .home-panel-footer {
    grid-column: 1 / -1;
  }
  .home-introduction > p {
    max-width: none;
    font-size: 13px;
    line-height: 1.6;
  }
  .home-details {
    margin: 0;
    padding-top: 14px;
    gap: 10px;
  }
  .home-details > div {
    border-left: 0;
    padding: 0;
  }
  .home-details dt {
    display: inline;
    font-size: 15px;
    margin: 0 7px 0 0;
  }
  .home-details dd {
    display: inline;
    font-size: 11px;
    line-height: 1.6;
  }
  .hero-actions {
    gap: 7px;
  }
  .homepage .hero-actions .site-button {
    min-height: 48px;
    padding-block: 13px;
  }
  .home-save-note {
    margin: 0;
  }
  .home-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 8px;
  }
  .home-panel-links {
    flex: 1;
    gap: 12px;
  }
  .home-panel-links .theme-picker {
    margin-left: 0;
  }
  .home-panel-footer > .game-version {
    margin: 0;
    max-width: 80px;
    text-align: right;
    overflow-wrap: anywhere;
  }
}
@media (max-width: 380px) {
  .home-copy {
    grid-template-columns: 80px minmax(0, 1fr);
    column-gap: 18px;
    padding: 22px;
  }
  .home-introduction h2 {
    font-size: 28px;
  }
  .home-panel-footer {
    flex-wrap: wrap;
  }
}
.account-main {
  min-height: calc(100dvh - 170px);
  padding: 55px 5% 70px;
  max-width: 1160px;
  margin: auto;
}
.account-main > h1,
.account-heading h1 {
  font: 74px/1.04 var(--serif);
  letter-spacing: -2px;
  margin: 0 0 22px;
}
.account-heading {
  max-width: 640px;
  margin: 0 0 32px;
}
.account-heading p {
  line-height: 1.9;
  font-size: 14px;
  color: var(--theme-muted, #75816e);
}
.account-panel {
  padding: 34px;
  background: var(--theme-raised, #fcfaf2);
  border: 1px solid var(--theme-line, #d9dece);
  border-radius: 10px;
  max-width: 800px;
  box-shadow: 0 14px 40px -30px #40543855;
}
.account-panel h2 {
  font: 37px/1.1 var(--serif);
  margin: 0 0 22px;
}
.account-panel h3 {
  font: 26px var(--serif);
  margin: 0 0 15px;
}
.account-panel p {
  line-height: 1.75;
  color: var(--theme-ink, #6b7964);
}
.signin-panel {
  max-width: 500px;
}
.signin-panel form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.signin-panel form h2 {
  font-size: 29px;
  margin-bottom: 10px;
}
.signin-panel label {
  font-size: 11px;
  font-weight: 600;
}
.signin-panel input {
  min-height: 50px;
  padding: 12px 15px;
  background: var(--theme-raised, #fffef9);
  border: 1px solid var(--theme-line, #cbd2bf);
  border-radius: 5px;
  font: 15px var(--sans);
  color: var(--theme-ink, #354936);
  width: 100%;
}
.signin-panel input:focus-visible {
  outline: 2px solid var(--theme-line-strong, #497968);
  outline-offset: 3px;
}
.fine-print {
  font-size: 11px;
  line-height: 1.7;
  color: var(--theme-muted, #7f8877);
}
.fine-print a {
  color: inherit;
  text-underline-offset: 3px;
}
.guest-divider {
  border-top: 1px solid var(--theme-line, #dce0d2);
  margin-top: 24px;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.guest-divider span {
  font-size: 8px;
  letter-spacing: 1.7px;
  color: var(--theme-muted, #859076);
}
.guest-divider a {
  font-size: 12px;
  color: var(--theme-ink, #456044);
}
.email-sent > svg {
  background: var(--theme-surface, #e0ead8);
  border-radius: 50%;
  padding: 12px;
  width: 47px;
  height: 47px;
  margin-bottom: 25px;
}
.site-text-button {
  background: none;
  border: 0;
  color: var(--theme-ink, #536b47);
  font: 12px var(--sans);
  padding: 12px 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.account-notice {
  background: var(--theme-warm, #f4ead7);
  border: 1px solid var(--theme-line, #ded0b4);
  border-radius: 6px;
  padding: 16px;
  line-height: 1.7;
  max-width: 800px;
}
.village-summary {
  display: flex;
  gap: 40px;
  padding: 18px 0;
  margin: 15px 0;
  border-block: 1px solid var(--theme-line, #e1e4d6);
}
.village-summary dt {
  font-size: 10px;
  color: var(--theme-muted, #839176);
  margin-bottom: 8px;
}
.village-summary dd {
  margin: 0;
  font: 27px var(--serif);
}
.conflict-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin-top: 30px;
}
.conflict-options > div {
  min-width: 0;
}
.conflict-options .village-summary {
  gap: 20px;
}
.conflict-options .site-button {
  width: 100%;
  font-size: 11px;
}
.privacy-copy h2 {
  font-size: 28px;
  margin-top: 35px;
}
.privacy-copy h2:first-child {
  margin-top: 0;
}
.account-loading {
  display: grid;
  place-content: center;
  min-height: 100dvh;
  font: 28px var(--serif);
}
@media (min-width: 1100px) {
  .account-main:has(.signin-panel) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
    align-items: center;
  }
  .account-main:has(.signin-panel) .account-heading {
    margin-bottom: 0;
  }
}
@media (max-width: 600px) {
  .site-header {
    height: 78px;
    padding-inline: 6%;
  }
  .site-brand {
    font-size: 27px;
    gap: 9px;
  }
  .site-header nav {
    gap: 0;
  }
  .about-link {
    display: none;
  }
  .site-header nav .site-account-link {
    padding: 10px 13px;
    font-size: 11px;
  }
  .site-eyebrow {
    font-size: 8px;
    letter-spacing: 1.9px;
    margin-bottom: 24px;
  }
  .site-footer {
    padding: 23px 6%;
    font-size: 10px;
    gap: 12px;
  }
  .account-main {
    padding: 32px 6% 50px;
  }
  .account-main > h1,
  .account-heading h1 {
    font-size: 58px;
  }
  .account-heading p {
    font-size: 13px;
  }
  .account-panel {
    padding: 23px;
  }
  .account-panel h2 {
    font-size: 32px;
  }
  .village-summary {
    gap: 26px;
  }
  .village-summary dd {
    font-size: 24px;
  }
  .conflict-options {
    grid-template-columns: 1fr;
  }
  .conflict-options > div + div {
    border-top: 1px solid var(--theme-line, #dce0d2);
    padding-top: 25px;
  }
}

.village-management {
  max-width: 650px;
  border-top: 1px solid var(--theme-line, #d9ddcd);
  margin-top: 28px;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  font-size: 12px;
  color: var(--theme-ink, #6f7969);
}
.village-management p {
  margin: 0;
}
.delete-village-trigger {
  color: var(--theme-danger, #8b493d);
}
.delete-village-dialog {
  width: min(520px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: clamp(24px, 5vw, 38px);
  background: var(--theme-raised, #f5f2e9);
  color: var(--theme-ink, #304639);
  border: 1px solid var(--theme-line, #d9ddcd);
  border-radius: 16px;
}
.delete-village-dialog .site-eyebrow {
  margin-bottom: 16px;
}
.delete-village-dialog h2 {
  font: 36px/1.1 var(--serif);
  margin: 0 0 20px;
}
.delete-village-dialog p {
  font-size: 14px;
  line-height: 1.7;
}
.delete-village-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.delete-village-actions .site-button {
  flex: 1 1 180px;
  padding: 14px;
}
.site-button.destructive {
  background: #8b493d;
  color: #fffdf2;
}
.site-button.destructive:hover {
  background: #743b31;
}

.site-header:has(.theme-picker) {
  gap: 16px;
}
.site-header nav:has(.theme-picker) {
  gap: 24px;
}
.signin-panel input::placeholder {
  color: var(--theme-muted, #7f8877);
  opacity: 1;
}
:root[data-theme="dark"] .signin-panel input {
  border-color: var(--theme-line-strong);
}
@media (max-width: 700px) {
  .site-header:has(.theme-picker) {
    gap: 12px;
  }
  .site-header nav:has(.theme-picker) {
    gap: 8px;
  }
  .site-header .site-brand {
    white-space: nowrap;
  }
  .site-header nav .site-account-link {
    white-space: nowrap;
    padding-inline: 0;
    border: 0;
  }
}
@media (max-width: 360px) {
  .site-header .site-brand {
    font-size: 24px;
  }
}

/* The account register shares the homepage's parchment and manuscript details. */
.medieval-account {
  --theme-ink: var(--chronicle-ink);
  --theme-muted: var(--chronicle-muted);
  --theme-line: var(--chronicle-rule);
  --theme-line-strong: var(--chronicle-rust);
  --theme-raised: var(--chronicle-paper);
  --theme-surface: color-mix(
    in srgb,
    var(--chronicle-paper),
    var(--chronicle-rule) 14%
  );
  --theme-warm: color-mix(
    in srgb,
    var(--chronicle-paper),
    var(--chronicle-rust) 9%
  );
  color: var(--chronicle-ink);
  font-family: Georgia, "Palatino Linotype", serif;
}
.medieval-account .site-header {
  border-bottom: 1px solid var(--chronicle-rule);
  margin-inline: 5%;
  padding-inline: 0;
}
.medieval-account .site-header nav a {
  font-family: Georgia, serif;
}
.medieval-account .site-header .site-account-link {
  border-radius: 1px;
  border: 3px double var(--chronicle-rule);
}
.medieval-account .site-eyebrow,
.medieval-account .estate-kicker,
.medieval-account .estate-ledger dt {
  font:
    11px/1.5 Georgia,
    serif;
  letter-spacing: 1.7px;
  color: var(--chronicle-rust);
}
.medieval-account .estate-heading {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--chronicle-rule);
}
.medieval-account .estate-heading h1 {
  font-size: clamp(34px, 3.5vw, 48px);
  letter-spacing: 0;
}
.medieval-account .estate-identity {
  font-size: 12px;
  color: var(--chronicle-muted);
}
.medieval-account .site-text-button {
  font:
    13px/1.6 Georgia,
    serif;
  color: var(--chronicle-ink);
}
.medieval-account .site-button {
  border-radius: 1px;
  font:
    15px/1.4 Georgia,
    serif;
  box-shadow:
    inset 0 0 0 1px #304b37,
    inset 0 0 0 4px #bba27366;
}
.medieval-account .site-button.secondary {
  box-shadow: inset 0 0 0 3px var(--chronicle-paper);
  border: 3px double var(--chronicle-rule);
}
.medieval-account .village-estate {
  position: relative;
  border: 1px solid var(--chronicle-rule);
  box-shadow:
    0 7px 0 -4px var(--chronicle-paper),
    0 8px 0 -4px var(--chronicle-rule);
}
.medieval-account .estate-introduction {
  position: relative;
  background: #263e32;
  background-image: repeating-linear-gradient(
    90deg,
    #e9dab204 0 1px,
    transparent 1px 5px
  );
}
.medieval-account .estate-introduction::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 3px double #bba27365;
  pointer-events: none;
}
.medieval-account .estate-kicker {
  color: #e0c599;
}
.medieval-account .estate-title h2 {
  color: #f6edcf;
  letter-spacing: 0;
}
.medieval-account .estate-title p,
.medieval-account .estate-save-note {
  font-family: Georgia, serif;
  color: #dfd5b8;
}
.medieval-account .estate-save-note {
  font-style: italic;
}
.medieval-account .estate-play {
  box-shadow:
    inset 0 0 0 1px #aa905d,
    inset 0 0 0 4px #ffffff16;
}
.medieval-account .village-portrait::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 3px double #f6edcf88;
  pointer-events: none;
}
.medieval-account .portrait-caption {
  font:
    italic 11px/1.5 Georgia,
    serif;
  border: 1px solid #bba27365;
  bottom: 22px;
  left: 22px;
}
.medieval-account .estate-ledger {
  border-top: 1px solid var(--chronicle-rule);
  background: color-mix(
    in srgb,
    var(--chronicle-paper),
    var(--chronicle-rule) 8%
  );
}
.medieval-account .estate-ledger dd span {
  font-family: Georgia, serif;
  font-style: italic;
}
.medieval-account .estate-records {
  position: relative;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(26px, 3.5vw, 48px);
  border: 1px solid var(--chronicle-rule);
}
.medieval-account .estate-records::before,
.medieval-account .account-panel::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid var(--chronicle-rule);
  opacity: 0.45;
  pointer-events: none;
}
.medieval-account .estate-records section + section {
  padding-left: clamp(24px, 4vw, 56px);
}
.medieval-account .estate-records p,
.medieval-account .estate-guest-import p {
  font:
    14px/1.85 Georgia,
    serif;
  color: var(--chronicle-muted);
}
.medieval-account .account-panel {
  position: relative;
  border-radius: 0;
  box-shadow: none;
}
.medieval-account .account-notice,
.medieval-account .signin-panel input,
.medieval-account .delete-village-dialog {
  border-radius: 1px;
}
.medieval-account .delete-village-dialog {
  border: 4px double var(--chronicle-rule);
  font-family: Georgia, serif;
}
.medieval-account .delete-village-trigger {
  color: var(--theme-danger, #8b493d);
}
.medieval-account .site-footer {
  margin-inline: 5%;
  padding-inline: 0;
  align-items: center;
  color: var(--chronicle-muted);
}
.medieval-account .site-footer > span {
  font: 24px var(--serif);
  color: var(--chronicle-ink);
}
@media (max-width: 700px) {
  .home-introduction {
    border: 0;
    padding-top: 0;
  }
}
@media (max-width: 600px) {
  .medieval-account .site-header,
  .medieval-account .site-footer {
    margin-inline: 6%;
  }
  .medieval-account .site-header .site-account-link {
    border: 0;
  }
  .medieval-account .estate-heading h1 {
    font-size: 34px;
  }
  .medieval-account .estate-records section + section {
    padding: 26px 0 0;
  }
  .medieval-account .estate-ledger dt {
    font-size: 10px;
    letter-spacing: 1px;
  }
  .medieval-account .estate-introduction {
    padding: 30px 26px;
  }
}
