/* BART SIM — near-black blue panels, white CAPS, yellow-line accents.
   Big couch-readable type; no emojis on kid surfaces. */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: #0d1524; }
body { font-family: "Helvetica Neue", Arial, sans-serif; user-select: none; }
#view, #view canvas { position: fixed; inset: 0; }

/* bart.gov language: black header bar, white type, #0064a8 interactive blue,
   the white-rounded-square "ba" logo with the sky-blue a (#0099d8) */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 52px;
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: rgba(8, 8, 10, 0.95); color: #fff;
  font-weight: 800; letter-spacing: 0.06em; z-index: 10;
}
#logo {
  background: #fff; border-radius: 9px; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-size: 27px; font-weight: 900; letter-spacing: -0.06em;
  line-height: 1; padding-bottom: 3px; text-transform: lowercase;
}
#logo .b { color: #101010; }
#logo .a { color: #0099d8; }
#title { font-size: 20px; }
#line-pill {
  background: #ffe802; color: #101010; border-radius: 999px;
  padding: 4px 14px; font-size: 13px;
}
#trips { font-size: 13px; opacity: 0.8; }
.spacer { flex: 1; }
#speed { font-size: 18px; font-variant-numeric: tabular-nums; }
#topbar button {
  background: #0064a8; color: #fff; border: 0;
  border-radius: 8px; padding: 8px 14px; font-weight: 800;
  font-size: 13px; letter-spacing: 0.06em; cursor: pointer;
}
#topbar button:hover { background: #0a76bf; }
#pa-btn.off { background: #2a2e35; color: #6c7480; }

/* ?dev=1 strip — dev-only, revealed by main.js */
#devbar {
  position: fixed; bottom: 42px; left: 16px; z-index: 40;   /* clears the SAVE chip */
  display: flex; flex-wrap: wrap; gap: 4px; max-width: 46vw;
  align-items: center;
}
.dev-chip {
  background: #1d232c; color: #9fd4ff; border: 1px solid #33404f;
  border-radius: 6px; padding: 4px 8px; font-size: 11px; font-weight: 800;
  font-family: inherit; cursor: pointer; letter-spacing: 0.04em;
}
.dev-chip:hover { background: #29323e; }
#dev-readout { color: #9fd4ff; font-size: 11px; font-weight: 700; margin-left: 6px; }

/* the next-card IS a BART platform sign: black, white Helvetica, yellow bar */
#next-card {
  position: fixed; top: 68px; left: 16px; z-index: 10;
  background: rgba(10, 10, 12, 0.95); color: #fff;
  border: 2px solid #2c2c30; border-left: 6px solid #ffe802;
  border-radius: 12px; padding: 14px 20px; min-width: 300px;
}
#next-label { font-size: 13px; font-weight: 800; letter-spacing: 0.14em; color: #ffe802; }
#next-name { font-size: 40px; font-weight: 900; letter-spacing: 0.02em; line-height: 1.1; }
#sub-line { font-size: 15px; font-weight: 700; margin-top: 6px; min-height: 20px; color: #b9c4d8; }
#lamps { display: flex; gap: 8px; margin-top: 8px; }
#go-lamp, #close-lamp, #ato-lamp {
  padding: 4px 14px; border-radius: 999px; font-weight: 900; font-size: 14px;
  background: #16171b; color: #3f434c; transition: all 0.3s;
}
#go-lamp.lit { background: #2ea84f; color: #fff; box-shadow: 0 0 18px #2ea84f; }
#close-lamp.lit {
  background: #e88a1a; color: #fff; box-shadow: 0 0 16px #e88a1a;
  animation: lampflash 0.9s infinite;
}
#ato-lamp.lit { background: #0064a8; color: #fff; box-shadow: 0 0 14px #0099d8; }
@keyframes lampflash { 50% { opacity: 0.45; } }

#seat-card {
  position: fixed; top: 68px; right: 16px; z-index: 10;
  background: rgba(10, 10, 12, 0.95); color: #fff;
  border: 2px solid #2c2c30; border-radius: 12px; padding: 10px 14px;
  font-size: 13px; font-weight: 700;
}
#seat-title { color: #0099d8; font-size: 11px; font-weight: 900; letter-spacing: 0.12em; margin-bottom: 4px; }
.hint { display: flex; gap: 10px; padding: 2px 0; }
.ctl { color: #ffe802; width: 52px; font-weight: 900; }

#pad {
  position: fixed; right: 16px; bottom: 16px; z-index: 10;
  display: grid; grid-template-columns: repeat(3, 64px); gap: 6px;
}
.pad-cell {
  position: relative;
  height: 52px; border-radius: 10px; background: rgba(13, 21, 36, 0.9);
  border: 2px solid #334770; color: #e8ecf2; font-size: 11px;
  font-weight: 800; display: flex; align-items: center; justify-content: center;
  letter-spacing: 0.04em; flex-direction: column; gap: 2px; cursor: pointer;
}
.pad-cell:hover { background: rgba(24, 36, 58, 0.95); border-color: #4a63a0; }
.pad-cell:active { transform: scale(0.94); }
.pad-num {
  position: absolute; top: 2px; left: 5px; font-size: 8px; font-weight: 900;
  color: #5c6a85; pointer-events: none;
}
#pad-cap {
  grid-column: 1 / -1; text-align: center; color: #7e8aa3;
  font-size: 9px; font-weight: 800; letter-spacing: 0.1em; padding-bottom: 2px;
}
.pad-pill {
  font-size: 8px; font-weight: 900; letter-spacing: 0.06em;
  padding: 1px 7px; border-radius: 7px; background: #242e44; color: #8f9bb3;
}
.pad-pill.on { background: #2ea84f; color: #eafff0; }
.pad-pill.mid { background: #e88a1a; color: #fff3e0; }
.pad-cell.glow { border-color: #ffe802; color: #ffe802; box-shadow: 0 0 10px rgba(255, 230, 0, 0.5); }
.pad-cell.blue { background: #0d3b66; border-color: #1b6aa8; color: #cfe8ff; }
.pad-cell.blue.flash { animation: lampflash 0.9s infinite; border-color: #e88a1a; }

/* cab-view windshield: on-screen wiper + rain on the glass */
#windshield { position: fixed; inset: 0; z-index: 5; pointer-events: none; display: none; overflow: hidden; }
#windshield.show { display: block; }
#wiper {
  position: absolute; bottom: -5vh; left: 50%; width: 10px; height: 54vh;
  margin-left: -5px; transform-origin: bottom center; border-radius: 6px;
  background: linear-gradient(#4a5058, #2a2e34);
}
#wiper-blade {
  position: absolute; top: 0; left: -3px; width: 16px; height: 55%;
  background: #22262b; border-radius: 8px;
}
.drop {
  position: absolute; width: 7px; height: 9px; border-radius: 50% 50% 60% 60%;
  background: rgba(190, 215, 240, 0.4);
  box-shadow: inset 1px 2px 3px rgba(255, 255, 255, 0.5);
}

/* the stop gauge — distance-to-marker meter (train-sim style) */
#stop-gauge {
  position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%);
  width: 380px; background: rgba(10, 10, 12, 0.95); border: 2px solid #2c2c30;
  border-radius: 12px; padding: 10px 16px 14px; z-index: 15; display: none;
}
#stop-gauge.show { display: block; }
#sg-label { color: #ffe802; font-size: 11px; font-weight: 900; letter-spacing: 0.12em; margin-bottom: 6px; }
#sg-bar { position: relative; height: 14px; background: #1c2028; border-radius: 7px; overflow: hidden; }
#sg-window { position: absolute; top: 0; bottom: 0; background: rgba(46, 168, 79, 0.55); }
#sg-needle {
  position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px;
  background: #fff; border-radius: 2px; transition: left 0.08s linear;
}
#sg-num {
  text-align: center; color: #fff; font-size: 24px; font-weight: 900;
  margin-top: 6px; font-variant-numeric: tabular-nums;
}
#stop-gauge.good #sg-num { color: #4fe07a; }
#stop-gauge.good { border-color: #2ea84f; }
#stop-gauge.over #sg-num { color: #ff6b57; }
#stop-gauge.over { border-color: #a83a2e; }
#code-chip { font-size: 12px; font-weight: 800; color: #9fd4ff; letter-spacing: 0.08em; }
#clock-chip { width: 54px; height: 26px; }

#banner {
  position: fixed; top: 30%; left: 50%; transform: translate(-50%, -50%) scale(0.9);
  background: rgba(13, 21, 36, 0.94); color: #fff; border: 3px solid #ffe802;
  border-radius: 20px; padding: 22px 44px; font-size: 44px; font-weight: 900;
  letter-spacing: 0.03em; opacity: 0; pointer-events: none; z-index: 20;
  transition: opacity 0.35s, transform 0.35s; text-align: center; max-width: 80vw;
}
#banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: rgba(13, 21, 36, 0.94); color: #ffe802; border: 2px solid #ffe802;
  border-radius: 999px; padding: 10px 26px; font-size: 18px; font-weight: 800;
  opacity: 0; pointer-events: none; z-index: 20; transition: all 0.3s;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* help screen — same panel language as the map board */
#help-overlay {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(13, 21, 36, 0.96); border: 3px solid #334770;
  border-radius: 20px; padding: 26px 36px 22px; z-index: 32;
  display: none; color: #e8ecf2; cursor: pointer;
}
#help-overlay.show { display: block; }
#help-title { color: #ffe802; font-weight: 900; font-size: 20px; letter-spacing: 0.14em; margin-bottom: 18px; }
#help-cols { display: flex; gap: 44px; }
.help-head { color: #0099d8; font-size: 11px; font-weight: 900; letter-spacing: 0.12em; margin-bottom: 10px; }
.h-row { display: flex; gap: 12px; padding: 3px 0; font-size: 13px; font-weight: 700; }
.hk { color: #ffe802; width: 108px; font-weight: 900; flex-shrink: 0; }
#help-close { color: #5c6675; font-size: 10px; font-weight: 800; letter-spacing: 0.12em; margin-top: 18px; text-align: center; }

#map-overlay {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(13, 21, 36, 0.96); border: 3px solid #334770;
  border-radius: 20px; padding: 28px 36px 40px; z-index: 30;
  display: none; min-width: 760px;
}
#map-overlay.show { display: block; }
#map-title { color: #ffe802; font-weight: 900; font-size: 18px; letter-spacing: 0.14em; }
#map-sub { color: #5c6675; font-weight: 800; font-size: 11px; letter-spacing: 0.14em; margin: 4px 0 26px; }
#map-bar { position: relative; height: 8px; background: #ffe802; border-radius: 4px; margin: 0 20px; }
#map-stops { position: absolute; inset: 0; display: flex; justify-content: space-between; }
.map-stop { position: relative; width: 0; }
.map-stop .dot {
  position: absolute; top: -5px; left: -9px; width: 18px; height: 18px;
  border-radius: 50%; background: #0d1524; border: 4px solid #7a7f8c;
}
.map-stop.lit .dot { border-color: #fff; background: #ffe802; box-shadow: 0 0 8px #ffe802; }
.map-stop .nm {
  position: absolute; top: 22px; left: 0; transform: translateX(-50%) rotate(28deg);
  transform-origin: top center; color: #e8ecf2; font-size: 11px; font-weight: 800;
  white-space: nowrap; letter-spacing: 0.05em;
}
.map-stop.lit .nm { color: #ffe802; }
/* the OCC board's train symbol — red ("each red line is 1,000 people") */
#map-train {
  position: absolute; top: -26px; margin-left: -9px; color: #ff5540;
  font-size: 18px; line-height: 1; transition: left 0.2s linear;
  text-shadow: 0 0 8px rgba(255, 85, 64, 0.8);
}
