#villageEngine {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.workforce-editor[hidden] {
  display: none !important;
}
.save-export-copy {
  margin: 14px 0;
}
.save-export-copy summary {
  cursor: pointer;
  font-weight: 700;
}
.save-export-copy textarea {
  width: 100%;
  height: 120px;
  margin-top: 10px;
  padding: 10px;
  resize: vertical;
  background: #f6e8c8;
  color: #302414;
  border: 1px solid #a98b51;
  font: 12px/1.5 monospace;
}
.village-screen .resource-toggle {
  z-index: 40;
}
#villageEngine canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.engine-ready .village-terrain,
.engine-ready #mapMarkers .building-sprite {
  visibility: hidden;
}
.engine-ready #mapMarkers .building-marker:focus-visible {
  outline: 2px solid #eacb83;
  outline-offset: 5px;
}
.world-map-launchers {
  position: absolute;
  z-index: 40;
  top: 14px;
  left: 172px;
  display: flex;
  gap: 10px;
}
.world-map-card {
  display: flex;
  align-items: center;
  min-width: 160px;
  height: 45px;
  gap: 10px;
  padding: 8px 13px;
  color: #f3e5c4;
  border: 1px solid #c8a469;
  border-radius: 5px;
  background: linear-gradient(145deg, #614526, #271c10);
  box-shadow:
    inset 0 1px #d1ae63,
    0 4px 12px #0007;
  font:
    700 14px Georgia,
    serif;
}
.world-map-card:hover,
.world-map-card[aria-expanded="true"] {
  background: linear-gradient(145deg, #896138, #3f2d18);
}
.map-card-symbol {
  font-size: 24px;
  color: #e1bc75;
}
.world-map-card b {
  margin-left: auto;
  font:
    600 11px Georgia,
    serif;
}
.world-backdrop {
  position: absolute;
  z-index: 21;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #090b08b5;
  backdrop-filter: blur(3px);
}
.world-backdrop[hidden] {
  display: none;
}
.village-screen #worldMapPanel {
  position: absolute;
  z-index: 22;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  width: 1380px;
  height: 760px;
  max-height: none;
  padding: 20px;
  border-width: 6px;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  overflow: hidden;
}
.village-screen #worldMapPanel[hidden] {
  display: none;
}
.world-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 0 4px 12px;
  border-bottom: 1px solid #7c593970;
}
.world-heading h1 {
  margin: 4px 0 0;
  color: #422b17;
  font:
    700 28px Georgia,
    serif;
}
.world-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.world-heading-actions > button:not(.panel-close) {
  border: 1px solid #856844;
  border-radius: 3px;
  padding: 10px 15px;
  background: linear-gradient(#f0dfb7, #c8a875);
  color: #4a321d;
  font:
    700 13px Georgia,
    serif;
}
.world-heading-actions > button[aria-pressed="true"] {
  background: linear-gradient(#725333, #3b2918);
  color: #f4e3be;
}
.world-content {
  min-height: 0;
  overflow: hidden;
}
.world-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #7c593940;
  padding-top: 10px;
  color: #665039;
  font:
    12px/1.3 Georgia,
    serif;
}
.world-footer [role="status"] {
  color: #9e4129;
}
.province-layout,
.global-layout {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 20px;
}
.province-grid {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.province-card {
  position: relative;
  isolation: isolate;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 2px solid #795d37;
  border-radius: 4px;
  box-shadow: 0 3px 6px #2b1c1930;
  background: #304632;
  text-align: left;
}
.province-art {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  transition: filter 0.2s;
}
.province-card::after {
  position: absolute;
  inset: 35% 0 0;
  background: linear-gradient(transparent, #0f1c12eb);
  content: "";
}
.province-card:hover .province-art {
  filter: brightness(1.15);
}
.province-card[aria-pressed="true"] {
  border-color: #e6bd65;
  box-shadow: 0 0 0 2px #70501e;
}
.province-card-copy {
  position: absolute;
  z-index: 1;
  left: 13px;
  bottom: 12px;
  right: 10px;
  color: #fff1d2;
}
.province-card-copy strong {
  display: block;
  font:
    700 17px/1.2 Georgia,
    serif;
}
.province-card-copy small {
  display: block;
  margin-top: 5px;
  font:
    600 9px/1.2 Inter,
    system-ui,
    sans-serif;
  letter-spacing: 0.14em;
  color: #dbc397;
}
.province-id {
  position: absolute;
  z-index: 1;
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 4px;
  border: 1px solid #c4a36b;
  border-radius: 50%;
  background: #211d14b3;
  color: #f0dba9;
  font:
    700 13px Georgia,
    serif;
}
.capital-province .province-id {
  border-radius: 4px;
  font-size: 19px;
}
.world-sidebar {
  min-height: 0;
  overflow: auto;
  padding: 12px;
  border: 1px solid #89694161;
  border-radius: 4px;
  background: linear-gradient(140deg, #f3e3bd75, #c5a87650);
  scrollbar-color: #947344 transparent;
}
.world-sidebar h2 {
  margin: 8px 0 12px;
  color: #422c19;
  font:
    700 23px Georgia,
    serif;
}
.world-sidebar p {
  color: #614c34;
  font:
    13px/1.5 Georgia,
    serif;
}
.world-sidebar .game-action {
  width: 100%;
  margin-top: 10px;
}
.province-preview {
  height: 110px;
  margin-bottom: 14px;
  border: 1px solid #927544;
  border-radius: 3px;
}
.world-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid #896b4730;
  color: #655037;
  font:
    13px Georgia,
    serif;
}
.world-stat strong {
  font-size: 16px;
  color: #3f2b18;
}
.province-specialty {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  padding: 8px;
  border: 1px solid #98764050;
  background: #e9d6a655;
}
.province-specialty img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.province-specialty small,
.province-specialty strong {
  display: block;
  color: #5a442e;
  font:
    12px Georgia,
    serif;
}
.province-specialty strong {
  margin-top: 5px;
  font-weight: 700;
  font-size: 15px;
}
.annex-building-list {
  display: grid;
  gap: 5px;
}
.annex-building-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 42px;
  gap: 6px;
  align-items: center;
  padding: 5px;
  background: #ead8ac8a;
  border: 1px solid #8d704538;
  border-radius: 3px;
}
.annex-building-row img {
  width: 44px;
  height: 37px;
  object-fit: contain;
}
.annex-building-row strong {
  display: block;
  color: #4e3823;
  font:
    700 12px Georgia,
    serif;
}
.annex-building-row small {
  display: block;
  margin-top: 4px;
  color: #836548;
  font:
    11px Georgia,
    serif;
}
.annex-building-row button,
.annex-worker-line button {
  min-width: 28px;
  min-height: 28px;
  border: 1px solid #9c794a;
  border-radius: 3px;
  background: #d6b988;
  color: #543b23;
  font:
    700 18px Georgia,
    serif;
}
.annex-building-row button:disabled,
.annex-worker-line button:disabled {
  opacity: 0.5;
  cursor: default;
}
.annex-worker-line {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
  padding: 2px 4px 5px;
  color: #6d5336;
  font:
    11px Georgia,
    serif;
}
.annex-worker-line span {
  margin-right: auto;
}
.annex-mining summary {
  cursor: pointer;
  padding: 8px;
  color: #594227;
  font:
    700 12px Georgia,
    serif;
}
.annex-mining img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}
.annex-mining .annex-worker-line small {
  display: block;
  margin-top: 3px;
}
.annex-production-note {
  font-size: 11px !important;
}
.global-map-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 3px solid #765838;
  border-radius: 3px;
  background: #15392c;
}
.global-stage {
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.global-stage:active {
  cursor: grabbing;
}
.global-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.global-camera-controls {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px;
  border: 1px solid #bd9c62;
  border-radius: 4px;
  background: #241e15d9;
  color: #f0dba7;
}
.global-camera-controls button {
  min-width: 30px;
  height: 30px;
  padding: 4px 9px;
  border: 1px solid #916c3e;
  border-radius: 3px;
  background: #62492c;
  color: #f7e4bc;
  font:
    700 12px Georgia,
    serif;
}
.global-camera-controls span {
  min-width: 46px;
  text-align: center;
  font:
    12px Georgia,
    serif;
}
#worldCoordinateForm {
  margin: 16px 0;
}
#worldCoordinateForm label {
  display: block;
  margin-bottom: 7px;
  color: #665038;
  font:
    700 12px Georgia,
    serif;
}
.coordinate-inputs {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #856644;
}
.coordinate-inputs input {
  width: 87px;
  height: 34px;
  min-width: 0;
  border: 1px solid #ae8c58;
  border-radius: 3px;
  background: #f4e4bf;
  color: #44311e;
  padding: 5px;
  font:
    14px Georgia,
    serif;
}
.coordinate-inputs button {
  height: 34px;
  width: 40px;
  border: 1px solid #ae8c58;
  border-radius: 3px;
  background: #725332;
  color: #fff0c5;
}
.world-local-note {
  font-size: 11px !important;
  color: #806244 !important;
}
.settings-layout {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  padding: 20px 35px;
  color: #644a2c;
  font:
    15px/1.6 Georgia,
    serif;
  overflow: auto;
}
.settings-layout h2 {
  color: #48311c;
  font:
    700 25px Georgia,
    serif;
}
.settings-layout .game-action {
  display: block;
  margin: 16px 0;
  max-width: 340px;
  text-align: center;
}
.settings-layout button:not(.game-action) {
  padding: 8px 12px;
  border: 1px solid #9c794a;
  border-radius: 3px;
  background: #d7bd89;
  color: #5a412a;
}
.import-label {
  position: relative;
  cursor: pointer;
}
.import-label input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}
.settings-large-number {
  color: #594424;
  font-size: 54px;
}
#settingsQueue {
  white-space: pre-line;
  padding: 12px;
  background: #e8d3a477;
  border: 1px solid #8b6c443a;
  font-size: 13px;
}
.workforce-editor {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  padding: 10px;
  background: #e7d2a4;
  border: 1px solid #b59660;
  color: #5c442c;
  font:
    12px Georgia,
    serif;
}
.workforce-editor button {
  width: 30px;
  height: 30px;
  border: 1px solid #9c794a;
  border-radius: 3px;
  background: #d4b784;
  color: #513921;
  font:
    700 18px Georgia,
    serif;
}
.workforce-editor button:disabled {
  opacity: 0.4;
}
@media (prefers-reduced-motion: reduce) {
  .province-art {
    transition: none;
  }
}
