/* Subway: station screen, ride overlay, arrival panel. MTA signage crossed with chunky cartoon stickers. */

/* ---------- bullets ---------- */
.sw-bul {
  display: inline-grid;
  place-items: center;
  width: 2em; height: 2em;
  border-radius: 50%;
  background: var(--c, #666);
  color: var(--t, #fff);
  font: 700 1em/1 var(--font);
  font-size: 18px;
  flex: none;
  vertical-align: middle;
}
.sw-bul.two { font-size: 14px; letter-spacing: -0.5px; }
.sw-bul.sm { font-size: 9px; width: 1.9em; height: 1.9em; margin-right: 2px; }
.sw-bul.sm.two { font-size: 7px; }
.sw-bul.big { font-size: 26px; }
.sw-bul.big.two { font-size: 19px; }

/* ---------- station screen ---------- */
.sw-modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(10, 12, 28, 0.62);
  backdrop-filter: blur(2px);
}
.sw-modal[hidden] { display: none; }
.sw-panel {
  width: min(1180px, 97vw);
  height: min(740px, 95vh);
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
  font-family: var(--font);
}
.sw-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: #1a1a1a;
  border-bottom: 3px solid var(--ink);
}
.sw-sign {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 14px;
  color: #fff;
}
.sw-sign-name {
  font: 700 clamp(20px, 2.6vw, 30px)/1.1 var(--font);
  letter-spacing: -0.5px;
  min-width: 0;
}
.sw-sign-name.long { font-size: clamp(16px, 2vw, 22px); }
.sw-sign-bul { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; flex: none; max-width: 52%; }
.sw-sign-bul .sw-bul { font-size: 15px; }
.sw-sign-bul .sw-bul.two { font-size: 11px; }
.sw-x {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid #fff; background: transparent; color: #fff;
  font-size: 16px; cursor: pointer;
}
.sw-x:hover { background: var(--hot); border-color: var(--hot); }

.sw-body {
  display: grid;
  grid-template-columns: 188px minmax(290px, 360px) 1fr;
  min-height: 0;
}
.sw-modal[data-n="few"] .sw-body { grid-template-columns: 112px minmax(290px, 380px) 1fr; }
.sw-modal[data-n="some"] .sw-body { grid-template-columns: 150px minmax(290px, 360px) 1fr; }
@media (max-width: 1150px) { .sw-modal[data-n="many"] .sw-body { grid-template-columns: 170px minmax(270px, 320px) 1fr; } }

/* route buttons */
.sw-routes {
  padding: 12px 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: min-content;
  gap: 8px 4px;
  justify-items: center;
  align-content: start;
  background: #eee6cd;
  border-right: 3px solid var(--ink);
  overflow-y: auto;
}
.sw-modal[data-n="few"] .sw-routes { grid-template-columns: 1fr; gap: 14px; padding-top: 18px; }
.sw-modal[data-n="some"] .sw-routes { grid-template-columns: repeat(2, 1fr); gap: 12px 4px; }
.sw-rb {
  border: 0; padding: 3px; background: none; cursor: pointer; border-radius: 50%;
  transition: transform 0.12s;
}
.sw-rb .sw-bul { font-size: 20px; border: 3px solid transparent; box-sizing: content-box; }
.sw-rb .sw-bul.two { font-size: 15px; }
.sw-modal[data-n="few"] .sw-rb .sw-bul { font-size: 30px; }
.sw-modal[data-n="few"] .sw-rb .sw-bul.two { font-size: 22px; }
.sw-modal[data-n="some"] .sw-rb .sw-bul { font-size: 26px; }
.sw-rb:hover { transform: scale(1.1); }
.sw-rb.on .sw-bul { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.sw-rb.on { transform: scale(1.14); }

/* strip map */
.sw-strip {
  display: flex; flex-direction: column; min-height: 0;
  border-right: 3px solid var(--ink);
  background: #fff;
}
.sw-note {
  padding: 8px 12px;
  background: var(--yolk);
  border-bottom: 3px solid var(--ink);
  font-size: 13px; line-height: 1.35; font-weight: 600;
}
.sw-note .alt { display: block; margin-top: 3px; font-weight: 600; font-size: 12px; opacity: 0.85; }
.sw-note .tip { display: block; margin-top: 3px; font-weight: 700; color: #7a2300; }
.sw-note .sw-bul.sm { font-size: 8px; }
.sw-line-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--c, #333);
  color: var(--t, #fff);
  border-bottom: 3px solid var(--ink);
}
.sw-line-head .sw-bul { background: #fff; color: var(--c); outline: 3px solid var(--ink); font-size: 22px; }
.sw-line-head .sw-bul.two { font-size: 16px; }
.sw-line-head b { display: block; font-size: 15px; }
.sw-line-head > div span { display: block; font-size: 11px; opacity: 0.9; }
.sw-line-head > div { min-width: 0; }
.sw-list {
  list-style: none; margin: 0; padding: 0;
  overflow-y: auto; flex: 1; min-height: 0;
  position: relative;
}
.sw-end {
  padding: 6px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
  color: #666; background: #f3f0e6; border-bottom: 1px solid #ddd;
}
.sw-end b { color: var(--ink); }
.sw-row {
  display: grid;
  grid-template-columns: 34px 1fr auto auto;
  align-items: center;
  min-height: 38px;
  cursor: pointer;
  position: relative;
  border-bottom: 1px solid #f0ede2;
  font-size: 14px; font-weight: 600;
}
.sw-row:hover { background: #fff6d0; }
.sw-row.sel { background: #ffe680; box-shadow: inset 4px 0 0 var(--ink); }
.sw-row.here { cursor: default; background: #fff; }
.sw-track { align-self: stretch; position: relative; }
.sw-track::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 10px; margin-left: -5px;
  background: var(--c);
}
.sw-row.top .sw-track::before { top: 50%; border-radius: 5px 5px 0 0; }
.sw-row.bot .sw-track::before { bottom: 50%; border-radius: 0 0 5px 5px; }
.sw-dot {
  position: absolute; left: 50%; top: 50%;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #fff; border: 3px solid var(--ink);
  box-sizing: border-box;
}
.sw-row.xfer .sw-dot { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
.sw-row.here .sw-dot { width: 24px; height: 24px; margin: -12px 0 0 -12px; background: var(--yolk); border-width: 4px; }
.sw-row.sel .sw-dot { background: var(--hot); }
.sw-nm { padding: 4px 6px 4px 4px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sw-n { line-height: 1.15; }
.sw-you {
  align-self: flex-start;
  background: var(--ink); color: var(--yolk);
  font-size: 10px; letter-spacing: 0.8px; padding: 2px 6px; border-radius: 4px;
}
.sw-star {
  align-self: flex-start;
  font-style: normal; font-size: 11px; font-weight: 700;
  background: var(--hot); color: #fff; padding: 2px 6px; border-radius: 4px;
  line-height: 1.25;
}
.sw-star.soft { background: #f1d9e6; color: #8a1d55; }
.sw-tx { display: flex; flex-wrap: wrap; justify-content: flex-end; max-width: 92px; padding: 0 2px; }
.sw-cnt { font-size: 11px; font-weight: 600; color: #888; padding: 0 10px 0 4px; min-width: 52px; text-align: right; }
.sw-row.sel .sw-cnt { color: var(--ink); }
.sw-empty { padding: 20px; color: #888; }

/* system map */
.sw-map { position: relative; min-width: 0; min-height: 0; background: #141a33; }
.sw-map canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sw-legend {
  position: absolute; left: 10px; top: 10px;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 9px; border-radius: 6px; pointer-events: none;
}
.sw-legend:empty { display: none; }
.sw-star-ic { color: var(--hot); }

/* footer */
.sw-foot {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px;
  background: #1a1a1a; color: #fff;
  border-top: 3px solid var(--ink);
}
.sw-info { flex: 1; min-width: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sw-info .sw-bul { font-size: 11px; }
.sw-info .sw-bul.two { font-size: 9px; }
.sw-sum { color: var(--yolk); font-weight: 700; }
.sw-keys { font-size: 12px; color: #bbb; white-space: nowrap; }
@media (max-width: 1150px) { .sw-keys { display: none; } }
.sw-keys kbd, .sa-btns kbd {
  display: inline-block; font: 700 11px var(--font);
  background: #fff; color: var(--ink); border-radius: 4px; padding: 1px 5px; margin: 0 2px;
  border-bottom: 2px solid #999;
}
.sw-ride {
  font: 700 18px var(--font-display);
  background: var(--yolk); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 12px;
  padding: 8px 20px; cursor: pointer;
  box-shadow: 3px 3px 0 #000;
}
.sw-ride:hover:not(:disabled) { background: var(--hot); color: #fff; }
.sw-ride:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
.sw-ride:disabled { opacity: 0.4; cursor: default; }

/* ---------- the ride ---------- */
.sw-train {
  position: fixed; inset: 0; z-index: 55;
  background: #0b0d18;
  overflow: hidden;
  animation: rc-in 0.35s ease-out both;
  color: #fff;
}
@keyframes rc-in { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
.rc-car {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: linear-gradient(#cfd4d6 0, #b7bec0 100%);
  animation: rc-rumble 0.18s linear infinite;
}
.stopped .rc-car, .paused .rc-car { animation: none; }
@keyframes rc-rumble { 0%,100% { transform: translate(0,0); } 25% { transform: translate(1px,-1px); } 50% { transform: translate(-1px,1px); } 75% { transform: translate(1px,1px); } }
.rc-ceiling {
  flex: none; height: 22vh; min-height: 130px;
  background: linear-gradient(#e9ecec, #cfd5d6);
  border-bottom: 6px solid #8b9496;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 1.4vh 4vw 1.2vh;
  position: relative; z-index: 3;
}
.rc-strip {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 3px solid #12162a; border-radius: 12px;
  padding: 8px 22px 22px 14px; height: 56%; min-height: 62px;
  color: #12162a;
}
.rs-map { position: relative; flex: 1; height: 100%; margin: 0 8%; }
.rs-line { position: absolute; left: 0; right: 0; top: 40%; height: 10px; margin-top: -5px; background: #cfcfcf; border-radius: 5px; overflow: hidden; }
.rs-fill { height: 100%; width: 0; background: var(--c); }
.rs-dot {
  position: absolute; top: 40%; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%; background: #fff; border: 3px solid #12162a; box-sizing: border-box;
}
.rs-dot.passed { background: var(--c); }
.rs-train {
  position: absolute; top: 40%; z-index: 2; left: 0;
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border-radius: 50%; background: var(--yolk); border: 3px solid #12162a;
  display: grid; place-items: center; font-size: 20px;
}
.rs-end { position: absolute; top: 82%; font: 700 clamp(11px, 1.3vw, 14px) var(--font); white-space: nowrap; }
.rs-end.l { left: 0; transform: translateX(-30%); }
.rs-end.r { right: 0; transform: translateX(30%); }
.rc-led {
  align-self: center;
  background: #050505; border: 3px solid #333; border-radius: 8px;
  padding: 6px 22px; margin-top: 0.8vh;
  display: flex; align-items: baseline; gap: 16px;
  font-family: "Courier New", ui-monospace, monospace; font-weight: 700;
  color: #ffa51f; text-shadow: 0 0 8px rgba(255,165,31,0.8);
  max-width: 92vw;
}
.rc-led-k { font-size: clamp(11px, 1.3vw, 14px); opacity: 0.8; white-space: nowrap; }
.rc-led-v { font-size: clamp(18px, 2.8vw, 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.delay .rc-led-v { animation: rc-blink 0.8s steps(2) infinite; }
@keyframes rc-blink { 50% { opacity: 0.3; } }

.rc-wall {
  position: relative; flex: none; height: 33vh; min-height: 170px;
  display: flex; justify-content: space-evenly; align-items: center;
  background: repeating-linear-gradient(90deg, #c2c9cb 0 3px, #cdd3d5 3px 40px);
  padding: 0 3vw;
  z-index: 1;
}
.rc-win {
  position: relative; width: 28%; height: 76%;
  border: 8px solid #8b9496; border-radius: 14px;
  background: linear-gradient(#05060d, #101426);
  overflow: hidden;
  box-shadow: inset 0 0 22px #000, 0 3px 0 #6c7476;
}
.rc-lights { position: absolute; left: 0; width: 200%; background-repeat: repeat-x; }
.rc-lights.a { top: 22%; height: 7px; background-image: repeating-linear-gradient(90deg, #ffe9a8 0 46px, transparent 46px 190px); box-shadow: 0 0 12px #ffe9a8; animation: rc-streak 0.45s linear infinite; }
.rc-lights.b { top: 50%; height: 4px; background-image: repeating-linear-gradient(90deg, rgba(150,190,255,0.8) 0 22px, transparent 22px 120px); animation: rc-streak 0.28s linear infinite; }
.rc-lights.c { top: 78%; height: 12px; background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.12) 0 60px, transparent 60px 240px); animation: rc-streak 0.7s linear infinite; }
@keyframes rc-streak { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.stopped .rc-lights, .paused .rc-lights { animation-play-state: paused; opacity: 0; }
.rc-lights { transition: opacity 0.2s; }
.rc-platform {
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.2s;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(0,0,0,0.5) 18% 22%, transparent 22% 58%, rgba(0,0,0,0.5) 58% 62%, transparent 62%),
    linear-gradient(#6b8a7c 0 62%, #3d4b52 62% 66%, #8c8f93 66%);
  display: grid; place-items: center;
}
.rc-tile {
  background: #111; color: #fff; border: 2px solid #fff; border-radius: 3px;
  font: 700 clamp(11px, 1.5vw, 17px) var(--font); padding: 4px 8px; max-width: 90%; text-align: center; line-height: 1.15;
  opacity: 0;
}
.dwell .rc-platform { opacity: 1; }
.dwell .rc-tile { opacity: 1; }
.delay .rc-platform { opacity: 0.55; background: linear-gradient(#05060d, #0a0c18); }
.rc-pole {
  position: absolute; top: -6px; bottom: -12px; width: 12px; border-radius: 6px;
  background: linear-gradient(90deg, #8e97a3, #f3f6fa 40%, #8e97a3);
  border: 2px solid #59616f; z-index: 2;
}
.rc-pole.p1 { left: 36%; }
.rc-pole.p2 { left: 68%; }
.rc-seats {
  position: relative; flex: none; height: 14vh; min-height: 80px;
  display: flex; justify-content: space-evenly; align-items: flex-end;
  background: #aab2b4;
  z-index: 1;
}
.rc-seat {
  width: 27%; height: 78%;
  background: linear-gradient(#ff9a1f 0 38%, #f2780c 38% 100%);
  border: 4px solid #8a4300; border-bottom: 0; border-radius: 22px 22px 0 0;
  position: relative;
  box-shadow: inset 0 -14px 0 rgba(0,0,0,0.12);
}
.rc-seat::after {
  content: ""; position: absolute; left: 6%; right: 6%; top: 52%; height: 6px; border-radius: 3px;
  background: #ffd23f; opacity: 0.8;
}
.rc-seat:nth-child(2n) { background: linear-gradient(#ffd23f 0 38%, #f5b700 38% 100%); border-color: #8a5a00; }
.rc-floor {
  flex: 1; min-height: 0;
  background: repeating-linear-gradient(90deg, #6d7173 0 70px, #656a6c 70px 140px);
  border-top: 8px solid #4a4f51;
  box-shadow: inset 0 14px 20px rgba(0,0,0,0.3);
}
.rc-chuck-wrap {
  position: absolute; left: 50%; bottom: 11vh; z-index: 2;
  width: min(31vh, 270px);
  transform: translateX(-62%);
  filter: drop-shadow(0 6px 0 rgba(0,0,0,0.25));
}
.rc-chuck { display: block; width: 100%; height: auto; overflow: visible; transform-origin: 50% 96%; animation: rc-sway 1.15s ease-in-out infinite alternate; }
@keyframes rc-sway { from { transform: rotate(-4deg) translateX(-4px); } to { transform: rotate(4deg) translateX(4px); } }
.stopped .rc-chuck { animation-duration: 2.4s; }
.paused .rc-chuck, .paused .rc-prop { animation-play-state: paused; }
.rc-prop { transform-box: view-box; transform-origin: 110px 24px; animation: rc-prop 0.28s linear infinite; }
@keyframes rc-prop { 0%,100% { transform: scaleX(1); } 50% { transform: scaleX(0.12); } }
.rc-pupil { animation: rc-look 3.4s ease-in-out infinite alternate; }
@keyframes rc-look { from { transform: translateX(-3px); } to { transform: translateX(4px); } }
.rc-ann {
  position: absolute; left: 50%; bottom: 2.4vh; z-index: 4; transform: translateX(-50%);
  width: min(720px, 90vw);
  background: #fff8e7; color: var(--ink);
  border: 3px solid #12162a; border-radius: 14px; box-shadow: 4px 4px 0 #12162a;
  padding: 10px 16px; font: 600 clamp(13px, 1.6vw, 17px)/1.35 var(--font);
  display: flex; gap: 10px; align-items: center;
}
.rc-ann.pop { animation: rc-pop 0.35s ease-out; }
@keyframes rc-pop { from { transform: translateX(-50%) scale(0.92); opacity: 0.2; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.rc-spk { font-size: 22px; }
.rc-eta {
  position: absolute; right: 3vw; bottom: 3vh; z-index: 4;
  background: #12162a; color: var(--yolk); font: 700 16px var(--font-display);
  padding: 4px 12px; border-radius: 999px; border: 2px solid #fff;
}
.doors .rc-wall::before, .doors .rc-wall::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 18%; z-index: 3;
  background: rgba(0,0,0,0.14);
  animation: rc-door 0.5s ease-in-out infinite alternate;
}
.doors .rc-wall::before { left: 0; }
.doors .rc-wall::after { right: 0; }
@keyframes rc-door { from { transform: translateX(0); } to { transform: translateX(8px); } }

/* ---------- arrival panel ---------- */
.sw-arrive {
  position: fixed; left: 50%; bottom: 120px; z-index: 50;
  transform: translateX(-50%);
  width: min(430px, 92vw);
  background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 16px; box-shadow: 5px 5px 0 var(--ink);
  padding: 12px 14px 0; overflow: hidden;
  animation: sa-in 0.3s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes sa-in { from { transform: translateX(-50%) translateY(30px) scale(.9); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
.sa-top { display: flex; align-items: center; gap: 10px; }
.sa-ic { font-size: 30px; }
.sa-top > div { flex: 1; min-width: 0; }
.sa-top small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #777; }
.sa-top b { display: block; font: 700 20px/1.15 var(--font-display); }
.sa-btns { display: flex; gap: 8px; margin: 10px 0 12px; }
.sa-btns button {
  flex: 1; font: 700 15px var(--font-display); color: var(--ink);
  background: var(--yolk); border: 3px solid var(--ink); border-radius: 12px; padding: 9px 8px; cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.sa-btns .sa-xfer { background: #fff; }
.sa-btns button:hover { background: var(--hot); color: #fff; }
.sa-btns button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.sa-xb { display: inline-flex; }
.sa-bar { height: 7px; margin: 0 -14px; background: #e6dcc0; }
.sa-bar i { display: block; height: 100%; background: var(--leaf); transform-origin: left; }
