/* ========================================
   SUPER MARIO PLATFORMER - CSS STYLES
   ======================================== */

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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    overflow: hidden;
    user-select: none;
}

/* Screen Management */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    z-index: 1000;
}

.screen.active {
    display: flex;
}

.screen-content {
    text-align: center;
    padding: 3rem;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 20px;
    border: 3px solid #FFD700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    max-width: 600px;
    width: 90%;
}

/* Typography */
h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
    color: #FFD700;
    font-weight: bold;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    color: #FFD700;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #FFA500;
}

p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #E0E0E0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 15px 30px;
    margin: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(45deg, #FF6B6B, #FF8E53);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #FF8E53, #FF6B6B);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, #4ECDC4, #44A08D);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(45deg, #44A08D, #4ECDC4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

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

/* Instructions */
.instructions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    text-align: left;
    margin: 2rem 0;
}

.control-group ul {
    list-style: none;
    padding: 0;
}

.control-group li {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    border-left: 3px solid #FFD700;
}

/* Game Container */
#gameContainer {
    position: relative;
    margin: 20px auto;
    text-align: center;
    max-width: 100vw;
}

#gameContainer.hidden {
    display: none;
}

/* HUD */
#hud {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6));
    padding: 10px 20px;
    border-radius: 10px 10px 0 0;
    border: 2px solid #333;
    border-bottom: none;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    width: 800px;
    margin: 0 auto;
}

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

.hud-label {
    color: #FFD700;
}

#score, #lives, #coinsCollected, #totalCoins {
    color: #4ECDC4;
    background: rgba(78, 205, 196, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 30px;
    text-align: center;
}

/* Canvas */
#gameCanvas {
    display: block;
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 100%);
    border: 2px solid #333;
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    margin: 0 auto;
}

/* Mobile Controls */
.mobile-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 100;
}

.control-pad {
    display: flex;
    gap: 10px;
}

.control-btn {
    width: 60px;
    height: 60px;
    border: 3px solid #FFD700;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5));
    color: #FFD700;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.jump-btn {
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
}

.control-btn:active,
.control-btn.pressed {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: black;
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
}

/* Responsive Design */
@media (max-width: 850px) {
    #gameContainer {
        margin: 10px;
    }
    
    #hud {
        width: 100%;
        max-width: 800px;
        font-size: 1rem;
        padding: 8px 15px;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 800px;
        height: auto;
        aspect-ratio: 4/3;
    }
    
    .mobile-controls {
        display: flex;
    }
}

@media (min-width: 851px) {
    .mobile-controls {
        display: none;
    }
}

@media (max-width: 650px) {
    .instructions {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .screen-content {
        padding: 2rem;
        margin: 1rem;
    }
    
    .control-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .jump-btn {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* Animations */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.btn:hover {
    animation: bounce 1s;
}

/* Loading Animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

.screen-content {
    animation: pulse 2s infinite;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}
