:root {
    --bg-color: #050510;
    --panel-bg: rgba(10, 20, 50, 0.85);
    --border-color: #e2e8f0;
    --highlight: #38bdf8;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Press Start 2P', monospace;
    line-height: 1.6;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    font-size: 12px;
}

/* Efecto de pantalla antigua de tubo (CRT) */
.crt-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 3px 100%;
    pointer-events: none; z-index: 100;
}

/* Contenedor principal del menú RPG */
.game-menu {
    width: 90%; max-width: 1000px; height: 85vh;
    display: grid; grid-template-columns: 250px 1fr; gap: 20px;
    position: relative; z-index: 10;
}

/* Paneles estilo caja de diálogo de videojuego */
.panel {
    background: var(--panel-bg);
    border: 4px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 5px 5px 0px rgba(0,0,0,0.5), inset 0 0 10px rgba(56, 189, 248, 0.2);
}

/* Sidebar - Menú de navegación */
.sidebar { display: flex; flex-direction: column; gap: 15px; }
.player-info { text-align: center; margin-bottom: 20px; border-bottom: 2px dashed var(--text-muted); padding-bottom: 20px;}
.player-info h1 { font-size: 14px; color: var(--highlight); margin-bottom: 10px; line-height: 1.4;}
.level { color: #fbbf24; }

.menu-btn {
    background: transparent; color: var(--text-main); border: none;
    font-family: inherit; font-size: 12px; text-align: left;
    padding: 10px; cursor: pointer; transition: 0.2s; position: relative;
}
.menu-btn:hover, .menu-btn.active { color: var(--highlight); padding-left: 20px; }
.menu-btn.active::before {
    content: "►"; position: absolute; left: 0; color: var(--highlight);
}

/* Contenido de las pantallas */
.screen { display: none; height: 100%; overflow-y: auto; padding-right: 10px; }
.screen.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }

/* Estilos de contenido interno */
h2 { font-size: 16px; color: var(--highlight); margin-bottom: 20px; text-transform: uppercase; border-bottom: 2px solid var(--highlight); padding-bottom: 5px;}
h3 { font-size: 12px; color: #fbbf24; margin-bottom: 5px; margin-top: 20px; }
p { margin-bottom: 15px; color: #cbd5e1; }
ul { list-style-type: square; margin-left: 20px; margin-bottom: 15px; color: #cbd5e1; }
li { margin-bottom: 8px; }

/* Barras de estadísticas (Skills) */
.stat-bar { display: flex; align-items: center; margin-bottom: 10px; }
.stat-name { width: 150px; }
.bar-bg { flex-grow: 1; height: 12px; background: #333; border: 2px solid #fff; }
.bar-fill { height: 100%; background: var(--highlight); }

/* Botones de Inventario (Enlaces) */
.item-link {
    display: inline-block; padding: 10px 15px; margin-top: 10px;
    background: transparent; border: 2px solid var(--highlight); color: var(--highlight);
    text-decoration: none; text-transform: uppercase; transition: 0.2s;
}
.item-link:hover { background: var(--highlight); color: var(--bg-color); }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: var(--border-color); }

@media (max-width: 768px) {
    .game-menu {
        /* Cambia de 2 columnas a 1 sola columna */
        grid-template-columns: 1fr; 
        /* Permite que la caja crezca hacia abajo si hay mucho contenido */
        height: auto; 
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .sidebar {
        /* Pone los botones en horizontal o envueltos en móvil */
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .player-info {
        width: 100%; /* La info del jugador ocupa toda la fila arriba */
        margin-bottom: 10px;
    }

    .menu-btn {
        text-align: center;
        padding: 5px 10px;
    }
    
    .menu-btn.active::before {
        content: ""; /* Quitamos la flechita en móvil para no descolocar el texto */
    }
}