* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
    overflow: hidden;
    background-color: #050505;
    color: #ffffff;
}
#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}
.ui-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px;
}
header h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(45deg, #ff2a2a, #ff7b00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 42, 42, 0.5);
    animation: fadeInDown 1s ease-out;
}
header p {
    font-size: 1.2rem;
    color: #dddddd;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
    animation: fadeInDown 1s ease-out 0.2s backwards;
}

.top-hud {
    position: absolute;
    top: 150px;
    left: 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 2;
    animation: fadeInLeft 1s ease-out 0.3s backwards;
}
.score-display {
    font-size: 2.5rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 5px #000;
    font-variant-numeric: tabular-nums;
    background: rgba(0,0,0,0.5);
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid rgba(255,215,0,0.5);
}
.nitro-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: rgba(0,0,0,0.5);
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid rgba(0,210,255,0.5);
}
.nitro-label {
    color: #00d2ff;
    font-weight: bold;
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-shadow: 0 0 10px #00d2ff;
}
.nitro-bar {
    width: 250px;
    height: 25px;
    background: rgba(0,0,0,0.8);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0,0,0,1);
}
#nitro-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #00d2ff, #0055ff, #00d2ff);
    background-size: 200% 100%;
    animation: nitroPulse 2s infinite linear;
    transition: width 0.1s linear;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.8);
}
@keyframes nitroPulse {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.hud {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: auto;
    animation: fadeInUp 1s ease-out 0.4s backwards;
}
.speedometer {
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 20px;
    border: 2px solid rgba(255, 42, 42, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    box-shadow: 0 0 30px rgba(255, 42, 42, 0.2);
    transition: box-shadow 0.3s;
    position: relative;
}
.gauge {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 8px solid #333;
    border-bottom-color: transparent;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}
.gauge::before {
    content: '';
    position: absolute;
    top: 5px; left: 5px; right: 5px; bottom: 5px;
    border-radius: 50%;
    border: 4px solid #ff2a2a;
    border-bottom-color: transparent;
    opacity: 0.5;
}
.needle {
    width: 4px;
    height: 60px;
    background: #ff2a2a;
    position: absolute;
    bottom: 50%;
    left: calc(50% - 2px);
    transform-origin: bottom center;
    transform: rotate(-135deg);
    transition: transform 0.1s ease-out;
    border-radius: 4px;
    box-shadow: 0 0 10px #ff2a2a;
    z-index: 1;
}
.center-pin {
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    bottom: calc(50% - 10px);
    left: calc(50% - 10px);
    z-index: 2;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.speed-text {
    display: flex;
    align-items: baseline;
    gap: 5px;
}
#speed-value {
    font-size: 3rem;
    font-weight: 900;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}
.unit {
    font-size: 1.2rem;
    color: #ff2a2a;
    font-weight: bold;
}
.gear-display {
    position: absolute;
    bottom: -15px;
    right: -15px;
    background: #ff2a2a;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.8rem;
    box-shadow: 0 0 15px rgba(255, 42, 42, 0.8), inset 0 0 10px rgba(0,0,0,0.5);
    border: 3px solid #111;
}
.instructions {
    background: rgba(10, 10, 10, 0.8);
    padding: 15px 30px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.1rem;
    color: #dddddd;
    line-height: 1.8;
}
.instructions span {
    background: #ff2a2a;
    color: #fff;
    padding: 3px 8px;
    border-radius: 5px;
    font-weight: bold;
    margin: 0 5px;
}

.settings-panel {
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: absolute;
    top: 40px;
    right: 40px;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 250px;
    z-index: 3;
    animation: fadeInDown 1s ease-out;
}
.settings-panel h3 {
    margin-bottom: 5px;
    font-size: 1.2rem;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
    color: #fff;
}
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ddd;
    font-weight: bold;
}
.setting-item input[type="color"] {
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background: transparent;
    height: 35px;
    width: 60px;
}
.setting-item input[type="range"] {
    width: 120px;
    cursor: pointer;
    accent-color: #ff2a2a;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 768px) {
    .ui-container { padding: 20px; }
    header h1 { font-size: 2.2rem; }
    .top-hud { top: 100px; left: 20px; }
    .score-display { font-size: 1.8rem; }
    .nitro-bar { width: 150px; }
    .hud { flex-direction: column; align-items: flex-start; gap: 20px; }
    .speedometer { padding: 15px 25px; }
    #speed-value { font-size: 2.5rem; }
    .instructions { font-size: 0.9rem; }
    .settings-panel { top: 20px; right: 20px; min-width: 200px; }
}