/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; font-size: clamp(11px, 1.55vh, 15px); }
body.playing #hud { opacity: 1; }
kbd { display: inline-block; min-width: 1.6em; padding: .08em .45em; margin-right: .35em; border-radius: .35em; background: #fff; color: #10151c; font: 800 .82em/1.5 var(--ui); text-align: center; box-shadow: 0 2px 0 rgba(0,0,0,.35); }
#mm { position: absolute; left: 18px; bottom: 46px; width: min(250px, 30vw); height: min(170px, 24vh); border-radius: 14px; overflow: hidden; border: 2px solid rgba(255,255,255,.16); box-shadow: 0 10px 30px rgba(0,0,0,.45); background: #1b1e23; }
#mm canvas { width: 100%; height: 100%; display: block; }
/* the street you are on, always: a strip along the bottom of the map */
#mm-zone { position: absolute; left: 0; right: 0; bottom: 0; padding: 5px 26px 5px 10px; background: linear-gradient(0deg, rgba(10,13,18,.94), rgba(10,13,18,.74)); color: #fff; font: 800 14px/1.25 var(--ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; direction: rtl; }
#mm-zone:empty { display: none; }
#mm-zone::before { content: ''; position: absolute; right: 10px; top: 50%; width: 9px; height: 9px; margin-top: -5px; border-radius: 50%; background: #00c2e8; box-shadow: 0 0 0 2px rgba(0,194,232,.3); }
body.touch #mm-zone { font-size: 11.5px; line-height: 1.15; padding: 3px 19px 3px 6px; }
body.touch #mm-zone:not(:empty) { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }      /* the phone map is narrow: a long name takes two lines */
body.touch #mm-zone::before { right: 6px; width: 7px; height: 7px; margin-top: -4px; }
#mm-n { position: absolute; left: 0; top: 0; width: 16px; height: 16px; border-radius: 50%; background: #fff; color: #10151c; font: 900 10px/16px var(--ui); text-align: center; }
#bars { position: absolute; left: 18px; bottom: 18px; width: min(250px, 30vw); display: flex; gap: 6px; }
.hbar { flex: 1; height: 9px; border-radius: 5px; background: rgba(0,0,0,.55); overflow: hidden; border: 1px solid rgba(255,255,255,.12); }
.hbar i { display: block; height: 100%; width: 100%; background: var(--ok); transition: width .2s ease; }
.hbar.low i { background: var(--hot); animation: pulse .5s infinite alternate; }
.hbar.food { display: none; }
.hbar.food.on { display: block; }
.hbar.food i { background: #ff9a3c; }
@keyframes pulse { to { opacity: .45; } }
#nav { position: absolute; left: 18px; bottom: calc(46px + min(170px, 24vh) + 10px); display: none; align-items: center; gap: 10px; padding: 7px 14px 7px 9px; border-radius: 12px; background: rgba(13,17,23,.82); border: 1px solid rgba(255,255,255,.12); max-width: min(250px, 30vw); }
#nav.on { display: flex; }
.nav-arrow { width: 34px; height: 34px; border-radius: 9px; background: var(--wolt); color: #04222b; font: 900 24px/34px var(--ui); text-align: center; flex: none; }
.nav-dist { font-weight: 900; font-size: 1.25em; white-space: nowrap; }
.nav-street { font-weight: 600; color: rgba(255,255,255,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tr { position: absolute; right: 22px; top: 18px; text-align: right; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
#stars { font-size: 1.9em; letter-spacing: .08em; height: 1.2em; opacity: 0; transition: opacity .3s; }
#stars.active { opacity: 1; }
#stars i { font-style: normal; color: rgba(255,255,255,.22); }
#stars i.on { color: #fff; text-shadow: 0 0 12px rgba(255,255,255,.8); }
#stars.cooling i.on { animation: pulse .35s infinite alternate; }
#money { font: 900 2.5em/1.1 var(--ui); color: #7dffb0; letter-spacing: .01em; }
#money.up { animation: moneyUp .7s ease; }
#money.down { animation: moneyDown .7s ease; }
@keyframes moneyUp { 0% { transform: scale(1.25); color: #fff; } }
@keyframes moneyDown { 0% { transform: scale(1.15); color: var(--hot); } }
#clock { font-weight: 700; font-size: 1.15em; color: rgba(255,255,255,.85); }
#objective { position: absolute; left: 50%; top: 16px; transform: translate(-50%, -20px); min-width: 300px; max-width: min(560px, 70vw); padding: 10px 18px; border-radius: 14px; background: rgba(13,17,23,.84); border: 1px solid rgba(255,255,255,.12); opacity: 0; transition: opacity .3s, transform .3s; text-align: center; }
#objective.on { opacity: 1; transform: translate(-50%, 0); }
.obj-step { font-weight: 900; font-size: .8em; letter-spacing: .22em; color: var(--wolt); }
#objective[data-kind="drop"] .obj-step { color: var(--gold); }
.obj-title { font-weight: 800; font-size: 1.3em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obj-row { display: flex; justify-content: center; gap: 18px; font-weight: 700; color: rgba(255,255,255,.8); }
.obj-timer { font-variant-numeric: tabular-nums; }
.obj-timer.urgent { color: var(--hot); animation: pulse .4s infinite alternate; }
#subs { position: absolute; left: 50%; bottom: 17%; transform: translateX(-50%); width: min(820px, 86vw); text-align: center; opacity: 0; transition: opacity .25s; text-shadow: 0 2px 4px #000, 0 0 12px rgba(0,0,0,.8); }
#subs.on { opacity: 1; }
.sub-who { font-weight: 800; font-size: .85em; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.sub-he { font: 700 2.1em/1.25 var(--ui); }
.sub-en { font-weight: 600; font-size: 1.25em; color: rgba(255,255,255,.88); font-style: italic; }
#prompt { position: absolute; left: 50%; bottom: 8.5%; transform: translateX(-50%); padding: 9px 18px; border-radius: 12px; background: rgba(13,17,23,.86); border: 1px solid rgba(255,255,255,.14); font-weight: 700; font-size: 1.15em; opacity: 0; transition: opacity .2s; white-space: nowrap; }
#prompt.on { opacity: 1; }
#toasts { position: absolute; left: 18px; top: 18px; display: flex; flex-direction: column; gap: 8px; width: min(360px, 44vw); }
.toast { padding: 10px 14px; border-radius: 12px; background: rgba(13,17,23,.88); border-left: 4px solid var(--wolt); font-weight: 600; line-height: 1.4; transform: translateX(-20px); opacity: 0; transition: all .3s ease; }
.toast.in { transform: none; opacity: 1; }
.toast.ok { border-color: var(--ok); }
.toast.warn { border-color: var(--gold); }
.toast.bad { border-color: var(--hot); }
.toast.msg { border-color: #c084fc; }
.toast.msg b { display: block; color: #d8b4fe; font-size: .85em; letter-spacing: .1em; text-transform: uppercase; }
.toast.msg span { display: block; font-size: 1.12em; text-align: right; }
.toast.msg i { display: block; color: rgba(255,255,255,.7); font-size: .92em; }
#banner { position: absolute; left: 50%; top: 24%; transform: translate(-50%, 10px) scale(.96); width: min(520px, 86vw); padding: 22px 26px; border-radius: 20px; background: rgba(13,17,23,.92); border: 1px solid rgba(255,255,255,.14); box-shadow: 0 24px 80px rgba(0,0,0,.6); opacity: 0; transition: all .35s cubic-bezier(.2,1.3,.4,1); text-align: center; pointer-events: none; }
#banner.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.bn-kicker { font-weight: 700; font-size: .95em; color: rgba(255,255,255,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bn-title { font: 700 4.2em/.95 var(--display); letter-spacing: .02em; color: var(--ok); }
#banner.bad .bn-title { color: var(--hot); }
.bn-he { font: 700 2em/1.1 var(--display); color: rgba(255,255,255,.85); margin-bottom: 10px; }
.bn-line { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; border-top: 1px solid rgba(255,255,255,.08); font-weight: 600; text-align: left; }
.bn-line b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bn-line.good b { color: var(--ok); }
.bn-line.bad b { color: var(--hot); }
.bn-line.dim b { color: rgba(255,255,255,.5); }
.bn-line.total { font-size: 1.5em; font-weight: 900; border-top: 2px solid rgba(255,255,255,.3); margin-top: 4px; padding-top: 8px; }
.bn-line.total b { color: #7dffb0; }
#speedo { position: absolute; right: 22px; bottom: 18px; text-align: right; opacity: 0; transition: opacity .3s; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
#speedo.on { opacity: 1; }
#speedo b { font: 900 3.4em/1 var(--ui); font-variant-numeric: tabular-nums; }
#speedo span { display: block; font-weight: 700; letter-spacing: .14em; color: rgba(255,255,255,.7); font-size: .85em; }
#street { position: absolute; right: 22px; bottom: 92px; text-align: right; opacity: 0; text-shadow: 0 2px 8px rgba(0,0,0,.7); }
#street.on { animation: streetIn 4.5s ease forwards; }
#street b { display: block; font: 700 2.3em/1 var(--display); letter-spacing: .03em; }
#street span { font-weight: 700; color: var(--gold); letter-spacing: .12em; text-transform: uppercase; font-size: .85em; }
@keyframes streetIn { 0% { opacity: 0; transform: translateX(12px); } 10%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }
#fade { position: absolute; inset: 0; z-index: 1; background: #05070a; opacity: 0; transition: opacity .35s ease; pointer-events: none; }
#banner, #subs, #toasts, #tr { z-index: 2; }
#fade.slow { transition-duration: 1.2s; }
#fade.on { opacity: .86; }

/* ---------- phone ---------- */
#phone { --ps: 1.32; position: absolute; right: 22px; bottom: 150px; width: 270px; transform: scale(var(--ps)); transform-origin: bottom right; transition: transform .28s cubic-bezier(.2,1.2,.4,1), opacity .5s; pointer-events: auto; opacity: 0; }
body.playing #phone { opacity: 1; }
#phone.mini { transform: scale(calc(var(--ps) * .62)); }
#phone.open { transform: scale(calc(var(--ps) * 1.12)); z-index: 5; }
#phone.ring { animation: ring .7s ease 2; }
@keyframes ring { 0%, 100% { translate: 0 0; rotate: 0deg; } 20% { translate: -3px -6px; rotate: -2deg; } 40% { translate: 3px -8px; rotate: 2deg; } 60% { translate: -2px -4px; rotate: -1.4deg; } 80% { translate: 2px -2px; rotate: 1deg; } }
.ph-frame { height: 500px; border-radius: 34px; background: #0b0d10; border: 3px solid #2a2e35; box-shadow: 0 24px 60px rgba(0,0,0,.6), inset 0 0 0 2px #000; padding: 10px; display: flex; flex-direction: column; overflow: hidden; }
.ph-status { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 700; padding: 2px 12px 6px; color: #fff; }
.ph-island { width: 70px; height: 18px; border-radius: 10px; background: #000; }
.ph-icons i { display: inline-block; width: 3px; background: #fff; margin-left: 1.5px; border-radius: 1px; }
.ph-icons i:nth-child(1) { height: 5px; }
.ph-icons i:nth-child(2) { height: 8px; }
.ph-icons i:nth-child(3) { height: 11px; }
.ph-icons b { display: inline-block; width: 18px; height: 9px; border-radius: 3px; background: var(--ok); margin-left: 5px; vertical-align: -1px; }
.ph-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 16px 16px 0 0; background: var(--wolt-deep); }
.ph-logo { font: 900 22px/1 var(--ui); color: #fff; letter-spacing: -.02em; }
.ph-logo small { display: block; font: 700 9px/1.2 var(--ui); letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.ph-state { font: 800 10px/1 var(--ui); letter-spacing: .1em; text-transform: uppercase; padding: 5px 9px; border-radius: 20px; background: rgba(0,0,0,.3); color: rgba(255,255,255,.8); }
.ph-state.on { background: #fff; color: #06784f; }
.ph-body { flex: 1; overflow-y: auto; background: #f4f6f8; color: #10151c; padding: 10px; display: flex; flex-direction: column; gap: 9px; scrollbar-width: thin; }
.ph-tabs { display: flex; background: #fff; border-radius: 0 0 18px 18px; border-top: 1px solid #e3e7ec; }
.ph-tabs button { flex: 1; border: 0; background: none; padding: 9px 0 10px; font: 700 11px/1 var(--ui); color: #7b8794; border-top: 2px solid transparent; }
.ph-tabs button.on { color: var(--wolt-deep); border-top-color: var(--wolt-deep); }
.ph-card { background: #fff; border-radius: 14px; padding: 12px; box-shadow: 0 1px 3px rgba(16,21,28,.08); display: flex; flex-direction: column; gap: 8px; }
.ph-card.offer { border: 2px solid var(--wolt); }
.ph-kicker { font: 800 10px/1.2 var(--ui); letter-spacing: .14em; color: var(--wolt-deep); }
.ph-rest { display: flex; align-items: center; gap: 10px; }
.ph-rest b { display: block; font-size: 17px; line-height: 1.15; }
.ph-rest small { display: block; color: #6b7785; font-size: 12px; font-weight: 600; }
.ph-emoji { width: 42px; height: 42px; border-radius: 12px; background: #eef7fb; font-size: 24px; line-height: 42px; text-align: center; flex: none; }
.ph-pay b { font: 900 30px/1 var(--ui); color: #06784f; }
.ph-pay small { display: block; color: #6b7785; font-weight: 600; font-size: 12px; }
.ph-rows { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.ph-rows div { display: flex; justify-content: space-between; gap: 10px; }
.ph-rows span { color: #6b7785; font-weight: 600; flex: none; }
.ph-rows b { text-align: end; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-count { height: 5px; border-radius: 3px; background: #e3e7ec; overflow: hidden; }
.ph-countbar { display: block; height: 100%; width: 100%; background: var(--wolt-deep); }
.ph-actions { display: flex; gap: 8px; }
.ph-btn { flex: 1; border: 0; border-radius: 12px; padding: 11px 8px; font: 800 13.5px/1 var(--ui); }
.ph-btn kbd { margin: 0 0 0 5px; font-size: 10px; box-shadow: none; background: rgba(255,255,255,.9); }
.ph-btn.go { background: var(--wolt-deep); color: #fff; }
.ph-btn.no { background: #e9edf1; color: #3a4654; }
.ph-btn.off { background: #eef1f4; color: #a3adb8; }
.ph-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 10px; }
.ph-center p { margin: 0; color: #6b7785; font-size: 12.5px; font-weight: 600; }
.ph-center .ph-btn { flex: none; width: 100%; margin-top: 8px; }
.ph-big { font: 800 19px/1.2 var(--ui); }
.ph-radar { position: relative; width: 84px; height: 84px; }
.ph-radar i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--wolt-deep); opacity: 0; animation: radar 2.1s infinite; }
.ph-radar i:nth-child(2) { animation-delay: .7s; }
.ph-radar i:nth-child(3) { animation-delay: 1.4s; }
@keyframes radar { 0% { transform: scale(.2); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
.ph-items { margin: 0; padding-inline-start: 18px; font-size: 13px; font-weight: 600; }
.ph-chip { align-self: flex-start; padding: 5px 10px; border-radius: 20px; background: #fff3d6; color: #8a5a00; font: 700 11.5px/1.2 var(--ui); }
.ph-chip.ready { background: #dcfce7; color: #06784f; }
.ph-timer { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid #e9edf1; padding-top: 8px; }
.ph-timer span { color: #6b7785; font-weight: 700; font-size: 12px; }
.ph-timer b { font: 900 24px/1 var(--ui); font-variant-numeric: tabular-nums; }
.ph-timer b.late { color: #e11d48; }
.ph-note { font-size: 12.5px; font-style: italic; color: #3a4654; background: #f4f6f8; border-radius: 10px; padding: 8px 10px; }
.ph-meter { display: flex; align-items: center; gap: 8px; font: 700 11.5px/1 var(--ui); color: #6b7785; }
.ph-meter span { width: 40px; }
.ph-meter i { flex: 1; height: 7px; border-radius: 4px; background: #e3e7ec; overflow: hidden; }
.ph-meter b { display: block; height: 100%; background: #ff9a3c; }
.ph-meter b.m-intact { background: #22c55e; }
.ph-meter b.low { background: #e11d48; }
.ph-money { font: 900 34px/1 var(--ui); color: #06784f; }
.ph-prog { height: 9px; border-radius: 5px; background: #e3e7ec; overflow: hidden; }
.ph-prog i { display: block; height: 100%; background: var(--wolt-deep); border-radius: 5px; }
.ph-prog.rent i { background: #c084fc; }
.ph-card small { color: #6b7785; font-size: 11.5px; font-weight: 600; line-height: 1.4; }
.ph-uprow { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ph-uprow b { font-size: 14px; }
.ph-uprow small { display: block; }
.ph-pips { display: flex; gap: 3px; padding-top: 4px; }
.ph-pips i { width: 12px; height: 6px; border-radius: 3px; background: #dfe4ea; }
.ph-pips i.on { background: var(--wolt-deep); }
.ph-card.help dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; font-size: 12px; }
.ph-card.help dt { font-weight: 800; white-space: nowrap; }
.ph-card.help dd { margin: 0; color: #4a5562; font-weight: 600; }
.ph-hint { text-align: center; margin-top: 8px; font-weight: 700; font-size: 15px; color: rgba(255,255,255,.85); text-shadow: 0 2px 6px rgba(0,0,0,.7); }
#phone.open .ph-hint { display: none; }

/* ---------- full map, pause ---------- */
#bigmap { position: absolute; inset: 0; background: rgba(8,10,13,.9); opacity: 0; pointer-events: none; transition: opacity .25s; }
#bigmap.on { opacity: 1; }
#bigmap canvas { position: absolute; inset: 56px 24px 24px; width: calc(100% - 48px); height: calc(100% - 80px); }
.bm-title { position: absolute; left: 28px; top: 14px; font: 700 2.4em/1 var(--display); letter-spacing: .06em; }
.bm-title span { font: 700 13px/1 var(--ui); letter-spacing: .1em; color: rgba(255,255,255,.6); margin-left: 12px; text-transform: uppercase; }
#menu { position: fixed; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center; background: rgba(8,10,13,.78); backdrop-filter: blur(6px); pointer-events: auto; }
#menu.on { display: flex; }
.menu-box { width: min(560px, 92vw); max-height: 92vh; overflow-y: auto; padding: 28px; border-radius: 22px; background: #12161c; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.menu-box h2 { margin: 0 0 4px; font: 700 54px/.9 var(--display); letter-spacing: .02em; }
.menu-box h2 span { color: var(--wolt); }
.menu-box p { margin: 0 0 16px; color: rgba(255,255,255,.65); font-weight: 600; }
.menu-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin-bottom: 18px; }
.menu-grid span { color: rgba(255,255,255,.75); font-weight: 600; }
.menu-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; align-items: center; }
.menu-row label { font-weight: 700; color: rgba(255,255,255,.75); min-width: 84px; }
.menu-btn { border: 0; border-radius: 12px; padding: 12px 18px; font: 800 15px/1 var(--ui); background: #232a33; color: #fff; }
.menu-btn.on, .menu-btn.primary { background: var(--wolt); color: #04222b; }
.menu-btn:hover { filter: brightness(1.15); }
.menu-legal { margin-top: 14px; font-size: 11.5px; line-height: 1.5; color: rgba(255,255,255,.45); }
#touch-note { display: none; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(255,207,58,.14); border: 1px solid rgba(255,207,58,.4); color: #ffe08a; font-size: 13.5px; font-weight: 600; line-height: 1.4; }
@media (hover: none) and (pointer: coarse) { #touch-note { display: block; } }
@media (max-width: 760px) {
  #phone { --ps: .95; bottom: 128px; right: 10px; }
  #tr { right: 12px; top: 12px; }
  #objective { min-width: 0; top: 64px; }
  #toasts { top: 132px; }
}

/* ---------- touch controls (phones and tablets) ---------- */
#touch { position: absolute; inset: 0; pointer-events: none; z-index: 3; display: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
body.touch.playing #touch { display: block; }
.t-zone { position: absolute; left: 0; bottom: 0; width: calc(250px + env(safe-area-inset-left, 0px)); height: calc(250px + env(safe-area-inset-bottom, 0px)); pointer-events: none; }
.t-look { position: absolute; left: 0; right: 0; top: 64px; bottom: 0; pointer-events: auto; touch-action: none; }
.t-base { position: absolute; left: calc(125px + env(safe-area-inset-left, 0px)); top: 125px; width: 156px; height: 156px; margin: -78px 0 0 -78px; border-radius: 50%; background: rgba(13,17,23,.34); border: 3px solid rgba(255,255,255,.4); pointer-events: none; transition: opacity .15s; }
.t-base:not(.on) { opacity: .8; }
.t-base.on { opacity: 1; transition: none; }
.t-knob { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgba(0,194,232,.92); border: 2px solid rgba(255,255,255,.75); box-shadow: 0 2px 10px rgba(0,0,0,.5); }
.t-main { position: absolute; right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: 172px; height: 172px; pointer-events: none; }
.t-btn, .t-mini, .t-pill { pointer-events: auto; touch-action: none; border: 2px solid rgba(255,255,255,.32); background: rgba(13,17,23,.6); color: #fff; padding: 0; font-family: var(--ui); }
.t-btn { position: absolute; width: 58px; height: 58px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 20px; line-height: 1; }
.t-btn small { font: 800 8px/1 var(--ui); letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.t-btn.big { width: 80px; height: 80px; right: 0; bottom: 0; font-size: 28px; border-color: rgba(0,194,232,.8); }
.t-main [data-a=mount] { right: 92px; bottom: 6px; }
.t-main .ride-only, .t-main .foot-only { right: 10px; bottom: 92px; }
.t-btn.small { width: 44px; height: 44px; right: 82px; bottom: 82px; font-size: 18px; }
#touch:not(.riding) .ride-only, #touch.riding .foot-only { display: none; }
.t-btn.on, .t-mini.on, .t-pill.on { background: rgba(0,194,232,.85); color: #04222b; }
.t-ctx { position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; gap: 10px; pointer-events: none; }
.t-pill { display: none; height: 46px; padding: 0 20px; border-radius: 23px; font: 900 15px/1 var(--ui); letter-spacing: .02em; white-space: nowrap; }
.t-pill.go { background: rgba(0,194,232,.92); color: #04222b; border-color: transparent; } .t-pill.no { background: rgba(13,17,23,.75); }
#touch.st-off .off-only, #touch.st-offer .offer-only { display: inline-flex; align-items: center; }
.t-top { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); display: flex; gap: 8px; pointer-events: none; }
.t-mini { width: 40px; height: 40px; border-radius: 12px; font: 900 15px/1 var(--ui); }
.t-rotate { display: none; position: absolute; inset: 0; background: rgba(10,13,18,.92); color: #fff; font: 800 20px/1.4 var(--ui); align-items: center; justify-content: center; text-align: center; padding: 24px; pointer-events: auto; }
@media (orientation: portrait) { .t-rotate { display: flex; } }
/* the rest of the HUD on a touch screen: small, at the edges, never under the thumbs */
body.touch kbd { display: none; }
body.touch #mm { left: auto; right: calc(12px + env(safe-area-inset-right, 0px)); bottom: auto; top: calc(54px + env(safe-area-inset-top, 0px)); width: min(140px, 22vw); height: min(96px, 24vh); }
body.touch #nav { display: none !important; }
body.touch #bars { left: auto; right: calc(12px + env(safe-area-inset-right, 0px)); bottom: auto; top: calc(58px + min(96px, 24vh) + env(safe-area-inset-top, 0px)); width: min(140px, 22vw); }
body.touch #tr { font-size: .8em; top: calc(8px + env(safe-area-inset-top, 0px)); }
body.touch #speedo { right: auto; left: calc(50% + 110px); bottom: auto; top: calc(6px + env(safe-area-inset-top, 0px)); font-size: .5em; text-align: left; }
body.touch #phone:not(.open) { display: none; }
body.touch #phone.open { --ps: 1; top: 50%; bottom: auto; right: 50%; transform: translate(50%, -50%) scale(min(1.15, calc(100vh / 620px))); transform-origin: center; z-index: 6; }
/* Phones: what people say and the action hint sit at the bottom edge, below the rider, between the stick and the buttons
   (never over the rider). While someone speaks, the line takes the hint's place (the hint returns after). While the big
   order buttons show, the line sits above the rider, under the top messages. */
body.touch #subs { left: calc(212px + env(safe-area-inset-left, 0px)); right: calc(176px + env(safe-area-inset-right, 0px)); bottom: calc(4px + env(safe-area-inset-bottom, 0px)); width: auto; transform: none; font-size: 1em; }
body.touch .sub-who { display: none; }
body.touch .sub-he { font: 700 15px/1.2 var(--ui); }
body.touch .sub-en { font-size: 10.5px; line-height: 1.2; }
body.touch #prompt { bottom: calc(6px + env(safe-area-inset-bottom, 0px)); padding: 5px 12px; font-size: 11px; max-width: calc(100vw - 344px); overflow: hidden; text-overflow: ellipsis; }
body.touch #subs.on + #prompt { opacity: 0; }
body.touch.t-pills #prompt { display: none; }
body.touch.t-pills #subs { bottom: auto; top: calc(92px + env(safe-area-inset-top, 0px)); left: 50%; right: auto; transform: translateX(-50%); width: min(46vw, 400px); }
@media (max-width: 759px) { body.touch:not(.t-pills) #subs { left: calc(12px + env(safe-area-inset-left, 0px)); } }
body.touch #toasts { width: min(300px, calc(50vw - 112px)); font-size: .8em; top: calc(8px + env(safe-area-inset-top, 0px)); }
/* the destination: on the left, above the stick (never in the middle of the view), two compact lines */
body.touch #objective { left: calc(12px + env(safe-area-inset-left, 0px)); top: auto; bottom: calc(212px + env(safe-area-inset-bottom, 0px)); transform: translateY(8px); width: 230px; min-width: 0; max-width: 230px; padding: 6px 10px 7px; border-radius: 12px; text-align: start;
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "step row" "title title"; column-gap: 10px; align-items: baseline; }
body.touch #objective.on { transform: none; }
body.touch .obj-step { grid-area: step; font-size: 9px; letter-spacing: .12em; white-space: nowrap; }
body.touch .obj-row { grid-area: row; justify-content: flex-end; gap: 10px; font-size: 11.5px; white-space: nowrap; }
body.touch .obj-title { grid-area: title; font-size: 13.5px; line-height: 1.25; }
/* messages stay above the destination box: one at a time on short screens, two on taller ones */
@media (max-height: 340px) { body.touch #toasts .toast:not(:last-child) { display: none; } }
@media (min-height: 341px) { body.touch #toasts .toast:nth-last-child(n+3) { display: none; } }
body.touch #street { display: none; }

body.touch.playing, body.touch.playing #c { touch-action: none; }

/* the phone is in Hebrew: wide letter-spacing is for capitals, not for Hebrew letters */
#phone .ph-kicker, #phone .ph-state, #phone .ph-logo small { letter-spacing: .02em; }

/* Sound on / off: a round speaker button under the money (computer) and in the top button row (phone) */
.snd svg { width: 22px; height: 22px; display: block; margin: auto; }
.snd .ic-off, .snd.off .ic-on { display: none; }
.snd.off .ic-off { display: block; }
#mute { display: block; margin: 6px 0 0 auto; width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); background: rgba(13,17,23,.55); color: #fff; pointer-events: auto; cursor: pointer; transition: background .15s, border-color .15s; }
#mute:hover { background: rgba(13,17,23,.8); border-color: rgba(255,255,255,.55); }
#mute.off { color: #ff9a7a; border-color: rgba(255,138,100,.6); }
#mute:focus-visible { outline: 3px solid var(--wolt); outline-offset: 2px; }
body.touch #mute { display: none; }
.t-mini.snd svg { width: 20px; height: 20px; }
.t-mini.snd.off { color: #ff9a7a; border-color: rgba(255,138,100,.6); }
/* ---------- the end card (after the last story delivery) ---------- */
#ending { position: fixed; inset: 0; z-index: 41; display: none; align-items: center; justify-content: center; padding: 12px; background: radial-gradient(120% 90% at 50% 0%, rgba(0,194,232,.18), rgba(6,8,12,.9) 60%); backdrop-filter: blur(6px); pointer-events: auto; }
#ending.on { display: flex; animation: end-in .7s ease both; }
@keyframes end-in { from { opacity: 0; } to { opacity: 1; } }
.end-box { width: min(640px, 94vw); max-height: calc(100vh - 24px); overflow-y: auto; padding: 26px 28px 24px; border-radius: 22px; background: #12161c; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 30px 90px rgba(0,0,0,.6); text-align: center; }
.end-kicker { font: 900 12px/1 var(--ui); letter-spacing: .28em; color: var(--gold); }
.end-box h2 { margin: 12px 0 0; font: 700 104px/.82 var(--display); color: #fff; text-shadow: 0 5px 0 rgba(0,0,0,.35); }
.end-sub { margin-top: 6px; font: 700 30px/1 var(--display); letter-spacing: .04em; color: var(--wolt); }
.end-he { margin: 16px auto 4px; max-width: 34em; font: 600 17px/1.45 var(--ui); color: #fff; }
.end-en { margin: 0 auto 18px; max-width: 40em; font: 500 13.5px/1.4 var(--ui); color: rgba(255,255,255,.6); }
.end-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 14px; }
.end-stats div { padding: 10px 6px 9px; border-radius: 12px; background: #1b212a; }
.end-stats .end-rank { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.end-stats span { display: block; font: 600 11.5px/1.2 var(--ui); color: rgba(255,255,255,.6); }
.end-stats b { display: block; margin-top: 4px; font: 800 19px/1.1 var(--ui); color: #fff; }
.end-stats .end-rank b { margin: 0; color: var(--gold); }
.end-next { margin: 0 0 2px; font: 600 14px/1.4 var(--ui); color: rgba(255,255,255,.85); }
.end-next-en { margin: 0 0 16px; font: 500 12px/1.4 var(--ui); color: rgba(255,255,255,.5); }
#end-go { font-size: 17px; padding: 14px 28px; }
/* short screens (phones held sideways): the story on one side, the numbers and the button on the other */
@media (max-height: 520px) and (min-width: 600px) {
  .end-box { width: min(860px, 96vw); display: grid; grid-template-columns: 1.1fr 1fr; gap: 0 22px; align-items: center; padding: 16px 20px; }
  .end-box h2 { font-size: 64px; margin-top: 8px; }
  .end-sub { font-size: 20px; }
  .end-he { font-size: 14px; margin-top: 10px; }
  .end-en { font-size: 11.5px; margin-bottom: 0; }
  .end-stats { grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 10px; }
  .end-stats div { padding: 7px 6px 6px; }
  .end-stats b { font-size: 16px; }
  .end-next { font-size: 12.5px; }
  .end-next-en { font-size: 11px; margin-bottom: 10px; }
  #end-go { font-size: 15px; padding: 11px 20px; }
}
/* the shortest phones (about 300 px tall): tighter still, so nothing has to scroll */
@media (max-height: 340px) and (min-width: 600px) {
  .end-box { padding: 12px 18px; }
  .end-box h2 { font-size: 54px; margin-top: 6px; }
  .end-sub { font-size: 17px; }
  .end-he { font-size: 13px; line-height: 1.38; margin-top: 8px; }
  .end-en { font-size: 10.5px; }
  .end-stats { gap: 5px; margin-bottom: 7px; }
  .end-stats div { padding: 5px 6px 4px; }
  .end-stats span { font-size: 10.5px; }
  .end-stats b { font-size: 14.5px; margin-top: 2px; }
  .end-next { font-size: 11.5px; }
  .end-next-en { font-size: 10px; margin-bottom: 7px; }
  #end-go { font-size: 14px; padding: 9px 18px; }
}
@media (max-width: 599px) { .end-box h2 { font-size: 72px; } .end-stats { grid-template-columns: repeat(2, 1fr); } }
