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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

#game-container {
    width: 100%;
    height: 100%;
    position: relative;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 18px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 10;
}

.hidden {
    display: none;
}

button {
    padding: 12px 24px;
    margin: 15px;
    font-size: 18px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

button:disabled {
    background-color: #cccccc;
    color: #888888;
    cursor: not-allowed;
}

h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

h2 {
    font-size: 32px;
    margin-bottom: 15px;
}

h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

/* Menu styles */
.menu-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
    max-width: 400px;
}

#player-setup, #multiplayer-setup {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.color-select {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    gap: 10px;
}

.color-select span {
    margin-right: 10px;
    font-weight: bold;
}

.color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid transparent;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.selected {
    border: 2px solid white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

/* Multiplayer styles */
#player-name {
    padding: 10px;
    font-size: 16px;
    margin: 10px 0;
    border-radius: 5px;
    border: none;
    width: 100%;
    max-width: 300px;
}

#player-list-container {
    margin-top: 20px;
    width: 100%;
    text-align: center;
}

#player-list {
    list-style: none;
    margin: 15px 0;
    text-align: left;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

#player-list li {
    padding: 8px;
    margin: 5px 0;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    display: flex;
    align-items: center;
}

#player-list .player-color {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin-right: 10px;
}

/* Countdown styles */
#countdown {
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
}

#countdown-number {
    font-size: 150px;
    animation: pulse 1s infinite;
}

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

/* Game over screen */
#game-over {
    text-align: center;
}

#final-time, #final-position {
    font-size: 24px;
    margin: 10px 0;
}

/* Responsive design */
@media (max-width: 768px) {
    #hud {
        font-size: 14px;
    }
    
    h1 {
        font-size: 36px;
    }
    
    button {
        padding: 10px 20px;
        font-size: 16px;
    }
    
    #countdown-number {
        font-size: 100px;
    }
}