* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-orange: #FF6B35;
    --primary-dark: #1a1a2e;
    --secondary-blue: #0F3460;
    --accent: #E94560;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-blue) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    padding: 1rem;
}

.container {
    text-align: center;
    z-index: 1;
    padding: 1rem;
    width: 100%;
    max-width: 900px;
}

/* Logo */
.logo {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 900;
    color: var(--primary-orange);
    text-shadow: 0 0 30px rgba(255, 107, 53, 0.4);
    margin-bottom: 0.5rem;
    letter-spacing: -2px;
}

.logo-sub {
    font-size: clamp(0.8rem, 2.5vw, 1.1rem);
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: clamp(3px, 1.5vw, 6px);
    margin-bottom: 2rem;
}

/* Game Area */
.game-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: clamp(15px, 3vw, 30px);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border: 2px solid rgba(255, 107, 53, 0.3);
    margin: 0 auto;
}

.game-screen {
    width: 100%;
    max-width: 600px;
    height: clamp(150px, 35vw, 200px);
    background: #f7f7f7;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    touch-action: none;
}

/* Ground */
.ground {
    position: absolute;
    bottom: 0;
    width: 200%;
    height: 20px;
    background: repeating-linear-gradient(
        90deg,
        #535353 0px,
        #535353 80px,
        #606060 80px,
        #606060 160px
    );
    animation: moveGround 3s linear infinite;
}

@keyframes moveGround {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Ratel Sprite */
.ratel {
    position: absolute;
    bottom: 20px;
    left: 50px;
    width: 36px;
    height: 24px;
    z-index: 10;
    /* No transition - physics handles movement */
}

.ratel-sprite {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Pixel blocks for the ratel */
.pixel {
    position: absolute;
    width: 2px;
    height: 2px;
}

/* Obstacles */
.obstacle {
    position: absolute;
    bottom: 20px;
    width: 15px;
    height: 25px;
    background: #535353;
    border-radius: 2px;
    right: -20px;
}

.obstacle.cactus {
    background: linear-gradient(to bottom, #2d5016, #3d6b1f);
    width: 12px;
    height: 28px;
}

.obstacle.rock {
    background: #666;
    border-radius: 4px;
    width: 18px;
    height: 20px;
}

.obstacle.bird {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    width: 20px;
    height: 12px;
    border-radius: 50%;
    bottom: 60px;
}

.obstacle.bird::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 3px;
    background: #A0522D;
    top: 4px;
    left: -6px;
    border-radius: 2px;
}

.obstacle.bird::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 3px;
    background: #A0522D;
    top: 4px;
    right: -6px;
    border-radius: 2px;
}

.obstacle.moving {
    animation: moveObstacle 2.5s linear forwards;
}

.obstacle.paused {
    animation-play-state: paused;
}

@keyframes moveObstacle {
    0% {
        right: -30px;
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        right: 110%;
        opacity: 0;
    }
}

/* Clouds */
.cloud {
    position: absolute;
    background: #e0e0e0;
    border-radius: 50px;
    opacity: 0.7;
    animation: moveCloud 20s linear infinite;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: #e0e0e0;
    border-radius: 50px;
}

.cloud1 {
    width: 40px;
    height: 15px;
    top: 30px;
    animation-duration: 25s;
}

.cloud1::before {
    width: 20px;
    height: 20px;
    top: -10px;
    left: 10px;
}

.cloud2 {
    width: 30px;
    height: 12px;
    top: 50px;
    animation-duration: 30s;
    animation-delay: -5s;
}

@keyframes moveCloud {
    0% { right: -60px; }
    100% { right: 100%; }
}

/* Level Indicator */
.level-indicator {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Courier New', monospace;
    font-size: clamp(12px, 2.5vw, 14px);
    color: #FF6B35;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Score */
.score {
    position: absolute;
    top: 10px;
    right: 10px;
    font-family: 'Courier New', monospace;
    font-size: clamp(14px, 3vw, 18px);
    color: #535353;
    font-weight: bold;
}

/* High Score */
.high-score {
    position: absolute;
    top: 10px;
    left: 10px;
    font-family: 'Courier New', monospace;
    font-size: clamp(12px, 2.5vw, 14px);
    color: #888;
    font-weight: bold;
}

/* Game Over */
.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: clamp(20px, 5vw, 40px);
    border-radius: 12px;
    display: none;
    z-index: 100;
    text-align: center;
    min-width: 200px;
    border: 2px solid var(--primary-orange);
}

.game-over.show {
    display: block;
}

.game-over h2 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: clamp(1.3rem, 5vw, 2rem);
}

.game-over p {
    margin: 8px 0;
    font-size: clamp(0.9rem, 3vw, 1.1rem);
}

.restart-btn {
    margin-top: 15px;
    padding: clamp(10px, 3vw, 14px) clamp(25px, 6vw, 35px);
    background: var(--primary-orange);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    transition: all 0.3s;
}

.restart-btn:hover {
    background: var(--accent);
    transform: scale(1.05);
}

/* Message */
.message {
    color: white;
    font-size: clamp(1rem, 3vw, 1.3rem);
    margin-top: 2rem;
    line-height: 1.8;
    padding: 0 1rem;
}

.highlight {
    color: var(--primary-orange);
    font-weight: bold;
}

/* Email Form */
.email-form {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.email-input-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 500px;
}

.email-input {
    flex: 1;
    min-width: 200px;
    padding: clamp(0.8rem, 2vw, 1rem) clamp(1rem, 3vw, 1.5rem);
    border: 2px solid var(--primary-orange);
    border-radius: 50px;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    outline: none;
    transition: all 0.3s;
}

.email-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
}

.submit-btn {
    padding: clamp(0.8rem, 2vw, 1rem) clamp(2rem, 5vw, 3rem);
    background: linear-gradient(135deg, var(--primary-orange), var(--accent));
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(255, 107, 53, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-message {
    color: var(--primary-orange);
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    margin-top: 1rem;
    min-height: 24px;
}

.rgpd-notice {
    color: rgba(255, 255, 255, 0.5);
    font-size: clamp(0.65rem, 1.8vw, 0.75rem);
    margin-top: 0.8rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}

.rgpd-notice a {
    color: var(--primary-orange);
    text-decoration: none;
    transition: opacity 0.3s;
}

.rgpd-notice a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Loading bar */
.loading-bar {
    width: 100%;
    max-width: 300px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin: 2rem auto 1rem;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-orange), var(--accent));
    animation: load 3s ease-in-out infinite;
}

@keyframes load {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Instructions */
.instructions {
    color: rgba(255, 255, 255, 0.6);
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    margin-top: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }

    .ratel {
        left: 30px;
        width: 30px;
        height: 20px;
    }

    .obstacle {
        width: 12px;
        height: 20px;
    }

    .obstacle.cactus {
        width: 10px;
        height: 22px;
    }

    .obstacle.rock {
        width: 14px;
        height: 16px;
    }

    .game-container {
        padding: 15px;
    }

    .email-input-container {
        flex-direction: column;
    }

    .email-input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .logo {
        margin-bottom: 0.3rem;
    }

    .logo-sub {
        margin-bottom: 1.5rem;
    }

    .game-container {
        padding: 10px;
    }
}
