* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-drag: none;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: transparent !important;
    font-family: 'Fredoka', sans-serif;
}

/* Main Wrapper - Pinned & Sized for Bottom-Right Corner */
.hud-wrapper {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
    transform-origin: bottom right;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 9999;
}

/* Top Cluster Container */
.cluster-container {
    position: relative;
    width: 100%;
    height: 148px;
    background: rgba(43, 45, 66, 0.92);
    border: 3.5px solid #1E2030;
    border-radius: 72px 72px 30px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.08);
}

/* 1. Left RPM Wing */
.rpm-wing {
    width: 114px;
    height: 118px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.rpm-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.svg-num-sm {
    fill: #FFF3BF;
    font-size: 18px;
    font-weight: 700;
    stroke: #1E2030;
    stroke-width: 4px;
    paint-order: stroke;
}

.rpm-title {
    fill: #FFF3BF;
    font-size: 20px;
    font-weight: 700;
    stroke: #1E2030;
    stroke-width: 4.5px;
    paint-order: stroke;
}

.rpm-sub {
    fill: #FFF3BF;
    font-size: 14px;
    font-weight: 700;
    stroke: #1E2030;
    stroke-width: 3.5px;
    paint-order: stroke;
}

/* 2. Center Speedometer */
.speed-center {
    position: absolute;
    left: 50%;
    top: -11px;
    transform: translateX(-50%);
    width: 164px;
    height: 152px;
    z-index: 3;
}

.speed-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.speed-scale {
    fill: #FFF3BF;
    font-size: 19px;
    font-weight: 700;
    stroke: #1E2030;
    stroke-width: 4.5px;
    paint-order: stroke;
}

.speed-digital {
    fill: #FFFFFF;
    font-size: 28px;
    font-weight: 700;
    stroke: #1E2030;
    stroke-width: 5px;
    paint-order: stroke;
}

.speed-unit {
    fill: #B2F2BB;
    font-size: 16px;
    font-weight: 700;
    stroke: #1E2030;
    stroke-width: 4px;
    paint-order: stroke;
}

.gear-label {
    fill: #FFE066;
    font-size: 15px;
    font-weight: 700;
}

.odo-text {
    fill: #A5D8FF;
    font-size: 12px;
    font-weight: 600;
    stroke: #1E2030;
    stroke-width: 3px;
    paint-order: stroke;
}

/* Smooth Needle Transitions */
.needle-group {
    transform-box: view-box;
    transition: transform 0.08s linear;
}

/* 3. Right Wing: Health + Interactive Water Fuel Cup */
.right-wing {
    width: 108px;
    height: 134px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0 4px 6px;
    z-index: 2;
}

.health-widget {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: -3px;
}

.health-svg {
    width: 62px;
    height: 28px;
    overflow: visible;
}

.health-percent {
    color: #FFF3BF;
    font-size: 12px;
    font-weight: 700;
    -webkit-text-stroke: 2.5px #1E2030;
    paint-order: stroke;
}

/* Heart & Mini Car Animations */
.heart-beat {
    transform-origin: 23px 22px;
    animation: heartPulse 1.1s infinite ease-in-out;
}

@keyframes heartPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.14);
    }
}

.car-bob {
    animation: carBobbing 1.4s infinite ease-in-out;
}

@keyframes carBobbing {

    0%,
    100% {
        transform: translate(52px, 4px);
    }

    50% {
        transform: translate(52px, 1.5px);
    }
}

.band-aid {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.health-widget.damaged .band-aid {
    opacity: 1;
}

/* Interactive Fuel Water Cup */
.fuel-widget {
    width: 82px;
    height: 88px;
    margin-top: -4px;
}

.fuel-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.fuel-liquid-group {
    transform: translateY(15px);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.wave-front {
    animation: waveSlideFront 2.4s linear infinite;
}

.wave-back {
    animation: waveSlideBack 3.2s linear infinite;
}

@keyframes waveSlideFront {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(120px);
    }
}

@keyframes waveSlideBack {
    0% {
        transform: translateX(120px);
    }

    100% {
        transform: translateX(0);
    }
}

.floating-leaf {
    animation: leafBob 1.8s ease-in-out infinite;
}

@keyframes leafBob {

    0%,
    100% {
        transform: translate(54px, 3px) rotate(-6deg);
    }

    50% {
        transform: translate(54px, 7px) rotate(8deg);
    }
}

.droplet-float {
    animation: dropletJump 2s ease-in-out infinite;
}

@keyframes dropletJump {

    0%,
    100% {
        transform: translate(96px, 6px);
    }

    50% {
        transform: translate(96px, 1px);
    }
}

.tear-stream {
    stroke-dasharray: 4 3;
    animation: tearFlow 0.5s linear infinite;
}

@keyframes tearFlow {
    0% {
        stroke-dashoffset: 7;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

.fuel-percent-svg {
    fill: #2B2D42;
    font-size: 20px;
    font-weight: 700;
    stroke: #FFF3BF;
    stroke-width: 3.5px;
    paint-order: stroke;
}

/* Bottom Single Indicator Bar */
.bottom-bar {
    width: 100%;
    background: rgba(43, 45, 66, 0.92);
    border: 3.5px solid #1E2030;
    border-radius: 22px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ind-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    opacity: 0.42;
    filter: grayscale(65%);
    transform: scale(0.95);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.ind-item.active {
    opacity: 1;
    filter: grayscale(0%) drop-shadow(0 0 6px rgba(255, 243, 191, 0.45));
    transform: scale(1.04);
}

.ind-icon-wrap {
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ind-svg {
    height: 28px;
    width: auto;
    overflow: visible;
}

.ind-label {
    color: #FFF3BF;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.2px;
    -webkit-text-stroke: 2px #1E2030;
    paint-order: stroke;
}

/* Interactive Indicator Specific Animations */
/* 1. Key Jingle */
#indKey.active .key-jingle {
    transform-origin: 38px 24px;
    animation: keyJingle 2.2s ease-in-out infinite;
}

@keyframes keyJingle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

/* 2. Seatbelt Snap */
#indSeatbelt .buckle-left {
    transform: translateX(-4px);
    transition: transform 0.3s ease;
}

#indSeatbelt .buckle-right {
    transform: translateX(4px);
    transition: transform 0.3s ease;
}

#indSeatbelt.active .buckle-left,
#indSeatbelt.active .buckle-right {
    transform: translateX(0);
}

#indSeatbelt:not(.active) {
    animation: beltWarnPulse 1.2s infinite ease-in-out;
}

@keyframes beltWarnPulse {

    0%,
    100% {
        opacity: 0.42;
    }

    50% {
        opacity: 0.85;
        filter: grayscale(10%) drop-shadow(0 0 6px #FF8787);
    }
}

/* 3. Engine Chug & Smoke Puffs */
#indEngine.active .engine-body {
    animation: engineChug 0.18s infinite alternate ease-in-out;
}

@keyframes engineChug {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-2px);
    }
}

.puff {
    opacity: 0;
}

#indEngine.active .puff-1 {
    animation: smokePuff 1.1s infinite ease-out;
}

#indEngine.active .puff-2 {
    animation: smokePuff 1.1s 0.55s infinite ease-out;
}

@keyframes smokePuff {
    0% {
        opacity: 0.95;
        transform: translate(0, 0) scale(0.6);
    }

    100% {
        opacity: 0;
        transform: translate(10px, -8px) scale(1.35);
    }
}

/* 4 & 5. Left & Right Turn Signals Blinking */
#indLeft.active,
#indRight.active {
    animation: turnSignalBlink 0.55s infinite steps(1);
}

@keyframes turnSignalBlink {

    0%,
    50% {
        opacity: 1;
        filter: grayscale(0%) drop-shadow(0 0 10px #8CE99A);
        transform: scale(1.08);
    }

    51%,
    100% {
        opacity: 0.35;
        filter: grayscale(70%);
        transform: scale(0.95);
    }
}

/* 6. Headlights Rays */
.light-rays {
    opacity: 0.15;
    transition: opacity 0.25s ease;
}

#indLights.active .light-rays {
    opacity: 1;
    animation: rayGlow 1.2s infinite alternate ease-in-out;
}

#indLights.highbeam .light-rays line {
    stroke: #74C0FC;
}

@keyframes rayGlow {
    0% {
        filter: drop-shadow(0 0 2px #FFE066);
    }

    100% {
        filter: drop-shadow(0 0 8px #FFE066);
    }
}

/* 7. YouTube Play Bounce */
#indYoutube.active .yt-bounce {
    transform-origin: 35px 30px;
    animation: ytPulse 1.8s infinite ease-in-out;
}

@keyframes ytPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.07);
    }
}

/* Responsive Scaling for Different Screen / CEF Viewport Sizes */
@media (max-width: 1440px), (max-height: 820px) {
    .hud-wrapper {
        transform: scale(0.9);
        bottom: 14px;
        right: 14px;
    }
}

@media (max-width: 1024px), (max-height: 600px) {
    .hud-wrapper {
        transform: scale(0.8);
        bottom: 10px;
        right: 10px;
    }
}

@media (max-width: 420px), (max-height: 260px) {
    .hud-wrapper {
        transform: scale(0.68);
        bottom: 6px;
        right: 6px;
    }
}