/* --- Megadruid Orc Attack - Global Styles --- */
.agencia-game-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: transparent;
    overflow: hidden;
    line-height: normal;
    user-select: none;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    z-index: 1;
    aspect-ratio: 16/9;
    /* Prevent CLS */
}

.agencia-game-canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #87CEEB;
    /* Match sky to identify gaps */
    box-sizing: border-box;
    /* Recorte de seguridad para asegurar que el contenido siga la curva */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
}

canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    background: #87CEEB;
    /* Match sky */
    border-radius: inherit;
    /* Sigue al contenedor */
}

/* --- UI Overlays --- */
.agencia-game-ui {
    font-family: 'Bungee', cursive, monospace;
    color: #fff;
    text-transform: uppercase;
}

.agencia-game-ui .pix-h2 {
    font-size: 32px;
    color: #49C5B6;
    margin-bottom: 20px;
    text-shadow: 3px 3px 0 #000;
}

.pix-instr-row-wrapper {
    color: #fff;
    text-shadow: 2px 2px 0 #000;
}

.pix-key {
    display: inline-block;
    padding: 6px 10px;
    border: 2px solid #fff;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 4px;
    margin: 0 5px;
    font-size: 14px;
    line-height: 1;
}

.pix-btn-start {
    font-family: 'Bungee', cursive, monospace;
    padding: 15px 35px;
    font-size: 18px;
    background: #FF5A00;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    box-shadow: 0 4px 0 #b33f00;
}

.pix-btn-start:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #b33f00;
}

.pix-btn-start:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 #b33f00;
}

/* --- Mobile Controls (Overlay) --- */
.mobile-controls.overlay-controls {
    display: none;
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 1000;
    justify-content: space-between;
    padding: 0 15px;
    background: transparent !important;
}

@media (max-width: 768px) {
    .agencia-game-container {
        height: auto !important;
        aspect-ratio: auto !important;
    }

    .agencia-game-canvas-wrapper {
        aspect-ratio: 16 / 9;
        height: auto !important;
    }

    .mobile-controls.overlay-controls {
        display: none;
        position: relative !important;
        bottom: 0 !important;
        background: transparent !important;
        /* Eliminado el fondo negro 'horrible' */
        padding: 5px 20px 20px 20px !important;
        /* Disposición más 'Slim' */
        margin-top: 0;
        pointer-events: auto !important;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .agencia-game-ui .pix-h2 {
        font-size: 20px !important;
    }

    .ui-intro-text-mobile {
        font-size: 9px !important;
        padding: 0 20px !important;
    }
}

.mod-btn {
    pointer-events: auto;
    transition: transform 0.1s, background 0.1s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.mod-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.5) !important;
}