:root { --ink:#1d2b2a; --sand:#f6f1e7; --teal:#0e7a6d; --teal2:#0a5c52; --card:#fffdf8; --red:#c94f3d; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin:0; height:100%; overflow:hidden; font-family: system-ui, "Segoe UI", Tahoma, sans-serif; color:var(--ink);
  overscroll-behavior:none; touch-action:manipulation; }
#map { position:fixed; inset:0; background:#cfe3dd; }

#topbar { position:fixed; top:0; right:0; left:0; z-index:1000; display:flex; justify-content:space-between;
  align-items:center; padding:10px 12px; pointer-events:none; }
#brand, #bank { background:var(--card); border-radius:14px; padding:7px 12px; font-weight:700;
  box-shadow:0 2px 10px rgba(0,0,0,.15); font-size:14px; pointer-events:auto; }

#toast { position:fixed; top:64px; right:16px; left:16px; z-index:1100; background:#222; color:#fff;
  border-radius:12px; padding:12px 14px; text-align:center; font-size:14px; box-shadow:0 4px 14px rgba(0,0,0,.3); }

#panel { position:fixed; right:0; left:0; bottom:0; z-index:1000; background:var(--sand);
  border-radius:20px 20px 0 0; padding:10px 14px calc(8px + env(safe-area-inset-bottom));
  box-shadow:0 -4px 18px rgba(0,0,0,.2); }
#status { font-size:14px; margin-bottom:6px; min-height:20px; }
#routeInfo { color:var(--teal2); font-weight:700; margin-top:4px; }
#controls { display:flex; gap:8px; }
button { font-family:inherit; cursor:pointer; border:0; border-radius:12px; padding:10px 14px; font-size:15px;
  background:#e8e0cf; color:var(--ink); font-weight:700; }
button:disabled { opacity:.45; cursor:default; }
#goBtn.big { flex:1; background:var(--teal); color:#fff; font-size:17px; padding:12px; }
#goBtn.big:not(:disabled) { background:var(--teal2); }
#speedRow { display:flex; align-items:center; gap:6px; margin-top:8px; font-size:13px; }
.speed { padding:5px 12px; font-size:13px; }
.speed.on { background:var(--teal); color:#fff; }

#modeRow { display:flex; gap:8px; margin-bottom:8px; }
#modeRow .mode { flex:1; font-size:13px; padding:8px 6px; background:#efe8d8; }
#modeRow .mode.on { background:var(--teal); color:#fff; }

#driveCtl { display:flex; justify-content:space-between; align-items:flex-end; gap:8px; margin:6px 0 2px; }
#driveCtl .pad { display:flex; gap:10px; }
.pbtn { width:68px; height:68px; border-radius:50%; font-size:24px; display:flex; align-items:center;
  justify-content:center; box-shadow:0 3px 10px rgba(0,0,0,.22); user-select:none; touch-action:none; }
.pbtn.steer { background:#efe8d8; color:var(--ink); font-size:22px; }
.pbtn.gas { background:var(--teal); color:#fff; }
.pbtn.brake { background:var(--red); color:#fff; }
.pbtn.down { transform:scale(.94); filter:brightness(.92); }
#speedoWrap { text-align:center; font-size:13px; color:var(--teal2); font-weight:800; margin:2px 0 0; }

#tabs { display:flex; gap:8px; margin-top:8px; }
#tabs button { flex:1; font-size:13px; padding:9px 4px; background:#efe8d8; }
#tabs b { color:var(--teal2); }

#sheet { position:fixed; right:0; left:0; bottom:0; top:18%; z-index:1200; background:var(--sand);
  border-radius:20px 20px 0 0; display:flex; flex-direction:column; box-shadow:0 -6px 24px rgba(0,0,0,.3); }
#sheetHead { display:flex; justify-content:space-between; align-items:center; padding:12px 14px;
  font-weight:800; font-size:16px; border-bottom:1px solid #e2d9c6; }
#sheetBody { overflow-y:auto; padding:8px 12px calc(16px + env(safe-area-inset-bottom)); }

.country { display:flex; align-items:center; gap:10px; padding:9px 6px; border-bottom:1px solid #eee5d3; }
.country .flag { font-size:24px; }
.country .nm { flex:1; font-size:15px; }
.country .rank { color:#8a7f66; font-size:12px; min-width:34px; text-align:center; }
.country .stamp { font-size:16px; }
.country.locked { opacity:.55; }
.carRow { display:flex; align-items:center; gap:10px; padding:10px 6px; border-bottom:1px solid #eee5d3; }
.carRow .emo { font-size:28px; }
.carRow .info { flex:1; }
.carRow .info b { display:block; font-size:15px; }
.carRow .info span { font-size:12px; color:#8a7f66; }
.carRow button { font-size:13px; padding:8px 12px; background:var(--teal); color:#fff; }
.carRow button:disabled { background:#c9bfa8; color:#5c5442; }
.carRow .owned { color:var(--teal2); font-weight:800; font-size:13px; }
.carRow.current .emo { outline:2px solid var(--teal); border-radius:10px; }

#credits { position:fixed; bottom:2px; left:6px; z-index:999; font-size:10px; color:#5c6b68; direction:ltr;
  background:rgba(255,255,255,.75); border-radius:6px; padding:1px 5px; }
#credits a { color:#5c6b68; }

.leaflet-container { font-family:inherit; }
.carWrap { position:relative; width:44px; height:44px; transition:transform .12s linear; }
.carWrap .carEmo { position:absolute; inset:0; font-size:26px; text-align:center; line-height:44px;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.carWrap .carArrow { position:absolute; left:50%; top:-2px; width:0; height:0; margin-left:-5px;
  border-left:5px solid transparent; border-right:5px solid transparent; border-bottom:9px solid var(--teal2); }
.destIcon { font-size:26px; text-align:center; }
.trafficIcon { font-size:20px; text-align:center; line-height:1; opacity:.92; filter:drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
[hidden]{display:none !important}

/* مشي + معالم */
.wide { display:block; width:100%; margin-top:6px; padding:12px 10px; border:0; border-radius:12px; background:#0e7a6d; color:#fff; font-size:15px; font-weight:700; cursor:pointer; }
.wide:active { transform:scale(.97); }
#callCarBtn { background:#8a6d1d; }
#enterCarBtn { background:#b45309; }
.parkedEmo { font-size:28px; text-shadow:0 2px 4px rgba(0,0,0,.45); }
.lmIcon { font-size:22px; text-shadow:0 1px 3px rgba(0,0,0,.5); }
.lmTip { direction:rtl; font-weight:700; font-size:12px; background:#fff8ea; border:1px solid #d8c89a; border-radius:8px; padding:2px 8px; box-shadow:0 2px 6px rgba(0,0,0,.2); }
