.world {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  --left: env(safe-area-inset-left, 0px);
  --right: env(safe-area-inset-right, 0px);
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --dock-height: 104px;
  --sheet-top: calc(var(--top) + 104px);
}

.map-viewport {
  position: absolute;
  isolation: isolate;
  inset: 0;
  overflow: hidden;
  background: #000;
  outline: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.map-viewport.dragging { cursor: grabbing; }
.world:has(.map-viewport:focus-visible) #sector-grid-toggle { box-shadow: 0 1px var(--steel-blue); }
.raster { position: absolute; top: 0; left: 0; pointer-events: none; }
.overview { display: block; width: 100%; height: 100%; }
#tiles { position: absolute; inset: 0; }
#tiles img { position: absolute; display: block; }
.daylight, #sector-grid, #roads, .places { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#journey-path { position: absolute; pointer-events: none; }
.daylight { mix-blend-mode: multiply; }
#places { z-index: 3; }
#squads { z-index: 5; }
#sector-contacts { z-index: 6; }
.sector-contacts {
  position: absolute;
  display: flex;
  justify-content: center;
  gap: min(1px, 2%);
  transform: translateX(-50%);
}
.sector-contacts[hidden] { display: none; }
.sector-contacts i {
  flex: 0 1 10px;
  min-width: 0;
  border-radius: 1px;
  box-shadow: inset 0 0 0 .75px #16150e, 0 .75px 1px #171410;
}
.sector-contacts i, .contact-key span::before { background: var(--contact-color); }
body { --neutral: #c1beb3; --guild: #64c673; --ally: #62b4f7; --enemy: #ee675d; }
[data-kind="neutral"] { --contact-color: var(--neutral); }
[data-kind="guild"] { --contact-color: var(--guild); }
:is([data-kind="own"], [data-kind="squad"]) { --contact-color: var(--party-color); }
[data-kind="ally"] { --contact-color: var(--ally); }
[data-kind="enemy"] { --contact-color: var(--enemy); }
.contact-key { display: flex; flex-wrap: wrap; gap: .2em .7em; }
.contact-key span::before { content: ""; display: inline-block; width: .65em; height: .48em; margin-right: .3em; }

.map-marker {
  appearance: none;
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
}

.marker-art {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: clip;
  pointer-events: auto;
}

.marker-portrait {
  position: absolute;
  inset: 8%;
  width: 84%;
  height: 84%;
  object-fit: cover;
}

.marker-frame {
  position: absolute;
  /* Align the painted rim (5, 2, 249, 240) inside the 256 × 250 Unity sprite with the sector. */
  left: calc(-5 / 249 * 100%);
  top: calc(-2 / 240 * 100%);
  width: calc(256 / 249 * 100%);
  height: calc(250 / 240 * 100%);
  pointer-events: none;
}
.map-marker:hover .marker-frame { filter: brightness(1.2); }
.map-marker[aria-pressed="true"] .marker-frame { filter: brightness(1.28); }
.map-marker[aria-pressed="true"] .marker-name {
  color: var(--steel-blue-light);
  text-decoration: underline;
  text-underline-offset: .2em;
}
.map-marker:focus-visible { outline: 0; }
.map-marker:focus-visible .marker-name {
  outline: 2px solid var(--steel-blue);
  outline-offset: 1px;
  box-shadow: 0 0 0 4px var(--map-outline);
}

.marker-label {
  position: absolute;
  display: grid;
  place-items: center;
  align-content: center;
  width: max-content;
  min-width: 44px;
  min-height: 44px;
  max-width: min(146px, 42vw);
  pointer-events: auto;
}
.marker-name {
  padding: 2px 3px;
  color: #f4e1bd;
  font-size: .84rem;
  line-height: 1.18;
  -webkit-text-stroke: 2.5px #30251c;
  paint-order: stroke fill;
  text-shadow: 0 1px 2px #18130e;
  text-align: center;
}
.city-marker .marker-label {
  top: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  align-content: start;
}
.city-marker .marker-name { font-size: .78rem; }
.marker-presence {
  position: relative;
  isolation: isolate;
  padding: 3px 10px 4px;
  color: var(--party-color);
  font-size: .78rem;
  line-height: 1.18;
  text-shadow: 0 1px 2px #15110c;
}

.squad-marker {
  position: absolute;
  z-index: 2;
  inset: 0 auto auto 0;
  display: grid;
  place-items: center;
  width: var(--medallion);
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
  --medallion: 47px;
  transform: translate(-50%, -50%);
}

.squad-medallion { display: grid; place-items: center; position: relative; width: var(--medallion); aspect-ratio: 1; }
.squad-portrait { width: 86%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; object-position: center 22%; background: #2e2821; }
.squad-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.squad-marker[aria-pressed="true"] .squad-medallion {
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--steel-blue), 0 0 0 3px var(--map-outline);
}
.squad-name {
  position: absolute;
  isolation: isolate;
  pointer-events: none;
  bottom: calc(100% + 1px);
  left: 50%;
  width: max-content;
  max-width: min(145px, 42vw);
  padding: 6px 14px;
  color: #f2e4cb;
  text-shadow: 0 1px 2px #070605;
  font-size: .84rem;
  line-height: 1.12;
  text-align: center;
  overflow-wrap: anywhere;
  transform: translateX(-50%);
}
.squad-name::before, .marker-presence::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border: solid transparent;
  border-width: 12px 13px;
  border-image: url("/art/map/squad-nameplate.png") 36 39 fill stretch;
}

.player-squad .squad-name { color: var(--party-color); }
.player-squad .squad-name, .marker-presence {
  -webkit-text-stroke: 2px var(--map-outline);
  paint-order: stroke fill;
}

.marker-presence::after {
  content: "";
  position: absolute;
  inset: auto 10px 2px;
  height: 1px;
  background: var(--party-color);
}

.map-target, .inspection-point {
  --target-line: var(--steel-blue);
  --target-text: var(--steel-blue-light);
  --target-field: var(--steel-blue-field);
  position: absolute;
  z-index: 4;
  pointer-events: none;
  border: 1px solid var(--target-line);
  box-shadow: 0 0 0 1px #191c1ca0;
}
.map-target[data-confirmed="true"] {
  --target-line: #e4ba6b;
  --target-text: #f7e0aa;
  --target-field: #362b1deb;
  box-shadow: inset 0 0 7px 2px #e3ad594e, 0 0 5px #e7b75a52;
}
.map-target i {
  display: none;
  position: absolute;
  inset: 0;
  border: 1px solid #f5d28b;
  box-shadow: inset 0 0 6px #edc47880, 0 0 5px #edc47890;
}
@media (prefers-reduced-motion: no-preference) {
  .map-target[data-moving="true"] i {
    display: block;
    animation: destination-wave 2.2s cubic-bezier(.2,.6,.35,1) infinite both;
  }
  .map-target[data-moving="true"] i:nth-of-type(2) { animation-delay: 170ms; }
  .map-target[data-moving="true"] i:nth-of-type(3) { animation-delay: 320ms; }
}
@keyframes destination-wave {
  0% { opacity: 0; transform: scale(1.38); }
  8% { opacity: .72; }
  32%, 100% { opacity: 0; transform: scale(1); }
}
.map-target span {
  position: absolute;
  left: 50%;
  top: calc(100% + var(--eta-gap, 6px));
  transform: translateX(-50%);
  padding: 3px 7px;
  background: var(--target-field);
  border-bottom: 1px solid var(--target-line);
  color: var(--target-text);
  font-size: .76rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.map-target[data-city="true"] { --eta-gap: 27px; }
.map-target span:empty { display: none; }

.hud-top {
  position: absolute;
  z-index: 2;
  inset: var(--top) var(--right) auto var(--left);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 443px) minmax(0, 1fr);
  align-items: start;
  gap: 4px 18px;
  pointer-events: none;
}

.hud-view-stack {
  --hud-scrim-fill: radial-gradient(ellipse 102% 155% at left top, #211b14ce 14%, #211b148b 51%, #211b142e 77%, transparent 100%);
  --hud-scrim-rule: linear-gradient(270deg, transparent 7%, #caa97135 53%, #caa97192);
  --hud-scrim-left: -19px;
  --hud-scrim-right: -40px;
  grid-area: 1 / 1;
  display: grid;
  justify-items: start;
  align-items: start;
  gap: 4px;
  min-width: 0;
}
.hud-map-tools {
  grid-area: 1 / 3;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  justify-self: end;
  gap: 4px 7px;
  width: max-content;
  min-width: 0;
  max-width: 100%;
}
.hud-map-tools .hud-menu { flex: none; }
.hud-view-panel {
  display: grid;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  padding: 2px 10px 8px;
  overflow-wrap: anywhere;
}
.hud-view-panel:not(:has(> :not([hidden]))) { display: none; }
.map-hint { padding-block: 5px 2px; color: #edddbd; font-size: .76rem; line-height: 1.24; }
.hud-map-statuses {
  display: grid;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
  padding: 3px 10px 0;
  color: #ecdab9;
  text-shadow: 0 1px 2px #171510, 0 0 4px #171510;
  font-size: .74rem;
  font-style: italic;
  font-synthesis: style;
  line-height: 1.26;
  overflow-wrap: anywhere;
}
.hud-map-statuses:not(:has(> p:not([hidden]), .game-notification:not([hidden]))) { display: none; }
.hud-map-statuses #visibility-status { color: #efadbd; }
.hud-map-statuses .error { color: #f6be94; }

.hud-calendar {
  grid-area: 1 / 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-width: 0;
}
.world-clock { grid-area: 1 / 1; width: 100%; }
.marquee { position: relative; aspect-ratio: 2931 / 471; }
.marquee img { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; }
.marquee-sky {
  position: absolute;
  inset: 17% 9% 23%;
  border-radius: 24px;
  background: #292a28 url("/art/clock-sky.jpg") repeat-x 0 center / auto 100%;
}

.marquee::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 20%;
  bottom: 24%;
  width: 1px;
  background: #edcd94;
  box-shadow: 0 0 4px #1d160fae;
}

.clock-readout {
  grid-area: 1 / 1;
  display: flex;
  align-items: baseline;
  align-self: start;
  justify-self: start;
  translate: calc(-100% - 8px);
  gap: 1px 5px;
  padding: 3px 6px;
  color: #edddbd;
  font-size: .69rem;
}
.hud-scrim {
  position: relative;
  isolation: isolate;
  text-shadow: 0 1px 2px #171510;
}
.hud-scrim::before, .hud-scrim::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -7px var(--hud-scrim-right, -19px) 3px var(--hud-scrim-left, -40px);
  pointer-events: none;
}
.hud-scrim::before {
  background: var(--hud-scrim-fill, radial-gradient(ellipse 102% 155% at right top, #211b14ce 14%, #211b148b 51%, #211b142e 77%, transparent 100%));
}
.hud-scrim::after {
  inset-block-start: auto;
  height: 1px;
  background: var(--hud-scrim-rule, linear-gradient(90deg, transparent 7%, #caa97135 53%, #caa97192));
}

.clock-readout span { white-space: nowrap; }
.clock-readout time { font-size: 1rem; color: var(--data); font-variant-numeric: tabular-nums; line-height: 1.15; }

.hud-sector-name {
  grid-area: 2 / 1;
  justify-self: center;
  max-width: 100%;
  margin-top: -2px;
  padding: 0 12px 2px;
  overflow: hidden;
  color: #efdec0;
  background: radial-gradient(ellipse at center, #252019e8 25%, #252019b0 55%, transparent 75%);
  text-align: center;
  text-shadow: 0 1px 2px #171510, 0 0 5px #171510;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .77rem;
  line-height: 1.2;
}

.hero-death-plaque {
  grid-area: 3 / 1;
  justify-self: center;
  margin-top: 3px;
  pointer-events: none;
}

.hero-death-plaque img { display: block; width: min(216px, 49vw); height: auto; }

.hero-death-actions {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 32px);
  transform: translate(-50%, -50%);
  padding: 12px;
  text-align: center;
}

.hero-death-actions .order-key { width: 100%; min-height: 44px; }
.hero-death-actions p { margin: 8px 0 0; color: var(--muted); font-size: .85rem; }

.hud-menu {
  position: relative;
  justify-self: end;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  padding: 4px 7px 5px;
}

.hud-menu-button {
  flex: none;
  display: grid;
  justify-items: center;
  align-items: center;
  min-width: 48px;
  min-height: 46px;
  padding: 0 5px;
  border: 0;
  background: transparent;
  pointer-events: auto;
}

.hud-menu-button img { width: 32px; height: 33px; object-fit: contain; }
.hud-menu-button:hover img { filter: brightness(1.2); }
.hud-menu-button:active img { filter: brightness(.78); }
.hud-menu-label { font-size: .65rem; color: var(--muted); }
.hud-menu-button:is(:hover, :focus-visible) .hud-menu-label { color: var(--steel-blue-light); }

body[data-world-ready="true"] .clock-readout { animation: clock-readout-in var(--drawer-speed) var(--drawer-ease) both; }
body[data-world-ready="true"] .world-clock { animation: clock-in 420ms var(--drawer-ease) both; }
@keyframes clock-readout-in {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: none; }
}
@keyframes clock-in {
  from { opacity: 0; transform: translateY(-17px); }
  to { opacity: 1; transform: none; }
}

.place-drawer {
  position: absolute;
  z-index: 3;
  inset: max(var(--sheet-top), calc(var(--map-tools-bottom, 0px) + 5px)) var(--right) calc(var(--right-dock-height, var(--dock-height)) + 4px) auto;
  width: min(374px, calc(100% - 80px));
  transform: translateX(100%);
  pointer-events: none;
  transition: transform var(--drawer-speed) var(--drawer-ease);
}

.place-drawer[data-open="true"] { transform: translateX(0); }
.sheet-toggle {
  position: absolute;
  top: 3px;
  right: calc(100% - 5px);
  display: grid;
  place-items: center;
  width: 46px;
  height: 44px;
  padding: 4px;
  border: 0;
  background: transparent;
  pointer-events: auto;
}
.sheet-toggle img {
  width: 38px;
  rotate: -90deg;
  filter: drop-shadow(0 2px 2px #15120fd0);
  transition: rotate 210ms var(--drawer-ease);
}
.sheet-toggle[aria-expanded="true"] img { rotate: 90deg; }
.sheet-toggle:is(:hover, :focus-visible) img { filter: brightness(1.19) drop-shadow(0 2px 2px #15120fd0); }
.object-kind {
  position: absolute;
  z-index: 2;
  isolation: isolate;
  inset: 1px auto auto 1px;
  display: grid;
  place-items: center;
  width: max(110px, 8.7em);
  height: 43px;
  padding: 0 12px 7px;
  color: #f4dfb6;
  font-size: .77rem;
  text-shadow: 0 2px 3px #21160e, 0 0 9px #21160e;
  pointer-events: none;
}
.object-kind::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border: solid transparent;
  border-width: 0 20px;
  border-image: url("/art/cloth.png") 0 65 fill stretch;
  scale: -1 1;
}
.place-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 8px 9px;
  max-height: min(100%, 62dvh, 620px);
  overflow: hidden;
  pointer-events: auto;
  filter: drop-shadow(0 8px 11px #1b1511a8);
}
.place-sheet-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #8d7050 var(--steel);
  scrollbar-width: thin;
  scrollbar-gutter: stable;
}
.place-sheet-body:focus-visible { outline-offset: -2px; }
.place-sheet-tools {
  position: absolute;
  inset: 65px calc(100% - 2px) auto auto;
  max-height: calc(100% - 65px);
  padding: 5px;
  gap: 5px;
  overflow: auto;
  scrollbar-width: none;
  pointer-events: auto;
}
.place-sheet-tools, .route-orders, .object-actions { display: grid; gap: 5px; }
.place-sheet-tools:not(:has(button:not([hidden]), #route-choice:not([hidden]))),
.place-drawer[data-open="false"] .place-sheet-tools { display: none; }
.object-actions:not([hidden]) + .route-orders { padding-top: 4px; border-top: 1px solid #879a9e50; }
.route-choice { position: relative; }
.route-choice select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  color-scheme: dark;
  font: inherit;
}
.route-choice > svg { pointer-events: none; }
.route-choice:has(:focus-visible) { box-shadow: inset 0 0 0 1px var(--steel-blue-light), 0 2px 4px #19130f80; }

@supports (appearance: base-select) {
  #route-mode, #route-mode::picker(select) { appearance: base-select; }
  #route-mode {
    opacity: 1;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: transparent;
    outline: 0;
  }
  #route-mode::picker-icon { display: none; }
  #route-mode::picker(select) {
    position-area: block-end span-inline-start;
    margin-block-start: 4px;
    min-inline-size: max-content;
    padding: 4px;
    border: 1px solid #8b7b60;
    border-radius: 8px;
    color: #efdec1;
    background: linear-gradient(#36372f, #292923);
    box-shadow: inset 0 1px #dfc89336, 0 6px 18px #18130fc7;
  }
  #route-mode option {
    min-height: 36px;
    gap: 7px;
    padding: 5px 10px;
    border-radius: 4px;
    color: inherit;
  }
  #route-mode option:checked { color: #e8d098; }
  #route-mode option:is(:hover, :focus-visible) {
    color: var(--steel-blue-light);
    background: #435158aa;
    outline: 0;
  }
}

.stop-command {
  color: #f3cec2;
  border-color: #a5685b;
  background: linear-gradient(#683a33, #422723);
}
.stop-command:hover:not(:disabled) {
  color: #fff0e5;
  border-color: #c58a77;
  background: linear-gradient(#804b40, #553029);
}
.stop-command:disabled { color: #c7a398; }

.place-drawer[data-open="false"] .place-panel { pointer-events: none; }
.object-visual {
  display: grid;
  place-items: center;
  position: relative;
  margin: 0 0 4px;
  overflow: hidden;
  background: #2c281f;
  box-shadow: inset 0 0 0 1px #726352;
}

.object-visual[data-type="wide"] { width: 100%; aspect-ratio: 16 / 9; }
.object-visual[data-type="wide"]::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px #c0a7859b; pointer-events: none; }
.object-visual[data-type="wide"] img { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

.object-visual[data-type="portrait"] img { display: block; width: 119px; aspect-ratio: 1; margin: 8px; object-fit: cover; object-position: center 22%; }
.object-visual[data-type="character"] { padding: 12px; }
.object-visual[data-type="character"] .character-portrait { width: min(100%, 90px); }
.object-visual[hidden] + .field-sheet { padding-block-start: 37px; }

.field-sheet {
  padding: 14px 14px 16px;
  color: #161310;
  background: linear-gradient(#f0dcad86, #e9d2a984), var(--paper) url("/art/paper.jpg") center 46% / cover;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}

.field-sheet :focus-visible { outline-color: var(--steel-ink); }
.place-head h2 { margin-top: 4px; font-size: 1.72rem; line-height: 1.04; font-weight: 400; overflow-wrap: anywhere; }
.place-note { margin-top: 8px; font-size: .91rem; white-space: pre-line; }
.route-detail { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--steel-ink); }
.road-name { font-size: .98rem; font-weight: 400; }
.route-table { font-size: .88rem; }
.road-name:not([hidden]) + .route-table { margin-top: 6px; }
.route-table > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: 8px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--paper-rule); }
.route-table dt { font-weight: 600; }
.route-table dd { margin: 0; max-width: 11em; text-align: end; overflow-wrap: anywhere; font-size: .96rem; font-variant-numeric: tabular-nums; }
.risk-detail { margin-top: 8px; font-size: .87rem; line-height: 1.3; }

.hud-bottom {
  position: absolute;
  isolation: isolate;
  z-index: 2;
  inset: auto 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, min(40%, 600px)) minmax(0, 1fr);
  gap: 13px;
  align-items: end;
  padding: 9px var(--right) var(--bottom) var(--left);
  pointer-events: none;
}

.order-dock {
  grid-column: 2;
  justify-self: center;
  width: min(100%, 32rem);
  min-width: 0;
}
.sector-entry {
  position: relative;
  z-index: 0;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: clamp(126px, 13vw, 184px);
  min-height: 28px;
  margin: 0 auto;
  padding: 4px 22px 5px;
  border: 0;
  background: transparent;
  color: #f4ddb5;
  font-size: .84rem;
  pointer-events: auto;
}
.sector-entry svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}
.sector-entry::before, .sector-entry::after {
  content: "";
  position: absolute;
  inset: 0 0 -6px;
  clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%);
  background: #ae8b55;
  z-index: -2;
}
.sector-entry::after { inset: 1px 2px -6px; z-index: -1; background: linear-gradient(#50412e, #28241f); }
.sector-entry:hover:not(:disabled)::after { background: linear-gradient(#6a5337, #302721); }
.sector-entry:disabled { color: #ac9f89; }
.sector-takeover {
  display: block;
  min-height: 34px;
  margin: 0 auto 5px;
  font-size: .83rem;
  pointer-events: auto;
}
.hud-character-stack {
  grid-area: 1 / 1;
  display: grid;
  width: min(100%, 17.75rem);
  min-width: 0;
  gap: 5px;
}

.player-dock {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  inline-size: min(100%, 256px);
  margin-inline: auto;
  padding: 2px 6px;
  color: #e6dccc;
  pointer-events: auto;
  filter: drop-shadow(0 3px 5px #17120f8a);
}
.player-dock-button {
  position: relative;
  display: grid;
  place-items: center;
  min-inline-size: 0;
  min-block-size: 42px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.player-dock-button + .player-dock-button { border-inline-start: 1px solid #879a9e27; }
.player-dock-button img {
  filter: drop-shadow(0 1px 1px #100e0b);
  pointer-events: none;
  transition: transform 180ms ease-out, filter 160ms;
}
.player-dock-button::after {
  position: absolute;
  z-index: 1;
  inset-block-end: calc(100% + 7px);
  inset-inline-start: 50%;
  padding: 3px 8px;
  border: 1px solid #ac8d56;
  border-radius: 3px;
  background: #2a2722;
  color: #f4e6cb;
  font-size: .79rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 3px);
  transition: opacity 130ms, transform 170ms ease-out;
  content: attr(aria-label);
}
.order-dock:has(.sector-entry:not([hidden])) .player-dock-button::after { inset-block-end: calc(100% + 36px); }
.player-dock-button:is(:hover, :focus-visible) img {
  transform: translateY(-2px) scale(1.07);
  filter: brightness(1.26) drop-shadow(0 1px 3px #c3995650);
}
.player-dock-button:is(:hover, :focus-visible)::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.player-dock:has(.player-dock-button:hover) .player-dock-button:focus-visible:not(:hover)::after { opacity: 0; }
.player-dock-button:focus-visible {
  outline: 0;
  background: radial-gradient(ellipse closest-side, #9dbcc93d, transparent);
}
.player-dock-button:active img {
  transform: translateY(1px) scale(.92);
  filter: brightness(1.08) drop-shadow(0 1px 1px #100e0b);
}
@media (hover: none) {
  .player-dock-button:hover:not(:focus-visible)::after { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .player-dock-button img, .player-dock-button::after { transition: none; }
  .player-dock-button:is(:hover, :focus-visible, :active) img { transform: none; }
}

.game-notification {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 5px;
}
.game-notification h2 { color: var(--data); font: inherit; }
.game-notification p { margin-top: 2px; }
#dismiss-game-notification {
  min-width: 28px;
  min-height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  text-shadow: inherit;
  pointer-events: auto;
}
#dismiss-game-notification:is(:hover, :focus-visible) { color: var(--steel-blue-light); }
@media (pointer: coarse) {
  #dismiss-game-notification { min-width: 44px; min-height: 44px; }
}

.hud-status-stack {
  grid-area: 1 / 3;
  display: grid;
  justify-items: end;
  justify-self: end;
  gap: 5px;
  width: min(100%, 19rem);
  min-width: 0;
}

.hud-resources {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(6px, 1vw, 15px);
  min-height: 40px;
  max-width: 100%;
  padding: 7px 11px;
  filter: drop-shadow(0 3px 5px #17120f8a);
}
.resource { display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--muted); }
.resource + .resource { border-inline-start: 1px solid #879a9e50; padding-inline-start: 10px; }
.resource img { flex: none; width: 25px; height: 25px; object-fit: contain; }
.resource .eyebrow { font-size: .61rem; letter-spacing: .06em; }
.resource strong { display: block; color: var(--data); font-size: 1.12rem; font-variant-numeric: tabular-nums; line-height: 1.06; }

.main-menu, .player-section-dialog {
  width: min(390px, calc(100vw - 28px));
  max-height: calc(100dvh - 24px);
  padding: 22px 25px 26px;
  border: 0;
  background: transparent;
  color: #f0e1c8;
  filter: drop-shadow(0 11px 13px #17120fba);
}

.main-menu::backdrop, .player-section-dialog::backdrop { background: #15131162; }
.player-section-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 9px; }
.player-section-dialog h2 { color: var(--steel-blue-light); font-size: 1.48rem; font-weight: 400; }
.player-section-dialog p { color: var(--muted); line-height: 1.35; }
.player-section-dialog .map-key { min-width: 44px; padding: 0; font-size: 1.26rem; }
.main-menu {
  --menu-padding: clamp(14px, 4vw, 26px);
  width: min(480px, calc(100vw - 20px));
  padding: var(--menu-padding);
}
.main-menu form {
  display: flex; flex-direction: column;
  max-height: calc(100dvh - 24px - 2 * var(--menu-padding));
}
.main-menu form > :not([role="tabpanel"]) { flex-shrink: 0; }
.main-menu h2 { margin: 0 0 14px; font-size: 1.75rem; font-weight: 400; }
.menu-tabs {
  display: grid; grid-template-columns: repeat(4, auto);
  border-block-end: 1px solid #a88a665e;
}
.menu-tabs button {
  min-width: 0; min-height: 44px; padding: 5px 2px;
  font: inherit; font-size: clamp(.84rem, 3.2vw, 1rem); color: var(--muted); background: transparent;
  border: 0; border-block-end: 2px solid transparent; cursor: pointer;
}
.menu-tabs button:hover { color: var(--steel-blue-light); }
.menu-tabs button[aria-selected="true"] {
  color: #f4ddb1; border-block-end-color: #bd9259;
  background: linear-gradient(transparent, #af86501b);
}
.main-menu [role="tabpanel"] { min-height: 0; padding-block: 16px 5px; overflow: auto; }
@media (min-height: 440px) {
  .main-menu [role="tabpanel"] { min-height: 9rem; }
}
.main-menu :focus-visible { outline: 2px solid var(--steel-blue-light); outline-offset: -2px; }
.menu-local-graphics, .local-visit .menu-global-graphics { display: none; }
.local-visit .menu-local-graphics { display: grid; gap: 6px; }
.menu-zoom-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.menu-zoom-row span { margin-inline-end: auto; color: var(--data); }
.menu-layer { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.menu-layer input, .menu-volume input { accent-color: #c19762; }
.menu-layer input { width: 1.1rem; height: 1.1rem; }
.menu-volume { display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 12px; }
.menu-volume + .menu-volume { margin-top: 10px; }
.menu-volume output { color: var(--data); font-variant-numeric: tabular-nums; }
.menu-volume input { grid-column: 1 / -1; width: 100%; min-height: 32px; margin: 0; cursor: pointer; }
.main-menu .control-reference { margin: 0; }
.control-reference kbd { color: #e1d2b7; font: inherit; }
.main-menu .menu-actions { justify-content: flex-end; margin-top: 10px; border-top: 1px solid #879a9e50; padding-top: 12px; }
.game-release { margin: 4px 0 12px; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.menu-ping { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 14px; font-size: .87rem; }
.menu-ping dd { margin: 0; color: var(--data); font-variant-numeric: tabular-nums; }
.control-reference { margin-block: 16px; font-size: .87rem; }
.control-reference div { display: grid; grid-template-columns: minmax(85px, .6fr) minmax(0, 1.4fr); gap: 10px; padding: 7px 0; border-block-end: 1px solid #879a9e50; }
.control-reference dt { color: var(--steel-blue-light); }
.control-reference dd { margin: 0; color: var(--muted); }
.menu-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.map-place-picker { display: grid; gap: 4px; margin: 0 0 14px; font-size: .87rem; color: var(--data); }
.map-place-picker select { width: 100%; min-height: 42px; padding: 5px 8px; border: 1px solid var(--steel-line); background: var(--steel); color: #f0e1c8; color-scheme: dark; font: inherit; }
.map-place-picker select:focus-visible { border-color: var(--steel-blue); outline-offset: 1px; }
.menu-zoom { min-width: 42px; font-size: 1.14rem; }

@media (max-width: 1180px) {
  .hud-top { grid-template-columns: minmax(0, 1fr) minmax(220px, 354px) minmax(0, 1fr); column-gap: 9px; }
}

@media (max-width: 1060px) {
  .hud-top { grid-template-columns: minmax(0, 1fr) minmax(0, min(62%, 23rem)); }
  .hud-calendar {
    grid-area: 1 / 1 / 2 / -1;
    grid-template-columns: max-content minmax(0, 345px);
    column-gap: 8px;
    justify-self: center;
    max-width: 100%;
    padding-inline: 8px;
  }
  .clock-readout { translate: none; }
  .world-clock, .hud-sector-name, .hero-death-plaque { grid-column: 2; }
  .hud-view-stack { grid-area: 2 / 1; }
  .hud-map-tools { grid-area: 2 / 2; }
}

@media (max-width: 790px) {
  .hud-bottom { grid-template-columns: minmax(0, 1.45fr) minmax(122px, 1fr); gap: 7px; }
  .order-dock { grid-area: 2 / 1 / 3 / -1; }
  .hud-status-stack { grid-area: 1 / 2; }
  .hud-resources { gap: 6px; padding: 5px 7px; }
  .resource img { width: 21px; height: 22px; }
  .resource strong { font-size: .99rem; }
}

@media (max-width: 590px) {
  .hud-menu { padding: 1px 4px 2px; }
  .hud-menu-button { min-width: 43px; min-height: 43px; padding-inline: 3px; }
  .hud-menu-button img { width: 27px; height: 28px; }
  .hud-menu-label { font-size: .58rem; }
  .hud-calendar { grid-template-columns: minmax(0, max-content) minmax(0, 309px); column-gap: 4px; }
  .world-clock { align-self: end; }
  .clock-readout { display: grid; grid-template-columns: max-content max-content; font-size: .66rem; }
  .clock-readout #calendar-date { grid-column: 1 / -1; white-space: normal; }
  .clock-readout time { font-size: .94rem; }
  .hud-map-tools { column-gap: 4px; }
  .place-drawer { width: min(314px, calc(100% - 80px)); }
  .place-panel { padding: 6px 7px; }
  .field-sheet { padding: 12px; }
  .place-head h2 { font-size: 1.45rem; }
  .hud-resources { gap: 5px; justify-content: end; }
  .resource { gap: 3px; }
  .resource + .resource { padding-inline-start: 3px; }
  .resource img { width: 16px; height: 18px; }
  .resource .eyebrow { font-size: .55rem; letter-spacing: .02em; }
}

@media (max-width: 360px) {
  .resource img { width: 14px; }
}

@media (pointer: coarse) {
  .player-dock-button, .sector-entry, .sector-takeover { min-height: 44px; }
}
