/* Drive mode: page content steps aside, the driving UI takes over. */

body.is-driving { overflow: hidden; }
body.is-driving .site,
body.is-driving .footer { opacity: 0; visibility: hidden; }
body.is-driving .nav,
body.is-driving .topbar__drive { visibility: hidden; }

.drive-ui {
  position: fixed;
  inset: 0;
  z-index: 15;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}
.drive-ui.is-on { opacity: 1; visibility: visible; transition: opacity 0.4s ease; }

/* Red pulse around the edges while a cruiser is on your bumper */
.drive-ui::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(110% 90% at 50% 50%, transparent 55%, rgba(255, 31, 61, 0.55) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.drive-ui.is-danger::before { opacity: 1; animation: danger 0.6s ease-in-out infinite alternate; }
@keyframes danger { to { opacity: 0.45; } }

.drive-ui__top {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  width: max-content;
  max-width: calc(100% - 2 * var(--gutter));
  pointer-events: auto;
}
.drive-ui__hint {
  margin: 0;
  padding: 8px 16px;
  border-radius: 18px;
  background: rgba(20, 8, 40, 0.6);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
}

/* "E TO EXPLORE" prompt next to a district */
.drive-ui__prompt {
  --c: var(--yellow);
  position: absolute;
  left: 50%;
  bottom: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.drive-ui__prompt.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.drive-ui__prompt-name {
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(27, 22, 48, 0.85);
  border: 2px solid var(--c);
  font-family: var(--display);
  font-size: 14px;
  white-space: nowrap;
}
.key-e {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--navy);
  color: var(--yellow);
  font-size: 13px;
}
@media (pointer: coarse) {
  .key-e { display: none; }
  .drive-ui__prompt .btn::after { content: ' (TAP)'; }
  .drive-ui__prompt { bottom: 200px; }
}

.drive-ui__speed {
  position: absolute;
  right: var(--gutter);
  bottom: 28px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.drive-ui__speed strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: 64px;
  line-height: 1;
  color: #fff7fb;
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke: 2px #140b26;
  paint-order: stroke fill;
  text-shadow: 0 5px 0 rgba(20, 8, 40, 0.45);
}
.drive-ui__speed span { font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }

/* Touch pads: only on touch screens */
.drive-ui__pad { position: absolute; bottom: 26px; display: none; gap: 12px; pointer-events: auto; }
.drive-ui__pad--steer { left: var(--gutter); }
.drive-ui__pad--pedals { right: var(--gutter); bottom: 110px; }
.drive-ui__pad button {
  width: 68px;
  height: 68px;
  border: 3px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  background: rgba(20, 8, 40, 0.55);
  color: #fff7fb;
  font-family: var(--display);
  font-size: 22px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.drive-ui__pad button.is-gas { background: var(--teal); color: #140b26; }
.drive-ui__pad button.is-pressed { transform: scale(0.94); filter: brightness(1.2); }

@media (pointer: coarse) {
  .drive-ui__pad { display: flex; }
  .drive-ui__hint { display: none; }
  .drive-ui__speed { bottom: 200px; }
  .drive-ui__speed strong { font-size: 44px; }
}

@media (max-width: 820px) {
  .topbar__drive { display: none; }
}
