/* Sim 03 panels on top of the shared HUD: the numbers/leaderboard panel
   takes the bottom-left slot, the car picker and per-car setup sit in the
   controls, and the deck gains a front/rear balance bar. */
#numbers { left: 20px; bottom: 20px; width: 400px; padding: 10px 14px 12px; }
.tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.tabs button {
  flex: 1; border: 1px solid var(--line); background: rgba(150, 190, 255, 0.05); border-radius: 7px; padding: 6px 4px;
  font: 500 10.5px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim);
}
.tabs button.on { color: var(--cyan); border-color: rgba(95, 225, 255, 0.45); background: rgba(95, 225, 255, 0.08); }
#numbers .calc { margin-top: 2px; }
#tab-math[hidden], #tab-board[hidden] { display: none; }
#numbers .calc dt small { text-transform: none; letter-spacing: 0; color: var(--dim); font-size: 10px; margin-left: 4px; }
#numbers .calc dd.good { color: var(--lift); }
.board { width: 100%; border-collapse: collapse; font: 500 11.5px/1.35 var(--mono); font-variant-numeric: tabular-nums; }
.board th { font: 500 9.5px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); text-align: right; padding: 0 0 4px; }
.board th:first-child, .board td:first-child { text-align: left; }
.board td { padding: 3px 0; text-align: right; color: #c9d6e8; border-top: 1px solid var(--line); }
.board td:first-child { color: var(--ink); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board tr.now td { color: var(--cyan); }
.board tr.now td:first-child::before { content: "▸ "; }
.note { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.note b { color: var(--cyan); font-weight: 600; }
.note.small { font-size: 11px; color: var(--dim); margin: 8px 0 0; }

.cars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.cars button {
  border: 1px solid var(--line); background: rgba(150, 190, 255, 0.05); border-radius: 7px; padding: 8px 4px;
  font: 600 11px/1.1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: #c9d6e8;
}
.cars button:hover { border-color: rgba(95, 225, 255, 0.55); color: var(--ink); }
.cars button.on { background: var(--ink); color: #07101f; border-color: var(--ink); }
.setup[hidden] { display: none; }
.seg.four button { font-size: 10.5px; }
.presets.three { margin-top: 6px; }
.tog.wide { flex-direction: row; justify-content: center; width: 100%; font-size: 10.5px; padding: 8px; gap: 8px; margin-top: 2px; }
.toggles.three { grid-template-columns: repeat(3, 1fr); }
.sw.front { background: #5fe1ff; } .sw.rear { background: #ffb547; } .sw.floor { background: #3ee6a0; }

/* front/rear balance */
.balance { width: 150px; }
.split { display: flex; height: 6px; margin: 6px 0 5px; border-radius: 3px; overflow: hidden; background: rgba(150, 190, 255, 0.14); }
.split i { display: block; height: 100%; transition: width 0.15s linear; }
#bal-front { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
#bal-rear { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.balance .meter-foot { display: flex; justify-content: space-between; min-height: 0; }
.fill.lift.neg { background: var(--warn); box-shadow: 0 0 10px var(--warn); }

#measuring {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  font: 600 12px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan);
  background: var(--glass); border: 1px solid var(--line); border-radius: 8px; padding: 9px 14px; pointer-events: none;
}
#measuring[hidden] { display: none; }

@media (max-width: 1280px) {
  #numbers { width: 340px; }
  .balance { width: 110px; }
}
@media (max-width: 900px) {
  #numbers { order: 3; }
  .balance { flex: 1 1 130px; width: auto; }
}

#credit { position: absolute; right: 24px; bottom: calc(var(--deck-h, 81px) + 50px); margin: 0; max-width: 420px; text-align: right; font: 500 10px/1.4 var(--mono); color: var(--dim); }
#credit:empty { display: none; }
#credit a { color: var(--muted); }
body.shot #credit { display: none; }
@media (max-width: 900px) { #credit { position: static; order: 6; text-align: left; max-width: none; } }

/* leave room above the deck for the model credit too */
@media (min-width: 901px) { #controls { max-height: calc(100% - var(--deck-h, 81px) - 104px); } }
