.station-symbol { display: block; width: 22px; height: 22px; flex: none; }

.station-invite {
  display: flex;
  align-items: center;
  width: 100%;
  gap: clamp(8px, 1.5vw, 16px);
  padding: 7px 13px 7px 5px;
  margin: 0 0 12px;
  text-align: left;
  color: #fbf4de;
  border: 1px solid #254e50;
  border-radius: 12px;
  background: linear-gradient(110deg, #244a4c, #2f605d 60%, #315a58);
  box-shadow: inset 0 1px 0 #d2f3ce39, 0 3px 0 #173b3b;
}
.station-invite:hover { background: linear-gradient(110deg, #285855, #336a64 60%, #32615c); }
.station-invite:active { box-shadow: inset 0 1px 3px #102f37a3; }
.station-stamp { display: block; flex: none; width: clamp(55px, 8vw, 84px); height: auto; }
.station-invite-copy, .station-invite-title { display: flex; }
.station-invite-copy { flex: 1; min-width: 0; flex-direction: column; gap: 5px; }
.station-invite-title { align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
.station-invite-title strong { color: #fff8dc; font-size: clamp(18px, 2.5vw, 26px); line-height: 1.16; font-weight: 900; letter-spacing: .025em; }
.station-invite-title small { color: #f2dca5; font-size: 11px; font-weight: 780; white-space: nowrap; }
.station-invite-detail { color: #e3efde; font-size: 12px; line-height: 1.45; }
.station-invite-enter { display: inline-flex; flex: none; align-items: center; gap: 5px; padding: 6px 9px; color: #263f3a; background: #f7dc98; border: 1px solid #f8e9b9; border-radius: 7px; font-size: 13px; font-weight: 890; }
.station-invite-enter .glyph { width: 16px; height: 16px; }
.station-return.secondary { border-color: #496b63; color: #254b48; background: #e3eee0; }
.station-return span { display: grid; gap: 3px; }
.station-return small { font-size: 10px; font-weight: 710; color: #526a5b; }

.station-key, #app:not([data-play="station"]) :is(#station-hud, #station-map-button), #app[data-play="station"] .race-only { display: none; }
#app[data-play="station"] .keyboard-guide .station-key { display: inline; }
#app[data-play="station"] .race-top { display: flex; align-items: flex-start; justify-content: space-between; }
#app[data-play="station"] .race-place { max-width: none; padding-inline-start: 12px; border: 1px solid #c9dbb594; border-left: 3px solid #f0cf8e; color: #fff3d3; background: #193e42f5; }
#app[data-play="station"] .race-place span { color: #b9d8c8; }
#app[data-play="station"] #station-map-button { color: #fff3c6; border: 1px solid #dbd5a5b3; background: #285452; box-shadow: 0 3px 0 #153b40; }
#app[data-play="station"] #station-map-button:hover { background: #356960; }
#app[data-play="station"] #race-callout { top: calc(var(--top) + 55px); bottom: auto; max-width: min(66vw, 440px); }

#station-hud {
  position: absolute;
  left: 50%;
  bottom: calc(var(--bottom) + 38px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 5px;
  transform: translateX(-50%);
  width: min(46vw, 420px);
  pointer-events: none;
}
.station-bearing { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 2px 9px 2px 4px; color: #ffedbb; border: 1px solid #d4cb98b0; border-radius: 20px; background: #1c3c3df2; font-size: 12px; line-height: 1.25; font-weight: 800; }
.station-bearing i { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #edcd90; color: #234741; font: 900 16px/1 system-ui, sans-serif; }
.station-plaque { --station-mark: #edcf91; display: grid; align-items: center; grid-template-columns: auto minmax(0,1fr); column-gap: 9px; row-gap: 4px; width: fit-content; max-width: 100%; min-width: 0; white-space: normal; overflow-wrap: anywhere; padding: 8px 11px 8px 9px; color: #fcf4dc; background: #173d40f2; border: 1px solid #d4d6b493; border-radius: 10px; box-shadow: inset 0 1px #c1dfc02e, 0 3px 0 #1c3235a3; }
.station-plaque-icon { align-self: start; display: grid; place-items: center; width: 31px; height: 31px; color: var(--station-mark); border: 1px solid #e2e6c244; border-radius: 7px; }
.station-plaque-icon .station-symbol { width: 21px; height: 21px; }
.station-plaque-copy { min-width: 0; }
.station-plaque-copy strong, .station-plaque-copy span { display: block; }
.station-plaque-copy strong { margin-bottom: 2px; font-size: clamp(13px, 1.35vw, 16px); line-height: 1.3; color: var(--station-mark); }
.station-plaque-copy span { font-size: clamp(12px, 1.1vw, 14px); line-height: 1.45; color: #fcf8e9; font-weight: 650; }
.station-command { grid-column: 2; justify-self: start; padding: 2px 7px; border-radius: 4px; background: var(--station-mark); color: #253c37; font-size: 11px; line-height: 1.4; font-weight: 860; }
.station-plaque[data-nearby="no"] { align-items: center; padding-block: 6px; }
.station-plaque[data-nearby="no"] .station-plaque-icon { width: 25px; height: 25px; align-self: center; border: 0; }

#dialog[data-kind="station-map"] { width: min(92vw, 790px, calc(100% - var(--phone-left, 0px) - var(--phone-right, 0px))); border: 2px solid #324f48; background: #f5f1de; box-shadow: 0 6px 0 #314b46, 0 16px 70px #152d3559; }
#dialog[data-kind="station-map"] .dialog-content { padding: clamp(12px, 2vw, 21px); }
#dialog[data-kind="station-map"] .dialog-close { top: 8px; right: 9px; width: 44px; height: 44px; color: #345249; background: transparent; border-color: transparent; }
#dialog[data-kind="station-map"] .dialog-close:hover { background: #dce3d2; }
.station-map-head { display: flex; align-items: center; gap: 9px; min-height: 36px; margin: 0 48px 12px 0; color: #294c47; }
.station-map-head > span { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #799285; border-radius: 50%; background: #e7e7ce; }
.station-map-head .station-symbol { width: 22px; height: 22px; }
#dialog .station-map-head h2 { margin: 0; color: #254642; font-size: clamp(21px, 3vw, 30px); letter-spacing: .03em; line-height: 1.2; }
.station-atlas { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(195px, 1fr); gap: clamp(10px, 1.5vw, 17px); align-items: stretch; }
.station-chart-plate { display: flex; flex-flow: column; justify-content: center; align-self: start; overflow: hidden; margin: 0; border: 1px solid #47665c; border-radius: 9px; background: #20484b; }
.station-chart { display: block; width: 100%; height: auto; }
.station-chart-coast rect { fill: #233d3b; stroke: #608d80; stroke-width: 3; }
.station-chart-land rect { fill: #719b85; stroke: #c6ca9a; stroke-width: .9; }
.station-chart-land .station-deck-plaza { fill: #9cb39a; }
.station-chart-land .station-deck-gallery, .station-chart-land .station-deck-bridge { fill: #bfa77c; }
.station-chart-land .station-deck-highwalk { fill: #ced2af; }
.station-chart-label { font: 850 14px var(--rounded); fill: #fff7da; paint-order: stroke fill; stroke: #244741; stroke-width: 3.6; stroke-linejoin: round; }
.station-chart-note { font: 750 11px/1 ui-monospace, monospace; fill: #e1e4c6; }
.station-chart-plate figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 3px 9px; padding: 6px 9px; border-top: 1px solid #d0debb3b; background: #1b3d40; color: #e5ebd6; font-size: 11px; line-height: 1.3; font-weight: 700; }
.station-chart-plate figcaption span { display: inline-flex; align-items: center; gap: 6px; }
.station-you, .station-vane-key { display: inline-block; flex: none; width: 8px; height: 8px; }
.station-you { border-radius: 50%; background: #fffdef; }
.station-vane-key { width: 7px; height: 7px; border: 1.4px solid #ffdf9e; transform: rotate(45deg); }
.station-plaque-key { width: 7px; height: 5px; background: #d7d8b8; }
.station-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; padding: 0 1px; margin: 0 0 5px; }
.station-section-title h3 { margin: 0; color: #284d45; font-size: 13px; line-height: 1.25; font-weight: 900; }
.station-section-title small { color: #55685c; font-size: 10px; font-weight: 750; }
.station-routes { display: grid; gap: 3px; }
.station-mark { min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 6px; padding: 3px 7px; border: 1px solid #9cac99; border-radius: 6px; color: #254b45; background: #fffbee; text-align: left; }
.station-mark:hover { border-color: #587966; background: #edf2df; }
.station-mark[aria-pressed="true"] { color: #fff6dc; background: #315952; border-color: #234942; }
.station-mark > i { flex: none; display: grid; place-items: center; width: 25px; height: 25px; color: #324e47; border: 1px solid #223e3c39; background: var(--station-mark); border-radius: 5px; }
.station-mark .station-symbol { width: 17px; height: 17px; }
.station-mark > span { display: flex; flex: 1; flex-wrap: wrap; align-items: baseline; gap: 1px 6px; }
.station-mark b { font-size: 12px; font-weight: 850; }
.station-mark small { color: #54675e; font-size: 10px; font-weight: 750; }
.station-mark[aria-pressed="true"] small { color: #d9e8ce; }
.station-mark > .glyph { width: 14px; height: 14px; }
.station-mark-route:not([aria-pressed="true"]) > .glyph { opacity: .54; }
.station-puzzle-title { margin-top: 10px; }
.station-puzzle-sites { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.station-puzzle-sites .station-mark { padding: 3px 5px; gap: 4px; }
.station-puzzle-sites .station-mark > i { width: 20px; height: 20px; border: 0; background: none; color: inherit; }
.station-puzzle-sites .station-mark b { font-size: 11px; }
.station-arrival-list { margin-block: 9px 5px; }
.station-arrival-list > div:last-child { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 4px; }
.station-chart-plate figcaption .station-symbol { width: 13px; height: 13px; color: #f3ca96; }

@media (orientation: landscape) and (max-height: 500px) {
  .station-invite { gap: 8px; margin-bottom: 9px; padding-block: 4px; }
  .station-stamp { width: 54px; }
  .station-invite-copy { gap: 2px; }
  .station-invite-title strong { font-size: 18px; }
  .station-invite-detail { font-size: 11px; }
  #dialog[data-kind="station-map"] .dialog-content { padding: 7px 13px; }
  .station-map-head { margin-bottom: 3px; min-height: 32px; }
  .station-atlas { grid-template-columns: minmax(0, 1.6fr) minmax(199px, 1fr); gap: 10px; }
  .station-chart { max-height: 63dvh; }
  .station-puzzle-title { margin-top: 4px; }
  #station-hud { width: min(39vw, 360px); }
  .station-plaque { padding: 5px 8px; column-gap: 6px; row-gap: 2px; }
  .station-plaque-icon { width: 24px; height: 24px; }
  .station-plaque-icon .station-symbol { width: 17px; height: 17px; }
  .station-plaque-copy strong { margin: 0; font-size: 12px; }
  .station-plaque-copy span { font-size: 11px; line-height: 1.4; }
  .station-command, .station-bearing { font-size: 10px; }
}
@media (any-pointer: coarse) and (orientation: landscape) {
  #station-hud { left: 46%; bottom: calc(var(--bottom) + 9px); width: min(38vw, 360px); }
}
@media (orientation: landscape) and (max-height: 360px) and (min-aspect-ratio: 2/1) {
  .station-atlas { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 8px; }
  .station-chart { max-height: min(60dvh, calc(100dvh - 112px)); }
  .station-chart-plate figcaption { padding: 4px 6px; gap: 2px 7px; }
  .station-routes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .station-mark-route { gap: 4px; padding-inline: 4px; }
  .station-mark-route > i { width: 20px; height: 20px; }
  .station-mark-route > span { display: grid; gap: 1px; }
  .station-mark-route b { font-size: 11px; }
  .station-mark-route > .glyph { display: none; }
  .station-puzzle-sites { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .station-puzzle-sites .station-mark { padding-inline: 3px; gap: 2px; }
  .station-puzzle-sites .station-mark > .glyph { display: none; }
  .station-arrival-list { margin-top: 5px; }
}
@media (orientation: landscape) {
  #app.touch-hud #station-hud { left: 46%; bottom: calc(var(--bottom) + 9px); width: min(38vw, 360px); }
}
@media (max-width: 540px) and (orientation: portrait) {
  .station-atlas { grid-template-columns: minmax(0, 1fr); }
  .station-chart { max-height: 30dvh; }
  .station-invite { padding-inline-end: 8px; gap: 6px; }
  .station-stamp { width: 44px; }
  .station-invite-detail { font-size: 11px; }
  .station-invite-enter { padding: 5px; }
  .station-puzzle-sites { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .station-puzzle-sites .station-mark { justify-content: center; flex-wrap: wrap; }
  .station-puzzle-sites .station-mark > span { flex: none; }
  #station-hud { width: min(90vw, 400px); bottom: calc(var(--bottom) + 121px); }
}
