:root {
  color-scheme: dark;
  --bg: #171c2b;
  --panel: #242b3d;
  --panel-soft: #30384e;
  --ink: #f7f9ff;
  --muted: #b9c1d5;
  --road: #343947;
  --road-line: #f4d35e;
  --grass: #3aa36a;
  --river: #2f99c9;
  --coin: #ffd44d;
  --accent: #5dd7a1;
  --accent-dark: #1d8d63;
  --blue: #4fc3f7;
  --pink: #f76f8e;
  --danger: #ff6b6b;
  --vip: #f59f36;
  --shadow: rgba(0, 0, 0, 0.22);
  /* Reserved space for the native AdMob banner; updated at runtime. */
  --ad-banner-space: 0px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(79, 195, 247, 0.22), transparent 38%),
    linear-gradient(180deg, #22283a, var(--bg) 46%, #101520);
  color: var(--ink);
  touch-action: manipulation;
  user-select: none;
}

button {
  appearance: none;
  border: 0;
  color: inherit;
  font: inherit;
  touch-action: manipulation;
}

button:focus-visible {
  outline: 3px solid rgba(255, 212, 77, 0.9);
  outline-offset: 2px;
}

button:disabled {
  cursor: default;
}

.game-shell {
  display: grid;
  grid-template-rows: 44px minmax(300px, 1fr) auto 52px;
  gap: 7px;
  width: 100%;
  max-width: 430px;
  height: calc(100dvh - var(--ad-banner-space));
  min-height: 560px;
  margin: 0 auto;
  padding: max(8px, env(safe-area-inset-top)) max(9px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(9px, env(safe-area-inset-left));
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 6%, rgba(93, 215, 161, 0.18), transparent 24%),
    radial-gradient(circle at 88% 10%, rgba(255, 212, 77, 0.12), transparent 24%),
    linear-gradient(180deg, #222b40 0%, #111722 100%);
}

.top-bar,
.yard-header,
.action-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.top-bar,
.plaza,
.booth-yard,
.action-bar {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.top-bar {
  display: grid;
  grid-template-columns: minmax(76px, 0.9fr) 54px minmax(88px, 1.2fr) 36px 36px 36px;
  gap: 6px;
  min-height: 44px;
}

.wallet,
.city-progress,
.booth-yard,
.modal-panel {
  background: linear-gradient(180deg, rgba(46, 55, 78, 0.96), rgba(26, 32, 48, 0.96));
  box-shadow: 0 10px 26px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.wallet {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 42px;
  padding: 0 8px;
  border-radius: 8px;
  font-weight: 850;
}

.wallet #coins {
  overflow: hidden;
  min-width: 0;
  font-size: clamp(14px, 4.2vw, 18px);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-bump {
  animation: wallet-bump 0.55s ease;
}

.prestige-badge {
  display: grid;
  place-items: center;
  min-height: 42px;
  min-width: 0;
  padding: 0 6px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 212, 77, 0.18), rgba(245, 159, 54, 0.1));
  border: 1px solid rgba(255, 212, 77, 0.22);
  color: #fff7c0;
  font-size: 9px;
  font-weight: 950;
  line-height: 1.05;
  text-align: center;
  white-space: pre-line;
}

.coin-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--coin);
  color: #6d4700;
  font-weight: 950;
}

.city-progress {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  padding: 7px 8px;
  border-radius: 8px;
}

.city-progress span {
  display: block;
  margin-bottom: 5px;
  overflow: hidden;
  min-height: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #131826;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5dd7a1, #f4d35e);
  transition: width 0.25s ease;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 42px;
  border-radius: 8px;
  background: var(--panel-soft);
  font-size: 20px;
  font-weight: 900;
}

.restart-button {
  color: var(--coin);
}

.plaza {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  border-radius: 8px;
  background:
    radial-gradient(circle at 72% 4%, rgba(255, 212, 77, 0.45), transparent 17%),
    linear-gradient(180deg, #78cfff 0 18%, #3c93c7 18% 31%, #45ad70 31% 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 18px 28px rgba(255, 255, 255, 0.12),
    inset 0 -24px 0 rgba(0, 0, 0, 0.05),
    0 12px 34px var(--shadow),
    0 0 0 1px rgba(0, 0, 0, 0.18);
}

.plaza::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 90px;
  z-index: 2;
  height: 28px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 247, 192, 0.34) 0 7px, transparent 7px 17px),
    linear-gradient(180deg, rgba(27, 42, 66, 0.2), rgba(27, 42, 66, 0.56));
  clip-path: polygon(0 36%, 9% 36%, 9% 16%, 18% 16%, 18% 44%, 28% 44%, 28% 8%, 39% 8%, 39% 38%, 51% 38%, 51% 18%, 60% 18%, 60% 45%, 71% 45%, 71% 12%, 82% 12%, 82% 36%, 100% 36%, 100% 100%, 0 100%);
  pointer-events: none;
}

.plaza::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 18%),
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.28), transparent 12%);
  pointer-events: none;
}

.theme-chicago .plaza {
  background:
    linear-gradient(180deg, #b8d9ff 0 21%, #4b7da3 21% 31%, #6ca06e 31% 100%);
}

.theme-miami .plaza {
  background:
    linear-gradient(180deg, #7ee7ff 0 21%, #27b5c9 21% 32%, #70c66f 32% 100%);
}

.theme-tokyo .plaza {
  background:
    linear-gradient(180deg, #f0b4ff 0 21%, #5f7bd8 21% 32%, #5faa83 32% 100%);
}

.ny-badge {
  display: none;
}

.river {
  position: absolute;
  inset: 90px 0 auto;
  z-index: 0;
  height: 34px;
  opacity: 0.86;
  background:
    repeating-linear-gradient(145deg, rgba(255, 255, 255, 0.18) 0 18px, transparent 18px 36px),
    linear-gradient(90deg, #237caf, var(--river), #54bddc);
}

.theme-chicago .river {
  background:
    repeating-linear-gradient(145deg, rgba(255, 255, 255, 0.14) 0 18px, transparent 18px 36px),
    linear-gradient(90deg, #3b6686, #4b7da3, #7fa9bd);
}

.theme-miami .river {
  background:
    repeating-linear-gradient(145deg, rgba(255, 255, 255, 0.22) 0 18px, transparent 18px 36px),
    linear-gradient(90deg, #16a5b8, #25d1d0, #67e5cf);
}

.theme-tokyo .river {
  background:
    repeating-linear-gradient(145deg, rgba(255, 255, 255, 0.18) 0 18px, transparent 18px 36px),
    linear-gradient(90deg, #4e63c8, #7968e8, #de91ff);
}

.bridge {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 102px;
  z-index: 3;
  height: 28px;
  border-top: 3px solid rgba(255, 247, 192, 0.58);
  border-bottom: 3px solid rgba(255, 247, 192, 0.4);
  opacity: 0.62;
  pointer-events: none;
}

.bridge::before,
.bridge::after {
  content: "";
  position: absolute;
  bottom: -4px;
  width: 10px;
  height: 34px;
  border-radius: 5px 5px 0 0;
  background: rgba(255, 247, 192, 0.68);
}

.bridge::before {
  left: 18%;
}

.bridge::after {
  right: 18%;
}

.bridge span {
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 2px;
  background: rgba(255, 247, 192, 0.7);
  transform: rotate(18deg);
}

.bridge span:nth-child(1) { left: 28%; }
.bridge span:nth-child(2) { left: 50%; transform: rotate(0); }
.bridge span:nth-child(3) { right: 28%; transform: rotate(-18deg); }

.theme-chicago .bridge {
  border-top-color: rgba(164, 203, 214, 0.82);
  border-bottom-color: rgba(164, 203, 214, 0.62);
}

.theme-miami .bridge {
  border-top-color: rgba(255, 247, 192, 0.86);
  border-bottom-color: rgba(255, 159, 104, 0.68);
}

.theme-tokyo .bridge {
  border-top-color: rgba(255, 180, 245, 0.86);
  border-bottom-color: rgba(112, 214, 255, 0.68);
}

.sun {
  position: absolute;
  top: 20px;
  right: 26px;
  width: 26px;
  height: 26px;
  opacity: 0.84;
  border-radius: 50%;
  background: #ffd44d;
  box-shadow: 0 0 0 10px rgba(255, 212, 77, 0.16), 0 0 32px rgba(255, 212, 77, 0.42);
}

.cloud {
  position: absolute;
  z-index: 1;
  width: 72px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  opacity: 0.58;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  bottom: 7px;
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  left: 12px;
  width: 28px;
  height: 28px;
}

.cloud::after {
  right: 11px;
  width: 36px;
  height: 36px;
}

.cloud-a {
  top: 30px;
  left: 18px;
  animation: drift 13s linear infinite;
}

.cloud-b {
  top: 50px;
  left: 60%;
  transform: scale(0.74);
  animation: drift 18s linear infinite reverse;
}

.skyline {
  position: absolute;
  inset: 24px 8px auto;
  display: flex;
  align-items: end;
  gap: 5px;
  height: 72px;
  z-index: 2;
  opacity: 0.68;
}

.skyline span {
  display: block;
  position: relative;
  flex: 1;
  min-width: 18px;
  border-radius: 3px 3px 0 0;
  background:
    repeating-linear-gradient(180deg, rgba(255, 247, 192, 0.26) 0 4px, transparent 4px 12px),
    linear-gradient(180deg, #657d91, #2e415a);
  box-shadow: inset 0 9px 0 rgba(255, 255, 255, 0.07);
}

.theme-chicago .skyline span {
  background:
    repeating-linear-gradient(180deg, rgba(255, 247, 192, 0.18) 0 5px, transparent 5px 14px),
    linear-gradient(180deg, #7c8898, #273246);
}

.theme-miami .skyline span {
  background:
    repeating-linear-gradient(180deg, rgba(255, 247, 192, 0.24) 0 4px, transparent 4px 13px),
    linear-gradient(180deg, #ffb07c, #4b6f87);
}

.theme-tokyo .skyline span {
  background:
    repeating-linear-gradient(180deg, rgba(255, 247, 192, 0.3) 0 4px, transparent 4px 11px),
    linear-gradient(180deg, #8f74e8, #26345f);
}

.skyline span:nth-child(1) { height: 38px; }
.skyline span:nth-child(2) { height: 58px; }
.skyline span:nth-child(3) { height: 76px; }
.skyline span:nth-child(4) { height: 48px; }
.skyline span:nth-child(5) { height: 68px; }
.skyline span:nth-child(6) { height: 54px; }
.skyline span:nth-child(7) { height: 38px; }

.skyline .empire::before,
.skyline .spire::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 5px;
  height: 18px;
  border-radius: 4px 4px 0 0;
  background: #fff7c0;
  transform: translateX(-50%);
}

.skyline .empire::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 16px);
  width: 2px;
  height: 16px;
  background: #fff7c0;
  transform: translateX(-50%);
}

.skyline .spire {
  clip-path: polygon(0 12%, 42% 12%, 50% 0, 58% 12%, 100% 12%, 100% 100%, 0 100%);
}

.borough-track {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 104px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  pointer-events: none;
}

.borough-track span {
  overflow: hidden;
  padding: 6px 4px;
  min-height: 26px;
  border-radius: 8px;
  background: rgba(16, 24, 39, 0.82);
  color: rgba(247, 249, 255, 0.72);
  font-size: 8px;
  line-height: 1.35;
  font-weight: 950;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.traffic-assist {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 12;
  display: grid;
  gap: 2px;
  min-width: 132px;
  padding: 8px 12px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 10px, transparent 10px 20px),
    linear-gradient(180deg, rgba(79, 195, 247, 0.98), rgba(34, 105, 181, 0.98));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32), 0 0 28px rgba(79, 195, 247, 0.48), inset 0 0 0 2px rgba(255, 255, 255, 0.22);
  color: #fff;
  text-align: center;
  transform: translate(-50%, -50%);
  animation: traffic-assist 1.15s ease forwards;
  pointer-events: none;
}

.traffic-assist span {
  color: #fff7c0;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.traffic-assist strong {
  font-size: 14px;
  line-height: 1;
}

.traffic-assist em {
  color: #fff7c0;
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
}

.assist-marker {
  position: absolute;
  left: -42px;
  z-index: 11;
  width: 46px;
  height: 28px;
  border-radius: 10px 16px 7px 7px;
  background:
    radial-gradient(circle at 78% 34%, rgba(255, 255, 255, 0.72) 0 3px, transparent 4px),
    linear-gradient(90deg, #f7f3dc 0 42%, #2f68ff 42%);
  box-shadow: 0 0 0 2px #fff, 0 0 24px rgba(79, 195, 247, 0.95);
  animation: assist-car 1.05s ease-out forwards;
  pointer-events: none;
}

.assist-marker::before {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  top: -5px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff4f6d, #4fc3f7);
  box-shadow: 0 0 10px rgba(79, 195, 247, 0.9);
}

.car.cleared {
  filter: drop-shadow(0 0 12px rgba(79, 195, 247, 0.95)) brightness(1.25);
  animation: cleared-car 0.55s ease both;
}

.borough-track .active {
  background: linear-gradient(180deg, #ffd44d, #f59f36);
  color: #28200b;
}

.road {
  position: absolute;
  inset: 138px 0 0;
  display: grid;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  background: var(--grass);
}

.district-1 {
  --road: #343947;
  --road-line: #f4d35e;
}

.district-2 {
  --road: #2f3544;
  --road-line: #d7f4ff;
}

.district-2 .road {
  background:
    linear-gradient(90deg, rgba(28, 109, 148, 0.95) 0 11%, transparent 11% 89%, rgba(28, 109, 148, 0.95) 89%),
    #2f7b56;
}

.district-2 .lane {
  border-top-style: solid;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 10%, transparent 10%),
    repeating-linear-gradient(90deg, transparent 0 28px, rgba(255, 255, 255, 0.05) 28px 31px),
    linear-gradient(90deg, transparent 0 58%, rgba(215, 244, 255, 0.16) 58% 60%, transparent 60%),
    var(--road);
}

.district-3 {
  --road: #3a3142;
  --road-line: #ffcf56;
}

.district-3 .road {
  background:
    linear-gradient(90deg, rgba(82, 58, 99, 0.84) 0 8%, transparent 8% 92%, rgba(82, 58, 99, 0.84) 92%),
    #3aa36a;
}

.district-3 .lane {
  background:
    linear-gradient(90deg, rgba(255, 207, 86, 0.08) 0 18%, transparent 18%),
    radial-gradient(circle at 11% 50%, rgba(255, 207, 86, 0.12) 0 10px, transparent 11px),
    linear-gradient(90deg, transparent 0 58%, rgba(255, 207, 86, 0.18) 58% 60%, transparent 60%),
    var(--road);
}

.district-4 {
  --road: #283440;
  --road-line: #70d6ff;
}

.district-4 .road {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 4px, transparent 4px 18px),
    #2f6f68;
}

.district-4 .lane {
  background:
    linear-gradient(90deg, rgba(112, 214, 255, 0.1) 0 12%, transparent 12%),
    linear-gradient(90deg, transparent 0 58%, rgba(112, 214, 255, 0.2) 58% 60%, transparent 60%),
    var(--road);
}

.district-5 {
  --road: #202634;
  --road-line: #ffd44d;
}

.district-5 .road {
  background:
    linear-gradient(90deg, rgba(255, 212, 77, 0.12) 0 6%, transparent 6% 94%, rgba(255, 212, 77, 0.12) 94%),
    linear-gradient(180deg, #2e7f54, #236945);
}

.district-5 .lane {
  border-top-color: rgba(255, 212, 77, 0.82);
  background:
    repeating-linear-gradient(90deg, rgba(255, 212, 77, 0.08) 0 12px, transparent 12px 42px),
    linear-gradient(90deg, transparent 0 58%, rgba(255, 212, 77, 0.24) 58% 60%, transparent 60%),
    var(--road);
}

.lane {
  position: relative;
  overflow: hidden;
  min-height: 0;
  border-top: 3px dashed rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.22), transparent 12%, transparent 86%, rgba(255, 255, 255, 0.07)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 14%, transparent 14%),
    radial-gradient(circle at 8% 50%, rgba(255, 255, 255, 0.08) 0 12px, transparent 13px),
    linear-gradient(90deg, transparent 0 58%, rgba(255, 255, 255, 0.13) 58% 60%, transparent 60%),
    var(--road);
  box-shadow: inset 0 9px 14px rgba(0, 0, 0, 0.16), inset 0 -8px 10px rgba(255, 255, 255, 0.04);
}

.lane.jammed {
  box-shadow: inset 0 0 0 2px rgba(255, 212, 77, 0.34);
}

.lane.gridlocked {
  box-shadow: inset 0 0 0 3px rgba(255, 107, 107, 0.72), inset 0 0 28px rgba(255, 107, 107, 0.34);
  animation: lane-gridlock 0.5s ease-in-out infinite alternate;
}

.vip-lane {
  background:
    linear-gradient(90deg, rgba(255, 212, 77, 0.12), rgba(245, 159, 54, 0.2)),
    radial-gradient(circle at 8% 50%, rgba(255, 255, 255, 0.08) 0 12px, transparent 13px),
    var(--road);
}

.vip-lane::before {
  content: attr(data-label);
  position: absolute;
  left: 12px;
  top: 50%;
  z-index: 2;
  color: rgba(255, 212, 77, 0.72);
  font-size: 13px;
  font-weight: 950;
  transform: translateY(-50%);
}

.lane:not(.vip-lane)::before {
  content: attr(data-label);
  position: absolute;
  left: 12px;
  top: 50%;
  z-index: 2;
  color: rgba(247, 249, 255, 0.5);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  transform: translateY(-50%);
}

.lane:first-child {
  border-top: 0;
}

.lane::after {
  content: "";
  position: absolute;
  right: 27%;
  top: 0;
  bottom: 0;
  width: 7px;
  background: repeating-linear-gradient(180deg, var(--road-line) 0 22px, transparent 22px 42px);
  opacity: 0.8;
}

.lane:not(.locked) .toll-gate::after {
  content: "";
  position: absolute;
  right: -14px;
  top: 50%;
  width: 10px;
  height: 42%;
  border-radius: 999px;
  background: repeating-linear-gradient(180deg, #ff6b6b 0 8px, #ffd44d 8px 16px, #35e17a 16px 24px);
  box-shadow: 0 0 12px rgba(255, 212, 77, 0.34);
  transform: translateY(-50%);
}

.lane-grade {
  position: absolute;
  left: 7px;
  bottom: 6px;
  z-index: 4;
  display: grid;
  place-items: center;
  min-width: 68px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(19, 24, 38, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff7c0;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0;
}

.lane.flow-pick {
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(109, 240, 163, 0.56), inset 0 0 26px rgba(109, 240, 163, 0.14);
}

.flow-upgrade-chip {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 8;
  display: none;
  min-width: 62px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  place-items: center;
  background: linear-gradient(180deg, #72f3aa, #1ebc78);
  border: 1px solid rgba(255, 255, 255, 0.44);
  color: #08291d;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25), 0 0 18px rgba(109, 240, 163, 0.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.lane.flow-pick .flow-upgrade-chip {
  display: grid;
}

.lane-jam-chip {
  display: none;
}

.lane.locked {
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(-45deg, rgba(30, 36, 52, 0.82) 0 18px, rgba(47, 55, 74, 0.82) 18px 36px),
    var(--road);
}

.lane.locked .lane-grade {
  display: none;
}

.lane:not(.locked) .lane-lock {
  display: none;
}

.lane-lock {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 5px;
  width: min(164px, 70%);
  padding: 8px 9px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 212, 77, 0.96), rgba(245, 159, 54, 0.94));
  border: 2px solid rgba(255, 247, 192, 0.72);
  color: #fff;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(109, 71, 0, 0.3), 0 14px 22px rgba(0, 0, 0, 0.26);
  text-shadow: 0 1px 0 rgba(72, 42, 0, 0.26);
}

.lane-lock:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.lane-lock span {
  display: inline-grid;
  place-items: center;
  min-height: 22px;
  border-radius: 999px;
  background: rgba(19, 24, 38, 0.88);
  color: #fff7c0;
  font-size: 11px;
  font-weight: 950;
}

.car {
  position: absolute;
  left: 0;
  top: calc(50% - 15px);
  z-index: 3;
  width: var(--car-width, 48px);
  height: 28px;
  border-radius: 15px 17px 9px 9px;
  background:
    radial-gradient(circle at calc(100% - 4px) 58%, rgba(255, 247, 192, 0.95) 0 2px, transparent 3px),
    radial-gradient(circle at 80% 33%, rgba(255, 255, 255, 0.52) 0 3px, transparent 4px),
    var(--car-color, #f25f5c);
  box-shadow:
    inset 0 -6px 0 rgba(0, 0, 0, 0.13),
    0 4px 0 rgba(0, 0, 0, 0.12),
    12px 1px 14px rgba(255, 247, 192, 0.1);
  transform: translateX(var(--x, 0));
  transition: filter 0.15s ease;
}

.car.taxi {
  border-radius: 10px 18px 8px 8px;
  background:
    radial-gradient(circle at calc(100% - 4px) 58%, rgba(255, 247, 192, 0.95) 0 2px, transparent 3px),
    linear-gradient(90deg, transparent 0 36%, rgba(26, 29, 39, 0.85) 36% 46%, transparent 46% 56%, rgba(26, 29, 39, 0.85) 56% 66%, transparent 66%),
    radial-gradient(circle at 82% 34%, rgba(255, 255, 255, 0.5) 0 3px, transparent 4px),
    var(--car-color, #ffd44d);
}

.car.taxi::before {
  left: 14px;
  width: 23px;
  background: #fff7c0;
}

.car.taxi::after {
  background:
    radial-gradient(circle at 8px 50%, #1a1d27 0 4px, transparent 4px),
    radial-gradient(circle at calc(100% - 8px) 50%, #1a1d27 0 4px, transparent 4px),
    linear-gradient(90deg, transparent 0 35%, #1a1d27 35% 65%, transparent 65%);
}

.car.van {
  height: 30px;
  border-radius: 8px 13px 8px 8px;
}

.car.van::before {
  left: 28px;
  width: 18px;
  border-radius: 5px;
}

.car.van::after {
  left: 9px;
  right: 9px;
}

.car.suv {
  height: 31px;
  border-radius: 13px 14px 9px 9px;
}

.car.suv::before {
  left: 12px;
  width: 31px;
}

.car.truck {
  height: 31px;
  border-radius: 7px 10px 7px 7px;
  background:
    radial-gradient(circle at calc(100% - 4px) 58%, rgba(255, 247, 192, 0.95) 0 2px, transparent 3px),
    linear-gradient(90deg, rgba(20, 24, 36, 0.18) 0 34%, transparent 34%),
    radial-gradient(circle at 84% 34%, rgba(255, 255, 255, 0.5) 0 3px, transparent 4px),
    var(--car-color, #ffcf56);
}

.car.truck::before {
  left: 37px;
  top: 6px;
  width: 14px;
  height: 10px;
  border-radius: 3px;
}

.car.truck::after {
  left: 8px;
  right: 8px;
}

.car.sports {
  height: 25px;
  border-radius: 20px 24px 7px 10px;
  transform: translateX(var(--x, 0)) skewX(-4deg);
}

.car.sports::before {
  left: 16px;
  top: 5px;
  width: 24px;
  height: 8px;
  border-radius: 9px 10px 2px 2px;
}

.car.police {
  background:
    linear-gradient(90deg, transparent 0 40%, #fff 40% 60%, transparent 60%),
    radial-gradient(circle at 80% 33%, rgba(255, 255, 255, 0.52) 0 3px, transparent 4px),
    var(--car-color, #2f68ff);
}

.car.police::before {
  background: linear-gradient(90deg, #ff6b6b, #e7f7ff 45%, #70d6ff);
}

.car::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 5px;
  width: 23px;
  height: 10px;
  border-radius: 8px 9px 3px 3px;
  background: rgba(226, 245, 255, 0.86);
}

.car::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: -4px;
  height: 8px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 8px 50%, #1a1d27 0 4px, transparent 4px),
    radial-gradient(circle at calc(100% - 8px) 50%, #1a1d27 0 4px, transparent 4px);
}

.car.vip {
  width: var(--car-width, 64px);
  border-radius: 14px 22px 9px 9px;
  background: linear-gradient(90deg, #171d2c, #34415f);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.22), 0 0 0 2px #ffd44d, 0 5px 0 rgba(0, 0, 0, 0.16);
}

.car.limo {
  height: 27px;
  border-radius: 11px 24px 8px 8px;
}

.car.vip::before {
  width: 34px;
  background: linear-gradient(90deg, #e7f7ff, #ffd44d);
}

.jam-banner {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 6;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 107, 107, 0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  user-select: none;
}

.jam-banner.danger {
  animation: jam-alert 0.55s ease infinite alternate;
}

.jam-banner.clear-ready {
  right: 50%;
  bottom: 10px;
  min-width: 190px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #4fc3f7, #2269b5);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3), 0 0 18px rgba(79, 195, 247, 0.55);
  text-align: center;
  transform: translateX(50%);
}

.jam-banner.manager-check {
  right: 50%;
  bottom: 10px;
  min-width: 188px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #ffd44d, #f59f36);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3), 0 0 18px rgba(255, 212, 77, 0.45);
  color: #2f2400;
  text-align: center;
  transform: translateX(50%);
}

.jam-banner.hidden {
  display: none;
}

.car.rush {
  filter: drop-shadow(0 0 10px rgba(255, 212, 77, 0.9));
}

.car.paused-car {
  filter: grayscale(0.35) brightness(0.86);
}

.toll-gate {
  position: absolute;
  right: 8%;
  top: 10px;
  z-index: 4;
  display: grid;
  place-items: center;
  gap: 1px;
  width: 50px;
  height: calc(100% - 20px);
  border-radius: 8px;
  background: linear-gradient(180deg, #f8f0cf 0 38%, var(--booth-color, #5dd7a1) 38%);
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.14), inset 0 0 0 3px rgba(255, 255, 255, 0.24);
  color: #20283a;
  font-weight: 950;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.toll-gate em {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 42px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: rgba(32, 40, 58, 0.68);
  font-size: 7px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  transform: translate(-50%, -50%);
}

.toll-gate small {
  display: block;
  color: rgba(32, 40, 58, 0.72);
  font-size: 8px;
  font-weight: 950;
  line-height: 1;
}

.lane-drop {
  position: absolute;
  right: 7%;
  top: 12px;
  z-index: 4;
  display: grid;
  place-items: center;
  gap: 2px;
  width: 64px;
  height: calc(100% - 24px);
  border-radius: 8px;
  background: rgba(19, 24, 38, 0.42);
  border: 2px dashed rgba(255, 212, 77, 0.45);
  color: rgba(255, 247, 192, 0.86);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
}

.lane-drop span,
.lane-drop small {
  display: block;
  pointer-events: none;
}

.lane-drop span {
  font-size: 10px;
}

.lane-drop small {
  color: rgba(255, 247, 192, 0.72);
  font-size: 8px;
}

.booth-slot.drop-hover,
.toll-gate.drop-hover,
.lane-drop.drop-hover {
  outline: 3px solid rgba(255, 212, 77, 0.76);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(255, 212, 77, 0.18), 0 12px 24px rgba(0, 0, 0, 0.24);
}

.lane.drop-hover {
  outline: 3px solid rgba(255, 212, 77, 0.58);
  outline-offset: -4px;
}

.vip-lane .toll-gate {
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.14), inset 0 0 0 3px rgba(255, 212, 77, 0.34), 0 0 18px rgba(255, 212, 77, 0.32);
}

.toll-gate::before {
  content: "";
  position: absolute;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #35e17a;
  box-shadow: 16px 0 0 #ffd44d, -16px 0 0 #ff6b6b;
}

.toll-gate.processing {
  animation: pulse 0.22s ease;
}

.queue-meter {
  position: absolute;
  right: 4px;
  top: 8px;
  bottom: 8px;
  z-index: 4;
  width: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
}

.queue-meter span {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 0;
  border-radius: inherit;
  background: var(--danger);
  transition: height 0.2s ease;
}

.coin-pop {
  position: fixed;
  z-index: 90;
  transform: translate(-50%, -100%);
  color: #fff7c0;
  font-size: 16px;
  font-weight: 950;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.38);
  animation: coin-pop 0.85s ease forwards;
  pointer-events: none;
}

.drag-ghost {
  position: fixed !important;
  z-index: 120;
  pointer-events: none;
  opacity: 0.92;
  transform: translate(-50%, -50%) scale(1.05);
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.28));
}

.fly-coin {
  position: fixed;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6b8, #ffd44d 58%, #f59f36);
  color: #6d4700;
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.28), inset 0 -2px 0 rgba(109, 71, 0, 0.18);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: fly-coin 0.8s cubic-bezier(0.18, 0.82, 0.22, 1) forwards;
}

.mission-card {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 9px;
  z-index: 9;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 4px 7px;
  min-height: 52px;
  padding: 8px 8px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 212, 77, 0.16), transparent 48%),
    linear-gradient(180deg, rgba(31, 40, 61, 0.94), rgba(14, 21, 35, 0.86));
  border: 1px solid rgba(255, 247, 192, 0.14);
  box-shadow: 0 9px 20px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.traffic-danger {
  display: none;
}

.traffic-danger span {
  overflow: hidden;
  color: #fff7c0;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.traffic-danger div {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
}

.traffic-danger i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5dd7a1 0 42%, #ffd44d 42% 68%, #ff6b6b 68%);
  transition: width 0.2s ease;
}

.mission-card span {
  color: var(--coin);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.mission-card strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-track {
  grid-column: 1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
}

.mission-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--coin));
  transition: width 0.2s ease;
}

.claim-button {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  min-width: 50px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff176, #f59f36);
  color: #473300;
  font-size: 11px;
  font-weight: 950;
}

.claim-button:disabled {
  opacity: 0.5;
}

.claim-button:not(:disabled),
.chest-button.ready,
.vip-button:not(:disabled) {
  animation: reward-breathe 1.25s ease-in-out infinite;
}

.booth-yard {
  padding: 7px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.yard-header {
  justify-content: space-between;
  margin-bottom: 6px;
}

.yard-header > div:first-child {
  min-width: 0;
}

.yard-actions {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
  gap: 4px;
}

.yard-header p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.yard-header strong {
  display: block;
  max-width: min(185px, 45vw);
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rush-forecast {
  display: grid;
  grid-template-columns: 1.02fr 0.9fr 1.3fr;
  gap: 5px;
  margin: 0 0 7px;
}

.rush-forecast div {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 42px;
  padding: 6px 7px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 46%),
    linear-gradient(180deg, rgba(21, 30, 48, 0.96), rgba(12, 18, 31, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.22);
}

.rush-forecast .rush-card {
  background:
    radial-gradient(circle at 86% 0%, rgba(255, 212, 77, 0.2), transparent 38%),
    linear-gradient(180deg, rgba(28, 42, 66, 0.98), rgba(10, 17, 31, 0.98));
}

.rush-forecast div::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, #5dd7a1, #ffd44d, #ff6b6b);
}

.rush-forecast span,
.rush-forecast strong {
  position: relative;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rush-forecast span {
  color: rgba(247, 249, 255, 0.62);
  font-size: 7.5px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.rush-forecast strong {
  margin-top: 5px;
  color: #fff7c0;
  font-size: 10.2px;
  font-weight: 950;
  line-height: 1;
}

.rush-forecast i {
  position: absolute;
  right: 7px;
  bottom: 6px;
  left: 8px;
  overflow: hidden;
  height: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.36);
}

.rush-forecast i b {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5dd7a1 0 45%, #ffd44d 45% 72%, #ff6b6b 72%);
  transition: width 0.2s ease;
}

.lane-upgrade-panel {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 28px;
  gap: 7px;
  margin: 0 0 7px;
  padding: 8px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 10% 0%, rgba(93, 215, 161, 0.2), transparent 36%),
    linear-gradient(180deg, rgba(37, 49, 75, 0.98), rgba(14, 20, 34, 0.98));
  border: 1px solid rgba(93, 215, 161, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 18px rgba(0, 0, 0, 0.18);
}

.lane-upgrade-panel.hidden {
  display: none;
}

.lane-upgrade-panel span,
.lane-upgrade-panel strong {
  display: block;
}

.lane-upgrade-panel > div:first-child span {
  color: var(--accent);
  font-size: 8px;
  font-weight: 950;
  text-transform: uppercase;
}

.lane-upgrade-panel > div:first-child strong {
  margin-top: 2px;
  color: #fff7c0;
  font-size: 13px;
  line-height: 1;
}

.mini-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  color: rgba(247, 249, 255, 0.86);
  font-size: 18px;
  font-weight: 950;
}

.lane-upgrade-list {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.lane-upgrade-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 5px;
  min-height: 46px;
  padding: 7px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(86, 216, 255, 0.18), rgba(20, 28, 46, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.lane-upgrade-card.recommended {
  border-color: rgba(255, 212, 77, 0.44);
  box-shadow: 0 0 18px rgba(255, 212, 77, 0.16);
}

.lane-upgrade-card.locked {
  opacity: 0.62;
}

.lane-upgrade-card span {
  color: rgba(247, 249, 255, 0.74);
  font-size: 8px;
  font-weight: 950;
  text-transform: uppercase;
}

.lane-upgrade-card strong {
  color: #fff;
  font-size: 13px;
  font-weight: 950;
}

.lane-upgrade-card em {
  color: var(--accent);
  font-size: 9px;
  font-style: normal;
  font-weight: 950;
}

.lane-upgrade-card b {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  padding: 5px 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff176, #f59f36);
  color: #302100;
  font-size: 10px;
  font-weight: 950;
}

.booth-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  touch-action: none;
}

.booth-slot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-height: 58px;
  min-width: 0;
  border-radius: 8px;
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, 0.1), transparent 28%),
    linear-gradient(180deg, #25304a, #101725);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    inset 0 -12px 18px rgba(0, 0, 0, 0.16),
    0 6px 0 rgba(0, 0, 0, 0.2);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.booth-slot:active {
  cursor: grabbing;
}

.booth-slot.empty {
  opacity: 0.52;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 8px, transparent 8px 16px),
    #141b29;
}

.booth-slot.empty .booth-art {
  display: none;
}

.booth-slot.selected {
  box-shadow: inset 0 0 0 3px var(--coin), 0 0 0 3px rgba(255, 212, 77, 0.18);
}

.booth-slot.merge-ready:not(.empty) {
  box-shadow:
    inset 0 0 0 2px rgba(255, 212, 77, 0.7),
    inset 0 -12px 18px rgba(0, 0, 0, 0.14),
    0 6px 0 rgba(0, 0, 0, 0.18),
    0 0 20px rgba(255, 212, 77, 0.32);
  animation: merge-ready-glow 1.25s ease-in-out infinite;
}

.booth-slot.merge-ready:not(.empty)::after {
  content: "MERGE";
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 2px 4px;
  border-radius: 999px;
  background: rgba(255, 212, 77, 0.18);
  color: #fff7c0;
  font-size: 6px;
  font-weight: 950;
}

.booth-slot.merge-hit,
.toll-gate.merge-hit {
  animation: merge-hit 0.48s cubic-bezier(0.22, 1.2, 0.28, 1);
}

.booth-level {
  position: absolute;
  top: 4px;
  left: 5px;
  z-index: 2;
  color: var(--coin);
  font-size: 11px;
  font-weight: 950;
}

.booth-art {
  position: relative;
  width: 38%;
  height: 44%;
  border-radius: 5px;
  background: var(--booth-color, #5dd7a1);
  box-shadow: inset 0 -7px 0 rgba(0, 0, 0, 0.14);
}

.merge-burst,
.merge-spark {
  position: fixed;
  z-index: 130;
  pointer-events: none;
}

.merge-burst {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7c0, #ffd44d 58%, #f59f36);
  color: #372600;
  font-size: 20px;
  font-weight: 950;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28), 0 0 26px rgba(255, 212, 77, 0.46);
  transform: translate(-50%, -50%);
  animation: merge-burst 0.7s ease-out forwards;
}

.merge-spark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coin);
  transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0);
  animation: merge-spark 0.55s ease-out forwards;
}

.booth-roof {
  position: absolute;
  left: -18%;
  right: -18%;
  top: -20%;
  height: 28%;
  border-radius: 5px 5px 2px 2px;
  background: #f4d35e;
}

.booth-window {
  position: absolute;
  left: 24%;
  top: 28%;
  width: 52%;
  height: 28%;
  border-radius: 3px;
  background: #e7f7ff;
}

.action-bar {
  display: grid;
  grid-template-columns: 1.08fr 0.94fr 0.86fr 0.84fr 0.9fr;
  gap: 4px;
  align-items: stretch;
  min-height: 54px;
  padding: 4px;
  border-radius: 10px 10px 8px 8px;
  background:
    linear-gradient(180deg, rgba(67, 78, 112, 0.98), rgba(28, 35, 55, 0.98) 48%, rgba(10, 15, 27, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -4px 0 rgba(0, 0, 0, 0.2),
    0 -12px 28px rgba(0, 0, 0, 0.32);
}

.primary-button,
.secondary-button,
.small-button {
  min-width: 0;
  min-height: 42px;
  border-radius: 8px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  font-weight: 900;
  cursor: pointer;
}

.primary-button {
  color: #092b20;
  background: linear-gradient(180deg, #75f0b7, #19a66f);
}

.secondary-button,
.small-button {
  background: var(--panel-soft);
}

.action-bar .primary-button,
.action-bar .secondary-button {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 17px 11px minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  min-height: 46px;
  max-height: 46px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom-color: rgba(0, 0, 0, 0.34);
  text-align: center;
}

.action-bar .primary-button::before,
.action-bar .secondary-button::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 50%;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.28), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent);
  pointer-events: none;
}

.action-bar .primary-button::after,
.action-bar .secondary-button::after {
  content: none;
}

.action-bar .secondary-button:nth-child(2) {
  color: #e8fbff;
  background: linear-gradient(180deg, #64d8ff, #2678d4 54%, #1852a6);
}

.action-bar .secondary-button:nth-child(3) {
  color: #2d2100;
  background: linear-gradient(180deg, #ffe97a, #ffb33e 56%, #df7f18);
}

.action-bar .secondary-button:nth-child(4) {
  color: #fff7c0;
  background: linear-gradient(180deg, #a88bff, #654bd0 56%, #3d2d92);
}

.action-bar .secondary-button:nth-child(5) {
  color: #fff7c0;
  background: linear-gradient(180deg, #ff9ec2, #d64e82 56%, #9b2e5c);
}

.clear-button {
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 236, 123, 0.38), transparent 34%),
    linear-gradient(180deg, #a90f30, #6d0926 100%);
  opacity: 1;
  box-shadow: 0 4px 0 rgba(48, 4, 18, 0.78), 0 0 22px rgba(255, 78, 72, 0.42), inset 0 0 0 1px rgba(255, 236, 123, 0.42);
  text-shadow: 0 1px 0 rgba(30, 0, 10, 0.9);
}

.clear-button.ready {
  opacity: 1;
  animation: reward-breathe 1s ease-in-out infinite;
}

.clear-button.ad-ready {
  opacity: 1;
  filter: none;
  box-shadow: 0 4px 0 rgba(48, 4, 18, 0.78), 0 0 24px rgba(255, 78, 72, 0.56), inset 0 0 0 1px rgba(255, 236, 123, 0.48);
}

.action-bar span {
  position: relative;
  align-self: center;
  color: currentColor;
  font-size: 7px;
  font-weight: 950;
  line-height: 1;
  opacity: 0.78;
  text-transform: uppercase;
}

.action-bar i {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-self: end;
  height: 17px;
  color: currentColor;
  font-size: 15px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
}

.action-bar strong {
  position: relative;
  align-self: center;
  overflow: hidden;
  color: currentColor;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.small-button {
  min-height: 34px;
  padding: 0 9px;
  color: var(--coin);
  font-size: 13px;
}

.yard-actions .small-button {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 34px;
  padding: 2px 5px;
  border-radius: 8px;
  line-height: 1;
  text-align: center;
}

.yard-actions .boost-button,
.yard-actions .clear-button {
  justify-items: center;
  grid-template-rows: 12px 14px;
  padding-left: 19px;
  min-width: 70px;
}

.yard-actions .vip-button {
  min-width: 52px;
  padding-inline: 7px;
  justify-items: center;
  color: #171d2c;
  font-size: 15px;
  line-height: 1;
}

.ad-icon {
  position: absolute;
  left: 5px;
  top: 50%;
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 247, 192, 0.95);
  color: #151b2a;
  font-size: 8px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  transform: translateY(-50%);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.22), 0 0 8px rgba(255, 247, 192, 0.36);
}

.yard-actions .small-button span,
.yard-actions .small-button strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.yard-actions .small-button span {
  font-size: 7.4px;
  font-weight: 950;
  opacity: 0.78;
  text-transform: uppercase;
}

.yard-actions .clear-button span,
.yard-actions .clear-button strong {
  opacity: 1;
  color: #fff;
  text-shadow: 0 1px 0 rgba(22, 0, 8, 0.95);
}

.yard-actions .small-button strong {
  font-size: 11px;
  font-weight: 950;
}

.boost-button {
  color: #fff7c0;
  background: linear-gradient(180deg, #a88bff, #654bd0 54%, #3d2d92);
  box-shadow: 0 4px 0 rgba(34, 25, 88, 0.72), 0 0 14px rgba(141, 114, 255, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.boost-button.active {
  color: #102018;
  background:
    linear-gradient(180deg, rgba(255, 247, 192, 0.42), transparent 38%),
    linear-gradient(180deg, #84f4b2, #35d87a 56%, #168d57);
  box-shadow: 0 4px 0 rgba(6, 74, 42, 0.78), 0 0 22px rgba(93, 215, 161, 0.54), inset 0 1px 0 rgba(255, 255, 255, 0.34);
  animation: reward-breathe 1.2s ease-in-out infinite;
}

.vip-button {
  color: #171d2c;
  background: linear-gradient(180deg, #ffe176, #f59f36);
}

.chest-button.ready {
  color: #171d2c;
  background: linear-gradient(180deg, #ffd44d, #ff9f68);
}

.ad-reward-splash {
  position: fixed;
  z-index: 90;
  display: grid;
  min-width: 148px;
  max-width: min(260px, calc(100vw - 28px));
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 0 8px;
  align-items: center;
  padding: 9px 12px;
  border: 2px solid rgba(255, 247, 192, 0.88);
  border-radius: 8px;
  background:
    radial-gradient(circle at 88% 0%, rgba(255, 247, 192, 0.38), transparent 34%),
    linear-gradient(180deg, rgba(42, 54, 82, 0.98), rgba(13, 20, 34, 0.98));
  color: #fff7c0;
  pointer-events: none;
  text-align: left;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -100%);
  animation: ad-reward-pop 1.35s ease both;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.38), 0 0 24px rgba(255, 212, 77, 0.28);
}

.ad-reward-splash i {
  grid-row: span 2;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff7c0, #ffd44d);
  color: #151b2a;
  font-size: 13px;
  font-style: normal;
  font-weight: 950;
}

.ad-reward-splash span,
.ad-reward-splash strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-reward-splash span {
  color: #c9d5ef;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ad-reward-splash strong {
  color: #fff;
  font-size: 18px;
  font-weight: 950;
}

.prestige-button.ready {
  color: #171d2c;
  background: linear-gradient(180deg, #fff7c0, #ffd44d);
}

.primary-button:active,
.secondary-button:active,
.small-button:active,
.icon-button:active,
.booth-slot:active {
  transform: translateY(2px);
}

.primary-button span,
.secondary-button span,
.primary-button strong,
.secondary-button strong {
  display: block;
  overflow: hidden;
  padding: 0 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button span,
.secondary-button span {
  font-size: 12px;
  opacity: 0.8;
}

.primary-button strong,
.secondary-button strong {
  margin-top: 2px;
  font-size: clamp(14px, 4vw, 18px);
}

.action-bar .primary-button span,
.action-bar .secondary-button span,
.action-bar .primary-button strong,
.action-bar .secondary-button strong,
.action-bar .primary-button i,
.action-bar .secondary-button i {
  position: relative;
  z-index: 1;
  grid-column: 1;
  padding: 0;
  white-space: nowrap;
}

.action-bar .primary-button span,
.action-bar .secondary-button span {
  align-self: end;
  font-size: 7.4px;
  letter-spacing: 0;
}

.action-bar .primary-button strong,
.action-bar .secondary-button strong {
  align-self: start;
  margin-top: 0;
  font-size: 12px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 13, 22, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.start-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 100vw;
  max-width: 430px;
  margin: 0 auto;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(22, 29, 45, 0.1), rgba(9, 13, 22, 0.82)),
    radial-gradient(circle at 22% 18%, rgba(79, 195, 247, 0.24), transparent 28%),
    radial-gradient(circle at 78% 10%, rgba(255, 212, 77, 0.16), transparent 24%),
    rgba(10, 13, 22, 0.64);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.start-screen.hidden {
  display: none;
}

.start-panel {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  display: grid;
  gap: 9px;
  width: min(100%, 360px);
  max-height: calc(100dvh - 28px);
  padding: 16px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 212, 77, 0.14), transparent 36%),
    rgba(36, 43, 61, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  text-align: center;
  scrollbar-width: none;
}

.start-panel::-webkit-scrollbar {
  display: none;
}

.start-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 92px;
  background:
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255, 247, 192, 0.15) 18px 21px),
    linear-gradient(180deg, rgba(86, 136, 170, 0.52), transparent);
}

.home-map,
.home-stats,
.home-route,
.home-districts,
.start-panel span,
.start-panel h1,
.start-panel p,
.start-panel button {
  position: relative;
}

.home-map {
  height: 74px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(136, 216, 255, 0.9) 0 42%, rgba(47, 153, 201, 0.85) 42% 56%, rgba(52, 57, 71, 0.96) 56%),
    #20283a;
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.1);
}

.home-map::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: 18px;
  width: 30px;
  height: 16px;
  border-radius: 9px 12px 5px 5px;
  background: #ffd44d;
  box-shadow:
    64px 0 0 #4fc3f7,
    128px 0 0 #5dd7a1,
    0 4px 0 rgba(0, 0, 0, 0.16),
    64px 4px 0 rgba(0, 0, 0, 0.16),
    128px 4px 0 rgba(0, 0, 0, 0.16);
  animation: home-traffic 2.2s linear infinite;
}

.home-map::before {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 13px;
  left: 18px;
  height: 22px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, transparent 0 20px, rgba(255, 212, 77, 0.78) 20px 28px),
    #343947;
}

.home-map span {
  position: absolute;
  bottom: 43px;
  width: 20px;
  border-radius: 3px 3px 0 0;
  background: rgba(36, 43, 61, 0.92);
}

.home-map span:nth-child(1) { left: 36px; height: 22px; }
.home-map span:nth-child(2) { left: 70px; height: 34px; }
.home-map span:nth-child(3) { right: 82px; height: 28px; }
.home-map span:nth-child(4) { right: 42px; height: 40px; }

.start-panel span {
  color: var(--coin);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.start-panel h1 {
  margin: 0;
  color: #fff7c0;
  font-size: clamp(25px, 8vw, 30px);
  line-height: 1;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
}

.start-panel p {
  margin: 0 auto;
  max-width: 300px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.home-stats div,
.home-route {
  border-radius: 8px;
  background: rgba(19, 24, 38, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.home-stats div {
  display: grid;
  gap: 2px;
  padding: 8px 6px;
}

.home-stats span,
.home-route-head span {
  color: rgba(185, 193, 213, 0.82);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.home-stats strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-route {
  display: grid;
  gap: 7px;
  padding: 10px;
  text-align: left;
}

.home-route-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 8px;
}

.home-route-head strong {
  overflow: hidden;
  color: #fff7c0;
  font-size: 14px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-route-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
}

.home-route-track div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--coin));
}

.home-route p {
  max-width: none;
  font-size: 11px;
}

.home-districts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.home-districts span {
  overflow: hidden;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(19, 24, 38, 0.48);
  color: rgba(247, 249, 255, 0.72);
  font-size: 10px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-districts span.active {
  background: linear-gradient(180deg, #ffd44d, #f59f36);
  color: #28200b;
}

.play-button {
  width: 100%;
  min-height: 48px;
  font-size: 18px;
}

.home-actions {
  display: grid;
  grid-template-columns: 1fr 0.58fr;
  gap: 8px;
}

.home-actions .play-button,
.home-actions .new-game-button {
  min-height: 48px;
}

.new-game-button {
  padding: 0 10px;
  background: linear-gradient(180deg, rgba(72, 84, 121, 0.98), rgba(24, 32, 52, 0.98));
  color: #fff7c0;
  font-size: 13px;
}

.pause-panel {
  width: min(340px, calc(100vw - 28px));
}

.settings-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 8px;
  margin-top: 14px;
}

.settings-tile {
  display: grid;
  gap: 4px;
  min-height: 54px;
  padding: 9px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(47, 56, 82, 0.96), rgba(15, 22, 36, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: left;
}

.settings-tile span {
  color: rgba(185, 193, 213, 0.86);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.settings-tile strong {
  overflow: hidden;
  color: #fff7c0;
  font-size: 14px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pause-actions {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 0.78fr 0.86fr;
  gap: 8px;
  margin-top: 14px;
}

.version-label {
  display: block;
  margin-top: 12px;
  color: rgba(185, 193, 213, 0.7);
  font-size: 10px;
  font-weight: 850;
}

.pause-actions .primary-button,
.pause-actions .secondary-button {
  min-height: 46px;
}

.danger-button {
  color: #fff;
  background: linear-gradient(180deg, #ff8a8a, #d94a4a);
}

.modal.hidden {
  display: none;
}

.modal-panel {
  position: relative;
  overflow: hidden;
  width: min(380px, 100%);
  padding: 24px 20px 20px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 212, 77, 0.12), transparent 34%),
    rgba(36, 43, 61, 0.97);
  text-align: center;
  animation: modal-pop 0.22s ease-out;
}

.modal-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, var(--accent), var(--coin), var(--pink));
}

.modal-panel h1 {
  margin: 0 0 10px;
  color: #fff7c0;
  font-size: 26px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
}

.modal-badge {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  margin: 0 auto 9px;
  padding: 5px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 212, 77, 0.22), rgba(245, 159, 54, 0.16));
  color: var(--coin);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 212, 77, 0.22);
}

.modal-badge[hidden] {
  display: none;
}

.modal-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.modal-reward {
  display: grid;
  place-items: center;
  min-height: 48px;
  margin: 16px auto;
  width: max-content;
  max-width: 100%;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(255, 212, 77, 0.12);
  color: var(--coin);
  font-size: 24px;
  font-weight: 950;
  box-shadow: inset 0 0 0 2px rgba(255, 212, 77, 0.18);
  animation: prize-pop 0.7s ease-out both;
}

.modal-reward:empty,
.modal-reward[hidden] {
  display: none;
}

.modal-details {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
}

.modal-details[hidden] {
  display: none;
}

.modal-details span {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(10, 15, 27, 0.42);
  color: rgba(247, 249, 255, 0.86);
  font-size: 12px;
  font-weight: 850;
}

.modal-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 16px;
}

.modal-actions[hidden] {
  display: none;
}

.modal-actions .primary-button,
.modal-actions .secondary-button {
  min-height: 46px;
  padding: 0 8px;
  font-size: 12px;
  line-height: 1.05;
}

.danger-modal .modal-panel {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 107, 107, 0.22), transparent 38%),
    linear-gradient(180deg, rgba(54, 39, 54, 0.98), rgba(22, 25, 39, 0.98));
}

.danger-modal .modal-panel::before {
  background: linear-gradient(90deg, #ff6b6b, #ffd44d);
}

.reward-modal .modal-panel,
.district-modal .modal-panel {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 212, 77, 0.2), transparent 38%),
    linear-gradient(180deg, rgba(42, 52, 79, 0.98), rgba(21, 27, 43, 0.98));
}

.chest-modal .modal-panel::after {
  content: "★";
  position: absolute;
  right: 18px;
  top: 16px;
  color: rgba(255, 212, 77, 0.28);
  font-size: 54px;
  font-weight: 950;
  animation: reward-breathe 1.4s ease-in-out infinite;
}

.offline-modal .modal-reward {
  background: linear-gradient(180deg, rgba(93, 215, 161, 0.24), rgba(79, 195, 247, 0.14));
  color: #b9ffe1;
}

.district-modal .modal-reward {
  min-width: 160px;
  background: linear-gradient(180deg, rgba(255, 212, 77, 0.25), rgba(245, 159, 54, 0.16));
}

.coach {
  position: fixed;
  inset: auto 10px calc(82px + env(safe-area-inset-bottom));
  z-index: 40;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.coach.hidden {
  display: none;
}

.coach-panel {
  width: min(420px, 100%);
  padding: 13px;
  border-radius: 8px;
  background: rgba(19, 24, 38, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.36);
  pointer-events: auto;
}

.coach-panel span {
  display: block;
  color: var(--coin);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.coach-panel strong {
  display: block;
  margin: 3px 0;
  font-size: 16px;
}

.coach-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.coach-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.text-button {
  min-height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.tutorial-focus {
  position: relative;
  z-index: 45;
  animation: focus-ring 1s ease-in-out infinite;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(110px + env(safe-area-inset-bottom));
  z-index: 30;
  width: max-content;
  max-width: calc(100% - 28px);
  padding: 11px 14px;
  border-radius: 8px;
  background: rgba(19, 24, 38, 0.95);
  box-shadow: 0 10px 24px var(--shadow);
  color: var(--ink);
  font-weight: 850;
  transform: translateX(-50%);
  animation: toast 1.8s ease forwards;
}

@keyframes pulse {
  0% { transform: scale(1); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes coin-pop {
  0% { opacity: 0; transform: translate(-50%, calc(-100% + 10px)) scale(0.8); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, calc(-100% - 42px)) scale(1.18); }
}

@keyframes jam-alert {
  from { transform: translateY(0); filter: saturate(1); }
  to { transform: translateY(-2px); filter: saturate(1.35); }
}

@keyframes lane-gridlock {
  from { filter: saturate(1); }
  to { filter: saturate(1.35) brightness(1.08); }
}

@keyframes clear-pulse {
  from {
    transform: translateY(-50%) scale(1);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28), 0 0 14px rgba(93, 215, 161, 0.42);
  }
  to {
    transform: translateY(-50%) scale(1.06);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34), 0 0 24px rgba(93, 215, 161, 0.78);
  }
}

@keyframes traffic-assist {
  0% { opacity: 0; transform: translate(-50%, -42%) scale(0.92); }
  16%, 72% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(0.96); }
}

@keyframes assist-car {
  0% { opacity: 0; transform: translateX(0) scale(0.9); }
  20% { opacity: 1; }
  78% { opacity: 1; transform: translateX(calc(100vw - 40px)) scale(1); }
  100% { opacity: 0; transform: translateX(calc(100vw + 30px)) scale(0.96); }
}

@keyframes cleared-car {
  0% { transform: translateX(var(--x, 0)) scale(1); }
  35% { transform: translateX(calc(var(--x, 0) + 18px)) scale(1.08); }
  100% { transform: translateX(calc(var(--x, 0) + 54px)) scale(1); }
}

@keyframes fly-coin {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.55);
  }
  18% {
    opacity: 1;
    transform: translate(calc(-50% + var(--dx) * 0.12), calc(-50% + var(--dy) * 0.02 - 30px)) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.38);
  }
}

@keyframes wallet-bump {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.08); }
  65% { transform: scale(0.98); }
}

@keyframes merge-ready-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.16); }
}

@keyframes merge-hit {
  0% { transform: scale(1); filter: brightness(1); }
  42% { transform: scale(1.12); filter: brightness(1.28); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes merge-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.55) rotate(-8deg); }
  24% { opacity: 1; transform: translate(-50%, -50%) scale(1.14) rotate(3deg); }
  78% { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -76%) scale(0.9); }
}

@keyframes merge-spark {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0) scale(0.8); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--angle)) translateX(42px) scale(0.3); }
}

@keyframes home-traffic {
  0% { transform: translateX(-38px); opacity: 0; }
  12% { opacity: 1; }
  86% { opacity: 1; }
  100% { transform: translateX(70px); opacity: 0; }
}

@keyframes toast {
  0%, 100% { opacity: 0; transform: translate(-50%, 12px); }
  12%, 82% { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes focus-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 212, 77, 0.82), 0 8px 0 rgba(0, 0, 0, 0.18); }
  50% { box-shadow: 0 0 0 7px rgba(255, 212, 77, 0.12), 0 8px 0 rgba(0, 0, 0, 0.18); }
}

@keyframes drift {
  0% { transform: translateX(-18px); }
  50% { transform: translateX(18px); }
  100% { transform: translateX(-18px); }
}

@keyframes modal-pop {
  0% { opacity: 0; transform: translateY(12px) scale(0.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes prize-pop {
  0% { transform: scale(0.7) rotate(-2deg); }
  55% { transform: scale(1.12) rotate(1deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes reward-breathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

@keyframes ad-reward-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -88%) scale(0.82);
  }
  16% {
    opacity: 1;
    transform: translate(-50%, -106%) scale(1.05);
  }
  76% {
    opacity: 1;
    transform: translate(-50%, -118%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -138%) scale(0.96);
  }
}

@media (max-width: 380px) {
  .game-shell {
    gap: 6px;
    grid-template-rows: 42px minmax(290px, 1fr) auto 50px;
    padding-inline: 7px;
  }

  .booth-grid {
    gap: 6px;
  }

  .wallet {
    padding-inline: 7px;
  }

  .top-bar {
    grid-template-columns: minmax(70px, 0.86fr) 48px minmax(78px, 1fr) 34px 34px 34px;
    gap: 4px;
  }

  .prestige-badge {
    padding-inline: 5px;
    font-size: 8px;
  }

  .icon-button {
    width: 34px;
    font-size: 18px;
  }

  .coin-icon {
    width: 20px;
    height: 20px;
  }

  .action-bar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 3px;
  }

  .action-bar .primary-button,
  .action-bar .secondary-button {
    grid-template-columns: minmax(0, 1fr);
    min-height: 42px;
    max-height: 42px;
    padding-inline: 1px;
  }

  .action-bar .primary-button span,
  .action-bar .secondary-button span {
    font-size: 7.8px;
  }

  .action-bar .primary-button strong,
  .action-bar .secondary-button strong {
    font-size: 10px;
  }

  .rush-forecast {
    gap: 3px;
  }

  .rush-forecast div {
    min-height: 35px;
    padding: 5px 5px 5px 7px;
  }

  .rush-forecast span {
    font-size: 6.8px;
  }

  .rush-forecast strong {
    font-size: 9.4px;
  }

  .lane {
    min-height: 48px;
  }

  .toll-gate {
    width: 46px;
    right: 7%;
  }

  .lane-drop {
    right: 6%;
  }

  .start-screen {
    padding-inline: 10px;
  }

  .start-panel {
    width: 100%;
  }
}

@media (max-height: 720px) {
  .game-shell {
    grid-template-rows: 42px minmax(260px, 1fr) auto 50px;
    gap: 5px;
  }

  .plaza::before,
  .river {
    top: 82px;
  }

  .bridge {
    top: 94px;
  }

  .skyline {
    top: 18px;
    height: 62px;
  }

  .borough-track {
    top: 94px;
  }

  .road {
    top: 126px;
  }

  .mission-card,
  .traffic-danger {
    top: 7px;
    min-height: 48px;
  }

  .mission-card {
    padding-block: 7px;
  }

  .mission-card strong {
    font-size: 12px;
  }

  .booth-yard {
    padding: 6px;
  }

  .yard-header {
    margin-bottom: 5px;
  }

  .booth-slot {
    max-height: 50px;
  }

  .start-panel {
    gap: 8px;
    padding: 14px;
  }

  .home-map {
    height: 62px;
  }
}

@media (max-height: 640px) {
  .home-districts,
  .home-route p {
    display: none;
  }

  .start-panel h1 {
    font-size: 24px;
  }

  .start-panel p {
    font-size: 12px;
  }
}

@media (min-width: 700px) {
  body {
    display: grid;
    place-items: center;
    background: #101520;
  }

  .game-shell {
    height: min(900px, 100dvh);
    border-radius: 18px;
  }

  .start-screen {
    width: min(430px, 100vw);
    max-width: 430px;
  }

  .start-panel {
    width: min(360px, 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
