/* ===== NDCockpit – the ONE shared cockpit for every 3D driving mode (road 2.0, 3D city, …).
   Same wheel, dashboard, speed panel, P-R-N-D lever, pedals, sizes, colours and animations everywhere.
   Pages only tune it with CSS variables / mount() options – never with a second copy. ===== */
#ck{position:absolute;inset:0;width:100%;height:100%;display:block;pointer-events:none;z-index:2}
/* dash */
.dash{position:absolute;z-index:5;top:calc(60px + env(safe-area-inset-top,0px));left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:10px;background:var(--glass);border:1px solid var(--line);border-radius:20px;padding:6px 10px;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);direction:rtl}
.spd{text-align:center;min-width:64px}
.spd b{display:block;font:900 2rem/1 Rubik;font-variant-numeric:tabular-nums}
.spd small{color:var(--muted);font-size:.72rem;font-weight:700}
.spd.over b{color:#FDA4AF}
.lim{width:44px;height:44px;border-radius:50%;background:#fff;border:5px solid #DC2626;display:grid;place-items:center;color:#111;font:900 1.02rem Rubik}
.sig{width:42px;height:42px;border-radius:13px;border:1px solid var(--line);background:var(--glass2);display:grid;place-items:center}
.sig svg{width:22px;height:22px;fill:currentColor}
.sig.on{background:var(--green);color:#052e16;animation:blink .5s steps(2) infinite}
@keyframes blink{50%{filter:brightness(.55)}}
.cam{height:42px;border-radius:13px;border:1px solid var(--line);background:var(--glass2);padding:0 10px;font:700 .82rem Rubik;display:flex;align-items:center;gap:6px}
.cam svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2}
/* controls */
.ctl{position:absolute;left:0;right:0;bottom:0;display:flex;align-items:flex-end;justify-content:space-between;gap:10px;padding:10px 14px calc(14px + env(safe-area-inset-bottom,0px));z-index:5;direction:ltr;pointer-events:none}
.ctl>*{pointer-events:auto}
.steer{display:flex;gap:10px}
.big{width:74px;height:74px;border-radius:24px;border:1px solid var(--line);background:var(--glass);display:grid;place-items:center;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);touch-action:none}
.big svg{width:34px;height:34px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.big.on{background:rgba(45,212,191,.32);border-color:var(--teal)}
.pedals{display:flex;gap:10px;align-items:flex-end}
.pedals .rlever{align-self:flex-end;margin-inline-end:4px}
.pedal{position:relative;width:72px;border-radius:18px;border:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;padding-bottom:9px;font:800 .95rem Rubik;touch-action:none;box-shadow:0 10px 24px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.35)}
.pedal::before{content:"";position:absolute;inset:12px 14px 34px;border-radius:9px;background:repeating-linear-gradient(0deg,rgba(0,0,0,.28) 0 5px,transparent 5px 11px)}
.pedal.brake{height:82px;width:84px;background:linear-gradient(180deg,#FB7185,#BE123C)}
.pedal.gas{height:118px;background:linear-gradient(180deg,#4ADE80,#15803D)}
.pedal.on{filter:brightness(1.25);transform:scale(.96)}
.lever{display:flex;flex-direction:column;gap:4px;padding:6px;border-radius:18px;background:linear-gradient(180deg,rgba(15,20,40,.92),rgba(3,5,12,.92));border:1px solid var(--line);box-shadow:inset 0 2px 10px rgba(0,0,0,.6),0 8px 20px rgba(0,0,0,.4);position:relative}
.lever::before{content:"";position:absolute;top:12px;bottom:12px;left:50%;width:4px;margin-left:-2px;border-radius:4px;background:rgba(255,255,255,.08)}
.gr{position:relative;width:46px;height:28px;border-radius:9px;border:1px solid transparent;background:transparent;color:#64748B;font:900 1rem Rubik;touch-action:manipulation}
.gr.on{color:#fff;border-color:var(--gc);background:color-mix(in srgb,var(--gc) 38%,transparent);box-shadow:0 0 16px -3px var(--gc)}
.gr[data-g=P]{--gc:#60A5FA}.gr[data-g=R]{--gc:#F43F5E}.gr[data-g=N]{--gc:#FBBF24}.gr[data-g=D]{--gc:#22C55E}
@media (max-width:640px){
 .dash{top:calc(54px + env(safe-area-inset-top,0px));gap:6px;padding:5px 7px;border-radius:16px}.spd b{font-size:1.9rem}.spd{min-width:48px}.lim{width:38px;height:38px;border-width:4px;font-size:.9rem}.sig{width:44px;height:44px}.cam{height:36px;padding:0 8px}.cam span{display:none}
 .ctl{gap:6px;padding:8px 8px calc(10px + env(safe-area-inset-bottom,0px))}.steer{gap:7px}.big{width:60px;height:60px;border-radius:20px}.big svg{width:28px;height:28px}
 .pedals{gap:6px}.pedal{width:62px;font-size:.82rem}.pedal.brake{width:64px;height:72px}.pedal.gas{height:100px}.lever{display:grid;grid-template-columns:1fr 1fr;padding:5px;gap:5px}.lever::before{display:none}.gr{width:44px;height:44px;font-size:1.05rem;border-color:rgba(255,255,255,.08)}
}
@media (max-width:360px){.dash .cam{display:none}}
@media (max-width:390px){.big{width:54px;height:54px;border-radius:18px}.gr{width:38px;height:40px}.pedal{width:56px}.pedal.brake{width:58px}.steer{gap:6px}.pedals{gap:5px}.ctl{padding-inline:6px}}
/* speed panel docked at the bottom, between the steering buttons and the pedals –
   it sits on the dashboard like a real instrument cluster and never covers the road ahead */
.dash{top:auto!important;bottom:calc(14px + env(safe-area-inset-bottom,0px))!important;left:50%!important;right:auto!important;transform:translateX(-50%)!important;
  display:grid!important;grid-template-columns:auto auto auto auto auto;align-items:center;gap:8px!important;padding:6px 10px!important;width:max-content!important;z-index:6}
.dash .spd{min-width:58px}
@media (max-width:640px){
 .dash{grid-template-columns:38px 58px 38px;grid-template-areas:"sr spd sl" "lim spd cam";gap:5px 6px!important;padding:6px 8px!important;border-radius:16px}
 .dash #sR{grid-area:sr}.dash #sL{grid-area:sl}.dash .spd{grid-area:spd;min-width:0}.dash .lim{grid-area:lim}.dash .cam{grid-area:cam;display:flex!important}
 .dash .sig,.dash .cam{width:38px;height:38px;padding:0;justify-content:center}.dash .lim{width:36px;height:36px;border-width:4px;justify-self:center}.dash .cam span{display:none}
 .dash .spd b{font-size:1.75rem}
}
/* narrow phones: no room between the controls – the panel sits just above them, still on the dashboard */
@media (max-width:640px){.dash{bottom:calc(144px + env(safe-area-inset-bottom,0px))!important}}
@media (max-height:500px) and (max-width:900px){.dash{transform:translateX(-50%) scale(.85)!important;transform-origin:bottom center}}
/* interactive feedback for every cockpit control */
.sig,.cam,.big,.pedal,.gr,.ndp-btn{cursor:pointer;transition:background-color .15s,border-color .15s,filter .15s,transform .12s}
.sig:hover,.cam:hover,.big:hover{border-color:rgba(255,255,255,.4);background-color:rgba(255,255,255,.12)}
.pedal:hover{filter:brightness(1.12)}
.big:active,.sig:active,.cam:active{transform:scale(.95)}
.pedal:active{transform:scale(.96)}
.rlever .gr:hover,.rlever .gear:hover{color:#cbd5e1!important}
.sig:focus-visible,.cam:focus-visible,.big:focus-visible,.pedal:focus-visible,.gr:focus-visible,.ndp-btn:focus-visible{outline:3px solid #5EEAD4;outline-offset:2px}
.ctl .shiftmsg{position:absolute}
/* pause overlay (same in every mode) */
.ndpause{position:absolute;inset:0;z-index:40;display:grid;place-items:center;padding:16px;background:rgba(3,6,16,.62);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);direction:rtl;font-family:Assistant,Rubik,Arial,sans-serif;color:#F1F5FF}
.ndpause[hidden]{display:none}
.ndp-card{width:min(400px,100%);background:rgba(15,20,44,.97);border:1px solid rgba(255,255,255,.14);border-radius:24px;padding:22px;display:flex;flex-direction:column;gap:10px;text-align:center;box-shadow:0 24px 60px rgba(0,0,0,.5)}
.ndp-card h2{margin:0 0 4px;font:900 1.4rem Rubik,Arial}
.ndp-card p{margin:0 0 6px;color:#A3AECB;font-size:.95rem}
.ndp-btn{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;border-radius:14px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.06);color:#F1F5FF;font:800 1rem Rubik,Arial;text-decoration:none}
.ndp-btn:hover{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.3)}
.ndp-btn.main{border:0;background:linear-gradient(90deg,#2DD4BF,#38BDF8);color:#042023}
.ndp-btn.main:hover{filter:brightness(1.07)}
.ndpbtn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
@media (prefers-reduced-motion:reduce){.sig,.cam,.big,.pedal,.gr,.ndp-btn,.rl-knob{transition:none!important}}
