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

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

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.game-header h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.score-board {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px;
    border-radius: 10px;
    color: white;
    font-size: 1.2em;
    font-weight: bold;
}

.game-area {
    position: relative;
    width: 100%;
    height: 500px;
    background: #2d3436;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.road {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #34495e 0%, #2c3e50 100%);
}

.lane-divider {
    position: absolute;
    width: 4px;
    height: 60px;
    background: #f39c12;
    left: 25%;
    animation: moveDown 1s linear infinite;
}

.lane-divider:nth-child(2) {
    left: 50%;
}

.lane-divider:nth-child(3) {
    left: 75%;
}

.lane-divider:nth-child(even) {
    animation-delay: 0.5s;
}

@keyframes moveDown {
    0% {
        top: -60px;
    }
    100% {
        top: 100%;
    }
}

.player-car {
    position: absolute;
    width: 50px;
    height: 80px;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(to bottom, #e74c3c 0%, #c0392b 100%);
    border-radius: 10px 10px 5px 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transition: left 0.15s ease;
    z-index: 10;
}

.player-car::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 25px;
    background: #3498db;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 5px;
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.3);
}

.player-car::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 15px;
    background: #2c3e50;
    bottom: 0;
    border-radius: 0 0 5px 5px;
}

.obstacle {
    position: absolute;
    width: 50px;
    height: 80px;
    background: linear-gradient(to bottom, #95a5a6 0%, #7f8c8d 100%);
    border-radius: 10px 10px 5px 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    animation: obstacleMove 3s linear;
}

.obstacle::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 25px;
    background: #34495e;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 5px;
}

.coin {
    position: absolute;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, #f1c40f 0%, #f39c12 100%);
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(241, 196, 15, 0.5);
    animation: obstacleMove 3s linear, spin 1s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
}

.coin::before {
    content: '💰';
}

@keyframes obstacleMove {
    0% {
        top: -100px;
    }
    100% {
        top: 100%;
    }
}

@keyframes spin {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}

.game-controls {
    text-align: center;
}

.instructions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 5px solid #667eea;
}

.instructions h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.instructions p {
    margin: 8px 0;
    color: #2c3e50;
}

.start-btn,
.restart-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.start-btn:hover,
.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

.start-btn:active,
.restart-btn:active {
    transform: translateY(0);
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.98);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 100;
    min-width: 300px;
}

.game-over h2 {
    color: #e74c3c;
    font-size: 2.5em;
    margin-bottom: 20px;
}

.game-over p {
    font-size: 1.3em;
    margin: 10px 0;
    color: #2c3e50;
}

.game-over span {
    color: #667eea;
    font-weight: bold;
}

.hidden {
    display: none;
}

@media (max-width: 600px) {
    .game-container {
        padding: 15px;
    }
    
    .game-header h1 {
        font-size: 1.8em;
    }
    
    .score-board {
        font-size: 1em;
        padding: 10px;
    }
    
    .game-area {
        height: 400px;
    }
}
