/* ===== ZORRO PLATFORMER - Game CSS ===== */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0a1a;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff;
    touch-action: none;
}

/* ===== Game Container ===== */
#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ===== Canvas ===== */
#game-canvas {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 60px);
    image-rendering: pixelated;
}

/* ===== UI Bar (bottom) ===== */
#ui-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(10, 10, 26, 0.95);
    border-top: 2px solid #2a2a4a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    gap: 8px;
}

.ui-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ui-btn {
    background: #1a1a3a;
    border: 2px solid #3a3a6a;
    border-radius: 8px;
    color: #fff;
    font-size: 18px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.ui-btn:hover {
    background: #2a2a5a;
    border-color: #5a5a9a;
    transform: scale(1.05);
}

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

.ui-btn.active {
    background: #2a5a2a;
    border-color: #4a9a4a;
}

.ui-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* Mobile controls */
#mobile-controls {
    display: none;
    position: absolute;
    bottom: 64px;
    left: 0;
    right: 0;
    padding: 0 12px;
    z-index: 90;
    pointer-events: none;
}

.mobile-group {
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}

.mobile-btn {
    background: rgba(30, 30, 60, 0.7);
    border: 2px solid rgba(90, 90, 150, 0.5);
    border-radius: 50%;
    color: #fff;
    font-size: 36px;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-btn:active {
    background: rgba(60, 60, 120, 0.8);
    transform: scale(0.92);
}

.mobile-btn.jump {
    width: 100px;
    height: 100px;
    font-size: 40px;
    background: rgba(60, 120, 60, 0.7);
    border-color: rgba(100, 200, 100, 0.5);
}

.mobile-btn.jump:active {
    background: rgba(80, 160, 80, 0.9);
}

#mobile-left {
    position: absolute;
    left: 12px;
    bottom: 0;
}

#mobile-right {
    position: absolute;
    left: 114px;
    bottom: 0;
}

#mobile-jump {
    position: absolute;
    right: 12px;
    bottom: 0;
}

/* ===== Pause Overlay ===== */
#pause-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 200;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

#pause-overlay.visible {
    display: flex;
}

.pause-title {
    font-size: 48px;
    font-weight: bold;
    color: #ffcc00;
    text-shadow: 3px 3px 0 #aa6600;
    margin-bottom: 20px;
}

.pause-btn {
    background: #2a2a5a;
    border: 3px solid #5a5a9a;
    border-radius: 12px;
    color: #fff;
    font-size: 22px;
    font-weight: bold;
    padding: 14px 48px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    min-width: 220px;
    text-align: center;
}

.pause-btn:hover {
    background: #3a3a7a;
    border-color: #7a7aba;
    transform: scale(1.05);
}

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

/* ===== HUD ===== */
#hud {
    position: absolute;
    top: 8px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 90;
    pointer-events: none;
}

.hud-panel {
    background: rgba(10, 10, 26, 0.8);
    border: 2px solid #2a2a4a;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hud-lives {
    color: #ff4444;
    font-size: 20px;
}

.hud-score {
    color: #ffcc00;
}

.hud-coins {
    color: #ffdd44;
}

/* ===== Mobile Portrait Mode ===== */
@media (max-width: 768px) {
    #mobile-controls {
        display: block;
    }
    
    /* Hide bottom UI bar on mobile */
    #ui-bar {
        display: none !important;
    }
    
    /* Canvas in portrait mode */
    #game-canvas {
        max-height: 100vh;
        width: 100%;
        height: auto;
    }
    
    /* Adjust mobile controls position (no ui-bar below) */
    #mobile-controls {
        bottom: 12px;
    }
    
    .pause-title {
        font-size: 36px;
    }
    
    .pause-btn {
        font-size: 18px;
        padding: 12px 36px;
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .pause-title {
        font-size: 28px;
    }
    
    .pause-btn {
        font-size: 16px;
        padding: 10px 28px;
    }
}
