/* =====================================================================
 * PAPAYA FIGHT — style.css (Versión Definitiva con Controles Arcade)
 * ===================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

body {
    background-color: #0b0614;
    color: #fff;
    font-family: 'Press Start 2P', monospace, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 20px;
}

.cabinet {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 660px;
    padding: 10px;
}

.marquee {
    font-size: 20px;
    color: #ff8c1a;
    text-shadow: 2px 2px #7a0000, 4px 4px #000;
    margin: 8px 0;
    text-align: center;
}

.marquee span {
    color: #ffe14d;
}

.screen {
    position: relative;
    width: 100%;
    background: #000;
    border: 4px solid #ffe14d;
    box-shadow: 0 0 20px rgba(255, 140, 26, 0.4);
    line-height: 0;
}

canvas {
    width: 100%;
    height: auto;
    display: block;
}

/* Guías de teclado PC */
.controls {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 12px;
    gap: 6px;
}

.pad {
    background: rgba(20, 10, 35, 0.8);
    border: 2px solid #4a3a66;
    padding: 8px;
    font-size: 7px;
    flex: 1;
    border-radius: 4px;
}

.pad h2 {
    font-size: 8px;
    color: #ffe14d;
    margin-bottom: 4px;
    border-bottom: 1px solid #4a3a66;
    padding-bottom: 2px;
}

.pad ul { list-style: none; }
.pad li { margin-bottom: 3px; color: #ddd; }

kbd {
    background: #332244;
    border: 1px solid #776a90;
    padding: 1px 3px;
    border-radius: 2px;
    font-family: inherit;
    font-size: 6px;
    color: #ffe14d;
}

footer {
    margin-top: 14px;
    font-size: 7px;
    color: #776a90;
    text-align: center;
}

/* =====================================================================
 * OCULTAMIENTO ABSOLUTO EN ESCRITORIO
 * ===================================================================== */
#mobile-gamepad {
    display: none !important;
}

/* =====================================================================
 * ACTIVACIÓN Y DISEÑO ARCADE EN DISPOSITIVOS TÁCTILES / MÓVILES
 * ===================================================================== */
@media (max-width: 900px), (pointer: coarse) {
    .controls {
        display: none !important;
    }

    #mobile-gamepad {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin-top: 12px;
        padding: 10px;
        background: rgba(18, 10, 32, 0.95);
        border: 2px solid #ff8c1a;
        border-radius: 10px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.8);
    }

    .mb-dpad {
        display: grid;
        grid-template-columns: repeat(3, 46px);
        grid-template-rows: repeat(3, 46px);
        gap: 4px;
    }

    .mb-actions {
        display: grid;
        grid-template-columns: repeat(3, 46px);
        grid-template-rows: repeat(2, 46px);
        gap: 4px;
    }

    .mb-btn {
        background: linear-gradient(135deg, #3a2255, #211235);
        border: 2px solid #776a90;
        color: #ffe14d;
        font-family: 'Press Start 2P', monospace;
        font-size: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        box-shadow: 0 3px 0 #11081c;
        touch-action: none;
    }

    .mb-btn:active, .mb-btn.pressed {
        background: linear-gradient(135deg, #ff8c1a, #e53b2b);
        color: #fff;
        border-color: #ffe14d;
        transform: translateY(2px);
        box-shadow: 0 1px 0 #11081c;
    }

    .mb-up { grid-column: 2; grid-row: 1; }
    .mb-left { grid-column: 1; grid-row: 2; }
    .mb-right { grid-column: 3; grid-row: 2; }
    .mb-down { grid-column: 2; grid-row: 3; }

    .mb-z { grid-column: 1; grid-row: 2; font-size: 10px; background: linear-gradient(135deg, #2b446a, #16263f); }
    .mb-x { grid-column: 2; grid-row: 1; font-size: 10px; background: linear-gradient(135deg, #2b446a, #16263f); }
    .mb-esp { grid-column: 3; grid-row: 2; font-size: 8px; background: linear-gradient(135deg, #b8382c, #7a1c14); border-color: #ff8c1a; color: #fff; }
    .mb-start { grid-column: 1 / span 2; grid-row: 1; font-size: 8px; background: linear-gradient(135deg, #444, #222); border-color: #888; color: #fff; }
}