:root {
    --bg-panel: rgba(10, 10, 10, 0.9);
    --accent-cyan: #00e5ff;
    --accent-yellow: #ffca28;
    --warning-red: #ff3d00;
    --text-dim: #666;
    --font-digital: 'Orbitron', sans-serif;
}

body {
    margin: 0;
    background-color: transparent; /* Latar belakang transparan */
    overflow: hidden;
}

/* === POSITIONING CONTAINER UTAMA === */
.speedometer-container {
    position: fixed;
    right: 20px;
    bottom: 20px; /* Menempel di bawah layar */
    width: 20vw;
    /* Jangan setel height tetap, biar auto-resize ke atas */
    height: auto; 
    min-width: 280px;
    font-family: var(--font-digital);
    z-index: 1000;
    display: flex;
    justify-content: flex-end; /* Memastikan isi menempel di bawah container */
}

/* === LAYOUT HUD TERBALIK (FLEX column-reverse) === */
.speedometer-hud {
    background: var(--bg-panel);
    width: 100%;
    /* Flexbox terbalik agar elemen auto-resize ke atas */
    display: flex;
    flex-direction: column-reverse; 
    
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px;
    box-sizing: border-box;
    box-shadow: 0 8px 32px rgba(0,0,0,0.8);
    transition: all 0.2s ease; /* Transisi halus saat membesar */
}

/* === CONTAINER INFO KENDARAAN (Menyala di layar paling atas) === */
.vehicle-info-group {
    width: 100%;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.03); /* Garis pemisah tipis */
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Nama Kendaraan: Baris pertama, value saja. Multi-baris aktif. */
.top-vehicle-name {
    font-size: 1.3vw; /* Lebih besar dari teks lain */
    color: var(--accent-cyan);
    font-weight: bold;
    text-transform: uppercase;
    text-shadow: 0 0 10px var(--accent-cyan);
    
    /* Mendukung multi-baris jika teks terlalu panjang */
    white-space: normal; 
    word-wrap: break-word;
    line-height: 1.2;
}

/* Baris Kedua: Plate dengan Label */
.top-plate-box {
    display: flex;
    justify-content: center;
    gap: 5px;
    font-size: 0.75vw;
}

.top-plate-box label {
    color: var(--text-dim);
    text-transform: uppercase;
}

.top-plate-box span {
    color: var(--accent-cyan);
    font-weight: bold;
}

.top-vehicle-name.inactive, .top-plate-box.inactive label, .top-plate-box.inactive span {
    color: #444;
    text-shadow: none;
    border-bottom-color: transparent;
}


/* Header: Health & Icons (Terbalik di kode, tampil kedua dari atas di layar) */
.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8vw;
    color: var(--text-dim);
    margin-bottom: 5px;
}

#health { color: #ffffff; } /* Value health warna putih */

.status-icons { display: flex; gap: 10px; }

.hud-icon {
    width: 1.3vw; height: 1.3vw; min-width: 20px; min-height: 20px;
    fill: #333; stroke: #333; opacity: 0.5; transition: all 0.2s ease;
}

.hud-icon.active {
    opacity: 1; fill: var(--accent-cyan); stroke: var(--accent-cyan);
    filter: drop-shadow(0 0 5px var(--accent-cyan));
}

.hud-icon.glow-high {
    opacity: 1; fill: #ffffff; stroke: #ffffff;
    filter: drop-shadow(0 0 5px #ffffff) drop-shadow(0 0 15px #ffffff);
}

.hud-icon.warning {
    opacity: 1; fill: var(--warning-red); stroke: var(--warning-red);
    filter: drop-shadow(0 0 5px var(--warning-red));
}

/* Body: Gauge & Info Section (Terbalik di kode, tampil ketiga dari atas di layar) */
.hud-body {
    flex: 1; display: flex; align-items: center; gap: 12px; padding: 5px 0;
}

.analog-section { flex: 1; display: flex; justify-content: center; }

.gauge-outline {
    width: 7vw; height: 7vw; max-width: 100px;
    border: 3px solid #222; border-top: 3px solid var(--accent-cyan);
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
}

#speed { font-size: 2.2vw; color: var(--accent-cyan); text-shadow: 0 0 10px var(--accent-cyan); }

.speed-display small {
    font-size: 0.5vw;
    display: block;
    text-align: center;
}

/* Data Grid (Kanan) */
.data-section { flex: 1.1; display: flex; flex-direction: column; gap: 4px; }

.data-box {
    background: rgba(255,255,255,0.03);
    padding: 4px 8px; border-radius: 4px;
    display: flex; justify-content: space-between; align-items: center;
}

/* Teks RPM, Gear, Fuel diperbesar 1-2px */
.data-box label { font-size: 0.65vw; color: #555; text-transform: uppercase; }
.data-box span { font-size: 1.15vw; color: var(--accent-cyan); font-weight: bold; }
.data-box.highlight span { color: var(--accent-yellow); }

/* Khusus RPM */
.rpm-container { flex-direction: column; align-items: flex-start; padding: 2px 8px; }

.rpm-bar-background {
    width: 100%; height: 4px; background-color: #222; border-radius: 2px;
    overflow: hidden; margin-top: 2px;
}

.rpm-bar-fill {
    height: 100%; width: 0%; background: var(--accent-cyan);
    box-shadow: 0 0 5px var(--accent-cyan); transition: width 0.1s linear;
}

/* Footer & Odometer (Paling bawah di layar) */
.hud-footer {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.75vw; /* Teks Odometer diperbesar */
    color: #444; margin-top: 5px;
}

#odometer { color: #ffffff; }

.hidden-data { display: none; }