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

body {
    font-family: 'Arial Black', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    color: #fff;
}

#game-container {
    position: relative;
    max-width: 400px;
    margin: 20px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    overflow: hidden;
}

#canvas {
    display: block;
    background: #2d5016;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#ui-overlay > * {
    pointer-events: auto;
}

#hud {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    color: #FFD700;
}

#start-screen, #game-over-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.85);
    padding: 30px;
    border-radius: 15px;
    border: 3px solid #FFD700;
    min-width: 280px;
}

.game-title {
    font-size: 36px;
    color: #FFD700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.car-icon {
    font-size: 48px;
    margin: 20px 0;
    animation: drive 2s ease-in-out infinite;
}

@keyframes drive {
    0%, 100% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
}

#display-high-score {
    font-size: 18px;
    color: #FFD700;
    margin-bottom: 20px;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 3px solid #FFD700;
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 10px 0;
}

button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

button:active {
    transform: scale(0.95);
}

.controls-hint {
    font-size: 12px;
    color: #ccc;
    margin-top: 15px;
}

.game-over-title {
    font-size: 32px;
    color: #FF4444;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    margin-bottom: 15px;
}

#final-score {
    font-size: 24px;
    color: #FFD700;
    margin-bottom: 10px;
}

#new-record {
    font-size: 20px;
    color: #FFD700;
    margin: 15px 0;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#share-score {
    font-size: 12px;
    color: #ccc;
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.hidden {
    display: none !important;
}

footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

footer a {
    color: #FFD700;
    text-decoration: none;
    font-weight: bold;
}

footer a:hover {
    text-decoration: underline;
}

.tagline {
    font-size: 12px;
    font-style: italic;
    margin-top: 5px;
    opacity: 0.7;
}

@media (max-width: 480px) {
    .game-title {
        font-size: 28px;
    }
    
    #start-screen, #game-over-screen {
        padding: 20px;
        min-width: 240px;
    }
    
    button {
        padding: 12px 30px;
        font-size: 16px;
    }
}