/* Мосты мегаполиса: physical bridge decks and cars in a shared coordinate system. */
main.view-traffic-control
  > :not(.site-header):not(#traffic-control-trainer-screen) {
  display: none !important;
}
#traffic-control-trainer-screen {
  --ink: #183c4a;
  --muted: #657c85;
  --teal: #14aa9b;
  --line: #dcebea;
  color: var(--ink);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  width: 100%;
}
#traffic-control-trainer-screen * {
  box-sizing: border-box;
}
#traffic-control-trainer-screen [hidden] {
  display: none !important;
}
#traffic-control-trainer-screen button {
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
#traffic-control-trainer-screen button:disabled {
  cursor: default;
}
#traffic-control-trainer-screen button:focus-visible {
  outline: 3px solid #05766e;
  outline-offset: 4px;
}
.traffic-setup-shell,
.traffic-results-shell {
  max-width: 1060px;
  margin: auto;
  padding: 26px 28px 50px;
}
.traffic-back {
  padding: 8px 0;
  margin: 0 0 20px;
  border: 0;
  background: none;
  color: #53727c;
  font-size: 14px;
  font-weight: 600;
}
.traffic-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 36px;
  align-items: center;
  padding-bottom: 30px;
}
.traffic-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #138b83;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.traffic-kicker i {
  height: 7px;
  width: 7px;
  background: #16b6a5;
  border-radius: 50%;
}
.traffic-hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.045em;
  margin: 16px 0;
}
.traffic-hero p {
  font-size: 15px;
  line-height: 1.7;
  color: #607984;
  max-width: 510px;
  margin: 0;
}
.traffic-hero-records {
  display: flex;
  gap: 25px;
  margin-top: 23px;
  font-size: 12px;
  color: #70868c;
}
.traffic-hero-records strong {
  font-size: 19px;
  color: #234b55;
  margin-right: 3px;
}
.traffic-hero-map {
  height: 220px;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  background:
    url("./generated/traffic-road-preview-v9.svg") 50% 44% / cover,
    url("./generated/traffic-city-water-v9.webp") 50% 44% / cover;
  box-shadow: 0 12px 32px #163d501a;
}
.traffic-hero-map span {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: #183c4adc;
  color: white;
  text-align: center;
  border: 1px solid #ffffff80;
  padding: 10px;
  font-size: 11px;
  font-weight: 650;
  border-radius: 12px;
  backdrop-filter: blur(8px);
}
.traffic-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 5px;
  gap: 5px;
  background: #e9f1f0;
  border-radius: 16px;
  margin-bottom: 30px;
}
.traffic-mode-tabs button {
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 13px;
  color: #597680;
  font-weight: 750;
  font-size: 15px;
  text-align: center;
  transition: background 0.15s;
}
.traffic-mode-tabs button small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  margin-top: 3px;
}
.traffic-mode-tabs button[aria-pressed="true"] {
  background: white;
  color: #087e75;
  box-shadow: 0 2px 8px #1b555310;
}
.traffic-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 17px;
}
.traffic-section-heading h2,
.traffic-setup-card h2,
.traffic-howto h2,
.traffic-result-colors h2 {
  font-size: 17px;
  letter-spacing: -0.02em;
  margin: 0;
}
.traffic-section-heading > span {
  font-size: 13px;
  font-weight: 750;
  color: #bf8a12;
}
.traffic-level-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.traffic-level {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  border: 1px solid #dce7e7;
  border-radius: 16px;
  background: #fff;
  padding: 17px;
  color: #294d59;
  min-height: 137px;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.traffic-level:hover:not(:disabled) {
  border-color: #16aa9b;
  background: #f3fcfa;
}
.traffic-level.selected {
  border: 2px solid #16aa9b;
  padding: 16px;
  background: #f0fcf8;
  box-shadow: 0 4px 12px #11aa9b13;
}
.traffic-level-number {
  font-size: 24px;
  line-height: 1;
  color: #8cacb2;
  letter-spacing: -0.03em;
  font-weight: 750;
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 14px;
}
.traffic-level.selected .traffic-level-number {
  color: #138e82;
}
.traffic-level-number i {
  font-style: normal;
  font-size: 18px;
}
.traffic-level strong {
  font-size: 12px;
  line-height: 1.3;
  min-height: 16px;
}
.traffic-level > small {
  font-size: 10px;
  margin-top: 5px;
  color: #668089;
}
.traffic-level:disabled {
  background: #f3f6f5;
  color: #7b9094;
  border-color: #e7edec;
}
.traffic-level:disabled {
  opacity: 1;
}
.traffic-level:disabled .traffic-level-number {
  color: #a2b6b9;
}
.traffic-stars {
  display: inline-flex;
  gap: 3px;
  margin-top: 10px;
  white-space: nowrap;
}
.traffic-stars i {
  font-style: normal;
  color: #d5e2df;
  font-size: 13px;
  line-height: 1;
}
.traffic-stars i.earned {
  color: #e4b134;
}
.traffic-setup-card {
  padding: 24px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 18px;
}
.traffic-option-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 15px 0 25px;
}
.traffic-option-grid:last-child {
  margin-bottom: 0;
}
.traffic-option-grid button {
  border: 1px solid #dcebea;
  border-radius: 12px;
  background: #f8fbfa;
  padding: 17px 10px;
  color: #3e5f66;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
}
.traffic-option-grid small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  line-height: 1.5;
  margin-top: 5px;
}
.traffic-option-grid button[aria-pressed="true"] {
  background: #ecfaf4;
  border-color: #0fa694;
  color: #08776d;
  box-shadow: inset 0 0 0 1px #0fa694;
}
.traffic-mission-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 35px;
  background: white;
  border: 1px solid #cfe5e0;
  padding: 25px;
  border-radius: 18px;
  margin-top: 24px;
  box-shadow: 0 8px 25px #285d5510;
}
.traffic-mission-card h2 {
  font-size: 22px;
  letter-spacing: -0.025em;
  margin: 9px 0;
}
.traffic-mission-card p {
  font-size: 13px;
  line-height: 1.7;
  color: #5f7982;
  max-width: 550px;
  margin: 0;
}
.traffic-mission-services {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
}
.traffic-mission-services > span:last-child:not(.traffic-service-dot) {
  font-size: 11px;
  color: #6b848c;
  margin-left: 5px;
}
.traffic-service-dot {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  background: var(--service-color);
  border: 2px solid white;
  border-radius: 9px;
  color: white;
  font-weight: 800;
  font-size: 11px;
  box-shadow: 0 2px 5px #163c4618;
  line-height: 1;
}
.traffic-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 50px;
  padding: 14px 24px;
  background: #109f91;
  color: white;
  border: 0;
  border-radius: 13px;
  font-weight: 750;
  font-size: 14px;
  box-shadow: 0 4px 10px #0c8c821a;
}
.traffic-start:hover {
  background: #088a7e;
}
.traffic-mission-card > .traffic-start {
  min-width: 240px;
  white-space: nowrap;
}
.traffic-preferences {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin: 18px 0 35px;
  color: #72888f;
  font-size: 11px;
}
.traffic-sound {
  color: #537881;
  border: 1px solid #d7e7e5;
  border-radius: 10px;
  min-height: 38px;
  padding: 8px 13px;
  background: #fff;
  font-size: 11px;
  font-weight: 650;
}
.traffic-sound[aria-pressed="true"] {
  color: #087c72;
  background: #edf9f4;
  border-color: #83c4b9;
}
.traffic-howto {
  padding-top: 25px;
  border-top: 1px solid #e1eae7;
}
.traffic-howto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin-top: 20px;
}
.traffic-howto-grid article {
  display: flex;
  gap: 12px;
}
.traffic-howto-grid article > b {
  flex: 0 0 25px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  color: #158c80;
  background: #e3f4eb;
  font-size: 11px;
}
.traffic-howto-grid strong {
  font-size: 12px;
}
.traffic-howto p {
  font-size: 12px;
  line-height: 1.7;
  color: #657f86;
  margin: 7px 0 0;
}
.traffic-howto .traffic-howto-note {
  font-size: 11px;
  margin-top: 24px;
  color: #778d93;
}
.traffic-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8e8e3;
  background: #fff;
  color: #426970;
  border-radius: 12px;
  min-height: 45px;
  font-size: 13px;
  font-weight: 650;
  padding: 12px 20px;
}
.traffic-secondary:hover {
  background: #f0f8f5;
}
/* Fullscreen field preserves the photograph, service sprites, white HUD and cyan controls. */
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;
}
body.traffic-control-play-mode .site-header,
body.traffic-control-play-mode .install-app-banner {
  display: none !important;
}
.traffic-control-game {
  position: fixed;
  z-index: 1000;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, #dcf4f3, #b1d9df);
}
.traffic-game-shell {
  --field-width: min(100vw, max(360px, calc((100dvh - 266px) * 0.65)));
  display: flex;
  align-items: center;
  flex-direction: column;
  height: 100%;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.traffic-game-topbar {
  position: relative;
  flex: 0 0 64px;
  width: var(--field-width);
  background: #fbfefe;
  box-shadow: 0 5px 15px #1848571a;
  z-index: 30;
}
.traffic-game-actions {
  position: absolute;
  top: 10px;
  left: 7px;
  display: flex;
  gap: 5px;
  z-index: 2;
}
.traffic-icon-button {
  position: relative;
  width: 39px;
  height: 39px;
  border: 0;
  border-radius: 12px;
  background: #eaf8f7;
  color: #168f86;
}
.traffic-close {
  background: #fff0f0;
  color: #e36070;
}
.traffic-pause i::before,
.traffic-pause i::after {
  content: "";
  position: absolute;
  top: 11px;
  left: 12px;
  height: 18px;
  width: 5px;
  border-radius: 3px;
  background: currentColor;
}
.traffic-pause i::after {
  left: 22px;
}
.traffic-close i::before,
.traffic-close i::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 18px;
  width: 21px;
  height: 4px;
  background: currentColor;
  border-radius: 3px;
  transform: rotate(45deg);
}
.traffic-close i::after {
  transform: rotate(-45deg);
}
.traffic-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 44px 5px;
  gap: 3px 1px;
  padding: 4px 7px 5px 93px;
  height: 64px;
}
.traffic-hud > span {
  text-align: center;
  min-width: 0;
  display: grid;
  place-content: center;
  gap: 3px;
}
.traffic-hud small {
  color: #647d87;
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.traffic-hud strong {
  font-size: 15px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #284957;
}
.traffic-time-line {
  display: block;
  grid-column: 1/-1;
  height: 5px;
  background: #e3eded;
  border-radius: 5px;
  overflow: hidden;
}
.traffic-time-line b {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #13aa9d, #4bceb5);
  transition: width 0.15s linear;
  border-radius: 5px;
}
.traffic-board-wrap {
  width: var(--field-width);
  flex: 1;
  min-height: 0;
  box-shadow: 0 18px 45px #123e4e22;
}
.traffic-board {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
  overflow: hidden;
  background: #c9edf1 url("./generated/traffic-city-water-v9.webp") center/100%
    100%;
  touch-action: manipulation;
  user-select: none;
}
.traffic-road-map,
.traffic-vehicles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.traffic-road-map {
  z-index: 3;
  overflow: hidden;
}
.traffic-bridge-shadow {
  fill: none;
  stroke: #135e6b;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.3;
}
.traffic-road-arrow {
  fill: #f8f2d8;
  opacity: 0.65;
}
.traffic-switch-arrows path {
  fill: #f3f2de;
  opacity: 0.25;
  stroke: #454d4d;
  stroke-width: 1;
}
.traffic-switch-arrows path.is-open {
  fill: #ffe08b;
  opacity: 1;
}
.traffic-switch-arrows path.is-open.is-focused {
  stroke: #fff;
  stroke-width: 2;
}
.traffic-route-legend {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  z-index: 15;
  max-width: calc(100% - 95px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid #ffffffbd;
  border-radius: 22px;
  background: #183e4cd9;
  color: #fff;
  backdrop-filter: blur(8px);
  box-shadow: 0 5px 14px #11384326;
}
.traffic-route-legend span {
  font-size: 9px;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
}
.traffic-route-legend > i {
  flex: 0 0 18px;
  width: 18px;
  height: 4px;
  border-radius: 4px;
  background: #ecefe1;
}
.traffic-station {
  position: absolute;
  left: var(--station-x);
  top: var(--station-y);
  transform: translate(-50%, -50%);
  z-index: 12;
  width: 53px;
  height: 48px;
  background: var(--station-color);
  border: 4px solid white;
  border-radius: 15px;
  color: white;
  box-shadow:
    0 8px 16px #14394252,
    inset 0 -7px 0 #0f2c3a15;
  display: grid;
  place-items: center;
}
.traffic-station strong {
  font-size: 22px;
  line-height: 1;
  font-weight: 850;
}
.traffic-station-roof {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 25px;
  height: 22px;
  border: 3px solid white;
  background: var(--station-color);
  font-size: 9px;
  font-weight: 850;
  border-radius: 7px;
}
.traffic-station small {
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: #f8ffffe6;
  color: #315564;
  border-radius: 8px;
  padding: 4px 7px;
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 3px 8px #24546120;
}
.traffic-station.is-inactive {
  display: none;
}
.traffic-station.is-delivered {
  animation: traffic-delivered 0.45s ease;
}
.traffic-station.is-missed {
  animation: traffic-missed 0.4s ease;
}
.traffic-junction {
  position: absolute;
  left: var(--junction-x);
  top: var(--junction-y);
  transform: translate(-50%, -50%);
  z-index: 14;
  width: 46px;
  height: 46px;
  border: 2px solid #fff;
  border-radius: 50%;
  padding: 0;
  background: #f7fdfeec;
  color: #234c58;
  box-shadow:
    0 8px 18px #13363e50,
    inset 0 0 0 3px #ffffffc7,
    0 0 0 2px #46dce438;
  backdrop-filter: blur(6px);
  transition:
    box-shadow 0.12s,
    background 0.12s;
}
.traffic-junction b {
  display: block;
  margin-top: -7px;
  font-size: 17px;
  font-weight: 850;
  line-height: 1;
  text-shadow: 0 1px 0 white;
}
.traffic-junction small {
  position: absolute;
  left: -5px;
  top: -4px;
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #205361;
  color: white;
  font-size: 8px;
  border: 1px solid #bff5f4;
  font-weight: 750;
}
.traffic-junction i {
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: #456770;
  font-style: normal;
}
.traffic-junction:not(:disabled):hover {
  background: #fff;
  box-shadow:
    0 8px 18px #13363e50,
    0 0 0 4px #a1fffa7d;
}
.traffic-junction:not(:disabled):active {
  transform: translate(-50%, -50%) scale(0.94);
}
.traffic-junction.is-current {
  background: #087f78;
  color: white;
  border-color: #ccfff5;
  box-shadow:
    0 0 0 3px #22c3b4aa,
    0 5px 15px #123e4e50;
}
.traffic-junction.is-current b {
  text-shadow: none;
}
.traffic-junction.is-current i {
  color: white;
}
.traffic-junction.is-current:not(:disabled):hover {
  background: #076e68;
}
.traffic-junction.is-auto {
  width: 34px;
  height: 34px;
  opacity: 0.7;
  border-color: #ffffffd4;
}
.traffic-junction.is-auto b {
  font-size: 12px;
}
#traffic-control-trainer-screen .traffic-junction:focus-visible {
  outline: 3px solid white;
  outline-offset: 3px;
}
.traffic-junction.is-guided {
  animation: traffic-guide 1.25s infinite;
}
.traffic-entry {
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  width: 31px;
  height: 31px;
  background: #32cdd5;
  border: 3px solid white;
  border-radius: 50%;
  color: white;
  z-index: 8;
  text-align: center;
  font-size: 23px;
  font-weight: 900;
  line-height: 26px;
  box-shadow: 0 0 0 3px #31cbd650;
}
.traffic-vehicles {
  z-index: 11;
}
.traffic-vehicle {
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 56px;
  margin: 0;
  transform-origin: 0 0;
  border-radius: 42%;
  overflow: hidden;
  background: transparent;
  filter: drop-shadow(0 5px 3px #11222b75);
  will-change: transform;
}
.traffic-car-sprite {
  position: absolute;
  top: -19px;
  width: 223px;
  height: auto;
  max-width: none;
  pointer-events: 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;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 3px;
  border: 1px solid white;
  border-radius: 50%;
  background: #fffffff0;
  color: var(--vehicle-color);
  font: 900 11px/1 system-ui;
  box-shadow: 0 2px 4px #0d263631;
}
.traffic-vehicle.is-waiting {
  filter: drop-shadow(0 4px 3px #16354380) drop-shadow(0 0 5px #ffce7870);
}
.traffic-vehicle.is-focused {
  outline: 4px solid #fff6b4;
  outline-offset: 3px;
  filter: drop-shadow(0 4px 4px #162f3a90);
}
.traffic-control-dock {
  flex: 0 0 auto;
  width: var(--field-width);
  padding: 10px 12px;
  background: #fafffe;
  border-top: 1px solid #d7eae7;
  box-shadow: 0 -5px 18px #143c4826;
  z-index: 25;
}
.traffic-control-heading {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 34px;
  margin-bottom: 8px;
}
.traffic-focus-service {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #e7f3f0;
  font-weight: 800;
  color: #256359;
}
.traffic-focus-service .traffic-service-dot {
  width: 34px;
  height: 34px;
  font-size: 15px;
  border-radius: 10px;
}
.traffic-control-heading-text {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
}
.traffic-control-heading-text strong {
  font-size: 14px;
  line-height: 1.15;
}
.traffic-control-heading-text > span {
  font-size: 10px;
  color: #5a737a;
}
.traffic-focus-auto {
  min-height: 44px;
  padding: 0 9px;
  border: 1px solid #c3e1db;
  border-radius: 10px;
  background: #edf7f4;
  font-size: 11px;
  font-weight: 700;
  color: #166d60;
}
.traffic-direction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.traffic-direction {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  min-height: 112px;
  padding: 10px;
  border: 2px solid #d3e4e0;
  border-radius: 13px;
  background: #fff;
  color: #204b55;
  text-align: left;
  box-shadow: 0 2px 0 #dceae5;
  transition:
    background 0.1s,
    border-color 0.1s;
}
.traffic-direction[aria-pressed="true"] {
  border-color: #128778;
  background: #e8f8f0;
  box-shadow: 0 2px 0 #128778;
}
.traffic-direction:not(:disabled):hover {
  border-color: #128778;
}
.traffic-direction:not(:disabled):active {
  translate: 0 2px;
  box-shadow: none;
}
.traffic-direction:disabled {
  opacity: 0.55;
}
.traffic-direction-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 19px;
}
.traffic-direction-heading b {
  display: flex;
  gap: 4px;
  align-items: center;
  font-size: 14px;
  line-height: 1;
}
.traffic-direction-heading i {
  font-size: 18px;
  font-style: normal;
}
.traffic-direction-state {
  font-size: 9px;
  line-height: 1.2;
  color: #5b747b;
  font-weight: 750;
  white-space: nowrap;
}
.traffic-direction[aria-pressed="true"] .traffic-direction-state {
  color: #07654e;
}
.traffic-direction-services {
  display: grid;
  align-content: start;
  gap: 3px;
}
.traffic-destination {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 650;
}
.traffic-destination > i {
  display: grid;
  place-items: center;
  flex: 0 0 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--service-color);
  color: white;
  font-style: normal;
  font-size: 10px;
  font-weight: 850;
  text-shadow: 0 1px 2px #17403e66;
}
.traffic-direction.is-guided {
  border-color: #ce9b29;
  background: #fffae4;
  box-shadow: 0 0 0 3px #ffe6a0;
}
.traffic-control-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  min-height: 20px;
  margin-top: 8px;
}
.traffic-control-footer > span {
  font-size: 10px;
  line-height: 1.3;
  color: #58747a;
}
.traffic-next {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}
.traffic-next > small {
  font-size: 7px;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: #4c737b;
}
.traffic-next > span {
  display: flex;
  gap: 4px;
}
.traffic-next .traffic-service-dot {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  font-size: 8px;
  border-radius: 7px;
}
.traffic-board-message {
  position: absolute;
  z-index: 22;
  left: 50%;
  bottom: 65px;
  transform: translate(-50%, 8px);
  max-width: 90%;
  padding: 10px 14px;
  border-radius: 12px;
  color: white;
  background: #138c7bed;
  box-shadow: 0 5px 12px #16434c35;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.12s,
    transform 0.12s;
}
.traffic-board-message.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.traffic-board-message.is-error {
  background: #ba4054f0;
}
.traffic-board-message.is-info {
  background: #235766f0;
}
.traffic-tutorial-hint {
  position: absolute;
  z-index: 21;
  top: 42%;
  left: 8%;
  width: 84%;
  border-radius: 16px;
  padding: 18px;
  background: #fafffff2;
  box-shadow: 0 10px 35px #153d4560;
  border: 2px solid #5fddd3;
  line-height: 1.6;
}
.traffic-tutorial-hint strong {
  display: block;
  font-size: 14px;
  color: #294e5a;
  margin-bottom: 7px;
}
.traffic-tutorial-hint span {
  display: block;
  font-size: 12px;
  color: #4d717b;
}
.traffic-countdown-overlay,
.traffic-pause-overlay {
  position: absolute;
  z-index: 40;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: #133a4ab5;
  backdrop-filter: blur(7px);
  color: white;
  padding: 20px;
  text-align: center;
}
.traffic-countdown-overlay span {
  font-size: 14px;
  font-weight: 650;
}
.traffic-countdown-overlay strong {
  font-size: 100px;
  font-weight: 800;
  line-height: 1.2;
  margin: 15px;
}
.traffic-countdown-overlay p {
  font-size: 12px;
}
.traffic-pause-overlay {
  z-index: 50;
}
.traffic-pause-card {
  width: 100%;
  max-width: 330px;
  border: 1px solid #b9e0d9;
  background: #f8fffc;
  border-radius: 23px;
  padding: 27px 23px;
  color: #224c55;
  box-shadow: 0 15px 45px #10323f50;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.traffic-pause-card .traffic-kicker {
  justify-content: center;
  font-size: 9px;
}
.traffic-pause-card h2 {
  font-size: 25px;
  margin: 8px 0 0;
  letter-spacing: -0.03em;
}
.traffic-pause-card p {
  font-size: 12px;
  line-height: 1.6;
  color: #698188;
  margin: 0 0 10px;
}
.traffic-results-shell {
  max-width: 720px;
  text-align: center;
  padding-top: 40px;
}
.traffic-results-shell > .traffic-kicker {
  justify-content: center;
  font-size: 9px;
  line-height: 1.5;
}
.traffic-results-shell h1 {
  font-size: 34px;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 17px 0 0;
}
.traffic-results-shell > .traffic-stars {
  margin-top: 18px;
  gap: 12px;
}
.traffic-results-shell > .traffic-stars i {
  font-size: 38px;
}
.traffic-result-lead {
  font-size: 14px;
  line-height: 1.8;
  color: #6b8389;
  max-width: 510px;
  margin: 22px auto;
}
.traffic-results-score {
  border: 1px solid #cee6df;
  background: linear-gradient(140deg, #effbf5, #f8fdfb);
  border-radius: 23px;
  padding: 27px;
  display: grid;
  gap: 7px;
}
.traffic-results-score small {
  font-size: 12px;
  color: #64827f;
}
.traffic-results-score strong {
  font-size: 62px;
  letter-spacing: -0.05em;
  line-height: 1.1;
  color: #108f7d;
}
.traffic-results-score > span {
  font-size: 12px;
  color: #698789;
}
.traffic-results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 15px 0 23px;
}
.traffic-results-grid article {
  padding: 18px 7px;
  border: 1px solid #e1eae6;
  border-radius: 14px;
  background: white;
  display: grid;
  gap: 8px;
}
.traffic-results-grid span {
  font-size: 10px;
  color: #78908f;
}
.traffic-results-grid strong {
  font-size: 23px;
}
.traffic-result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.traffic-result-colors {
  margin-top: 35px;
  border-top: 1px solid #e0eae6;
  padding-top: 25px;
}
.traffic-result-colors > div {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-top: 20px;
}
.traffic-result-colors article {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 7px;
}
.traffic-result-colors strong {
  font-size: 19px;
}
.traffic-result-colors small {
  font-size: 10px;
  color: #708887;
}
.traffic-save-status,
.traffic-account-status {
  font-size: 11px;
  color: #708785;
  line-height: 1.6;
  margin: 24px 0 0;
}
.traffic-account-status {
  margin-top: 6px;
}
.traffic-card-art {
  position: relative;
  background:
    url("./generated/traffic-road-preview-v9.svg") 50% 55% / cover,
    url("./generated/traffic-city-water-v9.webp") 50% 55% / cover !important;
}
.traffic-card-art > b,
.traffic-card-art > i,
.traffic-card-art > em {
  position: absolute;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 3px solid white;
  border-radius: 9px;
  left: 18%;
  top: 24%;
  background: #2f7df4;
  color: white;
  font: bold 13px system-ui;
  box-shadow: 0 4px 12px #173b5250;
}
.traffic-card-art > i {
  left: auto;
  right: 13%;
  top: 45%;
  background: #ef3f45;
}
.traffic-card-art > em {
  left: 38%;
  top: 70%;
  background: #edb124;
}
@keyframes traffic-delivered {
  50% {
    box-shadow:
      0 0 0 9px #dcfff9a3,
      0 0 25px #12efd9;
    filter: brightness(1.25);
  }
}
@keyframes traffic-missed {
  30% {
    translate: -4px 0;
  }
  60% {
    translate: 4px 0;
  }
}
@keyframes traffic-guide {
  50% {
    box-shadow:
      0 0 0 14px #93fff387,
      0 0 0 26px #adfff72b;
  }
}
@media (max-width: 700px) {
  .traffic-setup-shell {
    padding: 20px 18px 35px;
  }
  .traffic-hero {
    gap: 15px;
    grid-template-columns: 1.2fr 0.8fr;
  }
  .traffic-hero-map {
    height: 180px;
  }
  .traffic-hero p {
    font-size: 13px;
  }
  .traffic-hero-records {
    gap: 12px;
    font-size: 10px;
  }
  .traffic-hero-records strong {
    font-size: 16px;
  }
  .traffic-level-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
  }
  .traffic-level {
    padding: 13px;
    min-height: 137px;
  }
  .traffic-level.selected {
    padding: 12px;
  }
  .traffic-mission-card {
    flex-direction: column;
    gap: 20px;
    padding: 22px;
    align-items: stretch;
  }
  .traffic-mission-card > .traffic-start {
    width: 100%;
  }
  .traffic-howto-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .traffic-option-grid {
    gap: 7px;
  }
  .traffic-option-grid button {
    padding: 13px 9px;
    font-size: 12px;
  }
  .traffic-results-shell {
    padding: 30px 18px;
  }
  .traffic-mode-tabs button {
    font-size: 13px;
    padding: 12px 5px;
  }
}
@media (max-width: 500px) and (orientation: portrait) {
  .traffic-game-shell {
    --field-width: 100vw;
  }
  .traffic-hero {
    display: block;
  }
  .traffic-hero-map {
    display: none;
  }
  .traffic-hero h1 {
    font-size: 34px;
    max-width: 310px;
  }
  .traffic-hero p {
    font-size: 14px;
  }
  .traffic-hero-records {
    gap: 25px;
    margin-top: 20px;
  }
  .traffic-mode-tabs {
    margin-bottom: 25px;
  }
  .traffic-preferences {
    align-items: flex-start;
  }
  .traffic-preferences > span {
    max-width: 180px;
    text-align: right;
    line-height: 1.5;
  }
  .traffic-results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .traffic-result-colors > div {
    gap: 12px;
  }
  .traffic-result-colors small {
    font-size: 8px;
  }
  .traffic-result-actions {
    flex-direction: column;
  }
  .traffic-results-shell h1 {
    font-size: 30px;
  }
  .traffic-level strong {
    font-size: 11px;
  }
  .traffic-level-number {
    margin-bottom: 11px;
  }
}
@media (max-width: 360px) {
  .traffic-level {
    padding: 10px;
  }
  .traffic-level.selected {
    padding: 9px;
  }
  .traffic-level strong {
    font-size: 10px;
  }
  .traffic-level > small {
    font-size: 9px;
  }
  .traffic-mode-tabs button small {
    font-size: 9px;
  }
  .traffic-junction {
    width: 46px;
    height: 46px;
  }
  .traffic-station {
    width: 48px;
    height: 43px;
  }
  .traffic-station strong {
    font-size: 19px;
  }
  .traffic-station small {
    font-size: 7px;
  }
  .traffic-hud {
    padding-left: 86px;
  }
  .traffic-game-actions {
    left: 5px;
    gap: 3px;
  }
  .traffic-icon-button {
    width: 36px;
  }
  .traffic-hud small {
    font-size: 6px;
  }
  .traffic-hud strong {
    font-size: 14px;
  }
  .traffic-route-legend {
    max-width: calc(100% - 80px);
    padding: 7px 9px;
  }
  .traffic-route-legend span {
    font-size: 8px;
  }
}
@media (orientation: landscape) and (max-height: 600px) {
  .traffic-game-shell {
    --field-width: min(48vw, max(290px, calc((100dvh - 54px) * 0.8)));
    display: grid;
    grid-template-columns: var(--field-width) minmax(270px, 320px);
    grid-template-rows: 54px minmax(0, 1fr);
    justify-content: center;
    align-items: stretch;
  }
  .traffic-game-topbar {
    grid-column: 1;
    grid-row: 1;
  }
  .traffic-board-wrap {
    grid-column: 1;
    grid-row: 2;
  }
  .traffic-control-dock {
    grid-column: 2;
    grid-row: 1 / -1;
    width: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 0;
    border-left: 1px solid #d7eae7;
  }
  .traffic-control-heading {
    margin-bottom: 16px;
  }
  .traffic-control-footer {
    flex-wrap: wrap;
    margin-top: 16px;
  }
  .traffic-next {
    margin-top: 4px;
  }
  .traffic-hud {
    height: 54px;
    grid-template-rows: 35px 4px;
  }
  .traffic-game-actions {
    top: 6px;
  }
  .traffic-junction {
    width: 44px;
    height: 44px;
  }
  .traffic-junction b {
    font-size: 15px;
  }
  .traffic-junction.is-auto {
    width: 24px;
    height: 24px;
  }
  .traffic-station {
    width: 40px;
    height: 36px;
  }
  .traffic-station strong {
    font-size: 16px;
  }
  .traffic-station small {
    font-size: 7px;
    padding: 2px 4px;
  }
  .traffic-route-legend {
    top: 4px;
    padding: 5px 8px;
  }
  .traffic-next {
    padding: 4px;
    bottom: 4px;
  }
  .traffic-next > small {
    display: none;
  }
  .traffic-pause-card {
    padding: 14px;
    gap: 5px;
  }
  .traffic-pause-card .traffic-start,
  .traffic-pause-card .traffic-secondary {
    min-height: 36px;
    padding: 8px;
  }
  .traffic-pause-card h2 {
    font-size: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #traffic-control-trainer-screen * {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 700px) {
  .traffic-setup-shell {
    display: flex;
    flex-direction: column;
  }
  .traffic-back {
    align-self: flex-start;
    order: -2;
  }
  .traffic-hero {
    order: -1;
  }
  .traffic-mode-tabs {
    order: 0;
    margin-bottom: 0;
  }
  .traffic-mission-card {
    order: 1;
    margin: 20px 0;
  }
  .traffic-level-section,
  .traffic-setup-card {
    order: 2;
  }
  .traffic-preferences {
    order: 3;
  }
  .traffic-howto {
    order: 4;
  }
}
