/* --- VARIABLES & RESET --- */
:root {
    --bg-dark: #050510;
    --neon-pink: #ff00ff;
    --neon-blue: #00ffff;
    --neon-yellow: #ffff00;
    --neon-green: #00ff00;
    --neon-purple: #bc13fe;
    --font-title: 'Press Start 2P', cursive;
    --font-body: 'VT323', monospace;
}

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

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle, rgba(255,0,255,0.1) 10%, transparent 20%),
        radial-gradient(circle, rgba(0,255,255,0.1) 10%, transparent 20%);
    background-size: 50px 50px;
    background-position: 0 0, 25px 25px;
    color: #fff;
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- EFECTO CRT (SCANLINES) --- */
.crt-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    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% 2px, 3px 100%;
    pointer-events: none;
    z-index: 999;
}

/* --- CONTENEDOR PRINCIPAL --- */
.arcade-cabinet {
    width: 90%;
    max-width: 800px;
    height: 90vh;
    border: 4px solid var(--neon-blue);
    box-shadow: 0 0 20px var(--neon-blue), inset 0 0 20px var(--neon-blue);
    border-radius: 10px;
    position: relative;
    background: rgba(0, 0, 0, 0.8);
    overflow: hidden;
    padding: 20px;
    /* Actualización v4: Flexbox para centrar verticalmente el contenido y evitar cortes */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- PANTALLAS Y TRANSICIONES --- */
.screen {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    transition: opacity 0.5s ease;
    /* Actualización v4: Permitir scroll interno si el contenido supera la altura (Seguridad) */
    overflow-y: auto; 
    scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; } /* Actualización v4: Ocultar barra en Chrome */

.hidden { display: none; opacity: 0; }
.active { display: flex; opacity: 1; }

/* --- ESTILOS HOME --- */
#screen-home .content-box {
    text-align: center;
    margin: auto;
}

.pixel-avatar {
    width: 150px;
    height: 150px;
    border: 4px solid var(--neon-blue);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--neon-blue);
    margin-bottom: 20px;
    object-fit: cover;
    transition: all 0.3s ease; /* Actualización v4: Transición suave al cambiar tamaño */ 
}

h1 {
    font-family: var(--font-title);
    color: var(--neon-yellow);
    font-size: 1.5rem;
    text-shadow: 4px 4px var(--neon-pink);
    margin-bottom: 20px;
    line-height: 1.5;
    transition: font-size 0.3s ease; /* Actualización v4 */
}

.bio-text {
    font-size: 1.5rem;
    color: var(--neon-blue);
    margin-bottom: 30px;
    transition: all 0.3s ease; /* Actualización v4 */
}

.arcade-btn {
    background: transparent;
    border: 2px solid var(--neon-green);
    color: var(--neon-green);
    font-family: var(--font-title);
    padding: 15px 30px;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
    text-transform: uppercase;
}

.arcade-btn:hover {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 15px var(--neon-green);
}

.blink { animation: blinker 1s linear infinite; }
@keyframes blinker { 50% { opacity: 0; } }

/* --- SOCIAL HUB --- */
.social-hub {
    margin: 20px 0; /* Separación entre el botón Start y el Email */
    transition: margin 0.3s ease; /* Actualización v4 */
}

.social-icon svg {
    width: 50px;       /* Tamaño visible */
    height: 50px;
    fill: var(--neon-purple); /* Color Violeta Neón (Proyectos) */
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 5px var(--neon-purple)); /* Brillo suave inicial */
}

.social-icon:hover svg {
    transform: translateY(-5px) scale(1.1); /* Efecto levitar y crecer */
    fill: #fff; /* Se pone blanco al tocarlo */
    filter: drop-shadow(0 0 15px var(--neon-purple)); /* Brillo intenso */
}

/* --- ESTILOS CV INFO --- */
.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 2px dashed var(--neon-blue);
    margin-bottom: 15px;
}

.back-btn {
    background: none;
    border: none;
    color: var(--neon-pink);
    font-family: var(--font-title);
    cursor: pointer;
    font-size: 0.8rem;
}

/* --- NUEVO: ESTILO BOTÓN DE DESCARGA (SAVE DATA) --- */
.save-btn {
    background: transparent;
    border: 2px solid var(--neon-green);
    color: var(--neon-green);
    font-family: var(--font-title);
    font-size: 0.7rem;
    padding: 5px 10px;
    text-decoration: none; /* Quitar subrayado de link */
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.save-btn:hover {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 10px var(--neon-green);
}

.score {
    font-family: var(--font-title);
    color: var(--neon-yellow);
    font-size: 0.8rem;
}

.scroll-container {
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-blue) #000;
}

.panel {
    border: 2px solid #fff;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
}

.red-panel { border-color: var(--neon-pink); box-shadow: 0 0 5px var(--neon-pink); }
.blue-panel { border-color: var(--neon-blue); box-shadow: 0 0 5px var(--neon-blue); }
.green-panel { border-color: var(--neon-green); box-shadow: 0 0 5px var(--neon-green); }
.yellow-panel { border-color: var(--neon-yellow); box-shadow: 0 0 5px var(--neon-yellow); }
/* Nuevo Panel Violeta */
.purple-panel { border-color: var(--neon-purple); box-shadow: 0 0 5px var(--neon-purple); }

.panel h3 {
    font-family: var(--font-title);
    font-size: 1rem;
    margin-bottom: 15px;
    color: #fff;
}

/* Estilos Proyectos */
.project-card {
    border: 1px dashed var(--neon-purple);
    padding: 10px;
    margin-bottom: 15px;
    background: rgba(188, 19, 254, 0.1);
    transition: transform 0.2s;
}

.project-card:hover {
    transform: translateX(5px);
    background: rgba(188, 19, 254, 0.2);
}

.project-title {
    color: var(--neon-purple);
    font-weight: bold;
    font-size: 1.1rem;
}

.project-tech {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 8px;
}

.project-link-btn {
    display: inline-block;
    margin-top: 5px;
    color: var(--neon-yellow);
    text-decoration: none;
    font-size: 0.9rem;
    border: 1px solid var(--neon-yellow);
    padding: 5px 10px;
    cursor: pointer;
}

.project-link-btn:hover {
    background: var(--neon-yellow);
    color: #000;
}

/* Grid para Habilidades */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.skill-tag {
    background: var(--neon-blue);
    color: #000;
    text-align: center;
    padding: 5px;
    font-weight: bold;
    font-size: 1.2rem;
}

.entry { margin-bottom: 15px; border-left: 2px solid rgba(255,255,255,0.3); padding-left: 10px; }
.entry-title { font-weight: bold; font-size: 1.3rem; color: var(--neon-yellow); }
.entry-date { font-size: 1rem; opacity: 0.7; }

/* --- ESTILOS BOTÓN MUTE --- */
.mute-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #000;
    border: 2px solid var(--neon-pink);
    color: var(--neon-pink);
    font-family: var(--font-title);
    padding: 10px;
    cursor: pointer;
    z-index: 1000;
    font-size: 0.8rem;
    box-shadow: 0 0 5px var(--neon-pink);
    transition: all 0.3s ease;
}

.mute-toggle:hover {
    background: var(--neon-pink);
    color: #000;
}

.mute-toggle.muted {
    border-color: #555;
    color: #555;
    box-shadow: none;
}

/* --- RESPONSIVE DESIGN (MEJORADO) --- */

/* Actualización v4: Media Query para evitar cortes verticales en Laptops */
@media (max-height: 800px) {
    .pixel-avatar {
        width: 100px;
        height: 100px;
        margin-bottom: 10px;
    }
    h1 { font-size: 1.2rem; margin-bottom: 10px; }
    .bio-text { font-size: 1.2rem; margin-bottom: 15px; }
    .arcade-btn { padding: 10px 20px; }
    
    /* Achicar espacios del Social Hub para que entre */
    .social-hub { margin: 10px 0; }
    .social-icon svg { width: 40px; height: 40px; }
    
    .footer-contact { margin-top: 5px; font-size: 0.9rem; }
}

/* 1. Tablets y Laptops Pequeñas */
@media (max-width: 1024px) {
    .arcade-cabinet {
        width: 95%;
        height: 95vh;
    }
}

/* 2. Móviles (Modo Handheld) */
@media (max-width: 600px) {
    body {
        /* 'dvh' se ajusta dinámicamente si aparece/desaparece la barra del navegador */
        height: 100dvh; 
        align-items: flex-start; /* Alinea arriba para evitar cortes */
    }

    .arcade-cabinet {
        width: 100%;
        height: 100dvh; /* Pantalla completa real */
        border: none;   /* Quitamos el borde grueso para ganar espacio */
        border-radius: 0;
        padding: 15px;  /* Padding reducido */
        box-shadow: none; /* Quitamos el glow externo */
    }

    /* Ajuste de textos para que no se rompan */
    h1 { font-size: 1rem; margin-bottom: 10px; }
    
    .player-name { font-size: 1.5rem; }
    
    .bio-text { 
        font-size: 1.1rem; 
        margin-bottom: 15px; 
    }

    /* Avatar un poco más pequeño */
    .pixel-avatar {
        width: 110px;
        height: 110px;
        border-width: 3px; /* Borde más fino */
    }

    /* Botón Start más fácil de tocar */
    .arcade-btn {
        width: 100%; /* Botón ancho completo */
        padding: 15px;
        font-size: 1.1rem;
    }

    /* Actualización v4: Icono de Github optimizado para móvil */
    .social-hub { margin: 15px 0; }
    .social-icon svg { width: 45px; height: 45px; }

    /* Ajustes de la Pantalla CV (ACTUALIZADO PARA EL BOTÓN SAVE) */
    .hud-header {
        font-size: 0.8rem;
        padding-bottom: 10px;
        /* Permitir que los botones bajen si no entran */
        flex-wrap: wrap; 
        gap: 10px;
        justify-content: center;
    }
    
    /* Si el Score molesta en pantallas muy angostas, lo ocultamos */
    .score { 
        display: none; 
    }

    .back-btn {
        font-size: 1rem; /* Flecha de volver más grande */
    }

    /* Botón Mute más discreto en móvil */
    .mute-toggle {
        bottom: 10px;
        right: 10px;
        padding: 8px;
        font-size: 0.7rem;
        opacity: 0.8; /* Un poco transparente para no tapar contenido */
    }
}
