/* In-game HUD: top bar, location banner, car prompts, maps, touch controls. */

#topbar { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 999px; padding: 6px 6px 6px 18px; box-shadow: 0 4px 18px rgba(0,0,0,.15); font: 700 14px var(--ui); color: var(--ink); white-space: nowrap; pointer-events: none; }
#topbar .tb-mood { color: var(--brand); }
#topbar .tb-money { background: var(--soft); border-radius: 999px; padding: 7px 14px; font-weight: 800; }
#tbBuy { pointer-events: auto; width: 30px; height: 30px; margin-left: -10px; border: 0; border-radius: 50%; background: #22b573; color: #fff; font: 800 20px/1 var(--ui); cursor: pointer; box-shadow: 0 2px 8px rgba(34,181,115,.45); }
.touch #topbar { font-size: 11px; gap: 8px; padding-left: 12px; top: 8px; }
.touch #topbar .tb-name { display: none; }

#place { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); color: #fff; background: rgba(10,30,70,.78); padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; opacity: 0; transition: opacity .3s; pointer-events: none; white-space: nowrap; }
#prompt { position: fixed; bottom: 130px; left: 50%; transform: translateX(-50%); color: #fff; background: rgba(0,0,0,.6); padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; display: none; pointer-events: none; white-space: nowrap; }
.touch #prompt { bottom: auto; top: 60px; }
#speedo { position: fixed; right: 16px; top: 200px; color: #fff; background: rgba(0,0,0,.5); padding: 8px 14px; border-radius: 10px; font: 700 22px system-ui, sans-serif; display: none; pointer-events: none; }
#speedo small { font-size: 12px; font-weight: 600; opacity: .8; }
.touch #speedo { top: 136px; font-size: 18px; }

/* maps */
#minimap { position: fixed; right: 16px; top: 14px; width: 170px; height: 170px; border-radius: 50%; border: 3px solid rgba(255,255,255,.85); box-shadow: 0 2px 10px rgba(0,0,0,.35); cursor: pointer; }
.touch #minimap { width: 112px; height: 112px; }
#bigmap { position: fixed; inset: 0; z-index: 8; display: none; background: #13284d; touch-action: none; }
#bigmap.open { display: block; }
#bigmap.mode3d { background: transparent; cursor: grab; } #bigmap.mode3d #bigmapCanvas { display: none; }
#bigmap.mode3d .title { text-shadow: 0 1px 6px #000; }
body.map-open #topbar, body.map-open #place, body.map-open #minimap, body.map-open #lifeNav, body.map-open #needsW, body.map-open #locCard, body.map-open #homeBar, body.map-open #touchUI, body.map-open #micBtn { display: none !important; }
#bigmapCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
#bigmapSvg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #e9ecef; pointer-events: none; } #bigmap.mode3d #bigmapSvg { display: none; }
#bigmap .bar { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }
#bigmap button, #aerialBtn { font: 600 14px system-ui, sans-serif; color: #fff; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.5); border-radius: 10px; padding: 9px 14px; cursor: pointer; }
#bigmap .title { position: absolute; top: 14px; left: 16px; color: #fff; font: 700 20px system-ui, sans-serif; text-shadow: 0 1px 4px #000; pointer-events: none; }
#bigmap .hint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); color: #fff; background: rgba(0,0,0,.55); padding: 7px 14px; border-radius: 999px; font: 13px system-ui, sans-serif; pointer-events: none; white-space: nowrap; }
#aerialBtn { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); display: none; z-index: 4; }
#aerialBtn.show { display: block; }

/* phone / tablet controls */
#joy { position: fixed; left: 110px; top: calc(100% - 120px); width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; background: rgba(255,255,255,.14); border: 2px solid rgba(255,255,255,.45); display: none; pointer-events: none; opacity: .6; transition: opacity .2s; }
#joy.active { opacity: 1; }
.touch #joy { display: block; }
#knob { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%; background: rgba(255,255,255,.8); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
#touchUI { display: none; }
.touch #touchUI { display: block; }
.tbtn { position: fixed; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%;
  background: rgba(20,20,20,.35); border: 2px solid rgba(255,255,255,.65); color: #fff; font: 700 12px system-ui, sans-serif; letter-spacing: .5px; text-align: center;
  touch-action: none; -webkit-tap-highlight-color: transparent; backdrop-filter: blur(3px); }
.tbtn b { font-size: 22px; line-height: 1; margin-bottom: 2px; }
.tbtn.active, .tbtn.on { background: rgba(245,197,24,.75); border-color: #fff; }
#jumpBtn { right: 22px; bottom: 26px; width: 84px; height: 84px; }
#runBtn { right: 120px; bottom: 34px; }
#carBtn { right: 34px; bottom: 128px; background: rgba(245,197,24,.55); display: none; }
#gasBtn { right: 18px; bottom: 22px; width: 82px; height: 128px; border-radius: 20px; background: rgba(40,160,70,.5); }
#brakeBtn { right: 112px; bottom: 22px; width: 82px; height: 96px; border-radius: 20px; background: rgba(200,50,50,.45); }
#hornBtn { right: 120px; bottom: 132px; width: 56px; height: 56px; }
/* engine on/off while seated (game/player.js toggleEngine); off: lit red */
#engBtn { right: 186px; bottom: 132px; width: 56px; height: 56px; font-size: 9.5px; }
#engBtn b { font-size: 18px; }
body.engine-off #engBtn { background: rgba(200,50,50,.6); }
/* steering with arrows (Settings › Controls; game/input.js): ◀ ▶ under the left thumb instead of the stick */
#leftBtn, #rightBtn { bottom: 22px; width: 84px; height: 84px; border-radius: 20px; }
#leftBtn b, #rightBtn b { font-size: 30px; margin: 0; }
#leftBtn { left: 18px; } #rightBtn { left: 114px; }
body:not(.steer-arrows) #leftBtn, body:not(.steer-arrows) #rightBtn { display: none; }
body.driving.steer-arrows #joy { display: none; }
#fsBtn { right: 136px; top: 14px; width: 44px; height: 44px; font-size: 20px; }
#mapBtn { right: 188px; top: 14px; width: 44px; height: 44px; font-size: 20px; }
body:not(.driving) .tbtn.drive { display: none; }
body.driving .tbtn.foot { display: none; }
body.driving #carBtn { right: 30px; bottom: 166px; }
/* the key fob: near one of your cars, on foot (ui/cars-ui.js shows it); the label is what a tap does */
#lockBtn { display: none; width: 52px; height: 52px; font-size: 9.5px; background: rgba(15,29,51,.5); }
#lockBtn b { font-size: 19px; }
#lockBtn.locked { background: rgba(200,50,50,.5); }
body.driving #lockBtn { display: none !important; }

/* proximity voice: always visible while playing (desktop + phone) */
#micBtn { display: none; left: 26px; bottom: 96px; width: 52px; height: 52px; font-size: 22px; background: rgba(15,29,51,.55); z-index: 3; }
body.mode-play #micBtn { display: flex; }
.touch #micBtn { left: auto; right: 240px; top: 14px; bottom: auto; width: 44px; height: 44px; font-size: 20px; }
#micBtn.on { background: var(--brand, #1f6fe5); border-color: #fff; box-shadow: 0 0 0 4px rgba(31,111,229,.35); }

/* fast travel from the big map */
#travel { display: none; position: absolute; left: 50%; bottom: 56px; transform: translateX(-50%); width: min(520px, calc(100vw - 24px)); background: #fff; color: #0f1d33; border-radius: 20px; padding: 12px; box-shadow: 0 10px 34px rgba(0,0,0,.35); font-family: var(--ui, system-ui); }
#travel.open { display: block; }
#travel .tv-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
#travel .tv-hd strong { font: 800 16px var(--ui, system-ui); } #travel .tv-hd span { flex: 1; font: 600 13px var(--ui, system-ui); color: #6b7a90; }
#bigmap #travel button { color: #0f1d33; background: #eef3fb; border: 0; border-radius: 14px; padding: 10px 12px; font: 800 14px var(--ui, system-ui); }
#travel .tv-hd button { padding: 6px 10px !important; }
#travel .tv-opts { display: flex; gap: 8px; } #bigmap #travel .tv-opts button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
#travel .tv-opts b { color: #1554b8; font-size: 13px; } #travel .tv-opts small { font-weight: 600; font-size: 11px; color: #6b7a90; }
#bigmap #travel button[data-go="taxi"] { background: #fff5d6; } #bigmap #travel button:disabled { opacity: .45; }
#bigmap #travel .tv-home { width: 100%; margin-top: 8px; background: #1f6fe5; color: #fff; }
#travel .tv-list { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow-y: auto; } #bigmap #travel .tv-list button { text-align: left; }
/* the places list (ui/map.js): a side panel on wide screens, a sheet from the bottom on phones */
#bigmap #mapList { position: absolute; top: 58px; left: 12px; font-weight: 800; }
#bigmap.places-open #mapList { display: none; }
#places { display: none; position: absolute; left: 12px; top: 12px; bottom: 12px; width: 340px; flex-direction: column; background: #fff; color: #0f1d33; border-radius: 20px; box-shadow: 0 10px 34px rgba(0,0,0,.35); font-family: var(--ui, system-ui); overflow: hidden; }
#bigmap.places-open #places { display: flex; }
#places .pl-hd { display: flex; align-items: center; gap: 8px; padding: 14px 12px 10px 16px; }
#places .pl-hd strong { flex: 1; font: 800 17px var(--ui, system-ui); }
#bigmap #places button { color: #0f1d33; background: #eef3fb; border: 0; border-radius: 12px; padding: 7px 11px; font: 700 13px var(--ui, system-ui); }
#places input { flex-shrink: 0; margin: 0 12px 10px; padding: 10px 14px; border: 1.5px solid #d5deeb; border-radius: 12px; background: #f6f8fc; color: #0f1d33; font: 600 15px var(--ui, system-ui); outline: none; }
#places input:focus { border-color: #1f6fe5; background: #fff; }
#places .pl-kinds { flex-shrink: 0; display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 10px; scrollbar-width: none; touch-action: pan-x; }
#places .pl-kinds::-webkit-scrollbar { display: none; }
#bigmap #places .pl-kinds button { flex-shrink: 0; white-space: nowrap; border-radius: 999px; padding: 7px 12px; }
#bigmap #places .pl-kinds button.on { background: #1f6fe5; color: #fff; }
#places .pl-kinds small { margin-left: 6px; font-weight: 700; opacity: .6; }
#places .pl-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 4px 8px 10px; border-top: 1px solid #eef1f6; }
#bigmap #places .pl-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; background: none; border-radius: 14px; text-align: left; }
#bigmap #places .pl-list button:hover { background: #f2f6fc; }
#places .pl-ic { flex-shrink: 0; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #eef3fb; font-size: 20px; }
#places .mine .pl-ic { background: #1f6fe5; }
#places .pl-tx { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#places .pl-tx b { font: 800 14px var(--ui, system-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#places .mine .pl-tx b { color: #1554b8; }
#places .pl-tx small { font: 600 12px var(--ui, system-ui); color: #6b7a90; }
#places .pl-none { padding: 24px 12px; text-align: center; color: #6b7a90; font: 600 14px var(--ui, system-ui); }
@media (min-width: 900px) { #bigmap.places-open #travel, #bigmap.places-open .hint { left: calc(50% + 176px); } } /* beside the panel */
@media (max-width: 899px) {
  #places { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: min(72vh, 620px); border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  #places::before { content: ''; align-self: center; width: 40px; height: 4px; margin-top: 8px; border-radius: 2px; background: #d5deeb; } /* a sheet */
  #places .pl-hd { padding-top: 8px; }
  #bigmap.places-open .hint { display: none; }
}

/* taxi ride card (ui/taxi-ride.js) */
#rideCard { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(340px, calc(100vw - 24px));
  padding: 14px 16px; border-radius: 22px; background: rgba(60, 60, 64, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: #fff; font: 14px/1.35 system-ui, sans-serif; z-index: 60; display: none; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
#rideCard.show { display: block; }
#rideCard strong { display: block; font-size: 17px; margin-bottom: 8px; }
#rideCard .rcBar { display: block; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); overflow: hidden; }
#rideCard .rcBar u { display: block; height: 100%; width: 0; background: #f5c518; transition: width .25s linear; }
#rideCard #rcEta { display: block; margin-top: 6px; color: rgba(255,255,255,.75); font-size: 13px; }
#rideCard .rcChips { display: flex; gap: 6px; margin: 8px 0; }
#rideCard .rcChips b, #rideCard .rcChips em { font-style: normal; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
#rideCard .rcChips b { background: #b5e853; color: #1d2b0a; }
#rideCard .rcChips em { background: rgba(255,255,255,.18); }
#rideCard p { margin: 0 0 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.15); min-height: 2.7em; }
#rideCard button { width: 100%; padding: 11px; border: 0; border-radius: 999px; background: #fff; color: #111; font-weight: 700; font-size: 15px; cursor: pointer; }

/* car dashboard while driving (ui/dashboard.js) */
#dash { position: fixed; right: 22px; bottom: 96px; z-index: 30; display: none; align-items: center; gap: 12px; padding: 10px 14px 12px;
  background: rgba(14, 16, 20, .78); color: #fff; border-radius: 16px; font-family: system-ui, sans-serif; pointer-events: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25); min-width: 170px; flex-wrap: wrap; }
#dash.on { display: flex; }
body.driving #speedo { display: none !important; } /* the dashboard shows speed and the car's name */
#dash .dash-name { flex-basis: 100%; font: 700 11px system-ui, sans-serif; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: -4px; }
#dash .dash-speed { display: flex; align-items: baseline; gap: 5px; flex: 1; }
#dash .dash-speed b { font: 800 34px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
#dash .dash-speed span { font: 600 12px system-ui, sans-serif; opacity: .7; }
#dash .dash-gear { font: 800 26px/1 system-ui, sans-serif; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #ffd23f; }
#dash .dash-rev { flex-basis: 100%; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .15); overflow: hidden; }
#dash .dash-rev i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3ecf6b, #ffd23f 70%, #e8453c); }
#dash.redline .dash-gear { background: #e8453c; color: #fff; }
#dash.ev .dash-rev { display: none; }
/* phones: on the left, half-way down - the free space between the needs at the top and the stick at the bottom (the user, 16 Oct 2026) */
@media (pointer: coarse) { #dash { right: auto; left: calc(env(safe-area-inset-left, 0px) + 10px); top: 42%; transform: translateY(-50%); bottom: auto; min-width: 0; width: 132px; padding: 6px 10px 8px; gap: 8px; }
  #dash .dash-speed b { font-size: 26px; } #dash .dash-gear { width: 30px; height: 30px; font-size: 20px; } }

/* okada / taxi shift card (ui/trips.js): same look as the taxi ride card, at the top */
#tripCard { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 64px); transform: translateX(-50%); width: min(360px, calc(100vw - 24px));
  padding: 12px 14px; border-radius: 20px; background: rgba(60, 60, 64, .8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: #fff; font: 14px/1.35 system-ui, sans-serif; z-index: 55; display: none; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
#tripCard.show { display: block; }
#tripCard strong { display: block; font-size: 15px; margin-bottom: 4px; }
#tripCard #tcWhat { display: block; font-size: 14px; margin-bottom: 8px; }
#tripCard .rcBar { display: block; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); overflow: hidden; }
#tripCard .rcBar u { display: block; height: 100%; width: 0; background: #f5c518; transition: width .25s linear; }
#tripCard .rcChips { display: flex; gap: 6px; margin: 8px 0 6px; }
#tripCard .rcChips b, #tripCard .rcChips em { font-style: normal; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
#tripCard .rcChips b { background: #b5e853; color: #1d2b0a; }
#tripCard .rcChips em:empty { display: none; }
#tripCard .rcChips em { background: rgba(255,255,255,.18); }
#tripCard p { margin: 0 0 8px; color: rgba(255,255,255,.85); font-size: 13px; min-height: 1.3em; }
#tripCard button { width: 100%; padding: 8px; border: 0; border-radius: 999px; background: rgba(255,255,255,.2); color: #fff; font-weight: 700; cursor: pointer; }
.tripCoin { position: fixed; left: 50%; top: 40%; transform: translateX(-50%); font: 800 28px system-ui, sans-serif; color: #ffd84a;
  text-shadow: 0 2px 8px rgba(0,0,0,.6); z-index: 70; pointer-events: none; animation: tripCoin 1.8s ease-out forwards; }
@keyframes tripCoin { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -60px) scale(1); } }
