*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{width:100%;height:100%;overflow:hidden;background:#05030a;color:#fff;font-family:'Rajdhani',system-ui,sans-serif;touch-action:none;user-select:none;-webkit-user-select:none;overscroll-behavior:none}
#game,#game canvas{position:fixed;inset:0;width:100%;height:100%;display:block}

/* ---------- START ---------- */
#start{position:fixed;inset:0;z-index:50;overflow:hidden;display:flex;align-items:center;justify-content:center;
  background:radial-gradient(ellipse at 50% 85%,#ffd59a 0%,rgba(255,180,110,.6) 18%,transparent 45%),linear-gradient(180deg,#3d6f9e 0%,#7fa9c9 35%,#e8b88a 68%,#d9875a 82%,#2a2228 100%)}
#start .skyline{position:absolute;left:0;bottom:0;width:100%;height:46%}
#start::after{content:'';position:absolute;inset:0;background:radial-gradient(ellipse at center,transparent 40%,rgba(0,0,0,.45));pointer-events:none}
.startInner{position:relative;z-index:1;text-align:center;padding:16px;max-width:680px}
.logo{font-family:'Oswald',Impact,sans-serif;font-weight:700;font-size:clamp(58px,14vmin,130px);line-height:.95;letter-spacing:2px;font-style:italic;
  color:#fff;text-shadow:0 3px 0 #b0563a,0 6px 0 #6a2a20,0 14px 30px rgba(0,0,0,.45)}
.tag{letter-spacing:5px;font-weight:700;font-size:clamp(12px,2.4vmin,18px);color:#fff4e6;margin:10px 0 20px;text-shadow:0 1px 4px #0008}
#playBtn{font-family:'Oswald',Impact,sans-serif;font-weight:700;font-size:clamp(26px,5.5vmin,40px);letter-spacing:4px;padding:8px 58px;border:0;border-radius:6px;cursor:pointer;
  color:#1a1410;background:#fff;box-shadow:0 6px 0 #c8b8a8,0 12px 26px rgba(0,0,0,.35)}
#playBtn:active{transform:translateY(3px);box-shadow:0 3px 0 #c8b8a8,0 8px 20px rgba(0,0,0,.35)}
.quality{margin:16px 0 10px;display:flex;gap:8px;justify-content:center;align-items:center;font-weight:700;text-shadow:0 1px 3px #000a}
.quality button{font:700 15px 'Rajdhani',sans-serif;padding:6px 14px;border-radius:6px;border:1px solid #ffffff88;background:#0005;color:#fff;cursor:pointer}
.quality button.on{background:#fff;color:#1a1410;border-color:#fff}
.help{font-size:clamp(11px,2.1vmin,14px);color:#fff;line-height:1.45;background:#0007;border-radius:8px;padding:8px 12px;margin-top:6px}
#rotateHint{display:none;margin-top:10px;font-weight:700;color:#fff}
@media (orientation:portrait) and (pointer:coarse){#rotateHint{display:block}}
#loading{position:absolute;bottom:18px;left:0;right:0;text-align:center;font-weight:700;letter-spacing:2px;display:none}

/* ---------- HUD ---------- */
#hud{position:fixed;inset:0;pointer-events:none;z-index:10;display:none;
  --sl:env(safe-area-inset-left,0px);--sr:env(safe-area-inset-right,0px);--st:env(safe-area-inset-top,0px)}
#mapWrap{position:absolute;left:calc(14px + var(--sl));top:calc(12px + var(--st));width:150px;height:150px;border-radius:50%;
  overflow:hidden;border:3px solid #000a;box-shadow:0 0 0 2px #ffffff40,0 4px 18px #0008}
#minimap{width:100%;height:100%}
.mapN{position:absolute;top:2px;left:50%;transform:translateX(-50%);font:700 11px sans-serif;color:#fff;text-shadow:0 0 3px #000}
#bars{position:absolute;left:calc(14px + var(--sl));top:calc(170px + var(--st));width:150px}
#bars>div{height:8px;background:#0008;border:1px solid #000;margin-bottom:4px;border-radius:3px;overflow:hidden}
#hpBar i{display:block;height:100%;width:100%;background:linear-gradient(90deg,#2ee66b,#7dff9a)}
#armBar i{display:block;height:100%;width:0%;background:linear-gradient(90deg,#3aa0ff,#9fd4ff)}
#stats{position:absolute;right:calc(16px + var(--sr));top:calc(10px + var(--st));text-align:right;font-family:'Bebas Neue',Impact,sans-serif}
#clock{font-size:26px;letter-spacing:2px;text-shadow:2px 2px 0 #000,0 0 8px #000}
#money{font-size:38px;color:#7dff9a;letter-spacing:2px;text-shadow:2px 2px 0 #000,-1px -1px 0 #000,0 0 10px #0a0}
#stars{font-size:32px;letter-spacing:2px}
#stars i{font-style:normal;color:#0006;-webkit-text-stroke:1.5px #fff8;margin-left:2px}
#stars i.on{color:#ffd23a;-webkit-text-stroke:1.5px #000;text-shadow:0 0 10px #ffb300}
#weapon{font-family:'Rajdhani',sans-serif;font-weight:700;font-size:17px;margin-top:2px;text-shadow:1px 1px 0 #000,0 0 6px #000}
#weapon span{color:#ffd23a;margin-left:4px}
#stars.blink i.on{animation:blink .5s steps(1) infinite}
@keyframes blink{50%{opacity:.25}}
#mission{position:absolute;left:50%;top:calc(14px + var(--st));transform:translateX(-50%);font-weight:700;font-size:18px;
  background:#000a;padding:6px 16px;border-radius:10px;border-left:4px solid #ffd23a;display:none;white-space:nowrap}
#bigMsg{position:absolute;left:0;right:0;top:32%;text-align:center;font-family:'Bebas Neue',Impact,sans-serif;font-size:clamp(40px,9vmin,84px);
  letter-spacing:3px;opacity:0;transition:opacity .4s;text-shadow:3px 3px 0 #000,0 0 30px #000}
#bigMsg small{display:block;font-size:.4em;letter-spacing:2px}
#prompt{position:absolute;left:50%;bottom:22%;transform:translateX(-50%);background:#000b;padding:6px 14px;border-radius:8px;font-weight:700;display:none}
#speedo{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);text-align:center;font-family:'Bebas Neue',Impact,sans-serif;display:none;text-shadow:2px 2px 0 #000}
#speedo b{font-size:46px;font-weight:400;display:block;line-height:.9;color:#fff}
#speedo small{font-size:14px;letter-spacing:3px}
#cross{position:absolute;left:50%;top:44%;width:6px;height:6px;margin:-3px;border-radius:50%;background:#fff;box-shadow:0 0 0 2px #0008;opacity:.8;display:none}
#fade{position:absolute;inset:0;background:#000;opacity:0;transition:opacity .6s}

/* ---------- TOUCH ---------- */
#touch{position:fixed;inset:0;z-index:20;display:none;touch-action:none}
#joyHint{position:absolute;left:calc(40px + var(--sl,0px));bottom:36px;width:120px;height:120px;border-radius:50%;border:2px dashed #ffffff30;pointer-events:none}
#joy{position:absolute;width:130px;height:130px;margin:-65px 0 0 -65px;border-radius:50%;background:radial-gradient(#ffffff10,#ffffff22);border:2px solid #ffffff55;display:none;pointer-events:none}
#knob{position:absolute;left:50%;top:50%;width:58px;height:58px;margin:-29px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff,#bbb);opacity:.85;box-shadow:0 2px 10px #0008}
.btn{position:absolute;width:66px;height:66px;border-radius:50%;display:flex;align-items:center;justify-content:center;text-align:center;line-height:1;
  font:700 13px 'Rajdhani',sans-serif;color:#fff;background:#0007;border:2px solid #ffffffaa;text-shadow:0 1px 2px #000;
  -webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);touch-action:none}
.btn.down{background:#fff4;transform:scale(.93)}
#bFire{right:calc(26px + var(--sr,0px));bottom:34px;width:92px;height:92px;font-size:17px;background:#ff2a6a55;border-color:#ff8ab0}
#bEnter{right:calc(112px + var(--sr,0px));bottom:196px;font-size:26px;background:#3ff2ff33}
#bWeapon{right:calc(36px + var(--sr,0px));bottom:138px;width:58px;height:58px;font-size:24px;background:#ffd23a33}
#bRadio{right:calc(36px + var(--sr,0px));bottom:210px;width:50px;height:50px;font-size:20px}
#bEnter.hot{box-shadow:0 0 0 4px #3ff2ff,0 0 24px #3ff2ff;animation:pulse 1s infinite}
#bJump{right:calc(136px + var(--sr,0px));bottom:26px}
#bGas{right:calc(136px + var(--sr,0px));bottom:26px;background:#2ee66b44;border-color:#7dff9a}
#bBrake{right:calc(210px + var(--sr,0px));bottom:20px;background:#ff3b3b44}
#bHand{right:calc(126px + var(--sr,0px));bottom:110px;font-size:12px}
body:not(.incar) .btn.car{display:none}
body.incar .btn.foot{display:none}
@media (max-height:420px){#mapWrap{width:118px;height:118px}#bars{top:calc(138px + var(--st));width:118px}#money{font-size:30px}#stars{font-size:26px}}

/* ---------- SHOP ---------- */
#shop{position:fixed;inset:0;z-index:60;display:none;align-items:center;justify-content:center;background:rgba(0,0,0,.55);padding:12px}
.shopBox{width:min(560px,100%);max-height:100%;overflow:auto;background:#14171c;border:1px solid #ffffff22;border-radius:12px;box-shadow:0 20px 60px #000a}
.shopHead{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid #ffffff1a;position:sticky;top:0;background:#14171c}
.shopHead b{font-family:'Oswald',sans-serif;font-size:22px;letter-spacing:1px;flex:1}
.shopHead span{font-family:'Bebas Neue',sans-serif;font-size:28px;color:#7dff9a}
#shopClose{width:40px;height:40px;border-radius:8px;border:0;background:#ffffff14;color:#fff;font-size:20px;cursor:pointer}
.shopItem{display:flex;align-items:center;gap:12px;padding:10px 16px;border-bottom:1px solid #ffffff0d}
.shopItem div{flex:1}.shopItem b{display:block;font-size:17px}.shopItem small{color:#ffffffaa;font-size:13px}
.shopItem button{min-width:96px;padding:10px 12px;border:0;border-radius:8px;background:#2e9e52;color:#fff;font:700 16px 'Rajdhani',sans-serif;cursor:pointer}
.shopItem.poor button{background:#4a4f57;color:#ffffff88}

.shopSec{padding:10px 16px 4px;font:700 12px 'Rajdhani',sans-serif;letter-spacing:3px;color:#ffffff77;text-transform:uppercase}
.shopItem.done button{background:#2a2f36;color:#7dff9a}
.sw{display:inline-block;width:18px;height:18px;border-radius:50%;margin-right:8px;vertical-align:-3px;border:2px solid #fff6}
.shopBox{background:rgba(16,19,24,.92);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.shopHead{background:rgba(16,19,24,.96)}
.shopItem button{min-height:48px}
#bAct{left:50%;right:auto;transform:translateX(-50%);bottom:28%;width:auto;height:54px;padding:0 26px;border-radius:30px;font-size:17px;letter-spacing:1px;
  background:#ffc020dd;color:#1a1206;text-shadow:none;border-color:#fff;display:none;box-shadow:0 0 20px #ffc02088;animation:pulse 1.2s infinite}
#bAct.down{transform:translateX(-50%) scale(.95)}
#navArrow{position:absolute;left:50%;top:calc(52px + var(--st));font-size:30px;color:#ffc020;text-shadow:0 0 6px #000,0 2px 0 #000;display:none;transform-origin:50% 55%;transition:transform .08s linear}
@media (orientation:landscape) and (max-height:500px){.shopBox{max-height:96vh}.shopItem{padding:7px 14px}}
@media (max-height:500px){
  #bEnter{bottom:166px}
  #bRadio{left:calc(14px + var(--sl,0px));right:auto;top:calc(150px + var(--st,0px));bottom:auto;width:44px;height:44px;font-size:18px}
}

/* ---------- PHONE ---------- */
#bPhone{position:fixed;z-index:22;left:calc(16px + env(safe-area-inset-left,0px));bottom:150px;width:50px;height:50px;border-radius:14px;display:none;align-items:center;justify-content:center;
  font-size:26px;background:#0009;border:2px solid #ffffffaa;cursor:pointer;touch-action:none;box-shadow:0 4px 14px #0007}
body.playing #bPhone{display:flex}
#phone{position:fixed;z-index:55;right:calc(14px + env(safe-area-inset-right,0px));bottom:10px;width:min(340px,94vw);height:min(620px,94vh);
  transform:translateY(115%);transition:transform .28s cubic-bezier(.2,.9,.3,1.1);pointer-events:none}
#phone.open{transform:none;pointer-events:auto}
.phFrame{position:absolute;inset:0;border-radius:34px;background:#08090c;border:3px solid #2c2f36;box-shadow:0 20px 60px #000c,inset 0 0 0 2px #000;overflow:hidden;display:flex;flex-direction:column;font-family:'Rajdhani',sans-serif}
.phStatus{height:30px;display:flex;align-items:center;justify-content:space-between;padding:0 18px;font-weight:700;font-size:14px;color:#fff;background:#000;flex:none}
.phNotch{width:80px;height:18px;border-radius:10px;background:#111}
#phClose{margin-left:8px;width:24px;height:24px;border-radius:50%;border:0;background:#ffffff22;color:#fff;cursor:pointer}
#phScreen{flex:1;overflow:auto;background:#101318;color:#fff;-webkit-overflow-scrolling:touch}
#phHomeBtn{flex:none;height:22px;border:0;background:#000;cursor:pointer;position:relative}
#phHomeBtn::after{content:'';position:absolute;left:50%;top:8px;width:110px;height:5px;margin-left:-55px;border-radius:3px;background:#ffffffaa}
.phWall{min-height:100%;padding:22px 16px;background:linear-gradient(160deg,#2a5a8a 0%,#c8784a 60%,#3a2030 100%)}
.phTime{font:700 54px 'Oswald',sans-serif;text-align:center;text-shadow:0 2px 10px #0006}
.phDate{text-align:center;font-weight:700;letter-spacing:2px;margin-bottom:22px;text-shadow:0 1px 4px #0008}
.phGrid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px 6px}
.phApp{background:none;border:0;color:#fff;display:flex;flex-direction:column;align-items:center;gap:6px;cursor:pointer;font:700 13px 'Rajdhani',sans-serif}
.phApp i{font-style:normal;width:58px;height:58px;border-radius:16px;display:flex;align-items:center;justify-content:center;font-size:28px;box-shadow:0 4px 12px #0006}
.phApp:active i{transform:scale(.92)}
.phHead{display:flex;align-items:center;gap:8px;padding:10px 12px;position:sticky;top:0;z-index:1}
.phHead b{flex:1;font-size:18px}.phHead span{font:400 22px 'Bebas Neue',sans-serif;color:#d8ffe0}
.phBack{width:34px;height:34px;border-radius:50%;border:0;background:#0003;color:#fff;font-size:24px;line-height:1;cursor:pointer}
.phBody{padding:10px 12px 16px}
.phNote{font-size:13px;color:#ffffff99;margin:2px 0 10px}
.phEmpty{padding:18px 8px;text-align:center;color:#ffffffaa;font-size:14px}
.phRow,.phCard,.phAch{display:flex;align-items:center;gap:10px;padding:9px 6px;border-bottom:1px solid #ffffff10}
.phRow>div,.phCard>div:first-child,.phAch>div{flex:1;min-width:0}
.phRow b,.phCard b,.phAch b{display:block;font-size:15px}.phRow small,.phCard small,.phAch small{color:#ffffff99;font-size:12px}
.phIc{font-style:normal;font-size:24px;width:34px;text-align:center}
.phBtn{min-width:70px;min-height:40px;border:0;border-radius:10px;background:#1e6ad8;color:#fff;font:700 14px 'Rajdhani',sans-serif;cursor:pointer}
.phBtn.red{background:#c8283a}.phBtn:disabled{background:#3a3f47;color:#ffffff66}
.phBig{width:100%;min-height:50px;margin-bottom:8px;border:0;border-radius:12px;background:#ffc020;color:#1a1206;font:700 16px 'Rajdhani',sans-serif;cursor:pointer}
.phStar{width:38px;height:40px;border:0;background:none;color:#ffffff44;font-size:22px;cursor:pointer}.phStar.on{color:#ffc020}
.phCardR{display:flex;flex-direction:column;align-items:flex-end;gap:4px}.phCardR span{font:400 22px 'Bebas Neue',sans-serif;color:#7dff9a}
.phBal{background:#ffffff0d;border-radius:14px;padding:12px 14px;margin-bottom:6px}.phBal small{display:block;color:#ffffff99}.phBal b{font:400 38px 'Bebas Neue',sans-serif;color:#7dff9a}
.phSec{margin:14px 2px 4px;font-size:12px;letter-spacing:3px;color:#ffffff77;text-transform:uppercase;font-weight:700}
.phLed{display:flex;gap:8px;font-size:13px;padding:5px 2px;border-bottom:1px solid #ffffff0a}.phLed span:first-child{color:#ffffff66;width:42px}.phLed span:nth-child(2){flex:1}.phLed b{color:#7dff9a}.phLed b.neg{color:#ff7a7a}
.phStats{display:grid;grid-template-columns:1fr 1fr;gap:6px}.phStats div{background:#ffffff0a;border-radius:10px;padding:7px 9px}.phStats small{display:block;color:#ffffff88;font-size:11px}.phStats b{font-size:16px}
.phAch{opacity:.55}.phAch.on{opacity:1}.phAch i{font-style:normal;font-size:20px}.phAch span{color:#ffd23a;font-weight:700;font-size:13px}
@media (max-height:500px){#bPhone{bottom:auto;top:calc(200px + env(safe-area-inset-top,0px));width:44px;height:44px;font-size:22px}#phone{height:96vh;bottom:2vh}.phTime{font-size:38px}.phWall{padding:12px}.phDate{margin-bottom:12px}}

/* ---------- HELICOPTER CONTROLS ---------- */
.btn.heli{display:none}
body.inheli .btn.heli{display:flex}
body.inheli .btn.car{display:none}
#bUp{right:calc(136px + var(--sr,0px));bottom:112px;background:#2e9e5255;border-color:#7dff9a;font-size:12px}
#bDown{right:calc(136px + var(--sr,0px));bottom:26px;background:#c8283a44;border-color:#ff8a8a;font-size:12px}

/* ---------- CINEMATIC (slow-mo stunt) ---------- */
body::before,body::after{content:'';position:fixed;left:0;right:0;height:0;background:#000;z-index:15;pointer-events:none;transition:height .35s ease}
body::before{top:0}body::after{bottom:0}
body.cine::before,body.cine::after{height:11vh}
body.cine #hud>*:not(#bigMsg){opacity:0;transition:opacity .3s}
