/* Reset et variables CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c;
    --accent-color: #f39c12;
    --bg-color: #ecf0f1;
    --text-color: #2c3e50;
    --desert-color: #d4a574;
    --cactus-color: #27ae60;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 50%, #6c5ce7 100%);
    min-height: 100vh;
    color: var(--text-color);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 1s ease-out;
}

.title {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: white;
    text-shadow: 3px 3px 0px var(--secondary-color);
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.subtitle {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: #ddd;
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Game Container */
.game-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 30px;
    position: relative;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.score-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    border: 2px solid var(--primary-color);
}

.score-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    color: var(--primary-color);
}

.score-value {
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    color: var(--secondary-color);
    font-weight: bold;
}

/* Canvas */
#gameCanvas {
    width: 100%;
    max-width: 800px;
    height: 200px;
    border: 3px solid var(--primary-color);
    border-radius: var(--border-radius);
    background: linear-gradient(to bottom, #87CEEB 0%, #87CEEB 70%, var(--desert-color) 70%, var(--desert-color) 100%);
    display: block;
    margin: 0 auto;
    cursor: pointer;
    transition: transform 0.1s ease;
}

#gameCanvas:hover {
    transform: scale(1.02);
}

#gameCanvas:active {
    transform: scale(0.98);
}

/* Game Overlay */
.game-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.start-screen, .game-over-screen {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: var(--border-radius);
    border: 3px solid var(--primary-color);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.start-screen h2, .game-over-screen h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.start-screen p, .game-over-screen p {
    margin-bottom: 20px;
    font-size: 1rem;
    color: var(--text-color);
}

kbd {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
}

.play-btn, .share-btn {
    font-family: 'Press Start 2P', cursive;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin: 5px;
}

.play-btn {
    background: var(--secondary-color);
    color: white;
}

.play-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(231, 76, 60, 0.3);
}

.share-btn {
    background: var(--accent-color);
    color: white;
}

.share-btn:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(243, 156, 18, 0.3);
}

.game-over-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    justify-content: center;
    margin-top: 15px;
}

.jump-btn {
    font-family: 'Press Start 2P', cursive;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 15px 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.jump-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.jump-btn:active {
    transform: translateY(0);
}

/* Instructions */
.instructions {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 30px;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.instructions h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.instruction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.instruction-item {
    text-align: center;
    padding: 15px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    transition: transform 0.3s ease;
}

.instruction-item:hover {
    transform: translateY(-5px);
}

.instruction-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.instruction-item p {
    font-size: 0.9rem;
    color: var(--text-color);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: auto;
    padding: 20px 0;
    color: white;
    font-size: 0.9rem;
    animation: fadeIn 1s ease-out 0.9s both;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .game-container {
        padding: 15px;
    }

    #gameCanvas {
        height: 150px;
    }

    .mobile-controls {
        display: flex;
    }

    .score-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .instruction-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .start-screen, .game-over-screen {
        padding: 20px;
        margin: 0 10px;
    }

    .game-over-buttons {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.2rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    #gameCanvas {
        height: 120px;
    }

    .instruction-grid {
        grid-template-columns: 1fr;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000;
        --secondary-color: #ff0000;
        --accent-color: #ff8800;
        --bg-color: #fff;
        --text-color: #000;
    }
}

