/* ========================================
   Moon Flag Runner - Styles
   ======================================== */

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

:root {
    --space-dark: #0a0a1a;
    --moon-gray: #c9c9c9;
    --moon-light: #e8e8e8;
    --accent-blue: #4fc3f7;
    --accent-purple: #b388ff;
    --accent-gold: #ffd54f;
    --glow-blue: rgba(79, 195, 247, 0.6);
    --glow-purple: rgba(179, 136, 255, 0.6);
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Space Grotesk', sans-serif;
    background: var(--space-dark);
}

/* Game Container */
#game-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
}

/* Game Canvas */
#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Screens (Start & Game Over) */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    background: linear-gradient(180deg, #0a0a2e 0%, #1a1a3e 50%, #0a0a1a 100%);
    padding: 20px;
    text-align: center;
}

.screen.hidden {
    display: none;
}

/* Stars Background */
.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, white, transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 160px 120px, white, transparent),
        radial-gradient(2px 2px at 200px 50px, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(1px 1px at 250px 160px, white, transparent),
        radial-gradient(2px 2px at 300px 100px, rgba(255, 255, 255, 0.7), transparent);
    background-size: 350px 200px;
    animation: twinkle 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Earth Background */
.earth-bg {
    position: absolute;
    bottom: -150px;
    right: -100px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e88e5 0%, #4caf50 30%, #1565c0 60%, #0d47a1 100%);
    box-shadow:
        inset -30px -30px 60px rgba(0, 0, 0, 0.4),
        0 0 100px rgba(30, 136, 229, 0.3),
        0 0 200px rgba(30, 136, 229, 0.2);
    opacity: 0.6;
    pointer-events: none;
}

/* Game Title */
.game-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 900;
    color: white;
    text-shadow:
        0 0 20px var(--glow-blue),
        0 0 40px var(--glow-purple);
    margin-bottom: 10px;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.moon-icon {
    font-size: 0.8em;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.subtitle {
    font-size: clamp(0.9rem, 3vw, 1.3rem);
    color: var(--moon-gray);
    margin-bottom: 40px;
    z-index: 1;
}

/* Glow Button */
.glow-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1rem, 4vw, 1.4rem);
    font-weight: 700;
    padding: 18px 45px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    color: white;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
    box-shadow:
        0 5px 30px rgba(79, 195, 247, 0.4),
        0 0 0 2px rgba(255, 255, 255, 0.1);
}

.glow-btn:hover {
    transform: scale(1.05);
    box-shadow:
        0 8px 40px rgba(79, 195, 247, 0.6),
        0 0 0 2px rgba(255, 255, 255, 0.2);
}

.glow-btn:active {
    transform: scale(0.98);
}

.glow-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.instructions {
    font-size: clamp(0.8rem, 2.5vw, 1rem);
    color: rgba(255, 255, 255, 0.5);
    margin-top: 25px;
    z-index: 1;
}

/* Score Display */
#score-display {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 900;
    color: white;
    text-shadow:
        0 2px 10px rgba(0, 0, 0, 0.5),
        0 0 30px var(--glow-blue);
    display: none;
}

#score-display.visible {
    display: block;
}

/* Game Over Screen */
.gameover-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 7vw, 3.5rem);
    font-weight: 900;
    color: white;
    text-shadow: 0 0 30px var(--glow-purple);
    margin-bottom: 15px;
    z-index: 1;
}

.killer-message {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    color: #e0e0e0;
    margin-bottom: 20px;
    z-index: 1;
    display: none;
}

.score-container {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    z-index: 1;
    flex-wrap: wrap;
    justify-content: center;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
}

.score-item.highlight {
    background: rgba(255, 213, 79, 0.15);
    border-radius: 12px;
    border: 2px solid var(--accent-gold);
}

.score-label {
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    color: var(--moon-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 3px;
}

.score-value {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    font-weight: 900;
    color: var(--accent-gold);
    text-shadow: 0 0 20px rgba(255, 213, 79, 0.5);
}

.score-value.small {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    color: #e0e0e0;
    text-shadow: none;
}

.flags-collected {
    margin-bottom: 30px;
    z-index: 1;
    color: var(--moon-gray);
    font-size: clamp(0.8rem, 2.5vw, 1rem);
}

#flag-list {
    margin-top: 10px;
    font-size: clamp(1.5rem, 5vw, 2rem);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 300px;
}

.share-btn {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    font-weight: 500;
    padding: 12px 30px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    background: transparent;
    color: white;
    cursor: pointer;
    margin-top: 15px;
    z-index: 1;
    transition: all 0.3s ease;
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Responsive */
@media (max-width: 480px) {
    .earth-bg {
        width: 250px;
        height: 250px;
        bottom: -100px;
        right: -80px;
    }

    .score-container {
        gap: 25px;
    }

    .glow-btn {
        padding: 15px 35px;
    }
}

/* Prevent text selection */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}