
:root{--ink:#e9f6ff;--navy:#071b2b;--teal:#1bdfc4;--sun:#ffcc77;--orange:#ff984d}*{box-sizing:border-box}html,body{height:100%;margin:0;overflow:hidden;background:#0d2335;font-family:Tahoma,'Segoe UI',Arial,sans-serif;color:var(--ink)}button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:3px solid white;outline-offset:3px}#game{position:relative;width:100%;height:100%;height:100dvh;overflow:hidden;isolation:isolate;touch-action:none;user-select:none;-webkit-user-select:none}#sky{position:absolute;inset:0;background:linear-gradient(180deg,#315477 0%,#86a5aa 33%,#e4b282 63%,#f5bb77 100%);z-index:-2}canvas{display:block;width:100%;height:100%;position:absolute;inset:0;z-index:-1}.vignette{position:absolute;inset:0;z-index:0;pointer-events:none;background:radial-gradient(ellipse at 50% 48%,transparent 28%,rgba(3,23,36,.32) 98%)}.hud{position:absolute;inset:0;pointer-events:none;z-index:2;padding:calc(16px + env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));display:flex;flex-direction:column;justify-content:space-between}.hud-top{display:flex;align-items:center;gap:12px;min-width:0}.brand{display:flex;align-items:center;gap:9px;min-width:0;text-shadow:0 2px 9px #1a3449}.brand-mark,.menu-emblem{display:grid;place-items:center;color:#152e3e;background:linear-gradient(145deg,#f4c977,#ff9f69);font-weight:900;box-shadow:0 5px 15px #05253655}.brand-mark{width:39px;height:39px;border-radius:13px;font-size:26px;transform:rotate(-7deg)}.brand strong{display:block;font-size:18px;letter-spacing:-.5px}.brand small{display:block;font-size:10px;opacity:.85;line-height:1.6}.stats{display:flex;gap:7px;margin-inline-start:auto}.stat{min-width:75px;padding:7px 12px;background:#071d31ad;border:1px solid #f2e6cc27;border-radius:13px;backdrop-filter:blur(10px)}.stat>span{display:block;color:#b7c9d3;font-size:10px}.stat b{font-size:17px;font-variant-numeric:tabular-nums}.stat b small{font-size:10px;color:#b7c9d3}.coin-dot{color:#ffc064;font-size:18px;text-shadow:0 0 14px #fec36baa}.pause-btn{width:39px;height:39px;background:#0a253cb3;border:1px solid #ffffff32;border-radius:13px;color:#fff;font-size:20px;pointer-events:auto}.hud-row{display:flex;align-items:start;justify-content:space-between;gap:10px;margin-top:12px}.hearts{font-size:24px;letter-spacing:3px;color:#ff6d7b;text-shadow:0 2px 14px #0008}.hearts .empty{color:#9ea9b7}.challenge{width:200px;max-width:49vw;background:#071b2bbb;border:1px solid #ffffff2a;border-radius:12px;padding:10px 12px;font-size:11px}.challenge-label{font-size:9px;color:#fcd18e}.progress-track{height:4px;margin-top:8px;background:#ffffff29;border-radius:5px;overflow:hidden}.points-line{display:flex;justify-content:space-between;margin-top:7px;font-size:10px;color:#afc9d4}.points-line b{color:#fee0a5;font-variant-numeric:tabular-nums}.progress-track div{height:100%;width:0;background:linear-gradient(90deg,#f7b76b,#ffe0a9);transition:width .2s}.toast{position:absolute;top:28%;left:50%;transform:translateX(-50%) translateY(15px);font-size:17px;font-weight:900;white-space:nowrap;color:#fff7e1;text-shadow:0 2px 15px #001a2c;opacity:0;transition:opacity .2s,transform .2s}.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}.hud-bottom{display:flex;align-items:end;justify-content:space-between;gap:8px;flex-direction:column}.speed{position:absolute;bottom:calc(108px + env(safe-area-inset-bottom));right:max(18px,env(safe-area-inset-right));background:#051b2acb;border:1px solid #ffffff35;border-radius:18px;padding:11px 15px;min-width:106px;backdrop-filter:blur(6px);box-shadow:0 8px 30px #05121d33}.speed-value{display:flex;align-items:baseline;gap:5px;direction:ltr}.speed-value b{font-size:34px;line-height:1;font-variant-numeric:tabular-nums}.speed-value span{font-size:11px}.speed-label{font-size:10px;color:#8acbbf;margin-top:5px}.speed-bars{display:flex;align-items:end;gap:3px;margin-top:8px;direction:ltr}.speed-bars i{width:8px;height:6px;background:#28475c;border-radius:2px}.speed-bars i:nth-child(2){height:9px}.speed-bars i:nth-child(3){height:12px}.speed-bars i:nth-child(4){height:15px}.speed-bars i:nth-child(5){height:18px}.speed-bars i:nth-child(6){height:21px}.speed-bars i:nth-child(7){height:24px}.speed-bars i.active{background:linear-gradient(#fbd889,#fc9d55)}.controls{width:100%;display:flex;direction:ltr;justify-content:space-between;align-items:end;gap:20px;pointer-events:auto}.steer-controls,.pedal-controls{display:flex;align-items:end;gap:10px}.drive-btn{border:1px solid #ffffff7d;box-shadow:0 6px 16px #06233766, inset 0 1px 0 #ffffff22;background:#0b2a3dbf;color:#fff;backdrop-filter:blur(9px);touch-action:none}.drive-btn.pressed{background:#ecac69e8;color:#152d40;transform:scale(.95)}.steer-btn{width:72px;height:72px;border-radius:23px;display:grid;place-items:center;font-size:34px;font-weight:800}.steer-btn#left{transform:scaleX(-1)}.steer-btn#left.pressed{transform:scaleX(-1) scale(.95)}.pedal{width:75px;height:87px;border-radius:19px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}.pedal span{font-size:33px;font-weight:bold;line-height:1}.pedal small{font-size:11px;font-weight:bold}.gas{background:linear-gradient(170deg,#edac60d9,#a94e35e0);border-color:#ffdeaa}.brake{background:#27364dd9}.overlay{position:absolute;inset:0;z-index:5;display:flex;align-items:center;justify-content:center;padding:20px;background:linear-gradient(110deg,#061a2de8,#0d3047a8 55%,#0b253aa9);backdrop-filter:blur(5px)}.overlay.hidden,.hidden{display:none!important}.menu-card{width:min(100%,430px);padding:32px 27px;border:1px solid #e8f0fa34;background:linear-gradient(150deg,#0c273ce8,#102d40ed);box-shadow:0 25px 80px #06162588;border-radius:26px;text-align:right;max-height:min(92dvh,800px);overflow:auto}.eyebrow{font-size:11px;letter-spacing:.1px;color:#fee0a5;display:flex;align-items:center;gap:7px}.eyebrow-dot{width:7px;height:7px;border-radius:50%;background:#49ddc4;box-shadow:0 0 12px #49ddc4}.menu-emblem{width:67px;height:67px;font-size:40px;border-radius:21px;margin:25px 0 17px;transform:rotate(-8deg)}.menu-card h1{font-size:clamp(30px,7.4vw,43px);line-height:1.23;margin:0 0 10px;color:#f9fdff;letter-spacing:-1px}.menu-card h1 em{font-style:normal;color:#ffc67d}.menu-card h2{font-size:28px;margin:0 0 12px}.menu-card p{font-size:14px;line-height:1.9;color:#c6d5df;margin:0 0 22px}.menu-features{display:flex;gap:7px;flex-wrap:wrap;margin:0 0 24px}.menu-features span{font-size:11px;background:#ffffff12;border:1px solid #ffffff23;padding:9px;border-radius:12px}.vehicle-chip{padding:8px 12px;border-radius:999px;background:#0a253cb3;border:1px solid #ffffff2f;font-size:11px;color:#ffe1b0;white-space:nowrap;box-shadow:0 5px 16px #0616253a}.vehicle-picker-title{font-size:12px;color:#ffd9a1;margin:0 0 12px;font-weight:700}.vehicle-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:14px}.vehicle-card{background:linear-gradient(180deg,#112f45,#0b2435);border:1px solid #ffffff1f;border-radius:16px;padding:13px 12px;text-align:right;color:#eef7fb;display:flex;flex-direction:column;gap:5px;min-height:120px;transition:transform .15s,border-color .15s,box-shadow .15s}.vehicle-card strong{font-size:15px}.vehicle-card small{font-size:11px;line-height:1.6;color:#bcd0db}.vehicle-card.selected{border-color:#ffd18b;box-shadow:0 0 0 2px #ffd18b25,0 10px 25px #00000026;transform:translateY(-1px)}.vehicle-badge{display:inline-flex;align-self:flex-start;padding:4px 9px;border-radius:999px;background:#ffffff14;border:1px solid #ffffff21;color:#ffe3b5;font-size:10px}.vehicle-specs{display:flex;flex-wrap:wrap;gap:6px;margin-top:auto}.vehicle-specs span{font-size:10px;padding:4px 7px;border-radius:999px;background:#071d2d;border:1px solid #ffffff14;color:#8fded0}.selected-vehicle-line,.selected-vehicle-summary{text-align:center;margin:0 0 16px;font-size:13px;color:#d8e5ed}.selected-vehicle-line b,.selected-vehicle-summary b{color:#ffd18b}.selected-vehicle-summary{margin:8px 0 18px}.secondary-btn{display:block;width:100%;background:transparent;color:#e6f3f8;border:1px solid #ffffff53;border-radius:14px;padding:13px;margin-top:13px}.primary-btn{display:flex;justify-content:space-between;align-items:center;width:100%;background:linear-gradient(105deg,#ffd28e,#f5a467);color:#183246;border:0;border-radius:16px;padding:17px 19px;font-weight:900;font-size:17px;box-shadow:0 8px 18px #f0a96b30}.primary-btn>span:last-child{font-size:26px;line-height:16px}.primary-btn:active{transform:translateY(2px)}.secondary-btn{display:block;width:100%;background:transparent;color:#e6f3f8;border:1px solid #ffffff53;border-radius:14px;padding:13px;margin-top:13px}.instructions{text-align:center;margin-top:18px;font-size:11px;line-height:2.2;color:#aebfc9}kbd{font-family:inherit;background:#ffffff1d;border:1px solid #ffffff3a;padding:1px 5px;border-radius:4px}.menu-foot{font-size:9px;color:#7994a4;display:block;text-align:center;margin-top:18px}.compact{text-align:center;padding:34px 26px}.compact .menu-emblem{margin:2px auto 23px}.compact p{margin-bottom:23px}.compact .eyebrow{justify-content:center;margin-bottom:16px}.result-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:21px}.result-grid>div{background:#ffffff12;border-radius:13px;padding:14px 5px}.result-grid b{display:block;font-size:22px;color:#ffd38e;font-variant-numeric:tabular-nums}.result-grid span{font-size:10px;color:#b7cdd8}.error{position:absolute;inset:auto 15px 20px;z-index:20;border-radius:15px;background:#82292b;color:#fff;padding:20px;text-align:center}#impact{position:absolute;inset:0;pointer-events:none;z-index:3;background:#ff3649;opacity:0;transition:opacity .15s}.shaking{animation:shake .25s ease}@keyframes shake{0%{transform:translateX(0)}25%{transform:translateX(7px)}50%{transform:translateX(-5px)}75%{transform:translateX(3px)}100%{transform:translateX(0)}}@media(max-width:500px){.hud{padding-top:calc(9px + env(safe-area-inset-top));padding-left:12px;padding-right:12px}.brand-mark{width:34px;height:34px;font-size:23px}.brand strong{font-size:16px}.brand small{font-size:9px}.stat{padding:6px 8px;min-width:65px}.stat b{font-size:15px}.stat>span{font-size:9px}.hud-top{gap:7px}.vehicle-chip{font-size:10px;padding:7px 10px}.pause-btn{width:34px;height:34px}.steer-btn{width:61px;height:68px;border-radius:19px}.pedal{width:64px;height:76px;border-radius:17px}.controls{gap:7px}.steer-controls,.pedal-controls{gap:7px}.speed{bottom:calc(93px + env(safe-area-inset-bottom));padding:8px 11px;min-width:94px}.speed-value b{font-size:30px}.challenge{width:180px}.menu-card{padding:24px 23px}.menu-emblem{margin-top:16px;margin-bottom:12px}.menu-card p{margin-bottom:16px}.menu-features{margin-bottom:18px}.vehicle-grid{grid-template-columns:1fr}.vehicle-card{min-height:auto}}@media(max-width:370px){.stat:nth-child(1){display:none}.challenge{max-width:58vw}.brand small{display:none}.vehicle-chip{display:none}.steer-btn{width:52px;height:64px}.pedal{width:58px;height:70px}.menu-card{padding:17px}.instructions{margin-top:10px}}@media(max-height:640px){.menu-card{max-height:96dvh;padding:15px 21px}.menu-emblem{height:50px;width:50px;font-size:30px;margin:10px 0}.menu-card h1{font-size:29px}.menu-card p{font-size:12px;line-height:1.5}.menu-features{margin-bottom:12px}.menu-features span{padding:5px}.primary-btn{padding:13px 17px}.instructions{margin-top:8px;font-size:10px}.menu-foot{margin-top:7px}}@media(orientation:landscape) and (max-height:600px){.hud-row{margin-top:4px}.speed{bottom:calc(13px + env(safe-area-inset-bottom));right:50%;transform:translateX(50%)}.controls .drive-btn{width:58px;height:55px}.pedal span{font-size:22px}.menu-card{max-width:560px}.menu-emblem{display:none}.menu-card h1{font-size:30px}}


/* Mashwar 0.5: keep challenges at the top, not over the road. */
.hud{justify-content:flex-start}
.hud-top{flex-shrink:0}
.hud-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:8px;flex-shrink:0}
.hud-bottom{margin-top:auto}
.challenge{width:min(186px,48vw);max-width:none;padding:8px 10px;background:#081c2bc9;border-radius:13px;font-size:10px;line-height:1.35;box-shadow:0 4px 17px #0002}
.challenge-label{font-size:9px}
.challenge .progress-track{margin-top:5px}
.challenge .points-line{margin-top:4px}
.hearts{font-size:20px;letter-spacing:1px;white-space:nowrap}
.camera-button{pointer-events:auto;flex:0 0 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;background:#0a283dcf;color:#ffdfaf;border:1px solid #ffffff60;border-radius:13px;min-width:57px;height:47px;padding:4px 6px;box-shadow:0 4px 12px #001d2a40;touch-action:manipulation}
.camera-button span{font-size:20px;line-height:21px}
.camera-button small{font-size:10px;font-weight:700;white-space:nowrap}
.camera-button:active{transform:scale(.96);background:#34536a}
#mission{max-width:100%;white-space:normal}
@media(max-width:500px){
  .hud-row{gap:5px;margin-top:7px}
  .challenge{width:min(168px,46vw);padding:6px 8px;font-size:9px}
  .hearts{font-size:18px;letter-spacing:0}
  .camera-button{min-width:51px;height:44px;padding:2px 4px}
  .camera-button span{font-size:18px}
  .camera-button small{font-size:9px}
  .hud-bottom .speed{bottom:calc(108px + env(safe-area-inset-bottom))}
}
@media(max-width:370px){.challenge{width:min(152px,46vw)}.hearts{font-size:16px}.camera-button{min-width:46px}}
@media(orientation:landscape) and (max-height:600px){.hud-row{margin-top:2px}.challenge{max-width:180px}.camera-button{height:39px}}
