@font-face {
  font-family: HarborSerif;
  src: local(".NewYork-Regular");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: HarborSerif;
  src: local(".NewYork-Medium");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: HarborSerif;
  src: local(".NewYork-Semibold");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: HarborSerif;
  src: local(".NewYork-Bold");
  font-weight: 700;
  font-display: swap;
}
:root {
  --ink: rgb(38, 66, 59);
  --paper: rgb(247, 242, 224);
  --gold: rgb(222, 176, 92);
  font-family:
    -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -3px;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
button:active {
  filter: brightness(0.9);
}
button svg {
  width: 22px;
  height: 22px;
  display: block;
  flex: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
svg {
  overflow: visible;
}
#game {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  background: var(--paper);
}
#header {
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  z-index: 2;
}
.header-top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}
.brand-mark {
  color: var(--gold);
  width: 27px;
  height: 27px;
}
.brand-mark svg {
  width: 27px;
  height: 27px;
}
.brand {
  min-width: 0;
  flex: 1;
}
.brand h1 {
  font-family: HarborSerif, ui-serif, Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  white-space: nowrap;
}
.brand p {
  font-size: 9px;
  color: rgb(247 242 224 / 0.6);
  margin-top: 2px;
  white-space: nowrap;
}
.header-actions {
  display: flex;
  gap: 12px;
}
.header-actions button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
}
.header-actions button.speed {
  font-size: 15px;
  font-weight: 700;
}
.header-actions button.on {
  background: rgb(222 176 92 / 0.3);
}
.resources {
  display: flex;
  margin-top: 8px;
  padding-bottom: 4px;
}
.resource {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.resource-value {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family:
    ui-rounded,
    -apple-system,
    sans-serif;
}
.resource-value svg {
  color: var(--gold);
  width: 22px;
  height: 22px;
}
.resource-label {
  font-size: 8px;
  color: rgb(247 242 224 / 0.6);
}
.resource.population {
  display: none;
}
#map {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #325f60;
  touch-action: none;
}
#map canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#map-ui {
  position: absolute;
  inset: 0;
  padding: 12px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
#map-ui button {
  pointer-events: auto;
}
#mission {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: rgb(247 242 224 / 0.96);
  border-radius: 16px;
  box-shadow: 0 5px 10px rgb(38 66 59 / 0.08);
  text-align: left;
}
.mission-ring {
  width: 37px;
  height: 37px;
  position: relative;
  flex-shrink: 0;
}
.mission-ring > svg {
  width: 37px;
  height: 37px;
}
.mission-ring .icon {
  position: absolute;
  inset: 7.5px;
  width: 22px;
  height: 22px;
}
.mission-text strong {
  display: block;
  font-family: HarborSerif, ui-serif, Georgia, serif;
  font-size: 12px;
  font-weight: 600;
}
.mission-text small {
  display: block;
  font-size: 9px;
  opacity: 0.6;
  margin-top: 4px;
}
#mission > .icon {
  width: 22px;
  height: 22px;
}
.map-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  width: 100%;
}
#region {
  opacity: 0.65;
  line-height: 1.3;
}
#region small {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
}
#region strong {
  display: block;
  font-family: HarborSerif, ui-serif, Georgia, serif;
  font-weight: 500;
  font-size: 12px;
  margin-top: 4px;
}
#map-buttons {
  display: flex;
  gap: 5px;
}
#map-buttons button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: rgb(247 242 224 / 0.94);
  border-radius: 12px;
}
#bottom {
  padding: 14px 12px 10px;
  background: var(--paper);
  min-width: 0;
  z-index: 2;
}
.context {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 10px;
}
.context-copy {
  min-width: 0;
  flex: 1;
}
.context > .icon {
  width: 35px;
  height: 22px;
  flex: 0 0 35px;
}
.context h2 {
  font-family: HarborSerif, ui-serif, Georgia, serif;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.context p {
  font-size: 10px;
  line-height: 1.25;
  opacity: 0.6;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.context p.error {
  opacity: 1;
  color: #bd5142;
}
.context button {
  padding: 0;
  font-size: 12px;
  min-height: 44px;
  flex-shrink: 0;
}
.context button svg {
  margin: 0 11px;
}
.cards {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 2px 0;
  min-width: 0;
}
.cards::-webkit-scrollbar {
  display: none;
}
.build-card {
  padding: 10px;
  flex: 0 0 110px;
  width: 110px;
  height: 112px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  background: rgb(255 255 255 / 0.6);
  border: 1px solid rgb(38 66 59 / 0.1);
  border-radius: 13px;
}
.build-card.selected {
  color: var(--paper);
  background: var(--ink);
  border: 1.5px solid var(--gold);
}
.card-image-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  height: 53px;
}
.card-image-row img {
  width: 57px;
  height: 53px;
  object-fit: contain;
}
.card-image-row .icon {
  opacity: 0.5;
  width: 22px;
  height: 22px;
}
.build-card strong {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.card-cost {
  display: flex;
  gap: 6px;
  opacity: 0.65;
  font-size: 9px;
  min-height: 22px;
}
.card-cost span {
  display: flex;
  align-items: center;
  gap: 2px;
}
.card-cost svg {
  width: 22px;
  height: 22px;
}
.bottom-legend {
  display: none;
}
.wide-only {
  display: none !important;
}
#placement {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.placement-action {
  position: absolute;
  transform: translate(-50%, -50%);
  height: 88px;
  pointer-events: auto;
  color: var(--paper);
  text-shadow:
    0 1px 2px #26423b,
    0 0 2px #26423b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 6px;
}
.placement-action img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px #26423b);
}
.placement-action strong {
  font-family:
    ui-rounded,
    -apple-system,
    sans-serif;
  font-size: 11px;
}
.placement-action small {
  font-size: 9px;
  line-height: 1.15;
  color: #ffd6b8;
  font-weight: 600;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.placement-action:disabled {
  opacity: 1;
}
.placement-action:disabled img {
  opacity: 0.6;
  width: 24px;
  height: 24px;
}
.placement-action[hidden] {
  display: none;
}
dialog {
  color: var(--ink);
  background: var(--paper);
  border: 0;
  padding: 0;
  border-radius: 20px;
  max-width: min(620px, calc(100vw - 32px));
  width: 100%;
  max-height: calc(100dvh - 40px);
  box-shadow: 0 14px 60px #0004;
}
dialog::backdrop {
  background: rgb(0 0 0 / 0.3);
}
.sheet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: var(--paper);
  border-bottom: 1px solid #26423b18;
}
.sheet-head h2 {
  font-size: 18px;
  font-weight: 650;
}
.sheet-head button {
  font-size: 15px;
  min-height: 32px;
}
.sheet-body {
  padding: 20px;
  overflow: auto;
}
.sheet-body p {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}
.sheet-body h3 {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.65;
  margin: 22px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.sheet-body h3:first-child {
  margin-top: 0;
}
.sheet-group {
  background: rgb(255 255 255 / 0.62);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}
.sheet-group p:last-child {
  margin-bottom: 0;
}
.sheet-group > button,
.menu-list > button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 0;
  text-align: left;
  border-bottom: 1px solid #26423b15;
  font-size: 15px;
}
.sheet-group > button:last-child,
.menu-list > button:last-child {
  border-bottom: 0;
}
.danger {
  color: #bb443c;
}
.sheet-building {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.sheet-building img {
  width: 90px;
  height: 95px;
  object-fit: contain;
}
.sheet-building h2 {
  font-size: 24px;
}
.sheet-building p {
  font-size: 12px;
  margin: 6px 0 0;
}
.guide-title {
  font-family: HarborSerif, ui-serif, Georgia, serif;
  font-size: 32px;
  font-weight: 500;
  margin: 0 0 24px;
}
.guide-step {
  display: flex;
  gap: 16px;
  margin: 24px 0;
}
.guide-step > b {
  font-family: HarborSerif, ui-serif, Georgia, serif;
  font-size: 25px;
  color: var(--gold);
  font-weight: 500;
}
.guide-step h4 {
  margin: 0 0 8px;
  font-size: 17px;
}
.guide-step p {
  color: #26423bb3;
}
.guide-progress {
  padding: 16px;
  background: #deb05c33;
  border-radius: 16px;
  font-weight: 600;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #26423b15;
}
.list-row:last-child {
  border: 0;
}
.list-row div {
  flex: 1;
}
.list-row > .icon {
  width: 28px;
  height: 22px;
  flex: 0 0 28px;
}
.list-row small {
  display: block;
  opacity: 0.65;
  font-size: 12px;
  margin-top: 4px;
}
.list-row > span {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.primary {
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  min-height: 44px;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 600;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  margin-top: 20px;
}
.victory {
  text-align: center;
  padding: 36px;
}
.victory .icon {
  width: 68px;
  height: 68px;
  color: var(--gold);
  margin: 0 auto 24px;
}
.victory h2 {
  font-family: HarborSerif, ui-serif, Georgia, serif;
  font-size: 32px;
  font-weight: 500;
  margin-bottom: 24px;
}
.victory p {
  opacity: 0.7;
  margin-bottom: 24px;
}
#resident {
  max-width: 320px;
  border: 1px solid #deb05cb3;
  border-radius: 18px;
  box-shadow: 0 6px 16px #26423b33;
}
#resident::backdrop {
  background: #0000002e;
}
.resident-body {
  padding: 18px;
}
.resident-title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.resident-title > div {
  flex: 1;
}
.resident-title small {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--gold);
}
.resident-title h2 {
  font-family: HarborSerif, ui-serif, Georgia, serif;
  font-size: 21px;
  margin-top: 4px;
}
.resident-title button {
  width: 44px;
  height: 44px;
  font-size: 27px;
  flex-shrink: 0;
}
.resident-body hr {
  border: 0;
  border-top: 1px solid #deb05c80;
  margin: 10px 0;
}
.resident-body p {
  font-size: 15px;
  line-height: 1.3;
  margin: 10px 0;
}
.resident-body p.minor {
  font-size: 12px;
  opacity: 0.7;
}
.satiety-line {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}
.resident-body progress {
  width: 100%;
  height: 5px;
  border: 0;
  display: block;
  appearance: none;
  margin: 5px 0 10px;
}
.resident-body progress::-webkit-progress-bar {
  background: #26423b22;
  border-radius: 5px;
}
.resident-body progress::-webkit-progress-value {
  background: var(--ink);
  border-radius: 5px;
}
.resident-body progress.low::-webkit-progress-value {
  background: var(--gold);
}
#connection {
  position: fixed;
  z-index: 20;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 12px;
  box-shadow: 0 5px 30px #0004;
}
body[aria-busy="true"] {
  cursor: progress;
}
@media (min-width: 701px) and (min-height: 501px) {
  #header {
    padding: 16px 28px;
  }
  .brand h1 {
    font-size: 21px;
  }
  .brand p {
    font-size: 11px;
  }
  .resources {
    margin-top: 16px;
  }
  .resource-value {
    gap: 8px;
    font-size: 19px;
  }
  .resource-label {
    font-size: 10px;
  }
  .resource.population {
    display: flex;
    flex: 0 0 110px;
    border-left: 1px solid #f7f2e033;
  }
  .resource.population svg {
    color: var(--paper);
  }
  .wide-only {
    display: flex !important;
  }
  #map-ui {
    padding: 24px;
  }
  #mission {
    padding: 16px;
  }
  .mission-text strong {
    font-size: 15px;
  }
  .mission-text small {
    font-size: 11px;
  }
  #region strong {
    font-size: 17px;
  }
  #bottom {
    padding: 14px 24px 16px;
  }
  .context h2 {
    font-size: 18px;
  }
  .context p {
    font-size: 11px;
  }
  .build-card {
    width: 121px;
    flex-basis: 121px;
  }
  .build-card strong {
    font-size: 12px;
  }
  .bottom-legend {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    font-weight: 500;
    color: #26423b73;
    margin-top: 10px;
  }
  .bottom-legend span:first-child {
    letter-spacing: 2px;
  }
}
@media (orientation: landscape) and (max-height: 499px) {
  #game {
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-rows: auto minmax(0, 1fr);
  }
  #map {
    grid-column: 1;
    grid-row: 1/3;
  }
  #header {
    grid-column: 2;
    grid-row: 1;
  }
  #bottom {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .header-actions {
    gap: 4px;
  }
  .header-top {
    gap: 6px;
  }
  .brand h1 {
    font-size: 15px;
  }
  .build-card {
    flex-basis: 110px;
  }
  .context {
    margin-bottom: 10px;
  }
  dialog {
    max-height: calc(100dvh - 20px);
  }
}
@media (max-width: 420px) {
  .header-actions {
    gap: 2px;
  }
  .header-top {
    gap: 8px;
  }
  .brand h1 {
    font-size: 15px;
  }
  .mission-text small {
    font-size: 9px;
  }
}
