/* Smokey Studio Live Map, in the smokeystudio.com theme:
   night sky, moonlit track, trains lit up like the string lights on the homepage. */

:root {
  color-scheme: dark;

  /* The same palette as smokeystudio.com */
  --night: #140c2e;
  --night-2: #1d1342;
  --night-3: #2a1d58;
  --ink: #0d0822;
  --pink: #f0287f;
  --pink-deep: #d3176c;
  --amber: #ffc35c;
  --moon: #f6f1ff;
  --haze: #b4a9d3;
  --dim: #8a7fb0;
  --green: #4fe3a1;
  --cyan: #45d4f0;
  --red: #ff6b82;
  --line: rgba(196, 176, 255, 0.14);
  --line-strong: rgba(196, 176, 255, 0.28);

  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --text: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Map drawing (read by map.js) */
  --track: #f6f1ff;
  --track-side: #d9d1f2;
  --track-shadow: rgba(13, 8, 34, 0.75);
  --water: rgba(69, 212, 240, 0.34);
  --car-plain: #b4a9d3;
  --car-tender: #d99a3d;
  --car-passenger: #45d4f0;
  --car-caboose: #ff6b82;
  --car-mow: #4fe3a1;

  --nav-h: 64px;
  --roster-width: 344px;
  --sheet-peek: 92px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--night);
  color: var(--moon);
  font: 400 16px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

h1,
h2 {
  text-wrap: balance;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 8px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--amber);
  color: #241300;
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* ------------------------------------------------------------ site nav */

.nav {
  position: relative;
  z-index: 5;
  background: rgba(17, 10, 40, 0.84);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--nav-h);
  padding-inline: max(clamp(16px, 2.6vw, 32px), env(safe-area-inset-left)) max(clamp(16px, 2.6vw, 32px), env(safe-area-inset-right));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 750 19px/1 var(--display);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
}

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.nav-links a {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--haze);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-links a:hover {
  color: var(--moon);
  background: rgba(255, 255, 255, 0.07);
}

/* How many people have the map open right now */
.watching {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 0 auto;
  padding: 7px 13px 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--haze);
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.watching svg {
  flex: none;
  width: 17px;
  height: 17px;
  color: var(--pink);
}

.watching:not([hidden]) + .nav-links {
  margin-left: 0;
}

/* Back from one railroad's map to the board of every railroad */
.all-railroads {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--haze);
  font-size: 14.5px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.all-railroads:hover {
  border-color: rgba(240, 40, 127, 0.55);
  background: rgba(240, 40, 127, 0.1);
  color: var(--moon);
}

.all-railroads svg {
  width: 16px;
  height: 16px;
}

/* ------------------------------------------------------------ the Live railroads board */

/* One page, two views (route.js picks): the board of every railroad, or one railroad's map. */
html[data-view="map"] .railroads,
html[data-view="map"] .skip-list,
html:not([data-view="map"]) .board,
html:not([data-view="map"]) .skip-map,
html:not([data-view="map"]) .all-railroads {
  display: none;
}

html:not([data-view="map"]) body {
  display: block;
  height: auto;
  min-height: 100%;
  background:
    radial-gradient(60% 50% at 92% 0%, rgba(255, 195, 92, 0.07), transparent 70%),
    radial-gradient(70% 55% at 0% 100%, rgba(240, 40, 127, 0.1), transparent 70%),
    var(--night);
  background-attachment: fixed;
}

.railroads {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) clamp(16px, 3vw, 32px) 64px;
}

.rr-head {
  display: grid;
  gap: 14px;
  margin-bottom: 30px;
}

.rr-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0;
}

.rr-count {
  color: var(--haze);
  font-size: 14.5px;
  font-weight: 650;
}

.rr-head h1 {
  margin: 0;
  font: 800 clamp(40px, 6.4vw, 66px)/0.95 var(--display);
  font-stretch: 86%;
  letter-spacing: -0.03em;
}

.rr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rr-item {
  display: flex;
}

.rr-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.025);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.rr-card:hover {
  border-color: rgba(240, 40, 127, 0.6);
  background: rgba(240, 40, 127, 0.06);
  transform: translateY(-2px);
}

.rr-card:focus-visible {
  border-radius: 20px;
}

.rr-preview {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(70% 70% at 100% 0%, rgba(255, 195, 92, 0.07), transparent 70%),
    radial-gradient(70% 70% at 0% 100%, rgba(240, 40, 127, 0.12), transparent 70%),
    var(--ink);
}

.rr-preview canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.rr-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 24px);
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(13, 8, 34, 0.8);
  color: var(--dim);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.rr-badge::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.rr-card[data-state="live"] .rr-badge {
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(79, 227, 161, 0.35);
}

.rr-card[data-state="live"] .rr-badge::before {
  box-shadow: 0 0 10px currentColor;
}

.rr-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 18px 18px;
}

.rr-name {
  font: 750 22px/1.15 var(--display);
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.rr-card[data-state="offline"] .rr-name {
  color: var(--haze);
}

.rr-owner {
  color: var(--dim);
  font-size: 14px;
  font-weight: 600;
}

.rr-stats {
  margin-top: 9px;
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.rr-line {
  color: var(--haze);
  font-size: 14px;
  line-height: 1.4;
}

.rr-people {
  color: var(--moon);
}

.rr-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  color: var(--amber);
  font-size: 14px;
  font-weight: 650;
}

.rr-radio::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px rgba(255, 195, 92, 0.8);
}

.rr-empty {
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  color: var(--haze);
}

.rr-empty h2 {
  margin: 0 0 6px;
  color: var(--moon);
  font: 750 24px/1.15 var(--display);
}

.rr-empty p {
  margin: 0;
}

.rr-note {
  margin: 30px 0 0;
  color: var(--haze);
  font-size: 15px;
}

.empty a {
  color: var(--moon);
  font-weight: 650;
}

/* ------------------------------------------------------------ board */

.board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--roster-width);
  min-height: 0;
}

.map {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(60% 55% at 92% 0%, rgba(255, 195, 92, 0.07), transparent 70%),
    radial-gradient(70% 60% at 0% 100%, rgba(240, 40, 127, 0.11), transparent 70%),
    var(--night);
}

.map:focus-visible {
  outline-offset: -3px;
  border-radius: 0;
}

.map canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

.map canvas.dragging {
  cursor: grabbing;
}

.map canvas.pointing {
  cursor: pointer;
}

.controls {
  position: absolute;
  top: 16px;
  left: 16px;
  display: grid;
  gap: 8px;
}

.round {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(17, 10, 40, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.round svg {
  width: 18px;
  height: 18px;
}

.round:hover {
  border-color: rgba(240, 40, 127, 0.65);
  background: rgba(240, 40, 127, 0.12);
}

.round:focus-visible {
  border-radius: 50%;
}

.scale {
  position: absolute;
  left: 16px;
  bottom: 16px;
  color: var(--haze);
  font: 600 12.5px/1 var(--text);
  pointer-events: none;
}

.scale-bar {
  height: 7px;
  margin-bottom: 6px;
  border: 1.5px solid var(--haze);
  border-top: 0;
}

/* Like the "Next up" pill on the homepage */
.following {
  position: absolute;
  top: 16px;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin: 0;
  padding: 9px 18px 9px 14px;
  border: 1px solid rgba(255, 195, 92, 0.34);
  border-radius: 999px;
  background: rgba(12, 7, 30, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

.bulb {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dim);
  opacity: 0.55;
}

.following .bulb,
.bulb[data-state="moving"] {
  background: var(--amber);
  opacity: 1;
  box-shadow: 0 0 0 4px rgba(255, 195, 92, 0.16), 0 0 16px rgba(255, 195, 92, 0.9);
}

.tip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: max-content;
  max-width: 270px;
  padding: 12px 14px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--night-2);
  box-shadow: 0 14px 32px rgba(5, 2, 15, 0.55);
  font-size: 14px;
  line-height: 1.45;
  pointer-events: none;
}

.tip-title {
  display: block;
  font: 750 18px/1.15 var(--display);
  letter-spacing: -0.015em;
}

.tip-model {
  display: block;
  margin: 2px 0 6px;
  color: var(--dim);
}

.tip-line {
  display: block;
  color: var(--haze);
}

.tip-warn {
  display: block;
  color: var(--red);
  font-weight: 700;
}

.tip-train {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--haze);
}

/* A switch: the game's own words and colors, Normal in green and Reversed in red */
.tip-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  color: var(--dim);
  font-weight: 700;
}

.tip-switch::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.tip-switch[data-tone="green"] {
  color: var(--green);
}

.tip-switch[data-tone="amber"] {
  color: var(--amber);
}

.tip-switch[data-tone="red"] {
  color: var(--red);
}

.tip-gauges {
  display: grid;
  grid-template-columns: auto 52px auto;
  align-items: center;
  gap: 5px 8px;
  width: max-content;
  margin: 2px 0 6px;
}

/* In a tip, the bars line up in one column. */
.tip-gauges .gauge {
  display: contents;
}

/* ------------------------------------------------------------ fuel and water gauges */

.gauge {
  display: inline-grid;
  grid-template-columns: auto 52px auto;
  align-items: center;
  column-gap: 8px;
  color: var(--haze);
  font-size: 13px;
  line-height: 1.2;
}

.gauge-bar {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
}

.gauge-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
  background: var(--green);
}

.gauge[data-level="low"] .gauge-fill {
  background: var(--amber);
}

.gauge[data-level="empty"] .gauge-fill {
  background: var(--red);
}

.gauge-value {
  color: var(--moon);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.gauge[data-level="empty"] .gauge-value {
  color: var(--red);
}

/* ------------------------------------------------------------ search */

.search {
  position: absolute;
  top: 16px;
  left: 70px;
  z-index: 3;
  width: min(340px, calc(100% - 86px));
}

.search-icon {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 15px;
  width: 18px;
  height: 18px;
  color: var(--dim);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 42px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(17, 10, 40, 0.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--moon);
  font: 500 15px/1 var(--text);
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.search input::placeholder {
  color: var(--dim);
  opacity: 1;
}

.search input:hover {
  border-color: rgba(240, 40, 127, 0.5);
}

.search input:focus {
  border-color: rgba(240, 40, 127, 0.8);
}

.search input:focus-visible {
  outline-offset: 2px;
  border-radius: 999px;
}

.search-results {
  max-height: min(360px, 60vh);
  margin: 6px 0 0;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--night-2);
  box-shadow: 0 14px 32px rgba(5, 2, 15, 0.55);
  list-style: none;
}

.search-results li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  column-gap: 11px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
}

.search-results li[aria-selected="true"],
.search-results li[role="option"]:hover {
  background: rgba(240, 40, 127, 0.12);
}

.result-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--haze);
}

[data-kind="train"] .result-dot { background: var(--pink); }
[data-kind="player"] .result-dot { background: var(--moon); box-shadow: 0 0 0 3px rgba(246, 241, 255, 0.16); }
[data-kind="station"] .result-dot { background: var(--cyan); }
[data-kind="industry"] .result-dot { background: var(--amber); }
[data-kind="town"] .result-dot { background: transparent; box-shadow: inset 0 0 0 2px var(--moon); }

.result-name {
  overflow: hidden;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.result-detail {
  grid-column: 2;
  overflow: hidden;
  color: var(--haze);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.search-results .search-empty {
  display: block;
  color: var(--dim);
  cursor: default;
}

/* ------------------------------------------------------------ the radio */

.radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.radio-row[hidden],
.radio-bar[hidden] {
  display: none;
}

.radio-toggle {
  position: relative;
}

/* Someone's on the radio and this visitor isn't listening yet. */
.radio-live {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--night);
  border-radius: 50%;
  background: var(--amber);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.radio-toggle[data-live="true"] .radio-live {
  opacity: 1;
  transform: none;
  animation: radio-live 1.4s ease-in-out infinite;
}

.radio-toggle[data-live="true"] {
  border-color: rgba(255, 195, 92, 0.55);
}

@keyframes radio-live {
  50% {
    box-shadow: 0 0 0 5px rgba(255, 195, 92, 0);
  }
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 195, 92, 0.55);
  }
}

.radio-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 110px);
  height: 42px;
  padding: 0 14px 0 13px;
  border: 1px solid rgba(255, 195, 92, 0.34);
  border-radius: 999px;
  background: rgba(12, 7, 30, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 14.5px;
  font-weight: 650;
  white-space: nowrap;
}

.radio-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dim);
  transition: background-color 0.15s ease;
}

.radio-bar[data-talking="true"] .radio-dot {
  background: var(--amber);
  box-shadow: 0 0 10px rgba(255, 195, 92, 0.8);
}

.radio-what {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.radio-bar[data-talking="false"] .radio-what {
  color: var(--haze);
  font-weight: 600;
}

/* Sound bars while someone talks. */
.radio-bars {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.radio-bar[data-talking="true"] .radio-bars {
  display: inline-flex;
}

.radio-bars i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: var(--amber);
  transform-origin: bottom;
  animation: radio-bars 0.9s ease-in-out infinite;
}

.radio-bars i:nth-child(2) {
  animation-delay: -0.3s;
}

.radio-bars i:nth-child(3) {
  animation-delay: -0.6s;
}

.radio-bars i:nth-child(4) {
  animation-delay: -0.15s;
}

@keyframes radio-bars {
  0%,
  100% {
    transform: scaleY(0.3);
  }
  50% {
    transform: scaleY(1);
  }
}

.radio-volume {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  margin-left: 2px;
  color: var(--haze);
}

.radio-volume svg {
  width: 16px;
  height: 16px;
}

.radio-volume input {
  width: 84px;
  margin: 0;
  accent-color: var(--amber);
  cursor: pointer;
}

/* ------------------------------------------------------------ layers */

.round[aria-pressed="true"],
.round[aria-expanded="true"] {
  border-color: rgba(255, 195, 92, 0.7);
  background: rgba(255, 195, 92, 0.14);
  color: var(--amber);
}

.layers {
  position: absolute;
  top: 66px;
  left: 70px;
  z-index: 4;
  display: grid;
  gap: 14px;
  width: 248px;
  max-width: calc(100% - 86px);
  max-height: calc(100% - 82px);
  margin: 0;
  padding: 14px 10px 12px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--night-2);
  box-shadow: 0 14px 32px rgba(5, 2, 15, 0.55);
  overscroll-behavior: contain;
}

.layer-group {
  display: grid;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.layer-group legend {
  margin: 0 0 4px;
  padding: 0 8px;
  color: var(--dim);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.layer {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  column-gap: 11px;
  padding: 7px 8px;
  border-radius: 10px;
  color: var(--moon);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
}

.layer:hover {
  background: rgba(255, 255, 255, 0.05);
}

.layer input {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid var(--dim);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}

.layer input[type="radio"] {
  border-radius: 50%;
}

.layer input:checked {
  border-color: var(--pink);
  background: var(--pink);
}

.layer input[type="checkbox"]:checked::after {
  content: "";
  width: 9px;
  height: 5px;
  margin-top: -2px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}

.layer input[type="radio"]:checked {
  background: transparent;
}

.layer input[type="radio"]:checked::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
}

.layer input:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

.layer input:not(:checked) + span {
  color: var(--haze);
}

/* Keys for the colors a layer uses (speed limits, car condition), bottom left. */
.keys {
  position: absolute;
  left: 16px;
  bottom: 50px;
  z-index: 1;
  display: grid;
  justify-items: start;
  gap: 6px;
  max-width: calc(100% - 32px);
  pointer-events: none;
}

.map-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(17, 10, 40, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--haze);
  font: 600 12px/1 var(--text);
}

.map-key-title {
  margin-right: 3px;
}

.chip {
  padding: 3px 6px;
  border-radius: 6px;
  color: var(--ink);
  font-weight: 750;
}

.chip[data-tone="red"] { background: var(--red); }
.chip[data-tone="amber"] { background: var(--amber); }
.chip[data-tone="cyan"] { background: var(--cyan); }
.chip[data-tone="green"] { background: var(--green); }
.chip[data-tone="moon"] { background: var(--moon); }
.chip[data-tone="orange"] { background: #ff9a5c; }

/* ------------------------------------------------------------ news, as it happens */

.toast {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  column-gap: 11px;
  max-width: min(380px, calc(100% - 32px));
  padding: 11px 16px 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--night-2);
  box-shadow: 0 14px 32px rgba(5, 2, 15, 0.55);
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  animation: toast-in 0.3s ease both;
}

.toast:hover {
  border-color: rgba(240, 40, 127, 0.6);
}

.toast.is-leaving {
  animation: toast-out 0.4s ease both;
}

.toast:focus-visible {
  border-radius: 16px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(10px); }
}

/* ------------------------------------------------------------ weather from the game */

.map::before {
  content: "";
  position: absolute;
  inset: -40% 0 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.map[data-weather="rain"]::before,
.map[data-weather="storm"]::before {
  opacity: 1;
  background-image: repeating-linear-gradient(104deg, rgba(190, 205, 255, 0.07) 0 1px, transparent 1px 13px);
  animation: rain-fall 0.9s linear infinite;
}

.map[data-weather="storm"]::before {
  background-image: repeating-linear-gradient(110deg, rgba(190, 205, 255, 0.11) 0 1.5px, transparent 1.5px 10px);
  animation-duration: 0.55s;
}

.map[data-weather="snow"]::before {
  opacity: 1;
  background-image:
    radial-gradient(circle, rgba(246, 241, 255, 0.5) 0 1.4px, transparent 1.8px),
    radial-gradient(circle, rgba(246, 241, 255, 0.35) 0 1px, transparent 1.4px);
  background-size: 46px 46px, 31px 31px;
  background-position: 0 0, 15px 20px;
  animation: snow-fall 9s linear infinite;
}

.map[data-weather="fog"]::before {
  opacity: 1;
  inset: 0;
  background: linear-gradient(180deg, rgba(196, 186, 230, 0.13), rgba(196, 186, 230, 0.06) 60%, rgba(196, 186, 230, 0.12));
}

.map[data-weather="cloudy"]::before {
  opacity: 1;
  inset: 0;
  background: rgba(8, 4, 22, 0.16);
}

@keyframes rain-fall {
  from { transform: translateY(0); }
  to { transform: translateY(26%); }
}

@keyframes snow-fall {
  from { transform: translateY(0); }
  to { transform: translateY(25%); }
}

/* The "Following" pill moves down out of the search box's way when the map is narrow */
@media (max-width: 1260px) {
  .following {
    top: 70px;
  }
}

.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.empty-card {
  max-width: 420px;
  padding: 30px 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
  background: rgba(13, 8, 34, 0.55);
  text-align: center;
}

.empty h2 {
  margin: 0 0 10px;
  font: 800 34px/1 var(--display);
  font-stretch: 86%;
  letter-spacing: -0.025em;
}

.empty p {
  margin: 0;
  color: var(--haze);
}

/* ------------------------------------------------------------ railroad and trains */

.roster {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, #1f1447, #190f3c);
}

.roster-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 26px 24px 20px;
  border-bottom: 1px solid var(--line);
}

.roster-title {
  min-width: 0;
  flex: 1;
}

.roster-head h1 {
  margin: 0;
  font: 800 38px/0.95 var(--display);
  font-stretch: 86%;
  letter-spacing: -0.028em;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 14px 0 0;
}

/* Status pill, like the SmokeMod console on the homepage */
.state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--haze);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.state::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.state[data-state="live"] {
  background: rgba(79, 227, 161, 0.12);
  color: var(--green);
}

.state[data-state="live"]::before {
  box-shadow: 0 0 10px currentColor;
}

.state[data-state="connecting"] {
  background: rgba(255, 195, 92, 0.12);
  color: var(--amber);
}

.state[data-state="offline"] {
  background: rgba(255, 107, 130, 0.12);
  color: var(--red);
}

.clock {
  color: var(--haze);
  font-size: 14.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.roster-toggle {
  display: none;
}

.roster-body {
  padding-bottom: 8px;
}

.schedule-title {
  margin: 22px 24px 12px;
  color: var(--haze);
  font: 700 16px/1.2 var(--text);
}

.trains {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0 16px;
  list-style: none;
}

.train {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 12px;
  width: 100%;
  padding: 14px 16px 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.train:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
}

.train[aria-pressed="true"] {
  border-color: rgba(240, 40, 127, 0.65);
  background: rgba(240, 40, 127, 0.08);
}

.train:focus-visible {
  border-radius: 18px;
}

.train .bulb {
  align-self: center;
}

.train-name {
  min-width: 0;
  font: 750 18px/1.2 var(--display);
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.train-speed {
  font: 750 17px/1.2 var(--display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--dim);
  white-space: nowrap;
}

.train-speed.is-moving {
  color: var(--green);
}

.train-meta,
.train-to {
  grid-column: 2 / 4;
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--haze);
}

.train-to {
  margin-top: 1px;
  color: var(--dim);
}

.train-warn {
  grid-column: 2 / 4;
  margin-top: 5px;
  color: var(--red);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
}

.train-warn[data-level="amber"] {
  color: var(--amber);
}

.train-gauges {
  grid-column: 2 / 4;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 9px;
}

.train-tt {
  grid-column: 2 / 4;
  margin-top: 4px;
  color: var(--cyan);
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.35;
}

/* ------------------------------------------------------------ the followed train's cars */

.trains li.is-open .train {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.consist {
  display: grid;
  max-height: 380px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid rgba(240, 40, 127, 0.65);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: rgba(13, 8, 34, 0.55);
  list-style: none;
}

.consist-car {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.consist-car:hover {
  background: rgba(255, 255, 255, 0.05);
}

.consist-car:focus-visible {
  border-radius: 10px;
}

.consist-title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.consist-line,
.consist-warn {
  grid-column: 1 / 3;
}

.consist-line {
  overflow: hidden;
  color: var(--haze);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.consist-warn {
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.consist-car[data-level="amber"] .consist-warn {
  color: var(--amber);
}

/* How worn a car is: a short bar and the percent, on its title line */
.consist-cond {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--haze);
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.consist-cond .gauge-bar {
  width: 30px;
}

.consist-cond[data-level="empty"] {
  color: var(--red);
}

.consist-cond[data-level="low"] .gauge-fill {
  background: var(--amber);
}

.consist-cond[data-level="empty"] .gauge-fill {
  background: var(--red);
}

.train-wear {
  grid-column: 2 / 4;
  margin-top: 5px;
  color: var(--amber);
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.35;
}

/* ------------------------------------------------------------ railroad stats */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 10px;
  margin: 18px 16px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.stats dt {
  color: var(--dim);
  font-size: 12.5px;
}

.stats dd {
  margin: 2px 0 0;
  font: 750 19px/1.1 var(--display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

/* ------------------------------------------------------------ today's numbers */

.today {
  margin: 14px 16px 0;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.today-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 10px;
  font: 750 17px/1.2 var(--display);
  letter-spacing: -0.01em;
}

.today-day {
  color: var(--dim);
  font: 600 13px/1.2 var(--text);
  letter-spacing: 0;
}

.today-numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 10px;
  margin: 0;
}

.today-numbers dt {
  color: var(--dim);
  font-size: 12.5px;
  white-space: nowrap;
}

.today-numbers dd {
  margin: 2px 0 0;
  font: 750 19px/1.1 var(--display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.today-top-title {
  margin: 14px 0 6px;
  color: var(--haze);
  font: 700 13px/1.2 var(--text);
}

.today-top {
  display: grid;
  gap: 1px;
  margin: 0 -6px;
  padding: 0;
  list-style: none;
}

.top-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 8px;
  width: 100%;
  padding: 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--moon);
  text-align: left;
}

button.top-row {
  cursor: pointer;
}

button.top-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.top-row:focus-visible {
  border-radius: 10px;
}

.top-rank {
  color: var(--dim);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.today-top li:first-child .top-rank {
  color: var(--amber);
}

.top-name {
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-miles {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.top-more {
  grid-column: 2 / 4;
  color: var(--dim);
  font-size: 12.5px;
}

.today-more {
  margin: 2px 0 0 20px;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--pink);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.today-more:hover {
  background: rgba(240, 40, 127, 0.1);
}

.today-yesterday {
  margin: 10px 0 0;
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.4;
}

/* ------------------------------------------------------------ news */

.news-title {
  margin: 22px 24px 10px;
  color: var(--haze);
  font: 700 16px/1.2 var(--text);
}

.news-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0 10px;
  list-style: none;
}

.news-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: baseline;
  column-gap: 12px;
  width: 100%;
  padding: 8px 12px 9px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}

button.news-item {
  cursor: pointer;
}

button.news-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.news-item:focus-visible {
  border-radius: 12px;
}

.news-item.is-new {
  animation: news-new 2.4s ease;
}

@keyframes news-new {
  from { background: rgba(240, 40, 127, 0.2); }
}

.news-dot {
  align-self: center;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--haze);
}

.news-item .news-dot {
  align-self: start;
  margin-top: 6px;
}

[data-kind="arrive"] > .news-dot,
[data-kind="depart"] > .news-dot { background: var(--pink); }
[data-kind="spot"] > .news-dot { background: var(--amber); }
[data-kind="hotbox"] > .news-dot,
[data-kind="derail"] > .news-dot { background: var(--red); box-shadow: 0 0 8px rgba(255, 107, 130, 0.8); }
[data-kind="fuel"] > .news-dot { background: var(--amber); box-shadow: 0 0 0 2px rgba(255, 195, 92, 0.25); }
[data-kind="join"] > .news-dot,
[data-kind="leave"] > .news-dot { background: var(--moon); box-shadow: 0 0 0 3px rgba(246, 241, 255, 0.16); }
[data-kind="weather"] > .news-dot { background: var(--cyan); }
[data-kind="online"] > .news-dot { background: var(--green); box-shadow: 0 0 8px rgba(79, 227, 161, 0.7); }

.news-text {
  min-width: 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.news-time {
  grid-column: 2;
  margin-top: 1px;
  color: var(--dim);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.news-more {
  margin: 4px 0 0 22px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--pink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.news-more:hover {
  background: rgba(240, 40, 127, 0.1);
}

/* ------------------------------------------------------------ timetable */

.timetable {
  margin: 22px 24px 0;
}

.timetable summary {
  width: max-content;
  color: var(--moon);
  font: 700 15px/1.3 var(--text);
  cursor: pointer;
}

.tt-count {
  margin-left: 4px;
  color: var(--dim);
  font-weight: 600;
}

.tt-trains {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.tt-train {
  display: grid;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.4;
}

.tt-name {
  font: 750 16px/1.2 var(--display);
  letter-spacing: -0.01em;
}

.tt-kind,
.tt-route {
  color: var(--dim);
}

.tt-status {
  margin-top: 2px;
  color: var(--haze);
  font-weight: 650;
}

.tt-status[data-live="true"] {
  color: var(--cyan);
}

.tip-heading {
  display: block;
  margin-top: 6px;
  color: var(--moon);
  font-weight: 700;
}

/* ------------------------------------------------------------ players online */

.people-title {
  margin: 22px 24px 10px;
  color: var(--haze);
  font: 700 16px/1.2 var(--text);
}

.players {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 16px;
  list-style: none;
}

.player {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  width: 100%;
  padding: 10px 14px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.player:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
}

.player:focus-visible {
  border-radius: 14px;
}

.player-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--moon);
  box-shadow: 0 0 0 3px rgba(246, 241, 255, 0.16);
}

.player-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.player-where {
  grid-column: 2;
  color: var(--haze);
  font-size: 13.5px;
}

.quiet {
  margin: 4px 24px 16px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  color: var(--haze);
}

.key {
  margin: 22px 24px 26px;
  color: var(--haze);
  font-size: 14px;
  line-height: 1.4;
}

.key summary {
  width: max-content;
  color: var(--moon);
  font: 700 15px/1.3 var(--text);
  cursor: pointer;
}

.key ul {
  display: grid;
  gap: 9px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.key li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
}

.key svg {
  width: 28px;
  height: 10px;
}

/* ------------------------------------------------------------ phones: the railroad card slides up */

@media (max-width: 760px) {
  .nav-links {
    display: none;
  }

  .radio-bar {
    max-width: calc(100vw - 84px);
    gap: 8px;
    padding: 0 12px 0 11px;
  }

  .radio-volume input {
    width: 64px;
  }

  .board {
    grid-template-columns: minmax(0, 1fr);
  }

  .roster {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    max-height: 66%;
    overflow: hidden;
    border-top: 1px solid var(--line-strong);
    border-left: 0;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 30px rgba(5, 2, 15, 0.45);
    transform: translateY(calc(100% - var(--sheet-peek) - env(safe-area-inset-bottom)));
    transition: transform 0.25s ease;
  }

  .roster[data-open="true"] {
    transform: none;
  }

  .roster-head {
    flex: none;
    min-height: var(--sheet-peek);
    padding: 14px 18px 12px 20px;
  }

  .roster-head h1 {
    overflow: hidden;
    font-size: 25px;
    line-height: 1.05;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .status-row {
    margin-top: 8px;
    flex-wrap: nowrap;
  }

  .clock {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .roster-toggle {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 8px 0 16px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 15px;
    font-weight: 650;
    cursor: pointer;
  }

  .roster-toggle .count {
    min-width: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--pink-deep);
    color: #fff;
    font-size: 13px;
    font-weight: 750;
    text-align: center;
  }

  .roster-body {
    flex: 1;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .schedule-title {
    display: none;
  }

  .trains {
    padding-top: 14px;
  }

  .scale {
    bottom: calc(var(--sheet-peek) + 16px);
  }

  .tip {
    max-width: min(270px, 80vw);
  }

  .search {
    top: 16px;
    left: 68px;
    right: 14px;
    width: auto;
  }

  .search input {
    font-size: 16px;
  }

  .keys {
    bottom: calc(var(--sheet-peek) + 50px);
  }

  .toast {
    right: 14px;
    bottom: calc(var(--sheet-peek) + 48px);
    max-width: calc(100% - 28px);
  }

  .layers {
    left: 68px;
    max-width: calc(100% - 82px);
    max-height: calc(100% - 82px - var(--sheet-peek));
  }

  /* On a phone the trains come first; the news follows them. */
  .roster-body {
    display: flex;
    flex-direction: column;
  }

  .roster-body > * {
    flex: none;
  }

  .stats { order: 0; }
  .today { order: 0; }
  .people { order: 1; }
  .schedule-title,
  .trains,
  #no-trains { order: 2; }
  .news { order: 3; }
  .timetable { order: 4; }
  .key { order: 5; }

  .watching {
    padding: 6px 11px 6px 10px;
    font-size: 13.5px;
  }

  .people-title {
    margin-top: 16px;
  }
}

/* On a railroad's map the header also holds "All railroads" and the watching count; the board has room for the name. */
@media (max-width: 520px) {
  html[data-view="map"] .brand span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .roster,
  .round,
  .train,
  .nav-links a {
    transition: none;
  }

  .toast,
  .toast.is-leaving,
  .news-item.is-new,
  .radio-toggle[data-live="true"] .radio-live,
  .radio-bars i {
    animation: none;
  }

  /* The weather stays, but stands still. */
  .map::before {
    animation: none !important;
  }
}

/* ------------------------------------------------------------ setting switches from the website */

/* A clicked switch's tip can hold a button, so it takes clicks (other tips let them through to the map). */
.tip.interactive {
  pointer-events: auto;
}

.tip-control {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.tip-note {
  display: block;
  color: var(--haze);
  font-size: 13.5px;
}

.tip-note[data-tone="green"] {
  color: var(--green);
  font-weight: 700;
}

.tip-note[data-tone="red"] {
  color: var(--red);
  font-weight: 700;
}

.tip-button,
.control-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font: 700 14px/1.1 var(--text);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tip-button:hover,
.control-button:hover {
  background: var(--pink-deep);
}

.tip-button:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--haze);
  cursor: progress;
}

.tip-button:focus-visible,
.control-button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.control-button.subtle {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--haze);
}

.control-button.subtle:hover {
  border-color: rgba(240, 40, 127, 0.55);
  background: rgba(240, 40, 127, 0.1);
  color: var(--moon);
}

.control-button:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Who's signed in, at the top of the panel: their Discord picture and Sign out, or how to sign in */
.control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 12px;
  margin: 18px 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.control-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--night-3);
  box-shadow: 0 0 0 2px var(--line-strong);
  object-fit: cover;
}

.control-text {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--haze);
  font-size: 14px;
  line-height: 1.45;
}

.control-avatar:not([hidden]) + .control-text {
  grid-column: 2;
}

.control-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Signed in: picture, any note beside it, and Sign out at the end of the same row */
.control[data-signed-in="true"] {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control[data-signed-in="true"] .control-text {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
}

.control[data-signed-in="true"] .control-actions {
  margin-left: auto;
}

/* Talking on the radio from the map: the channel, and a button held down while talking */
.control[data-signed-in="true"] {
  flex-wrap: wrap;
}

.talk {
  grid-column: 1 / -1;
  flex-basis: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.talk-channel {
  display: grid;
  gap: 3px;
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.talk-channel select {
  min-width: 64px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--night-3);
  color: var(--moon);
  font: 700 15px/1 var(--text);
  letter-spacing: 0;
}

.talk-channel select:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.talk-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  margin-top: 16px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font: 750 15px/1.1 var(--text);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.talk-button svg {
  flex: none;
  width: 18px;
  height: 18px;
}

.talk-button:hover {
  background: var(--pink-deep);
}

.talk-button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.talk-button:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--haze);
  cursor: default;
}

/* On the air: green, with a ring going out */
.talk-button[aria-pressed="true"] {
  background: var(--green);
  color: #052a1a;
  animation: talk-ring 1.2s ease-out infinite;
}

@keyframes talk-ring {
  0% { box-shadow: 0 0 0 0 rgba(79, 227, 161, 0.45); }
  100% { box-shadow: 0 0 0 12px rgba(79, 227, 161, 0); }
}

.talk-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--haze);
  font-size: 13.5px;
  line-height: 1.45;
}

.talk-note[data-tone="green"] {
  color: var(--green);
  font-weight: 700;
}

.talk-note[data-tone="red"] {
  color: var(--red);
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .talk-button {
    transition: none;
  }

  .talk-button[aria-pressed="true"] {
    animation: none;
    box-shadow: 0 0 0 4px rgba(79, 227, 161, 0.3);
  }
}

/* ------------------------------------------------------------ community link */

.community {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin-bottom: 8px;
  color: var(--haze);
  font: 700 13.5px/1.2 var(--text);
  text-decoration: none;
}

.community img {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  object-fit: cover;
}

.community span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community:hover span {
  color: var(--moon);
  text-decoration: underline;
}

/* ------------------------------------------------------------ embedded in a community's page */

html[data-embed] .nav,
html[data-embed] .roster,
html[data-embed] .skip,
html[data-embed] .search,
html[data-embed] .dispatch-toggle,
html[data-embed] .radio-row,
html[data-embed] #layers-toggle {
  display: none;
}

html[data-embed] body {
  grid-template-rows: minmax(0, 1fr);
}

html[data-embed] .board {
  grid-template-columns: minmax(0, 1fr);
}

/* ------------------------------------------------------------ the dispatch board */

.sheet,
.desk {
  display: none;
}

.dispatch-toggle[aria-pressed="true"] {
  border-color: var(--amber);
  background: rgba(255, 195, 92, 0.16);
  color: var(--amber);
}

html[data-mode="dispatch"] {
  --night: #070a0c;
  --night-2: #0d1215;
  --night-3: #161d21;
  --ink: #020304;
  --pink: #ffb21e;
  --pink-deep: #e09a0c;
  --amber: #ffcf3f;
  --moon: #eef3f0;
  --haze: #a3b3ab;
  --dim: #66756d;
  --green: #36f07c;
  --cyan: #58d6ff;
  --red: #ff3d33;
  --line: rgba(160, 255, 200, 0.12);
  --line-strong: rgba(160, 255, 200, 0.26);
  --track: #f1f5f2;
  --track-side: #94a39b;
  --track-shadow: rgba(0, 0, 0, 0);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Consolas, "Liberation Mono", monospace;
}

@media (min-width: 761px) {
  html[data-mode="dispatch"] .board {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  html[data-mode="dispatch"] .map {
    grid-column: 1;
    grid-row: 1;
  }

  html[data-mode="dispatch"] .roster {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

html[data-mode="dispatch"] .map {
  background:
    linear-gradient(rgba(160, 255, 200, 0.035) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(90deg, rgba(160, 255, 200, 0.035) 1px, transparent 1px) 0 0 / 48px 100%,
    #030506;
}

html[data-mode="dispatch"] .roster {
  background: #0a0e10;
}

html[data-mode="dispatch"] .nav {
  background: #05080a;
}

html[data-mode="dispatch"] #layers-toggle,
html[data-mode="dispatch"] .keys,
html[data-mode="dispatch"] .stats,
html[data-mode="dispatch"] .today,
html[data-mode="dispatch"] details.key {
  display: none;
}

html[data-mode="dispatch"] .round,
html[data-mode="dispatch"] .search input,
html[data-mode="dispatch"] .radio-bar {
  border-radius: 8px;
  background: rgba(8, 12, 14, 0.88);
}

html[data-mode="dispatch"] .roster-head h1,
html[data-mode="dispatch"] .schedule-title,
html[data-mode="dispatch"] .people-title,
html[data-mode="dispatch"] .news-title {
  font-family: var(--mono);
  font-stretch: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html[data-mode="dispatch"] .roster-head h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
}

html[data-mode="dispatch"] .schedule-title,
html[data-mode="dispatch"] .people-title,
html[data-mode="dispatch"] .news-title {
  color: var(--amber);
  font-size: 12.5px;
}

/* The sheet lists the trains, so the side panel doesn't have to (on a phone the sheet is hidden and it still does). */
@media (min-width: 761px) {
  html[data-mode="dispatch"] .schedule-title,
  html[data-mode="dispatch"] .trains,
  html[data-mode="dispatch"] #no-trains {
    display: none;
  }

  html[data-mode="dispatch"] .sheet {
    display: flex;
  }
}

.sheet {
  grid-column: 1;
  grid-row: 2;
  flex-direction: column;
  min-width: 0;
  max-height: min(34vh, 320px);
  border-top: 2px solid var(--line-strong);
  background: #080b0d;
  font-family: var(--mono);
}

.sheet[hidden] {
  display: none !important;
}

.sheet-head {
  display: flex;
  flex: none;
  align-items: baseline;
  gap: 14px;
  padding: 10px 18px 8px;
  border-bottom: 1px solid var(--line);
}

.sheet-head h2 {
  margin: 0;
  color: var(--amber);
  font: 700 13px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-count {
  color: var(--haze);
  font-size: 12.5px;
}

.sheet-key {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--dim);
  font-size: 12px;
  white-space: nowrap;
}

.sheet-key i {
  width: 14px;
  height: 4px;
  margin-left: 10px;
  border-radius: 2px;
  background: var(--dim);
}

.sheet-key i[data-tone="red"] { background: var(--red); }
.sheet-key i[data-tone="green"] { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.sheet-key i[data-tone="amber"] { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }

.sheet-scroll {
  min-height: 0;
  overflow: auto;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.3;
}

.sheet-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 7px 12px;
  background: #0c1113;
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.sheet-table thead th:first-child,
.sheet-table tbody th {
  padding-left: 18px;
}

.sheet-table td,
.sheet-table tbody th {
  padding: 6px 12px;
  border-top: 1px solid var(--line);
  color: var(--haze);
  font-weight: 400;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.sheet-table tbody th {
  padding-left: 18px;
}

.sheet-table td.sheet-notes,
.sheet-table td.sheet-to {
  min-width: 130px;
  white-space: normal;
}

.sheet-notes[data-tone="red"] { color: var(--red); }
.sheet-notes[data-tone="amber"] { color: var(--amber); }

.sheet-table tr[data-moving="true"] .sheet-speed {
  color: var(--green);
  font-weight: 700;
}

.sheet-table tr[data-followed="true"] {
  background: rgba(255, 207, 63, 0.08);
}

.sheet-train {
  display: grid;
  gap: 1px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--moon);
  font: 700 13.5px/1.3 var(--mono);
  text-align: left;
  cursor: pointer;
}

.sheet-train small {
  color: var(--cyan);
  font-size: 11.5px;
  font-weight: 400;
}

.sheet-train:hover span,
.sheet-train[aria-pressed="true"] span {
  color: var(--amber);
  text-decoration: underline;
}

.sheet-empty {
  margin: 0;
  padding: 16px 18px;
  color: var(--dim);
  font-size: 13px;
}

html[data-mode="dispatch"] .desk {
  display: block;
}

.desk {
  margin: 14px 18px 4px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #050708;
  font-family: var(--mono);
}

.desk[hidden] {
  display: none !important;
}

.desk-clock {
  min-height: 1.1em;
  margin: 0 0 12px;
  color: var(--green);
  font: 700 26px/1.1 var(--mono);
  letter-spacing: 0.04em;
  text-shadow: 0 0 14px rgba(54, 240, 124, 0.35);
}

.desk-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 10px;
}

.desk-label {
  color: var(--amber);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.desk-air {
  min-width: 0;
  color: var(--haze);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.desk-air[data-live="true"] {
  color: var(--red);
  font-weight: 700;
}

.desk-listen,
.desk-key {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #10171a;
  color: var(--moon);
  font: 700 13px/1.2 var(--mono);
  cursor: pointer;
}

.desk-listen {
  width: 100%;
  padding: 10px 12px;
}

.desk-listen[aria-pressed="true"] {
  border-color: var(--green);
  background: rgba(54, 240, 124, 0.12);
  color: var(--green);
}

.desk-channels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.desk-channels[hidden] {
  display: none;
}

.desk-key {
  display: grid;
  gap: 2px;
  min-height: 46px;
  padding: 6px 4px;
  place-items: center;
  place-content: center;
}

.desk-key b {
  font-size: 15px;
}

.desk-key span {
  max-width: 100%;
  overflow: hidden;
  color: var(--haze);
  font-size: 10.5px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desk-key span:empty {
  display: none;
}

.desk-key[aria-pressed="true"] {
  border-color: var(--amber);
  background: rgba(255, 207, 63, 0.14);
  color: var(--amber);
}

.desk-key:disabled {
  cursor: default;
  opacity: 0.55;
}

.desk-listen:hover,
.desk-key:hover:not(:disabled) {
  border-color: var(--amber);
}

/* With the keys there, the channel list above them would say the same thing twice. */
html[data-mode="dispatch"] .talk-channel {
  display: none;
}
