:root {
    --primary: #ff4757;
    --secondary: #2f3542;
    --accent: #eccc68;
    --success: #2ed573;
    --glass: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #121212;
    color: white;
    font-family: 'Outfit', 'Jua', sans-serif;
    overflow: hidden;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    background: radial-gradient(circle at center, #1e272e 0%, #000 100%);
}

canvas {
    display: block;
}

/* --- HUD --- */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    padding: 40px;
}

.hud-top {
    display: flex;
    justify-content: flex-start;
}

.stats-box {
    background: var(--glass);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    gap: 30px;
    font-size: 1.5rem;
    font-weight: bold;
}

#timer-text {
    color: var(--accent);
}

.speedometer {
    position: absolute;
    bottom: 40px;
    right: 40px;
    background: var(--glass);
    backdrop-filter: blur(15px);
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid var(--glass);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.speed-value {
    font-size: 3rem;
    font-weight: 700;
}

.speed-unit {
    font-size: 0.8rem;
    opacity: 0.7;
}

.gear-indicator {
    position: absolute;
    bottom: 40px;
    left: 40px;
    display: flex;
    gap: 15px;
}

.gear {
    width: 60px;
    height: 60px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: bold;
    border: 2px solid transparent;
    transition: 0.3s;
}

.gear.active {
    background: var(--primary);
    border-color: #fff;
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
}

.damage-bar {
    position: absolute;
    bottom: 120px;
    left: 40px;
    width: 200px;
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.damage-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--success), #ff9f43, var(--primary));
    transition: 0.3s;
}

/* --- SCREENS --- */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.menu-card {
    background: #fff;
    color: #2f3542;
    padding: 60px;
    border-radius: 40px;
    text-align: center;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.glow-text {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: linear-gradient(45deg, var(--primary), #ff6b81);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.controls-guide {
    background: #f1f2f6;
    padding: 30px;
    border-radius: 20px;
    margin: 30px 0;
    text-align: left;
}

.guide-item {
    font-size: 1.2rem;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.guide-item span {
    background: #2f3542;
    color: #fff;
    padding: 2px 10px;
    border-radius: 5px;
    font-family: monospace;
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    transition: 0.3s;
    font-family: 'Jua', sans-serif;
}

.primary-btn:hover {
    transform: scale(1.05);
    background: #ff6b81;
    box-shadow: 0 10px 30px rgba(255, 71, 87, 0.4);
}

.hidden {
    display: none !important;
}

.win-card {
    border-bottom: 10px solid var(--success);
}

.lose-card {
    border-bottom: 10px solid var(--primary);
}