:root {
  color-scheme: dark;
  --ink: #f6f0dd;
  --muted: #bac9be;
  --gold: #f0bd78;
  --line: #40514b;
  --panel: #192c2a;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  background: #122321;
  color: var(--ink);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
summary {
  font: inherit;
  cursor: pointer;
}
button {
  color: inherit;
  background: #233a36;
  border: 1px solid #566859;
  border-radius: 7px;
  min-height: 35px;
  padding: 6px 11px;
  font-size: 13px;
  font-weight: 650;
}
button:hover:not(:disabled) {
  border-color: var(--gold);
  color: #fff4d9;
}
button:focus-visible,
summary:focus-visible,
canvas:focus-visible {
  outline: 3px solid #ffd488;
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button[aria-pressed='true'] {
  color: #ffda99;
  border-color: var(--gold);
  background: #39443a;
}
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  pointer-events: none;
}
.sprites,
[hidden] {
  display: none !important;
}
h1,
h2,
p {
  margin: 0;
}
h1,
h2,
.brand strong {
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: -0.035em;
}
main {
  height: 100dvh;
  min-height: 490px;
  display: flex;
  flex-direction: column;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--line);
  background: #182b28;
}
.brand,
.accounts,
.accounts > span,
.views,
.worktop,
.footerline,
.line {
  display: flex;
  align-items: center;
}
.brand {
  gap: 10px;
}
.brand svg {
  color: var(--gold);
  height: 29px;
  width: 29px;
}
.brand strong {
  font-size: 25px;
  white-space: nowrap;
}
.brand > span {
  border-left: 1px solid #66796c;
  padding-left: 14px;
  margin-left: 4px;
  font-size: 13px;
  color: var(--muted);
}
.accounts {
  gap: 22px;
}
.accounts > span {
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.accounts b {
  font-size: 16px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.accounts button {
  min-width: 32px;
  border-radius: 50%;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(220px, 19.5vw, 300px);
  flex: 1;
  min-height: 0;
}
#scene {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #698079;
}
#world {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}
#scene.moving #world {
  cursor: grab;
}
#scene.moving #world:active {
  cursor: grabbing;
}
.maphead {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 17px 18px 38px;
  background: linear-gradient(#13251fe8, transparent);
  z-index: 2;
  pointer-events: none;
}
.maphead h1 {
  font-size: clamp(25px, 3vw, 42px);
  text-shadow: 0 2px 12px #121d16;
}
.eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--gold);
}
.eyebrow i {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #b7d8b1;
  border-radius: 50%;
  margin-right: 5px;
}
.views {
  gap: 5px;
  pointer-events: auto;
}
.views button,
.navpad button {
  background: #152b27eb;
  box-shadow: 0 2px 9px #081b1d45;
  color: #f4edda;
}
.views svg {
  width: 15px;
  height: 15px;
  margin-right: 4px;
}
#markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.parcel {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  min-height: 0;
  height: 23px;
  width: 23px;
  padding: 0;
  line-height: 1;
  border: 1px solid #caefe0;
  border-radius: 50%;
  background: #19493be8;
  color: #dcf8eb;
  box-shadow: 0 1px 3px #1423189c;
  font: 600 17px/1 system-ui;
  pointer-events: auto;
}
.parcel:hover,
.parcel:focus-visible {
  z-index: 1;
  background: #775c35;
}
.navpad {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(3, 29px);
  grid-template-rows: repeat(2, 28px);
  gap: 2px;
}
.navpad button {
  border-radius: 5px;
  min-height: 0;
  padding: 0;
  font-size: 16px;
}
.navpad button:nth-child(1) {
  grid-column: 2;
}
.navpad button:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}
.navpad button:nth-child(3) {
  grid-column: 3;
  grid-row: 2;
}
.navpad button:nth-child(4) {
  grid-column: 2;
  grid-row: 2;
}
#status {
  pointer-events: none;
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 216px);
  padding: 7px 13px;
  text-align: center;
  border-radius: 6px;
  background: #122b25ee;
  color: #ffdfaa;
  font-size: 13px;
  box-shadow: 0 2px 9px #1423184d;
}
#status:empty {
  display: none;
}
#load,
#error {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  padding: 14px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
}
aside {
  background: var(--panel);
  border-left: 1px solid var(--line);
  overflow: auto;
}
aside > div,
aside > details {
  margin: 0 18px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}
aside h2 {
  font-size: clamp(24px, 2.2vw, 34px);
  margin: 5px 0 8px;
}
aside p,
#guide p {
  font-size: 13px;
  line-height: 1.49;
  color: #d5dfd2;
}
.primary {
  background: #e9b574;
  color: #222f24;
  border-color: #e9b574;
  width: 100%;
  padding: 9px 10px;
  font-weight: 750;
}
.primary:hover:not(:disabled) {
  background: #f7d299;
  color: #15281f;
}
#risk {
  margin: 8px 0;
  display: block;
}
.link {
  border: 0;
  background: none;
  color: #d7e5d6;
  padding: 3px 0;
  min-height: 25px;
}
.link[aria-pressed='true'] {
  color: var(--gold);
  background: none;
}
.line {
  justify-content: space-between;
  margin: 9px 0 4px;
}
.line > b {
  color: #b3e2bb;
}
summary {
  font-size: 13px;
}
footer {
  padding: 9px 18px 8px;
  background: #162b28;
  border-top: 1px solid #55685a;
}
.worktop,
.footerline {
  justify-content: space-between;
  gap: 10px;
}
.worktop h2 {
  font-size: 21px;
}
.worktop {
  margin-bottom: 5px;
}
#tools {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
}
#tools button {
  display: flex;
  align-items: center;
  padding: 9px 10px;
  gap: 7px;
  text-align: left;
  white-space: nowrap;
}
#tools small {
  margin-left: auto;
  font-weight: 500;
  color: #e0d2b6;
}
.footerline {
  margin-top: 6px;
  min-height: 18px;
}
.footerline p,
.footerline span {
  font-size: 12px;
  color: var(--muted);
}
.footerline span {
  white-space: nowrap;
}
dialog {
  color: var(--ink);
  background: var(--panel);
  border: 1px solid #8a9887;
  border-radius: 10px;
  padding: 24px;
  max-width: min(440px, 94vw);
}
dialog::backdrop {
  background: #10251bc9;
}
dialog h2 {
  margin: 8px 0;
}
#guide p {
  margin: 10px 0;
}
@media (max-width: 1050px) {
  #tools button {
    padding: 8px 6px;
    gap: 4px;
  }
  #tools svg {
    width: 15px;
  }
  .views button {
    font-size: 12px;
    padding: 4px 7px;
  }
}
@media (max-width: 760px) {
  main {
    min-height: 560px;
  }
  header {
    padding: 7px 10px;
    gap: 4px;
  }
  .brand {
    gap: 5px;
  }
  .brand strong {
    font-size: 20px;
  }
  .brand svg {
    width: 24px;
  }
  .brand > span {
    display: none;
  }
  .accounts {
    gap: 8px;
  }
  .accounts > span {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    font-size: 9px;
  }
  .accounts b {
    font-size: 14px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  #scene {
    flex: 1;
    min-height: 190px;
  }
  .maphead {
    padding: 8px 8px 25px;
  }
  .maphead h1 {
    font-size: 21px;
  }
  .maphead .eyebrow {
    font-size: 8px;
  }
  .views {
    gap: 3px;
  }
  .views button {
    font-size: 11px;
    min-height: 31px;
  }
  .views svg {
    display: none;
  }
  aside {
    border-left: 0;
    border-top: 1px solid var(--line);
    overflow: visible;
  }
  aside > div,
  aside > details {
    margin: 0;
    border: 0;
  }
  footer {
    padding: 5px 8px;
  }
  .worktop h2 {
    font-size: 17px;
  }
  .worktop {
    margin-bottom: 3px;
  }
  #tools {
    display: flex;
    gap: 4px;
    overflow: auto;
  }
  #tools button {
    flex: 1;
    flex-direction: column;
    gap: 1px;
    min-width: 50px;
    padding: 3px 5px;
    font-size: 10px;
    align-items: center;
  }
  #tools small {
    margin: 0;
  }
  #tools svg {
    width: 15px;
    height: 15px;
  }
  .footerline {
    margin-top: 3px;
    min-height: 26px;
  }
  .footerline p {
    font-size: 11px;
  }
  .footerline span {
    display: none;
  }
  #status {
    font-size: 11px;
    left: auto;
    right: 6px;
    transform: none;
    max-width: calc(100% - 104px);
    bottom: 6px;
  }
  .navpad {
    left: 6px;
    bottom: 5px;
    grid-template-columns: repeat(3, 25px);
    grid-template-rows: repeat(2, 23px);
  }
}
@media (max-height: 580px) and (min-width: 761px) {
  .maphead {
    padding: 7px 12px;
  }
  .worktop {
    display: none;
  }
  aside > div,
  aside > details {
    padding: 9px 0;
  }
}
#parcel-info {
  pointer-events: none;
  position: absolute;
  bottom: 48px;
  right: 12px;
  max-width: calc(100% - 122px);
  background: #19342bec;
  border: 1px solid #839180;
  padding: 5px 9px;
  border-radius: 5px;
  color: #e9eedc;
  font-size: 12px;
}
#parcel-info[hidden] {
  display: none;
}
@media (max-width: 760px) {
  #parcel-info {
    font-size: 10px;
    bottom: 40px;
    right: 6px;
  }
}
#recovery {
  margin: 8px 12px 0;
  color: #ffd398;
}
@media (max-width: 760px) {
  #recovery {
    font-size: 11px;
    min-height: 22px;
    padding: 2px 5px;
    margin: 2px 10px;
  }
}

.hazard-pin {
  position: absolute;
  pointer-events: none;
  white-space: nowrap;
  background: #764126f0;
  color: #fff0c7;
  border: 1px solid #f9c585;
  border-radius: 4px;
  padding: 1px 4px;
  font: 700 10px/1.35 system-ui;
  z-index: 1;
}
#spotlight {
  font-size: 11px;
  min-height: 25px;
  margin-top: 4px;
  color: #ffd99e;
}
@media (max-width: 760px) {
  #spotlight {
    grid-column: 1/-1;
    justify-self: start;
    padding: 1px 6px;
    min-height: 20px;
    margin: 0;
  }
}

/* The harbor desk stays alongside the map on desktop and folds beneath it on phones. */
:root {
  --panel: #193336;
  --line: #415b59;
  --gold: #efc182;
}
header {
  background: #132c30;
}
.brand svg {
  color: #efbc78;
}
.workspace {
  grid-template-columns: minmax(0, 1fr) clamp(245px, 21vw, 330px);
}
.compass {
  position: absolute;
  left: 12px;
  bottom: 81px;
  display: flex;
  align-items: center;
  background: #18312fde;
  border: 1px solid #6e8478;
  border-radius: 6px;
  color: #e4e9d5;
}
.compass button {
  min-height: 26px;
  border: 0;
  background: transparent;
  padding: 2px 6px;
}
.compass span {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.views button[aria-pressed='true'] {
  border-color: var(--gold);
  color: #ffe3b4;
  background: #334537;
}
aside section {
  border-bottom: 1px solid var(--line);
  padding: 17px 16px;
}
.desk-row,
.modal-head,
.time-controls,
.stock-row,
.qty,
.receipt > div,
.stall-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.time-controls {
  gap: 4px;
}
.time-controls button {
  padding: 2px 7px;
  min-height: 27px;
  font-size: 12px;
}
.desk-day #hour,
#weather-count {
  font:
    600 11px/1.2 ui-monospace,
    monospace;
  color: #c4d8cf;
}
.dayline {
  height: 3px;
  background: #3d5552;
  border-radius: 3px;
  overflow: hidden;
}
.dayline i {
  display: block;
  height: 100%;
  background: #f0c481;
}
.desk-day .line {
  margin-top: 14px;
}
.desk-day .line b {
  font-size: 20px;
}
.town-trade h3,
.weather-card h3,
dialog h3 {
  font:
    600 23px/1.1 Georgia,
    serif;
  margin: 7px 0;
}
.town-trade .primary {
  margin-top: 10px;
}
.weather-card:not(.warning) h3 {
  font-size: 18px;
}
.weather-heading { display: flex; align-items: center; gap: .45em; }
.weather-heading svg { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.weather-card[data-sky="sunny"] .weather-heading svg,
.weather-card[data-sky="golden"] .weather-heading svg { color: #ffcd64; }
.weather-card.warning {
  background: #493f30;
}
.weather-card .link {
  display: inline-block;
  margin: 5px 6px 4px 0;
}
.weather-card #recovery,
.weather-card #crew-open {
  margin: 4px 0;
}
aside .town-record {
  margin: 0;
  padding: 12px 16px;
}
.town-record p {
  margin-top: 8px;
}
dialog {
  max-height: 90dvh;
  overflow: auto;
}
#market-dialog,
#crew-dialog {
  width: min(422px, 94vw);
}
.modal-head button {
  background: none;
  border: 0;
  font-size: 20px;
  padding: 0 6px;
  min-height: 28px;
}
.stall-select {
  margin: 12px 0;
  font-size: 13px;
  color: var(--muted);
}
select {
  background: #233f3d;
  color: var(--ink);
  border: 1px solid #708279;
  border-radius: 4px;
  padding: 6px;
}
#market-content p,
#crew-dialog p {
  font-size: 13px;
  color: #ccdbd1;
  line-height: 1.45;
  margin: 9px 0 14px;
}
.stock-row {
  border-top: 1px solid #50605a;
  padding: 10px 0;
  gap: 12px;
}
.stock-row > svg {
  width: 38px;
  height: 38px;
  color: #e8bd7d;
  background: #2c443d;
  border-radius: 8px;
  padding: 5px;
}
.stock-row > div:nth-child(2) {
  flex: 1;
}
.stock-row small {
  display: block;
  color: #c5d1c2;
  font-size: 11px;
}
.qty button {
  padding: 2px 8px;
  min-height: 30px;
}
.qty output {
  font-variant-numeric: tabular-nums;
}
.receipt {
  border-top: 1px dashed #849283;
  padding-top: 10px;
}
.receipt > div:not(.eyebrow) {
  font-size: 13px;
  padding: 4px 0;
}
.receipt h3 {
  color: #bfdeb2;
}
.receipt .eyebrow {
  display: block;
}
#crew-sites {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
@media (max-width: 760px) {
  .compass {
    left: 6px;
    bottom: 58px;
  }
  .maphead {
    display: block;
  }
  .maphead > div:first-child {
    display: flex;
    gap: 6px;
    align-items: baseline;
  }
  .maphead h1 {
    font-size: 18px;
  }
  .maphead .views {
    display: inline-flex;
    margin-top: 3px;
  }
  .views button {
    min-height: 29px;
  }
  .workspace {
    display: flex;
  }
  aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-height: min(34dvh, 248px);
    overflow: auto;
  }
  aside section {
    padding: 7px 10px;
  }
  .desk-day h2 {
    font-size: 18px;
  }
  .desk-day .line {
    margin: 4px 0;
  }
  .desk-day .line b {
    font-size: 15px;
  }
  .desk-day .line span {
    font-size: 11px;
  }
  .desk-day #breakdown,
  .town-trade p,
  .weather-card p {
    font-size: 10px;
    line-height: 1.3;
  }
  .desk-row .eyebrow,
  .town-trade .eyebrow,
  .weather-card .eyebrow {
    font-size: 8px;
  }
  .town-trade h3,
  .weather-card h3 {
    font-size: 16px;
    margin: 4px 0;
  }
  .town-trade .primary {
    margin-top: 4px;
    padding: 4px;
    min-height: 26px;
    font-size: 11px;
  }
  .weather-card {
    grid-column: 1/-1;
  }
  .weather-card:not(.warning) {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .weather-card:not(.warning) h3 {
    font-size: 13px;
    white-space: nowrap;
  }
  .weather-card:not(.warning) #event-hint {
    flex: 1;
  }
  .town-record {
    grid-column: 1/-1;
  }
  aside .town-record {
    padding: 3px 10px;
  }
  .town-record summary {
    font-size: 10px;
  }
  .time-controls button {
    padding: 1px 5px;
    min-height: 21px;
  }
  .weather-card #crew-open {
    min-height: 25px;
    font-size: 11px;
  }
  .dayline {
    height: 2px;
  }
}

.classic-link {
  color: #e4c08d;
}
