/* ========================================
   ENDLESS RUNNER - ARCADE GAME STYLES
   Modern Dark Theme with Neon Accents
   ======================================== */

/* CSS Variables for Theme Colors */
:root {
    --bg-dark: #0a0a0f;
    --bg-darker: #050508;
    --neon-cyan: #00ffff;
    --neon-purple: #bf00ff;
    --neon-pink: #ff00ff;
    --text-white: #ffffff;
    --text-gray: #a0a0a0;
}

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

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    color: var(--text-white);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Animated Background Pattern */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 255, 255, 0.03) 2px, rgba(0, 255, 255, 0.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(191, 0, 255, 0.03) 2px, rgba(191, 0, 255, 0.03) 4px);
    animation: gridMove 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* Container for Centered Content */
.container {
    text-align: center;
    padding: 20px;
    max-width: 600px;
}

/* Title Styles */
.title {
    font-size: 4rem;
    font-weight: bold;
    letter-spacing: 8px;
    margin-bottom: 40px;
    text-transform: uppercase;
    position: relative;
}

/* Neon Glow Effect */
.glow {
    color: var(--neon-cyan);
    text-shadow: 
        0 0 10px var(--neon-cyan),
        0 0 20px var(--neon-cyan),
        0 0 30px var(--neon-cyan),
        0 0 40px var(--neon-purple);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        text-shadow: 
            0 0 10px var(--neon-cyan),
            0 0 20px var(--neon-cyan),
            0 0 30px var(--neon-cyan),
            0 0 40px var(--neon-purple);
    }
    50% {
        text-shadow: 
            0 0 20px var(--neon-cyan),
            0 0 30px var(--neon-cyan),
            0 0 40px var(--neon-cyan),
            0 0 50px var(--neon-purple);
    }
}

/* Button Styles */
.btn {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 15px 60px;
    margin: 10px;
    border: 3px solid var(--neon-cyan);
    background: transparent;
    color: var(--neon-cyan);
    border-radius: 50px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background: var(--neon-cyan);
    color: var(--bg-dark);
    transform: scale(1.05);
}

.btn:active {
    transform: scale(0.95);
}

/* Glowing Button */
.glow-btn {
    animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {
    0%, 100% {
        box-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan);
    }
    50% {
        box-shadow: 0 0 20px var(--neon-cyan), 0 0 30px var(--neon-cyan), 0 0 40px var(--neon-purple);
    }
}

/* Credits */
.credits {
    margin-top: 40px;
    font-size: 0.9rem;
    color: var(--text-gray);
    letter-spacing: 2px;
}

/* Controls Info */
.controls-info {
    margin-top: 60px;
    font-size: 1rem;
    color: var(--text-gray);
}

.controls-info p {
    margin: 8px 0;
}

.key {
    display: inline-block;
    padding: 5px 15px;
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid var(--neon-cyan);
    border-radius: 5px;
    color: var(--neon-cyan);
    font-weight: bold;
    margin: 0 5px;
}

/* Game Screen Styles */
#game-screen {
    flex-direction: column;
    background: var(--bg-darker);
}

/* HUD (Heads Up Display) */
.hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 20px 40px;
    z-index: 10;
    pointer-events: none;
}

.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-display .label {
    font-size: 0.8rem;
    color: var(--text-gray);
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.score-display .value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}

/* Canvas */
#game-canvas {
    display: block;
    background: var(--bg-darker);
    max-width: 100%;
    max-height: 100%;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

/* Mobile Controls */
.mobile-controls {
    position: absolute;
    bottom: 30px;
    width: 100%;
    display: none;
    justify-content: center;
    z-index: 10;
}

.btn-jump {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 20px 50px;
    border: 3px solid var(--neon-purple);
    background: rgba(191, 0, 255, 0.2);
    color: var(--neon-purple);
    border-radius: 50px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 3px;
    box-shadow: 0 0 20px var(--neon-purple);
    transition: all 0.1s ease;
}

.btn-jump:active {
    transform: scale(0.95);
    background: rgba(191, 0, 255, 0.4);
}

/* Game Over Screen */
.final-scores {
    margin: 40px 0;
}

.score-item {
    display: flex;
    flex-direction: column;
    margin: 20px 0;
}

.score-item .label {
    font-size: 1rem;
    color: var(--text-gray);
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.score-item .value {
    font-size: 3rem;
    font-weight: bold;
    color: var(--neon-purple);
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
        letter-spacing: 5px;
        margin-bottom: 30px;
    }

    .btn {
        font-size: 1.2rem;
        padding: 12px 40px;
    }

    .controls-info {
        font-size: 0.9rem;
        margin-top: 40px;
    }

    .hud {
        padding: 15px 20px;
    }

    .score-display .value {
        font-size: 1.5rem;
    }

    .score-display .label {
        font-size: 0.7rem;
    }

    .mobile-controls {
        display: flex;
    }

    .score-item .value {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
        letter-spacing: 3px;
    }

    .btn {
        font-size: 1rem;
        padding: 10px 30px;
        letter-spacing: 2px;
    }

    .controls-info {
        margin-top: 30px;
    }

    .hud {
        padding: 10px 15px;
    }

    .score-display .value {
        font-size: 1.2rem;
    }

    .btn-jump {
        font-size: 1rem;
        padding: 15px 40px;
    }
}

/* Touch Device Detection */
@media (hover: none) and (pointer: coarse) {
    .mobile-controls {
        display: flex;
    }
}
