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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0c0c2e 0%, #1a1a4a 50%, #2d2d6b 100%);
    color: white;
    min-height: 100vh;
    overflow: hidden;
}

#gameContainer {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

h1 {
    margin: 20px 0;
    font-size: 2.5em;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #ffd700, #ffb347);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.screen.active {
    display: flex;
}

/* Selection Screen */
#selectionScreen {
    padding: 20px;
}

.players {
    gap: 50px;
    margin: 30px 0;
}

.player-section {
    flex: 1;
    margin: 10px 0px;
}

.player-section h3 {
    display: flex;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8em;
    color: #ffd700;
}

.rocket-options {
    display: flex;
    gap: 15px;
}

.rocket-option {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.rocket-option:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ffd700;
    transform: translateY(-2px);
}

.rocket-option.selected {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.rocket-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.rocket-option h4 {
    margin-bottom: 10px;
    color: #ffd700;
}

.rocket-option p {
    margin: 5px 0;
    opacity: 0.8;
}

.selection-status {
    text-align: center;
    margin-top: 15px;
    font-weight: bold;
    color: #ffb347;
}

#startGame {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

#startGame:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

#startGame:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Building Screen */
#buildingScreen h2 {
    margin-bottom: 50px;
    font-size: 2em;
    color: #ffd700;
}

.building-progress {
    display: flex;
    gap: 100px;
}

.player-build {
    text-align: center;
}

.player-build h3 {
    margin-bottom: 20px;
    font-size: 1.5em;
    color: #ffd700;
}

.build-timer {
    width: 300px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 15px;
    border: 2px solid #ffd700;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 13px;
}

/* Game Screen */
#gameScreen {
    padding: 20px;
    justify-content: flex-start;
}

.game-info {
    width: 100%;
    margin-bottom: 20px;
}

.player-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.player-status {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    flex: 1;
    margin: 0 10px;
}

.player-status h3 {
    color: #ffd700;
    margin-bottom: 5px;
}

.race-progress {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.progress-track {
    background: rgba(255, 255, 255, 0.1);
    height: 30px;
    border-radius: 15px;
    position: relative;
    border: 2px solid #ffd700;
}

.moon {
    position: absolute;
    right: -15px;
    top: -5px;
    font-size: 2em;
}

.player-marker {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
    transition: left 0.1s ease;
}

#player1Marker {
    background: #ff6b6b;
    left: 0%;
}

#player2Marker {
    background: #4ecdc4;
    left: 0%;
}

#gameCanvas {
    border: 3px solid #ffd700;
    border-radius: 10px;
    background: linear-gradient(180deg, #000428 0%, #004e92 100%);
    display: block;
    margin: 0 auto;
}

/* Game Over Screen */
#gameOverScreen {
    text-align: center;
}

#winnerText {
    font-size: 3em;
    margin-bottom: 30px;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#playAgain {
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

#playAgain:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .players {
        flex-direction: column;
        gap: 30px;
    }

    .building-progress {
        flex-direction: column;
        gap: 30px;
    }

    #gameCanvas {
        width: 100%;
        height: auto;
    }

    .player-info {
        flex-direction: column;
        gap: 10px;
    }
}
