:root {
  --bg: #0e1013;
  --panel: rgba(16, 18, 22, 0.88);
  --panel-2: rgba(28, 31, 37, 0.9);
  --line: rgba(255, 255, 255, 0.09);
  --text: #eceae4;
  --muted: #9aa0a8;
  --amber: #ffb020;
  --amber-2: #ff8a10;
  --red: #e5402c;
  --green: #3ccf6e;
  --blue: #4aa3ff;
  --font: "Rajdhani", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Share Tech Mono", "Courier New", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font-family: inherit; }

.btn {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 12px; font-size: 15px; font-weight: 600; cursor: pointer; letter-spacing: .3px;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { border-color: rgba(255, 176, 32, .5); background: #2a2e36; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #ffbe3a, #ff9410); color: #1a1206; border-color: #ffb020; }
.btn.primary:hover { background: linear-gradient(180deg, #ffc955, #ffa020); }
.btn.big { font-size: 20px; padding: 12px 26px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 14px; }
.chk { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 15px; cursor: pointer; }
select { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; font-family: inherit; font-size: 15px; font-weight: 600; }

/* ---------- Meniu ---------- */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 20; }
.menu-bg { position: absolute; inset: 0; background: radial-gradient(ellipse 80% 70% at 30% 20%, #1c2a44 0%, #0d121c 55%, #06080d 100%), repeating-linear-gradient(115deg, rgba(255,176,32,.05) 0 2px, transparent 2px 38px); background-blend-mode: normal; }

/* ---------- Garaj ---------- */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: 58px; display: flex; align-items: center; gap: 16px; padding: 0 16px; background: linear-gradient(180deg, rgba(8,9,11,.92), rgba(8,9,11,.6)); border-bottom: 1px solid var(--line); z-index: 5; }
.brand { font-size: 22px; letter-spacing: 1px; white-space: nowrap; }
.brand b { color: var(--amber); }
.brand span { color: var(--muted); font-weight: 600; margin-left: 6px; }
.money { font-family: var(--mono); font-size: 22px; color: var(--green); background: rgba(0,0,0,.35); border: 1px solid var(--line); padding: 4px 12px; border-radius: 8px; white-space: nowrap; }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.drive-group { display: flex; gap: 6px; margin-left: 8px; }

.panel { position: fixed; top: 70px; bottom: 44px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; z-index: 4; display: flex; flex-direction: column; overflow: hidden; }
.panel.left { left: 12px; width: 380px; }
.panel.right { right: 12px; width: 300px; padding: 14px 16px; overflow-y: auto; }
.panel h3 { margin: 0 0 10px; font-size: 18px; letter-spacing: 1px; color: var(--amber); text-transform: uppercase; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); }
.tab { background: transparent; border: 1px solid transparent; color: var(--muted); padding: 6px 2px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.tab i { font-style: normal; font-size: 18px; }
.tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.tab.on { color: #1a1206; background: var(--amber); }
.list { overflow-y: auto; padding: 8px 10px 14px; flex: 1; }
.slot { margin: 10px 0 4px; }
.slot-name { font-size: 13px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; font-weight: 700; margin: 8px 2px 6px; }
.part { border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 10px; padding: 9px 11px; margin-bottom: 6px; cursor: pointer; transition: border-color .12s, background .12s; }
.part:hover { border-color: rgba(255,176,32,.35); background: rgba(255,255,255,.05); }
.part.equipped { border-color: rgba(60,207,110,.55); background: rgba(60,207,110,.07); }
.part.preview { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber) inset; }
.part-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.part-name { font-weight: 700; font-size: 17px; }
.part-price { font-family: var(--mono); color: var(--amber); font-size: 15px; white-space: nowrap; }
.part-price.owned { color: var(--green); }
.part-desc { color: var(--muted); font-size: 14px; line-height: 1.25; margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip { font-size: 12.5px; padding: 1px 7px; border-radius: 20px; background: rgba(255,255,255,.07); color: #cfd2d6; font-weight: 600; }
.chip.good { background: rgba(60,207,110,.15); color: #8ff0b0; }
.chip.bad { background: rgba(229,64,44,.15); color: #ffa090; }
.part-act { margin-top: 8px; display: flex; gap: 6px; }
.part-act .btn { padding: 4px 10px; font-size: 14px; }

.paint-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 6px 0 10px; }
.swatch { aspect-ratio: 1; border-radius: 8px; border: 2px solid rgba(255,255,255,.15); cursor: pointer; }
.swatch.on { border-color: var(--amber); box-shadow: 0 0 0 2px rgba(255,176,32,.4); }
.row { display: flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.row label { color: var(--muted); font-size: 14px; min-width: 88px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; color: var(--muted); border: none; padding: 5px 10px; cursor: pointer; font-weight: 700; font-size: 14px; }
.seg button.on { background: var(--amber); color: #1a1206; }
input[type=text] { background: #0c0e11; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-family: var(--mono); font-size: 16px; width: 150px; text-transform: uppercase; }
input[type=range] { accent-color: var(--amber); flex: 1; }
input[type=color] { width: 44px; height: 32px; border: none; background: none; padding: 0; cursor: pointer; }

.stat { margin: 9px 0; }
.stat-top { display: flex; justify-content: space-between; font-size: 15px; }
.stat-top span { color: var(--muted); font-weight: 600; }
.stat-top b { font-family: var(--mono); font-weight: 400; font-size: 16px; }
.stat-top em { font-style: normal; font-family: var(--mono); font-size: 14px; margin-left: 6px; }
.stat-top em.good { color: var(--green); }
.stat-top em.bad { color: var(--red); }
.stat-bar { height: 7px; background: rgba(255,255,255,.07); border-radius: 4px; margin-top: 4px; overflow: hidden; position: relative; }
.stat-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #ff8a10, #ffc040); border-radius: 4px; transition: width .25s; }
.stat-bar i.ghost { background: rgba(255,255,255,.3); }
.spec { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.spec b { color: var(--text); font-weight: 600; }
.open-bar { position: fixed; bottom: 46px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 3; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 760px); }
.open-bar .btn { padding: 5px 10px; font-size: 14px; background: rgba(16,18,22,.85); }
.open-bar .btn.on { background: var(--amber); color: #1a1206; border-color: var(--amber); }
.garage-hint { position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 14px; background: rgba(0,0,0,.45); padding: 5px 14px; border-radius: 20px; white-space: nowrap; z-index: 3; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud .btn { pointer-events: auto; }
.cluster, #cluster { display: none; }
#speedo { position: absolute; bottom: 14px; right: 14px; }
#hud.cockpit #speedo, #hud.foot #speedo { display: none; }
#minimap { position: absolute; top: 12px; right: 12px; border-radius: 50%; box-shadow: 0 4px 16px rgba(0,0,0,.45); opacity: .92; }
.hud-tl { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.race { position: relative; background: rgba(12,14,17,.5); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 6px 10px; min-width: 150px; font-size: 13px; line-height: 1.35; }
.race .r { display: flex; justify-content: space-between; gap: 12px; }
.race .r span { color: var(--muted); font-weight: 600; }
.race .r b { font-family: var(--mono); font-weight: 400; }
.race .r.money b { color: var(--green); }
.race .t { color: var(--amber); font-weight: 700; letter-spacing: 1.5px; font-size: 11px; margin-bottom: 1px; }
#dmgCv { position: absolute; bottom: 14px; left: 12px; border-radius: 10px; }
.ctx-hint { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); font-size: 14px; color: #fff; background: rgba(0,0,0,.5); padding: 5px 14px; border-radius: 16px; opacity: 0; transition: opacity .25s; white-space: nowrap; }
.ctx-hint.show { opacity: 1; }
.tv-hud { position: absolute; right: 18px; bottom: 18px; display: none; flex-direction: column; align-items: flex-end; gap: 2px; background: rgba(8,10,14,.62); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; color: #fff; backdrop-filter: blur(6px); }
.tv-hud.show { display: flex; }
.tv-hud b { color: var(--amber); font-size: 15px; letter-spacing: .02em; }
.tv-hud span { font-family: var(--mono); font-size: 28px; line-height: 1.05; font-weight: 700; }
.tv-hud em { font-style: normal; font-size: 12px; color: #c9cfd6; }
.ctx-hint b { color: var(--amber); font-family: var(--mono); }
.btn.repair { border-color: rgba(229,64,44,.6); }
.btn.repair.ok { border-color: var(--line); opacity: .6; }
.bar { background: rgba(0,0,0,.5); border: 1px solid var(--line); height: 16px; border-radius: 8px; position: relative; overflow: hidden; margin-bottom: 8px; }
.bar label { position: absolute; left: 8px; top: -1px; font-size: 13px; font-weight: 700; z-index: 2; }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: linear-gradient(90deg, #1f7ad8, #6ad0ff); }
.surface { font-size: 14px; color: var(--muted); }
.hint-strip { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); font-size: 12px; color: rgba(255,255,255,.45); white-space: nowrap; display: none; }
.bigmsg { position: absolute; top: 20%; left: 50%; transform: translateX(-50%); text-align: center; font-size: 34px; font-weight: 700; letter-spacing: 2px; text-shadow: 0 4px 20px rgba(0,0,0,.8); opacity: 0; transition: opacity .3s; white-space: nowrap; }
.bigmsg small { display: block; font-size: 17px; color: var(--amber); letter-spacing: 1px; }
.bigmsg.show { opacity: 1; }
.cam-label { position: absolute; top: 196px; right: 14px; font-size: 13px; color: #fff; text-shadow: 0 1px 4px #000; text-align: right; width: 200px; opacity: 0; transition: opacity .4s; }
.cam-label.show { opacity: 1; }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .6s ease; z-index: 60; }
#fade.on { opacity: 1; }

#toast { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: rgba(12,14,17,.94); border: 1px solid var(--line); border-left: 4px solid var(--amber); padding: 8px 16px; border-radius: 8px; font-size: 17px; font-weight: 600; animation: tin .25s ease-out; }
.toast.good { border-left-color: var(--green); }
.toast.bad { border-left-color: var(--red); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Modal ---------- */
#modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { position: relative; background: #121418; border: 1px solid var(--line); border-radius: 16px; max-width: 980px; width: 100%; max-height: 92vh; overflow: auto; padding: 22px 24px; }
.modal-x { position: sticky; top: 0; float: right; z-index: 2; margin: -12px -10px 0 8px; width: 44px; height: 44px; border-radius: 50%; background: rgba(40,44,52,.95); border: 1px solid var(--line); color: #fff; font-size: 22px; cursor: pointer; }
.modal-box h2 { margin: 0 0 12px; color: var(--amber); letter-spacing: 1px; }
.dyno-wrap { display: grid; grid-template-columns: 1fr 250px; gap: 18px; }
.dyno-wrap canvas { width: 100%; background: #0a0b0d; border-radius: 10px; border: 1px solid var(--line); }
.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.kv span { color: var(--muted); }
.kv b { font-family: var(--mono); font-weight: 400; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 18px; }
.help-grid div { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
kbd { font-family: var(--mono); background: #23262c; border: 1px solid #3a3e46; border-bottom-width: 3px; border-radius: 6px; padding: 0 7px; min-width: 28px; text-align: center; color: #fff; }

@media (max-width: 1100px) {
  .panel.right { display: none; }
  .open-bar { max-width: calc(100% - 430px); left: calc(50% + 200px); }
  .top-actions .btn span { display: none; }
  .topbar { gap: 10px; padding: 0 10px; }
  .money { font-size: 18px; }
  .brand span { display: none; }
  .speed-digital { display: none; }
}
@media (max-width: 1000px) {
  .cluster { transform: scale(.6); }
}
@media (max-width: 760px) {
  .open-bar { left: 50%; max-width: calc(100% - 24px); bottom: calc(44vh + 56px); }
  .panel.left { width: calc(100% - 24px); top: auto; height: 44vh; bottom: 44px; }
  .top-actions .btn:not(.primary):not(#btnDyno) { display: none; }
  .brand { display: none; }
  .cluster { transform: scale(.55); }
  #minimap { transform: scale(.6); transform-origin: top right; }
  .hud-tl { transform: scale(.85); transform-origin: top left; }
  .garage-hint { display: none; }
  .dyno-wrap { grid-template-columns: 1fr; }
}

/* mașinile din garaj */
.car-tabs { display: flex; gap: 4px; padding: 8px 8px 0; }
.car-tab { flex: 1; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 6px 4px; font: 600 13px/1.1 inherit; font-family: inherit; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-tab i { font-style: normal; margin-right: 4px; }
.car-tab.on { background: var(--amber); color: #1a1206; border-color: var(--amber); }
.car-tab:hover:not(.on) { color: #fff; border-color: rgba(255,255,255,.3); }
/* bule de vorbă deasupra pietonilor */
.bubble { position: absolute; left: 0; top: 0; max-width: 240px; background: rgba(255,255,255,.94); color: #15171a; font-size: 14px; font-weight: 600; line-height: 1.25; padding: 6px 10px; border-radius: 12px; box-shadow: 0 3px 10px rgba(0,0,0,.35); white-space: normal; text-align: center; pointer-events: none; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); border: 7px solid transparent; border-top-color: rgba(255,255,255,.94); border-bottom: 0; }

/* navigație: săgeata spre traseu + distanța */
.nav { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: rgba(12,14,17,.62); border: 1px solid rgba(255,194,26,.5); border-radius: 12px; padding: 5px 14px 5px 8px; opacity: 0; transition: opacity .3s; }
.nav.show { opacity: 1; }
.nav i { font-style: normal; font-size: 26px; color: #ffc21a; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; text-shadow: 0 2px 4px #000; transition: transform .15s linear; }
.nav span { display: flex; flex-direction: column; line-height: 1.15; }
.nav b { font-size: 14px; color: #fff; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav small { font-family: var(--mono); color: #ffc21a; font-size: 14px; }
/* harta mare (Tab) */
#bigMap { position: absolute; inset: 5vh 5vw; width: 90vw; height: 90vh; border-radius: 16px; border: 2px solid rgba(255,176,32,.6); box-shadow: 0 10px 60px rgba(0,0,0,.7); display: none; pointer-events: auto; cursor: crosshair; }
#bigMap.show { display: block; }

/* urmărit de miliție: steluțe + bară „te prinde” */
.wanted { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: none; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 18px; background: rgba(10,14,30,.72); border: 1px solid rgba(90,140,255,.55); color: #fff; font-size: 13px; letter-spacing: .06em; font-weight: 700; }
.wanted.show { display: flex; animation: wantedPulse 1s infinite alternate; }
.wanted .stars { color: #ffd23a; font-size: 17px; letter-spacing: 2px; }
.wanted .bar { width: 70px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.18); overflow: hidden; display: block; }
.wanted .bar b { display: block; height: 100%; width: 0; background: #ff4a3a; }
@keyframes wantedPulse { from { box-shadow: 0 0 0 rgba(60,110,255,0); } to { box-shadow: 0 0 16px rgba(60,110,255,.75); border-color: rgba(255,70,70,.7); } }

/* ---------- atelierul ---------- */
#garageUI.ws-on .panel, #garageUI.ws-on .open-bar, #garageUI.ws-on .garage-hint { display: none; }
.ws-panel { position: absolute; left: 16px; top: 76px; width: 340px; max-width: calc(100vw - 32px); max-height: calc(100vh - 100px); overflow: auto; background: rgba(14,16,20,.9); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; color: #e6e8ea; z-index: 6; }
.ws-head b { display: block; color: var(--amber); font-size: 17px; letter-spacing: .5px; }
.ws-head small { color: var(--muted); font-size: 12px; }
.ws-now { margin: 12px 0 8px; font-size: 15px; line-height: 1.4; }
.ws-now span { display: block; font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 3px; }
.ws-prog { height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.ws-prog i { display: block; height: 100%; width: 0; background: var(--amber); transition: width .1s; }
.ws-choose { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ws-choose .btn { text-align: left; justify-content: flex-start; }
.ws-choose .btn:disabled { opacity: .35; text-decoration: line-through; }
.ws-steps { margin: 12px 0 8px; padding-left: 20px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.ws-steps li.done { color: #5fd08a; }
.ws-steps li.cur { color: #fff; font-weight: 600; }
.ws-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.ws-foot b { color: var(--amber); }
.ws-labels { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.ws-lbl { position: absolute; transform: translate(-50%, -150%); background: rgba(0,0,0,.72); color: #ffd36a; border: 1px solid rgba(255,176,32,.6); font: 700 12px var(--mono, monospace); padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.ws-lbl.ok { color: #6ee39a; border-color: rgba(80,210,130,.6); }
.ws-lbl.hold { color: #fff; }
.ws-lbl.off { color: #ff8a7a; border-color: rgba(255,90,70,.6); }
.ws-gauge { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); width: min(460px, calc(100vw - 32px)); background: rgba(14,16,20,.9); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; z-index: 6; color: #e6e8ea; text-align: center; }
.ws-g-t { font-size: 14px; margin-bottom: 10px; }
.ws-g-bar { position: relative; height: 18px; border-radius: 9px; background: linear-gradient(90deg, #6b2a22, #3a3d42 30%, #3a3d42 70%, #6b2a22); }
.ws-g-bar i { position: absolute; top: 0; bottom: 0; background: rgba(60,210,120,.75); border-radius: 6px; }
.ws-g-bar b { position: absolute; top: -5px; width: 4px; height: 28px; margin-left: -2px; background: #fff; border-radius: 2px; box-shadow: 0 0 8px #fff; }
.ws-g-h { font-size: 12px; color: var(--muted); margin-top: 8px; }
.ws-card { display: flex; gap: 14px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 8px 0; background: rgba(255,255,255,.03); }
.ws-card b { color: #fff; } .ws-card small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.4; }
.ws-card .pay { color: var(--amber); font-weight: 700; white-space: nowrap; }
.ws-card .save { color: #5fd08a; font-size: 12px; }
.modal-box h3 { margin: 16px 0 6px; color: #e6e8ea; } .modal-box h3 small { color: var(--muted); font-weight: 400; }
.ws-lvl { color: var(--muted); }
@media (max-width: 760px) { .ws-panel { top: auto; bottom: 12px; max-height: 44vh; } .ws-gauge { bottom: calc(44vh + 24px); } }

.pause-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.pause-btns .btn { justify-content: flex-start; text-align: left; padding: 10px 14px; font-size: 15px; }
.pause-btns .btn[disabled] { opacity: .45; cursor: not-allowed; }
.fps { background: rgba(12,14,17,.6); border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 3px 9px; font: 600 13px var(--mono), monospace; color: #9be88a; pointer-events: none; }
.fps:empty { display: none; }
.fps.low { color: #ffb020; } .fps.bad { color: #ff6a50; }

/* ---- multiplayer online ---- */
.net-badge { position: fixed; top: 46%; left: 6px; transform: translateY(-50%); z-index: 6; padding: 4px 8px; border-radius: 8px; background: rgba(16,18,22,.55); color: #eceae4; font: 600 12px var(--mono), monospace; text-align: left; pointer-events: none; opacity: .8; max-width: 140px; }
.net-badge.hidden { display: none; }
.net-badge small { color: #9aa0a8; font-weight: 500; }
.net-labels { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.net-label { position: absolute; left: 0; top: 0; padding: 2px 8px; border-radius: 6px; background: rgba(16,18,22,.65); color: #fff; font: 600 13px var(--mono), monospace; text-shadow: 0 1px 2px #000; white-space: nowrap; }
#olName, #olCode { background: #1c1f25; border: 1px solid var(--line); color: var(--text); padding: 6px 8px; border-radius: 6px; font: inherit; }

/* ---- chat online ---- */
.net-chat { position: fixed; left: 14px; bottom: 150px; width: min(420px, 60vw); z-index: 25; pointer-events: none; font: 600 13px var(--mono), monospace; }
.net-chat.hidden { display: none; }
.net-chat-log { max-height: 160px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.net-chat-line { padding: 2px 8px; margin-top: 2px; border-radius: 5px; background: rgba(16,18,22,.7); color: #eceae4; text-shadow: 0 1px 2px #000; word-break: break-word; transition: opacity .6s; }
.net-chat-line b { color: var(--amber); }
.net-chat-line.sys { color: #9aa0a8; font-weight: 500; }
.net-chat-line.old { opacity: 0; }
.net-chat.typing .net-chat-log { overflow-y: auto; pointer-events: auto; }
.net-chat.typing .net-chat-line.old { opacity: 1; }
.net-chat-in { display: none; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 7px 9px; border-radius: 6px; border: 1px solid var(--amber); background: rgba(16,18,22,.92); color: var(--text); font: inherit; pointer-events: auto; }
.net-chat.typing .net-chat-in { display: block; }

.net-label.talk { background: rgba(40,140,50,.85); box-shadow: 0 0 0 2px #7fd66a; }
.net-label.talk::before { content: '🔊 '; }

/* ---- comenzi tactile (telefon / tabletă) ---- */
html.touch, html.touch body { overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
html.touch #gl { touch-action: none; }
html.touch input, html.touch select { -webkit-user-select: text; user-select: text; }
.t-root { position: fixed; inset: 0; z-index: 12; pointer-events: none; font-family: var(--ui, inherit); }
.t-root.hidden { display: none; }
.t-root button, .t-pad { pointer-events: auto; touch-action: none; }
.t-btn { border: 2px solid rgba(255,255,255,.28); background: rgba(14,16,20,.55); color: #fff; border-radius: 50%; font: 700 14px var(--ui, inherit); letter-spacing: .04em; padding: 0; line-height: 1.1; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.t-btn small { font-size: 9px; font-weight: 500; opacity: .75; }
.t-btn.on { background: rgba(255,176,32,.78); border-color: #ffb020; color: #111; }
.t-pad { position: absolute; left: max(14px, env(safe-area-inset-left)); bottom: 14px; width: 240px; height: 112px; border-radius: 56px; background: rgba(14,16,20,.4); border: 2px solid rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; }
.t-pad.on { border-color: #ffb020; }
.t-knob { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; background: rgba(255,255,255,.35); border: 2px solid rgba(255,255,255,.7); pointer-events: none; }
.t-padhint { font: 600 12px var(--mono), monospace; color: rgba(255,255,255,.4); pointer-events: none; }
.t-root.foot .t-pad { width: 168px; height: 168px; border-radius: 50%; }
.t-pedals { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: 14px; width: 270px; height: 236px; pointer-events: none; }
.t-pedals .t-btn { position: absolute; }
.t-gas { right: 0; bottom: 0; width: 114px; height: 114px; background: rgba(40,160,70,.5); }
.t-brake { right: 128px; bottom: 0; width: 90px; height: 90px; background: rgba(200,50,40,.5); }
.t-hb { right: 0; bottom: 128px; width: 62px; height: 62px; font-size: 11px; }
.t-nitro { right: 76px; bottom: 104px; width: 62px; height: 62px; font-size: 12px; background: rgba(40,110,220,.5); }
.t-horn { right: 150px; bottom: 104px; width: 50px; height: 50px; font-size: 20px; }
.t-root.foot .t-pedals { display: none; }
.t-foot-act { display: none; position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: 14px; width: 250px; height: 200px; pointer-events: none; }
.t-root.foot .t-foot-act { display: block; }
.t-foot-act .t-btn { position: absolute; width: 74px; height: 74px; }
.t-foot-act .t-jump { right: 0; bottom: 0; width: 104px; height: 104px; background: rgba(40,160,70,.5); }
.t-foot-act .t-act:nth-of-type(2) { right: 118px; bottom: 6px; }
.t-foot-act .t-act:nth-of-type(3) { right: 6px; bottom: 118px; }
.t-foot-act .t-act:nth-of-type(4) { right: 118px; bottom: 100px; }
.t-strip { position: absolute; left: 50%; transform: translateX(-50%); bottom: 10px; display: grid; grid-template-columns: repeat(4, 46px); gap: 6px; pointer-events: none; }
.t-s { width: 46px; height: 46px; font-size: 20px; }
.t-s.t-net { display: none; }
.t-root.net .t-s.t-net { display: block; }
.t-more { display: none; position: absolute; left: 50%; transform: translateX(-50%); bottom: 112px; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px; background: rgba(10,12,15,.85); border: 1px solid var(--line); border-radius: 14px; pointer-events: auto; }
.t-root.more .t-more { display: grid; }
.t-m { border-radius: 10px; padding: 10px 8px; font-size: 13px; white-space: nowrap; }
.touch .hint-strip, .touch .fps { display: none !important; }
.touch .ctx-hint { bottom: 118px; }
.touch #minimap { width: 118px !important; height: 118px !important; }
.touch .cam-label { top: 136px; }
.touch #speedo { bottom: auto; top: 140px; right: 8px; width: 150px !important; height: auto !important; }
.touch .net-chat { bottom: 132px; width: min(340px, 40vw); }
.touch .net-badge { top: 40%; font-size: 10px; padding: 3px 6px; }
@media (orientation: portrait) {
  html.touch.t-driving body::after { content: '↻ Întoarce telefonul pe orizontală'; position: fixed; inset: 0; z-index: 99; display: flex; align-items: center; justify-content: center; background: rgba(8,9,11,.94); color: #fff; font: 700 20px var(--ui, sans-serif); text-align: center; padding: 30px; }
}

/* ---- ecrane scunde (telefon în orizontală) ---- */
@media (max-height: 540px) {
  .screen { align-items: flex-start; overflow-y: auto; }
  .btn.big { font-size: 16px; padding: 9px 16px; }
  .topbar { height: 44px; }
  .panel { top: 52px; bottom: 8px; }
  .panel.left { width: min(340px, 44vw); }
  .garage-hint, .open-bar { display: none; }
  #modal .modal-box { max-height: calc(100vh - 16px); overflow-y: auto; }
}
.touch #dmgCv { bottom: auto; top: 118px; left: 8px; transform: scale(.7); transform-origin: top left; }
html.touch, html.touch body { overflow: hidden; }


/* vignetă fină peste imaginea 3D (gratis): încadrează scena fără să schimbe iluminarea */
#hud .vig { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 85% 80% at 50% 48%, rgba(0,0,0,0) 62%, rgba(0,0,0,.22) 100%); }
#hud.cockpit .vig { background: radial-gradient(ellipse 85% 80% at 50% 48%, rgba(0,0,0,0) 55%, rgba(0,0,0,.30) 100%); }


/* ---- bara de miliție: roșu = te prind, verde = scapi ---- */
.wanted .tag { font-size: 10px; letter-spacing: .08em; color: #c8d0ec; font-weight: 700; }
.wanted .bar.esc b { background: #3ddc6a; }
.wanted .bar { width: 64px; }
/* ---- upgrade maxim în tuning ---- */
.maxbar { margin: 0 0 10px; } .maxbar .btn { width: 100%; justify-content: space-between; display: flex; align-items: center; padding: 10px 14px; font-size: 15px; }
.maxbar .btn small { font-size: 12px; font-weight: 600; opacity: .85; }
.mx-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; max-height: 40vh; overflow: auto; } .mx-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,.05); } .mx-list li span { color: var(--amber); font-family: var(--mono), monospace; }

/* metrou */
#hud.metro #minimap, #hud.metro #race, #hud.metro #wanted, #hud.metro #nav, #hud.metro .vig { display: none !important; }
#metroUI { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); width: min(780px, calc(100vw - 24px)); display: none; flex-direction: column; gap: 8px; z-index: 40; pointer-events: none; color: #fff; }
#metroUI.on { display: flex; }
#metroUI .mu-top { display: flex; align-items: center; gap: 10px; background: rgba(8,10,14,.72); border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px; backdrop-filter: blur(6px); }
#metroUI .mu-m { width: 30px; height: 30px; border-radius: 50%; background: #c4122b; color: #fff; font: 700 18px/30px Arial; text-align: center; }
#metroUI .mu-title { font-size: 20px; letter-spacing: .02em; }
#metroUI .mu-body { display: flex; flex-direction: column; gap: 6px; align-items: stretch; pointer-events: auto; background: rgba(8,10,14,.72); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; backdrop-filter: blur(6px); }
#metroUI .mu-body:empty { display: none; }
#metroUI .mu-h, #metroUI .mu-wait { font-size: 15px; color: #dfe3e8; }
#metroUI .mu-wait b { color: var(--amber); }
#metroUI .mu-btn { display: flex; align-items: center; gap: 10px; text-align: left; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.18); color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 15px; cursor: pointer; }
#metroUI .mu-btn:hover { background: rgba(255,255,255,.16); }
#metroUI .mu-btn i { font-style: normal; font-weight: 700; min-width: 34px; text-align: center; border-radius: 8px; padding: 2px 6px; background: #444; }
#metroUI .mu-btn span { flex: 1; }
#metroUI .mu-btn kbd { font-family: var(--mono); color: var(--amber); }
#metroUI .mu-btn.up i { background: #2a2f38; }
#metroUI .mu-strip { align-self: center; width: 100%; max-width: 760px; background: rgba(8,10,14,.6); border-radius: 12px; border: 1px solid var(--line); }

/* ecranul de încărcare */
#loadOverlay { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; background: rgba(28,30,34,0.86); backdrop-filter: grayscale(1) blur(2px); }
#loadOverlay.hidden { display: none; }
#loadOverlay .lo-box { text-align: center; color: #e8e6e0; font-family: inherit; width: min(420px, 86vw); }
#loadOverlay .lo-spin { width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 50%; border: 5px solid rgba(255,255,255,0.15); border-top-color: #ffb020; animation: lo-rot 0.9s linear infinite; }
#loadOverlay .lo-title { font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
#loadOverlay .lo-msg { margin-top: 8px; font-size: 14px; color: #b9bcc2; min-height: 18px; }
#loadOverlay .lo-bar { margin-top: 14px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.12); overflow: hidden; }
#loadOverlay .lo-bar i { display: block; height: 100%; width: 5%; background: #ffb020; transition: width 0.3s; }
@keyframes lo-rot { to { transform: rotate(360deg); } }

/* ---------- meniul de start ---------- */
.menu-card { position: relative; width: min(560px, calc(100% - 32px)); padding: 36px 36px 26px; background: rgba(10, 12, 15, .8); border: 1px solid var(--line); border-radius: 20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.menu-kicker { color: var(--amber); letter-spacing: .22em; text-transform: uppercase; font-size: 13px; font-weight: 700; }
.menu-card h1 { font-size: 72px; line-height: .95; margin: 8px 0 10px; letter-spacing: 2px; font-weight: 700; }
.menu-card h1 span { color: var(--amber); }
.menu-sub { color: #c6cad0; font-size: 18px; line-height: 1.4; margin: 0 0 24px; }
.menu-actions { display: grid; gap: 10px; }
.mbtn { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 13px 44px 13px 18px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text); text-align: left; cursor: pointer; transition: background .15s, border-color .15s, transform .08s; }
.mbtn::after { content: '›'; position: absolute; right: 18px; top: 50%; transform: translateY(-52%); font-size: 26px; line-height: 1; color: var(--muted); }
.mbtn b { font-size: 20px; font-weight: 700; letter-spacing: .02em; }
.mbtn small { font-size: 14px; color: var(--muted); font-weight: 500; }
.mbtn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,176,32,.5); }
.mbtn:active { transform: translateY(1px); }
.mbtn:focus-visible, .pz-act:focus-visible, .pz-go:focus-visible, .set-tabs button:focus-visible, .set-seg button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.mbtn.primary { background: linear-gradient(180deg, #ffbe3a, #ff9410); border-color: #ffb020; color: #1a1206; }
.mbtn.primary small, .mbtn.primary::after { color: rgba(26,18,6,.72); }
.mbtn.primary:hover { background: linear-gradient(180deg, #ffc955, #ffa020); }
.menu-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.menu-save { color: var(--muted); font-size: 15px; font-weight: 600; }
.menu-links { display: flex; gap: 4px; }
.menu-links button { background: none; border: 1px solid transparent; color: var(--text); font: 600 15px var(--font); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.menu-links button:hover { background: rgba(255,255,255,.07); border-color: var(--line); }
.loading { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.loading::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); animation: dtPulse 1s ease-in-out infinite alternate; }
.loading.ready::before { background: var(--green); animation: none; }
@keyframes dtPulse { from { opacity: .25; } to { opacity: 1; } }

/* ---------- ferestre: „Înapoi” ---------- */
.modal-back { position: sticky; top: 0; z-index: 2; display: inline-flex; align-items: center; height: 36px; margin: 0 0 12px; padding: 0 14px; border-radius: 18px; background: rgba(40,44,52,.92); border: 1px solid var(--line); color: var(--text); font: 600 15px var(--font); cursor: pointer; }
.modal-back:hover { border-color: rgba(255,176,32,.5); }

/* ---------- setări ---------- */
.set-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 18px; border-radius: 12px; background: rgba(255,255,255,.05); }
.set-tabs button { flex: 1; border: 0; background: none; color: var(--muted); padding: 9px 6px; border-radius: 9px; cursor: pointer; font: 600 15px var(--font); }
.set-tabs button:hover { color: var(--text); }
.set-tabs button.on { background: rgba(255,176,32,.16); color: var(--amber); }
.set-pane { display: flex; flex-direction: column; }
.set-pane.hidden { display: none; }
.set-field { display: grid; gap: 8px; margin-bottom: 16px; }
.set-label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.set-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.set-seg button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 46px; padding: 9px 8px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text); cursor: pointer; }
.set-seg button b { font-size: 16px; }
.set-seg button small { color: var(--muted); font-size: 12px; line-height: 1.2; text-align: center; }
.set-seg button:hover { background: rgba(255,255,255,.08); }
.set-seg button.on { border-color: var(--amber); background: rgba(255,176,32,.14); }
.set-seg button.on b { color: var(--amber); }
.set-row, .set-danger { display: flex; align-items: center; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.set-row > span, .set-danger > span { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-row b, .set-danger b { font-size: 16px; font-weight: 600; }
.set-row small, .set-danger small { color: var(--muted); font-size: 13px; }
.set-sw { cursor: pointer; }
.set-sw input { position: absolute; opacity: 0; pointer-events: none; }
.set-sw i { flex: none; position: relative; width: 44px; height: 26px; border-radius: 13px; background: rgba(255,255,255,.16); transition: background .2s; }
.set-sw i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.set-sw input:checked + i { background: var(--amber); }
.set-sw input:checked + i::after { transform: translateX(18px); }
.set-sw input:focus-visible + i { outline: 2px solid #fff; outline-offset: 2px; }
.set-range input { flex: 0 1 220px; min-width: 110px; accent-color: var(--amber); }
.set-range output { flex: none; width: 44px; text-align: right; font-family: var(--mono); color: var(--amber); }
.set-danger { margin-top: 12px; }
.btn.danger { background: #5c1d16; border-color: var(--red); color: #fff; }
.set-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.set-stats div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.05); }
.set-stats span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.set-stats b { font: 600 19px var(--mono), monospace; }
.set-foot { margin: 16px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
#modal:has(.set-solo) .modal-box { max-width: 560px; }
.set-solo h2 { margin-bottom: 16px; }

/* ---------- meniul de pauză ---------- */
#modal:has(.pz) .modal-box { max-width: 880px; padding: 0; overflow: hidden; background: rgba(14,16,20,.95); border-radius: 20px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 30px 90px rgba(0,0,0,.6); }
#modal:has(.pz) .modal-x { display: none; }
.pz { display: grid; grid-template-columns: 260px 1fr; max-height: 92vh; }
.pz-side { display: flex; flex-direction: column; gap: 6px; padding: 24px 16px 18px; background: rgba(255,255,255,.03); border-right: 1px solid var(--line); }
.pz-side h2 { margin: 0 0 12px 4px; color: #fff; font-size: 30px; letter-spacing: .04em; }
.pz-go { margin-bottom: 8px; padding: 14px; border: 0; border-radius: 12px; background: linear-gradient(180deg, #ffbe3a, #ff9410); color: #1a1206; font: 700 19px var(--font); letter-spacing: .03em; cursor: pointer; }
.pz-go:hover { filter: brightness(1.07); }
.pz-act { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 11px 12px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--text); text-align: left; cursor: pointer; }
.pz-act b { font-size: 16px; font-weight: 600; }
.pz-act small { color: var(--muted); font-size: 12px; }
.pz-act:hover:not([disabled]) { background: rgba(255,255,255,.06); border-color: var(--line); }
.pz-act[disabled] { opacity: .45; cursor: not-allowed; }
.pz-sep { flex: 1; min-height: 12px; }
#pzMenu b { color: var(--muted); }
.pz .set { padding: 22px 26px 18px; overflow-y: auto; }
.pz .set-pane { min-height: 330px; }
@media (max-width: 720px) {
  .menu-card { padding: 26px 20px 20px; }
  .menu-card h1 { font-size: 54px; }
  .menu-sub { font-size: 16px; }
  #modal:has(.pz) .modal-box { max-height: calc(100vh - 16px); overflow-y: auto; }
  .pz { grid-template-columns: 1fr; max-height: none; }
  .pz-side { flex-direction: row; flex-wrap: wrap; padding: 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .pz-side h2 { flex: 1 1 100%; font-size: 24px; margin-bottom: 4px; }
  .pz-go { flex: 1 1 100%; }
  .pz-act { flex: 1 1 auto; background: rgba(255,255,255,.05); }
  .pz-act small, .pz-sep { display: none; }
  .pz .set { padding: 16px; }
  .pz .set-pane { min-height: 0; }
  .set-seg button small { display: none; }
}
@media (max-height: 540px) {
  .menu-card { margin: 8px auto; padding: 14px 22px; }
  .menu-card h1 { font-size: 40px; margin: 2px 0 4px; }
  .menu-kicker { font-size: 11px; }
  .menu-sub { font-size: 13px; margin: 0 0 10px; }
  .menu-actions { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .mbtn { padding: 9px 30px 9px 12px; }
  .mbtn::after { right: 10px; font-size: 20px; }
  .mbtn b { font-size: 16px; } .mbtn small { font-size: 12px; }
  .menu-bar { margin-top: 10px; padding-top: 8px; }
  .loading { margin-top: 6px; font-size: 12px; }
  .pz { grid-template-columns: 210px 1fr; max-height: calc(100vh - 16px); }
  .pz-side { padding: 14px 12px; gap: 2px; }
  .pz-side h2 { font-size: 22px; margin-bottom: 6px; }
  .pz-go { padding: 10px; font-size: 17px; margin-bottom: 4px; }
  .pz-act { padding: 7px 10px; }
  .pz .set { padding: 14px 18px; }
  .pz .set-pane { min-height: 0; }
  .set-tabs { margin-bottom: 10px; }
  .set-row, .set-danger { padding: 8px 0; }
  .set-foot { display: none; }
}
