@import url('https://fonts.googleapis.com/css2?family=Bungee+Shade&family=Bungee&family=Luckiest+Guy&display=swap');
*{box-sizing:border-box}
body{margin:0;background:#0d131d;color:#fff;font-family:Arial,sans-serif;overflow:hidden}
canvas#city{display:block;width:100vw;height:100dvh}
button{border:2px solid #000;background:#102235;color:#fff;font-family:'Bungee',Arial,sans-serif;font-size:11px;padding:10px 14px;border-radius:7px;cursor:pointer;box-shadow:3px 3px #000}
button:hover{background:#f987b9;color:#171124}button:focus-visible{outline:3px solid #fff;outline-offset:3px}button:disabled{opacity:.38;cursor:not-allowed}
.eyebrow{font-size:10px;letter-spacing:3px;color:#ffc99e;font-weight:bold}
header{position:fixed;top:18px;left:22px;pointer-events:none;z-index:3}
header h1{font-family:'Bungee Shade',cursive;font-size:24px;line-height:1.1;margin:6px 0;color:#ffe600;text-shadow:3px 3px #ff159b,5px 5px #000}header h1 span{display:block;color:#00d9e6;font-size:27px}
#billboards{position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:1}
.building-sign{position:absolute;left:0;top:0;width:220px;text-align:center;transform-origin:center}
.building-sign img{display:block;width:78px;height:62px;object-fit:cover;margin:auto;border:4px solid #000;border-radius:9px;box-shadow:5px 5px #ff299b;transform:rotate(-7deg)}
.building-sign strong{display:inline-block;background:var(--unit);color:#111;font-family:'Bungee',sans-serif;font-size:13px;margin-top:7px;padding:5px 9px;border:4px solid #000;box-shadow:4px 4px #000;border-radius:7px}
.building-sign.done strong:after{content:' ✓'}
/* GTA-style wanted level: only earned stars are shown, the newest one pops in and flashes. */
#center{position:fixed;top:14px;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:8px;z-index:3;pointer-events:none}
#center button{pointer-events:auto}
#wanted{display:flex;gap:10px;min-height:96px;font-size:92px;line-height:1}
#wanted span{color:#fff;-webkit-text-stroke:4px #000;paint-order:stroke fill;text-shadow:0 6px 0 #000,0 0 26px #9fd4ff,0 0 50px #4d8dff}
#wanted span.new{animation:starpop .45s cubic-bezier(.2,2,.4,1),starflash .25s steps(2) .45s 8}
@keyframes starpop{from{transform:scale(3) rotate(-40deg);opacity:0}to{transform:none;opacity:1}}
@keyframes starflash{50%{color:#ffd400;opacity:.35}}
#policeToggle{font-size:15px;padding:12px 22px;background:#ff2f5f;color:#fff;border:4px solid #000;box-shadow:5px 5px #000;line-height:1.1;text-align:center}
#policeToggle small{display:block;font-family:Arial,sans-serif;font-size:10px;font-weight:bold;opacity:.85;margin-top:3px}
#policeToggle.off{background:#59d98e;color:#0b2416}
#safe{background:#59d98e;color:#0b2416;font-family:'Bungee',sans-serif;font-size:14px;padding:8px 14px;border:3px solid #000;border-radius:8px;box-shadow:4px 4px #000;animation:safepulse 1s ease-in-out infinite}@keyframes safepulse{50%{transform:scale(1.06)}}
#unranked{background:#000c;font-size:10px;padding:5px 9px;border-radius:5px;letter-spacing:1px}
#bustMeter{width:220px;background:#000c;border:2px solid #ff2f5f;border-radius:6px;padding:4px 6px;text-align:center;font-family:'Bungee',sans-serif;font-size:12px;color:#ff6b8a}
#bustMeter i{display:block;height:6px;background:#ff2f5f;margin-top:3px;width:0}
.hud{position:fixed;right:18px;top:16px;display:flex;flex-direction:column;align-items:flex-end;gap:8px;z-index:3}
.money{text-align:right;background:#0b1426d9;border:3px solid #000;border-radius:8px;padding:6px 12px;box-shadow:3px 3px #000}
#cash{font-family:'Bungee',sans-serif;color:#79efa9;font-size:28px;display:block;text-shadow:2px 2px #000}
#coinTimer,#progress{font-size:11px;color:#b6d7df}
#progress{background:#0b1426cc;padding:5px 9px;border-radius:5px}
.hudbtns{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end;max-width:330px}
#soundbar{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:12px;background:#0b1426e6;border:3px solid #000;border-radius:10px;padding:7px 12px;box-shadow:4px 4px #ff239b;z-index:4}
#soundbar label{display:flex;align-items:center;gap:5px;font-size:15px}#soundbar input{width:110px;accent-color:#ffe600}
#music{background:#ffe600;color:#111}
#area{position:fixed;right:24px;bottom:240px;font-family:'Luckiest Guy',cursive;font-size:34px;letter-spacing:1px;color:#fff;-webkit-text-stroke:1.5px #000;text-shadow:3px 3px #000;opacity:0;transition:opacity .4s;z-index:3;pointer-events:none;text-align:right;max-width:60vw}
#area.show{opacity:1}#area.district{color:#ffe600}#area.warn{color:#ff5c7c}#area.good{color:#79efa9}
#intro{position:fixed;inset:0;background:linear-gradient(110deg,#0d1235f5,#491c55b0,transparent);display:flex;align-items:center;padding:7vw;z-index:6}
#intro[hidden]{display:none}.introcard{max-width:520px}
h2{font-family:'Luckiest Guy',cursive;font-size:clamp(34px,6vw,64px);line-height:1;margin:16px 0}h2 em{color:#ffe600;text-shadow:3px 3px #ff299b;font-style:normal}
.controls{list-style:none;padding:0;margin:0 0 14px;display:grid;gap:8px;font-size:14px}
kbd{font-family:'Bungee',sans-serif;font-size:11px;background:#fff;color:#111;border-radius:4px;padding:3px 7px;border:2px solid #000;box-shadow:2px 2px #ff299b;margin-right:4px}
.rule{font-size:15px;font-weight:bold;color:#ffe600;line-height:1.4}
#start{background:#ffe600;color:#111;font-size:16px;margin:8px 8px 10px 0;padding:14px 20px}
small{display:block;font-size:10px;color:#bdafc7;margin-top:12px}
#prompt{position:fixed;bottom:86px;left:50%;transform:translateX(-50%);background:#101529f0;border:3px solid #ffe600;padding:12px 14px;text-align:center;border-radius:12px;min-width:280px;z-index:4}
#prompt strong{display:block;margin-bottom:8px;color:#ffcb9c;font-family:'Bungee',sans-serif}#enter{background:#ffe600;color:#111}
dialog{padding:22px;border:3px solid #000;border-radius:14px;background:#142139;color:#fff;max-width:94vw;max-height:92dvh;box-shadow:8px 8px #ff239b}
dialog::backdrop{background:#070d23cc}dialog h2{font-size:38px;margin:4px 0 12px}.close{float:right}
#directory{width:min(760px,94vw)}#destinations h3{font-family:'Bungee',sans-serif;font-size:14px;margin:16px 0 8px}
.destgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.destgrid button{border-bottom:5px solid var(--color);min-height:56px;text-align:left}
#reader{width:min(1200px,96vw);height:94dvh;max-height:94dvh;padding:0;overflow:hidden}
.readerbar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 15px}.readerbar strong{font-family:'Bungee',sans-serif}
iframe{width:100%;height:calc(100% - 64px);border:0;background:#130628}
#bigmap{width:min(1180px,96vw)}.maphead{display:flex;align-items:center;gap:16px;flex-wrap:wrap}.maphead h2{margin:0}.maphead span{flex:1;color:#b6d7df;font-size:13px}
.mapwrap{display:grid;grid-template-columns:1fr 270px;gap:16px;margin-top:12px}#mapCanvas{width:100%;border:3px solid #000;border-radius:8px;cursor:pointer;image-rendering:pixelated}
#mapList{max-height:70dvh;overflow:auto}#mapList h3{font-family:'Bungee',sans-serif;font-size:12px;margin:10px 0 6px}#mapList button{display:block;width:100%;text-align:left;margin:5px 0;border-left:7px solid var(--color);font-size:10px}#mapList b{display:inline-block;min-width:18px}
#garage{width:min(1100px,96vw);background:linear-gradient(#1b1d29,#11131c);border-color:var(--gar,#ffd400)}
.garagehead{display:flex;align-items:center;gap:20px;flex-wrap:wrap}.garagehead h2{color:var(--gar,#ffd400);margin:0;font-size:46px;text-shadow:3px 3px #ff2f8e}.garagehead>div:first-child{flex:1}
.wallet{background:#000;border:3px solid #79efa9;border-radius:10px;padding:6px 16px;text-align:right}.wallet small{margin:0;color:#79efa9;font-family:'Bungee',sans-serif}.wallet strong{font-family:'Bungee',sans-serif;font-size:34px;color:#79efa9}
.garagenote{color:#b6b9c9;font-size:13px}
#garageList{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:14px}
.carcard{border:3px solid #2c3142;border-top:8px solid var(--car);border-radius:12px;padding:12px;background:repeating-linear-gradient(135deg,#1e2232 0 12px,#1b1f2e 12px 24px)}
.carcard.active{border-color:#ffd400;box-shadow:0 0 0 3px #ffd40055}.carcard.owned .price{background:#2a5e40;color:#bff5d3}
.cartop{display:flex;justify-content:space-between;align-items:center;gap:8px}.carcard h3{font-family:'Bungee',sans-serif;font-size:14px;margin:0}
.price{background:#ffd400;color:#111;font-family:'Bungee',sans-serif;font-size:11px;padding:4px 8px;border-radius:5px;white-space:nowrap}
.carcard canvas{display:block;width:100%;height:auto;margin:6px 0;background:#2d3139;border-radius:8px;border:2px solid #000}
.carcard p{font-size:12px;color:#c4c7d4;min-height:30px;margin:4px 0 8px}
.stat{display:grid;grid-template-columns:82px 1fr;align-items:center;gap:6px;font-size:10px;margin:4px 0;color:#c4c7d4}
.stat i{position:relative;height:9px;background:#0c0e15;border-radius:5px;overflow:hidden;border:1px solid #000}.stat b{position:absolute;inset:0 auto 0 0;background:var(--car)}.stat em{position:absolute;inset:0 auto 0 0;background:#79efa9;opacity:.55}
.buy{display:block;width:100%;margin-top:10px;background:#ffd400;color:#111;font-size:12px}.ups{display:grid;gap:5px;margin-top:8px}.ups button{font-size:9px;padding:7px}
#busted{text-align:center;border-color:#ff4888;width:min(520px,94vw)}#busted::backdrop{background:#10091dee}
#busted h2{color:#ff4277;font-size:84px;text-shadow:4px 4px #000;margin:0}#busted h3{font-family:'Bungee',sans-serif;font-size:13px;margin:16px 0 6px}
#score b{font-family:'Bungee',sans-serif;color:#79efa9;font-size:22px}
#saveForm label{display:block;font-size:12px;margin-bottom:6px;color:#ffcb9c}#saveForm div{display:flex;gap:8px;justify-content:center}
#saveForm input,#playerName{font:16px Arial;padding:9px;border-radius:6px;border:2px solid #000;min-width:0;flex:1;max-width:240px}
.board{list-style:none;padding:0;margin:0;text-align:left;max-height:50dvh;overflow:auto}.board li{display:grid;grid-template-columns:1fr auto auto;gap:10px;align-items:center;padding:7px 10px;border-bottom:1px solid #ffffff1a}
.board li:nth-child(1) span{color:#ffd400}.board li.me{background:#ff2f8e33}.board li small{margin:0;font-size:10px}.board li b{font-family:'Bungee',sans-serif;color:#79efa9}
#leaders{width:min(560px,94vw)}#weekLabel{color:#b6d7df;font-size:12px}
.bustbtns{display:flex;gap:8px;justify-content:center;margin-top:14px}#retry{background:#ffe600;color:#111}.small{font-size:11px;color:#b6b9c9}
#joystick{display:none;position:fixed;bottom:96px;left:22px;width:130px;height:130px;border-radius:50%;border:3px solid #ffffff80;background:#10192d99;z-index:4;touch-action:none}
#knob{position:absolute;left:40px;top:40px;width:45px;height:45px;border-radius:50%;background:#ffe600;border:3px solid #111;box-shadow:3px 3px #ff239b}
@media (hover:none),(max-width:700px){#joystick{display:block}}
@media(max-width:700px){header{display:none}
  #center{top:8px;left:12px;transform:none;align-items:flex-start}#wanted{font-size:46px;min-height:50px;gap:4px}#policeToggle{font-size:10px;padding:7px 10px}#policeToggle small{font-size:8px}
  .hud{top:8px;right:8px;gap:5px}#cash{font-size:18px}.money{padding:4px 8px}.hudbtns{max-width:120px}.hudbtns button{font-size:8px;padding:6px 7px}#progress{font-size:9px}
  #soundbar{bottom:8px;gap:6px;padding:5px 8px}#soundbar input{width:60px}#music{font-size:9px;padding:7px}
  #area{font-size:20px;bottom:300px;right:10px}#prompt{bottom:240px}#prompt strong{font-size:11px}
  .destgrid{grid-template-columns:1fr 1fr}.mapwrap{grid-template-columns:1fr}#mapList{max-height:none}#garage h2{font-size:30px}.wallet strong{font-size:24px}#busted h2{font-size:56px}}
@media(prefers-reduced-motion:reduce){#wanted span.new{animation:none}}

/* Quests, nitro, drift, paint */
#quest{position:fixed;top:110px;left:22px;z-index:3;max-width:320px;background:#0b1426e6;border:3px solid #000;border-left:8px solid var(--q,#ffd400);border-radius:10px;padding:9px 12px;box-shadow:4px 4px #000;display:grid;gap:3px;font-size:13px}
#quest b{font-family:'Bungee',sans-serif;font-size:13px;color:var(--q,#ffd400)}#quest em{font-style:normal;font-size:11px;color:#b6d7df}#quest.active{animation:questin .4s}#quest.active em{color:#fff;font-family:'Bungee',sans-serif;font-size:13px}
#questCancel{justify-self:start;font-size:9px;padding:5px 8px;margin-top:4px}
@keyframes questin{from{transform:translateX(-30px);opacity:0}}
#mobilebtns{position:fixed;left:22px;bottom:250px;display:flex;flex-direction:column;gap:8px;z-index:4}
#nitroBtn{background:#ff7f11;color:#111;font-size:12px}#nitroBtn.on{background:#fff6a0;animation:safepulse .3s infinite}
#driftBtn{display:none;background:#ff2f8e;width:84px;height:84px;border-radius:50%;font-size:13px;touch-action:none}#driftBtn.on{background:#fff;color:#111}
.garageshop{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:10px}.garageshop span{font-size:12px;color:#b6b9c9}#buyNitro{background:#ff7f11;color:#111;font-size:13px}
.paints{display:flex;flex-wrap:wrap;gap:5px;align-items:center;margin-top:9px}.paints span{font-family:'Bungee',sans-serif;font-size:9px;width:100%;color:#c4c7d4}
.swatch{width:22px;height:22px;padding:0;border-radius:50%;border:2px solid #000;box-shadow:2px 2px #000}.swatch.on{outline:3px solid #fff;outline-offset:1px}.swatch:disabled{opacity:1;cursor:default}
@media (hover:none),(max-width:700px){#driftBtn{display:block;position:fixed;right:18px;bottom:250px}}
@media(max-width:700px){#quest{top:128px;left:8px;max-width:190px;font-size:10px;padding:6px 8px;border-left-width:6px}#quest b,#quest.active em{font-size:10px}#mobilebtns{left:auto;right:18px;bottom:380px}#driftBtn{bottom:285px}}

#garageTag{margin:4px 0 0;color:#c4c7d4;font-size:13px}.garsec{grid-column:1/-1;font-family:'Bungee',sans-serif;font-size:13px;margin:6px 0 0;color:var(--gar,#ffd400)}

.modes{display:flex;gap:10px;flex-wrap:wrap;margin:8px 0 10px}#startNormal,#startHard{font-size:17px;padding:14px 22px}#startNormal{background:#ffe600;color:#111}#startHard{background:#ff2f5f;color:#fff}
#modeBtn{font-size:11px;padding:7px 12px;background:#102235}#modeBtn.hard{background:#ff2f5f}
#bigTimer{font-family:'Bungee',sans-serif;font-size:44px;color:#fff;-webkit-text-stroke:2px #000;paint-order:stroke fill;text-shadow:0 4px 0 #000,0 0 18px var(--q,#ffd400)}
#bigTimer.urgent{color:#ff3b5c;animation:tick .5s steps(2) infinite}@keyframes tick{50%{transform:scale(1.15)}}
.lbtabs{display:flex;gap:8px;margin:6px 0 10px}.lbtabs button.on{background:#ffe600;color:#111}
@media(max-width:700px){#bigTimer{font-size:28px}#modeBtn{font-size:8px;padding:5px 8px}}

#respect{display:block;font-family:'Bungee',sans-serif;font-size:11px;color:#ffd400}
#mission{position:fixed;left:50%;top:36%;transform:translate(-50%,-50%);text-align:center;z-index:7;pointer-events:none;animation:mpop .5s cubic-bezier(.2,1.8,.4,1)}
#mission h2{font-family:'Luckiest Guy',cursive;font-size:clamp(46px,8vw,96px);margin:0;color:#ffd400;-webkit-text-stroke:3px #000;paint-order:stroke fill;text-shadow:0 6px 0 #000,0 0 30px #ffb000}
#mission.failed h2{color:#ff3b5c;text-shadow:0 6px 0 #000,0 0 30px #ff3b5c}
#missionLines div{font-family:'Bungee',sans-serif;font-size:clamp(16px,2.4vw,26px);color:#fff;-webkit-text-stroke:1.5px #000;paint-order:stroke fill;text-shadow:0 3px 0 #000;margin-top:6px}
#missionLines div:nth-child(2){color:#79efa9}#missionLines div:nth-child(3){color:#ffd400}
@keyframes mpop{from{transform:translate(-50%,-50%) scale(2.4);opacity:0}}

/* Build 11: left control panel, centred district name, big radio, quest offer */
#left{position:fixed;top:14px;left:16px;width:300px;display:flex;flex-direction:column;gap:10px;z-index:3;max-height:calc(100dvh - 120px);overflow:auto}
#left header{position:static;pointer-events:none}
#left #quest{position:static;max-width:none}
#howto{background:#0b1426e6;border:3px solid #000;border-radius:10px;padding:9px 11px;box-shadow:4px 4px #000;font-size:12px}
#howto b{font-family:'Bungee',sans-serif;font-size:12px;color:#00d9e6}#howto ul{list-style:none;margin:6px 0;padding:0;display:grid;gap:5px}#howto li{display:flex;align-items:center;gap:8px}#howto kbd{min-width:62px;text-align:center;font-size:10px}#howto p{margin:4px 0 0;font-size:11px;color:#c4c7d4;line-height:1.4}
.leftbtns{display:grid;grid-template-columns:1fr 1fr;gap:7px}.leftbtns button{font-size:10px;padding:9px 8px}
#left #policeToggle{grid-column:1/-1;font-size:13px;padding:10px}#left #modeBtn{grid-column:1/-1}
#area{left:50%!important;right:auto!important;top:24%!important;bottom:auto!important;transform:translateX(-50%);text-align:center!important;font-size:clamp(34px,5vw,64px)!important;max-width:90vw!important;white-space:normal;line-height:1.05;text-wrap:balance}
#music{font-size:17px!important;padding:14px 22px!important;background:linear-gradient(90deg,#ffe600,#ff9b1a);color:#111;box-shadow:4px 4px #000}
#soundbar{padding:9px 14px;gap:14px}#soundbar input{width:130px}
#offer{width:min(520px,92vw);border-color:var(--q,#ffd400);text-align:center}#offer h2{color:var(--q,#ffd400);font-size:44px;text-shadow:3px 3px #000;margin:6px 0}#offer p{font-size:18px;line-height:1.45}
.offerbtns{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}#offerAccept{background:#59d98e;color:#0b2416;font-size:15px;padding:13px 20px}#offerDecline{font-size:13px}
@media(max-width:700px){#left{width:180px;top:110px;left:8px;gap:6px;max-height:calc(100dvh - 330px)}#left header,#howto{display:none}.leftbtns{grid-template-columns:1fr}.leftbtns button{font-size:8px;padding:6px}#left #policeToggle{font-size:9px;padding:6px}#left #quest{font-size:10px}
  #area{font-size:26px!important;top:30%!important}#music{font-size:11px!important;padding:9px 12px!important}#soundbar input{width:55px}#offer h2{font-size:30px}#offer p{font-size:15px}}
@media(max-width:700px){#left{top:64px;width:170px;max-height:calc(100dvh - 360px)}#left #quest:not(.active){display:none}.leftbtns{grid-template-columns:1fr 1fr;gap:4px}.leftbtns button{font-size:7px;padding:6px 4px}#left #policeToggle small{display:none}
  #area{white-space:normal!important;font-size:22px!important;width:90vw;top:20%!important}}

#stickBtn{display:none;grid-column:1/-1}
@media (hover:none),(max-width:700px){#stickBtn{display:block}
  body.stick-right #joystick{left:auto;right:22px}body.stick-right #driftBtn{right:auto;left:18px}body.stick-right #mobilebtns{right:auto;left:18px}
  body.stick-left #joystick{right:auto;left:22px}body.stick-left #driftBtn{left:auto;right:18px}body.stick-left #mobilebtns{left:auto;right:18px}}
@media(max-width:700px){body.stick-right #left{max-height:calc(100dvh - 400px)}}

.mqhead{font-family:'Bungee',sans-serif;font-size:18px;margin:16px 0 8px;color:#ffe600}
#mapQuests{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px}
.qcard{display:grid;grid-template-columns:62px 1fr;grid-template-rows:auto auto auto;column-gap:10px;text-align:left;background:#0b1426;border:3px solid #000;border-left:10px solid var(--q);padding:12px;box-shadow:4px 4px #000;font-family:Arial,sans-serif;letter-spacing:0}
.qcard .qicon{grid-row:1/4;font-size:44px;line-height:1;align-self:center}.qcard b{font-family:'Bungee',sans-serif;font-size:14px;color:var(--q)}.qcard .qtext{font-size:14px;color:#fff;font-weight:normal;margin:3px 0}.qcard em{font-style:normal;font-size:12px;color:#b6d7df}
.qcard.active{background:#1d2a12;outline:3px solid var(--q)}.qcard:hover{background:#1a2a44;color:inherit}
#justRead{display:block;width:100%;margin-top:12px;background:#00d9e6;color:#111;font-size:14px;padding:13px}

/* Four equal start buttons */
.modes{display:grid!important;grid-template-columns:repeat(4,1fr);gap:10px;margin:10px 0 12px}
.modes button{display:flex;flex-direction:column;align-items:center;gap:4px;padding:14px 8px!important;font-size:15px!important;color:#111!important;border:3px solid #000;box-shadow:4px 4px #000}
.modes button small{margin:0;font-family:Arial,sans-serif;font-size:10px;color:#222;font-weight:bold}
#startEasy{background:#59d98e!important}#startNormal{background:#ffe600!important}#startHard{background:#ff2f5f!important}#startHard b,#startHard small{color:#fff}#readOnly{background:#00d9e6!important}
.introcard{max-width:640px!important}
#left #policeToggle{display:none}#modeBtn.easy{background:#59d98e;color:#0b2416}
@media(max-width:700px){.modes{grid-template-columns:1fr 1fr}}

/* Action prompt sits right under the car in the middle of the screen. */
#prompt{top:calc(50% + 56px)!important;bottom:auto!important;left:50%!important;transform:translateX(-50%)!important;padding:8px 12px!important;min-width:0!important;max-width:min(560px,92vw)}#prompt strong{font-size:12px;margin-bottom:6px}#enter{font-size:13px;padding:10px 18px}

#menuDlg{width:min(820px,96vw);border-color:#e01e2b;background:#1a0d0d}#menuDlg h2{color:#ffd400;font-size:38px}
#menuCards{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.menucard{background:#fff8ec;color:#2b1a12;border:4px solid #b3121f;border-radius:10px;padding:16px;box-shadow:5px 5px #000}
.menucard h3{margin:0;font-family:'Bungee',sans-serif;font-size:22px;color:#b3121f}.menucard.zh h3{font-family:'Noto Sans SC','PingFang SC','Microsoft YaHei',sans-serif;font-size:30px;letter-spacing:4px}
.menucard p{margin:4px 0 10px;font-size:13px;color:#6b4a3a}.menucard ul{list-style:none;padding:0;margin:0 0 12px}.menucard li{display:flex;justify-content:space-between;gap:10px;padding:7px 0;border-bottom:1px dashed #d8b9a0;font-size:16px}
.menucard.zh li{font-size:19px;font-family:'Noto Sans SC','PingFang SC','Microsoft YaHei',sans-serif}.menucard button{width:100%;background:#b3121f;color:#ffd400;font-size:16px}.menucard.zh button{font-family:'Noto Sans SC','PingFang SC','Microsoft YaHei',sans-serif;font-size:20px}
@media(max-width:700px){#menuCards{grid-template-columns:1fr}}

#golfDlg{width:min(720px,96vw);border-color:#59d98e;text-align:center}#golfDlg h2{color:#59d98e;margin:4px 0 10px}#golfCanvas{width:100%;max-width:640px;aspect-ratio:16/10;border:4px solid #000;border-radius:10px;touch-action:none;cursor:crosshair;background:#3f7d34}#golfInfo{font-family:'Bungee',sans-serif;font-size:14px}

.carnums{font-family:'Bungee',sans-serif;font-size:10px!important;color:#ffd400!important;min-height:0!important;margin:6px 0 0!important}

.mapwrap{align-items:start}.mapleft{display:flex;flex-direction:column;gap:12px;min-width:0}
#mapList{max-height:min(78dvh,760px);overflow:auto;padding-right:4px}
.mqpanel{background:linear-gradient(135deg,#2a1640,#13223b);border:3px solid #ffe600;border-radius:12px;padding:10px 12px 12px;box-shadow:5px 5px #000}
.mqpanel .mqhead{margin:0 0 8px}#mapQuests{grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:9px}
.qcard{padding:9px 10px;grid-template-columns:48px 1fr}.qcard .qicon{font-size:34px}.qcard b{font-size:12px}.qcard .qtext{font-size:12px}.qcard em{font-size:11px}
#bigmap{padding:16px 20px}#bigmap .maphead h2{font-size:30px}
#mapCanvas{width:100%;max-width:calc(56dvh * 100 / 76);align-self:center}
.mapleft{gap:10px}

#continueBtn{display:flex;flex-direction:column;align-items:center;gap:4px;width:100%;margin:6px 0 4px;background:linear-gradient(90deg,#00d9e6,#59d98e);color:#111;font-size:17px;padding:14px;border:3px solid #000;box-shadow:4px 4px #000}#continueBtn[hidden]{display:none}#continueBtn small{margin:0;font-family:Arial,sans-serif;font-weight:bold;font-size:12px;color:#123}
/* Bigger start buttons */
.modes{gap:14px!important}.modes button{padding:22px 10px!important;min-height:110px;gap:8px!important}
.modes button b{font-size:22px}.modes button small{font-size:13px!important;line-height:1.3}
.introcard{max-width:780px!important}
@media(max-width:700px){.modes button{min-height:84px;padding:14px 8px!important}.modes button b{font-size:16px}.modes button small{font-size:11px!important}}

/* build 21: special car missions on the map */
#mapQuests .qcard.special{border:3px solid #ffd400;box-shadow:0 0 0 3px #000,0 0 22px #ffd40099;animation:specialPulse 1.4s ease-in-out infinite}
@keyframes specialPulse{50%{box-shadow:0 0 0 3px #000,0 0 34px #ffd400}}
#area.show{max-width:min(820px,90vw)}

/* build 23: bigger garage actions */
#buyNitro{font-family:Bungee,Arial,sans-serif!important;font-size:clamp(17px,2.2vw,24px)!important;padding:16px 28px!important;border-radius:14px;border:3px solid #000;box-shadow:0 5px 0 #000;letter-spacing:.03em;min-height:64px}
#buyNitro:not(:disabled){background:#ff7f11!important;color:#111!important}
#closeGarage{font-family:Bungee,Arial,sans-serif!important;font-size:clamp(17px,2vw,22px)!important;padding:14px 26px!important;min-height:58px;border-radius:14px;border:3px solid #000;box-shadow:0 5px 0 #000;background:#ffd400!important;color:#111!important}
.garageshop{gap:16px}.garageshop span{font-size:14px}

/* ===== build 24: mobile UI rebuild (body.mobile-ui) ===== */
#mMenu,#msheet{display:none}
body.mobile-ui #left{position:fixed!important;top:calc(env(safe-area-inset-top) + 8px)!important;left:8px!important;width:auto!important;max-width:calc(100vw - 150px)!important;padding:0!important;background:none!important;border:0!important;box-shadow:none!important;pointer-events:none;max-height:none!important;overflow:visible!important}
body.mobile-ui #left>header,body.mobile-ui #howto,body.mobile-ui .leftbtns{display:none!important}
body.mobile-ui #quest{pointer-events:auto;margin:0!important;padding:6px 9px!important;border-radius:10px!important;font-size:11px!important;line-height:1.25;background:rgba(10,12,24,.82)!important;max-width:100%}
body.mobile-ui #quest:not(.active){display:none!important}
body.mobile-ui #quest b{font-size:11px!important}body.mobile-ui #quest em{font-size:10px!important}
body.mobile-ui #questCancel{padding:4px 8px!important;font-size:10px!important;margin-top:4px}
body.mobile-ui .hud{position:fixed!important;top:calc(env(safe-area-inset-top) + 8px)!important;right:8px!important;left:auto!important;bottom:auto!important;padding:5px 10px!important;min-width:0!important;border-radius:12px!important;text-align:right}
body.mobile-ui .hud #cash{font-size:22px!important}
body.mobile-ui .hud small{font-size:10px!important;display:block}
body.mobile-ui .hud #coinTimer{display:none!important}
body.mobile-ui .hud #progress{font-size:10px!important;padding:2px 6px!important;margin-top:2px!important}
body.mobile-ui #center{top:calc(env(safe-area-inset-top) + 6px)!important;left:50%!important;transform:translateX(-50%)!important;align-items:center!important}
body.mobile-ui #wanted{transform:scale(.62);transform-origin:top center}
body.mobile-ui #area{font-size:20px!important;top:26%!important;width:86vw}
body.mobile-ui #soundbar{display:none!important}
body.mobile-ui #msheet:not([hidden]){display:grid;position:fixed;inset:0;z-index:60;background:rgba(0,0,0,.6);place-items:end center}
body.mobile-ui .msheetin{width:100%;max-width:520px;background:#12162a;border-top:3px solid #ffd400;border-radius:20px 20px 0 0;padding:16px 16px calc(16px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:10px}
body.mobile-ui .msheetin>b{font-family:Bungee,Arial;color:#ffd400;font-size:16px}
body.mobile-ui #msheetSlot{display:flex;flex-direction:column;gap:10px}
body.mobile-ui #msheetSlot button{width:100%;min-height:48px;font-size:14px}
body.mobile-ui #msheetSlot #soundbar{display:flex!important;position:static!important;transform:none!important;width:auto!important;flex-wrap:wrap;gap:10px;padding:10px!important;margin:0!important;box-shadow:none!important}
body.mobile-ui #msheetSlot #soundbar #music{display:none}
body.mobile-ui #msheetSlot #soundbar label{flex:1 1 40%;display:flex;align-items:center;gap:6px;font-size:18px}
body.mobile-ui #msheetSlot #soundbar input{width:100%}
body.mobile-ui #msheetClose{min-height:50px;background:#ffd400;color:#111;font-family:Bungee,Arial;font-size:16px;border:3px solid #000;border-radius:12px}
body.mobile-ui #joystick{bottom:calc(env(safe-area-inset-bottom) + 24px)!important;width:150px!important;height:150px!important}
body.mobile-ui #driftBtn{width:86px!important;height:86px!important;bottom:calc(env(safe-area-inset-bottom) + 40px)!important}
body.mobile-ui #mobilebtns{bottom:calc(env(safe-area-inset-bottom) + 140px)!important}
body.mobile-ui #nitroBtn{min-height:48px;font-size:13px!important}
body.mobile-ui #prompt{top:auto!important;bottom:calc(env(safe-area-inset-bottom) + 200px)!important}
body.mobile-ui #unranked{font-size:9px!important}
/* intro on phones: no keyboard legend, only the start choices */
body.mobile-ui #intro .controls,body.mobile-ui #intro .rule{display:none!important}
body.mobile-ui #intro .introcard{padding:20px 16px!important;max-height:100svh;overflow:auto}
body.mobile-ui #intro h2{font-size:clamp(30px,9vw,44px)!important;margin:6px 0 14px!important}
body.mobile-ui #intro .modes{grid-template-columns:1fr 1fr!important;gap:10px!important}
body.mobile-ui #intro .modes button{min-height:96px!important;padding:12px 8px!important}
body.mobile-ui #intro .modes b{font-size:18px!important}body.mobile-ui #intro .modes small{font-size:12px!important}
body.mobile-ui #continueBtn{min-height:80px!important;margin-bottom:12px!important}
body.mobile-ui.playing #mMenu{display:block;position:fixed;z-index:20;right:6px;top:220px;height:44px;border-radius:12px;border:3px solid #000;background:#ffd400;color:#111;font-family:Bungee,Arial,sans-serif;font-size:14px;box-shadow:0 4px 0 #000;padding:0 8px}
body.mobile-ui #msheetSlot #soundbar #music{display:block!important;width:100%;min-height:48px}
body.mobile-ui #msheetSlot #menu{background:#00d9e6;color:#111}
body.mobile-ui #msheetSlot #leaderButton{background:#ffd400;color:#111}
body.mobile-ui #msheetSlot{max-height:70svh;overflow:auto}
body.mobile-ui #quest{max-width:min(58vw,260px)!important}
body.mobile-ui #center{left:50%!important}
body.mobile-ui #area{top:36%!important}
body.mobile-ui #safe{font-size:11px!important;padding:5px 9px!important;max-width:52vw}
body.mobile-ui #unranked{max-width:52vw}
/* build 26: phone HUD top-left, radar top-right */
:root{--sat:env(safe-area-inset-top,0px)}
body.mobile-ui .hud{left:8px!important;right:auto!important;text-align:left!important}
body.mobile-ui #left{top:calc(env(safe-area-inset-top) + 96px)!important;max-width:calc(100vw - 180px)!important}
body.mobile-ui #center{left:calc(50% - 20px)!important}
/* build 27: phone-only top-left action bar + readable mission cards */
#mbar{display:none}
body.mobile-ui.playing #mbar{display:flex;position:fixed;z-index:20;left:8px;top:calc(env(safe-area-inset-top) + 96px);gap:6px}
body.mobile-ui.playing #mMenu{display:block;position:static!important;width:auto!important;top:auto!important;right:auto!important}
body.mobile-ui #mbar button{height:40px;padding:0 10px;border-radius:11px;border:3px solid #000;font-family:Bungee,Arial,sans-serif;font-size:12px;box-shadow:0 3px 0 #000;white-space:nowrap}
body.mobile-ui #mRadio{background:#151a2c;color:#fff}
body.mobile-ui #mRadio.on{background:#ff2f8e;color:#fff}
body.mobile-ui #left{top:calc(env(safe-area-inset-top) + 146px)!important}
body.mobile-ui #msheetSlot #soundbar #music{display:none!important}
body.mobile-ui #mission{top:46%!important;width:min(92vw,420px);z-index:40;background:rgba(8,10,20,.9);border:3px solid #ffd400;border-radius:18px;padding:14px 12px 16px;box-shadow:0 6px 0 #000,0 0 40px rgba(0,0,0,.6)}
body.mobile-ui #mission.failed{border-color:#ff3b5c}
body.mobile-ui #mission h2{font-size:clamp(34px,11vw,48px)!important;-webkit-text-stroke:2px #000;text-shadow:0 4px 0 #000;line-height:1}
body.mobile-ui #mission.failed h2{text-shadow:0 4px 0 #000}
body.mobile-ui #missionLines div{font-size:15px!important;-webkit-text-stroke:0;text-shadow:none;margin-top:8px;line-height:1.25}
body.mobile-ui,body.mobile-ui *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
body.mobile-ui input,body.mobile-ui textarea{-webkit-user-select:text;user-select:text}
/* build 35: chat bottom-left */
#chat{position:fixed;left:14px;bottom:14px;z-index:15;width:min(420px,40vw);pointer-events:none;font-family:Arial,sans-serif}
#chatLog{list-style:none;margin:0 0 6px;padding:0;display:flex;flex-direction:column;gap:3px}
#chatLog li{background:rgba(6,8,16,.66);color:#fff;font-size:14px;line-height:1.3;padding:4px 8px;border-radius:6px;text-shadow:0 1px 0 #000;word-break:break-word;width:fit-content;max-width:100%}
#chatLog li b{color:#ffd400;font-weight:800}#chatLog li.sys b{color:#59d98e}#chatLog li.sys{color:#c9ffd9}
#chatInput{pointer-events:auto;width:100%;box-sizing:border-box;font:15px Arial,sans-serif;padding:9px 11px;border-radius:8px;border:2px solid #ffd400;background:rgba(6,8,16,.92);color:#fff;outline:none}
body.chatting #chatLog li{background:rgba(6,8,16,.85)}
body.stick-left:not(.mobile-ui) #chat{left:auto;right:14px}
#mChat{display:none}
body.mobile-ui.playing #mChat{display:block;background:#151a2c;color:#fff}
body.mobile-ui #chat{left:8px;bottom:calc(env(safe-area-inset-bottom) + 150px);width:min(58vw,280px)}
body.mobile-ui #chatLog li{font-size:12px;padding:3px 7px}
body.mobile-ui.chatting #chat{top:calc(env(safe-area-inset-top) + 60px);width:calc(100vw - 16px);z-index:45}
body.mobile-ui #left{top:calc(env(safe-area-inset-top) + 146px)!important}
#eggDlg{border:5px solid #000;border-radius:24px;background:#3ee07a;padding:0;box-shadow:0 10px 0 #000}
#eggDlg::backdrop{background:rgba(0,0,0,.6)}
#eggDlg .egg{display:flex;flex-direction:column;align-items:center;gap:18px;padding:36px 60px}
#eggDlg b{font-family:'Luckiest Guy','Bungee',cursive;font-size:clamp(64px,14vw,140px);color:#fff;-webkit-text-stroke:4px #000;paint-order:stroke fill;text-shadow:0 8px 0 #000;line-height:1}
#eggClose{font-family:Bungee,Arial;font-size:20px;padding:12px 34px;border:4px solid #000;border-radius:14px;background:#ffd400;box-shadow:0 5px 0 #000;cursor:pointer}
/* build 41: phone top-left column, all the same width, nothing overlaps */
body.mobile-ui .hud{width:132px!important;box-sizing:border-box;padding:6px 10px!important}
body.mobile-ui .hud #progress{position:static!important;display:block;margin:4px 0 0!important;white-space:nowrap}
body.mobile-ui.playing #mbar{flex-direction:column;width:132px;gap:6px;left:8px}
body.mobile-ui #mbar button{width:100%!important;height:38px;font-size:12px;display:block}
body.mobile-ui #left{max-width:min(60vw,240px)!important}
html,body{touch-action:manipulation;-webkit-text-size-adjust:100%}
#city,#joystick,#driftBtn,#mobilebtns,#mbar,.hud{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
body.mobile-ui button{-webkit-tap-highlight-color:transparent}
body.mobile-ui #chatInput{font-size:16px}
/* build 42: page never scrolls on phones; round nitro right above drift */
body.mobile-ui{position:fixed;inset:0;overflow:hidden;overscroll-behavior:none;height:100%}
html:has(body.mobile-ui){overflow:hidden;height:100%;overscroll-behavior:none}
body.mobile-ui #nitroBtn{position:fixed!important;width:76px!important;height:76px!important;min-height:0!important;border-radius:50%!important;border:4px solid #000!important;box-shadow:0 5px 0 #000;padding:0!important;font-family:Bungee,Arial,sans-serif;font-size:15px!important;bottom:calc(env(safe-area-inset-bottom) + 142px)!important;z-index:6}
body.mobile-ui.stick-right #nitroBtn{left:23px!important;right:auto!important}
body.mobile-ui.stick-left #nitroBtn{right:23px!important;left:auto!important}
body.mobile-ui .hud{align-items:stretch!important;padding:0!important}body.mobile-ui .hud .money{box-sizing:border-box;width:100%}body.mobile-ui .hud #progress{text-align:center}
/* build 43: phones hide the stop counter; RÁDIO + CHAT share one row, MENU below */
body.mobile-ui .hud #progress{display:none!important}
body.mobile-ui.playing #mbar{flex-direction:row!important;flex-wrap:wrap;width:132px}
body.mobile-ui #mbar #mRadio,body.mobile-ui #mbar #mChat{width:calc(50% - 3px)!important;padding:0;font-size:20px;line-height:1}
body.mobile-ui #mbar #mMenu{width:100%!important;flex-basis:100%}
/* build 44: phone MENU opens as a dropdown under the button */
body.mobile-ui #msheet:not([hidden]){display:block!important;position:fixed;inset:0;z-index:60;background:transparent}
body.mobile-ui .msheetin{position:fixed;left:8px;top:var(--ddTop,160px);width:min(78vw,300px);max-width:none;border:3px solid #000;border-top:3px solid #000;border-radius:14px;padding:10px;box-shadow:0 8px 0 #000,0 12px 30px rgba(0,0,0,.5);background:#12162a;gap:8px;max-height:calc(100svh - var(--ddTop,160px) - 20px);overflow:auto;animation:ddIn .14s ease-out}
@keyframes ddIn{from{opacity:0;transform:translateY(-8px)}}
body.mobile-ui .msheetin>b{display:none}
body.mobile-ui #msheetSlot{max-height:none;gap:8px}
body.mobile-ui #msheetSlot button{min-height:44px;font-size:13px;border-radius:10px}
body.mobile-ui #msheetClose{min-height:40px;font-size:13px}
body.mobile-ui #mMenu.open{background:#fff}
/* build 46: phone arrest meter sits under the car, clear of the top column and radar */
body.mobile-ui #bustMeter{position:fixed!important;top:60%!important;left:50%!important;transform:translateX(-50%)!important;width:min(62vw,240px)!important;z-index:12;margin:0!important;box-sizing:border-box}
/* build 47: structured quest offers */
#offer h2{margin-bottom:2px}
#offerHead{font-family:'Luckiest Guy','Bungee',cursive;color:#fff;font-size:22px;letter-spacing:.02em;text-shadow:2px 2px 0 #000;margin:4px 0 10px;line-height:1.1}
#offerBold{font-weight:900;color:#fff;margin-top:-4px}
#offerReward{margin:6px auto 16px;display:inline-block;padding:10px 16px;border:3px solid #000;border-radius:12px;background:#3ee07a;color:#0b1a10;font-family:Bungee,Arial,sans-serif;font-size:15px;box-shadow:0 4px 0 #000;letter-spacing:.02em}
body.mobile-ui #offerHead{font-size:19px}body.mobile-ui #offerReward{font-size:12px;padding:8px 12px}

/* build 51: phone top-centre strip = small stars + quest timer only */
#mTop{display:none}
body.mobile-ui.playing #mTop{display:flex;flex-direction:column;align-items:center;position:fixed;top:calc(env(safe-area-inset-top,0px) + 8px);left:50%;transform:translateX(-50%);z-index:11;pointer-events:none;gap:2px}
body.mobile-ui #mTop #wanted{transform:none!important;font-size:17px!important;min-height:0!important;gap:1px!important;margin:0!important}
body.mobile-ui #mTop #wanted span{-webkit-text-stroke:1.5px #000;text-shadow:0 2px 0 #000,0 0 8px #4d8dff}
body.mobile-ui #mTop #bigTimer{font-size:24px!important;margin:0!important;-webkit-text-stroke:1.5px #000;text-shadow:0 3px 0 #000}
body.mobile-ui #quest{display:none!important}
body.mobile-ui #safe{display:none!important}
/* build 52: stars readable on phone */
body.mobile-ui #mTop #wanted{font-size:21px!important;gap:0!important;padding:3px 7px 4px!important;border-radius:12px;background:rgba(10,12,24,.82);box-shadow:0 0 0 2px #000,0 3px 0 #000}
body.mobile-ui #mTop #wanted span{-webkit-text-stroke:1.5px #000;text-shadow:0 0 6px #9fd4ff,0 0 12px #4d8dff}
body.mobile-ui #mTop #wanted:empty{display:none}

/* build 53: special quest navigation button */
#sqBtn{position:fixed;left:50%;bottom:118px;transform:translateX(-50%);z-index:12;font:15px Bungee,Arial,sans-serif;color:#111;background:var(--c,#ffd400);border:3px solid #000;border-radius:12px;padding:10px 16px;box-shadow:0 5px 0 #000;cursor:pointer;animation:sqPulse 1.2s ease-in-out infinite;white-space:nowrap}
#sqBtn[hidden]{display:none}
@keyframes sqPulse{50%{transform:translateX(-50%) scale(1.05)}}
body.mobile-ui #sqBtn{top:calc(env(safe-area-inset-top,0px) + 80px);bottom:auto;font-size:12px;padding:6px 10px;border-width:2px;box-shadow:0 3px 0 #000}
@media(prefers-reduced-motion:reduce){#sqBtn{animation:none}}
#sqBtn{background:#ffd400!important;box-shadow:0 0 0 3px var(--c,#ffd400),0 5px 0 3px #000}
body.mobile-ui #sqBtn{left:var(--sqL,8px);width:var(--sqW,132px);transform:none;top:var(--sqT,176px);animation:sqPulseM 1.2s ease-in-out infinite;box-shadow:0 3px 0 #000}
@keyframes sqPulseM{50%{filter:brightness(1.15)}}

body.mobile-ui #unranked{display:none!important}

/* build 58: no zoom from taps on game controls */
body.mobile-ui #mobilebtns *,body.mobile-ui #driftBtn,body.mobile-ui #nitroBtn,body.mobile-ui #joystick,body.mobile-ui #city{touch-action:none!important}
body.mobile-ui button,body.mobile-ui #mbar *{touch-action:manipulation}

/* build 61: desktop left panel = quest + one MENU dropdown */
#dMenu{display:none}
body:not(.mobile-ui) #dMenu{display:block;font:14px Bungee,Arial,sans-serif;background:#ffd400;color:#111;border:3px solid #000;border-radius:12px;padding:9px 12px;box-shadow:0 4px 0 #000;cursor:pointer;text-align:left}
body:not(.mobile-ui) #dMenu[aria-expanded=true]{background:#fff}
body:not(.mobile-ui) #dDrop{display:none;flex-direction:column;gap:10px}
body:not(.mobile-ui).dmenu-open #dDrop{display:flex}
body.mobile-ui #dDrop{display:contents}
/* build 66: desktop dropdown bigger and readable; newsletter button as big as the mode button */
body:not(.mobile-ui).dmenu-open #left{width:380px}
body:not(.mobile-ui) #dDrop #quest{font-size:16px;padding:14px 16px}
body:not(.mobile-ui) #dDrop #quest #qTitle{font-size:16px}
body:not(.mobile-ui) #dDrop #quest #qMeta{font-size:13px}
body:not(.mobile-ui) #dDrop #howto{font-size:15px;padding:14px 16px}
body:not(.mobile-ui) #dDrop #howto b{font-size:16px}
body:not(.mobile-ui) #dDrop #howto ul{gap:9px;margin:10px 0}
body:not(.mobile-ui) #dDrop #howto kbd{min-width:84px;font-size:13px;padding:5px 8px}
body:not(.mobile-ui) #dDrop #howto p{font-size:13px}
body:not(.mobile-ui) #dDrop .leftbtns button{font-size:14px;padding:13px 10px}
body:not(.mobile-ui) #dDrop #menu{grid-column:1/-1;order:-1;font-size:18px;padding:16px 12px;background:#00d9e6;color:#111}
body:not(.mobile-ui) #dMenu{font-size:16px;padding:12px 14px}
/* Readable type in garages and the map: Bungee stays only for big headlines. */
#garage .carcard h3,#garage .price,#garage .garsec,#garage .carnums,#garage button,#garage .stat,#bigmap #mapList,#bigmap #mapList button,#bigmap .qcard{font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif!important;letter-spacing:0!important;text-transform:none}
#garage .carcard h3{font-size:17px;font-weight:800}
#garage .price{font-size:13px;font-weight:800}
#garage .garsec{font-size:15px;font-weight:800;text-transform:uppercase;letter-spacing:.04em!important}
#garage .carnums{font-size:13px!important;font-weight:700}
#garage .buy{font-size:15px;font-weight:800}
/* Fake loading screen with the GGK 6 key visual. */
#loading{position:fixed;inset:0;z-index:2147483000;background:#14051f;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:opacity .55s ease}
#loading.done{opacity:0;pointer-events:none}
#loading .ldbg{position:absolute;inset:-40px;background:url(loading-blur.jpg) center/cover;filter:blur(30px) saturate(1.3);opacity:.85}
#loading img{position:relative;height:100%;width:100%;object-fit:contain;max-width:100vw}
#loading .ldbar{position:absolute;left:50%;bottom:44px;transform:translateX(-50%);width:min(420px,70vw);height:12px;border:3px solid #000;border-radius:8px;background:#0b1426;box-shadow:3px 3px #ff239b;overflow:hidden}
#loading .ldbar i{display:block;height:100%;width:0;background:linear-gradient(90deg,#ff4fd8,#ffb347)}
#loading .ldtxt{position:absolute;left:50%;bottom:16px;transform:translateX(-50%);font:12px Bungee,Arial,sans-serif;color:#fff;letter-spacing:.2em;text-shadow:2px 2px #000}
/* Agency billboard video, laid over the canvas at the billboard position. */
#billboardVideo{position:fixed;left:0;top:0;z-index:1;border:0;pointer-events:none;background:#000;overflow:hidden;contain:strict}

.cf-toggle{display:flex;gap:.5rem;align-items:center;justify-content:center;margin:.8rem auto 0;font-size:.85rem;color:#ffe08a;cursor:pointer;user-select:none}.cf-toggle input{width:1.1rem;height:1.1rem;accent-color:#e8c15a}.money #klince{color:#ffd400}

#startCF{background:#e8c15a!important}
/* GGK 6 title: bigger, the 6 sits next to GGK */
header h1{font-size:46px!important;line-height:1!important;white-space:nowrap}
header h1 span{display:inline!important;font-size:52px!important;margin-left:6px}

.agencylinks{display:flex;gap:10px;flex-wrap:wrap;margin:10px 0 14px}.agencylinks a{font:bold 14px Bungee,Arial;padding:10px 14px;border:3px solid #000;border-radius:10px;background:#fff;color:#111;text-decoration:none;box-shadow:3px 3px 0 #000}.agencylinks a:hover{background:var(--gar,#ffe600)}
/* Agency dialog: readable links, formatted nitro and tuning */
.agencylinks a{font:800 15px/1 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif!important;letter-spacing:.02em;text-transform:uppercase;padding:12px 18px;display:inline-flex;align-items:center;gap:8px}
#garage #buyNitro,#garage #closeGarage{font-weight:900!important;text-transform:uppercase;letter-spacing:.02em!important}
#garage #buyNitro small{display:block;font-size:12px;font-weight:700;opacity:.75;text-transform:none}
.tunebox{margin:6px 0 14px;padding:14px 16px;border:3px solid #000;border-radius:14px;background:#14161f;box-shadow:0 5px 0 #000}
.tunebox h4{margin:0 0 4px;font:900 17px system-ui,-apple-system,Arial,sans-serif;text-transform:uppercase;color:var(--gar,#ffd400)}
.tunebox p{margin:0 0 10px;font-size:13px;color:#c4c7d4}
.tunebox .tunes{display:flex;flex-wrap:wrap;gap:5px;margin-top:10px}.tunebox .tunes span{font:700 11px system-ui,Arial,sans-serif;padding:4px 7px;border-radius:6px;background:#262a38;color:#7d8296}.tunebox .tunes span.on{background:#3ee07a;color:#06210f}
.tunebox button{font-weight:900!important;text-transform:uppercase;font-size:15px!important;padding:12px 18px!important;border:3px solid #000;border-radius:12px;box-shadow:0 4px 0 #000;background:#ffd400!important;color:#111!important}
.tunebox button:disabled{opacity:.55}
#miniBtns button.on{outline:3px solid #ffd400;outline-offset:2px}
/* MLGGK car park CV form */
.cvform{display:grid;gap:10px;max-width:560px;font:15px system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:#f1f1f1}
.cvform .cvlead,.cvlead{margin:0 0 4px;font:600 16px/1.4 system-ui,-apple-system,Arial,sans-serif;color:#ffe9a6}
.cvform label{display:grid;gap:5px;font-weight:700;font-size:13px;text-transform:uppercase;letter-spacing:.02em;color:#c4c7d4}
.cvform input,.cvform select{font:16px system-ui,Arial,sans-serif;padding:10px 12px;border:3px solid #000;border-radius:10px;background:#fff;color:#111;text-transform:none}
.cvform .cvfile input{background:#fffbe6}
.cvform .cvconsent{display:flex;gap:10px;align-items:flex-start;text-transform:none;font-weight:600;font-size:13px;color:#e6e6e6;letter-spacing:0}
.cvform .cvconsent input{width:20px;height:20px;margin:0;flex:none}
.cvform .cvhp{position:absolute;left:-9999px;width:1px;height:1px;opacity:0}
#miniDlg .cvform input:not([type=checkbox]),#miniDlg .cvform select{background:#fff!important;color:#111!important;border:3px solid #000!important;width:100%!important;box-sizing:border-box;min-height:46px}
#miniDlg .cvform .cvfile input{background:#fffbe6!important}
#miniDlg .cvform .cvconsent{display:grid!important;grid-template-columns:22px 1fr;gap:10px;align-items:start}
#miniDlg .cvform .cvconsent input{width:20px!important;height:20px!important;min-height:0;margin:2px 0 0!important;padding:0!important}
#miniDlg .cvform .cvhp{position:absolute!important;left:-9999px!important;width:1px!important;height:1px!important;min-height:0!important}
#miniBtns button{font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif!important;font-weight:900!important;font-size:15px!important;letter-spacing:.02em!important;text-transform:uppercase;padding:12px 18px!important;border:3px solid #000;border-radius:12px;box-shadow:0 4px 0 #000}
/* Big map: use the room, the map is wide now */
#bigmap{width:min(1400px,97vw)}
.mapwrap{grid-template-columns:1fr 240px}
#mapCanvas{max-width:min(100%,calc(68dvh * 214 / 127))!important;image-rendering:auto}
/* Martin W.: mini Python IDE */
.pyide{border:3px solid #000;border-radius:12px;overflow:hidden;background:#1e1e2e;box-shadow:0 5px 0 #000;font:14px/1.5 "SF Mono",Menlo,Consolas,monospace;max-width:640px}
.pybar{display:flex;align-items:center;gap:7px;padding:8px 12px;background:#2b2b3d;color:#cdd6f4;font-family:system-ui,Arial,sans-serif;font-size:13px}.pybar .dot{width:11px;height:11px;border-radius:50%}.pybar .r{background:#ff5f57}.pybar .y{background:#febc2e}.pybar .g{background:#28c840}.pybar b{margin-left:8px}.pybar em{margin-left:auto;color:#89b4fa;font-style:normal}
.pyed{display:grid;grid-template-columns:38px 1fr;min-height:150px}.pyln{margin:0;padding:10px 8px;text-align:right;color:#6c7086;background:#181825;overflow:hidden;user-select:none}
.pyed textarea{margin:0;border:0!important;outline:0;resize:vertical;min-height:150px;padding:10px 12px!important;background:#1e1e2e!important;color:#f5e0dc!important;font:inherit!important;caret-color:#ffd43b;width:100%;box-sizing:border-box;border-radius:0!important;box-shadow:none!important}
.pyterm{border-top:2px solid #000;background:#11111b}.pyhead{padding:5px 12px;font:700 11px system-ui,Arial;color:#a6adc8;letter-spacing:.08em;background:#181825}.pyout{margin:0;padding:10px 12px;color:#a6e3a1;min-height:60px;white-space:pre-wrap}.pyout.err{color:#f38ba8}
/* Special quest navigation: big and obvious on desktop and mobile */
#sqBtn{font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif!important;display:flex;flex-direction:column;align-items:center;gap:3px;padding:16px 30px!important;border:4px solid #000!important;border-radius:16px!important;min-width:min(440px,90vw);bottom:128px}
#sqBtn b{font-size:clamp(18px,2vw,24px);font-weight:900;letter-spacing:.02em;line-height:1.1}
#sqBtn small{font-size:clamp(13px,1.3vw,16px);font-weight:800;color:#333!important;text-transform:uppercase}
#sqBtn{box-shadow:0 0 0 4px var(--c,#ffd400),0 7px 0 4px #000,0 0 28px 6px rgba(255,212,0,.55)!important}
body.mobile-ui #sqBtn{left:50%!important;transform:translateX(-50%);width:calc(100vw - 24px)!important;max-width:460px;min-width:0;top:var(--sqT,176px);padding:12px 14px!important;border-width:3px!important}
body.mobile-ui #sqBtn b{font-size:17px}body.mobile-ui #sqBtn small{font-size:12px}
@keyframes sqPulseM{0%,100%{transform:translateX(-50%) scale(1)}50%{transform:translateX(-50%) scale(1.04)}}
/* Butcher's chalkboard menu */
.bmenu{background:#1f3a2c;border:6px solid #6b4a2b;border-radius:12px;padding:14px 16px;color:#f4f1e6;font-family:"Comic Sans MS","Chalkboard SE",system-ui,sans-serif;max-width:560px;box-shadow:inset 0 0 30px #0007}
.bhead{text-align:center;font-size:20px;font-weight:700;letter-spacing:.08em;margin-bottom:8px;border-bottom:2px dashed #f4f1e655;padding-bottom:6px}
.bitem{display:grid;grid-template-columns:34px 1fr 50px 34px 26px 34px;align-items:center;gap:6px;padding:6px 0;border-bottom:1px dashed #f4f1e622;font-size:16px}
.bitem .bi{font-size:22px}.bitem .bp{color:#ffd27a;font-weight:700;text-align:right}.bitem b{text-align:center;font-size:17px}
.bitem button{font:900 18px system-ui,Arial!important;padding:2px 0!important;min-height:30px;border:2px solid #000!important;border-radius:8px!important;background:#ffd400!important;color:#111!important;box-shadow:0 2px 0 #000!important}
.bitem button:disabled{opacity:.35}
.btotal{margin-top:10px;font-weight:700;color:#ffd27a;text-align:right}
/* Agency dialog on phones: compact header, full-width actions, links in one row */
#garage #buyNitro:disabled{opacity:1;background:#3a2a1c!important;color:#d9b48a!important}
#garage #buyNitro:disabled small{color:#d9b48a;opacity:.85}
@media (max-width:700px){
  #garage{width:calc(100vw - 16px)!important;padding:16px 14px!important;max-height:calc(100dvh - 24px)}
  #garage .garagehead{display:grid;grid-template-columns:1fr auto;gap:10px 12px;align-items:start}
  #garage .garagehead>div:first-child{min-width:0}
  #garage .garagehead h2{font-size:30px;line-height:1;overflow-wrap:anywhere}
  #garage .garagehead .eyebrow{font-size:10px}
  #garage .wallet{padding:4px 10px;border-width:2px;align-self:start}
  #garage .wallet small{font-size:9px}#garage .wallet strong{font-size:20px}
  #garage #closeGarage{grid-column:1/-1;width:100%;min-height:50px;font-size:17px!important;padding:10px 14px!important}
  #garage .garageshop{display:grid;grid-template-columns:1fr;gap:8px;margin-top:10px}
  #garage #buyNitro{width:100%;min-height:54px;font-size:17px!important;padding:10px 14px!important}
  #garage #buyNitro small{font-size:11px;margin-top:2px}
  #garage .garageshop span,#garage .garagenote{font-size:12px;line-height:1.35;margin:4px 0}
  #garage .agencylinks{display:grid!important;grid-template-columns:repeat(3,1fr);gap:8px;margin:8px 0 12px}
  #garage .agencylinks a{justify-content:center;padding:10px 4px!important;font-size:12px!important;min-height:42px;gap:4px;white-space:nowrap}
  #garage .tunebox{padding:12px}
  #garage .tunebox h4{font-size:15px}#garage .tunebox p{font-size:12px}
  #garage .tunebox button{width:100%;font-size:14px!important}
  #garage .tunebox .tunes span{font-size:10px;padding:3px 6px}
  #garageList{grid-template-columns:1fr!important}
}

/* Special-quest GPS button: a slow, gentle hop and glow so it gets noticed. */
@keyframes sqHop{0%,70%,100%{transform:translateX(-50%) translateY(0)}78%{transform:translateX(-50%) translateY(-10px)}86%{transform:translateX(-50%) translateY(0)}92%{transform:translateX(-50%) translateY(-4px)}}
@keyframes sqGlow{0%,100%{filter:brightness(1)}50%{filter:brightness(1.18)}}
#sqBtn,body.mobile-ui #sqBtn{animation:sqHop 2.6s ease-in-out infinite,sqGlow 2.6s ease-in-out infinite!important}
@media(prefers-reduced-motion:reduce){#sqBtn,body.mobile-ui #sqBtn{animation:sqGlow 2.6s ease-in-out infinite!important}}
/* Nitro button: the line under the price as a dark pill, readable on orange. */
#garage #buyNitro small{display:table;margin:6px auto 0;padding:3px 10px;border-radius:999px;background:#111;color:#fff!important;opacity:1!important;font:800 13px system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif!important;letter-spacing:0;text-transform:none}
#garage #buyNitro:disabled small{background:#00000066;color:#f1d3ad!important}
/* Big map on phones: one column (map, quests, then the agency list), nothing overlapping. */
@media(max-width:760px){
  .mapwrap{grid-template-columns:1fr!important;gap:12px}
  .mapleft,#mapList{min-width:0;width:100%}
  #mapList{max-height:none!important;overflow:visible}
  #mapQuests{grid-template-columns:1fr 1fr!important}
  .mqpanel{min-width:0}
}
@media(max-width:420px){#mapQuests{grid-template-columns:1fr!important}}
/* Agency dialog: cars for sale first, then upgrades, then links. */
#garage .garbig{margin:14px 0 8px;font:900 20px/1.1 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;text-transform:uppercase;letter-spacing:.02em;color:var(--gar,#ffd400)}
#garage .garbig.garup{margin-top:22px;font-size:16px;color:#fff}
#garage .garageshop{margin-top:0}
#garage #linkSlot .agencylinks{margin:16px 0 4px}
@media(max-width:760px){#garage .garbig{font-size:18px}#garage .garbig.garup{font-size:15px}}
@media(max-width:760px){#garage .carcard canvas{height:110px!important;object-fit:contain}#garage .carcard{padding-bottom:10px}}
#garage .tunebox .tunes span:not(.on):not(:first-child){display:none}
/* Agency dialog: links on top, then three dropdowns (new cars, nitro + tuning, your cars). */
#mineList{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:14px}
#garage .garacc{margin:10px 0;border:3px solid #000;border-radius:14px;background:#14161f;box-shadow:0 4px 0 #000}
#garage .garacc>summary{list-style:none;cursor:pointer;padding:14px 16px;font:900 18px/1.1 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;text-transform:uppercase;color:var(--gar,#ffd400);display:flex;align-items:center;justify-content:space-between}
#garage .garacc>summary::-webkit-details-marker{display:none}
#garage .garacc>summary::after{content:'▾';font-size:20px;color:#fff;transition:transform .2s}
#garage .garacc[open]>summary::after{transform:rotate(180deg)}
#garage .garacc>div,#garage .garacc>.garageshop{padding:0 12px 12px}
#garage .garacc .tunebox{margin:8px 0 0}
#garage #linkSlot .agencylinks{margin:12px 0 4px}
@media(max-width:760px){#mineList{grid-template-columns:1fr}#garage .garacc>summary{font-size:16px;padding:12px 14px}}
/* Credits dialog */
#credits{max-width:560px;width:calc(100% - 32px);padding:26px 24px;border:4px solid #000;border-radius:18px;background:#1b1d29;color:#fff;box-shadow:8px 8px 0 #ff2d8a}
#credits h2{margin:0 0 16px;font-family:'Bungee',sans-serif;color:#ffd400;font-size:30px}
#credits .credits{margin:0}#credits dt{font:900 17px/1.3 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:#fff;margin-top:16px}#credits dt:first-child{margin-top:0}
#credits dd{margin:4px 0 0;font:500 15px/1.4 system-ui,-apple-system,Arial,sans-serif;color:#c4c7d4}
#credits .close{float:right}
#busted #bustedCredits{all:unset;display:block;margin:10px auto 0;font:700 12px system-ui,-apple-system,Arial,sans-serif;letter-spacing:.08em;color:#9ea3b8;text-decoration:underline;cursor:pointer;flex-basis:100%;text-align:center}
#busted #bustedCredits:hover{color:#fff}
.modepick{margin:18px 0 10px;font:900 18px/1 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;letter-spacing:.12em;color:#fff;text-shadow:2px 2px 0 #000}
@media(max-width:760px){.modepick{font-size:15px;margin:14px 0 8px}}
#credits .credsmall{margin:22px 0 0;font:500 12px system-ui,-apple-system,Arial,sans-serif;color:#8a8fa3;text-align:center}
/* Radio station bar */
#radioBar{position:fixed;z-index:60;left:50%;top:92px;transform:translateX(-50%);width:min(560px,calc(100vw - 24px));padding:10px 12px;background:#14161fee;border:3px solid #000;border-radius:14px;box-shadow:0 5px 0 #000;color:#fff;font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif}
#radioBar[hidden]{display:none}
#radioBar .rbhead{font:700 13px/1.2 system-ui,Arial,sans-serif;color:#ffd400;margin:0 0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#radioBar .rbrow{display:flex;gap:6px}
#radioBar .rbrow button{flex:1;min-width:0;padding:9px 4px;border:2px solid #000;border-radius:9px;background:#2a2e3d;color:#fff;font:800 12px system-ui,Arial,sans-serif;cursor:pointer;white-space:nowrap}
#radioBar .rbrow button.on{background:#ffd400;color:#111}
#radioBar .rbrow .rboff{flex:0 0 42px;background:#ff2d8a}
@media(max-width:760px){#radioBar{top:auto;bottom:calc(env(safe-area-inset-bottom,0px) + 190px)}#radioBar .rbrow button{font-size:11px;padding:9px 2px}}
/* Mobile: chat and menu, then a big radio button; arrows switch stations while it plays. */
body.mobile-ui #mbar #mChat{width:100%!important;flex-basis:100%;font-size:12px!important}
#mRadioBox{display:none}
body.mobile-ui.playing #mRadioBox{display:flex;flex-basis:100%;gap:4px}
body.mobile-ui #mbar #mRadioBox button{height:38px}
body.mobile-ui #mbar #mRadio{flex:1;width:auto!important;font-size:11px!important;padding:0 4px;overflow:hidden;text-overflow:ellipsis}
body.mobile-ui #mbar #mPrev,body.mobile-ui #mbar #mNext{flex:0 0 30px;width:30px!important;padding:0;background:#ffd400;color:#111;font-size:13px}
body.mobile-ui #mbar #mPrev[hidden],body.mobile-ui #mbar #mNext[hidden]{display:none}
body.mobile-ui #radioBar{display:none!important}
body.mobile-ui.playing #mbar{width:156px!important}
body.mobile-ui #mbar #mChat{display:none!important}
.menuchat{display:block;width:100%;margin:10px 0 0;padding:9px 12px;border:2px solid #000;border-radius:10px;background:#151a2c;color:#fff;font:800 13px system-ui,-apple-system,Arial,sans-serif;cursor:pointer}
/* Desktop radio: the button shows the station, arrows switch it. */
#radioBox{display:inline-flex;align-items:center;gap:4px}
#radioBox #rPrev,#radioBox #rNext{padding:6px 9px;border:2px solid #000;border-radius:8px;background:#ffd400;color:#111;font-weight:900;cursor:pointer}
#radioBox #rPrev[hidden],#radioBox #rNext[hidden]{display:none}
#music.on{min-width:150px;background:#ff2f8e;color:#fff}
/* Desktop: radio sits in the bottom-left corner. Only the radio button shows until you turn it on;
   then arrows, the station and a volume button appear, and the volume sliders open from that button. */
body:not(.mobile-ui) #soundbar{left:16px!important;right:auto!important;bottom:16px!important;transform:none!important;flex-direction:column;align-items:flex-start;gap:8px;padding:0!important;background:none!important;border:0!important;box-shadow:none!important}
body:not(.mobile-ui) #soundbar #radioBox{gap:5px}
body:not(.mobile-ui) #soundbar #music{border:3px solid #000;border-radius:10px;box-shadow:0 4px 0 #000}
#volBtn{padding:6px 9px;border:2px solid #000;border-radius:8px;background:#151a2c;color:#fff;cursor:pointer}
#volBtn[hidden]{display:none}
body:not(.mobile-ui) #volPop{display:none;order:-1;gap:14px;padding:8px 12px;background:#0b1426ee;border:3px solid #000;border-radius:10px;box-shadow:0 4px 0 #000}
body:not(.mobile-ui) #soundbar.vol #volPop{display:flex}
body.mobile-ui #msheetSlot #soundbar #volPop{display:flex;flex-wrap:wrap;gap:10px;width:100%}
body.mobile-ui #msheetSlot #soundbar #radioBox{display:none}
#credits .credver{margin:20px 0 0;font:600 11px system-ui,-apple-system,Arial,sans-serif;letter-spacing:.12em;color:#8a8fa3;text-align:center}
header{padding-top:0!important}header h1{margin-top:0!important}

/* Loading picture fills the screen from the centre: phones see the middle, wider screens see more of it. */
#loading img{object-fit:cover;object-position:50% 50%}
