/* === DRIFTCITY STYLES === */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    overflow: hidden;
    background: #0a0a1a;
    font-family: 'Orbitron', sans-serif;
    color: #fff;
}

canvas {
    display: block;
}

/* === START SCHERM === */
#start-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a2e 0%, #1a0a3e 50%, #0a1a3e 100%);
    z-index: 100;
}

#start-screen h1 {
    font-size: 5rem;
    font-weight: 900;
    background: linear-gradient(90deg, #ff3366, #ff66cc, #33ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(255, 51, 102, 0.5);
    margin-bottom: 1rem;
    letter-spacing: 0.2em;
}

#start-screen p {
    font-size: 1.2rem;
    color: #88aacc;
    margin-bottom: 2rem;
}

#car-select {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.car-btn {
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    cursor: pointer;
    transition: all 0.3s;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    text-align: center;
}

.car-btn:hover, .car-btn.selected {
    border-color: #ff3366;
    background: rgba(255, 51, 102, 0.15);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.3);
}

.car-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.car-btn span {
    font-size: 0.9rem;
    display: block;
}

#start-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 1rem 4rem;
    background: linear-gradient(90deg, #ff3366, #cc33ff);
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 0.15em;
    transition: all 0.3s;
    margin-bottom: 2rem;
}

#start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 51, 102, 0.5);
}

#controls-info {
    color: #88aacc;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.key-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 0.2rem 0.5rem;
    background: rgba(255, 51, 102, 0.15);
    border: 1px solid rgba(255, 51, 102, 0.4);
    border-radius: 6px;
    font-size: 0.85rem;
    color: #ff6699;
}

/* === HUD / DASHBOARD === */
#hud {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

#dashboard {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1.5rem;
    background: rgba(5, 5, 25, 0.85);
    border: 1px solid rgba(255, 51, 102, 0.3);
    border-radius: 16px;
    padding: 1rem 2rem;
    backdrop-filter: blur(10px);
}

.gauge {
    text-align: center;
    min-width: 80px;
}

.gauge-label {
    display: block;
    font-size: 0.55rem;
    color: #ff3366;
    letter-spacing: 0.15em;
    margin-bottom: 4px;
}

.gauge-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
}

.gauge-unit {
    display: block;
    font-size: 0.5rem;
    color: #556688;
}

.bar-gauge {
    min-width: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bar-bg {
    width: 100%;
    height: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    overflow: hidden;
    margin-top: 4px;
}

.bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s;
}

.fuel-bar {
    background: linear-gradient(90deg, #ff6633, #ffcc00);
    width: 100%;
}

.damage-bar {
    background: linear-gradient(90deg, #33ff66, #ff3333);
    width: 0%;
}

/* === DRIFT BANNER === */
#drift-banner {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    font-weight: 900;
    color: #ff3366;
    text-shadow: 0 0 30px rgba(255, 51, 102, 0.8), 0 0 60px rgba(255, 51, 102, 0.4);
    letter-spacing: 0.3em;
    opacity: 1;
    transition: opacity 0.3s;
}

#drift-banner.hidden {
    opacity: 0;
}

#drift-combo {
    position: absolute;
    top: 22%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    transition: opacity 0.3s;
}

#drift-combo #drift-val {
    display: block;
    font-size: 2.2rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 51, 102, 0.7);
}

#drift-combo #combo-text {
    display: block;
    font-size: 1.2rem;
    color: #ffcc00;
    text-shadow: 0 0 15px rgba(255, 204, 0, 0.6);
    margin-top: 0.2em;
}

#drift-combo.hidden {
    opacity: 0;
}

/* === POWERUP INDICATOR === */
#powerup-indicator {
    position: absolute;
    top: 18%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    padding: 8px 18px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.55);
    border: 2px solid currentColor;
    text-shadow: 0 0 12px currentColor;
    animation: powerup-pulse 0.8s ease-in-out infinite alternate;
    transition: opacity 0.3s;
}
#powerup-indicator.hidden {
    display: none;
}
#powerup-indicator.fire {
    color: #ff4400;
    border-color: #ff4400;
}
#powerup-indicator.blacksmoke {
    color: #aaaaaa;
    border-color: #666666;
}
#powerup-indicator.lightning {
    color: #44ccff;
    border-color: #44ccff;
}
#powerup-icon {
    font-size: 1.8rem;
}
#powerup-timer {
    font-weight: 700;
}
@keyframes powerup-pulse {
    from { transform: scale(1); }
    to { transform: scale(1.06); }
}

/* === GAME OVER === */
#gameover-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 15, 0.95);
    z-index: 100;
}

#gameover-screen h1 {
    font-size: 4rem;
    font-weight: 900;
    color: #ff3366;
    margin-bottom: 1rem;
}

#gameover-screen p {
    font-size: 1.3rem;
    color: #aaa;
    margin-bottom: 0.5rem;
}

#restart-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0.8rem 3rem;
    background: linear-gradient(90deg, #ff3366, #cc33ff);
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 1.5rem;
    letter-spacing: 0.1em;
    transition: all 0.3s;
}

#restart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 51, 102, 0.5);
}

/* === SPEED VIGNETTE === */
#speed-vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.7) 100%);
    transition: opacity 0.2s;
}

/* === NAME INPUT === */
#version-tag {
    font-size: 0.7rem;
    color: rgba(136, 170, 204, 0.5);
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
}

#name-input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
    background: rgba(255, 51, 102, 0.08);
    border: 1px solid rgba(255, 51, 102, 0.25);
    border-radius: 16px;
    padding: 1.2rem 2rem;
}

#name-input-wrapper label {
    font-size: 1.1rem;
    color: #ccddee;
    margin-bottom: 0.7rem;
}

#player-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    padding: 0.8rem 1.5rem;
    border: 2px solid rgba(255, 51, 102, 0.6);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-align: center;
    outline: none;
    width: 300px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 0 10px rgba(255, 51, 102, 0.15);
}

#player-name::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

#player-name:focus {
    border-color: #ff3366;
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.4);
}

#player-name.invalid {
    border-color: #ff4444;
}

#name-error {
    font-size: 0.65rem;
    color: #ff4444;
    margin-top: 0.3rem;
    transition: opacity 0.3s;
}

#name-error.hidden {
    opacity: 0;
}

/* === HIGHSCORES BTN === */
#highscores-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.6rem 2rem;
    background: rgba(255, 204, 0, 0.15);
    color: #ffcc00;
    border: 2px solid rgba(255, 204, 0, 0.4);
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 0.1em;
    transition: all 0.3s;
    margin-bottom: 1.5rem;
}

#highscores-btn:hover {
    background: rgba(255, 204, 0, 0.25);
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.3);
    transform: scale(1.05);
}

/* === HIGHSCORES MODAL === */
#highscores-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 15, 0.92);
    z-index: 200;
}

#highscores-content {
    background: linear-gradient(135deg, #0a0a2e 0%, #1a0a3e 100%);
    border: 2px solid rgba(255, 204, 0, 0.3);
    border-radius: 20px;
    padding: 2rem 2.5rem;
    max-width: 450px;
    width: 90%;
    text-align: center;
}

#highscores-content h2 {
    font-size: 2rem;
    color: #ffcc00;
    margin-bottom: 0.5rem;
    letter-spacing: 0.15em;
}

.hs-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 204, 0, 0.6);
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
}

.hs-section {
    margin-bottom: 1.5rem;
}

.hs-section h3 {
    font-size: 1rem;
    color: #ff3366;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
}

.hs-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.hs-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.75rem;
}

.hs-entry.highlight {
    background: rgba(255, 204, 0, 0.15);
    border: 1px solid rgba(255, 204, 0, 0.4);
}

.hs-rank {
    color: #ffcc00;
    font-weight: 700;
    min-width: 25px;
}

.hs-name {
    color: #fff;
    flex: 1;
    text-align: left;
    margin-left: 0.5rem;
}

.hs-value {
    color: #33ccff;
    font-weight: 700;
    margin-left: 0.5rem;
}

.hs-date {
    color: #556688;
    font-size: 0.6rem;
    margin-left: 0.5rem;
}

.hs-empty {
    color: #556688;
    font-size: 0.75rem;
    padding: 0.5rem;
}

#hs-close-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.6rem 2.5rem;
    background: linear-gradient(90deg, #ff3366, #cc33ff);
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 0.1em;
    transition: all 0.3s;
    margin-top: 0.5rem;
}

#hs-close-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.4);
}

/* === GAMEOVER HIGHSCORES === */
#gameover-highscores {
    margin: 1rem 0;
    max-width: 400px;
    width: 100%;
}

#gameover-highscores .hs-section {
    margin-bottom: 1rem;
}

#gameover-highscores .hs-section h3 {
    font-size: 0.85rem;
}

#start-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
