.bs-game {
  --bs-ink: #182f2a;
  --bs-mute: #3c5c52;
  --bs-line: #c7d6ce;
  --bs-green: #285d48;
  --bs-yellow: #ffd468;
  color: var(--bs-ink);
  background: #f0f4eb;
  border: 1px solid var(--bs-line);
  border-radius: 24px;
  padding: clamp(10px, 1.8vw, 22px);
}
.bs-game [hidden] { display: none; }
.bs-top, .bs-gauges, .bs-counter, .bs-stop-head, .bs-actions {
  display: flex;
  align-items: center;
}
.bs-top {
  justify-content: space-between;
  gap: 12px;
  padding-block-end: 14px;
}
.bs-picker {
  display: grid;
  gap: 3px;
  min-width: 0;
  font-size: .76rem;
  font-weight: 750;
}
.bs-select {
  min-height: 44px;
  max-width: 100%;
  padding: 6px 9px;
  color: var(--bs-ink);
  background: #fffdf5;
  border: 1px solid #a6b9ad;
  border-radius: 9px;
  font-size: .96rem;
  font-weight: 800;
}
.bs-gauges { gap: 6px; flex-wrap: wrap; justify-content: end; }
.bs-counter {
  gap: 6px;
  min-height: 37px;
  padding: 5px 8px;
  border: 1px solid #b7cbbf;
  border-radius: 9px;
  background: #e6eee1;
  font-size: .78rem;
  white-space: nowrap;
}
.bs-counter b { color: #1e523d; font-variant-numeric: tabular-nums; }
.bs-cell {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 10px;
  border: 1px solid #356950;
  border-radius: 2px;
  color: #285d48;
}
.bs-cell::before {
  position: absolute;
  left: 100%;
  width: 2px;
  height: 4px;
  content: '';
  background: currentColor;
}
.bs-cell i { width: 9px; height: 4px; border-radius: 1px; background: currentColor; }
.bs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  grid-template-areas: 'visual desk' 'manifest manifest';
  align-items: start;
  gap: 13px;
}
.bs-visual { grid-area: visual; min-width: 0; }
.bs-map {
  --bs-land-back: #9eb8a9;
  --bs-land-middle: #618e7b;
  --bs-land-front: #386d5f;
  --bs-water: #9bc7c3;
  --bs-sky: #bedece;
  position: relative;
  aspect-ratio: 1.7;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  border-radius: 16px;
  outline: 1px solid #619084;
  background: linear-gradient(170deg, #edf1d3, var(--bs-sky) 67%, #83aba0);
}
.bs-map[data-terrain=copper] {
  --bs-land-back: #c6b993;
  --bs-land-middle: #9b8863;
  --bs-land-front: #6b7755;
  --bs-water: #a3c5bd;
  --bs-sky: #e5d6ad;
}
.bs-map[data-terrain=above] {
  --bs-land-back: #aebac9;
  --bs-land-middle: #7c94a2;
  --bs-land-front: #537c86;
  --bs-water: #b4d2d5;
  --bs-sky: #d6e6e4;
}
.bs-land, .bs-mountains, .bs-river { position: absolute; inset: 0; }
.bs-sun {
  position: absolute;
  inset: 10% 13% auto auto;
  width: 11%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff3bd;
  box-shadow: 0 0 25px 8px #fffae594;
}
.bs-mountains {
  background: var(--bs-land-back);
  clip-path: polygon(0 39%, 10% 23%, 16% 19%, 34% 49%, 54% 17%, 61% 27%, 68% 25%, 85% 48%, 95% 36%, 100% 47%, 100% 100%, 0 100%);
}
.bs-mountains::before, .bs-mountains::after {
  position: absolute;
  inset: 0;
  content: '';
}
.bs-mountains::before {
  background: var(--bs-land-middle);
  clip-path: polygon(0 59%, 7% 45%, 22% 53%, 38% 41%, 56% 63%, 69% 44%, 82% 59%, 100% 48%, 100% 100%, 0 100%);
}
.bs-mountains::after {
  background: var(--bs-land-front);
  clip-path: polygon(0 76%, 19% 58%, 30% 71%, 50% 82%, 68% 62%, 85% 68%, 100% 67%, 100% 100%, 0 100%);
}
.bs-river {
  background: var(--bs-water);
  opacity: .67;
  clip-path: polygon(100% 57%, 100% 61%, 83% 66%, 69% 65%, 60% 72%, 59% 81%, 65% 88%, 60% 100%, 53% 100%, 59% 89%, 52% 82%, 54% 71%, 66% 62%, 82% 63%);
}
.bs-edge {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--run);
  height: 4px;
  transform: translateY(-50%) rotate(var(--slope));
  transform-origin: left center;
  border-radius: 6px;
  background: #e9ead4;
  border: 1px solid #36564a;
}
.bs-edge.bs-wood {
  height: 5px;
  background: repeating-linear-gradient(90deg, #f5d195 0 4px, #9f6949 5px 6px);
  border-color: #6e4530;
}
.bs-edge.bs-balance {
  height: 6px;
  background: repeating-linear-gradient(90deg, #9fe0d7 0 7px, #3b7b74 8px 9px);
  border-color: #27534e;
}
.bs-sign, .bs-pin, .bs-position { position: absolute; left: var(--x); top: var(--y); }
.bs-sign {
  transform: translate(-50%, -48%);
  padding: 1px 4px;
  border: 1px solid;
  border-radius: 4px;
  font-size: clamp(9px, 1.4vw, 13px);
  font-weight: 850;
  line-height: 1.1;
}
.bs-sign.bs-wood, .bs-road-mark.bs-wood { color: #693819; background: #ffdeb1; }
.bs-sign.bs-balance, .bs-road-mark.bs-balance { color: #154b43; background: #bdede3; }
.bs-pin {
  transform: translate(-50%, -5px);
  display: grid;
  justify-items: center;
  gap: 3px;
}
.bs-pin i {
  width: 10px;
  height: 10px;
  border: 2px solid #284f42;
  border-radius: 50%;
  background: #fffdf3;
  box-shadow: 0 0 0 1px #f4f6e9;
}
.bs-pin b {
  padding: 2px 4px;
  border-radius: 4px;
  color: #163b31;
  background: #f1f4e5;
  font-size: clamp(9px, 1.35vw, 13px);
  line-height: 1.12;
  white-space: nowrap;
}
.bs-pin.bs-wait i { background: #ffc46d; }
.bs-pin.bs-here b { background: #ffdc83; color: #41260f; }
.bs-position {
  transform: translate(-50%, calc(-100% - 6px));
  z-index: 2;
  transition: left .32s ease, top .32s ease;
}
.bs-position.bs-still { transition: none; }
.bs-van {
  position: relative;
  display: block;
  width: 29px;
  height: 17px;
  border: 1px solid #56451b;
  border-radius: 5px 6px 3px 3px;
  background: linear-gradient(#fff1bb 0 31%, var(--bs-yellow) 32% 67%, #daa84a 68% 78%, #f4ba45 79%);
  box-shadow: 0 2px 2px #14282064;
}
.bs-van::before, .bs-van::after {
  content: '';
  position: absolute;
  bottom: -4px;
  width: 6px;
  height: 6px;
  border: 1px solid #15251f;
  border-radius: 50%;
  background: #435a51;
}
.bs-van::before { left: 4px; }
.bs-van::after { right: 4px; }
.bs-van i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 6px;
  border-radius: 1px 4px 1px 1px;
  background: repeating-linear-gradient(90deg, #4c7b74 0 5px, #fff0bd 6px 7px);
}
.bs-hint {
  margin: 7px 0 0;
  color: var(--bs-mute);
  font-size: .84rem;
  line-height: 1.4;
}
.bs-desk, .bs-manifest {
  min-width: 0;
  padding: 12px;
  border: 1px solid #c7d6ce;
  border-radius: 14px;
  background: #fffdf6;
}
.bs-desk { grid-area: desk; }
.bs-manifest { grid-area: manifest; }
.bs-stop-head { gap: 9px; padding-block-end: 4px; }
.bs-stop-head .bs-van { flex: 0 0 29px; }
.bs-stop-head h2, .bs-manifest h2 { margin: 0; font-size: clamp(1rem, 1.8vw, 1.3rem); line-height: 1.3; }
.bs-status {
  margin: 5px 0 8px;
  color: #355b4b;
  font-size: .84rem;
  font-weight: 680;
  line-height: 1.35;
}
.bs-status:empty { margin: 0; }
.bs-complete .bs-status {
  padding: 9px;
  border-radius: 9px;
  background: #dcebd7;
  color: #20523b;
}
.bs-sec { margin-block: 9px; }
.bs-sec h3 { margin: 0 0 4px; font-size: .8rem; color: var(--bs-mute); }
.bs-choices, .bs-people { display: grid; gap: 5px; }
.bs-none { margin: 0; color: var(--bs-mute); font-size: .81rem; }
.bs-choice {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 6px 8px;
  text-align: start;
  border: 1px solid #b9cebc;
  border-radius: 8px;
  color: var(--bs-ink);
  background: #edf4e8;
}
.bs-choice:hover { border-color: #43856b; background: #e3f1e5; }
.bs-choice:active { border-color: #2e6655; background: #d6e9de; }
.bs-board { background: #fff1ca; border-color: #d9be78; }
.bs-board:hover { background: #ffebae; border-color: #a88237; }
.bs-blocked { background: #f5f0e5; border-style: dashed; border-color: #b5a992; }
.bs-blocked:hover { background: #ede6d4; border-color: #9b7b62; }
.bs-choice b, .bs-choice small, .bs-passenger b, .bs-passenger small { display: block; line-height: 1.25; overflow-wrap: anywhere; }
.bs-choice b, .bs-passenger b { font-size: .88rem; }
.bs-choice small, .bs-passenger small { font-size: .73rem; color: var(--bs-mute); }
.bs-road-mark {
  border: 1px solid #93a89d;
  border-radius: 5px;
  text-align: center;
  font-size: .78rem;
  font-weight: 850;
  background: #e0e9d9;
  padding: 2px;
}
.bs-riders {
  display: flex;
  justify-content: center;
  gap: 3px;
  min-width: 30px;
  color: #775325;
}
.bs-riders i { position: relative; width: 9px; height: 14px; }
.bs-riders i::before, .bs-riders i::after { position: absolute; content: ''; background: currentColor; }
.bs-riders i::before { width: 6px; height: 6px; inset: 0 1.5px auto; border-radius: 50%; }
.bs-riders i::after { inset: 7px 0 0; border-radius: 4px 4px 2px 2px; }
.bs-actions { gap: 6px; margin-top: 11px; flex-wrap: wrap; }
.bs-actions button, .bs-confirm button, .bs-file button {
  min-height: 44px;
  max-width: 100%;
  border: 1px solid #adbead;
  border-radius: 8px;
  padding: 5px 9px;
  background: #f3f6e9;
  color: var(--bs-ink);
  font-size: .83rem;
  font-weight: 730;
}
.bs-actions button:disabled { color: #52665e; border-color: #cbd2c7; background: #edf0e9; }
.bs-confirm button[data-kind=reset] { background: #ffe5d6; border-color: #c28d70; }
.bs-confirm, .bs-file { margin-block-start: 8px; border-radius: 8px; background: #f7f0da; padding: 7px; font-size: .82rem; }
.bs-confirm p, .bs-file p { margin: 0 0 3px; line-height: 1.35; }
.bs-manifest ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 7px 0 0; padding: 0; list-style: none; }
.bs-manifest li { display: flex; align-items: center; gap: 6px; min-height: 45px; padding: 5px; border: 1px solid #d3dfd2; border-radius: 7px; }
.bs-passenger { min-width: 0; flex: 1; }
.bs-manifest .bs-aboard { background: #fff1ca; border-color: #dbc278; }
.bs-manifest .bs-arrived { background: #e5f1e4; border-color: #bdd6c0; }
.bs-manifest .bs-arrived .bs-riders { color: #37694f; }
.bs-tag {
  max-width: 42%;
  border-radius: 5px;
  padding: 2px 4px;
  color: #2d5445;
  background: #e4ede3;
  font-size: .68rem;
  line-height: 1.2;
}
.bs-aboard .bs-tag { color: #60441e; background: #f8dfa0; }
.bs-arrived .bs-tag { color: #21563d; background: #cfe5ce; }

@media (max-width: 810px) {
  .bs-manifest ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 690px) {
  .bs-manifest ul { grid-template-columns: minmax(0, 1fr); }
  .bs-game { border-radius: 14px; }
  .bs-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'visual' 'desk' 'manifest'; gap: 8px; }
  .bs-top { align-items: end; gap: 5px; padding-block-end: 8px; }
  .bs-gauges { gap: 4px; padding-block-end: 2px; }
  .bs-counter { gap: 3px; padding: 4px; font-size: .71rem; }
  .bs-picker { font-size: .68rem; }
  .bs-select { padding: 4px 3px; font-size: .88rem; }
  .bs-cell { display: none; }
  .bs-desk, .bs-manifest { padding: 8px; }
}
@media (max-width: 420px) {
  /* Keep the Summit plate away from the adjacent load-limit sign. */
  .bs-pin[data-stop="summit"] b { position: absolute; left: 15px; top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bs-position { transition: none; }
}

.bs-road .bs-route-result { margin-block-start: 3px; color: #215e48; font-weight: 750; }
.bs-road .bs-route-stall { color: #8a3d2c; }
