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

body {
    font-family: 'Press Start 2P', cursive;
    background: transparent;
    overflow: hidden;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    min-height: 500px;
}

#gameContainer {
    position: relative;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    box-shadow: none;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 70%, #228B22 100%);
    touch-action: manipulation;
    cursor: pointer;
    max-width: 100%;
    max-height: 100%;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    z-index: 10;
    touch-action: manipulation;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.title h1 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #FFD700;
    text-shadow: 2px 2px 0px #000;
}

.subtitle {
    font-size: 10px;
    margin-bottom: 30px;
    color: #FFA500;
    line-height: 1.5;
}

.instructions {
    font-size: 8px;
    line-height: 1.8;
    max-width: 600px;
}

.instructions p {
    margin-bottom: 10px;
}

.start-prompt {
    color: #00FF00;
    animation: blink 1s infinite;
}

.start-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    padding: 20px 30px;
    background: #4CAF50;
    color: white;
    border: 4px solid #000;
    border-radius: 0;
    cursor: pointer;
    box-shadow: 4px 4px 0px #000;
    transition: all 0.1s;
    margin-top: 20px;
    min-width: 200px;
    min-height: 60px;
    touch-action: manipulation;
}

.start-btn:hover {
    background: #45a049;
}

.start-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #000;
}

.game-over-content h1 {
    font-size: 20px;
    color: #FF6B6B;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0px #000;
}

.game-over-content p {
    font-size: 10px;
    line-height: 1.6;
    margin-bottom: 10px;
}

#finalScore {
    color: #FFD700;
    font-size: 14px;
}

#gameUI {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.score {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 12px;
    color: #000;
    text-shadow: 1px 1px 0px #fff;
    pointer-events: none;
}

.mobile-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    pointer-events: auto;
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 1000;
}

.jump-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    padding: 15px 20px;
    background: #4CAF50;
    color: white;
    border: 3px solid #000;
    border-radius: 0;
    cursor: pointer;
    box-shadow: 3px 3px 0px #000;
    transition: all 0.1s;
    min-width: 80px;
    min-height: 50px;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.jump-btn:hover {
    background: #45a049;
}

.jump-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px #000;
}

.move-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    padding: 12px 16px;
    background: #FF6B6B;
    color: white;
    border: 3px solid #000;
    border-radius: 0;
    cursor: pointer;
    box-shadow: 3px 3px 0px #000;
    transition: all 0.1s;
    min-width: 50px;
    min-height: 50px;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.move-btn:hover {
    background: #FF5252;
}

.move-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px #000;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Responsive Design for embedding */
@media (max-width: 768px) {
    body {
        padding: 0;
        height: 100vh;
        min-height: 400px;
    }
    
    #gameContainer {
        height: 100%;
        min-height: 400px;
        min-width: 100%;
    }
    
    .title h1 {
        font-size: 14px;
    }
    
    .subtitle {
        font-size: 8px;
    }
    
    .instructions {
        font-size: 6px;
    }
    
    .game-over-content h1 {
        font-size: 16px;
    }
    
    .game-over-content p {
        font-size: 8px;
    }
    
    .score {
        font-size: 10px;
        top: 10px;
        left: 10px;
    }
    
    .jump-btn {
        font-size: 8px;
        padding: 12px 16px;
        min-width: 60px;
        min-height: 40px;
    }
    
    .move-btn {
        font-size: 12px;
        padding: 10px 12px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .mobile-controls {
        bottom: 10px;
        right: 10px;
        gap: 8px;
    }
    
    .start-btn {
        font-size: 10px;
        padding: 15px 20px;
        min-width: 150px;
        min-height: 50px;
    }
    
    .mobile-controls {
        bottom: 10px;
        right: 10px;
    }
}

/* For iframe embedding - makes game fully responsive */
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    min-height: 500px;
}

/* Ensure game scales with container but maintains minimum size */
#gameContainer {
    width: 100%;
    height: 100%;
    min-width: 800px;
    min-height: 500px;
    max-width: none;
    max-height: none;
}

/* Override responsive rules for iframe */
@media (max-width: 768px) {
    #gameContainer {
        min-width: 100%;
        min-height: 400px;
    }
}

@media (max-width: 480px) {
    .title h1 {
        font-size: 12px;
    }
    
    .subtitle {
        font-size: 6px;
    }
    
    .instructions {
        font-size: 5px;
    }
    
    .game-over-content h1 {
        font-size: 14px;
    }
    
    .game-over-content p {
        font-size: 6px;
    }
}
