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

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(180deg, #87CEEB 0%, #E0F6FF 50%, #90EE90 100%);
    min-height: 100vh;
    overflow: hidden;
}

.game-container {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

.sky {
    height: 40%;
    position: relative;
    overflow: hidden;
}

.sun {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #FFD700 30%, #FFA500 100%);
    border-radius: 50%;
    position: absolute;
    top: 20px;
    right: 50px;
    box-shadow: 0 0 40px #FFD700;
    animation: sunPulse 3s ease-in-out infinite;
}

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

.cloud {
    position: absolute;
    background: white;
    border-radius: 50px;
    opacity: 0.9;
}

.cloud::before, .cloud::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 50%;
}

.cloud1 {
    width: 100px;
    height: 40px;
    top: 30px;
    left: 10%;
    animation: float 20s linear infinite;
}

.cloud1::before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 10px;
}

.cloud1::after {
    width: 60px;
    height: 40px;
    top: -15px;
    right: 10px;
}

.cloud2 {
    width: 80px;
    height: 35px;
    top: 80px;
    left: 40%;
    animation: float 25s linear infinite;
}

.cloud2::before {
    width: 40px;
    height: 40px;
    top: -20px;
    left: 15px;
}

.cloud2::after {
    width: 50px;
    height: 35px;
    top: -10px;
    right: 15px;
}

.cloud3 {
    width: 120px;
    height: 45px;
    top: 50px;
    left: 70%;
    animation: float 22s linear infinite;
}

.cloud3::before {
    width: 60px;
    height: 60px;
    top: -30px;
    left: 20px;
}

.cloud3::after {
    width: 70px;
    height: 45px;
    top: -15px;
    right: 20px;
}

@keyframes float {
    from { transform: translateX(-200px); }
    to { transform: translateX(calc(100vw + 200px)); }
}

.game-area {
    height: 45%;
    position: relative;
    overflow: hidden;
}

.ground {
    height: 15%;
    background: linear-gradient(180deg, #228B22 0%, #006400 100%);
    position: relative;
}

.ground::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: repeating-linear-gradient(
        90deg,
        #32CD32 0px,
        #32CD32 20px,
        #228B22 20px,
        #228B22 40px
    );
}

.ramp-container {
    position: absolute;
    bottom: 0;
    left: 30%;
    width: 200px;
    height: 150px;
}

.ramp {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 50%, #8B4513 100%);
    clip-path: polygon(0 100%, 100% 100%, 100% 0);
    border: 3px solid #654321;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.car {
    position: absolute;
    bottom: 20px;
    left: 50px;
    width: 120px;
    height: 60px;
    transition: all 0.3s ease;
}

.car-body {
    position: relative;
    width: 100%;
    height: 100%;
}

.car-top {
    position: absolute;
    top: 0;
    left: 20px;
    width: 70px;
    height: 30px;
    background: linear-gradient(180deg, #FF4444 0%, #CC0000 100%);
    border-radius: 30px 30px 0 0;
    border: 2px solid #990000;
}

.car-bottom {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 120px;
    height: 35px;
    background: linear-gradient(180deg, #FF4444 0%, #CC0000 100%);
    border-radius: 10px;
    border: 2px solid #990000;
}

.window {
    position: absolute;
    top: 5px;
    left: 30px;
    width: 50px;
    height: 20px;
    background: linear-gradient(180deg, #87CEEB 0%, #4682B4 100%);
    border-radius: 20px 20px 0 0;
    border: 2px solid #990000;
}

.wheel {
    position: absolute;
    bottom: 0;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, #333 30%, #000 100%);
    border-radius: 50%;
    border: 3px solid #666;
    animation: wheelSpin 0.5s linear infinite;
    animation-play-state: paused;
}

.wheel::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15px;
    height: 15px;
    background: #888;
    border-radius: 50%;
}

.wheel-front {
    right: 10px;
}

.wheel-back {
    left: 10px;
}

@keyframes wheelSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.car.moving .wheel {
    animation-play-state: running;
}

.car.jumping {
    animation: jump 0.8s ease-out;
}

@keyframes jump {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-150px) rotate(-15deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

.car.flipping {
    animation: flip 1s ease-out;
}

@keyframes flip {
    0% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-100px) rotate(90deg); }
    50% { transform: translateY(-150px) rotate(180deg); }
    75% { transform: translateY(-100px) rotate(270deg); }
    100% { transform: translateY(0) rotate(360deg); }
}

.obstacles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.star {
    position: absolute;
    font-size: 40px;
    animation: starFloat 2s ease-in-out infinite;
    cursor: pointer;
    pointer-events: auto;
}

.star:nth-child(1) { top: 20%; left: 40%; animation-delay: 0s; }
.star:nth-child(2) { top: 40%; left: 60%; animation-delay: 0.5s; }
.star:nth-child(3) { top: 30%; left: 80%; animation-delay: 1s; }

@keyframes starFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.2); }
}

.star.collected {
    animation: starCollect 0.5s ease-out forwards;
}

@keyframes starCollect {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.coin {
    position: absolute;
    font-size: 35px;
    animation: coinSpin 3s linear infinite;
}

.coin:nth-child(4) { top: 60%; left: 50%; }
.coin:nth-child(5) { top: 50%; left: 70%; }

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

.coin.collected {
    animation: coinCollect 0.5s ease-out forwards;
}

@keyframes coinCollect {
    0% { transform: scale(1) rotateY(0deg); opacity: 1; }
    100% { transform: scale(0) rotateY(720deg); opacity: 0; }
}

.finish-line {
    position: absolute;
    right: 50px;
    bottom: 20px;
    font-size: 60px;
    animation: flagWave 2s ease-in-out infinite;
}

@keyframes flagWave {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
    z-index: 100;
}

.score-board {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.score, .stars {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 10px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 15px;
}

.btn {
    padding: 15px 30px;
    font-size: 20px;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-go {
    background: linear-gradient(135deg, #32CD32 0%, #228B22 100%);
    color: white;
}

.btn-jump {
    background: linear-gradient(135deg, #4169E1 0%, #0000CD 100%);
    color: white;
}

.btn-flip {
    background: linear-gradient(135deg, #FF6347 0%, #DC143C 100%);
    color: white;
}

.instructions {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

.message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    z-index: 200;
}

.message.show {
    animation: messagePop 2s ease-out forwards;
}

@keyframes messagePop {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

@media (max-width: 768px) {
    .controls {
        width: 95%;
        padding: 15px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .score-board {
        font-size: 16px;
        gap: 15px;
    }
    
    .car {
        width: 80px;
        height: 40px;
    }
    
    .car-top {
        width: 50px;
        height: 20px;
        left: 15px;
    }
    
    .car-bottom {
        width: 80px;
        height: 25px;
    }
    
    .window {
        width: 35px;
        height: 15px;
        left: 22px;
    }
    
    .wheel {
        width: 22px;
        height: 22px;
    }
}