:root {
  color-scheme: dark;
  --ink: #111a25;
  --panel: #182532;
  --edge: #64727a;
  --soft: #aabac4;
  --paper: #f4ead6;
  --gold: #e6bb76;
  --cyan: #a5e2dc;
  --line: #b6c0c634;
  --serif: 'Songti SC', 'Noto Serif CJK SC', 'STSong', Georgia, serif;
  --sans: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --mono: 'SFMono-Regular', Consolas, monospace;
  font-family: var(--sans);
  background: #131d2b;
  color: var(--paper);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  min-width: 290px;
}
body {
  min-height: 100dvh;
  background: transparent;
}
button,
input {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid #b2eee5;
  outline-offset: 3px;
}
button {
  border: 0;
}
button[hidden],
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button,
input,
a {
  -webkit-tap-highlight-color: transparent;
}
.station-bg {
  position: fixed;
  z-index: -2;
  inset: 0;
  background: #18283b url('/assets/station.webp') center 45% / cover no-repeat;
}
@media (min-width: 1700px), (min-width: 900px) and (min-resolution: 1.75dppx) {
  .station-bg {
    background-image: url('/assets/station-hd.webp');
  }
}
.station-bg:after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #101b2af0 0%, #152130b8 31%, #16233933 64%, #101a3045),
    linear-gradient(0deg, #0b1424de, transparent 40%, #0f172d35);
}
.app-shell {
  width: min(100%, 1730px);
  margin: 0 auto;
  padding: 0 clamp(14px, 3.1vw, 52px) 24px;
}
.app-head {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #c0beb74d;
  position: relative;
}
.app-head:after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--gold);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  background: none;
  padding: 4px 0;
  font: 700 clamp(17px, 1.5vw, 23px)/1 var(--serif);
  letter-spacing: 0.12em;
  text-shadow: 0 1px 4px #111826;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1.5px solid var(--gold);
  transform: rotate(45deg);
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 3px #27343e,
    0 0 12px #e6bb7637;
  background: #2e3740;
}
.brand-mark b {
  display: block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--gold);
  border-left: 0;
  border-top: 0;
  position: relative;
}
.brand-mark b:after {
  content: '';
  display: block;
  position: absolute;
  inset: 2px 3px 2px 1px;
  border: 1px solid var(--gold);
}
.utilities,
.head-actions,
.sub-actions,
.dialog-actions,
.waiting-controls > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.utility,
.small,
.quiet,
.text-btn,
.secondary,
.primary,
.room-tool,
.resume {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 5px;
  font-weight: 620;
  white-space: nowrap;
}
.utility,
.small,
.quiet {
  padding: 6px 10px;
  color: #e1e7e4;
  background: #172333db;
  border: 1px solid #aebba34e;
  font-size: 13px;
  min-height: 32px;
}
.utility:hover,
.small:hover,
.quiet:hover,
.equipment:not(:disabled):hover,
.mode:hover {
  border-color: var(--gold);
  background-color: #364454;
}
.utility i {
  display: block;
  font:
    600 19px/1 Georgia,
    serif;
  color: var(--gold);
}
.utility[aria-pressed='false'] i {
  color: #8b969c;
}
.utility .i-book {
  width: 14px;
  height: 11px;
  border: 1px solid currentColor;
  border-radius: 2px 2px 1px 1px;
  background: linear-gradient(90deg, transparent 45%, currentColor 46% 52%, transparent 53%);
}
.utility .i-person {
  width: 13px;
  height: 14px;
  position: relative;
  background: radial-gradient(circle at 50% 27%, currentColor 2.5px, transparent 3px);
}
.i-person:after {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 1px;
  width: 11px;
  height: 6px;
  border-radius: 6px 6px 1px 1px;
  border: 1px solid currentColor;
}
.profile {
  max-width: 135px;
}
.profile span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.loading {
  padding: 65px;
  text-align: center;
}
.lit,
.map-light {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #98e2cd;
  border-radius: 50%;
  box-shadow: 0 0 7px #6bdfbe92;
  flex: 0 0 auto;
}
.service-line {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #d5d3bd;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.13em;
}
.small:disabled,
.quiet:disabled,
.primary:disabled,
.mode:disabled,
.equipment:disabled {
  opacity: 0.46;
}
.primary,
.secondary,
.quiet {
  min-height: 38px;
  padding: 8px 14px;
}
.primary {
  color: #30291e;
  font-weight: 750;
  background: linear-gradient(#f3d99f, #d8ad69);
  border: 1px solid #f9e7bf;
  box-shadow: inset 0 0 0 2px #a8854e55;
}
.primary:not(:disabled):hover,
.departure:not(:disabled):hover {
  filter: brightness(1.08);
}
.secondary {
  background: #203140df;
  color: var(--paper);
  border: 1px solid #a6b8b276;
  box-shadow: inset 0 0 0 2px #1a2638a5;
}
.secondary:hover {
  border-color: #e9c891;
}
.text-btn,
.resume {
  background: none;
  color: var(--cyan);
  font-size: 13px;
  padding: 8px 4px;
}
.text-btn:hover,
.resume:hover {
  color: var(--paper);
}
.resume {
  margin-top: 8px;
}
.lobby-view {
  max-width: 1460px;
  margin: auto;
}
.lobby-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  min-height: clamp(396px, 59vh, 685px);
  padding: clamp(46px, 7vh, 100px) 4% clamp(35px, 5vh, 65px);
  gap: 28px;
  position: relative;
}
.hero-text {
  align-self: center;
}
.hero-text h1 {
  font: 700 clamp(62px, 7.5vw, 126px)/1.13 var(--serif);
  letter-spacing: 0.065em;
  margin: 14px 0 10px;
  color: #fff3d7;
  text-shadow: 0 4px 20px #0d1e31;
}
.hero-text h1 span {
  color: #efd099;
}
.hero-text p {
  font-size: clamp(14px, 1.1vw, 18px);
  line-height: 1.8;
  color: #e0e3dc;
  text-shadow: 0 2px 8px #0c1c2e;
}
.entry-actions {
  width: clamp(220px, 22vw, 315px);
  margin-top: 24px;
}
.departure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  width: 100%;
  min-height: 62px;
  padding: 7px 20px;
  color: #30291e;
  font: 750 22px/1.2 var(--serif);
  letter-spacing: 0.08em;
  border: 1px solid #f9e8ba;
  border-radius: 5px;
  background: linear-gradient(100deg, #f5dfaa, #d8b273);
  box-shadow:
    inset 0 0 0 3px #c0995f,
    0 5px 17px #08132385;
}
.departure small {
  display: block;
  margin-top: 4px;
  font: 650 11px/1.2 var(--sans);
  letter-spacing: 0.045em;
}
.depart-arrow {
  font: 24px/1 system-ui;
}
.sub-actions {
  margin-top: 8px;
}
.sub-actions button {
  flex: 1;
}
.hero-crew {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 14px;
  background: linear-gradient(110deg, #0c1b2ae8, #243646cf);
  border: 1px solid #d7c19770;
  border-radius: 6px;
  box-shadow: 0 5px 24px #0b162494;
}
.portrait-strip {
  display: flex;
  padding-left: 4px;
}
.portrait-strip span,
.portrait-round {
  display: block;
  position: relative;
  width: 42px;
  height: 48px;
  overflow: hidden;
  background: #ebddc4;
  border: 1px solid #c6ab78;
  border-radius: 4px;
}
.portrait-strip span {
  margin-left: -4px;
  transform: rotate(-3deg);
}
.portrait-strip img,
.portrait-round img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: center 24%;
}
.hero-crew b,
.hero-crew small {
  display: block;
  white-space: nowrap;
}
.hero-crew b {
  font: 650 16px var(--serif);
}
.hero-crew small {
  color: #b5c8c9;
  font-size: 11px;
  margin-top: 4px;
}
.departures,
.panel,
.dashboard,
.dispatch-box,
.operation-panel,
.map-panel {
  background: linear-gradient(135deg, #1c2b3af5, #172132f7);
  border: 1px solid #9aa7a85e;
  border-radius: 7px;
  box-shadow: 0 8px 28px #08132255;
}
.departures {
  max-width: 95%;
  margin: 0 auto;
  padding: 15px 23px;
}
.section-head,
.room-heading,
.waiting-controls,
.game-head,
.map-heading,
.map-caption,
.instrument-title,
.proposal-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.section-head h2,
.dispatch-box h2,
.instrument-title h2 {
  font: 700 17px/1.3 var(--serif);
  letter-spacing: 0.08em;
}
.platform-empty,
.train-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 4px;
  border-top: 1px solid var(--line);
}
.platform-empty b,
.platform-empty small,
.train-row b,
.train-row small {
  display: block;
}
.platform-empty small,
.train-row small {
  margin-top: 3px;
  color: var(--soft);
  font-size: 12px;
}
.rail-symbol {
  font: 26px Georgia;
  color: var(--gold);
}
.train-row {
  width: 100%;
  text-align: left;
  color: #f0e3cb;
  background: none;
}
.train-row em {
  margin-left: auto;
  font-size: 12px;
  font-style: normal;
  color: var(--cyan);
}
.train-row:not(:disabled):hover {
  background: #80c7cc12;
}
.panel {
  margin: min(8vh, 64px) auto 0;
  max-width: 1050px;
  padding: clamp(20px, 3vw, 40px);
}
.room-heading h1 {
  font: 700 clamp(28px, 3.3vw, 46px)/1.3 var(--serif);
  margin: 6px 0;
}
.room-heading p,
.waiting-controls p,
.restore p {
  color: var(--soft);
  line-height: 1.6;
  font-size: 14px;
}
.room-heading p b {
  color: var(--cyan);
  font-family: var(--mono);
  letter-spacing: 0.12em;
}
.crew-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}
.crew-card {
  position: relative;
  aspect-ratio: 0.86;
  overflow: hidden;
  border: 1px solid #d0bd8e87;
  border-radius: 6px;
  background: #273341;
}
.crew-card > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 24%;
}
.crew-name {
  position: absolute;
  inset: auto 0 0;
  padding: 25% 8px 7px;
  background: linear-gradient(transparent, #141e2eea 65%);
}
.crew-name > * {
  display: block;
}
.crew-name b {
  font-size: 15px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.crew-name small {
  color: #f1dfb1;
  font-size: 10px;
}
.crew-state,
.seat-tag {
  font-style: normal;
  font-size: 10px;
  color: #bce4d8;
}
.seat-tag {
  position: absolute;
  left: 5px;
  top: 5px;
  border: 1px solid #c7bc9860;
  color: #f2e0b8;
  background: #152333e8;
  padding: 2px 5px;
  border-radius: 3px;
}
.crew-card.empty {
  border-style: dashed;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  color: #b7c4c3;
}
.crew-card.empty i {
  font-size: 25px;
  color: #c6a879;
  font-style: normal;
}
.crew-card.empty small {
  font-size: 11px;
}
.waiting-controls {
  border-top: 1px solid var(--line);
  padding-top: 15px;
}
.connection-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0;
  padding: 7px 10px;
  background: #704533eb;
  border: 1px solid #d0a47e;
  border-radius: 4px;
  color: #fff3de;
  font-size: 13px;
}
.connection-warning button {
  background: #362e2d;
  color: #fff2de;
  border: 1px solid #c8a584;
  border-radius: 4px;
  padding: 3px 8px;
}
.restore {
  max-width: 500px;
}
.restore > p {
  margin: 12px 0;
}
.game-view {
  max-width: 1440px;
  margin: auto;
}
.game-head {
  padding: 14px 2px 12px;
}
.game-head h1 {
  font: 700 clamp(21px, 2.2vw, 32px)/1.15 var(--serif);
  letter-spacing: 0.08em;
}
.game-head small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: #c9d5d7;
}
.net-status {
  font-size: 11px;
  color: #b3d9c7;
}
.net-status:before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  vertical-align: 2px;
  margin-right: 5px;
  background: #92d4b1;
  border-radius: 50%;
}
.net-status.down {
  color: #f1c780;
}
.dispatch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 27%);
  gap: 14px;
  align-items: start;
}
.map-column,
.dispatch-sidebar {
  min-width: 0;
}
.dispatch-sidebar {
  display: grid;
  gap: 10px;
}
.map-panel {
  position: relative;
  overflow: hidden;
  border-color: #ac9e784f;
  box-shadow:
    0 12px 26px #08132270,
    inset 0 0 0 3px #d3bd8a10;
}
.map-heading {
  padding: 9px 13px;
  border-bottom: 1px solid #a194744d;
  background: linear-gradient(90deg, #263849, #283647);
}
.map-heading > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}
.map-heading strong {
  font: 650 16px var(--serif);
  letter-spacing: 0.08em;
}
.map-light {
  width: 6px;
  height: 6px;
}
.map-zoom {
  display: flex;
  align-items: center;
  gap: 4px;
}
.map-zoom .small {
  min-height: 27px;
  padding: 1px 8px;
  font: 650 16px system-ui;
}
.map-zoom .small:last-child {
  color: var(--gold);
  margin-left: 4px;
}
.map-zoom span {
  font: 11px var(--mono);
  min-width: 32px;
  text-align: center;
  color: var(--soft);
}
#map-viewport {
  height: clamp(245px, calc(100dvh - 362px), 730px);
  width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #566976 #17212c;
  display: flex;
  align-items: safe center;
  justify-content: safe center;
  background-color: #162330;
  background-image:
    linear-gradient(#82b1ba09 1px, transparent 1px), linear-gradient(90deg, #82b1ba09 1px, transparent 1px),
    radial-gradient(ellipse at 50% 38%, #283d49, #152230 85%);
  background-size:
    18px 18px,
    18px 18px,
    cover;
}
.map-sheet {
  --tile: 34px;
  --cols: 16;
  --rows: 12;
  display: grid;
  flex: none;
  width: max-content;
  height: max-content;
  grid-template-columns: 18px auto;
  grid-template-rows: 18px auto;
  padding: 4px 8px 8px 1px;
}
.axis-corner {
  grid-column: 1;
  grid-row: 1;
}
#axis-top,
#axis-left {
  display: grid;
  text-align: center;
  color: #b7bca8;
  font: 10px/1 var(--mono);
}
#axis-top {
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: repeat(var(--cols), var(--tile));
  align-items: center;
}
#axis-left {
  grid-column: 1;
  grid-row: 2;
  grid-template-rows: repeat(var(--rows), var(--tile));
  align-items: center;
}
#axis-top i,
#axis-left i {
  font-style: normal;
}
#mine-board {
  display: grid;
  grid-column: 2;
  grid-row: 2;
  grid-template-columns: repeat(var(--cols), var(--tile));
  grid-template-rows: repeat(var(--rows), var(--tile));
  width: max-content;
  box-shadow:
    0 0 0 2px #0e1822,
    0 0 0 3px #93896f81;
  isolation: isolate;
  user-select: none;
}
.tile {
  border-radius: 0;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  padding: 0;
  margin: 0;
  aspect-ratio: 1;
  cursor: crosshair;
  touch-action: manipulation;
  border: 1px solid #12212c;
  min-width: 0;
  min-height: 0;
  font-family: var(--mono);
  line-height: 1;
  color: var(--paper);
  isolation: isolate;
}
.tile.covered {
  background-color: #3a4d58;
  background-image: linear-gradient(140deg, #4d6066b8, #3e515a68 45%, #263947ac);
  box-shadow:
    inset 1px 1px #8a999666,
    inset -2px -2px #1d303b,
    inset 0 0 0 3px #485961;
}
.tile.covered:before {
  content: '';
  position: absolute;
  inset: 20%;
  pointer-events: none;
  background: linear-gradient(130deg, transparent 45%, #a4c2bf12 46% 49%, transparent 50%);
  z-index: -1;
}
.tile.explored {
  background: #1b303a;
  box-shadow: inset 0 0 0 1px #667c832b;
}
.tile:hover {
  outline: 1px solid #ebc787;
  outline-offset: -2px;
  z-index: 2;
}
.tile:focus-visible {
  outline: 2px solid #f6d18a;
  outline-offset: -3px;
  z-index: 3;
}
.tile.start,
.tile.exit,
.tile.station,
.tile.supply {
  background-color: #3b4744;
}
.tile.explored.station,
.tile.explored.supply {
  background: #35483c;
}
.tile.exit {
  box-shadow: inset 0 0 0 2px #d3ae68;
}
.tile.flagged .flag-icon,
.flag-icon {
  color: #fcbd80;
}
.tile.hazardous {
  background: #653d3c;
}
.tile.spent .feature-icon {
  opacity: 0.55;
}
.tile-number,
.tile-icon,
.minecart {
  grid-area: 1/1;
  position: relative;
  z-index: 1;
  pointer-events: none;
}
.tile-number {
  font-size: calc(var(--tile) * 0.54);
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 2px #0a1822;
}
.tile-number.sub {
  position: absolute;
  right: 0;
  top: 0;
  min-width: 9px;
  padding: 1px;
  background: #172730e8;
  border-radius: 0 0 0 2px;
  font-size: max(8px, calc(var(--tile) * 0.26));
  z-index: 4;
}
.n1 {
  color: #9de0f5;
}
.n2 {
  color: #a5dfab;
}
.n3 {
  color: #ffc090;
}
.n4 {
  color: #b9b4fd;
}
.n5,
.n7 {
  color: #f39891;
}
.n6,
.n8 {
  color: #8be0d1;
}
.tile-icon {
  font: 750 calc(var(--tile) * 0.58)/1 var(--sans);
}
.feature-icon,
.bridge-icon {
  color: #ffdb91;
  text-shadow: 0 1px 3px #17232c;
}
.mark-icon,
.attention {
  color: #a7eee7;
}
.danger {
  color: #ffb79e;
}
.minecart {
  width: 99%;
  height: 99%;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px #091725);
}
.train-here {
  background: #536150 !important;
  box-shadow: inset 0 0 0 2px #e3be73 !important;
}
.track {
  position: absolute;
  z-index: 0;
  width: 51%;
  height: 29%;
  top: 35.5%;
  left: 50%;
  background: linear-gradient(to bottom, #c2a979 0 17%, transparent 18% 81%, #c2a979 82%);
  opacity: 0.48;
}
.track.west {
  left: 0;
}
.track.north,
.track.south {
  width: 29%;
  height: 51%;
  left: 35.5%;
  top: 0;
  background: linear-gradient(to right, #c2a979 0 17%, transparent 18% 81%, #c2a979 82%);
}
.track.south {
  top: 50%;
}
.tile.draft,
.tile.proposed {
  background-color: #4c6b67;
  box-shadow: inset 0 0 0 2px #8fe3d6;
}
.tile.proposed {
  background-color: #716340;
  box-shadow: inset 0 0 0 2px #f1c57c;
}
.sequence,
.attention,
.scan-badge {
  position: absolute;
  font: 750 max(8px, calc(var(--tile) * 0.25))/1 var(--mono);
  font-style: normal;
  z-index: 5;
  pointer-events: none;
}
.sequence {
  background: #a9e5d7;
  color: #233b39;
  left: 1px;
  top: 1px;
  padding: 2px;
  border-radius: 2px;
}
.proposed .sequence {
  background: #f3cc8c;
}
.attention {
  left: 2px;
  bottom: 2px;
}
.scan-badge {
  bottom: 1px;
  right: 1px;
  background: #1b352d;
  color: #b5f2e2;
  padding: 1px;
}
.map-caption {
  padding: 5px 12px;
  min-height: 29px;
  border-top: 1px solid #90978a55;
  background: #1c2a34;
  font-size: 11px;
  color: #b5c7c7;
}
.map-caption > * {
  min-width: 0;
}
.map-caption > span:last-child {
  white-space: nowrap;
  color: #cfbc94;
}
.operation-panel {
  padding: 10px;
  margin-top: 9px;
}
.mode-tools {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}
.mode {
  background: #233442;
  color: #c3cdd0;
  min-height: 39px;
  border: 1px solid #7a898b5e;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 4px;
  font: 650 13px var(--sans);
}
.mode i {
  font: 700 16px var(--mono);
  font-style: normal;
  color: #c1d0be;
}
.mode[aria-pressed='true'],
.equipment[aria-pressed='true'] {
  color: #ffecc8;
  background: linear-gradient(#574c38, #423b31);
  border-color: #d7b276;
  box-shadow: inset 0 0 0 1px #d9b16f55;
}
.mode[aria-pressed='true'] i {
  color: #ffe0a3;
}
#instruction {
  color: #c6d0ce;
  font-size: 12px;
  line-height: 1.45;
  padding: 7px 2px 0;
  min-height: 16px;
}
.proposal-controls {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #ac987b59;
  border-radius: 4px;
  background: #1a2731;
}
.proposal-controls > span {
  margin-right: auto;
  color: #d9caa8;
  font-size: 12px;
}
.proposal-controls button {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 12px;
}
.dashboard,
.dispatch-box {
  padding: 13px 15px;
}
.instrument-title {
  justify-content: flex-start;
}
.instrument-title h2,
.dispatch-box h2,
.crew-details summary {
  font-size: 15px;
}
.route-meter {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  text-align: center;
  align-items: center;
  gap: 0 7px;
  margin: 13px 0 14px;
  padding: 7px 9px;
  background: #122127;
  border: 1px solid #8c9c8e60;
  border-radius: 4px;
}
.route-meter strong {
  font: 700 23px var(--mono);
  color: var(--cyan);
}
.route-meter strong:last-of-type {
  color: var(--gold);
}
.route-meter span {
  color: #848e86;
}
.route-meter small {
  font-size: 10px;
  color: #b2bfbd;
}
.meter {
  margin: 7px 0;
}
.meter > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #c4d1ce;
}
.meter b {
  font: 700 14px var(--mono);
  color: #e8e5ce;
}
.meter small {
  font-weight: 400;
  color: #a5b2b4;
}
.bar {
  height: 5px;
  margin-top: 4px;
  border-radius: 4px;
  background: #111b22;
  overflow: hidden;
}
.bar i {
  height: 100%;
  display: block;
  background: linear-gradient(90deg, #559c97, #a8daca);
  border-radius: 4px;
}
.hull .bar i {
  background: linear-gradient(90deg, #be9155, #edcf94);
}
#inventory {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 9px;
}
.equipment {
  padding: 5px 2px;
  min-width: 0;
  border-radius: 4px;
  border: 1px solid #80918170;
  background: #223541;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  align-items: center;
  gap: 2px 4px;
  color: #e1e5d7;
}
.equipment i {
  grid-column: 1/-1;
  font: 700 20px var(--mono);
  color: var(--gold);
}
.equipment b,
.equipment span {
  font-size: 10px;
}
.equipment span {
  color: #afbfba;
}
.equipment:disabled {
  opacity: 0.46;
}
.pending-supply {
  grid-column: 1/-1;
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.pending-supply b {
  font-size: 12px;
  color: var(--gold);
}
.crew-details summary {
  font: 700 15px var(--serif);
  cursor: pointer;
}
.mini-crew {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 9px;
}
.mini-person {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.mini-person > div:last-child {
  min-width: 0;
}
.mini-person b,
.mini-person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}
.mini-person small {
  color: #b8c8c1;
}
.portrait-round {
  width: 27px;
  height: 30px;
  flex: none;
}
.log-box ol {
  padding: 0;
  margin: 8px 0 0;
  list-style: none;
}
.log-box li {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: #c1cfcd;
  font-size: 12px;
  line-height: 1.6;
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.log-box li i {
  width: 4px;
  height: 4px;
  flex: none;
  background: #a3afa6;
  transform: rotate(45deg);
}
.log-box li:first-child {
  color: #f1d49c;
}
.finish-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #38463c;
  border: 1px solid #b9a476;
  padding: 11px;
  border-radius: 4px;
}
.finish-banner i {
  color: var(--gold);
  font-size: 26px;
}
.finish-banner strong,
.finish-banner span {
  display: block;
}
.finish-banner strong {
  font: 700 19px var(--serif);
}
.finish-banner span {
  color: #cad7ca;
  font-size: 12px;
}
.finish-banner button {
  margin-left: auto;
}
#modal {
  color: var(--paper);
  width: min(440px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: auto;
  border: 1px solid #c0ab7e;
  border-radius: 8px;
  background: linear-gradient(140deg, #2a3a48, #182435 78%);
  box-shadow: 0 22px 70px #051222aa;
}
#modal::backdrop {
  background: #091421a9;
  backdrop-filter: blur(3px);
}
.dialog-sheet {
  padding: 20px;
}
.dialog-sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
  margin-bottom: 15px;
}
.dialog-sheet h2 {
  font: 700 24px var(--serif);
}
.close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #acb8aa60;
  border-radius: 50%;
  background: #243341;
  color: #e4d2a4;
  font: 600 20px/1 var(--sans);
}
.field {
  display: block;
  margin-top: 12px;
}
.field > span {
  font-size: 12px;
  color: #c9d3ca;
}
.field input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  color: #f3efdf;
  background: #111f2e;
  border: 1px solid #899d9670;
  border-radius: 4px;
}
.check {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 13px;
  color: #d4ded7;
  margin: 12px 0;
}
.check input {
  accent-color: #cdb278;
}
.dialog-actions {
  margin-top: 15px;
  justify-content: flex-end;
}
.dialog-sheet p {
  line-height: 1.65;
  color: #d0d8cf;
  font-size: 14px;
}
.dialog-sheet .form-error {
  color: #ffc7a1;
  font-size: 12px;
}
.rule-book h3 {
  font: 650 16px var(--serif);
  color: var(--gold);
  margin: 14px 0 4px;
}
.ticket-code {
  background: #172b35;
  padding: 10px 15px;
  border: 1px dashed #b8ac81;
  border-radius: 3px;
}
.ticket-code small,
.ticket-code b {
  display: block;
}
.ticket-code b {
  font: 700 26px/1.5 var(--mono);
  letter-spacing: 0.1em;
  color: var(--gold);
}
#toast {
  position: fixed;
  z-index: 10;
  inset: auto 12px max(18px, env(safe-area-inset-bottom));
  margin: auto;
  width: max-content;
  max-width: calc(100vw - 24px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.16s,
    transform 0.16s;
  background: #132334ed;
  color: #ffedc6;
  border: 1px solid #d0ba8c9c;
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 13px;
  text-align: center;
  box-shadow: 0 7px 20px #09121e88;
}
#toast.show {
  opacity: 1;
  transform: none;
}
@media (min-width: 1600px) {
  .game-view {
    max-width: 1510px;
  }
  .app-head {
    height: 78px;
  }
  .game-head {
    padding: 18px 0;
  }
  .dispatch-sidebar {
    gap: 13px;
  }
  .dashboard,
  .dispatch-box {
    padding: 16px 19px;
  }
  .log-box li {
    font-size: 14px;
  }
}
@media (max-width: 840px) {
  .app-shell {
    padding: 0 13px 18px;
  }
  .app-head {
    height: 55px;
  }
  .dispatch-grid {
    grid-template-columns: minmax(0, 1fr) minmax(178px, 26%);
    gap: 8px;
  }
  .dashboard,
  .dispatch-box {
    padding: 10px;
  }
  .mode {
    gap: 3px;
    font-size: 12px;
  }
  .game-head {
    padding: 9px 0;
  }
  .lobby-hero {
    padding-left: 3%;
    padding-right: 3%;
  }
  .crew-slots {
    gap: 6px;
  }
}
@media (max-width: 650px) and (orientation: portrait) {
  .app-shell {
    padding: 0 max(8px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }
  .app-head {
    height: 49px;
  }
  .brand {
    font-size: 17px;
    gap: 8px;
  }
  .brand-mark {
    width: 19px;
    height: 19px;
  }
  .utilities {
    gap: 4px;
  }
  .utility {
    padding: 4px 7px;
    min-height: 30px;
  }
  .utility:not(.profile) > span {
    display: none;
  }
  .utility.profile {
    max-width: 80px;
  }
  .hero-text h1 {
    font-size: clamp(50px, 14vw, 78px);
  }
  .lobby-hero {
    display: grid;
    align-content: center;
    min-height: clamp(440px, 65dvh, 630px);
    gap: 18px;
    padding: 26px 6% 20px;
  }
  .hero-text {
    align-self: auto;
  }
  .entry-actions {
    width: min(248px, 100%);
    margin-top: 16px;
  }
  .hero-crew {
    width: max-content;
    max-width: 100%;
    padding: 6px 9px;
    gap: 8px;
  }
  .portrait-strip span {
    width: 27px;
    height: 31px;
  }
  .hero-crew b {
    font-size: 13px;
  }
  .hero-crew small {
    font-size: 10px;
  }
  .departures {
    max-width: 100%;
    padding: 9px 12px;
  }
  .station-bg {
    background-position: 61% center;
  }
  .station-bg:after {
    background:
      linear-gradient(90deg, #111d2add, #18243760 90%), linear-gradient(0deg, #101b2de0, transparent 70%);
  }
  .room-heading h1 {
    font-size: 25px;
  }
  .crew-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 12px 0;
  }
  .crew-card {
    aspect-ratio: 1.24;
  }
  .waiting-controls {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .panel {
    margin: 16px auto 0;
    padding: 14px;
  }
  .game-head {
    align-items: center;
    padding: 7px 0;
  }
  .game-head h1 {
    font-size: 19px;
  }
  .game-head small,
  .net-status {
    font-size: 10px;
  }
  .head-actions {
    gap: 4px;
  }
  .head-actions .small {
    min-height: 27px;
    padding: 3px 6px;
    font-size: 11px;
  }
  .dispatch-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .map-column,
  .dispatch-sidebar {
    width: 100%;
  }
  .map-heading {
    padding: 5px 8px;
  }
  .map-heading strong {
    font-size: 14px;
  }
  .map-zoom .small {
    min-height: 26px;
  }
  .map-caption {
    padding: 3px 7px;
    font-size: 10px;
    min-height: 24px;
  }
  #map-viewport {
    height: clamp(256px, 52dvh, 485px);
  }
  .operation-panel {
    padding: 6px;
    margin-top: 5px;
  }
  .mode-tools {
    gap: 3px;
  }
  .mode {
    flex-direction: column;
    gap: 0;
    font-size: 10px;
    min-height: 36px;
    padding: 2px;
  }
  .mode i {
    font-size: 15px;
  }
  #instruction {
    font-size: 11px;
    padding: 5px 0 0;
  }
  .dispatch-sidebar {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }
  .dashboard,
  .dispatch-box {
    padding: 8px;
  }
  .instrument-title h2,
  .dispatch-box h2,
  .crew-details summary {
    font-size: 13px;
  }
  .route-meter {
    margin: 5px 0;
    padding: 2px;
    gap: 0 3px;
  }
  .route-meter strong {
    font-size: 15px;
  }
  .route-meter small {
    font-size: 8px;
  }
  .meter {
    margin: 3px 0;
  }
  .meter > div:first-child,
  .meter b {
    font-size: 10px;
  }
  .bar {
    height: 3px;
    margin-top: 2px;
  }
  .log-box {
    grid-column: 1/-1;
  }
  .crew-details {
    grid-column: 1/-1;
  }
  .equipment i {
    font-size: 15px;
  }
  .equipment b,
  .equipment span {
    font-size: 9px;
  }
  .equipment {
    padding: 3px 1px;
  }
  .dispatch-box #inventory {
    margin-top: 6px;
    gap: 2px;
  }
  .dialog-sheet {
    padding: 14px;
  }
}
@media (max-height: 510px) and (orientation: landscape) {
  .app-shell {
    padding: 0 max(8px, env(safe-area-inset-right)) 6px max(8px, env(safe-area-inset-left));
  }
  .app-head {
    height: 33px;
  }
  .brand {
    font-size: 15px;
  }
  .brand-mark {
    width: 16px;
    height: 16px;
  }
  .brand-mark b {
    width: 8px;
    height: 8px;
  }
  .utility {
    min-height: 24px;
    font-size: 10px;
    padding: 1px 6px;
  }
  .utility i {
    font-size: 15px;
  }
  .lobby-hero {
    min-height: 245px;
    padding: 12px 4%;
  }
  .hero-text h1 {
    font-size: 43px;
    margin: 4px 0;
  }
  .hero-text p {
    font-size: 12px;
    line-height: 1.4;
  }
  .service-line {
    font-size: 10px;
  }
  .entry-actions {
    margin-top: 7px;
    width: 210px;
  }
  .departure {
    min-height: 40px;
    font-size: 16px;
  }
  .departure small {
    font-size: 9px;
  }
  .sub-actions {
    margin-top: 4px;
  }
  .sub-actions button {
    min-height: 27px;
    padding: 4px;
  }
  .departures {
    padding: 5px 12px;
  }
  .section-head h2 {
    font-size: 14px;
  }
  .game-head {
    padding: 3px 0;
  }
  .game-head h1 {
    font-size: 16px;
  }
  .game-head small {
    font-size: 9px;
  }
  .head-actions .small {
    min-height: 23px;
  }
  .dispatch-grid {
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) minmax(155px, 25%);
  }
  .map-heading {
    padding: 3px 6px;
  }
  .map-heading strong,
  .instrument-title h2,
  .dispatch-box h2 {
    font-size: 12px;
  }
  .map-zoom .small {
    min-height: 20px;
    font-size: 12px;
  }
  .map-caption {
    min-height: 17px;
    padding: 1px 5px;
    font-size: 9px;
  }
  #map-viewport {
    height: clamp(128px, calc(100dvh - 184px), 310px);
  }
  .operation-panel {
    padding: 4px;
    margin-top: 4px;
  }
  .mode {
    min-height: 25px;
    font-size: 10px;
  }
  .mode i {
    font-size: 12px;
  }
  #instruction {
    padding-top: 2px;
    font-size: 10px;
  }
  .dashboard,
  .dispatch-box {
    padding: 6px;
  }
  .dispatch-sidebar {
    gap: 4px;
  }
  .route-meter {
    margin: 5px 0;
    padding: 2px;
  }
  .route-meter strong {
    font-size: 16px;
  }
  .meter {
    margin: 3px 0;
  }
  .game-head small,
  .net-status {
    font-size: 9px;
  }
  .bar {
    height: 3px;
  }
  .crew-details summary {
    font-size: 12px;
  }
  .log-box li {
    font-size: 10px;
  }
  .waiting {
    margin-top: 8px;
  }
  .crew-card {
    max-height: 120px;
  }
  .proposal-controls {
    margin-top: 3px;
    padding: 4px;
  }
  .panel {
    padding: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
.mode-tools {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.caption-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  color: #d3bd92;
}
.hint-link {
  background: #233d43;
  color: #a8ece0;
  border: 1px solid #6e9e9d;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.hint-link:disabled {
  opacity: 0.5;
}
.reason-controls {
  justify-content: flex-end;
}
.reason-pin {
  position: absolute;
  bottom: 1px;
  left: 2px;
  min-width: 10px;
  border: 1px solid currentColor;
  border-radius: 3px;
  background: #192d35;
  font: 700 max(9px, calc(var(--tile) * 0.31))/1 var(--mono);
  z-index: 4;
}
.reason-pin.safe {
  color: #b6f5cd;
}
.reason-pin.danger {
  color: #ffd0a4;
}
.reason-pin.mixed {
  color: #e4d7ff;
}
#mine-board[data-mode='reveal'] .tile.frontier,
#mine-board[data-mode='probe'] .tile.frontier,
#mine-board[data-mode='sonar'] .tile.frontier {
  box-shadow:
    inset 0 0 0 1px #91b8ad,
    inset -2px -2px #354b51;
}
.tile.clue-selected {
  box-shadow: inset 0 0 0 2px #f9cf88;
}
.tile.target-selected,
.tile.hint-target {
  outline: 2px solid #b6fde5;
  outline-offset: -3px;
  z-index: 2;
}
.tile.hint-target:after {
  content: '';
  position: absolute;
  inset: 30%;
  border: 2px dashed #a9f4d9;
  transform: rotate(45deg);
  pointer-events: none;
}
.portrait-round {
  width: 46px;
  height: 52px;
}
.mini-person b {
  font-size: 12px;
}
.mini-person small {
  font-size: 10px;
}
.mini-crew {
  gap: 7px 4px;
}
@media (max-width: 840px) {
  .mini-crew {
    grid-template-columns: 1fr;
  }
  .portrait-round {
    width: 31px;
    height: 36px;
  }
  .mini-person b {
    font-size: 11px;
  }
}
@media (max-width: 650px) and (orientation: portrait) {
  .mini-crew {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }
  .portrait-round {
    width: 35px;
    height: 39px;
  }
  .caption-tools {
    gap: 5px;
  }
  .caption-tools > span {
    display: none;
  }
  .hint-link {
    font-size: 10px;
  }
  .map-caption #cell-info {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
@media (max-height: 510px) and (orientation: landscape) {
  .portrait-round {
    width: 25px;
    height: 27px;
  }
  .mini-crew {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mini-person {
    gap: 2px;
  }
  .mini-person b,
  .mini-person small {
    font-size: 8px;
  }
  .hint-link {
    padding: 1px 4px;
    font-size: 9px;
  }
  .caption-tools {
    gap: 5px;
  }
}
.portrait-strip img,
.portrait-round img {
  transform: scale(2.05);
  transform-origin: 50% 34%;
}
@media (min-width: 851px) {
  .portrait-strip span {
    width: 50px;
    height: 59px;
  }
  .portrait-round {
    width: 48px;
    height: 55px;
  }
}

.dispatch-title {
  min-width: 0;
}
#head-crew {
  display: none;
}
@media (max-width: 850px), (max-height: 510px) and (orientation: landscape) {
  .dispatch-title {
    display: grid;
    grid-template-columns: auto max-content;
    align-items: center;
    column-gap: 9px;
  }
  .dispatch-title h1 {
    grid-column: 1;
    grid-row: 1;
  }
  #room-info {
    grid-column: 1;
    grid-row: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #head-crew {
    grid-column: 2;
    grid-row: 1/3;
    display: flex;
    align-items: center;
    padding-left: 4px;
  }
  .head-portrait {
    width: 27px;
    height: 30px;
    margin-left: -4px;
    flex: none;
    border: 1px solid #dbca9e;
    border-radius: 4px;
    overflow: hidden;
    background: #efdfc4;
    box-shadow: 0 0 0 1px #172538;
  }
  .head-portrait img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 24%;
    transform: scale(2.05);
    transform-origin: 50% 34%;
  }
  .head-actions {
    flex: none;
  }
}
@media (max-width: 360px), (max-height: 420px) and (orientation: landscape) {
  .dispatch-title {
    column-gap: 6px;
  }
  .head-portrait {
    width: 23px;
    height: 25px;
    margin-left: -5px;
  }
}
.sonar-boundary {
  position: absolute;
  inset: 1px;
  pointer-events: none;
  z-index: 2;
  border: 0 dashed #b2c5f4;
}
.sonar-boundary.part-0 {
  border-top-width: 1px;
  border-left-width: 1px;
}
.sonar-boundary.part-1 {
  border-top-width: 1px;
  border-right-width: 1px;
}
.sonar-boundary.part-2 {
  border-bottom-width: 1px;
  border-left-width: 1px;
}
.sonar-boundary.part-3 {
  border-bottom-width: 1px;
  border-right-width: 1px;
}
.room-notice {
  margin: 10px auto;
  color: #ead39d;
  text-align: center;
}
.pending-supply small {
  color: #bfcfc5;
}

@media (max-width: 360px) and (orientation: portrait) {
  .game-head h1 {
    font-size: 15px;
    white-space: nowrap;
  }
}
