#clean-driving-hud {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: rgba(10, 14, 20, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    font-family: 'Rajdhani', Arial, sans-serif;
    color: #e5e7eb;
    z-index: 1400;
    pointer-events: none;
    user-select: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: border-color 150ms ease-out;
}

#clean-driving-hud.is-hidden { display: none; }
#clean-driving-hud.flash-penalty { border-color: #ef4444; box-shadow: 0 0 18px rgba(239, 68, 68, 0.55); }
#clean-driving-hud.flash-bonus { border-color: #22c55e; box-shadow: 0 0 18px rgba(34, 197, 94, 0.55); }

.cd-ring { width: 22px; height: 22px; }
.cd-ring circle { fill: none; stroke-width: 3; }
.cd-ring .track { stroke: rgba(255, 255, 255, 0.15); }
.cd-ring .progress {
    stroke: #22c55e;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 120ms linear;
}

.cd-label {
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.75;
}

.cd-score {
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 40px;
    text-align: right;
    transition: transform 180ms ease-out, color 180ms linear;
}

.cd-score.is-negative { color: #f87171; }
.cd-score.is-positive { color: #4ade80; }
.cd-score.is-zero { color: #e5e7eb; }
.cd-score.pulse { transform: scale(1.2); }

#clean-driving-toasts {
    position: fixed;
    top: 48px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 1399;
    pointer-events: none;
}

.cd-toast {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.85);
    font-family: 'Rajdhani', Arial, sans-serif;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1px solid rgba(239, 68, 68, 0.6);
    color: #fca5a5;
    animation: cd-toast-fly 900ms ease-out forwards;
}

.cd-toast.is-bonus {
    border-color: rgba(34, 197, 94, 0.6);
    color: #86efac;
}

@keyframes cd-toast-fly {
    0%   { transform: translateY(0);     opacity: 0; }
    15%  { transform: translateY(-2px);  opacity: 1; }
    100% { transform: translateY(-18px); opacity: 0; }
}

/* Mobile (landscape) — shrink the widget */
@media (max-width: 900px) {
    #clean-driving-hud { padding: 4px 10px; gap: 8px; top: 6px; }
    .cd-ring { width: 18px; height: 18px; }
    .cd-label { font-size: 10px; }
    .cd-score { font-size: 16px; min-width: 34px; }
}
