:root {
  --traffic-ink: #17324d;
  --traffic-muted: #66788a;
  --traffic-sky: #e8f7fb;
  --traffic-teal: #15a99b;
  --traffic-teal-dark: #0d8178;
  --traffic-orange: #ff7657;
}

main.view-traffic-control > :not(.site-header):not(#traffic-control-trainer-screen) {
  display: none !important;
}

main.view-traffic-control {
  min-height: 100vh;
}

#traffic-control-trainer-screen {
  width: 100%;
  color: var(--traffic-ink);
}

#traffic-control-trainer-screen,
#traffic-control-trainer-screen * {
  box-sizing: border-box;
}

body.traffic-control-play-mode {
  overflow-x: hidden;
  background: #eef8fa;
}

body.traffic-control-play-mode .site-header,
body.traffic-control-play-mode .install-app-banner {
  display: none !important;
}

.trainer-tile-traffic .trainer-tile-art {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.58) 0 2px, transparent 3px),
    linear-gradient(145deg, #e4f8fd 0%, #b9e5f0 100%);
}

.traffic-card-art::before,
.traffic-card-art::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(41, 168, 122, .18);
}

.traffic-card-art::before {
  width: 72px;
  height: 72px;
  right: -24px;
  top: -28px;
}

.traffic-card-art::after {
  width: 50px;
  height: 50px;
  left: -17px;
  bottom: -20px;
}

.traffic-card-road {
  position: absolute;
  height: 14px;
  border: 3px solid #fff;
  border-radius: 20px;
  background: #355168;
  box-shadow: 0 3px 8px rgba(20, 59, 74, .18);
}

.traffic-card-road::after {
  content: "";
  position: absolute;
  inset: 4px 6px;
  border-top: 2px dashed rgba(255,255,255,.65);
}

.traffic-card-road-a {
  width: 120px;
  left: 17px;
  top: 50%;
  transform: rotate(18deg);
}

.traffic-card-road-b {
  width: 96px;
  right: 8px;
  top: 38%;
  transform: rotate(-48deg);
}

.traffic-card-switch {
  position: absolute;
  left: 48%;
  top: 42%;
  width: 28px;
  height: 28px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--traffic-teal);
  box-shadow: 0 5px 12px rgba(13, 129, 120, .34);
}

.traffic-card-switch::before {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-top: 3px solid #fff;
  border-right: 3px solid #fff;
  left: 6px;
  top: 5px;
  transform: rotate(45deg);
}

.traffic-card-car {
  position: absolute;
  width: 34px;
  height: 18px;
  border-radius: 7px 9px 5px 5px;
  border: 3px solid #fff;
  box-shadow: 0 4px 9px rgba(22, 59, 80, .25);
}

.traffic-card-car::before {
  content: "";
  position: absolute;
  width: 13px;
  height: 7px;
  left: 7px;
  top: -6px;
  border: 3px solid #fff;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: inherit;
}

.traffic-card-car i::before,
.traffic-card-car i::after {
  content: "";
  position: absolute;
  bottom: -5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #17324d;
}

.traffic-card-car i::before { left: 4px; }
.traffic-card-car i::after { right: 4px; }

.traffic-card-car-blue {
  left: 27px;
  top: 34px;
  background: #2f7df4;
  transform: rotate(18deg);
}

.traffic-card-car-pink {
  right: 25px;
  bottom: 30px;
  background: #f24e91;
  transform: rotate(-48deg);
}

.traffic-card-garage {
  position: absolute;
  right: 20px;
  top: 18px;
  display: grid;
  place-items: center;
  width: 33px;
  height: 28px;
  border: 3px solid #fff;
  border-radius: 8px 8px 5px 5px;
  background: #f24e91;
  color: #fff;
  font: 900 12px/1 system-ui, sans-serif;
  box-shadow: 0 5px 11px rgba(104, 39, 73, .22);
}

.traffic-card-garage::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -11px;
  width: 35px;
  height: 14px;
  background: #d93379;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  z-index: -1;
}

.traffic-setup-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 72px;
}

.traffic-back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  color: #6a7b8d;
  font: 800 15px/1.2 inherit;
  cursor: pointer;
  padding: 10px 3px;
}

.traffic-back::before {
  content: "";
  width: 9px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.traffic-back:hover { color: var(--traffic-teal-dark); }

.traffic-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  gap: 36px;
  align-items: center;
  overflow: hidden;
  min-height: 350px;
  margin-top: 15px;
  padding: 44px 54px;
  border-radius: 35px;
  background:
    radial-gradient(circle at 91% 5%, rgba(255,255,255,.55), transparent 35%),
    linear-gradient(135deg, #e5faf7 0%, #ccefeb 58%, #bde5e6 100%);
  box-shadow: 0 23px 60px rgba(26, 78, 97, .12);
}

.traffic-hero::before,
.traffic-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.traffic-hero::before {
  width: 240px;
  height: 240px;
  right: -82px;
  top: -110px;
  border: 38px solid rgba(255,255,255,.25);
}

.traffic-hero::after {
  width: 170px;
  height: 170px;
  left: 42%;
  bottom: -132px;
  border: 28px solid rgba(25,169,155,.10);
}

.traffic-hero-copy { position: relative; z-index: 2; }

.traffic-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--traffic-teal-dark);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.traffic-kicker i {
  position: relative;
  width: 24px;
  height: 18px;
  border-radius: 5px 7px 4px 4px;
  background: var(--traffic-teal);
}

.traffic-kicker i::before,
.traffic-kicker i::after {
  content: "";
  position: absolute;
  bottom: -4px;
  width: 7px;
  height: 7px;
  border: 2px solid #e3f8f4;
  border-radius: 50%;
  background: var(--traffic-ink);
}

.traffic-kicker i::before { left: 3px; }
.traffic-kicker i::after { right: 3px; }

.traffic-hero h1 {
  margin: 13px 0 15px;
  max-width: 650px;
  color: #143856;
  font-size: clamp(42px, 5vw, 70px);
  line-height: .98;
  letter-spacing: -.055em;
}

.traffic-hero-copy > p {
  max-width: 650px;
  margin: 0;
  color: #526d80;
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.55;
}

.traffic-hero-records {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 24px;
}

.traffic-hero-records span {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 10px 14px;
  border: 1px solid rgba(20,93,104,.1);
  border-radius: 14px;
  background: rgba(255,255,255,.62);
  color: #5b7283;
  font-size: 13px;
  font-weight: 700;
}

.traffic-hero-records strong {
  color: var(--traffic-ink);
  font-size: 19px;
}

.traffic-hero-map {
  position: relative;
  z-index: 1;
  aspect-ratio: 1.25;
  width: 100%;
  border: 1px solid rgba(19,91,101,.1);
  border-radius: 30px;
  background:
    radial-gradient(circle at 20% 25%, rgba(51,184,120,.18) 0 12px, transparent 13px),
    radial-gradient(circle at 80% 75%, rgba(51,184,120,.18) 0 16px, transparent 17px),
    repeating-radial-gradient(ellipse at 30% 35%, rgba(255,255,255,.32) 0 2px, transparent 3px 22px),
    linear-gradient(150deg, rgba(220,249,255,.9), rgba(122,207,227,.46));
  box-shadow: inset 0 0 0 8px rgba(255,255,255,.25), 0 22px 35px rgba(30,96,104,.12);
  transform: rotate(-2deg);
}

.traffic-hero-map .road {
  position: absolute;
  display: block;
  height: 24px;
  border: 5px solid #fff;
  border-radius: 40px;
  background: #39586c;
  box-shadow: 0 7px 11px rgba(29, 66, 83, .18);
}

.traffic-hero-map .road::after {
  content: "";
  position: absolute;
  inset: 7px 10px;
  border-top: 3px dashed rgba(255,255,255,.6);
}

.traffic-hero-map .road-a { width: 67%; left: 9%; top: 47%; transform: rotate(12deg); }
.traffic-hero-map .road-b { width: 49%; right: 4%; top: 31%; transform: rotate(-50deg); }
.traffic-hero-map .road-c { width: 48%; left: 9%; bottom: 19%; transform: rotate(-34deg); }

.traffic-hero-map .junction {
  position: absolute;
  width: 43px;
  height: 43px;
  border: 6px solid #fff;
  border-radius: 50%;
  background: var(--traffic-teal);
  box-shadow: 0 8px 16px rgba(13,129,120,.28);
}

.traffic-hero-map .junction::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  left: 9px;
  top: 7px;
  border-top: 4px solid #fff;
  border-right: 4px solid #fff;
  transform: rotate(38deg);
}

.traffic-hero-map .junction-a { left: 47%; top: 41%; }
.traffic-hero-map .junction-b { left: 27%; bottom: 20%; transform: rotate(-75deg); }

.hero-car {
  position: absolute;
  width: 48px;
  height: 27px;
  border: 4px solid #fff;
  border-radius: 9px 13px 7px 7px;
  box-shadow: 0 7px 13px rgba(25,59,77,.24);
}

.hero-car::before {
  content: "";
  position: absolute;
  width: 19px;
  height: 10px;
  left: 10px;
  top: -9px;
  border: 4px solid #fff;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: inherit;
}

.hero-car::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: -7px;
  height: 8px;
  border-left: 9px solid #17324d;
  border-right: 9px solid #17324d;
}

.hero-car-a { left: 18%; top: 38%; background: #2f7df4; transform: rotate(12deg); }
.hero-car-b { right: 16%; bottom: 25%; background: #f24e91; transform: rotate(-50deg); }

.hero-garage {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 43px;
  border: 5px solid #fff;
  border-radius: 11px 11px 7px 7px;
  color: #fff;
  font-size: 16px;
  font-style: normal;
  font-weight: 950;
  box-shadow: 0 8px 14px rgba(36,67,82,.2);
}

.hero-garage::before {
  content: "";
  position: absolute;
  left: -6px;
  right: -6px;
  top: -19px;
  height: 18px;
  background: inherit;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.hero-garage-a { left: 4%; top: 7%; background: #2f7df4; }
.hero-garage-b { right: 6%; top: 8%; background: #f24e91; }

.traffic-setup-card {
  display: grid;
  grid-template-columns: 1.6fr .8fr;
  gap: 28px;
  margin-top: 28px;
  padding: 32px;
  border: 1px solid #e3edf0;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(29,68,88,.08);
}

.traffic-setting-group h2 {
  margin: 0 0 16px;
  color: var(--traffic-ink);
  font-size: 18px;
}

.traffic-option-grid {
  display: grid;
  gap: 11px;
}

.traffic-difficulty-options { grid-template-columns: repeat(3, 1fr); }
.traffic-duration-options { grid-template-columns: repeat(3, 1fr); }

.traffic-option-grid button {
  position: relative;
  display: flex;
  min-height: 76px;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 14px 38px 14px 16px;
  border: 2px solid #e4ebef;
  border-radius: 17px;
  background: #f9fbfc;
  color: #617485;
  text-align: left;
  cursor: pointer;
  transition: .18s ease;
}

.traffic-duration-options button {
  min-height: 76px;
  align-items: center;
  padding: 14px 30px 14px 14px;
  text-align: center;
}

.traffic-option-grid button:hover {
  border-color: #9edbd6;
  transform: translateY(-1px);
}

.traffic-option-grid button.selected {
  border-color: var(--traffic-teal);
  background: #effbf9;
  color: var(--traffic-ink);
  box-shadow: 0 8px 18px rgba(21,169,155,.11);
}

.traffic-option-grid button span {
  color: inherit;
  font-size: 16px;
  font-weight: 900;
}

.traffic-option-grid button small {
  margin-top: 5px;
  color: #7b8c99;
  font-size: 12px;
  font-weight: 650;
}

.traffic-option-grid button i {
  position: absolute;
  right: 13px;
  top: 50%;
  width: 19px;
  height: 19px;
  border: 2px solid #c5d0d7;
  border-radius: 50%;
  transform: translateY(-50%);
}

.traffic-option-grid button.selected i {
  border-color: var(--traffic-teal);
  background: var(--traffic-teal);
  box-shadow: inset 0 0 0 4px #fff;
}

.traffic-start {
  position: relative;
  display: flex;
  width: min(470px, 100%);
  min-height: 70px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 26px auto;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, #ff7d5e, #ff664d);
  color: #fff;
  box-shadow: 0 15px 28px rgba(255,102,77,.27);
  cursor: pointer;
  transition: .18s ease;
}

.traffic-start:hover { transform: translateY(-2px); box-shadow: 0 19px 32px rgba(255,102,77,.32); }
.traffic-start:active { transform: translateY(0); }

.traffic-start b { font-size: 18px; }

.traffic-start > i {
  width: 9px;
  height: 9px;
  border-top: 3px solid #fff;
  border-right: 3px solid #fff;
  transform: rotate(45deg);
}

.traffic-start-icon {
  position: relative;
  width: 27px;
  height: 19px;
  border: 2px solid #fff;
  border-radius: 5px 8px 4px 4px;
}

.traffic-start-icon::before,
.traffic-start-icon::after {
  content: "";
  position: absolute;
  bottom: -6px;
  width: 7px;
  height: 7px;
  border: 2px solid #ff7157;
  border-radius: 50%;
  background: #fff;
}

.traffic-start-icon::before { left: 3px; }
.traffic-start-icon::after { right: 3px; }

.traffic-howto {
  padding: 32px;
  border: 1px solid #e4edf0;
  border-radius: 28px;
  background: #fff;
}

.traffic-howto h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 23px;
  font-size: 20px;
}

.traffic-howto h2 span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e8f8f6;
  color: var(--traffic-teal-dark);
  font-size: 15px;
}

.traffic-howto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.traffic-howto-grid article {
  display: flex;
  gap: 13px;
}

.traffic-howto-grid article > b {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #effaf9;
  color: var(--traffic-teal-dark);
  font-size: 15px;
}

.traffic-howto-grid strong { display: block; margin: 1px 0 6px; font-size: 15px; }
.traffic-howto-grid p { margin: 0; color: #718392; font-size: 13px; line-height: 1.55; }

.traffic-howto-note {
  margin: 24px 0 0;
  padding: 13px 16px;
  border-radius: 13px;
  background: #f7fafb;
  color: #687c8c;
  font-size: 13px;
  line-height: 1.5;
}

.traffic-control-countdown {
  display: grid;
  min-height: calc(100vh - 90px);
  place-items: center;
  padding: 40px 20px;
}

.traffic-countdown-shell {
  display: grid;
  place-items: center;
  width: min(520px, 100%);
  padding: 55px 30px;
  border-radius: 34px;
  background: linear-gradient(145deg, #e4faf6, #cdeeea);
  box-shadow: 0 25px 70px rgba(27,81,98,.16);
  text-align: center;
}

.traffic-countdown-shell span {
  color: var(--traffic-teal-dark);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.traffic-countdown-shell strong {
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  margin: 28px 0;
  border: 11px solid rgba(255,255,255,.8);
  border-radius: 50%;
  background: var(--traffic-teal);
  color: #fff;
  font-size: 76px;
  box-shadow: 0 18px 40px rgba(13,129,120,.25);
  animation: traffic-count-pulse .76s ease both;
}

.traffic-countdown-shell p { margin: 0; color: #557582; font-size: 17px; }

@keyframes traffic-count-pulse {
  0% { opacity: .2; transform: scale(.72); }
  55% { opacity: 1; transform: scale(1.08); }
  100% { transform: scale(1); }
}

.traffic-control-game {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(70,195,181,.16), transparent 28%),
    radial-gradient(circle at 90% 100%, rgba(61,148,221,.11), transparent 30%),
    #eef8fa;
}

.traffic-game-shell {
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding: 16px 0 22px;
}

.traffic-game-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 13px;
  width: min(100%, calc(153.8vh - 210px));
  margin-left: auto;
  margin-right: auto;
}

.traffic-game-actions { display: flex; gap: 9px; }

.traffic-icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid #d9e8ec;
  border-radius: 15px;
  background: #fff;
  color: var(--traffic-ink);
  box-shadow: 0 7px 18px rgba(25,67,84,.08);
  cursor: pointer;
}

.traffic-icon-button:hover { border-color: #9ddbd6; background: #f7fffe; }

.traffic-pause i,
.traffic-pause i::after {
  display: block;
  width: 5px;
  height: 18px;
  border-radius: 3px;
  background: var(--traffic-teal-dark);
}

.traffic-pause i { position: relative; transform: translateX(-5px); }
.traffic-pause i::after { content: ""; position: absolute; left: 10px; top: 0; }

.traffic-close i::before,
.traffic-close i::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 22px;
  width: 20px;
  height: 3px;
  border-radius: 3px;
  background: #e25d67;
}

.traffic-close i::before { transform: rotate(45deg); }
.traffic-close i::after { transform: rotate(-45deg); }

.traffic-hud {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) repeat(3, auto);
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 8px 15px;
  border: 1px solid #dcebed;
  border-radius: 19px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 22px rgba(28,72,88,.08);
}

.traffic-hud > span {
  display: grid;
  min-width: 82px;
  padding: 3px 11px;
  text-align: center;
}

.traffic-hud small {
  color: #78909d;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.traffic-hud strong {
  margin-top: 2px;
  color: var(--traffic-ink);
  font-size: 20px;
  line-height: 1;
}

.traffic-time-line {
  position: relative;
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 9px;
  background: #e8eff2;
}

.traffic-time-line b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #17ae9f, #43cbb4);
  transition: width .25s linear;
}

.traffic-board-wrap {
  width: min(100%, calc(153.8vh - 210px));
  margin-right: auto;
  margin-left: auto;
  padding: 10px;
  border-radius: 34px;
  background: rgba(255,255,255,.76);
  box-shadow: 0 25px 55px rgba(26,73,92,.13);
}

.traffic-board {
  position: relative;
  width: 100%;
  aspect-ratio: 1000 / 650;
  overflow: hidden;
  border-radius: 27px;
  background:
    radial-gradient(circle at 13% 20%, rgba(255,255,255,.55) 0 18px, transparent 19px),
    repeating-radial-gradient(ellipse at 40% 20%, rgba(255,255,255,.22) 0 2px, transparent 3px 30px),
    linear-gradient(145deg, #bfeaf4 0%, #86cedf 52%, #a4ddea 100%);
  isolation: isolate;
}

.traffic-board::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .42;
  background-image:
    linear-gradient(90deg, transparent 0 46%, rgba(255,255,255,.32) 47% 52%, transparent 53%),
    linear-gradient(0deg, transparent 0 46%, rgba(255,255,255,.18) 47% 52%, transparent 53%);
  background-size: 80px 46px;
}

.traffic-board.has-error { animation: traffic-board-shake .34s ease; }

@keyframes traffic-board-shake {
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

.traffic-road-map,
.traffic-board-scenery,
.traffic-vehicles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.traffic-road-map { z-index: 2; overflow: visible; }

.traffic-road-map path {
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.traffic-road-border {
  stroke: rgba(255,255,255,.94);
  stroke-width: 34;
  filter: url(#trafficRoadShadow);
}

.traffic-road-surface { stroke: #577184; stroke-width: 25; }
.traffic-road-center { stroke: rgba(255,255,255,.42); stroke-width: 2.5; stroke-dasharray: 12 13; }

.traffic-road-active {
  stroke: rgba(45,226,192,0);
  stroke-width: 8;
  pointer-events: none;
  transition: stroke .18s ease;
}

.traffic-road-active.is-active { stroke: rgba(255,190,92,.78); }
.traffic-road-active.is-entry-active { stroke: rgba(255,255,255,.28); }

.traffic-board-scenery { z-index: 1; pointer-events: none; }

.traffic-island {
  position: absolute;
  display: block;
  border: clamp(4px, .7vw, 9px) solid rgba(244,255,247,.72);
  background:
    radial-gradient(circle at 25% 28%, rgba(255,255,255,.34) 0 4%, transparent 5%),
    linear-gradient(145deg, #78cc93, #48a978);
  box-shadow: 0 12px 20px rgba(31,101,121,.18), inset 0 -12px 0 rgba(18,126,94,.12);
}

.island-1 { left: -4%; top: -8%; width: 30%; height: 42%; border-radius: 35% 52% 44% 58%; transform: rotate(8deg); }
.island-2 { right: -4%; top: -8%; width: 31%; height: 43%; border-radius: 55% 38% 58% 42%; transform: rotate(-7deg); }
.island-3 { left: 31%; top: 18%; width: 38%; height: 43%; border-radius: 46% 55% 42% 58%; transform: rotate(3deg); }
.island-4 { left: -5%; bottom: -15%; width: 38%; height: 48%; border-radius: 45% 57% 38% 51%; transform: rotate(-6deg); }
.island-5 { right: -5%; bottom: -15%; width: 38%; height: 48%; border-radius: 57% 43% 55% 37%; transform: rotate(7deg); }

.traffic-tree {
  position: absolute;
  width: clamp(15px, 2.8vw, 34px);
  height: clamp(22px, 4.2vw, 52px);
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(145deg, #3eb881, #208e68);
  box-shadow: 10px 9px 0 -3px rgba(44,154,111,.55), -8px 12px 0 -4px rgba(57,176,124,.54);
}

.traffic-tree::after {
  content: "";
  position: absolute;
  left: 45%;
  top: 80%;
  width: 3px;
  height: 18px;
  background: #7d6a4f;
}

.tree-1 { left: 14%; top: 61%; transform: scale(.8); }
.tree-2 { right: 13%; top: 48%; transform: scale(.72); }
.tree-3 { left: 39%; top: 15%; transform: scale(.65); }

.traffic-building {
  position: absolute;
  width: clamp(22px, 4vw, 52px);
  height: clamp(18px, 3.5vw, 42px);
  border-radius: 6px;
  background: rgba(255,255,255,.47);
  box-shadow: inset 0 0 0 5px rgba(76,145,148,.11);
}

.building-1 { left: 27%; top: 12%; }
.building-2 { right: 28%; bottom: 11%; }

.traffic-cloud {
  position: absolute;
  width: 7%;
  height: 6%;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  filter: blur(1px);
}

.cloud-1 { left: 5%; top: 39%; }
.cloud-2 { right: 8%; top: 19%; }

.traffic-station {
  position: absolute;
  z-index: 5;
  left: var(--station-x);
  top: var(--station-y);
  display: grid;
  width: clamp(42px, 6.4vw, 76px);
  height: clamp(36px, 5.4vw, 64px);
  place-items: center;
  border: clamp(3px, .45vw, 6px) solid #fff;
  border-radius: clamp(8px, 1.2vw, 15px) clamp(8px, 1.2vw, 15px) clamp(5px, .8vw, 10px) clamp(5px, .8vw, 10px);
  background: var(--station-color);
  color: #fff;
  box-shadow: 0 9px 17px rgba(24,64,78,.24);
  transform: translate(-50%, -50%);
}

.traffic-station.is-inactive {
  opacity: .2;
  filter: grayscale(1);
}

.traffic-station-roof {
  position: absolute;
  left: -9%;
  right: -9%;
  top: -35%;
  height: 38%;
  border-bottom: 3px solid #fff;
  background: color-mix(in srgb, var(--station-color) 82%, #142f49);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.traffic-station strong {
  font-size: clamp(13px, 2.1vw, 24px);
  font-weight: 950;
  line-height: 1;
}

.traffic-station small {
  position: absolute;
  top: 105%;
  padding: 3px 7px;
  border-radius: 7px;
  background: rgba(255,255,255,.86);
  color: var(--traffic-ink);
  font-size: clamp(7px, 1vw, 11px);
  font-weight: 850;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(20,58,71,.1);
}

.traffic-junction {
  position: absolute;
  z-index: 8;
  left: var(--junction-x);
  top: var(--junction-y);
  display: grid;
  width: clamp(36px, 5.2vw, 62px);
  height: clamp(36px, 5.2vw, 62px);
  place-items: center;
  padding: 0;
  border: clamp(3px, .5vw, 6px) solid #fff;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffb55f, #f47a4e);
  box-shadow: 0 9px 18px rgba(175,76,39,.34);
  color: #fff;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform .16s ease, box-shadow .16s ease;
}

.traffic-junction:hover {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 12px 24px rgba(175,76,39,.42);
}

.traffic-junction:active { transform: translate(-50%, -50%) scale(.95); }

.traffic-junction span {
  position: absolute;
  width: 42%;
  height: 42%;
  border-top: clamp(3px, .4vw, 5px) solid #fff;
  border-right: clamp(3px, .4vw, 5px) solid #fff;
  transform: rotate(-45deg);
  transition: transform .17s ease;
}

.traffic-junction.is-alt span { transform: rotate(45deg); }

.traffic-junction i {
  position: absolute;
  left: 50%;
  bottom: 17%;
  width: clamp(3px, .45vw, 5px);
  height: 30%;
  border-radius: 5px;
  background: #fff;
  transform: translateX(-50%);
}

.traffic-junction b {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: none;
  width: clamp(13px, 1.8vw, 21px);
  height: clamp(13px, 1.8vw, 21px);
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #17425a;
  font-size: clamp(7px, .8vw, 10px);
}

.traffic-junction.is-auto {
  border-color: rgba(255,255,255,.82);
  background: linear-gradient(145deg, #7ea8b6, #567b8d);
  box-shadow: 0 6px 13px rgba(40,82,101,.25);
  cursor: default;
  opacity: .76;
}

.traffic-junction.is-auto:hover {
  transform: translate(-50%, -50%);
  box-shadow: 0 6px 13px rgba(40,82,101,.25);
}

.traffic-entry {
  position: absolute;
  z-index: 4;
  width: clamp(18px, 2.8vw, 34px);
  height: clamp(18px, 2.8vw, 34px);
  border: 3px solid #fff;
  border-radius: 50%;
  background: #587184;
  box-shadow: 0 5px 10px rgba(24,59,74,.2);
}

.traffic-entry::before {
  content: "";
  position: absolute;
  left: 30%;
  top: 30%;
  width: 32%;
  height: 32%;
  border-top: 3px solid #fff;
  border-right: 3px solid #fff;
  transform: rotate(45deg);
}

.traffic-entry-bottom { left: 50%; bottom: 0; transform: translate(-50%, 45%) rotate(-90deg); }
.traffic-entry-left { left: 0; top: 53.8%; transform: translate(-45%, -50%); }
.traffic-entry-top { left: 73.5%; top: 0; transform: translate(-50%, -45%) rotate(90deg); }
.traffic-entry-right { right: 0; top: 53.8%; transform: translate(45%, -50%) rotate(180deg); }

.traffic-vehicles { z-index: 7; pointer-events: none; }

.traffic-vehicle {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(25px, 4vw, 48px);
  height: clamp(15px, 2.35vw, 28px);
  margin-left: clamp(-24px, -2vw, -12px);
  margin-top: clamp(-14px, -1.18vw, -7px);
  filter: drop-shadow(0 5px 4px rgba(18,50,68,.27));
  transform-origin: center;
  will-change: transform;
}

.traffic-vehicle-body {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: clamp(2px, .28vw, 3px) solid #fff;
  border-radius: 28% 36% 22% 22%;
  background: var(--vehicle-color);
  color: #fff;
}

.traffic-vehicle-body::before {
  content: "";
  position: absolute;
  left: 26%;
  top: 15%;
  width: 30%;
  height: 38%;
  border-radius: 3px;
  background: rgba(220,247,255,.78);
  box-shadow: 10px 0 0 -2px rgba(220,247,255,.6);
}

.traffic-vehicle-body b {
  position: relative;
  z-index: 2;
  margin-left: -13%;
  font-size: clamp(7px, 1vw, 12px);
  font-weight: 950;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}

.traffic-wheel {
  position: absolute;
  bottom: -12%;
  width: 19%;
  height: 31%;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 50%;
  background: #183248;
}

.traffic-wheel.wheel-a { left: 12%; }
.traffic-wheel.wheel-b { right: 12%; }

.traffic-vehicle-van { width: clamp(28px, 4.5vw, 54px); }
.traffic-vehicle-van .traffic-vehicle-body { border-radius: 15% 24% 18% 18%; }
.traffic-vehicle-sport { height: clamp(13px, 2vw, 24px); }
.traffic-vehicle-sport .traffic-vehicle-body { border-radius: 40% 48% 18% 18%; }
.traffic-vehicle-taxi .traffic-vehicle-body::after {
  content: "";
  position: absolute;
  left: 43%;
  top: -26%;
  width: 20%;
  height: 23%;
  border: 2px solid #fff;
  border-radius: 2px;
  background: #ffe16b;
}

.traffic-vehicle.is-correct { animation: traffic-car-correct .32s ease both; }
.traffic-vehicle.is-wrong { animation: traffic-car-wrong .32s ease both; }

@keyframes traffic-car-correct {
  55% { filter: drop-shadow(0 0 12px #fff) brightness(1.35); }
  100% { opacity: 0; transform: scale(1.3); }
}

@keyframes traffic-car-wrong {
  40% { filter: grayscale(.4) drop-shadow(0 0 10px #ff3f54); }
  100% { opacity: 0; }
}

.traffic-board-message {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 5%;
  max-width: 76%;
  padding: 10px 17px;
  border-radius: 14px;
  background: rgba(23,50,77,.92);
  color: #fff;
  font-size: clamp(11px, 1.4vw, 16px);
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: .2s ease;
}

.traffic-board-message.show { opacity: 1; transform: translate(-50%, 0); }
.traffic-board-message.is-success { background: rgba(14,139,112,.94); }
.traffic-board-message.is-error { background: rgba(208,57,76,.94); }

.traffic-pause-overlay {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  background: rgba(21,52,73,.68);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(4px);
  transition: opacity .18s ease;
}

body.traffic-control-paused .traffic-pause-overlay { opacity: 1; pointer-events: auto; }

.traffic-pause-overlay span {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.traffic-pause-overlay strong { font-size: clamp(27px, 4vw, 48px); }

.traffic-pause-overlay button {
  min-width: 190px;
  margin-top: 10px;
  padding: 14px 22px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--traffic-teal-dark);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.traffic-game-tip {
  width: min(100%, calc(153.8vh - 210px));
  margin: 11px auto 0;
  color: #6c8390;
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

.traffic-control-results {
  min-height: calc(100vh - 80px);
  padding: 35px 20px 70px;
  background:
    radial-gradient(circle at 10% 10%, rgba(35,184,165,.14), transparent 28%),
    #f4fafb;
}

.traffic-results-shell { width: min(900px, 100%); margin: 0 auto; }

.traffic-results-head { text-align: center; }

.traffic-results-head > span {
  color: var(--traffic-teal-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.traffic-results-head h1 {
  margin: 9px 0 11px;
  color: var(--traffic-ink);
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: -.04em;
}

.traffic-results-head p {
  max-width: 700px;
  margin: 0 auto;
  color: #6d8190;
  font-size: 15px;
  line-height: 1.6;
}

.traffic-results-score {
  display: grid;
  width: 240px;
  height: 190px;
  place-content: center;
  margin: 27px auto;
  border: 9px solid #d8f2ee;
  border-radius: 36px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(24,73,91,.11);
  text-align: center;
}

.traffic-results-score small { color: #788b98; font-size: 12px; font-weight: 800; }
.traffic-results-score strong { color: var(--traffic-teal-dark); font-size: 57px; line-height: 1.05; }
.traffic-results-score span { color: var(--traffic-ink); font-size: 13px; font-weight: 850; }

.traffic-results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
}

.traffic-results-grid article {
  display: grid;
  min-height: 105px;
  place-content: center;
  border: 1px solid #e1ecef;
  border-radius: 20px;
  background: #fff;
  text-align: center;
  box-shadow: 0 10px 28px rgba(29,71,88,.06);
}

.traffic-results-grid span { color: #778b98; font-size: 12px; font-weight: 750; }
.traffic-results-grid strong { margin-top: 5px; color: var(--traffic-ink); font-size: 25px; }

.traffic-result-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 21px;
}

.traffic-result-actions button {
  min-height: 52px;
  border: 1px solid #d8e5e9;
  border-radius: 15px;
  background: #fff;
  color: #536c7d;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}

.traffic-result-actions button.primary {
  border-color: var(--traffic-orange);
  background: var(--traffic-orange);
  color: #fff;
  box-shadow: 0 10px 20px rgba(255,118,87,.23);
}

.traffic-result-colors {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid #e0ebee;
  border-radius: 23px;
  background: #fff;
}

.traffic-result-colors h2 { margin: 0 0 17px; font-size: 17px; }
.traffic-result-colors > div { display: flex; flex-wrap: wrap; gap: 12px; }

.traffic-result-colors div > span {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 1px 9px;
  min-width: 125px;
  padding: 10px 13px;
  border-radius: 15px;
  background: #f7fafb;
}

.traffic-result-colors i {
  grid-row: 1 / 3;
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 11px;
  background: var(--result-color);
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.traffic-result-colors b { color: var(--traffic-ink); font-size: 17px; line-height: 1; }
.traffic-result-colors small { color: #7d8f9b; font-size: 10px; font-weight: 700; }

@media (max-width: 900px) {
  .traffic-hero { grid-template-columns: 1fr 340px; padding: 35px; }
  .traffic-hero h1 { font-size: 50px; }
  .traffic-setup-card { grid-template-columns: 1fr; }
  .traffic-game-shell { width: min(100% - 18px, 1000px); }
  .traffic-road-border { stroke-width: 28; }
  .traffic-road-surface { stroke-width: 20; }
  .traffic-hud { gap: 4px; padding: 7px 8px; }
  .traffic-hud > span { min-width: 66px; padding: 3px 6px; }
}

@media (max-width: 720px) {
  .traffic-setup-shell { width: min(100% - 24px, 600px); padding-top: 9px; }
  .traffic-hero {
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 4px;
    padding: 28px 22px 22px;
    border-radius: 25px;
  }
  .traffic-hero h1 { font-size: clamp(38px, 12vw, 53px); }
  .traffic-hero-copy > p { font-size: 16px; }
  .traffic-hero-map { width: min(430px, 100%); margin: 0 auto; }
  .traffic-setup-card, .traffic-howto { padding: 21px 16px; border-radius: 22px; }
  .traffic-difficulty-options { grid-template-columns: 1fr; }
  .traffic-difficulty-options button { min-height: 68px; }
  .traffic-howto-grid { grid-template-columns: 1fr; gap: 17px; }
  .traffic-start { min-height: 62px; border-radius: 17px; }

  .traffic-game-shell { width: calc(100% - 10px); padding-top: 5px; }
  .traffic-game-topbar,
  .traffic-board-wrap,
  .traffic-game-tip { width: 100%; }
  .traffic-game-topbar { grid-template-columns: 1fr; gap: 5px; }
  .traffic-game-actions { position: absolute; z-index: 30; left: 11px; top: 10px; }
  .traffic-icon-button { width: 40px; height: 40px; border-radius: 12px; }
  .traffic-close i::before, .traffic-close i::after { left: 11px; top: 18px; width: 18px; }
  .traffic-hud {
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    min-height: 78px;
    padding: 7px 4px 6px 94px;
    border-radius: 15px;
  }
  .traffic-hud > span { min-width: 0; padding: 0 2px; }
  .traffic-hud > span:first-child { grid-column: auto; }
  .traffic-hud strong { font-size: 16px; }
  .traffic-hud small { font-size: 8px; }
  .traffic-time-line { grid-column: 1 / -1; grid-row: 2; height: 5px; }
  .traffic-board-wrap { padding: 5px; border-radius: 19px; }
  .traffic-board { aspect-ratio: 1000 / 760; border-radius: 16px; }
  .traffic-road-border { stroke-width: 21; }
  .traffic-road-surface { stroke-width: 15; }
  .traffic-road-center { stroke-width: 1.7; stroke-dasharray: 8 9; }
  .traffic-road-active { stroke-width: 5; }
  .traffic-station small { display: none; }
  .traffic-junction { width: 44px; height: 44px; }
  .traffic-junction b { display: none; }
  .traffic-game-tip { padding: 0 10px; font-size: 10px; }

  .traffic-control-results { padding: 24px 12px 50px; }
  .traffic-results-grid { grid-template-columns: repeat(2, 1fr); }
  .traffic-result-actions { grid-template-columns: 1fr; }
  .traffic-result-colors { padding: 19px 14px; }
}

@media (max-width: 420px) {
  .traffic-duration-options button { min-height: 62px; padding: 10px 24px 10px 6px; }
  .traffic-duration-options button span { font-size: 13px; }
  .traffic-hero-records { gap: 7px; }
  .traffic-hero-records span { padding: 8px 10px; }
  .traffic-hud { padding-left: 88px; }
  .traffic-icon-button { width: 37px; height: 37px; }
  .traffic-game-actions { left: 9px; top: 9px; gap: 6px; }
  .traffic-pause i, .traffic-pause i::after { height: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .traffic-start,
  .traffic-option-grid button,
  .traffic-junction,
  .traffic-board-message,
  .traffic-time-line b { transition: none; }
  .traffic-countdown-shell strong,
  .traffic-board.has-error,
  .traffic-vehicle.is-correct,
  .traffic-vehicle.is-wrong { animation-duration: .01ms; }
}

/* Mobile-first full-screen game board v2. */
body.traffic-control-play-mode,
body.traffic-control-play-mode main.view-traffic-control {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

.traffic-control-game {
  position: fixed;
  z-index: 1000;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(160deg, #d8f2f7 0%, #9ed7e4 100%);
}

.traffic-game-shell {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

.traffic-game-topbar {
  position: relative;
  z-index: 40;
  display: block;
  flex: 0 0 64px;
  width: min(100vw, calc(50dvh - 32px));
  height: 64px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(25,65,86,.09);
  background: rgba(251,254,255,.97);
  box-shadow: 0 8px 24px rgba(18,65,83,.12);
}

.traffic-game-actions {
  position: absolute;
  z-index: 3;
  left: 8px;
  top: 10px;
  display: flex;
  gap: 6px;
}

.traffic-icon-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: #edf8f9;
  box-shadow: none;
}

.traffic-icon-button:hover { border: 0; background: #e3f4f5; }

.traffic-close { background: #fff0f1; }
.traffic-close i::before,
.traffic-close i::after { left: 11px; top: 19px; width: 18px; }

.traffic-hud {
  display: grid;
  width: 100%;
  height: 64px;
  min-height: 64px;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 44px 5px;
  gap: 3px 4px;
  align-items: center;
  padding: 5px 7px 6px 96px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.traffic-hud > span {
  display: grid;
  min-width: 0;
  padding: 0 2px;
  text-align: center;
}

.traffic-hud small {
  color: #78909d;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .065em;
}

.traffic-hud strong {
  margin-top: 1px;
  color: #153b55;
  font-size: 15px;
  line-height: 1;
}

.traffic-time-line {
  grid-column: 1 / -1;
  grid-row: 2;
  height: 5px;
  margin: 0 4px;
  background: #e1ecef;
}

.traffic-time-line b { background: linear-gradient(90deg, #1ba99b, #49cfb5); }

.traffic-board-wrap {
  flex: 1 1 auto;
  width: min(100vw, calc(50dvh - 32px));
  height: calc(100dvh - 64px);
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  border-radius: 0 0 24px 24px;
  background: #80c9da;
  box-shadow: 0 18px 55px rgba(21,69,88,.2);
}

.traffic-board {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0 0 22px 22px;
  background:
    radial-gradient(circle at 12% 22%, rgba(255,255,255,.35) 0 9px, transparent 10px),
    radial-gradient(circle at 88% 74%, rgba(255,255,255,.26) 0 13px, transparent 14px),
    linear-gradient(165deg, #b9e9f1 0%, #78c4d7 58%, #65b4ca 100%);
}

.traffic-board::before {
  opacity: .2;
  background-image: linear-gradient(0deg, transparent 47%, rgba(255,255,255,.45) 49% 51%, transparent 53%);
  background-size: 100% 46px;
}

.traffic-water-pattern { opacity: .78; }

.traffic-road-border {
  stroke: rgba(250,254,255,.98);
  stroke-width: 46;
  filter: url(#trafficRoadShadow);
}

.traffic-road-surface {
  stroke: #38556a;
  stroke-width: 34;
}

.traffic-road-center {
  stroke: rgba(255,235,174,.72);
  stroke-width: 2.4;
  stroke-dasharray: 12 11;
}

.traffic-road-active {
  stroke-width: 7;
  transition: stroke .14s ease;
}

.traffic-road-active.is-active { stroke: rgba(255,179,63,.9); }
.traffic-road-active.is-entry-active { stroke: rgba(114,232,209,.38); }

.traffic-island {
  border: 7px solid rgba(239,255,247,.78);
  background:
    radial-gradient(circle at 22% 25%, rgba(255,255,255,.28) 0 4%, transparent 5%),
    linear-gradient(150deg, #72ce96, #3da677);
  box-shadow: 0 10px 18px rgba(28,91,110,.2), inset 0 -12px 0 rgba(12,111,78,.12);
}

.island-1 { left: -18%; top: -5%; width: 62%; height: 34%; border-radius: 39% 57% 43% 55%; transform: rotate(6deg); }
.island-2 { right: -18%; top: -5%; width: 62%; height: 34%; border-radius: 58% 39% 56% 42%; transform: rotate(-6deg); }
.island-3 { left: 16%; top: 29%; width: 68%; height: 34%; border-radius: 46% 58% 44% 55%; transform: rotate(2deg); }
.island-4 { left: -20%; bottom: -7%; width: 66%; height: 34%; border-radius: 43% 58% 39% 53%; transform: rotate(-5deg); }
.island-5 { right: -20%; bottom: -7%; width: 66%; height: 34%; border-radius: 57% 42% 55% 38%; transform: rotate(5deg); }

.traffic-tree {
  width: 16px;
  height: 24px;
  box-shadow: 7px 7px 0 -3px rgba(44,154,111,.55), -6px 9px 0 -4px rgba(57,176,124,.54);
}

.traffic-tree::after { height: 9px; }
.tree-1 { left: 13%; top: 71%; transform: scale(.78); }
.tree-2 { right: 12%; top: 45%; transform: scale(.65); }
.tree-3 { left: 37%; top: 18%; transform: scale(.62); }

.traffic-building {
  width: 30px;
  height: 25px;
  border-radius: 7px;
  background: rgba(255,255,255,.48);
  box-shadow: inset 0 0 0 4px rgba(69,135,147,.12);
}

.building-1 { left: 19%; top: 23%; }
.building-2 { right: 22%; bottom: 17%; }
.cloud-1 { left: 5%; top: 43%; }
.cloud-2 { right: 7%; top: 22%; }

.traffic-station {
  width: 54px;
  height: 46px;
  border: 3px solid #fff;
  border-radius: 14px;
  background:
    repeating-linear-gradient(90deg, transparent 0 12px, rgba(255,255,255,.2) 13px 15px),
    var(--station-color);
  box-shadow: 0 7px 14px rgba(19,60,77,.26);
}

.traffic-station-roof {
  left: 5px;
  right: auto;
  top: -13px;
  display: grid;
  width: 21px;
  height: 18px;
  place-items: center;
  border: 2px solid var(--station-color);
  border-radius: 6px 6px 2px 2px;
  background: #fff;
  clip-path: none;
}

.traffic-station-roof::after {
  content: "P";
  color: var(--station-color);
  font: 950 10px/1 system-ui, sans-serif;
}

.traffic-station strong { font-size: 17px; }
.traffic-station small { display: none; }
.traffic-station.is-inactive { opacity: .12; filter: grayscale(1); }

.traffic-junction {
  width: 34px;
  height: 34px;
  border: 3px solid #fff;
  background: linear-gradient(145deg, #ffb24f, #f17845);
  box-shadow: 0 5px 10px rgba(130,57,29,.34);
}

.traffic-junction::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
}

.traffic-junction:hover { transform: translate(-50%, -50%) scale(1.04); box-shadow: 0 6px 13px rgba(130,57,29,.4); }
.traffic-junction span { width: 39%; height: 39%; border-width: 3px; }
.traffic-junction i { bottom: 16%; width: 3px; height: 30%; }

.traffic-junction.is-auto {
  width: 26px;
  height: 26px;
  border-width: 2px;
  background: linear-gradient(145deg, #8caab5, #5b7d8c);
  box-shadow: 0 3px 8px rgba(36,76,92,.24);
  opacity: .68;
}

.traffic-junction.is-auto:hover { transform: translate(-50%, -50%); }

.traffic-entry { width: 25px; height: 25px; border-width: 2px; }
.traffic-entry-bottom { left: 50%; bottom: 0; transform: translate(-50%, 46%) rotate(-90deg); }
.traffic-entry-left { left: 0; top: 54.17%; transform: translate(-46%, -50%); }
.traffic-entry-top { left: 71.67%; top: 0; transform: translate(-50%, -46%) rotate(90deg); }
.traffic-entry-right { right: 0; top: 54.17%; transform: translate(46%, -50%) rotate(180deg); }

.traffic-vehicle {
  width: 42px;
  height: 24px;
  margin-left: -21px;
  margin-top: -12px;
  filter: drop-shadow(0 4px 3px rgba(12,42,57,.32));
}

.traffic-vehicle svg { display: block; width: 100%; height: 100%; overflow: visible; }
.traffic-car-wheel { fill: #142b3b; stroke: rgba(255,255,255,.74); stroke-width: 1.2; }
.traffic-car-body { fill: var(--vehicle-color); stroke: #fff; stroke-width: 2.3; }
.traffic-car-glass { fill: rgba(219,248,255,.9); stroke: rgba(25,67,83,.3); stroke-width: 1; }
.traffic-car-glass-rear { opacity: .72; }
.traffic-car-light { fill: #fff4ad; }
.traffic-car-letter { fill: #fff; font: 950 10px/1 system-ui, sans-serif; paint-order: stroke; stroke: rgba(23,50,65,.42); stroke-width: 1.4; }
.traffic-car-sign { fill: #ffe376; stroke: #fff; stroke-width: 1.2; }
.traffic-vehicle-van { width: 47px; margin-left: -23.5px; }
.traffic-vehicle-sport { width: 38px; height: 21px; margin-left: -19px; margin-top: -10.5px; }

@keyframes traffic-car-correct {
  55% { opacity: 1; filter: drop-shadow(0 0 10px #fff) brightness(1.28); }
  100% { opacity: 0; filter: drop-shadow(0 0 14px #8fffd8) brightness(1.4); }
}

@keyframes traffic-car-wrong {
  45% { opacity: 1; filter: grayscale(.35) drop-shadow(0 0 9px #ff4155); }
  100% { opacity: 0; filter: grayscale(.7) drop-shadow(0 0 11px #ff4155); }
}

.traffic-board-message {
  top: 12px;
  max-width: calc(100% - 30px);
  padding: 8px 13px;
  border-radius: 11px;
  font-size: 12px;
}

.traffic-pause-overlay { border-radius: inherit; }
.traffic-pause-overlay strong { font-size: 31px; }
.traffic-game-tip { display: none; }

@media (max-width: 720px) {
  .traffic-game-topbar,
  .traffic-board-wrap { width: 100vw; }
  .traffic-board-wrap,
  .traffic-board { border-radius: 0; }
  .traffic-game-shell { width: 100%; padding: 0; }
  .traffic-game-actions { left: 7px; top: 10px; }
  .traffic-icon-button { width: 39px; height: 39px; }
  .traffic-hud { padding-left: 92px; }
  .traffic-road-border { stroke-width: 46; }
  .traffic-road-surface { stroke-width: 34; }
  .traffic-road-center { stroke-width: 2.4; stroke-dasharray: 12 11; }
  .traffic-road-active { stroke-width: 7; }
  .traffic-junction { width: 34px; height: 34px; }
}

@media (max-width: 370px) {
  .traffic-hud { padding-left: 86px; padding-right: 4px; }
  .traffic-hud small { font-size: 6.5px; }
  .traffic-hud strong { font-size: 14px; }
  .traffic-icon-button { width: 36px; height: 36px; }
  .traffic-game-actions { gap: 4px; }
  .traffic-station { width: 49px; height: 42px; }
  .traffic-vehicle { width: 38px; height: 22px; margin-left: -19px; margin-top: -11px; }
}

/* Complex-route refinement: preserve the seven-switch network while making every choice readable. */
.traffic-board {
  background:
    radial-gradient(circle at 18% 12%, rgba(255,255,255,.34), transparent 24%),
    linear-gradient(165deg, #c6edf2 0%, #88cbd8 58%, #70b9ca 100%);
}

.traffic-board::before {
  opacity: .17;
  background-image:
    linear-gradient(rgba(255,255,255,.46) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.32) 1px, transparent 1px);
  background-size: 44px 44px;
}

.traffic-water-pattern { opacity: .32; }

.traffic-road-border {
  stroke: #dcebed;
  stroke-width: 39;
  filter: url(#trafficRoadShadow);
}

.traffic-road-surface {
  stroke: #314c5c;
  stroke-width: 29;
}

.traffic-road-center {
  stroke: rgba(255,244,205,.68);
  stroke-width: 1.8;
  stroke-dasharray: 9 12;
}

.traffic-road-active {
  stroke: var(--route-color, rgba(49,205,182,0));
  stroke-width: 5.5;
  stroke-dasharray: 10 10;
  opacity: 0;
  transition: stroke .15s ease, opacity .15s ease;
}

.traffic-road-active.is-active,
.traffic-road-active.is-entry-active {
  stroke: var(--route-color, #31cdb6);
  opacity: .9;
  animation: traffic-route-flow .86s linear infinite;
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--route-color, #31cdb6) 62%, transparent));
}

.traffic-road-active.is-cycle {
  stroke: #31cdb6;
  stroke-dasharray: 5 7;
}

[data-traffic-road].is-unavailable,
[data-traffic-edge].is-unavailable { opacity: 0; }

@keyframes traffic-route-flow {
  to { stroke-dashoffset: -42; }
}

.traffic-route-legend {
  position: absolute;
  z-index: 10;
  left: 50%;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 92px);
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.68);
  border-radius: 999px;
  background: rgba(29,66,84,.86);
  color: #fff;
  font-size: 9px;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
  box-shadow: 0 5px 14px rgba(26,70,88,.15);
  transform: translateX(-50%);
}

.traffic-route-legend i {
  flex: 0 0 auto;
  width: 22px;
  height: 5px;
  border-radius: 999px;
  background: #31cdb6;
  box-shadow: 0 0 7px rgba(49,205,182,.72);
}

.traffic-island {
  border: 5px solid rgba(238,255,248,.84);
  background: linear-gradient(150deg, #70ce98, #3da777);
  box-shadow: 0 9px 18px rgba(31,91,108,.16), inset 0 -9px 0 rgba(12,111,78,.1);
}

.island-1 { left: -18%; top: -5%; width: 59%; height: 31%; border-radius: 35% 55% 44% 56%; transform: rotate(4deg); }
.island-2 { right: -18%; top: -5%; width: 59%; height: 31%; border-radius: 55% 35% 56% 44%; transform: rotate(-4deg); }
.island-3 { left: 19%; top: 30%; width: 62%; height: 29%; border-radius: 45% 56% 44% 55%; transform: rotate(1deg); }
.island-4 { left: -18%; bottom: -7%; width: 61%; height: 31%; border-radius: 44% 57% 40% 54%; transform: rotate(-4deg); }
.island-5 { right: -18%; bottom: -7%; width: 61%; height: 31%; border-radius: 57% 43% 55% 39%; transform: rotate(4deg); }

.traffic-tree,
.traffic-building,
.traffic-cloud { opacity: .62; }

.traffic-station {
  width: 50px;
  height: 44px;
  border: 3px solid rgba(255,255,255,.98);
  border-radius: 13px;
  background: var(--station-color);
  box-shadow: 0 7px 15px rgba(24,64,79,.24), inset 0 -7px 0 rgba(18,49,62,.08);
}

.traffic-station-roof {
  left: 50%;
  right: auto;
  top: -12px;
  width: 22px;
  height: 18px;
  border: 2px solid var(--station-color);
  border-radius: 7px;
  background: rgba(255,255,255,.98);
  clip-path: none;
  transform: translateX(-50%);
}

.traffic-station-roof::after {
  content: "P";
  color: var(--station-color);
  font: 950 10px/1 system-ui, sans-serif;
}

.traffic-station strong { font-size: 17px; }

.traffic-station small {
  top: calc(100% + 5px);
  display: block;
  padding: 3px 6px;
  border: 1px solid rgba(255,255,255,.8);
  background: rgba(247,253,254,.9);
  color: #254c60;
  font-size: 8px;
  box-shadow: none;
}

.traffic-station.is-inactive { opacity: 0; }

.traffic-junction,
.traffic-junction:hover,
.traffic-junction:active {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,.98);
  background: var(--junction-color, #31cdb6);
  box-shadow:
    0 5px 12px rgba(21,58,74,.27),
    0 0 0 3px color-mix(in srgb, var(--junction-color, #31cdb6) 72%, #fff);
}

.traffic-junction:hover { transform: translate(-50%, -50%) scale(1.05); }
.traffic-junction:active { transform: translate(-50%, -50%) scale(.94); }

.traffic-junction::after { inset: -7px; }
.traffic-junction span,
.traffic-junction i { display: none; }

.traffic-junction b {
  position: relative;
  z-index: 2;
  right: auto;
  bottom: auto;
  display: grid;
  width: auto;
  height: auto;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(17,45,58,.42);
}

.traffic-junction.is-cycle {
  --junction-color: #31cdb6;
}

.traffic-junction.is-auto {
  width: 30px;
  height: 30px;
  border-width: 3px;
  background: var(--junction-color, #7694a1);
  box-shadow: 0 4px 9px rgba(27,64,80,.2), 0 0 0 2px rgba(255,255,255,.62);
  opacity: .62;
}

.traffic-junction.is-auto:hover { transform: translate(-50%, -50%); }
.traffic-junction.is-auto b { font-size: 10px; }

.traffic-entry {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,.94);
  background: #36576a;
  box-shadow: 0 4px 9px rgba(24,59,74,.2);
}

.traffic-entry.is-inactive { opacity: 0; }

.traffic-vehicle {
  width: 41px;
  height: 23px;
  margin-left: -20.5px;
  margin-top: -11.5px;
  filter: drop-shadow(0 3px 2px rgba(12,42,57,.36));
  transition: filter .16s ease;
}

.traffic-vehicle.is-waiting { filter: drop-shadow(0 3px 2px rgba(12,42,57,.36)) drop-shadow(-2px 0 4px rgba(255,72,62,.58)); }
.traffic-vehicle.is-waiting .traffic-car-light-rear { fill: #ff6c5f; filter: drop-shadow(0 0 2px #ff3b30); }

.traffic-junction:focus-visible,
.traffic-icon-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@media (max-width: 370px) {
  .traffic-route-legend { top: 10px; max-width: calc(100% - 82px); padding: 6px 9px; font-size: 8px; }
  .traffic-route-legend i { width: 18px; }
  .traffic-station { width: 46px; height: 41px; }
  .traffic-station small { font-size: 7px; }
  .traffic-junction,
  .traffic-junction:hover,
  .traffic-junction:active { width: 39px; height: 39px; }
  .traffic-vehicle { width: 38px; height: 22px; margin-left: -19px; margin-top: -11px; }
}

@media (prefers-reduced-motion: reduce) {
  .traffic-road-active.is-active,
  .traffic-road-active.is-entry-active { animation: none; }
}

/* Elevated-city road system v6: reference-inspired, original route geometry. */
.traffic-board {
  background:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,.24), transparent 34%),
    linear-gradient(165deg, #c8edf2 0%, #8bd1dc 50%, #71bfce 100%);
}

.traffic-water-pattern { opacity: .2; }

.traffic-road-shadow {
  stroke: rgba(20,49,62,.3);
  stroke-width: 58;
  opacity: .78;
  filter: url(#trafficRoadShadow);
}

.traffic-road-deck {
  stroke: url(#trafficRoadDeck);
  stroke-width: 52;
}

.traffic-road-kerb {
  stroke: #aeb9c0;
  stroke-width: 45;
}

.traffic-road-surface {
  stroke: #59646f;
  stroke-width: 37;
}

.traffic-road-center {
  stroke: rgba(247,249,242,.76);
  stroke-width: 1.7;
  stroke-dasharray: 8 10;
}

.traffic-road-active {
  stroke-width: 5;
  stroke-dasharray: 9 10;
}

.traffic-road-active.is-active,
.traffic-road-active.is-entry-active {
  opacity: .92;
  filter: drop-shadow(0 0 2px rgba(255,255,255,.62)) drop-shadow(0 0 4px color-mix(in srgb, var(--route-color, #31cdb6) 66%, transparent));
}

.traffic-island {
  border-color: rgba(245,250,245,.96);
  box-shadow:
    0 8px 17px rgba(31,76,91,.17),
    inset 0 0 0 2px rgba(130,173,146,.18),
    inset 0 -9px 0 rgba(12,111,78,.08);
}

.traffic-junction,
.traffic-junction:hover,
.traffic-junction:active {
  border-color: rgba(250,253,254,.98);
  box-shadow:
    0 6px 12px rgba(25,47,58,.3),
    0 0 0 3px color-mix(in srgb, var(--junction-color, #31cdb6) 64%, #fff);
}

.traffic-vehicle {
  width: 43px;
  height: 24px;
  margin-left: -21.5px;
  margin-top: -12px;
  filter: drop-shadow(0 4px 2px rgba(18,37,47,.44));
}

.traffic-car-body { stroke-width: 2.6; }
.traffic-car-glass { fill: rgba(221,244,250,.96); }
.traffic-car-wheel { fill: #15242d; stroke: rgba(236,243,246,.82); }

@media (max-width: 370px) {
  .traffic-vehicle { width: 40px; height: 23px; margin-left: -20px; margin-top: -11.5px; }
}

/* Metropolitan interchange v7: wide elevated roads, original gameplay graph. */
.traffic-board {
  isolation: isolate;
  background-color: #d6eef0;
  background-image: url("./generated/traffic-city-background-v7.webp");
  background-position: 50% 50%;
  background-size: cover;
}

.traffic-board::before,
.traffic-water-pattern,
.traffic-board-scenery { display: none; }

.traffic-road-map { z-index: 3; }

.traffic-road-map path {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.traffic-road-shadow {
  stroke: rgba(24, 43, 53, .42);
  stroke-width: 90;
  opacity: .8;
  filter: url(#trafficRoadShadow);
}

.traffic-road-deck {
  stroke: #f5f6f5;
  stroke-width: 82;
}

.traffic-road-kerb {
  stroke: #b7c0c5;
  stroke-width: 72;
}

.traffic-road-surface {
  stroke: #606a75;
  stroke-width: 62;
}

.traffic-road-center {
  stroke: rgba(255, 224, 116, .9);
  stroke-width: 2.8;
  stroke-dasharray: 14 13;
  opacity: .95;
}

.traffic-road-active {
  stroke: #31d2dd;
  stroke-width: 5.5;
  stroke-dasharray: 3 20;
  opacity: 0;
}

.traffic-road-active.is-active,
.traffic-road-active.is-entry-active,
.traffic-road-active.is-cycle {
  stroke: #31d2dd;
  opacity: .88;
  filter: drop-shadow(0 0 2px rgba(255,255,255,.95)) drop-shadow(0 0 5px rgba(17,194,208,.82));
}

.traffic-route-legend {
  top: 10px;
  max-width: calc(100% - 110px);
  border-color: rgba(255,255,255,.86);
  background: rgba(31, 63, 76, .82);
  box-shadow: 0 6px 16px rgba(20,48,60,.2);
  backdrop-filter: blur(8px);
}

.traffic-route-legend i {
  background: #31d2dd;
  box-shadow: 0 0 9px rgba(49,210,221,.9);
}

.traffic-station {
  width: 56px;
  height: 50px;
  border: 4px solid rgba(255,255,255,.98);
  border-radius: 15px;
  box-shadow: 0 9px 18px rgba(20,46,57,.32), inset 0 -8px 0 rgba(15,44,58,.08);
}

.traffic-station-roof {
  top: -14px;
  width: 24px;
  height: 20px;
  border-width: 3px;
  box-shadow: 0 3px 7px rgba(17,50,64,.2);
}

.traffic-station strong { font-size: 19px; }

.traffic-junction,
.traffic-junction:hover,
.traffic-junction:active {
  width: 54px;
  height: 54px;
  border: 4px solid #35cbd5;
  background: rgba(247, 253, 254, .9);
  color: var(--junction-color, #31cdb6);
  box-shadow:
    0 10px 22px rgba(23,55,67,.32),
    inset 0 0 0 4px rgba(255,255,255,.72),
    0 0 0 2px rgba(70,220,228,.2);
  backdrop-filter: blur(7px);
}

.traffic-junction:hover { transform: translate(-50%, -50%) scale(1.04); }
.traffic-junction:active { transform: translate(-50%, -50%) scale(.94); }
.traffic-junction::after { inset: -6px; }

.traffic-junction b {
  color: var(--junction-color, #1fbaca);
  font-size: 18px;
  font-weight: 1000;
  text-shadow: 0 1px 0 #fff, 0 0 6px rgba(255,255,255,.9);
}

.traffic-junction.is-cycle b { color: #19bcca; }

.traffic-junction.is-auto,
.traffic-junction.is-auto:hover {
  width: 40px;
  height: 40px;
  border-width: 3px;
  background: rgba(242,249,250,.86);
  box-shadow: 0 7px 15px rgba(24,55,67,.24), inset 0 0 0 3px rgba(255,255,255,.7);
  opacity: .78;
}

.traffic-junction.is-auto b { font-size: 13px; }

.traffic-entry {
  width: 29px;
  height: 29px;
  border: 3px solid rgba(255,255,255,.98);
  background: #31cbd6;
  box-shadow: 0 5px 12px rgba(18,56,69,.35), 0 0 0 3px rgba(49,203,214,.28);
}

.traffic-vehicles { z-index: 9; }

.traffic-vehicle,
.traffic-vehicle-van,
.traffic-vehicle-sport,
.traffic-vehicle-taxi {
  width: 34px;
  height: 56px;
  margin-left: -17px;
  margin-top: -28px;
  overflow: hidden;
  border-radius: 42%;
  background: transparent;
  filter: drop-shadow(0 5px 3px rgba(17,34,43,.46));
  transition: filter .16s ease;
  will-change: transform;
}

.traffic-vehicle svg { display: none; }

.traffic-car-sprite {
  position: absolute;
  top: -19px;
  width: 223px;
  height: auto;
  max-width: none;
  pointer-events: none;
  user-select: none;
}

.traffic-vehicle[data-vehicle-color="blue"] .traffic-car-sprite { left: -8.8px; }
.traffic-vehicle[data-vehicle-color="pink"] .traffic-car-sprite { left: -51.3px; }
.traffic-vehicle[data-vehicle-color="amber"] .traffic-car-sprite { left: -95px; }
.traffic-vehicle[data-vehicle-color="green"] .traffic-car-sprite { left: -138.6px; }
.traffic-vehicle[data-vehicle-color="violet"] .traffic-car-sprite { left: -181.8px; }

.traffic-car-code {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  display: grid;
  min-width: 15px;
  height: 15px;
  place-items: center;
  padding: 0 3px;
  border: 1px solid rgba(255,255,255,.98);
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: var(--vehicle-color);
  font: 1000 7px/1 system-ui, sans-serif;
  box-shadow: 0 2px 4px rgba(13,38,49,.22);
  transform: translate(-50%, -50%);
}

.traffic-vehicle.is-waiting {
  filter: drop-shadow(0 5px 3px rgba(17,34,43,.46)) drop-shadow(0 0 7px rgba(255,58,48,.78));
}

@media (max-width: 370px) {
  .traffic-road-shadow { stroke-width: 88; }
  .traffic-road-deck { stroke-width: 80; }
  .traffic-road-kerb { stroke-width: 70; }
  .traffic-road-surface { stroke-width: 60; }
  .traffic-junction,
  .traffic-junction:hover,
  .traffic-junction:active { width: 51px; height: 51px; }
  .traffic-station { width: 52px; height: 47px; }
  .traffic-vehicle,
  .traffic-vehicle-van,
  .traffic-vehicle-sport,
  .traffic-vehicle-taxi { width: 34px; height: 56px; margin-left: -17px; margin-top: -28px; }
}

/* Metropolitan interchange v8: the gameplay follows the generated road network. */
.traffic-board {
  background-color: #c9edf1;
  background-image: url("./generated/traffic-city-background-v8.webp");
  background-position: 50% 50%;
  background-size: cover;
}

.traffic-road-shadow-layer,
.traffic-road-deck-layer,
.traffic-road-kerb-layer,
.traffic-road-surface-layer,
.traffic-road-marking-layer {
  display: none;
}

.traffic-road-route-layer {
  opacity: .98;
  mix-blend-mode: screen;
}

.traffic-road-active {
  stroke: #35e9f1;
  stroke-width: 4.8;
  stroke-dasharray: 2 17;
  stroke-linecap: round;
  opacity: 0;
}

.traffic-road-active.is-active,
.traffic-road-active.is-entry-active,
.traffic-road-active.is-cycle {
  stroke: #35e9f1;
  opacity: .9;
  filter: drop-shadow(0 0 2px rgba(255,255,255,.98)) drop-shadow(0 0 5px rgba(18,216,228,.92));
}

.traffic-junction,
.traffic-junction:hover,
.traffic-junction:active {
  width: 50px;
  height: 50px;
  border-width: 3px;
  background: rgba(247,253,254,.92);
  box-shadow:
    0 9px 18px rgba(19,48,61,.34),
    inset 0 0 0 3px rgba(255,255,255,.78),
    0 0 0 2px rgba(70,220,228,.22);
}

.traffic-junction.is-auto,
.traffic-junction.is-auto:hover {
  width: 38px;
  height: 38px;
}

.traffic-station {
  width: 52px;
  height: 47px;
}

.traffic-station-roof::after {
  content: attr(data-station-symbol);
  font-size: 8px;
  letter-spacing: -.2px;
}

.traffic-station small {
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 370px) {
  .traffic-junction,
  .traffic-junction:hover,
  .traffic-junction:active { width: 48px; height: 48px; }
  .traffic-station { width: 49px; height: 44px; }
}
