:root { --y: #f5c400; --ink: #121212; --panel: rgba(16,16,16,.88); --line: #2c2c2c; --txt: #fff; --dim: #a9a9a9; --grn: #3ddc72; --red: #ff4b3e; --blu: #4aa8ff; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; font-family: "Trebuchet MS", Verdana, sans-serif; color: var(--txt); }
body { display: flex; align-items: center; justify-content: center; }
#stage { position: relative; overflow: hidden; background: #0d1420; }
#gl { position: absolute; left: 0; top: 0; display: block; }
#hud { position: absolute; left: 0; top: 0; transform-origin: 0 0; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
#home { display: none; position: fixed; bottom: 6px; left: 8px; z-index: 20; font: bold 12px "Trebuchet MS", Verdana, sans-serif;
  color: var(--y); text-decoration: none; background: rgba(18,18,18,.85); border: 2px solid var(--y); border-radius: 8px; padding: 3px 8px; }
#home:hover { background: var(--y); color: #111; }
.hide { display: none !important; }
button { font-family: inherit; cursor: pointer; }
.panel { background: var(--panel); border-radius: 10px; border: 1px solid #000; box-shadow: 0 2px 0 rgba(0,0,0,.4); }
.check { height: 6px; background: repeating-linear-gradient(90deg, #111 0 6px, var(--y) 6px 12px); border-radius: 3px; }

/* ---------- play HUD ---------- */
#play { position: absolute; inset: 0; pointer-events: none; }
#play button, #play canvas, #play .panel { pointer-events: auto; }
#tl { position: absolute; left: 12px; top: 12px; padding: 6px 12px 7px; min-width: 120px; }
#money { font-size: 24px; font-weight: bold; color: var(--y); letter-spacing: .5px; }
#money.neg { color: var(--red); }
#sub { font-size: 12px; color: var(--dim); }
#nav { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 8px; min-width: 300px; }
#navArrow { width: 46px; height: 46px; }
#navDist { font-size: 20px; font-weight: bold; color: var(--y); }
#navText { font-size: 13px; color: #ddd; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#navKm { margin-left: auto; font-size: 12px; color: var(--dim); text-align: right; }
#tr { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#mmWrap { position: relative; width: 190px; height: 190px; }
#mini { width: 190px; height: 190px; border-radius: 50%; box-shadow: 0 0 0 3px #111, 0 0 0 5px var(--y); background: #3b4a3b; }
#clock { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); background: #111; border: 2px solid var(--y); border-radius: 10px; padding: 1px 9px; font-size: 14px; font-weight: bold; }
#topBtns { display: flex; gap: 5px; margin-top: 10px; }
.ib { min-width: 34px; height: 30px; padding: 0 6px; border-radius: 8px; border: 2px solid #000; background: var(--y); color: #111; font-weight: bold; font-size: 11px; box-shadow: 0 2px 0 #7a6200; }
.ib:active, .ib.on { transform: translateY(2px); box-shadow: none; }
.ib.off { background: #555; color: #ddd; box-shadow: 0 2px 0 #222; }
#br { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#speedo { width: 190px; height: 128px; }
#gauge { width: 176px; padding: 6px 8px; font-size: 12px; }
.gRow { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.gRow.small { font-size: 11px; color: var(--dim); margin-top: 3px; }
#gIcon { font-weight: bold; color: var(--y); }
.gBar { height: 9px; background: #333; border-radius: 5px; overflow: hidden; margin-top: 4px; }
#gFill { display: block; height: 100%; width: 50%; background: var(--grn); border-radius: 5px; }
#gauge.low #gFill { background: var(--red); animation: blink .6s steps(2) infinite; }
#gauge.ev #gFill { background: var(--blu); }
#gauge.ev.low #gFill { background: var(--red); }
@keyframes blink { 50% { opacity: .25; } }
#dmg { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #3a3a3a; box-shadow: inset 0 0 0 2px #111; }
#dmg.d1 { background: #ffa21a; } #dmg.d2 { background: var(--red); } #dmg.d3 { background: var(--red); animation: blink .5s steps(2) infinite; }
#prompt { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); background: var(--panel); border: 2px solid var(--y); border-radius: 12px; padding: 8px 16px; font-size: 16px; font-weight: bold; white-space: nowrap; }
#prompt kbd { background: var(--y); color: #111; border-radius: 5px; padding: 0 6px; font-family: inherit; }
#toasts { position: absolute; left: 50%; top: 176px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: var(--panel); border-left: 5px solid var(--y); border-radius: 8px; padding: 6px 14px; font-size: 15px; font-weight: bold; animation: tin .25s ease-out; white-space: nowrap; }
.toast.warn { border-left-color: var(--red); }
.toast.good { border-left-color: var(--grn); }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all .4s; }
@keyframes tin { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1); } }
#ctx { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); min-width: 150px; height: 48px; border-radius: 12px; border: 3px solid #000; background: var(--y); color: #111; font-size: 18px; font-weight: bold; box-shadow: 0 3px 0 #7a6200; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 3px 0 #7a6200, 0 0 0 6px rgba(245,196,0,.35); } }

/* ---------- touch controls (mobile only) ---------- */
#touch { position: absolute; inset: 0; pointer-events: none; }
.tc { position: absolute; pointer-events: auto; border: 3px solid rgba(0,0,0,.7); border-radius: 16px; background: rgba(20,20,20,.45); color: #fff; font-weight: bold; font-size: 16px; touch-action: none; }
#touch .tc.on { background: rgba(245,196,0,.75); color: #111; }
#steerBtns .tc { width: 88px; height: 88px; bottom: 14px; font-size: 30px; }
#tL { left: 14px; } #tR { left: 112px; }
#tGas { right: 14px; bottom: 14px; width: 90px; height: 150px; background: rgba(40,140,60,.5); font-size: 20px; }
#tBrake { right: 114px; bottom: 14px; width: 90px; height: 110px; background: rgba(150,40,40,.5); }
#tHand { right: 114px; bottom: 134px; width: 72px; height: 64px; font-size: 12px; border-radius: 50%; }
#wheel { position: absolute; left: 20px; bottom: 14px; width: 150px; height: 150px; border-radius: 50%; pointer-events: auto; touch-action: none; background: rgba(20,20,20,.35); border: 3px solid rgba(0,0,0,.6); }
#wheelIn { position: absolute; inset: 14px; border-radius: 50%; border: 12px solid rgba(245,196,0,.8); }
#wheelIn::after { content: ''; position: absolute; left: 50%; top: -12px; width: 8px; height: 30px; margin-left: -4px; background: #111; border-radius: 4px; }

/* ---------- menus and panels ---------- */
#menu { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); }
#menu.clear { background: none; }
#menu.side { justify-content: flex-end; padding-right: 5%; box-sizing: border-box; }
.card { background: #141414; border: 2px solid #000; border-radius: 16px; box-shadow: 0 8px 30px rgba(0,0,0,.6); padding: 16px 20px 18px; min-width: 320px; max-width: 92%; max-height: 92%; overflow: auto; position: relative; }
.card .x { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; border-radius: 12px; border: 2px solid #000; background: #333; color: #fff; font-size: 18px; font-weight: bold; }
.card h1 { margin: 2px 0 10px; font-size: 26px; color: var(--y); text-align: center; letter-spacing: 1px; }
.card h2 { margin: 2px 0 8px; font-size: 20px; color: var(--y); }
.card p { margin: 6px 0; font-size: 14px; color: #ddd; line-height: 1.35; }
.col { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn { min-height: 44px; padding: 0 18px; border-radius: 12px; border: 3px solid #000; background: var(--y); color: #111; font-size: 16px; font-weight: bold; box-shadow: 0 3px 0 #7a6200; }
.btn:active { transform: translateY(3px); box-shadow: none; }
.btn.alt { background: #e9e9e9; box-shadow: 0 3px 0 #777; }
.btn.dark { background: #333; color: #fff; box-shadow: 0 3px 0 #111; }
.btn.sm { min-height: 34px; font-size: 13px; padding: 0 10px; }
.btn[disabled] { opacity: .4; cursor: default; }
.set { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; font-size: 14px; }
.seg { display: inline-flex; border: 2px solid #000; border-radius: 10px; overflow: hidden; }
.seg button { min-height: 36px; min-width: 52px; border: 0; background: #333; color: #ddd; font-weight: bold; font-size: 13px; padding: 0 10px; }
.seg button.on { background: var(--y); color: #111; }
.cars { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.carc { width: 190px; background: #1d1d1d; border: 2px solid #000; border-radius: 12px; padding: 8px 10px 10px; text-align: left; color: #fff; }
.carc.sel { border-color: var(--y); box-shadow: 0 0 0 2px var(--y); }
.carc b { color: var(--y); font-size: 15px; }
.carc .st { font-size: 12px; color: #bbb; margin-top: 4px; line-height: 1.4; }
.bars div { display: grid; grid-template-columns: 54px 1fr; gap: 6px; align-items: center; font-size: 11px; color: #aaa; }
.bars i { display: block; height: 6px; background: #333; border-radius: 3px; overflow: hidden; }
.bars i::after { content: ''; display: block; height: 100%; width: var(--v); background: var(--y); }
.big { font-size: 22px; font-weight: bold; color: var(--y); }
.meter { font: bold 26px "Courier New", monospace; color: #7dff9a; background: #071a0c; border-radius: 8px; padding: 4px 12px; text-align: right; }
.tbar { height: 12px; background: #333; border-radius: 6px; overflow: hidden; }
.tbar i { display: block; height: 100%; background: var(--grn); width: 0; }
.dlist { max-height: 300px; overflow: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.dlist button { text-align: left; min-height: 32px; font-size: 12px; border-radius: 8px; border: 1px solid #000; background: #2a2a2a; color: #eee; padding: 2px 8px; }
.dlist button.on { background: var(--y); color: #111; }
.logo { font-size: 54px; font-weight: bold; color: var(--y); text-shadow: 0 4px 0 #000, 0 0 18px rgba(245,196,0,.35); letter-spacing: 2px; text-align: center; }
.logo small { display: block; font-size: 15px; color: #eee; text-shadow: 0 2px 0 #000; letter-spacing: 0; font-weight: normal; }

/* ---------- full map ---------- */
#fullmap { position: absolute; inset: 0; background: #1b2633; }
#bigmap { position: absolute; left: 0; top: 0; touch-action: none; }
#fmBar { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; align-items: center; gap: 10px; padding: 6px 10px; font-size: 13px; }
#fmBar b { color: var(--y); font-size: 18px; }
#fmHint { color: #ccc; flex: 1; }
#fmLegend { position: absolute; left: 10px; bottom: 40px; padding: 6px 10px; font-size: 12px; line-height: 1.6; }
#fmLegend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
#fmCard { position: absolute; right: 10px; bottom: 10px; padding: 10px 14px; font-size: 13px; max-width: 280px; }
#fmCard b { color: var(--y); font-size: 15px; }

/* ---------- debug, fade, loading ---------- */
#debug { position: absolute; left: 12px; top: 70px; width: 300px; background: rgba(0,0,0,.78); border: 1px solid #444; border-radius: 8px; padding: 6px 8px; font: 11px/1.35 Consolas, monospace; color: #cfe; pointer-events: auto; }
#debug .ok { color: #7f7; } #debug .bad { color: #f77; }
#debug select { width: 100%; margin-top: 4px; font-size: 12px; }
#fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .35s; }
#fade.on { opacity: 1; }
#loading { position: absolute; inset: 0; background: radial-gradient(circle at 50% 40%, #232323, #0b0b0b); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.lbar { width: 320px; height: 14px; border: 2px solid var(--y); border-radius: 8px; overflow: hidden; }
.lbar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, #111 0 10px, var(--y) 10px 20px); transition: width .2s; }
#ltext { font-size: 14px; color: #ccc; }

/* ---------- mobile mode ---------- */
html.m, html.m body { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
html.m body { box-sizing: border-box; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
html.m #tr { top: 8px; right: 10px; flex-direction: column-reverse; gap: 8px; }
html.m #topBtns { margin-top: 0; gap: 6px; }
html.m .ib { min-width: 54px; height: 52px; font-size: 13px; border-radius: 10px; }
html.m #mmWrap, html.m #mini { width: 124px; height: 124px; }
html.m #clock { font-size: 13px; }
html.m #tl { left: 10px; top: 8px; }
html.m #br { right: auto; left: 50%; transform: translateX(-50%); bottom: 6px; flex-direction: row; align-items: flex-end; }
html.m #speedo { width: 150px; height: 101px; }
html.m #gauge { width: 140px; }
html.m #nav { top: 68px; left: 10px; transform: none; min-width: 0; padding: 4px 10px 4px 6px; }
html.m #navKm { display: none; }
html.m #navArrow { width: 40px; height: 40px; }
html.m #navText { max-width: 170px; }
html.m #prompt { bottom: 130px; font-size: 15px; }
html.m #ctx { left: auto; right: 140px; bottom: 212px; transform: none; min-width: 0; width: 104px; height: 54px; font-size: 14px; padding: 0 2px; }
html.m #toasts { top: auto; bottom: 124px; flex-direction: column-reverse; }
html.m .card { touch-action: pan-y; padding: 12px 16px 14px; max-height: 97%; box-sizing: border-box; }
html.m .set { grid-template-columns: auto auto auto auto; gap: 8px 12px; font-size: 13px; }
html.m .card h2 { margin-right: 50px; }
html.m .card:not(.garage) .x + h2 { margin-right: 62px; min-height: 48px; }
/* the HUD is scaled to the screen height (440 logical px), so 52 px here is at least 44 CSS px on a 375 px tall phone */
html.m .btn, html.m .btn.sm, html.m .seg button, html.m #fmBar .btn { min-height: 52px; }
html.m .seg button { min-width: 56px; }
html.m .btn { min-width: 56px; }
html.m .set .seg { justify-self: start; }
html.m .card .x { width: 52px; height: 52px; }
html.m .col { gap: 7px; }
html.m .toast { font-size: 14px; }
#mrot { display: none; }
@media (orientation: portrait) { html.m #mrot { display: flex; position: fixed; inset: 0; z-index: 30; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: #111; color: var(--y); font: bold 22px "Trebuchet MS", Verdana, sans-serif; text-align: center; padding: 24px; } }
#mrot svg { width: 96px; height: 96px; animation: mrot 2.4s ease-in-out infinite; }
#mrot small { font-size: 16px; color: #eee; font-weight: normal; }
@keyframes mrot { 0%, 25% { transform: rotate(0); } 50%, 75% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }

/* ---------- career HUD (stage 2) ---------- */
#tlRow { display: flex; align-items: center; gap: 7px; margin-top: 2px; font-size: 12px; font-weight: bold; }
#rate { color: #ffd75a; }
#lvl { background: var(--y); color: #111; border-radius: 6px; padding: 0 5px; }
#xpBar { width: 54px; height: 6px; background: #333; border-radius: 3px; overflow: hidden; }
#xpFill { display: block; height: 100%; width: 0; background: #7dd3ff; }
#streak { display: inline-flex; align-items: center; gap: 1px; color: #ffb21a; }
#streak svg { width: 13px; height: 15px; }
#job { position: absolute; left: 50%; top: 74px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 6px 12px 7px 8px; min-width: 330px; max-width: 470px; border-top: 4px solid var(--tc, var(--y)); }
#job.late { animation: lateGlow 1s ease-in-out infinite; }
@keyframes lateGlow { 50% { box-shadow: 0 0 0 3px rgba(255,75,62,.65); } }
#jobFace { width: 38px; height: 38px; flex: none; }
#jobFace .face { width: 38px; height: 38px; display: block; }
.pickIcon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #111; color: #111; flex: none; }
#jobFace .pickIcon { width: 36px; height: 36px; }
.ico { width: 70%; height: 70%; fill: currentColor; }
#jobMain { flex: 1; min-width: 0; }
#jobTitle { font-size: 14px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#jobDue { font-size: 12px; color: #ddd; margin: 1px 0 3px; white-space: nowrap; }
#job.late #jobDue { color: var(--red); font-weight: bold; }
.jBar { height: 6px; background: #333; border-radius: 3px; overflow: hidden; }
.jBar i { display: block; height: 100%; width: 100%; background: var(--grn); transition: width .3s; }
.jBar.sat i { background: linear-gradient(90deg, #ff4b3e, #f5c400 50%, #3ddc72); }
#jobSide { width: 92px; text-align: right; }
#jobFare { font-size: 17px; font-weight: bold; color: var(--y); margin-bottom: 4px; }
#bubble { position: absolute; left: 50%; top: 134px; transform: translateX(-50%); background: #fff; color: #111; font-weight: bold; font-size: 15px; padding: 6px 14px; border-radius: 14px; border: 2px solid #111; white-space: nowrap; }
#bubble::after { content: ''; position: absolute; left: 24px; top: -10px; border: 8px solid transparent; border-bottom-color: #fff; }
#bubble.pop { animation: bub .3s cubic-bezier(.3,1.6,.6,1); }
@keyframes bub { from { transform: translateX(-50%) scale(.4); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
#tut { position: absolute; left: 12px; top: 96px; max-width: 330px; padding: 8px 10px; font-size: 13px; line-height: 1.35; display: flex; gap: 8px; align-items: center; border-left: 5px solid var(--y); }
#tut kbd, #nitroRow kbd { background: var(--y); color: #111; border-radius: 4px; padding: 0 4px; font: bold 10px inherit; }
#pins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pin { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; transform-origin: 50% 100%; }
.pin b { background: #111; color: #fff; font-size: 13px; padding: 2px 7px; border-radius: 8px; border: 2px solid var(--pc); white-space: nowrap; }
.pin i { width: 22px; height: 22px; margin-top: 3px; border-radius: 50%; background: conic-gradient(var(--pc) var(--pat), rgba(0,0,0,.45) 0); border: 2px solid #111; }
.pin.res b { background: var(--pc); color: #111; }
#card { position: absolute; left: 12px; bottom: 150px; width: 300px; padding: 8px 10px; }
.rc { font-size: 13px; }
.rcHead { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.rcHead b { font-size: 15px; color: var(--tc); }
.rcHead .pickIcon { width: 26px; height: 26px; }
.rcFare { margin-left: auto; font-size: 17px; font-weight: bold; color: var(--y); }
.rcLine { margin: 2px 0; line-height: 1.3; }
.rcLine.dim, .dim { color: #aaa; }
.rcLine.bad { color: var(--red); font-weight: bold; }
.arr { color: var(--y); }
.small { font-size: 12px; }
#bigText { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-size: 64px; font-weight: bold; color: var(--y); text-shadow: 0 4px 0 #000, 0 0 30px rgba(245,196,0,.6); pointer-events: none; letter-spacing: 2px; }
#bigText.late { color: var(--red); text-shadow: 0 4px 0 #000, 0 0 30px rgba(255,75,62,.7); }
#bigText.go { animation: big 1.3s ease-out forwards; }
@keyframes big { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; } 18% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 30% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { transform: translate(-50%, -60%) scale(1); opacity: 0; } }
#gauge.dim > .gBar #gFill { opacity: .45; }
#lpgRow .gBar i, #nitroRow .gBar i { display: block; height: 100%; width: 0; border-radius: 5px; }
#lpgFill { background: #ffb21a; }
#lpgRow.on #lpgText { color: #ffb21a; font-weight: bold; }
#nitroFill { background: #4aa8ff; }
#nitroRow.jet #nitroFill { background: linear-gradient(90deg, #ff7a1a, #fff0a0); }
#nitroRow.on .gBar { box-shadow: 0 0 6px #4aa8ff; }
#tNitro { right: 14px; bottom: 172px; width: 90px; height: 56px; background: rgba(40,110,220,.6); font-size: 15px; }

/* ---------- dispatch phone ---------- */
#phone { position: absolute; z-index: 3; left: 12px; top: 92px; width: 268px; background: #0d0d0d; border: 3px solid #333; border-radius: 22px; box-shadow: 0 8px 26px rgba(0,0,0,.6), inset 0 0 0 2px #000; pointer-events: auto; overflow: hidden; }
.phoneTop { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 4px 14px; background: #1a1a1a; font-size: 12px; color: #ccc; }
.phoneTop b { color: var(--y); letter-spacing: 1px; }
.pX { width: 34px; height: 30px; border-radius: 10px; border: 2px solid #000; background: #333; color: #fff; font-weight: bold; }
.phoneBody { max-height: 300px; overflow: auto; padding: 6px 8px; }
.pTitle { font-size: 12px; color: #aaa; text-transform: uppercase; letter-spacing: 1px; margin: 2px 0 6px; }
.pRow { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; margin-bottom: 5px; padding: 4px 6px 7px; border-radius: 10px; border: 1px solid #000; background: #222; color: #fff; text-align: left; overflow: hidden; }
.pRow.no { opacity: .6; }
.pMid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pMid b { font-size: 13px; } .pMid small, .pEnd small { font-size: 11px; color: #aaa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pEnd { display: flex; flex-direction: column; align-items: flex-end; } .pEnd b { color: var(--y); font-size: 14px; }
.pPat { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--grn); }
.phoneFoot { padding: 4px 8px 10px; display: flex; justify-content: center; }

/* ---------- payout card ---------- */
#payout { position: absolute; left: 12px; top: 168px; pointer-events: auto; }
#payout.hide { display: none; }
#payout.show { animation: payIn .45s cubic-bezier(.3,1.5,.6,1); transform-origin: 0 0; }
#payout.out { opacity: 0; transform: translateY(-20px); transition: all .35s; }
@keyframes payIn { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.payCard { width: 320px; background: #141414; border: 3px solid var(--y); border-radius: 16px; padding: 10px 16px 12px; box-shadow: 0 10px 40px rgba(0,0,0,.7); }
.pStars { display: flex; justify-content: center; gap: 4px; }
.pStars span { width: 40px; height: 40px; animation: starIn .35s backwards cubic-bezier(.3,1.8,.6,1); }
.pStars .star { width: 100%; height: 100%; fill: #333; stroke: #000; stroke-width: 1.2; }
.pStars .star.on { fill: #ffd21a; filter: drop-shadow(0 0 6px rgba(255,210,26,.8)); }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); } to { transform: scale(1) rotate(0); } }
.pSat { text-align: center; font-size: 13px; color: #bbb; margin: 2px 0 6px; }
.pSat b { color: #fff; }
.pl { display: flex; justify-content: space-between; font-size: 13px; padding: 1px 0; color: #ddd; }
.pl.head { border-top: 1px solid #333; margin-top: 4px; padding-top: 4px; font-size: 14px; color: #fff; }
.pos { color: var(--grn); } .neg { color: var(--red); }
.pTotal { text-align: center; font-size: 34px; font-weight: bold; color: var(--y); text-shadow: 0 3px 0 #000; margin: 4px 0 2px; }
.pFoot { text-align: center; font-size: 12px; color: #bbb; }

/* ---------- title, how to play, stats ---------- */
.titleCard { min-width: 360px; background: rgba(14,14,14,.9) !important; }
.logo.led { font-size: 62px; letter-spacing: 6px; color: transparent; background: radial-gradient(circle, #ffd21a 42%, rgba(255,210,26,.12) 48%) 0 0 / 6px 6px; -webkit-background-clip: text; background-clip: text; text-shadow: none; filter: drop-shadow(0 0 8px rgba(245,196,0,.55)); animation: led 2.6s steps(2) infinite; }
@keyframes led { 0%, 70% { filter: drop-shadow(0 0 8px rgba(245,196,0,.55)); } 85% { filter: drop-shadow(0 0 16px rgba(61,255,115,.6)) hue-rotate(60deg); } }
.tagline { text-align: center; color: #eee; font-size: 15px; }
.row.two { flex-wrap: nowrap; } .row.two .btn { flex: 1; }
.how h2 small { font-size: 13px; color: #888; }
.howBody { display: flex; gap: 14px; align-items: flex-start; min-height: 190px; }
.howIll { flex: none; width: 150px; height: 100px; background: #1d2633; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.howIll svg { width: 130px; height: 80px; }
.howBody h3 { margin: 2px 0 4px; color: var(--y); font-size: 17px; }
.dots { display: flex; justify-content: center; gap: 6px; margin: 8px 0; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: #444; } .dots i.on { background: var(--y); }
.statGrid { display: grid; grid-template-columns: auto auto auto auto; gap: 5px 14px; font-size: 13px; margin: 6px 0; }
.statGrid span { color: #aaa; } .statGrid b { color: #fff; }

/* ---------- garage ---------- */
.card.garage { width: 470px; max-height: 96%; display: flex; flex-direction: column; padding: 12px 14px 12px; background: rgba(16,16,16,.94); }
.garage h2 small { font-size: 14px; color: #ddd; font-weight: normal; margin-left: 6px; }
.gHead { display: flex; gap: 16px; font-size: 13px; color: #aaa; margin: -2px 0 8px; } .gHead b { color: var(--y); }
.gTabs { display: flex; width: 100%; flex: none; } .gTabs button { flex: 1; }
.gBody { flex: 1; overflow: auto; margin-top: 8px; padding-right: 2px; }
.uRow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px; border-radius: 8px; }
.uRow.focus { background: #232323; }
.uRow.meme { border: 1px dashed #665a1a; margin-top: 2px; }
.uName { display: flex; flex-direction: column; min-width: 0; } .uName b { font-size: 14px; } .uName small { font-size: 11px; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.chips { display: flex; gap: 3px; flex: none; }
.chip { width: 34px; height: 34px; border-radius: 8px; border: 2px solid #000; font-weight: bold; font-size: 12px; background: #2a2a2a; color: #888; padding: 0; }
.chip.fit { background: var(--y); color: #111; }
.chip.own { background: #3a3510; color: var(--y); border-color: #7a6a10; }
.chip.next { background: #e9e9e9; color: #111; }
.chip.lock { background: #2a2a2a; color: #666; }
.chip.far { background: #1f1f1f; color: #444; }
.chip.sel { box-shadow: 0 0 0 2px #fff; }
.uDet { position: sticky; bottom: 0; z-index: 1; box-shadow: 0 -6px 12px rgba(0,0,0,.6); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 2px; padding: 8px 10px; background: #1d1d1d; border-radius: 10px; font-size: 13px; min-height: 40px; }
.uDet b { color: var(--y); flex: 1; min-width: 150px; }
.tag { display: inline-block; font-size: 11px; font-weight: bold; padding: 3px 7px; border-radius: 6px; background: var(--grn); color: #111; }
.tag.lock { background: #444; color: #ddd; }
.ownRow, .shopRow, .svcRow { background: #1d1d1d; border-radius: 10px; padding: 7px 10px; margin-bottom: 6px; font-size: 13px; }
.ownRow, .svcRow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ownRow.cur, .shopRow.focus { box-shadow: inset 0 0 0 2px var(--y); }
.ownRow small, .shopRow small, .svcRow small { color: #aaa; font-size: 11px; }
.sTop { display: flex; justify-content: space-between; } .sTop b { color: var(--y); font-size: 15px; } .price { font-weight: bold; }
.shopRow .bars { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; margin-top: 4px; }
.vs { display: block; margin-top: 3px; }
.gTiers { display: flex; flex-wrap: wrap; width: 100%; margin-bottom: 6px; } .gTiers button { flex: 1; min-width: 60px; font-size: 11px; }

/* ---------- mobile mode additions ---------- */
html.m #job { top: 8px; left: 232px; right: 432px; transform: none; min-width: 0; width: auto; max-width: none; padding: 4px 8px; gap: 6px; }
html.m #jobSide { width: 74px; } html.m #jobFare { font-size: 15px; }
html.m #jobFace, html.m #jobFace .face { width: 32px; height: 32px; }
html.m #nav { top: 88px; }
html.m #bubble { top: 86px; left: auto; right: 150px; transform: none; }
html.m #bubble.pop { animation: none; }
html.m #bigText { top: 50%; font-size: 52px; }
html.m #tut { bottom: auto; top: 144px; left: 10px; max-width: 300px; font-size: 12px; padding: 5px 8px; }
html.m #card { left: 10px; top: 144px; bottom: auto; width: 300px; }
html.m #play.hasCard #tut { display: none; }
html.m #phone { left: auto; right: 152px; top: 8px; width: 290px; }
html.m .phoneBody { max-height: 250px; }
html.m .pX { width: 56px; height: 52px; }
html.m .pRow { min-height: 52px; }
html.m .chip { width: 52px; height: 52px; font-size: 14px; }
html.m .card.garage { width: 50%; min-width: 0; max-width: 50%; padding: 8px 10px; }
html.m #menu.side:has(.garage) { padding-right: 8px; }
html.m .garage .uName small { display: none; } html.m .garage .uName b { font-size: 13px; }
html.m .garage .chip { width: 44px; height: 44px; }
.uDet .uD { display: none; } html.m .uDet .uD { display: block; flex-basis: 100%; font-size: 11px; color: #aaa; margin-top: -4px; }
html.m .garage .gTabs button { font-size: 12px; padding-left: 2px; padding-right: 2px; }
html.m .uName small { max-width: 150px; }
html.m #payout { top: 64px; left: 50%; margin-left: -150px; pointer-events: none; }
html.m #payout .payCard { transform-origin: 50% 0; }
html.m .payCard { width: 300px; padding: 8px 12px 10px; }
html.m .pTotal { font-size: 28px; }
html.m .pLines, html.m .pSat { display: none; }
.pMini { display: none; text-align: center; font-size: 13px; color: #ddd; }
html.m .pMini { display: block; }
html.m .pStars span { width: 32px; height: 32px; }
html.m .howBody { min-height: 150px; }
html.m .howIll { width: 120px; height: 84px; }
html.m .statGrid { font-size: 12px; }
html.m .logo.led { font-size: 48px; }

/* ---------- QA round 1 layout fixes ---------- */
/* desktop: the tutorial hint drops below the job card, and LEVEL text moves clear of the payout card */
html:not(.m) #job:not(.hide) ~ #tut { top: 136px; }
html:not(.m) #phone, html:not(.m) #tut { top: 106px; }
html:not(.m) #payout:not(.hide) ~ #bigText { left: calc(50% + 45px); font-size: 56px; }
/* narrow phones (under 930 logical px wide): the job card sits under the money panel, the nav and cards below it */
html.m #play.narrow #sub { display: none; }
html.m #play.narrow #job { left: 10px; right: auto; top: 72px; width: 360px; }
html.m #play.narrow #nav { top: 148px; }
html.m #play.narrow #tut, html.m #play.narrow #card { top: 204px; }
.gMore { margin-right: auto; color: var(--y); font-size: 12px; font-weight: bold; }

/* ---------- radio, chat, treats, shop, route tag (2026-10-22) ---------- */
#carBar { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 11px; color: #ddd; max-width: 230px; }
#carBar:empty { display: none; }
#carBar .rd { color: var(--y); font-weight: bold; }
#carBar .fr { color: #9be05a; }
#jobProf { font-size: 11.5px; color: #ffd75a; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#jobProf:empty { display: none; }
#job.loo #jobProf { color: #ff8a7a; font-weight: bold; }
#jobFareL { display: block; font-size: 9px; letter-spacing: 1px; color: #aaa; line-height: 1; }
#navTag { display: flex; flex-direction: column; align-items: center; justify-content: center; margin-left: 4px; min-height: 40px; padding: 2px 8px; border-radius: 8px; border: 2px solid #000; background: #333; color: #fff; font-size: 10px; line-height: 1.2; }
#navTag b { font-size: 10px; letter-spacing: .5px; } #navTag small { font-size: 10px; color: #111; background: var(--y); border-radius: 4px; padding: 0 4px; margin-top: 2px; font-weight: bold; }
#navTag.k-pickup { background: #8a5a00; } #navTag.k-drop { background: #1e7a42; } #navTag.k-fuel { background: #1d5fa0; } #navTag.k-waypoint { background: #555; }
.rcKind { font-size: 10px; font-weight: bold; letter-spacing: 1px; padding: 1px 5px; border-radius: 4px; background: #333; color: #ddd; }
.rcFare small { font-size: 10px; color: #aaa; }

#carp { position: absolute; z-index: 3; left: 12px; top: 106px; width: 300px; background: #0d0d0d; border: 3px solid #333; border-radius: 16px; box-shadow: 0 8px 26px rgba(0,0,0,.6); pointer-events: auto; overflow: hidden; }
.carTop { display: flex; align-items: center; gap: 6px; padding: 6px 6px 4px 8px; background: #1a1a1a; }
.carTop .seg { flex: 1; display: flex; } .carTop .seg button { flex: 1; }
.carBody { padding: 6px 8px 8px; font-size: 12px; }
.rDisp { background: #10251a; border: 2px solid #000; border-radius: 8px; padding: 4px 8px; margin-bottom: 6px; font-family: "Courier New", monospace; color: #6dff9a; }
.rDisp b { display: block; font-size: 16px; letter-spacing: 1px; } .rDisp small { display: block; font-size: 11px; color: #9be0b0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rDisp.off { background: #1a1a1a; color: #777; } .rDisp.off small { color: #666; }
.rRow { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.rRow button, .stList button { min-height: 30px; border-radius: 8px; border: 2px solid #000; background: #333; color: #fff; font-weight: bold; font-size: 11px; padding: 0 6px; }
.rRow button { flex: 1; } .rRow button.on { background: var(--y); color: #111; }
.rRow .vol { min-width: 18px; text-align: center; color: var(--y); font-weight: bold; }
.stList { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.stList button.on { background: var(--y); color: #111; }
.stList button:disabled { opacity: .4; cursor: default; }
.stList button kbd, .keys kbd { background: #111; color: var(--y); border-radius: 3px; padding: 0 3px; margin-right: 4px; font: bold 10px inherit; }
.stList.treat { grid-template-columns: 1fr; }
.cInfo { margin: 0 0 6px; color: #ffd75a; font-size: 12px; min-height: 16px; }
.keys { margin: 6px 0 0; color: #999; font-size: 11px; }
.stTabs { display: flex; margin-bottom: 8px; } .stTabs button { flex: 1; }
.shopList .pTitle { margin-top: 6px; }
.shopItem { display: flex; align-items: center; gap: 8px; background: #1d1d1d; border-radius: 10px; padding: 4px 8px; margin-bottom: 5px; }
.shopItem > div { flex: 1; min-width: 0; } .shopItem b { display: block; font-size: 13px; color: var(--y); } .shopItem small { display: block; font-size: 11px; color: #aaa; }
.shopItem .have { min-width: 26px; text-align: right; font-weight: bold; color: #9be05a; }
.pl.dimRow span, .pl.dimRow b { color: #aaa; font-weight: normal; }

html.m #carBar { display: none; }
html.m #carBtn small { display: block; font-size: 10px; color: #1e6a2a; line-height: 1; margin-top: 2px; }
html.m #navTag { min-height: 44px; min-width: 64px; }
html.m #carp { left: 50%; top: 86px; transform: translateX(-50%); width: 300px; border-radius: 14px; }
html.m #play.narrow #carp { top: 150px; width: 290px; }
/* phone, car panel open: the passenger's line and the toasts must not go behind it.
   Wide phones: the bubble wraps in the gap between the panel and the minimap (narrow ones already have it above the panel).
   Toasts move to the left of the panel. 343 = 150 bubble right + 153 half panel + 8 gap + 32 bubble padding/border; 171 = 10 + 153 + 8. */
html.m #play.carOpen:not(.narrow) #bubble { max-width: calc(50% - 343px); white-space: normal; }
html.m #play.carOpen #toasts { left: 10px; transform: none; align-items: flex-start; max-width: calc(50% - 171px); }
html.m #play.carOpen .toast { white-space: normal; }
html.m #play.narrow .carBody .keys.opt { display: none; }
html.m .carTop .seg button, html.m .carTop .pX { min-height: 46px; height: 46px; }
html.m .rRow button, html.m .stList button { min-height: 46px; font-size: 13px; }
html.m .carBody { padding: 4px 8px 6px; }
html.m .rDisp { padding: 2px 8px; margin-bottom: 4px; } html.m .rDisp b { font-size: 14px; }
html.m .rRow { margin-bottom: 4px; }
html.m .stList.treat { grid-template-columns: repeat(3, 1fr); }
html.m .stList.treat button { font-size: 12px; line-height: 1.1; }
html.m .stList.treat button.kol { grid-column: 1 / -1; }
html.m .keys { margin-top: 4px; }
/* phone: the shop as a grid of tiles, so every item and LEAVE fit without scrolling */
html.m .shopList { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px 6px; }
/* four for the passengers (treats and cologne) on a wider card, three fresheners */
html.m .card.shopCard { width: 560px; }
html.m .shopItem { grid-column: span 3; } html.m .shopItem.fr { grid-column: span 4; }
html.m .shopList .pTitle, html.m .shopList p { grid-column: 1 / -1; margin: 2px 0 0; }
html.m .shopItem { flex-direction: column; align-items: stretch; gap: 3px; margin: 0; padding: 4px 6px; text-align: center; position: relative; }
html.m .shopItem small { display: none; } html.m .shopItem b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.m .shopItem .have { position: absolute; right: 6px; top: 3px; min-width: 0; font-size: 12px; }
html.m .shopItem .btn.sm { min-height: 46px; }

/* ---------- photo mode and the photo gallery ---------- */
#photo { position: absolute; inset: 0; touch-action: none; cursor: grab; }
#photo:active { cursor: grabbing; }
#photo button, #photo input { cursor: pointer; }
#pCross { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; pointer-events: none;
  background: linear-gradient(#fff, #fff) center / 2px 100% no-repeat, linear-gradient(#fff, #fff) center / 100% 2px no-repeat; filter: drop-shadow(0 0 1px #000); }
#pCross::after { content: ''; position: absolute; inset: -6px; border: 2px solid var(--y); border-radius: 50%; opacity: 0; }
#pCross.ping::after { animation: ping .6s ease-out; }
@keyframes ping { from { opacity: 1; transform: scale(2.2); } to { opacity: 0; transform: scale(.8); } }
#pFlash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
#pFlash.go { animation: flash .45s ease-out; }
@keyframes flash { from { opacity: .9; } to { opacity: 0; } }
#pTop { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
#pHint { flex: 1; font-size: 12px; color: #ccc; }
#pFocusV { font-size: 12px; font-weight: bold; color: var(--y); white-space: nowrap; }
#pDof.on { background: var(--y); box-shadow: 0 3px 0 #7a6200; }
#pSpeed { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px; font-size: 11px; font-weight: bold; }
#pSpeedV { color: var(--y); font-size: 13px; }
#pSliders { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 20px; padding: 4px 14px; }
#pSliders label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: bold; }
#pSliders b { min-width: 34px; color: var(--y); }
#photo input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; margin: 0; width: 170px; height: 36px; touch-action: none; }
#photo input[type=range]::-webkit-slider-runnable-track { height: 8px; background: #444; border: 2px solid #000; border-radius: 6px; }
#photo input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -11px; border-radius: 50%; background: var(--y); border: 3px solid #000; box-sizing: border-box; }
#photo input[type=range]::-moz-range-track { height: 8px; background: #444; border: 2px solid #000; border-radius: 6px; }
#photo input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--y); border: 3px solid #000; box-sizing: border-box; }
/* the speed slider stands up: low at the bottom */
#photo #pSpeedR { writing-mode: vertical-lr; direction: rtl; width: 36px; height: 260px; }
#photo #pSpeedR::-webkit-slider-runnable-track { width: 8px; height: 100%; }
#photo #pSpeedR::-webkit-slider-thumb { margin: 0 0 0 -11px; }
#photo #pSpeedR::-moz-range-track { width: 8px; height: 100%; }
#pShot { position: absolute; right: 24px; top: 50%; width: 76px; height: 76px; margin-top: -38px; border-radius: 50%; border: 5px solid #fff;
  background: radial-gradient(circle, #fff 0 52%, rgba(0,0,0,.35) 54%); box-shadow: 0 0 0 3px #000, 0 4px 12px rgba(0,0,0,.5); }
#pShot:active { transform: scale(.92); }
#pStick { position: absolute; left: 20px; bottom: 14px; width: 150px; height: 150px; border-radius: 50%; background: rgba(20,20,20,.35); border: 3px solid rgba(0,0,0,.6); touch-action: none; box-sizing: border-box; }
#pStick i { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgba(245,196,0,.8); border: 3px solid #000; box-sizing: border-box; pointer-events: none; }
#pUp, #pDown { right: 14px; width: 72px; height: 64px; font-size: 22px; }
#pUp { bottom: 90px; } #pDown { bottom: 14px; }
#photo .tc.on { background: rgba(245,196,0,.75); color: #111; }
html:not(.m) #pStick, html:not(.m) #pUp, html:not(.m) #pDown { display: none; }
#pToast { position: absolute; left: 50%; top: 74px; transform: translateX(-50%); pointer-events: none; }
html.m #pTop { left: 8px; right: 8px; top: 8px; padding: 4px 8px; }
html.m #pSpeed { top: 82px; transform: none; padding: 4px 6px; }
html.m #photo input[type=range] { height: 52px; width: 190px; }
html.m #photo input[type=range]::-webkit-slider-thumb { width: 50px; height: 50px; margin-top: -23px; }
html.m #photo input[type=range]::-moz-range-thumb { width: 50px; height: 50px; }
html.m #photo #pSpeedR { width: 52px; height: 136px; }
html.m #photo #pSpeedR::-webkit-slider-thumb { margin: 0 0 0 -23px; }
html.m #pSliders { bottom: 8px; padding: 0 12px; }
html.m #pShot { right: 16px; width: 84px; height: 84px; margin-top: -42px; }
.card.photos { width: 640px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.pgrid p { grid-column: 1 / -1; }
.pthumb { padding: 0; border: 2px solid #000; border-radius: 10px; overflow: hidden; background: #222; aspect-ratio: 16 / 10; }
.pthumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pbig img { display: block; max-width: 100%; max-height: 380px; margin: 0 auto; border-radius: 10px; border: 2px solid #000; }
.photos h2 small { font-size: 13px; color: #aaa; font-weight: normal; margin-left: 6px; }
html.m .card.photos { width: 860px; }
html.m .pgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
html.m .pbig img { max-height: 250px; }
