* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'VT323', monospace;
}

body {
    background-color: #2b2b2b;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.gba-screen {
    width: 900px; 
    height: 600px; 
    background-color: #f8f8d8;
    border: 6px solid #506860;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    padding: 15px;
    box-shadow: 0 0 25px rgba(0,0,0,0.6);
    overflow: hidden;
}

.pocket-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: #506860;
    padding: 12px 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    gap: 8px;
}

.nav-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.6rem; 
    cursor: pointer;
    text-transform: uppercase;
    transition: color 0.2s;
}

.nav-btn:hover {
    color: #f8e870;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex-grow: 1;
    gap: 15px;
    margin-bottom: 15px;
    height: calc(100% - 135px); 
}

.visual-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 3px solid #a8a8a8;
    background-color: #e8e8e8;
    border-radius: 6px;
    padding: 20px;
}

.bag-container {
    width: 250px;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

#bag-sprite {
    width: 100%;
    height: auto;
}

.item-icon {
    width: 70px;
    height: 70px;
    background-color: #bbb;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.list-panel {
    border: 3px solid #506860;
    background-color: white;
    border-radius: 6px;
    padding: 15px;
    overflow-y: auto;
}

#item-list {
    list-style: none;
}

#item-list li {
    font-size: 2.0rem; 
    padding: 8px 0;
    cursor: pointer;
    border-bottom: 2px dashed #ccc;
}

#item-list li:hover {
    background-color: #e0f0e8;
}

#item-list li::before {
    content: "▶ ";
    color: transparent;
}

#item-list li:hover::before {
    color: #e84850;
}

.dialog-box {
    height: 120px;
    background-color: white;
    border: 6px solid #506860;
    border-radius: 12px;
    padding: 15px;
    font-size: 2.2rem; 
    line-height: 1.3;
    box-shadow: inset 3px 3px 0px #a8a8a8;
    display: flex;
    align-items: center;
}

/* Estilos para los links que pongas en el texto */
.dialog-box a {
    color: #2b7bc4;
    text-decoration: none;
    font-weight: bold;
    padding-left: 10px;
}

.dialog-box a:hover {
    color: #e84850;
}

.pixel-art {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

@keyframes pokePop {
    0% { transform: scale(0.9); }
    40% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.animate-bag {
    animation: pokePop 0.3s ease-out;
}
/* =========================================
   DISEÑO RESPONSIVO (Celulares y Tablets)
   ========================================= */
@media (max-width: 950px) {
    /* Ajustamos el contenedor principal al tamaño de la pantalla */
    .gba-screen {
        width: 95%;
        height: 95vh; /* Ocupa el 95% del alto de la pantalla */
        margin: auto;
    }
}

@media (max-width: 768px) {
    /* En celulares, cambiamos la estructura para que sea vertical */
    
    body {
        padding: 10px;
    }

    .gba-screen {
        width: 100%;
        height: auto; /* Dejamos que el alto fluya */
        max-height: 98vh;
        padding: 10px;
        border-width: 4px; /* Bordes un poco más finos */
    }

    /* Achicamos la botonera superior */
    .pocket-nav {
        padding: 8px 5px;
        gap: 5px;
        margin-bottom: 10px;
    }

    .nav-btn {
        font-size: 1.2rem; /* Fuente más chica para que entren los botones */
    }

    /* Pasamos la grilla a 1 sola columna (arriba/abajo) */
    .main-content {
        grid-template-columns: 1fr;
        height: auto;
        gap: 10px;
        margin-bottom: 10px;
    }

    /* Achicamos la mochila */
    .visual-panel {
        padding: 10px;
        flex-direction: row; /* Mochila e ícono uno al lado del otro para ahorrar espacio */
        justify-content: space-evenly;
    }

    .bag-container {
        width: 120px;
        height: 120px;
        margin-bottom: 0;
    }

    .item-icon {
        width: 60px;
        height: 60px;
    }

    /* Hacemos que la lista tenga scroll propio en mobile */
    .list-panel {
        max-height: 200px; /* Altura máxima para que no empuje el cuadro de diálogo fuera de la pantalla */
        padding: 10px;
    }

    #item-list li {
        font-size: 1.5rem;
        padding: 5px 0;
    }

    /* Ajustamos el cuadro de texto inferior */
    .dialog-box {
        height: auto;
        min-height: 100px;
        font-size: 1.6rem;
        padding: 10px;
        border-width: 4px;
    }
}
