﻿:root {
  --bg: #090909;
  --panel: #141414;
  --panel-2: #1b1b1b;
  --line: #2a2a2a;
  --text: #f3f3f3;
  --muted: #aaaaaa;
  --accent: #c90d05;
  --accent-2: #ff6a00;
  --ok: #2ecc71;
  --warn: #f1c40f;
  --off: #7f8c8d;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: Segoe UI, Arial, sans-serif; }
.topbar { display:flex; justify-content:space-between; align-items:center; padding:10px 16px; background: linear-gradient(90deg, #0e0e0e, #1a1a1a); border-bottom:1px solid var(--line); }
.brand { display:flex; gap:16px; align-items:center; }
.welcome-hero { font-size: 22px; font-weight: 700; color: #f5f5f5; margin-left: 8px; }
.logo { display:block; object-fit:contain; }
.logo.nitro { height:34px; }
.logo.ams2 { height:34px; }
.top-actions { display:flex; gap:10px; align-items:center; }
.layout { display:grid; grid-template-columns: 330px 1fr; gap:12px; padding:12px; }
.servers-panel, .card { background: var(--panel); border:1px solid var(--line); border-radius:10px; }
.servers-panel { min-height: calc(100vh - 90px); }
.panel-head { padding:12px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; }
.panel-head h2 { margin:0; font-size:18px; }
.servers-list { padding:10px; display:flex; flex-direction:column; gap:8px; }
.server-card { background: var(--panel-2); border:1px solid #242424; border-radius:8px; padding:10px; cursor:pointer; }
.server-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.server-top { display:flex; justify-content:space-between; gap:8px; }
.server-name { font-weight:700; }
.server-sub { color:var(--muted); font-size:12px; margin-top:4px; }
.server-actions { margin-top: 8px; display: flex; }
.btn-join-card { font-size: 12px; padding: 6px 10px; }
.live-panel { min-height: calc(100vh - 90px); }
.empty-state { background:var(--panel); border:1px dashed var(--line); border-radius:10px; padding:24px; color:var(--muted); }
.live-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:10px; }
.live-head h1 { margin:0; font-size:30px; color:var(--accent); }
.meta { margin:4px 0 0; color:var(--muted); }
.live-actions { display:flex; gap:8px; }
.pill { border:1px solid var(--line); border-radius:999px; padding:4px 9px; font-size:12px; }
.pill.muted { color:var(--muted); }
.pill.stage-race, .pill.state-race { border-color:#b11f16; color:#ff7f75; }
.pill.stage-qualifying, .pill.state-qualifying { border-color:#9f7d15; color:#ffd56b; }
.pill.stage-practice, .pill.state-practice { border-color:#1f8a4b; color:#74e6a2; }
.pill.state-running { border-color:#1f8a4b; color:#74e6a2; }
.pill.state-idle { border-color:#9f7d15; color:#ffd56b; }
.pill.state-off { border-color:#5a5a5a; color:#9d9d9d; }
.pill.flag-wet { border-color:#2d6fd6; color:#9bc6ff; }
.pill.flag-yellow { border-color:#9f7d15; color:#ffd56b; }
.grid-two { display:grid; grid-template-columns: 1fr 1fr; gap:10px; margin-bottom:10px; }
.card { padding:10px; margin-bottom:10px; }
.card-title { font-weight:700; margin-bottom:8px; }
.table-wrap { max-height:56vh; overflow:auto; }
.table { width:100%; border-collapse:collapse; font-size:12px; }
.table th, .table td { border:1px solid #2b2b2b; padding:6px; white-space:nowrap; }
.table th { background:#202020; color:#f8f8f8; }
.table tbody tr:nth-child(even) td { background:#181818; }
.table td.center, .table th.center { text-align: center; }
.table .best-col { font-weight: 700; }
.row-human td { background-color: rgba(73, 209, 127, 0.08); }
.row-ai td { background-color: rgba(255, 159, 67, 0.08); }
.row-online td { box-shadow: inset 0 0 0 1px rgba(73, 209, 127, 0.45); }
.class-row td { background: rgba(201, 13, 5, 0.14); color: #ffd5bf; text-transform: uppercase; letter-spacing: .04em; }
.type-badge { display:inline-block; padding:2px 7px; border-radius:999px; border:1px solid #3a3a3a; font-size:11px; }
.type-human { border-color:#1f8a4b; color:#74e6a2; }
.type-ai { border-color:#9f7d15; color:#ffd56b; }
.vehicle-main { font-weight: 600; }
.vehicle-sub { font-size: 11px; color: #a9a9a9; margin-top: 2px; }
.best-overall { color: #b47cff; font-weight: 700; }
.gap-cell { color: #d3d3d3; }
.name-cell { display: inline-flex; align-items: center; gap: 8px; }
.row-clickable { cursor: pointer; }
.row-selected td { box-shadow: inset 0 0 0 1px rgba(111, 196, 255, 0.6); }
.flag-icon { width: 18px; height: 13px; border-radius: 2px; border: 1px solid #2b2b2b; object-fit: cover; }
.ping-wrap { display: inline-flex; align-items: center; gap: 6px; }
.ping-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.ping-bars i { display: block; width: 3px; border-radius: 2px; background: #3a3a3a; }
.ping-bars i:nth-child(1) { height: 3px; }
.ping-bars i:nth-child(2) { height: 6px; }
.ping-bars i:nth-child(3) { height: 9px; }
.ping-bars i:nth-child(4) { height: 12px; }
.ping-bars.l4 i { background: #2ecc71; }
.ping-bars.l3 i:nth-child(-n+3) { background: #99d96d; }
.ping-bars.l3 i:nth-child(4) { background: #3a3a3a; }
.ping-bars.l2 i:nth-child(-n+2) { background: #f1c40f; }
.ping-bars.l2 i:nth-child(n+3) { background: #3a3a3a; }
.ping-bars.l1 i:nth-child(1) { background: #e74c3c; }
.ping-bars.l1 i:nth-child(n+2) { background: #3a3a3a; }
.table.compact td, .table.compact th { text-align:center; }
.map-wrap { display: flex; justify-content: flex-end; }
#mapCanvas {
  display: block;
  width: min(100%, 920px);
  aspect-ratio: 23 / 9;
  height: auto;
  background:#0f0f0f;
  border:1px solid #2c2c2c;
  border-radius:8px;
}
.cockpit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  padding: 3px 6px;
  border: 1px solid #2f2f2f;
  border-radius: 999px;
  background: #121212;
}
.cockpit b { color: #d8d8d8; font-weight: 700; }
.btn { background:#2a2a2a; border:1px solid #3a3a3a; color:#fff; border-radius:7px; padding:8px 12px; cursor:pointer; }
.btn:hover { filter:brightness(1.1); }
.btn.accent { background:var(--accent); border-color:#e03d2f; }
.btn.warn { background:#8a5a12; border-color:#af7a1d; }
.btn.danger { background:#6d1414; border-color:#8f1d1d; }
.btn.ghost { background:transparent; }
.input { width:100%; background:#111; border:1px solid #333; color:#fff; border-radius:7px; padding:8px; }
.admin-grid { display:grid; grid-template-columns: 1fr 1fr 1fr; gap:8px; margin-bottom:8px; }
.admin-tabs { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.admin-tab { font-size:12px; padding:6px 10px; }
.admin-tab.active { border-color: var(--accent); color:#ffd0c8; }
.admin-tab-panel { margin-bottom: 6px; }
.admin-help { font-size: 11px; color: var(--muted); }
.check-inline { display:flex; align-items:center; gap:6px; color:#ddd; }
.hidden { display:none !important; }
.toast { position:fixed; right:18px; bottom:18px; background:#161616; border:1px solid var(--line); padding:10px 12px; border-radius:8px; }
.modal { position:fixed; inset:0; background:rgba(0,0,0,0.7); display:flex; align-items:center; justify-content:center; }
.modal-card { width:360px; background:#151515; border:1px solid #333; border-radius:10px; padding:14px; display:grid; gap:8px; }
.modal-actions { display:flex; justify-content:flex-end; gap:8px; }
.status-off { color:var(--off); }
.status-idle { color:var(--warn); }
.status-running { color:var(--ok); }
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .servers-panel { min-height: auto; }
  .grid-two { grid-template-columns: 1fr; }
  .welcome-hero { font-size: 16px; }
}
