.gastown-sim-page {
  background:
    radial-gradient(circle at 18% 8%, rgba(74, 103, 138, 0.35) 0, rgba(12, 17, 25, 0) 34%),
    radial-gradient(circle at 76% 18%, rgba(203, 146, 89, 0.15) 0, rgba(8, 11, 17, 0) 28%),
    linear-gradient(180deg, #111824 0%, #080a10 56%, #040507 100%);
  color: #d5dde8;
  padding: 0;
}

.gastown-sim-shell {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  display: grid;
  gap: 0.75rem;
  background: linear-gradient(180deg, rgba(10, 13, 20, 0.9), rgba(8, 10, 15, 0.94));
  border: 1px solid rgba(173, 190, 215, 0.16);
  border-radius: 0;
  padding: 0.9rem;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.gastown-sim-header h1,
.gastown-help h2,
.gastown-debug h2 {
  margin: 0;
}

.gastown-sim-header {
  display: grid;
  gap: 0.2rem;
}

.gastown-sim-kicker,
.gastown-sim-intro,
.gastown-status,
.gastown-landmark,
.gastown-route-segment,
.gastown-world-status,
.gastown-quest-status,
.gastown-hud-detail-count {
  margin: 0;
}

.gastown-sim-intro {
  color: rgba(224, 236, 249, 0.88);
  font-size: 0.95rem;
}

.gastown-sim-platform-note {
  margin: 0;
  color: #ffd4a8;
  font-size: 0.84rem;
}

.gastown-controls-drawer,
.gastown-log-drawer {
  border: 1px solid rgba(170, 197, 226, 0.18);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(16, 22, 33, 0.78), rgba(8, 11, 18, 0.9));
}

.gastown-controls-drawer summary,
.gastown-log-drawer summary {
  cursor: pointer;
  padding: 0.6rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8fc8ff;
}

.gastown-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.75rem 0.75rem;
}

.gastown-controls label {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.78rem;
}

.gastown-controls select,
.gastown-name-field input {
  min-width: 118px;
  border-radius: 6px;
  border: 1px solid rgba(200, 214, 236, 0.3);
  background: #0f131b;
  color: #dce5f3;
  padding: 0.42rem 0.52rem;
}

.gastown-help {
  padding: 0 0.75rem 0.75rem;
  color: rgba(219, 232, 248, 0.92);
}

.gastown-help ul {
  margin: 0.4rem 0 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.18rem;
}

.gastown-help-note {
  margin: 0.5rem 0 0;
  color: #b8d7f4;
  font-size: 0.8rem;
}

.gastown-hud {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 0.32rem 0.5rem;
  align-items: center;
}

.gastown-hud-identity,
.gastown-hud-route,
.gastown-hud-card,
.gastown-meta-strip > * {
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(170, 197, 226, 0.22);
  background: linear-gradient(180deg, rgba(16, 22, 33, 0.8), rgba(8, 11, 18, 0.92));
}

.gastown-hud-kicker,
.gastown-expedition-label {
  margin: 0 0 0.24rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8fc8ff;
}

.gastown-hud-name {
  margin: 0;
  font-size: clamp(0.92rem, 1.7vw, 1.12rem);
  line-height: 1;
  color: #f6fbff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.gastown-hud-subline,
.gastown-expedition-value,
.gastown-hud-detail-count,
.gastown-minimap-mode-status,
.gastown-minimap-context,
.gastown-minimap-label,
.gastown-attribution {
  font-size: 0.82rem;
  line-height: 1.3;
}

.gastown-hud-subline {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.28rem 0.56rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 138, 0.34);
  background: rgba(22, 16, 8, 0.78);
  color: #ffe9b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gastown-hud-route {
  display: grid;
  justify-items: end;
  gap: 0.16rem;
  min-width: 112px;
}

.gastown-hud-route .gastown-expedition-value {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #f7fbff;
}

.gastown-hud-detail-count {
  color: #bdd8ff;
  display: none;
}

.gastown-interact-prompt[hidden],
.gastown-dialog-modal[hidden],
.gastown-name-overlay[hidden],
.gastown-tutorial-overlay[hidden] {
  display: none !important;
}

.gastown-interact-prompt[hidden] {
  display: none !important;
}

.gastown-dialog-modal[hidden],
.gastown-name-overlay[hidden],
.gastown-tutorial-overlay[hidden] {
  display: none !important;
}

.gastown-interact-prompt {
  grid-column: 1 / -1;
  margin: 0;
  justify-self: start;
  padding: 0.32rem 0.58rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 205, 116, 0.88);
  background: rgba(30, 21, 10, 0.9);
  color: #fff5dd;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.gastown-sim-canvas {
  position: relative;
  width: 100%;
  min-height: clamp(560px, calc(100vh - 310px), 1200px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(164, 182, 209, 0.22);
  background: radial-gradient(circle at 50% 0, rgba(120, 165, 215, 0.15), rgba(8, 10, 14, 0) 38%), linear-gradient(180deg, #0b0d12 0%, #06080c 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 42px rgba(0, 0, 0, 0.42);
}

.gastown-sim-canvas::before,
.gastown-sim-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gastown-sim-canvas::before {
  background: linear-gradient(180deg, rgba(197, 156, 112, 0.08), rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0.18) 100%), radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 38%);
  mix-blend-mode: screen;
  opacity: 0.85;
}

.gastown-sim-canvas::after {
  background: linear-gradient(180deg, rgba(4, 5, 8, 0.06), rgba(4, 5, 8, 0.22));
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.25);
}

.gastown-sim-canvas canvas {
  display: block;
  width: 100% !important;
  height: auto !important;
}

.gastown-live-strip {
  position: absolute;
  right: 0.8rem;
  top: 0.8rem;
  display: grid;
  gap: 0.22rem;
  max-width: min(170px, 24vw);
}

.gastown-fullscreen-toggle {
  position: absolute;
  top: 0.8rem;
  right: calc(0.8rem + min(170px, 24vw) + 0.55rem);
  z-index: 4;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(174, 207, 239, 0.58);
  border-radius: 7px;
  background: rgba(10, 18, 28, 0.92);
  color: #f1f7ff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.gastown-fullscreen-toggle:hover,
.gastown-fullscreen-toggle:focus-visible {
  background: rgba(33, 52, 74, 0.95);
  outline: none;
}

.gastown-sim-canvas:fullscreen {
  border-radius: 0;
  border: 0;
}

.gastown-sim-canvas:fullscreen .gastown-fullscreen-toggle {
  right: calc(0.8rem + min(200px, 30vw) + 0.55rem);
}

.gastown-landmark,
.gastown-route-segment,
.gastown-world-status {
  padding: 0.24rem 0.46rem;
  border-radius: 7px;
  background: rgba(10, 16, 25, 0.82);
  border: 1px solid rgba(164, 190, 218, 0.18);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gastown-route-debug-overlay {
  position: absolute;
  right: 0.75rem;
  top: 4.75rem;
  margin: 0;
  max-width: min(360px, 45vw);
  max-height: 52%;
  overflow: auto;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #d4ecff;
  background: rgba(7, 11, 18, 0.78);
  border: 1px solid rgba(143, 182, 214, 0.4);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.gastown-minimap {
  position: absolute;
  left: 0.85rem;
  bottom: 0.85rem;
  width: 220px;
  display: grid;
  gap: 0.34rem;
  padding: 0.45rem;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(10, 15, 23, 0.92), rgba(7, 11, 18, 0.88));
  border: 1px solid rgba(136, 170, 204, 0.42);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(8px);
}

.gastown-minimap canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(172, 201, 230, 0.24);
}

.gastown-minimap-toolbar { display: flex; justify-content: flex-end; align-items: center; gap: 0.35rem; }
.gastown-minimap-mode, .gastown-minimap-zoom { height: 1.7rem; font-size: 0.72rem; font-weight: 700; border-radius: 6px; border: 1px solid rgba(174, 207, 239, 0.5); background: rgba(18, 28, 41, 0.95); color: #e8f3ff; line-height: 1; cursor: pointer; }
.gastown-minimap-mode { min-width: 5.6rem; padding: 0 0.55rem; }
.gastown-minimap-mode[data-minimap-mode="north-up"] { border-color: rgba(137, 189, 245, 0.7); box-shadow: inset 0 0 0 1px rgba(137, 189, 245, 0.18); }
.gastown-minimap-mode[data-minimap-mode="heading-up"] { border-color: rgba(255, 197, 126, 0.78); color: #fff3de; box-shadow: inset 0 0 0 1px rgba(255, 197, 126, 0.18); }
.gastown-minimap-zoom { width: 1.7rem; padding: 0; font-size: 1rem; }
.gastown-minimap-mode:hover, .gastown-minimap-mode:focus-visible, .gastown-minimap-zoom:hover, .gastown-minimap-zoom:focus-visible { background: rgba(36, 53, 74, 0.95); outline: none; }
.gastown-minimap-context strong, .gastown-minimap-mode-status strong { color: #f5fbff; }
.gastown-minimap-mode-status { margin: 0; color: #ecf5ff; }
.gastown-minimap-context { margin: 0.22rem 0 0.14rem; color: rgba(220, 236, 255, 0.92); }
.gastown-minimap-tooltip { margin: 0.2rem 0 0; color: #ffdca7; font-size: 0.76rem; }
.gastown-minimap-compass { margin-top: 0.22rem; font-size: 0.76rem; color: #cfe4fb; }
.gastown-minimap-legend { list-style: none; margin: 0.08rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.18rem 0.5rem; font-size: 0.68rem; color: rgba(220, 236, 255, 0.9); }
.gastown-minimap-legend li { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.gastown-minimap-legend .dot { width: 0.48rem; height: 0.48rem; border-radius: 999px; display: inline-block; border: 1px solid rgba(235, 245, 255, 0.58); }
.gastown-minimap-legend .dot.player { background: radial-gradient(circle at 35% 35%, #ffffff 0, #b7ecff 58%, #3f8fca 100%); }
.gastown-minimap-legend .dot.route { background: #ffd28f; }
.gastown-minimap-legend .dot.sidewalk { background: #6c7f95; }
.gastown-minimap-legend .dot.street { background: #203344; }
.gastown-minimap-legend .dot.station { background: #84b4d7; }
.gastown-minimap-legend .dot.steam { background: #d8a968; }
.gastown-minimap-legend .dot.nearest { background: #8af7cb; }

.gastown-meta-strip,
.gastown-hud-support {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  padding: 0 0.75rem 0.75rem;
}

.gastown-hud-support {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 0;
}

.gastown-expedition-list {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.2rem;
  color: #d9e8ff;
  font-size: 0.86rem;
}

.gastown-hud-next-step {
  color: #fff1c7;
}

.gastown-attribution {
  margin-top: 0.1rem;
  color: rgba(209, 223, 242, 0.86);
}

.gastown-dialog-modal,
.gastown-name-overlay,
.gastown-tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(3, 6, 12, 0.82);
  backdrop-filter: blur(4px);
}

.gastown-dialog-panel {
  width: min(100%, 640px);
  max-height: min(78vh, 720px);
  overflow: auto;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid rgba(160, 194, 232, 0.32);
  background: linear-gradient(180deg, rgba(18, 25, 39, 0.96), rgba(9, 12, 19, 0.98));
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.55);
}

.gastown-name-panel { width: min(100%, 420px); }
.gastown-name-field { display: grid; gap: 0.35rem; }
.gastown-name-field span { font-size: 0.82rem; color: #b9d6f7; }
.gastown-dialog-header, .gastown-dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.gastown-dialog-header h2 { margin: 0; font-size: 1.2rem; }
.gastown-dialog-body { margin-top: 0.85rem; color: #e7eef8; line-height: 1.5; }
.gastown-dialog-body p { margin: 0 0 0.7rem; }
.gastown-dialog-actions { margin-top: 1rem; justify-content: flex-end; flex-wrap: wrap; }
.gastown-dialog-actions-dynamic { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.gastown-dialog-audio-status { margin-right: auto; font-size: 0.78rem; color: #c3d9f4; }
.gastown-dialog-actions .pixel-button { text-decoration: none; }
.gastown-dialog-actions .pixel-button:focus-visible, .gastown-sim-canvas:focus-visible { outline: 2px solid rgba(155, 212, 255, 0.92); outline-offset: 2px; }

.gastown-debug {
  border-top: 1px dashed rgba(162, 180, 201, 0.28);
  padding-top: 0.8rem;
}

@media (max-width: 980px) {
  .gastown-hud,
  .gastown-meta-strip,
  .gastown-hud-support {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 740px) {
  .gastown-minimap { width: 180px; }
  .gastown-sim-page { padding-inline: 0.45rem; }
  .gastown-sim-shell { padding: 0.7rem; }
  .gastown-sim-canvas { min-height: 460px; }
  .gastown-live-strip { max-width: 46vw; }
  .gastown-fullscreen-toggle { right: calc(0.8rem + 46vw + 0.55rem); }
}


.gastown-log-drawer .gastown-hud-support {
  display: none;
}

.gastown-meta-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0 0.75rem 0.75rem;
}

@media (max-width: 860px) {
  .gastown-hud {
    grid-template-columns: 1fr;
  }

  .gastown-hud-route {
    justify-items: start;
  }

  .gastown-meta-strip {
    grid-template-columns: 1fr;
  }

  .gastown-live-strip {
    max-width: min(180px, 46vw);
  }

  .gastown-fullscreen-toggle {
    right: calc(0.8rem + min(180px, 46vw) + 0.55rem);
  }
}

.gastown-log-drawer[open] { opacity: 0.98; }
.gastown-hud-kicker { display: none; }
.gastown-meta-strip { display: grid; gap: 0.45rem; }


.gastown-hud { max-width: 19rem; padding: 0.55rem 0.7rem; gap: 0.18rem; }
.gastown-hud-name { font-size: 0.92rem; margin: 0; }
.gastown-hud-route { display: none; }
.gastown-hud-subline { font-size: 0.78rem; margin: 0; }
.gastown-interact-prompt { font-size: 0.72rem; padding: 0.26rem 0.46rem; }
.gastown-live-strip { max-width: 14rem; padding: 0.38rem 0.5rem; }
.gastown-landmark { font-size: 0.76rem; margin: 0; }
.gastown-route-segment, .gastown-minimap-mode-status, .gastown-minimap-context, .gastown-minimap-compass, .gastown-minimap-legend, .gastown-hud-next-step, [data-sim-objective] { display: none !important; }
.gastown-minimap { width: 158px; padding: 0.35rem; }
.gastown-minimap-label, .gastown-minimap-tooltip { font-size: 0.68rem; margin: 0.18rem 0 0; }
