/* driving mode ("jazda", js/drive.js + js/drive-core.js): HUD button and its choice, the speed pill, hints, the
   phone pad (steering on the left, gas / brake on the right) */
#hud .row > #driveBtn { display: inline-flex; align-items: center; gap: 5px; }
#driveBtn .dv-svg, #driveFab .dv-svg, #driveMenu .dv-svg, #driveHud .dv-svg { display: block; image-rendering: pixelated; flex: 0 0 auto; }
#driveBtn.active { background: var(--accent); }
#hud .row > #driveCamBtn, #hud .row > #driveOutBtn { display: inline-flex; align-items: center; gap: 5px; }
#driveCamBtn .dv-svg { display: block; image-rendering: pixelated; }
#hud .row > #driveCamBtn[hidden], #hud .row > #driveOutBtn[hidden] { display: none; }
@media (max-width: 600px) { #hud .row > #driveBtn { margin-left: 0; flex: 1 1 auto; justify-content: center; } }
@media (max-width: 380px) { #hud .row > #driveBtn { padding: 0 4px; font-size: 13px !important; } #driveBtn .dv-svg { width: 16px; height: 9px; } }

/* the choice: samochód / motocykl / rower */
#driveMenu { position: fixed; z-index: 30; background: var(--paper); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); padding: 6px;
  display: flex; flex-direction: column; gap: 5px; min-width: 210px; }
#driveMenu[hidden] { display: none; }
#driveMenu .dm-head { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; opacity: .7; padding: 0 2px 1px; }
#driveMenu button { font: inherit; display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--ink); padding: 5px 8px;
  cursor: pointer; color: var(--ink); text-align: left; }
#driveMenu button:hover, #driveMenu button:focus-visible { background: var(--accent); outline: none; }
#driveMenu button:active { transform: translate(1px, 1px); }
#driveMenu .dm-ico { width: 26px; display: flex; justify-content: center; }
#driveMenu .dm-t { display: flex; flex-direction: column; flex: 1 1 auto; line-height: 1.1; }
#driveMenu .dm-t b { font-size: 17px; font-weight: 600; }
#driveMenu .dm-t small { font-size: 12px; opacity: .7; }
#driveMenu kbd { font: 11px "Silkscreen", monospace; border: 1px solid var(--ink); border-bottom-width: 2px; padding: 0 3px; background: #fff; }
@media (pointer: coarse) { #driveMenu kbd { display: none; } #driveMenu button { padding: 8px 10px; } }

/* the "jazda" / "wsiądź" button: phones while walking (the walk folds the HUD row; over the pad's buttons and the
   game's compact card), any screen next to a parked vehicle */
#driveFab { display: none; position: fixed; z-index: 24; right: max(16px, env(safe-area-inset-right)); bottom: calc(max(28px, env(safe-area-inset-bottom)) + 172px);
  align-items: center; gap: 6px; font: 600 15px "Pixelify Sans", monospace; color: var(--ink); background: var(--paper); border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink); padding: 6px 10px; cursor: pointer; touch-action: manipulation; }
#driveFab.near { background: var(--accent); }
#driveFab:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
body.walking #driveFab.near { display: flex; }
@media (max-width: 600px), (pointer: coarse) { body.walking #driveFab { display: flex; } }
@media (pointer: fine) and (min-width: 601px) { #driveFab { bottom: 64px; right: 18px; } }
body.driving #driveFab, body.touring #driveFab { display: none !important; }

/* the speed pill + hints (bottom middle; a phone: under the HUD, placed by drive-core.js) */
#driveHud { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 15; display: flex; flex-direction: column; align-items: center;
  gap: 6px; pointer-events: none; max-width: calc(100vw - 32px); }
#driveHud[hidden] { display: none; }
#driveHud .dv-pill { pointer-events: auto; display: flex; align-items: baseline; gap: 6px; background: var(--paper); border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink); padding: 3px 6px 3px 10px; white-space: nowrap; max-width: 100%; }
#driveHud .dv-ico { align-self: center; }
#driveHud .dv-speed { font: 600 26px/1 "Pixelify Sans", monospace; min-width: 2.2em; text-align: right; font-variant-numeric: tabular-nums; }
#driveHud .dv-unit { font-size: 13px; opacity: .7; }
#driveHud .dv-gear { font: 600 15px "Pixelify Sans", monospace; color: #c0392b; min-width: .7em; }
#driveHud .dv-name { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; padding-left: 6px; border-left: 2px solid rgba(43, 36, 51, .25); }
#driveHud.none .dv-name { font-weight: 400; opacity: .6; }
#driveHud .dv-off { display: none; font-size: 12px; background: #c9a96a; border: 1px solid var(--ink); padding: 0 4px; }
#driveHud.off .dv-off { display: inline; }
#driveHud .dv-x { align-self: center; font: inherit; font-size: 14px; width: 28px; height: 26px; background: #fff; border: 2px solid var(--ink); cursor: pointer; color: var(--ink); }
#driveHud .dv-msg { background: var(--ink); color: var(--paper); padding: 3px 10px; font-size: 15px; white-space: nowrap; }
#driveHud .dv-msg[hidden] { display: none; }
#driveHud .dv-hint { background: rgba(244, 236, 216, .88); border: 2px solid var(--ink); padding: 3px 8px; font-size: 13px; white-space: nowrap; }
#driveHud kbd { font: 11px "Silkscreen", monospace; border: 1px solid var(--ink); border-bottom-width: 2px; padding: 0 3px; margin-right: 2px; background: #fff; }
@media (pointer: fine) and (min-width: 601px) { #driveHud .dv-x { display: none; } }
/* while driving the event card waits (as while walking) */
body.driving .egg-card { visibility: hidden; transform: translateY(calc(100% + 60px)); }

/* phone pad */
#drivePad { position: fixed; inset: auto 0 0 0; height: 0; z-index: 24; }
#drivePad[hidden] { display: none; }
#drivePad .dp-steer { position: fixed; left: max(14px, env(safe-area-inset-left)); bottom: max(22px, env(safe-area-inset-bottom)); width: 156px; height: 74px;
  border-radius: 37px; border: 3px solid var(--ink); background: rgba(244, 236, 216, .5); touch-action: none; user-select: none; -webkit-user-select: none;
  display: flex; align-items: center; justify-content: space-between; padding: 0 8px; box-sizing: border-box; }
#drivePad .dp-steer b { display: block; opacity: .55; pointer-events: none; }
#drivePad .dp-steer i { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); pointer-events: none; box-sizing: border-box; }
#drivePad button { position: fixed; border-radius: 50%; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font: 600 15px "Pixelify Sans", monospace;
  color: var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; display: flex; align-items: center; justify-content: center; padding: 0; }
#drivePad .dp-gas { right: max(14px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom)); width: 86px; height: 86px; background: var(--accent); font-size: 17px; }
#drivePad .dp-brake { right: calc(max(14px, env(safe-area-inset-right)) + 96px); bottom: max(22px, env(safe-area-inset-bottom)); width: 68px; height: 68px; background: var(--paper); }
#drivePad .dp-horn { right: calc(max(14px, env(safe-area-inset-right)) + 14px); bottom: calc(max(22px, env(safe-area-inset-bottom)) + 100px); width: 54px; height: 54px; background: var(--paper); }
#drivePad button.on { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); filter: brightness(.92); }
#drivePad .dp-horn svg { display: block; image-rendering: pixelated; }

/* phone: the HUD folds to one row (koniec, kamera, wysiądź), the pill under it, no hints */
@media (max-width: 600px), (pointer: coarse) {
  #driveHud { bottom: auto; top: 120px; }
  #driveHud .dv-hint { display: none; }
  #driveHud .dv-pill { gap: 5px; padding: 2px 4px 2px 8px; border-width: 2px; box-shadow: 3px 3px 0 var(--ink); }
  #driveHud .dv-speed { font-size: 22px; }
  #driveHud .dv-name { font-size: 14px; max-width: 46vw; }
  #driveHud .dv-x { display: none; }
  body.driving #hud .title, body.driving #hud .lbl-where, body.driving #hud .row > :not(#driveBtn):not(#driveCamBtn):not(#driveOutBtn) { display: none; }
  body.driving #hud { padding: 6px 8px; }
  body.driving #hud .row { margin-top: 0; flex-wrap: nowrap; }
  body.driving #credits { display: none; }
  body.driving #hud .row > #driveCamBtn, body.driving #hud .row > #driveOutBtn { flex: 1 1 auto; justify-content: center; margin-left: 0; padding: 0 6px; }
}
body.driving #map { cursor: default; }
