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

body {
    font-family: 'Quicksand', sans-serif;
    /* overflow: hidden; */
    overflow-x: hidden;
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameContainer {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 500px;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}


/* UI Overlay */

#uiOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 10;
}

.score-panel {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.coin-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    animation: coinSpin 2s linear infinite;
}

@keyframes coinSpin {
    0%,
    100% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(180deg);
    }
}

.score-text {
    font-family: 'Fredoka One', cursive;
    font-size: 24px;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.distance-panel {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 50px;
    border: 2px solid rgba(0, 200, 255, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.distance-text {
    font-family: 'Fredoka One', cursive;
    font-size: 20px;
    color: #00D4FF;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}


/* Start Screen */

#startScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 150, 200, 0.9) 0%, rgba(0, 100, 150, 0.95) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.game-title {
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    color: #FFFFFF;
    text-shadow: 2px 2px 0 #FF6B35, 4px 4px 0 rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
    animation: titleBounce 2s ease-in-out infinite;
}

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

.game-subtitle {
    font-family: 'Quicksand', sans-serif;
    font-size: 10px;
    color: #FFE066;
    margin-bottom: 20px;
    font-weight: 700;
}

.tuk-tuk-preview {
    width: 100px;
    margin-bottom: 15px;
    animation: tukTukBounce 1s ease-in-out infinite;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.4));
}

@keyframes tukTukBounce {
    0%,
    100% {
        transform: translateY(0) rotate(-2deg);
    }
    50% {
        transform: translateY(-15px) rotate(2deg);
    }
}

.start-btn {
    font-family: 'Fredoka One', cursive;
    font-size: 14px;
    padding: 9px 30px;
    background: linear-gradient(180deg, #FFD700 0%, #FFA500 100%);
    border: none;
    border-radius: 25px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 0 #CC8400, 0 5px 10px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 0 #CC8400, 0 15px 30px rgba(0, 0, 0, 0.4);
}

.start-btn:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #CC8400, 0 5px 10px rgba(0, 0, 0, 0.3);
}

.instructions {
    margin-top: 15px;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 8px;
    line-height: 1.8;
}

.key-hint {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 7px;
    border-radius: 4px;
    margin: 0 2px;
    font-weight: 700;
}


/* Game Over Screen */

#gameOverScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.game-over-title {
    font-family: 'Fredoka One', cursive;
    font-size: 42px;
    color: #FF4444;
    text-shadow: 3px 3px 0 #AA0000;
    margin-bottom: 20px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.final-stats {
    background: rgba(255, 255, 255, 0.1);
    padding: 25px 50px;
    border-radius: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 10px 0;
}

.stat-label {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
}

.stat-value {
    font-family: 'Fredoka One', cursive;
    font-size: 32px;
    color: #FFD700;
}

.high-score-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #333;
    padding: 8px 20px;
    border-radius: 20px;
    font-family: 'Fredoka One', cursive;
    font-size: 14px;
    margin-top: 15px;
    display: none;
}

.button-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.retry-btn {
    font-family: 'Fredoka One', cursive;
    font-size: 24px;
    padding: 10px 40px;
    background: linear-gradient(180deg, #4CAF50 0%, #45a049 100%);
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 0 #2E7D32, 0 10px 20px rgba(0, 0, 0, 0.3);
}

.retry-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 0 #2E7D32, 0 15px 30px rgba(0, 0, 0, 0.4);
}

.explore-btn {
    font-family: 'Fredoka One', cursive;
    font-size: 24px;
    padding: 10px 40px;
    background: linear-gradient(180deg, #FFD700 0%, #FFA500 100%);
    border: none;
    border-radius: 50px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 0 #CC8400, 0 10px 20px rgba(0, 0, 0, 0.3);
}

.explore-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 0 #CC8400, 0 15px 30px rgba(0, 0, 0, 0.4);
}


/* Pause indicator */

#pauseIndicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Fredoka One', cursive;
    font-size: 48px;
    color: white;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 50;
}


/* Countdown overlay */

#countdownOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 90;
    backdrop-filter: blur(2px);
}

#countdownNumber {
    font-family: 'Fredoka One', cursive;
    font-size: 120px;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.6), 5px 5px 0 #FF6B35, 10px 10px 20px rgba(0, 0, 0, 0.8);
    animation: countdownPulse 1s ease-out;
    -webkit-text-stroke: 2px rgba(0, 0, 0, 0.5);
}

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


/* Mobile controls hint */

.mobile-hint {
    display: none;
}

@media (max-width: 768px) {
    .game-title {
        font-size: 18px;
    }
    .tuk-tuk-preview {
        width: 75px;
    }
    .start-btn {
        font-size: 11px;
        padding: 7px 22px;
    }
    .button-group {
        flex-direction: column;
        gap: 15px;
    }
    .retry-btn,
    .explore-btn {
        font-size: 18px;
        padding: 8px 30px;
    }
    .mobile-hint {
        display: block;
    }
    .desktop-hint {
        display: none;
    }
    #gameContainer {
        height: 400px;
        border-radius: 0;
    }
}