* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0d1117;
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  color: #fff;
  cursor: default;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- crosshair ---------- */
#crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
#crosshair::before,
#crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, .85);
  box-shadow: 0 0 2px rgba(0, 0, 0, .6);
}
#crosshair::before { left: 50%; top: 0; width: 2px; height: 100%; transform: translateX(-50%); }
#crosshair::after  { top: 50%; left: 0; height: 2px; width: 100%; transform: translateY(-50%); }
body.playing #crosshair { opacity: 1; }

/* ---------- hud ---------- */
#hud {
  position: fixed;
  left: 16px;
  top: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(10, 14, 20, .42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .1);
  font-size: 12.5px;
  line-height: 1.7;
  letter-spacing: .2px;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
  min-width: 190px;
}
body.playing #hud { opacity: 1; }
#hud .row { display: flex; justify-content: space-between; gap: 18px; }
#hud .k { color: rgba(255, 255, 255, .5); }
#hud .v { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- overlay ---------- */
#overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 10, 16, .55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity .3s ease;
}
#overlay.hidden { opacity: 0; pointer-events: none; }

.panel {
  width: min(420px, 88vw);
  padding: 34px 34px 28px;
  border-radius: 18px;
  background: rgba(16, 22, 32, .72);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  text-align: center;
}

.panel h1 {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -.5px;
}
.panel .sub {
  margin-top: 6px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, .55);
}

#play {
  margin: 22px 0 4px;
  width: 100%;
  padding: 13px 20px;
  font: inherit;
  font-weight: 600;
  font-size: 14.5px;
  color: #0c1119;
  background: #eaf2ff;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
#play:hover { background: #fff; transform: translateY(-1px); }
#play:active { transform: translateY(0); }

.controls {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  font-size: 12.5px;
}
.controls li { display: flex; justify-content: space-between; gap: 10px; }
.controls b {
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 11.5px;
}
.controls span { color: rgba(255, 255, 255, .5); }

.note {
  margin-top: 16px;
  font-size: 12px;
  color: #ff9a9a;
  min-height: 1em;
}

/* ---------- overlay peste bara de timp ---------- */
#overlay { z-index: 5; }

/* ---------- bara pentru ora din zi (traieste in panoul de setari) ---------- */
#timebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-top: 8px;
  font-size: 12.5px;
}
#timebar #tb-slider { flex: 1 1 150px; width: auto; min-width: 0; }
#timebar .tb-hint { flex-basis: 100%; }

.tb-clock {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 74px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: .3px;
}
#tb-icon { font-size: 14px; line-height: 1; }

#tb-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 240px;
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg,
    #10182c 0%, #2b3a63 12%, #d97a45 22%, #86b6e8 32%,
    #bcd8f2 50%,
    #86b6e8 68%, #d9683f 78%, #2b3a63 88%, #10182c 100%);
  outline: none;
  cursor: pointer;
}
#tb-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, .35);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .5);
  cursor: pointer;
}
#tb-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, .35);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .5);
  cursor: pointer;
}

.tb-btn {
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 7px;
  color: rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  cursor: pointer;
  transition: all .12s ease;
}
.tb-btn:hover { background: rgba(255, 255, 255, .13); color: #fff; }
.tb-btn.on {
  color: #0c1119;
  background: #eaf2ff;
  border-color: transparent;
}

.tb-hint {
  color: rgba(255, 255, 255, .38);
  font-size: 11px;
  white-space: nowrap;
}
.tb-hint b {
  font-weight: 600;
  color: rgba(255, 255, 255, .62);
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 4px;
  padding: 0 5px;
}

@media (max-width: 720px) {
  .tb-hint { display: none; }
  #tb-slider { width: 150px; }
}

/* ---------- panoul de statistici ---------- */
#stats {
  position: fixed;
  z-index: 8;
  right: 16px;
  top: 16px;
  width: 236px;
  padding: 11px 13px 9px;
  border-radius: 10px;
  background: rgba(10, 14, 20, .5);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border: 1px solid rgba(255, 255, 255, .1);
  font-family: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
  font-size: 11.5px;
  line-height: 1.62;
  pointer-events: none;
  transition: opacity .2s ease;
}
#stats.off { opacity: 0; }

.st-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  font-size: 10px;
  color: rgba(255, 255, 255, .62);
}
.st-k {
  font-weight: 600;
  color: rgba(255, 255, 255, .5);
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 4px;
  padding: 0 5px;
}

.st-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.st-row span { color: rgba(255, 255, 255, .45); }
.st-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.st-wrap { display: block; }
.st-wrap span { display: block; }
.st-wrap b {
  display: block;
  font-weight: 500;
  font-size: 10.5px;
  line-height: 1.4;
  color: rgba(255, 255, 255, .72);
  word-break: break-word;
}

.st-sep {
  height: 1px;
  margin: 6px 0;
  background: rgba(255, 255, 255, .1);
}

#st-graph {
  display: block;
  width: 100%;
  height: 44px;
  margin: 6px 0 2px;
  border-radius: 5px;
  background: rgba(0, 0, 0, .32);
}

.st-hint {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 10px;
  color: rgba(255, 255, 255, .35);
}
.st-hint b {
  font-weight: 600;
  color: rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .07);
  border-radius: 3px;
  padding: 0 4px;
}

@media (max-height: 700px) {
  #st-graph { height: 30px; }
  #stats { font-size: 11px; line-height: 1.5; }
}

/* ---------- meniul de pauza: doua vederi in acelasi card ---------- */
.view-off { display: none; }

#view-settings h1 { margin-bottom: 20px; }

#play ~ .ghost { margin-top: 9px; }

/* Butonul secundar. Culorile stau aici, pe clasa, nu pe o regula legata de
   meniul principal: altfel orice `.ghost` din alta fereastra ramane fara
   fundal si fara chenar, adica un text mic si greu de vazut. */
.ghost {
  width: 100%;
  padding: 11px 20px;
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  color: rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.ghost:hover { background: rgba(255, 255, 255, .14); color: #fff; }

.tip {
  margin-top: 16px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .38);
}

/* ---------- randuri de setari ---------- */
.set-row {
  margin-bottom: 20px;
  text-align: left;
}
.set-row label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 9px;
}
.set-row label b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: #0c1119;
  background: #eaf2ff;
  border-radius: 5px;
  padding: 1px 7px;
  min-width: 46px;
  text-align: center;
}
.set-help {
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .42);
}

.set-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .18);
  outline: none;
  cursor: pointer;
}
.set-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, .35);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .5);
  cursor: pointer;
}
.set-row input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, .35);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .5);
  cursor: pointer;
}

#close-settings,
#net-intra,
#close-net {
  margin-top: 6px;
  width: 100%;
  padding: 12px 20px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  color: #0c1119;
  background: #eaf2ff;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s ease;
}
#close-settings:hover,
#net-intra:hover,
#close-net:hover { background: #fff; }

/* ---------- inventarul de boltari ---------- */
#hotbar {
  position: fixed;
  z-index: 9;
  left: 50%;
  bottom: 82px;
  transform: translateX(-50%);
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(10, 14, 20, .5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .4);
  transition: opacity .25s ease;
}
body.playing #hotbar { pointer-events: none; }

.slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 9px;
  font: inherit;
  text-align: left;
  color: #fff;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 9px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.slot:hover { background: rgba(255, 255, 255, .1); }
.slot.on {
  background: rgba(234, 242, 255, .16);
  border-color: rgba(234, 242, 255, .75);
  box-shadow: inset 0 0 0 1px rgba(234, 242, 255, .18);
}

/* mica reprezentare a boltarului, la scara reala 60:25 si 30:25 */
.ico {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 42px;
  height: 30px;
}
.brick {
  display: block;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, #9a978f 0%, #7d7a73 55%, #6b6862 100%);
  border: 1px solid rgba(0, 0, 0, .45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}
.brick.full { width: 36px; }
.brick.half { width: 18px; }

.txt { display: flex; flex-direction: column; line-height: 1.35; }
.txt b { font-size: 12.5px; font-weight: 600; }
.txt em {
  font-style: normal;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .45);
}

.slot .key {
  align-self: flex-start;
  margin-left: 2px;
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, .5);
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 4px;
  padding: 0 5px;
}

.hb-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 0 12px 0 6px;
  border-left: 1px solid rgba(255, 255, 255, .1);
  margin-left: 2px;
  font-size: 11px;
  color: rgba(255, 255, 255, .42);
}
.hb-side .inf { font-size: 17px; line-height: 1; color: rgba(255, 255, 255, .65); }
.hb-rot b {
  font-weight: 600;
  color: rgba(255, 255, 255, .6);
  background: rgba(255, 255, 255, .08);
  border-radius: 3px;
  padding: 0 4px;
}

@media (max-width: 780px) {
  .txt em, .hb-side { display: none; }
}

/* cardul de pauza poate deveni inalt cu setarile deschise */
.panel { max-height: 88vh; overflow-y: auto; }

/* pe ecrane joase, inventarul ar acoperi cardul cat esti in pauza */
@media (max-height: 780px) {
  body:not(.playing) #hotbar { display: none; }
}

/* boltarul din inventar, la proportia reala 50:25 si 25:25 */
.brick.full { width: 30px; }
.brick.half { width: 15px; }

/* butonul de golire a constructiei */
.ghost.danger {
  margin-top: 4px;
  color: rgba(255, 170, 170, .9);
  background: rgba(255, 90, 90, .10);
  border: 1px solid rgba(255, 120, 120, .3);
}
.ghost.danger:hover { background: rgba(255, 90, 90, .2); color: #fff; }
.ghost.danger.armed {
  color: #2a0d0d;
  background: #ff9a9a;
  border-color: transparent;
}
.set-help .warn { color: #ffb0b0; }

/* ---------- crosshair si inventar doar in modul de constructie ---------- */
body.playing #crosshair { opacity: 0; }
body.playing.building #crosshair { opacity: 1; }

#hotbar { opacity: 0; pointer-events: none; }
body.building #hotbar { opacity: 1; }
body.building:not(.playing) #hotbar { pointer-events: auto; }

/* in zbor, crosshair-ul primeste un inel discret */
body.flying #crosshair::before,
body.flying #crosshair::after { background: rgba(150, 220, 255, .95); }

.hb-side {
  gap: 3px;
  font-size: 10.5px;
  line-height: 1.5;
}
.hb-line { white-space: nowrap; }
.hb-line b {
  display: inline-block;
  min-width: 34px;
  text-align: center;
  font-weight: 600;
  color: rgba(255, 255, 255, .6);
  background: rgba(255, 255, 255, .08);
  border-radius: 3px;
  padding: 0 4px;
}
.hb-flag { color: rgba(255, 255, 255, .38); }
.hb-flag.on { color: #9ee7b4; font-weight: 600; }

/* ---------- bara: o singura piesa, cea din mana ---------- */
#hotbar .slot { cursor: default; }
#hotbar .ico { width: 46px; }
.brick { width: 30px; height: 16px; }
.hb-side { gap: 2px; }

/* ---------- inventarul de piese ---------- */
#pieces {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(6, 10, 16, .55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#pieces.hidden { display: none; }

.pieces-card {
  width: min(560px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px 26px 20px;
  border-radius: 18px;
  background: rgba(16, 22, 32, .82);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
.pieces-card h1 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.2px;
  margin-bottom: 16px;
}

#pieces-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pg-head {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .45);
}
.pg-head:first-child { margin-top: 0; }

.pg-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  font: inherit;
  text-align: left;
  color: #fff;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.pg-item:hover { background: rgba(255, 255, 255, .12); }
.pg-item.on {
  background: rgba(234, 242, 255, .16);
  border-color: rgba(234, 242, 255, .75);
}
.pg-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  flex: 0 0 44px;
}
.pg-txt { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.pg-txt b { font-size: 12.5px; font-weight: 600; }
.pg-txt em {
  font-style: normal;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .45);
}
.pg-key {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, .5);
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 4px;
  padding: 0 5px;
}

.pieces-card .tip {
  margin-top: 16px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .4);
}
.pieces-card .tip b {
  font-weight: 600;
  color: rgba(255, 255, 255, .62);
  background: rgba(255, 255, 255, .07);
  border-radius: 3px;
  padding: 0 4px;
}

@media (max-width: 520px) {
  #pieces-grid { grid-template-columns: 1fr; }
}

/* ---------- indicatia pentru masina ---------- */
#carhint {
  position: fixed;
  z-index: 9;
  left: 50%;
  bottom: 190px;
  transform: translateX(-50%);
  padding: 7px 14px;
  border-radius: 8px;
  background: rgba(10, 14, 20, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .14);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .18s ease;
}
#carhint.hidden { opacity: 0; }
body:not(.playing) #carhint { opacity: 0; }

/* ---------- panoul de reglaje pentru masina ---------- */
#cartune {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: grid;
  place-items: center;
  background: rgba(6, 10, 16, .55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#cartune.hidden { display: none; }
#cartune .pieces-card { width: min(520px, 94vw); }
#cartune-grid { display: block; }
#cartune .set-row { margin-bottom: 12px; }
#cartune .set-row label { margin-bottom: 6px; font-size: 12px; }

.tune-presets {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tune-presets input,
.tune-presets select {
  flex: 1 1 120px;
  min-width: 0;
  font: inherit;
  font-size: 12px;
  padding: 6px 8px;
  color: #fff;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 7px;
}
.tune-presets option { color: #111; }
.tune-presets button,
.tune-actions button {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
  border: 0;
  cursor: pointer;
  color: #0c1119;
  background: #eaf2ff;
}
.tune-presets button:hover, .tune-actions button:hover { background: #fff; }

.tune-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.tune-actions .ghost {
  width: auto;
  flex: 1;
  color: rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
}

.tune-sum {
  margin: 0 0 14px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .85);
}

/* ---------- bordul masinii ---------- */
#carhud {
  position: fixed;
  z-index: 9;
  right: 16px;
  bottom: 20px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(10, 14, 20, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .45);
  pointer-events: none;
  transition: opacity .2s ease;
}
#carhud.hidden { opacity: 0; }

.ch-speed { display: flex; align-items: baseline; gap: 5px; }
.ch-speed b {
  font-size: 40px;
  font-weight: 650;
  line-height: 0.9;
  letter-spacing: -1.5px;
  font-variant-numeric: tabular-nums;
}
.ch-speed span { font-size: 11px; color: rgba(255, 255, 255, .5); }

.ch-dash { display: flex; flex-direction: column; gap: 6px; min-width: 132px; }
.ch-gear { display: flex; align-items: baseline; justify-content: space-between; }
.ch-gear em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .42);
}
.ch-gear b {
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ch-rpm {
  height: 7px;
  border-radius: 4px;
  overflow: hidden;
  /* ultima cincime e zona rosie */
  background: linear-gradient(90deg,
    rgba(255, 255, 255, .12) 0%, rgba(255, 255, 255, .12) 80%,
    rgba(255, 90, 80, .3) 80%, rgba(255, 90, 80, .3) 100%);
}
.ch-rpm i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #7fe0a4, #d8e86a);
  transition: width .05s linear;
}
.ch-rpm i.sus { background: linear-gradient(90deg, #ffb35c, #ff5a50); }

@media (max-width: 700px) {
  #carhud { right: 10px; bottom: 78px; padding: 9px 12px; }
  .ch-speed b { font-size: 30px; }
  .ch-dash { min-width: 96px; }
}

#cartune .set-row select {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 12.5px;
  padding: 6px 8px;
  color: #fff;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 7px;
  cursor: pointer;
}
#cartune .set-row select option { color: #111; }

/* ---------- comenzi pe ecran, pentru telefon ---------- */
#touch { display: none; }
body.touch #touch {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  touch-action: none;
}
body.touch:not(.playing) #touch { display: none; }

#stick {
  position: absolute;
  left: 22px;
  bottom: 24px;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .18);
  pointer-events: auto;
  touch-action: none;
}
#stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .3);
  border: 1px solid rgba(255, 255, 255, .45);
}

.tb {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(10, 14, 20, .55);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  padding: 0 10px;
  min-width: 62px;
  height: 46px;
  pointer-events: auto;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.tb.on { background: rgba(234, 242, 255, .35); }
.tb.pauza { position: absolute; left: 14px; top: 14px; min-width: 46px; }
.tb.stat  { position: absolute; right: 14px; top: 14px; min-width: 46px; }

.tgrup {
  position: absolute;
  right: 14px;
  bottom: 20px;
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: flex-end;
  gap: 8px;
  width: min(230px, 52vw);
}

/* butoanele apar doar cand au sens */
.only-build, .only-drive, .only-car { display: none; }
body.t-build .only-build { display: block; }
body.t-drive .only-drive { display: block; }
body.t-car   .only-car   { display: block; }
body.t-drive .no-drive   { display: none; }

/* pe telefon, panourile mari nu mai incap langa comenzi */
body.touch #hotbar { bottom: 178px; }
body.touch #carhud { right: 14px; bottom: 76px; }
body.touch #carhint { bottom: 250px; }
body.touch #stats { font-size: 10.5px; width: 200px; top: 68px; }

/* ------------------------------------------------------------------
   Ecran complet
   ------------------------------------------------------------------ */
.tb.full { position: absolute; right: 68px; top: 14px; min-width: 46px; }
/* browserele care nu il suporta (Safari pe iPhone) nu arata butoanele */
body.fs-nu .tb.full, body.fs-nu #fullscreen { display: none; }


/* Ecran scund (telefon tinut orizontal): tot ce e pe margini, mai strans. */
@media (max-height: 500px) {
  body.touch #hotbar  { bottom: 96px; transform: translateX(-50%) scale(.82); }
  body.touch #carhint { bottom: 156px; }
  body.touch #carhud  { bottom: 12px; right: 96px; }
  body.touch #stats   { top: 58px; width: 178px; font-size: 9.5px; }
  body.touch #stick   { width: 108px; height: 108px; left: 16px; bottom: 14px; }
  body.touch .tgrup   { bottom: 14px; width: min(230px, 40vw); }
  body.touch .tb      { height: 40px; min-width: 52px; font-size: 11.5px; }
  body.touch .tb.pauza, body.touch .tb.stat, body.touch .tb.full { top: 10px; }
}

/* ------------------------------------------------------------------
   Multiplayer
   ------------------------------------------------------------------ */
#view-login input[type="text"],
#view-login input[type="password"] {
  width: 100%;
  margin-top: 7px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: #eaf2ff;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 9px;
  outline: none;
}
#view-login input:focus { border-color: rgba(150, 190, 255, .55); }
#view-login input::placeholder { color: rgba(255, 255, 255, .32); }
#view-login #net-pin { letter-spacing: .32em; }
#net-form.off, #net-cine.off, #net-butoane.off, #net-iesi.off { display: none; }
#close-net { margin-top: 10px; }

/* cine esti, cand esti conectat */
#net-cine {
  margin: 4px 0 18px;
  padding: 14px 16px;
  text-align: left;
  border-radius: 11px;
  background: rgba(120, 220, 150, .10);
  border: 1px solid rgba(120, 220, 150, .28);
}
.net-cine-cap {
  font-size: 11.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .45);
}
.net-cine-nume {
  margin-top: 4px;
  font-size: 19px;
  font-weight: 600;
  color: #d8ffe6;
}

#net-intra:disabled, #net-cont:disabled { opacity: .5; cursor: default; }

/* Un singur loc pentru tot ce are serverul de spus, in trei culori:
   rosu daca a mers prost, verde daca a mers bine, gri cat asteptam. */
.net-msg {
  margin: 0 0 16px;
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.45;
  text-align: left;
}
.net-msg.off { display: none; }
.net-msg.rau {
  background: rgba(190, 70, 60, .18);
  border: 1px solid rgba(220, 110, 100, .35);
  color: #ffd9d4;
}
.net-msg.bun {
  background: rgba(80, 200, 120, .15);
  border: 1px solid rgba(110, 220, 150, .32);
  color: #d6ffe4;
}
.net-msg.info {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .72);
}

/* cine esti si cati sunteti, cat timp joci */
#netchip {
  position: fixed;
  z-index: 9;
  left: 18px;
  top: 18px;
  padding: 6px 11px;
  border-radius: 9px;
  background: rgba(10, 14, 20, .5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  pointer-events: none;
  transition: opacity .25s ease;
}
#netchip.off { opacity: 0; }
body.touch #netchip { left: 74px; top: 14px; font-size: 11px; }
@media (max-height: 500px) { body.touch #netchip { top: 10px; } }

/* ------------------------------------------------------------------
   Lista de jucatori (Tab)
   ------------------------------------------------------------------ */
#lista {
  position: fixed;
  z-index: 12;
  left: 50%;
  top: 14vh;
  transform: translateX(-50%);
  width: min(420px, 88vw);
  max-height: 62vh;
  overflow-y: auto;
  padding: 16px 18px 14px;
  border-radius: 14px;
  background: rgba(10, 14, 20, .74);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
  color: #eaf2ff;
  pointer-events: none;
}
#lista.off { display: none; }

.lista-cap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  font-size: 13px;
  font-weight: 600;
}
#lista-nr { color: rgba(255, 255, 255, .45); font-weight: 400; font-size: 12px; }

.lista-rand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 13.5px;
}
.lista-rand + .lista-rand { border-top: 1px solid rgba(255, 255, 255, .06); }
.lista-rand .unde {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .42);
  white-space: nowrap;
}
.lista-rand.eu .nume { color: #a8ffd0; }
.lista-rand.eu .nume::after {
  content: 'tu';
  margin-left: 7px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #0c1119;
  background: #a8ffd0;
}
.lista-gol {
  padding: 10px 0 4px;
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .5);
}
@media (max-height: 500px) { #lista { top: 8vh; max-height: 78vh; } }

/* ------------------------------------------------------------------
   Mesaje scurte peste imagine
   ------------------------------------------------------------------ */
#toast {
  position: fixed;
  z-index: 13;
  left: 50%;
  bottom: 22vh;
  transform: translateX(-50%);
  max-width: min(420px, 86vw);
  padding: 10px 16px;
  border-radius: 11px;
  background: rgba(10, 14, 20, .78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #eaf2ff;
  font-size: 13px;
  text-align: center;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
#toast.off { opacity: 0; transform: translateX(-50%) translateY(6px); }
