/* ==========================================================================
   1. VARIABLES, FUENTES Y ESTILOS BASE (Originales de base.css y style.css)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Alan+Sans:wght@300..900&family=Alice&family=Almendra+SC&display=swap');

:root {
    --brand: #5d5dff;
    --accent: #e9c46a;
    --dark: #1a202c;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body {
    font-family: "Alice", serif;
    font-weight: 400;
    font-style: normal;
    background-color: var(--brand);
}

a {
    text-decoration: none;
}

video {
    border-radius: 12px;
}


/* ==========================================================================
   2. DISTRIBUCIÓN GENERAL Y LAYOUT (Originales de layout.css y style.css)
   ========================================================================== */
.split-section {
    display: flex;
    width: 100vw;
    min-height: 100vh;
}

.firstsplit {
    width: 5vw;
    background: white;
    text-align: right;
    padding: 10px;
    min-height: 100vh;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

.secondsplit {
    padding-left: 10vw;
}

.header-menu {
    display: none;
}

.h-1, .h-2 {
    display: flex;
    justify-content: center;
    align-items: center;
}

.h-3 {
    padding-top: 20px;
}

.img-lo {
    width: 50px;
    height: 50px;
    padding: 10px;
}

.bar-log {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 20px;
    text-align: right;
}


/* ==========================================================================
   3. VISTA DE INICIO / HOME (Originales de index.css y style.css)
   ========================================================================== */
.bg-img {
    background-image: url("../Img/invationVr/6.webp");
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

.card-yellow {
    background-color: var(--accent);
    padding: 40px;
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    width: 90%;
    max-width: 800px;
    min-height: 70vh;
    max-height: 90vh;
    margin: 0 auto;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-logo {
    width: 80%;
}

.buttons-row {
    display: flex;
    flex-direction: row;
    gap: 20px;
    width: 100%;
}

.btn-custom {
    flex: 1;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    padding: 15px;
    border-radius: 12px;
    color: white;
    background-color: var(--brand);
}

.discord-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Courier New', monospace;
}

.btn-discord {
    color: white;
    padding: 10px 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
}

.discord-icon {
    width: 200px;
}


/* ==========================================================================
   4. SECCIÓN GALERÍA DE JUEGOS (Originales de game.css)
   ========================================================================== */
.div-game {
    position: relative;
    padding: 20px;
    width: 100%; 
    max-width: 80vw;
    border-radius: 16px;
    margin-bottom: 25px; 
    transform: translateY(-4px); 
    border-color: #5d5dff; 
    overflow: hidden;
}

.div-game:hover {
    box-shadow: 0 10px 25px rgba(93, 93, 255, 0.3); 
    border: 1px solid rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.img-game {
    display: block;
    width: 80vw;
    max-width: 80vw;
    height: 200px;
    object-fit: cover;
    object-position: center;
    transition: height 0.8s ease-in-out;
    margin: 10px auto;
    border-radius: 15px;
}

.img-game:hover {
    height: 50vh;
}

.game-name {
    color: white;
}


/* ==========================================================================
   5. DETALLE DEL JUEGO Y BENTO GRID (Originales de game-detail.css)
   ========================================================================== */
.title-game {
    display: flex;
    height: 100px;
    width: auto;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--dark);
    align-items: center;
    margin-top: 10px;
}

.h3-game {
    padding: 10px;
    color: var(--accent);
    font-size: xx-large;
}

.bento {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 15%);
    gap: 12px;
    width: 80vw;
    padding-top: 10px;
    padding-bottom: 10px;
}

.item {
    position: relative;
    border-radius: 12px;
    background: var(--brand);
    overflow: hidden;
    cursor: pointer;
}

.item p {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px 15px 15px 15px; 
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    margin: 0;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    font-size: xx-large;
    overflow: hidden;
    box-sizing: border-box;
}

.item h3 {
    position: absolute;
    bottom: 1px;
    left: 0;
    width: 100%;
    padding: 40px 15px 15px 15px; 
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    margin: 0;
    opacity: 1;
    transition: opacity 0.3s ease;
    font-size: xx-large;
    box-sizing: border-box;
}

.item:hover p {
    opacity: 1;
}

.img-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms ease-in-out;      
}

.img-item:hover {
    transform: scale(1.1);
}

.item.b video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.item.a .bg-desc {
    padding: 25px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--dark);
}

.item.a .bg-desc h3 {
    color: var(--accent);
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.v-game {
    border-radius: 12px;
}

.bg-desc {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: var(--dark);     
}

/* --- DISTRIBUCIÓN DE COORDENADAS BENTO --- */
.f { grid-column: 3 / 6; grid-row: 1 / 2; } 
.c { grid-column: 4 / 6; grid-row: 1 / 2; } 
.z { grid-column: 1 / 3; grid-row: 1 / 2; } 
.a { grid-column: 1 / 3; grid-row: 2 / 4; } 
.b { grid-column: 3 / 6; grid-row: 2 / 4; display: flex; align-items: center; justify-content: center; font-weight: bold; } 
.e { grid-column: 1 / 2; grid-row: 3 / 4; }
.i { grid-column: 1 / 3; grid-row: 4 / 6; } 
.j { grid-column: 3 / 5; grid-row: 4 / 6; } 
.g { grid-column: 5 / 6; grid-row: 4 / 6; } 


/* ==========================================================================
   6. SLIDER Y ELEMENTOS ADICIONALES (Móviles / Steam / Team)
   ========================================================================== */
.cellview {
    display: none;
}

.slider {
    margin: 5px;
    width: auto;
    position: relative;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding: 0;
    cursor: grab;
    gap: 10px;
}

.slider img {
    width: 100%;
    flex-shrink: 0;
    height: 350px;
    left: 0;
    position: relative;
    object-fit: cover;
    border-radius: 5px;
    scroll-snap-align: center;
}

.slider::-webkit-scrollbar {
    display: none;
}

.slider:active {
    cursor: grabbing;
}

.img-steam {
    min-width: 96px;
    min-height: 96px;
    background: transparent;
    border: none;
    padding: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-steam img {
    max-width: 100%; 
    height: auto;
}

.div-team {
    display: flex;
    flex-direction: row; 
    align-items: center; 
    gap: 4vw;         
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    padding: 20px;     
}

.img-team {
    width: 30vw;
    height: 500px;
    object-fit: cover;
    transition: transform 500ms ease-in-out;
    border-radius: 8px;
}

.img-team:hover {
    transform: scale(1.1);
}

.title-team {
    padding-left: 5vw;
    padding-top: 8vh;
}


/* ==========================================================================
   7. SECCIÓN RESPONSIUVE & COARSE MEDIA QUERIES (Combinado de responcive.css)
   ========================================================================== */
@media (max-width: 800px) {
    html {
        background-color: var(--brand);
        margin: 0;
        padding: 0;
        min-height: 100vh;
    }

    body {
        display: contents;
    }

    .bg-img {
        background-image: none;
    }

    .split-section {
        width: auto;
        background-color: var(--brand);
    }

    .firstsplit {
        display: none;
    }

    .secondsplit {
        padding-left: 10px;
    }

    .card-yellow {
        width: auto;
        border-radius: 0px;
    }

    .buttons-row {
        flex-direction: column; 
    }

    .btn-custom {
        font-size: 1.5rem;   
    }

    .div-game {
        padding: 0;
    }

    .img-game {
        flex-shrink: 0;
        width: 80vw;
    }

    .div-description {
        display: none;
    }

    .title-game { 
        margin: 5px;
        border-radius: 15px;
    }

    .header-menu {
        width: auto;
        display: flex;    
        background-color: #ffffff; 
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
                    0 2px 4px -1px rgba(0, 0, 0, 0.06);
        padding-top: 0;    
        padding-bottom: 0;
        padding-left: 1rem;  
        padding-right: 1rem;
        position: sticky;
        top: 0;
        z-index: 10; 
        justify-content: space-between;
        align-items: center;
    }

    .div-team {
        flex-direction: column;
        border-radius: 0.75rem;
        padding: 20px;     
    }
    
    .img-team {
        width: 80vw;
    }

    .bento {
        grid-template-columns: 1fr; 
        grid-template-rows: auto;    
        width: 95vw;                
    }

    .item {
        grid-column: unset !important;
        grid-row: unset !important;
        min-height: 150px; 
        width: 90%; 
    }

    /* Anidación de lógica táctil (Pointer Coarse) optimizada */
    @media (pointer: coarse) {
        .btn-steam {
            display: flex;
        }
        .cellview {
            display: contents;
        }
        .slider {
            display: flex;
        }
        .bento {
            display: none;
        }
        .item-sm {
            border-radius: 15px;
            padding: 15px;      
            height: auto;       
            min-height: 100px;
            position: relative; 
            overflow: hidden;  
            background: var(--dark); 
        }
        .item-sm h3 {
            margin: 0 0 10px 0; 
            color: white;
            font-size: 1.2rem;
            position: relative; 
        }
        .item-sm p {
            margin: 0;
            color: white;
            opacity: 0.8;
            font-size: 0.9rem;
            position: relative; 
        }
    }
}


/* ==========================================================================
   NUEVO LAYOUT DE DETALLE COMPATIBLE CON SPLIT-SECTION
   ========================================================================== */

/* Contenedor que abraza el espacio interno de #app */
.game-view-wrapper {
    width: 100%;
    max-width: 85vw; /* Margen de seguridad perfecto para no romper el layout */
    padding-right: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Distribución asimétrica de dos columnas */
.game-main-layout {
    display: flex;
    gap: 30px;
    width: 100%;
    align-items: flex-start;
}

/* --- COLUMNA MULTIMEDIA (IZQUIERDA) --- */
.game-media-column {
    flex: 1.2; /* Ligeramente más ancha para priorizar el video */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-video-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.game-video-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Caja de compra */
.game-purchase-box {
    background-color: var(--dark);
    padding: 25px;
    border-radius: 12px;
    color: white;
}

.game-purchase-box h3 {
    color: var(--accent);
    margin: 0 0 10px 0;
    font-size: 1.6rem;
}

.game-buy-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
}

.btn-main-buy {
    background-color: var(--brand);
    color: white;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: bold;
    transition: filter 0.2s;
}

.btn-main-buy:hover {
    filter: brightness(1.2);
}

.steam-logo-badge {
    height: 45px;
    display: flex;
    align-items: center;
}

.steam-logo-badge img {
    height: 100%;
    width: auto;
}

/* --- COLUMNA DE INFORMACIÓN (DERECHA) --- */
.game-info-column {
    flex: 1; /* Columna de lectura */
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.game-card-text {
    background-color: var(--dark);
    padding: 25px;
    border-radius: 12px;
    color: white;
}

.game-card-text h3 {
    color: var(--accent);
    margin: 0 0 10px 0;
}

.game-card-text p {
    line-height: 1.6;
    margin: 0;
    font-size: 1.1rem;
}

/* Filas dinámicas de características */
.game-mini-features {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mini-feature {
    display: flex;
    gap: 15px;
    align-items: center;
    background-color: rgba(26, 32, 44, 0.4);
    padding: 15px;
    border-radius: 12px;
}

.mini-feature img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.mini-feature p {
    color: #f7fafc;
    margin: 0;
    font-size: 0.95rem;
}

/* Galería inferior */
.game-gallery-section h3 {
    color: var(--accent);
    margin-bottom: 10px;
}

.game-grid-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.game-grid-gallery img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 6px;
}

/* --- RESPONSIVE CORREGIDO --- */
@media (max-width: 800px) {
    .game-view-wrapper {
        max-width: 100%;
        padding-right: 0;
    }
    .game-main-layout {
        flex-direction: column;
    }
    .game-grid-gallery {
        grid-template-columns: 1fr;
    }
}


/* --- ENVOLTORIOS DE LAS IMÁGENES (Aseguran espacio físico) --- */
.mini-feature {
    display: flex;
    gap: 15px;
    align-items: center;
    background-color: rgba(26, 32, 44, 0.4);
    padding: 15px;
    border-radius: 12px;
    overflow: hidden; /* Evita que layouts rotos rompan la imagen */
}

/* Fuerza a que el contenedor de la imagen no se pueda achicar a menos de 120px */
.mini-feature .zoomable-img {
    width: 120px;
    min-width: 120px; /* ¡CRUCIAL! Evita que flexbox la colapse a 0px */
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

/* --- GALERÍA INFERIOR (Ajuste de rejilla seguro) --- */
.game-grid-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
}

.game-grid-gallery .zoomable-img {
    width: 100%;
    height: 140px; /* Le damos una altura fija estable */
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

/* --- REGLA DE ORO PARA EL MODAL (Asegúrate de que no pise el flujo normal) --- */
.lightbox {
    position: fixed;
    z-index: 9999; /* Máxima prioridad para que flote por encima de todo */
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(13, 15, 20, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* Cambiamos opacity por un método invisible por defecto que no estorbe */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    visibility: visible;
    opacity: 1;
}

.lightbox-content {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    border-radius: 8px;
}