/* SLS - Street Life Simulator. Phone first (iPhone 15 Pro Max, 430 x 740 in Safari). */
:root{ --acc:#ff5a5f; --acc2:#ffb347; --gold:#e8c87a; --ink:#f4f1ea; --mute:#a8a5a0; --glass:rgba(10,12,16,0.62); --line:rgba(255,255,255,0.12);
  --st:env(safe-area-inset-top, 0px); --sb:env(safe-area-inset-bottom, 0px); --sl:env(safe-area-inset-left, 0px); --sr:env(safe-area-inset-right, 0px); }
*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body{ margin:0; height:100%; background:#08090c; color:var(--ink); font-family:Inter, system-ui, -apple-system, Arial, sans-serif; overflow:hidden; overscroll-behavior:none; -webkit-user-select:none; user-select:none; touch-action:none; }
.hidden{ display:none !important; }
#game, #game canvas{ position:fixed; inset:0; width:100%; height:100%; display:block; }
#buildTag{ position:fixed; right:calc(6px + var(--sr)); bottom:calc(3px + var(--sb)); font:600 10px Inter, Arial; color:rgba(255,255,255,0.35); z-index:60; pointer-events:none; }
button{ font-family:inherit; }
.btn{ display:block; width:100%; min-height:48px; padding:12px 18px; margin:8px 0 0; border-radius:14px; border:1px solid var(--line); background:rgba(255,255,255,0.08); color:var(--ink); font:700 16px Inter, Arial; cursor:pointer; }
.btn:active{ transform:scale(0.98); }
.btn.gold{ background:linear-gradient(135deg, var(--acc), var(--acc2)); color:#1a0d0a; border:0; }
.btn.red{ background:#c8202a; border:0; color:#fff; }
.btn.ghost{ background:transparent; }
.btn.big{ min-height:56px; font-size:18px; }
.btn.sm{ min-height:38px; padding:6px 12px; font-size:13px; width:auto; display:inline-block; margin:0; }
.link{ display:block; margin:12px auto 0; background:none; border:0; color:var(--gold); font:600 15px Inter, Arial; text-decoration:none; text-align:center; cursor:pointer; min-height:44px; line-height:44px; }
.small{ font-size:13px; color:var(--mute); line-height:1.45; }
.muted{ color:var(--mute); }
input{ width:100%; min-height:48px; margin:6px 0; padding:12px 14px; border-radius:12px; border:1px solid var(--line); background:rgba(255,255,255,0.06); color:var(--ink); font:500 16px Inter, Arial; }
.err{ color:#ff8a8a; font-size:13px; min-height:18px; }

/* ---------- screens ---------- */
.screen{ position:fixed; inset:0; z-index:40; display:flex; align-items:center; justify-content:center; padding:calc(16px + var(--st)) calc(16px + var(--sr)) calc(16px + var(--sb)) calc(16px + var(--sl)); }
.screen.dim{ background:rgba(4,5,8,0.62); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); z-index:50; }
.card{ width:100%; max-width:400px; background:rgba(14,16,22,0.92); border:1px solid var(--line); border-radius:22px; padding:22px; text-align:center; box-shadow:0 20px 60px rgba(0,0,0,0.5); }
.card h2{ margin:0 0 6px; font:800 24px Inter, Arial; }
.card .kick{ display:block; font:900 30px Inter, Arial; letter-spacing:0.04em; color:var(--acc); margin-bottom:8px; }
.card p{ line-height:1.5; }
#title{ top:var(--mdts-h, 0px); align-items:flex-end; background:linear-gradient(180deg, rgba(8,9,12,0) 30%, rgba(8,9,12,0.85) 75%); }
.tCard{ width:100%; max-width:420px; text-align:center; padding-bottom:8px; }
.tKick{ font:700 12px Inter, Arial; letter-spacing:0.28em; text-transform:uppercase; color:var(--gold); opacity:0.9; }
.logo{ margin:2px 0 0; font:900 italic 92px/0.95 Inter, Arial; letter-spacing:-0.04em; background:linear-gradient(120deg, var(--acc) 10%, var(--acc2) 60%, #ffe28a); -webkit-background-clip:text; background-clip:text; color:transparent; filter:drop-shadow(0 6px 24px rgba(255,90,95,0.35)); }
.tTag{ font:800 14px Inter, Arial; letter-spacing:0.34em; color:#fff; margin-top:4px; }
.tLine{ font-size:15px; line-height:1.5; color:#ddd8ce; margin:14px 0 8px; }
.tWho{ font-size:14px; color:var(--mute); margin:6px 0 0; }
.tWho b{ color:var(--ink); }
.tMoney{ font-size:13px; color:var(--gold); margin:4px 0 4px; min-height:16px; }
#loading{ position:fixed; inset:0; z-index:90; background:radial-gradient(circle at 50% 40%, #1a1216, #08090c 70%); display:flex; align-items:center; justify-content:center; transition:opacity .6s; }
#loading.gone{ opacity:0; pointer-events:none; }
.ld{ text-align:center; width:min(320px, 80vw); }
.ldBar{ height:6px; border-radius:3px; background:rgba(255,255,255,0.1); overflow:hidden; margin:18px 0 12px; }
.ldBar i{ display:block; height:100%; width:0; background:linear-gradient(90deg, var(--acc), var(--acc2)); transition:width .3s; }
#ldTxt{ font-size:14px; color:var(--mute); }
.ldAbout{ position:fixed; left:0; right:0; bottom:calc(20px + var(--sb)); text-align:center; color:var(--gold); font:600 14px Inter, Arial; text-decoration:none; }
#fade{ position:fixed; inset:0; background:#000; opacity:0; pointer-events:none; z-index:45; transition:opacity .3s; }
#fade.on{ opacity:1; }
#hurt{ position:fixed; inset:0; pointer-events:none; z-index:3; box-shadow:inset 0 0 120px 20px rgba(200,20,20,0); }
#hurt.go{ animation:hurt .5s ease-out; }
@keyframes hurt{ 0%{ box-shadow:inset 0 0 140px 40px rgba(200,20,20,0.65); } 100%{ box-shadow:inset 0 0 120px 20px rgba(200,20,20,0); } }

/* ---------- the HUD ---------- */
#hud{ position:fixed; inset:0; z-index:10; pointer-events:none; }
#hud button, #hud canvas{ pointer-events:auto; }
.hTL{ position:absolute; left:calc(10px + var(--sl)); top:calc(10px + var(--st)); width:min(52vw, 230px); }
.money{ background:var(--glass); border:1px solid var(--line); border-radius:14px; padding:7px 11px; backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); }
.money b{ display:block; font:900 22px Inter, Arial; color:#9ff0a8; letter-spacing:-0.01em; text-shadow:0 1px 0 #000; }
.money span{ display:block; font:600 11px Inter, Arial; color:var(--mute); }
.bars{ margin-top:6px; }
.bars > div{ height:6px; border-radius:3px; background:rgba(0,0,0,0.5); overflow:hidden; margin-top:3px; border:1px solid rgba(255,255,255,0.08); }
.bars i{ display:block; height:100%; transition:width .2s; }
.hp i{ background:linear-gradient(90deg, #3bd16f, #9ff0a8); }
.ar i{ background:linear-gradient(90deg, #4a8aff, #9fc8ff); }
.heat{ margin-top:7px; background:var(--glass); border:1px solid var(--line); border-radius:12px; padding:6px 9px; backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); }
.heat.lv0{ display:none; }
.hRow{ display:flex; align-items:center; gap:7px; }
.segs{ display:flex; gap:3px; }
.segs i{ width:13px; height:13px; border-radius:3px; background:rgba(255,255,255,0.12); transform:skewX(-14deg); }
.segs i.on{ background:linear-gradient(180deg, #ff7a3a, #ff2a3a); box-shadow:0 0 8px rgba(255,60,60,0.7); }
.heat b{ font:800 13px Inter, Arial; color:#ff8a6a; white-space:nowrap; }
.heat em{ margin-left:auto; font:800 10px Inter, Arial; font-style:normal; letter-spacing:0.08em; padding:2px 6px; border-radius:6px; background:rgba(255,200,64,0.18); color:#ffd060; }
.heat.seen em{ background:#ff2a3a; color:#fff; animation:blink .6s steps(2) infinite; }
@keyframes blink{ 50%{ opacity:0.55; } }
.heat small{ display:block; margin-top:4px; font:600 11px/1.3 Inter, Arial; color:#e8e2d6; }
.hTR{ position:absolute; right:calc(10px + var(--sr)); top:calc(10px + var(--st)); display:flex; gap:8px; align-items:flex-start; }
.hBtns{ display:flex; flex-direction:column; gap:8px; }
.rb{ width:44px; height:44px; border-radius:50%; border:1px solid var(--line); background:var(--glass); color:var(--ink); display:flex; align-items:center; justify-content:center; padding:0; backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); }
.rb svg{ width:22px; height:22px; }
.mapCol{ width:118px; }
#mini{ width:118px; height:118px; border-radius:50%; display:block; box-shadow:0 6px 20px rgba(0,0,0,0.45); }
.mInfo{ margin-top:5px; text-align:center; }
.mInfo span{ display:block; font:600 10.5px/1.3 Inter, Arial; color:#e8e2d6; text-shadow:0 1px 2px #000; }
.online{ color:var(--mute) !important; }
.online.live{ color:#9ff0a8 !important; }
.online.live::before{ content:''; display:inline-block; width:6px; height:6px; border-radius:50%; background:#3bd16f; margin-right:4px; vertical-align:1px; }
#feed{ position:absolute; right:calc(10px + var(--sr)); top:calc(178px + var(--st)); width:200px; text-align:right; }
#feed div{ font:600 12px Inter, Arial; color:#fff; background:rgba(0,0,0,0.5); border-radius:8px; padding:4px 8px; margin-top:4px; display:inline-block; float:right; clear:both; }
#toasts{ position:absolute; left:50%; transform:translateX(-50%); top:calc(196px + var(--st)); width:min(92vw, 380px); display:flex; flex-direction:column; align-items:center; gap:6px; }
.toast{ background:rgba(10,12,16,0.85); border:1px solid var(--line); color:#fff; font:600 14px/1.35 Inter, Arial; padding:9px 14px; border-radius:12px; text-align:center; transition:opacity .5s, transform .5s; }
.toast.red{ border-color:rgba(255,60,60,0.6); }
.toast.gold{ border-color:rgba(232,200,122,0.7); color:var(--gold); }
.toast.out{ opacity:0; transform:translateY(-6px); }
.banner{ position:absolute; left:50%; top:34%; transform:translate(-50%, -50%) scale(0.9); text-align:center; opacity:0; transition:opacity .3s, transform .3s; width:92vw; }
.banner.show{ opacity:1; transform:translate(-50%, -50%) scale(1); }
.banner b{ display:block; font:900 italic 40px/1 Inter, Arial; letter-spacing:-0.01em; color:#fff; text-shadow:0 4px 18px rgba(0,0,0,0.7); }
.banner span{ display:block; margin-top:6px; font:700 15px Inter, Arial; color:#eee; text-shadow:0 2px 6px #000; }
.banner.red b{ color:#ff5a4a; } .banner.gold b{ color:var(--gold); } .banner.green b{ color:#7ff09a; }
.job{ position:absolute; left:50%; transform:translateX(-50%); top:calc(150px + var(--st)); background:rgba(232,200,122,0.92); color:#1a140a; font:800 13px Inter, Arial; padding:7px 12px; border-radius:10px; white-space:nowrap; max-width:94vw; overflow:hidden; text-overflow:ellipsis; }
.arrest{ position:absolute; left:50%; transform:translateX(-50%); top:44%; background:rgba(20,40,120,0.9); border:1px solid #6a8aff; padding:8px 16px; border-radius:12px; text-align:center; }
.arrest b{ display:block; font:900 16px Inter, Arial; } .arrest span{ font:600 12px Inter, Arial; color:#cfd8ff; }
.arrest > i{ display:block; height:5px; width:160px; background:rgba(255,255,255,0.2); border-radius:3px; margin-top:6px; overflow:hidden; }
.arrest > i i{ display:block; height:100%; width:0; background:#fff; }
.wMark{ position:absolute; left:0; top:0; width:36px; height:36px; }
.wMark svg{ position:absolute; inset:0; transform:rotate(-90deg); }
.wMark .bg{ fill:rgba(10,12,16,0.75); stroke:rgba(255,255,255,0.2); stroke-width:3; }
.wMark .fg{ fill:none; stroke:#ffcc40; stroke-width:3.5; stroke-dasharray:100; stroke-linecap:round; }
.wMark i{ position:absolute; left:12px; top:8px; width:12px; height:20px; border:2.5px solid #ffcc40; border-radius:3px; }
.wMark.edge{ opacity:0.85; }
#cross{ position:absolute; left:50%; top:50%; width:22px; height:22px; margin:-11px 0 0 -11px; display:none; }
#cross i{ position:absolute; inset:9px; border-radius:50%; background:#fff; box-shadow:0 0 0 2px rgba(0,0,0,0.4); }
#cross::before, #cross::after{ content:''; position:absolute; background:rgba(255,255,255,0.8); }
#cross::before{ left:10px; top:0; width:2px; height:22px; } #cross::after{ top:10px; left:0; height:2px; width:22px; }
body:not(.inCar):not(.inApt).aiming #cross, body.desk:not(.inCar):not(.inApt) #cross{ display:block; }
#cross.hit i{ background:#ff4a4a; }
.speedo{ position:absolute; left:50%; transform:translateX(-50%); bottom:calc(18px + var(--sb)); text-align:center; text-shadow:0 2px 8px #000; }
.speedo b{ font:900 italic 34px/1 Inter, Arial; } .speedo small{ display:block; font:700 10px Inter, Arial; color:var(--mute); }
.prompt{ position:absolute; right:calc(14px + var(--sr)); bottom:calc(214px + var(--sb)); max-width:220px; background:rgba(10,12,16,0.82); border:1px solid rgba(232,200,122,0.5); color:var(--gold); font:700 13px Inter, Arial; padding:8px 12px; border-radius:10px; text-align:right; }
#lockHint{ position:absolute; left:50%; transform:translateX(-50%); bottom:calc(24px + var(--sb)); background:rgba(0,0,0,0.6); padding:8px 14px; border-radius:10px; font:600 13px Inter, Arial; }

/* touch buttons (bottom right; the stick is bottom left) */
#touch{ position:absolute; inset:0; pointer-events:none; }
.tb{ position:absolute; pointer-events:auto; border-radius:50%; border:1.5px solid rgba(255,255,255,0.22); background:rgba(10,12,16,0.55); color:#fff; font:800 12px Inter, Arial; letter-spacing:0.04em; display:flex; align-items:center; justify-content:center; flex-direction:column; padding:0; backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); touch-action:none; }
.tb.on{ background:rgba(255,90,95,0.55); border-color:var(--acc); }
.tb.big{ width:88px; height:88px; right:calc(18px + var(--sr)); bottom:calc(28px + var(--sb)); font-size:14px; border-color:rgba(255,90,95,0.7); }
.tb.act{ width:66px; height:66px; right:calc(118px + var(--sr)); bottom:calc(34px + var(--sb)); border-color:rgba(232,200,122,0.7); color:var(--gold); }
.tb.act.dim{ opacity:0.45; }
.tb.wpn{ width:66px; height:66px; right:calc(30px + var(--sr)); bottom:calc(128px + var(--sb)); }
.tb.wpn b{ font:800 10px Inter, Arial; } .tb.wpn small{ font:600 10px Inter, Arial; color:var(--mute); margin-top:2px; }
.tb.sm{ width:52px; height:52px; right:calc(112px + var(--sr)); bottom:calc(120px + var(--sb)); font-size:9.5px; }
.tb.car{ display:none; }
body.inCar .tb.car{ display:flex; }
body.inCar #tFire, body.inCar #tAct, body.inCar #tWeapon, body.inCar #tReload{ display:none; }
body.inApt #tFire, body.inApt #tWeapon, body.inApt #tReload{ display:none; }
@media (hover:hover) and (pointer:fine){ #touch{ display:none; } .prompt{ bottom:calc(24px + var(--sb)); right:50%; transform:translateX(50%); text-align:center; } }

/* ---------- the sheet ---------- */
.sheetWrap{ position:fixed; inset:0; z-index:30; display:flex; align-items:flex-end; justify-content:center; background:rgba(0,0,0,0.25); }
.sheet{ width:100%; max-width:520px; max-height:82dvh; display:flex; flex-direction:column; background:rgba(14,16,22,0.96); border:1px solid var(--line); border-bottom:0; border-radius:22px 22px 0 0; box-shadow:0 -10px 40px rgba(0,0,0,0.5); padding-bottom:var(--sb); animation:up .25s ease-out; }
.sheetWrap.wide .sheet{ max-width:720px; }
@keyframes up{ from{ transform:translateY(40px); opacity:0; } }
.sheet header{ display:flex; align-items:center; padding:14px 16px 8px 18px; }
.sheet h2{ margin:0; font:800 20px Inter, Arial; flex:1; }
.sheet .x{ width:44px; height:44px; border-radius:50%; border:0; background:rgba(255,255,255,0.08); color:#fff; font-size:26px; line-height:1; }
.shBody{ overflow-y:auto; -webkit-overflow-scrolling:touch; padding:4px 18px 14px; touch-action:pan-y; -webkit-user-select:text; user-select:text; }
.sheet footer{ padding:0 18px 14px; }
.sheet footer:empty{ display:none; }
.shop .row{ display:flex; align-items:center; gap:12px; padding:11px 0; border-bottom:1px solid var(--line); }
.shop .row > span{ flex:1; min-width:0; }
.shop .row b{ display:block; font:700 15px Inter, Arial; }
.shop .row small{ display:block; font:500 12.5px/1.35 Inter, Arial; color:var(--mute); margin-top:2px; }
.shop .row .btn{ width:auto; margin:0; min-height:44px; padding:8px 14px; font-size:14px; white-space:nowrap; }
.rowBtns{ display:flex; gap:6px; flex:0 0 auto !important; }
.own{ font:700 12px Inter, Arial; font-style:normal; color:var(--gold); }
.dot{ display:inline-block; width:12px; height:12px; border-radius:50%; margin-right:7px; vertical-align:-1px; border:1px solid rgba(255,255,255,0.4); }
.robBox{ margin-top:14px; padding:12px; border-radius:14px; background:rgba(200,32,42,0.1); border:1px solid rgba(200,32,42,0.35); }
.robBox .btn{ margin:0 0 6px; }
.rob{ padding:18px 0; text-align:center; }
.rob b{ display:block; font:800 17px Inter, Arial; margin-bottom:12px; }
.rob .bar{ height:10px; border-radius:5px; background:rgba(255,255,255,0.1); overflow:hidden; }
.rob .bar i{ display:block; height:100%; width:0; background:linear-gradient(90deg, #3bd16f, #e8c87a); }
.rob span{ display:block; margin-top:10px; font:800 22px Inter, Arial; color:#9ff0a8; }
.bal{ display:flex; gap:10px; margin:6px 0; }
.bal span{ flex:1; background:rgba(255,255,255,0.05); border-radius:12px; padding:10px; font:600 12px Inter, Arial; color:var(--mute); }
.bal b{ display:block; font:900 20px Inter, Arial; color:#9ff0a8; margin-top:2px; }
.btnRow{ display:flex; gap:8px; flex-wrap:wrap; }
.btnRow .btn{ flex:1 1 30%; font-size:14px; }
.clothes h4, .dealer h4, .howto h4{ margin:14px 0 6px; font:800 13px Inter, Arial; letter-spacing:0.06em; text-transform:uppercase; color:var(--gold); }
.chips{ display:flex; flex-wrap:wrap; gap:6px; }
.chip{ min-height:44px; padding:8px 12px; border-radius:20px; border:1px solid var(--line); background:rgba(255,255,255,0.06); color:var(--ink); font:600 13px Inter, Arial; text-transform:capitalize; }
.chip.on{ background:var(--acc); color:#1a0d0a; border-color:var(--acc); }
.sws{ display:flex; flex-wrap:wrap; gap:7px; margin-top:8px; }
.sw{ width:44px; height:44px; border-radius:50%; border:2px solid rgba(255,255,255,0.25); padding:0; }
.sw.on{ border:3px solid #fff; box-shadow:0 0 0 2px var(--acc); }
.cars{ display:grid; grid-template-columns:repeat(auto-fill, minmax(118px, 1fr)); gap:8px; }
.carPick{ text-align:left; padding:10px; border-radius:12px; border:1px solid var(--line); background:rgba(255,255,255,0.05); color:var(--ink); min-height:60px; position:relative; }
.carPick b{ display:block; font:800 14px Inter, Arial; } .carPick span{ font:600 12px Inter, Arial; color:#9ff0a8; }
.carPick em{ position:absolute; right:8px; top:8px; font:700 10px Inter, Arial; font-style:normal; color:var(--gold); }
.carPick.on{ border-color:var(--acc); background:rgba(255,90,95,0.14); }
.spec{ margin:12px 0 4px; }
.spec h3{ margin:0 0 6px; font:900 italic 22px Inter, Arial; }
.spec > div{ display:flex; align-items:center; gap:8px; font:600 12px Inter, Arial; color:var(--mute); margin:5px 0; }
.spec > div span{ width:92px; } .spec > div small{ width:64px; text-align:right; }
.st{ flex:1; height:7px; border-radius:4px; background:rgba(255,255,255,0.1); overflow:hidden; display:block; }
.st i{ display:block; height:100%; background:linear-gradient(90deg, var(--acc), var(--acc2)); }
.tabs{ display:flex; gap:6px; overflow-x:auto; padding-bottom:8px; margin:0 -2px 6px; }
.tabs button{ flex:0 0 auto; min-height:44px; padding:8px 14px; border-radius:20px; border:1px solid var(--line); background:rgba(255,255,255,0.05); color:var(--ink); font:700 13px Inter, Arial; }
.tabs button.on{ background:var(--ink); color:#111; }
.bigMap{ width:100%; aspect-ratio:1; border-radius:14px; overflow:hidden; }
.bigMap canvas{ width:100%; height:100%; display:block; }
.legend{ display:flex; flex-wrap:wrap; gap:10px; margin-top:8px; font:600 12px Inter, Arial; color:var(--mute); }
.legend i{ display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:5px; vertical-align:-1px; }
.board{ list-style:none; padding:0; margin:0; counter-reset:r; }
.board li{ display:flex; padding:10px 0; border-bottom:1px solid var(--line); counter-increment:r; font:600 14px Inter, Arial; }
.board li::before{ content:counter(r); width:30px; color:var(--mute); }
.board li b{ flex:1; } .board li span{ color:#9ff0a8; }
.board li.me{ color:var(--gold); }
.howto p{ font-size:14px; line-height:1.55; color:#ddd8ce; margin:0 0 6px; }

/* the destination marker (1.1): a pin with the distance; at the edge of the screen, an arrow pointing the way */
.wp{ --wpc:#e8c87a; position:absolute; left:0; top:0; width:0; height:0; pointer-events:none; z-index:2; }
.wpPin{ position:absolute; left:-15px; top:-40px; width:30px; height:40px; filter:drop-shadow(0 2px 4px rgba(0,0,0,0.6)); }
.wpPin path{ fill:var(--wpc); stroke:#000; stroke-width:1.6; }
.wpPin circle{ fill:#111; }
.wp b{ position:absolute; left:50%; top:4px; transform:translateX(-50%); white-space:nowrap; font:800 13px Inter, Arial; color:#fff; background:rgba(10,12,16,0.72); padding:3px 8px; border-radius:8px; border:1px solid var(--wpc); }
.wpArrow{ display:none; position:absolute; left:-20px; top:-38px; width:40px; height:40px; transform-origin:20px 20px; }
.wpArrow::before{ content:''; position:absolute; left:34px; top:6px; border-left:24px solid var(--wpc); border-top:14px solid transparent; border-bottom:14px solid transparent; filter:drop-shadow(0 0 3px rgba(0,0,0,0.9)); }
.wp.off .wpArrow{ display:block; }
.wp.off .wpPin{ transform:scale(0.8); }
