/* --- 🎮 EFECTOS VISUALES --- */

/* --- TÍTULO DEL JUEGO (versión suavizada) --- */
@keyframes gentle-glitch {
    0%, 100% { 
        transform: translate(0); 
        text-shadow: 1px 1px 0 rgba(255,0,0,0.3), -1px -1px 0 rgba(0,255,255,0.3);
    }
    25% { 
        transform: translate(-1px, 1px); 
        text-shadow: -1px -1px 0 rgba(255,0,0,0.3), 1px 1px 0 rgba(0,255,255,0.3);
    }
    50% { 
        transform: translate(1px, -1px); 
        text-shadow: 2px -2px 0 rgba(255,0,0,0.3), -2px 2px 0 rgba(0,255,255,0.3);
    }
    75% { 
        transform: translate(-1px, 1px); 
        text-shadow: -2px 2px 0 rgba(255,0,0,0.3), 2px -2px 0 rgba(0,255,255,0.3);
    }
}

h1 {
    animation: gentle-glitch 3s ease-in-out infinite;
    font-size: 50px;
    margin: 0 0 30px 0; /* Solo margen inferior */
    text-align: left;
    max-width: 80%;
}

/* --- EFECTO CRT MEJORADO --- */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.scanlines {
    background: 
        linear-gradient(
            to bottom,
            transparent 0%,
            transparent 50%,
            rgba(0, 0, 0, 0.15) 50%,
            rgba(0, 0, 0, 0.15) 100%
        ),
        linear-gradient(
            to right,
            rgba(255, 0, 0, 0.03) 0%,
            rgba(0, 255, 0, 0.02) 50%,
            rgba(0, 0, 255, 0.03) 100%
        );
    background-size: 100% 4px, 3px 100%;
    animation: 
        scan-move 0.5s linear infinite,
        color-drift 15s linear infinite;
}

@keyframes scan-move {
    0% { background-position: 0 0; }
    100% { background-position: 0 4px; }
}

@keyframes color-drift {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.static-noise {
    background: url("../assets/static.gif") center/cover;
    opacity: 0.05;
    mix-blend-mode: overlay;
}

/* --- MENSAJE "PRESS START" --- */
#press-start {
    font-size: 20px;
    animation: 
        blink-text 0.8s steps(2, start) infinite,
        float 2s ease-in-out infinite;
    position: relative;
    margin-top: 20px;
}

@keyframes blink-text {
    50% { opacity: 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* --- ESTILOS PARA CRÉDITOS --- */
.credits-content {
    background-color: rgba(0, 0, 0, 0.85);
    border: 4px solid #ff0000;
    width: 750px;
    height: 650px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
    position: relative;
    padding: 15px;
    overflow: hidden;
    margin: 0 auto;
}

.credits-top-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    height: 160px; /* Reducido aún más */
}

.credit-category {
    background: rgba(20, 20, 20, 0.7);
    border: 2px solid #333;
    padding: 8px; /* Reducido */
    transition: all 0.3s ease;
    flex: 1;
    overflow: hidden;
}

.credit-category.double-width {
    flex: 2;
}

.credit-category.full-width {
    height: 300px; /* Aumentado para caber todos los créditos */
    margin-bottom: 5px; /* Reducido */
    padding: 10px; /* Ajustado */
}

.music-credits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px; /* Reducido */
    height: auto;
    padding: 5px;
    grid-auto-rows: minmax(24px, auto); /* Altura mínima para cada fila */
}

.credits-footer {
    text-align: center;
    padding: 8px; /* Reducido */
    margin-top: auto;
    flex-shrink: 0;
}

.credit-category h3 {
    color: #ff0000;
    font-size: 0.9rem; /* Reducido */
    margin-bottom: 6px; /* Reducido */
    text-shadow: 2px 2px 0 #000;
    text-align: center;
    border-bottom: 1px solid #ff0000;
    padding-bottom: 3px; /* Reducido */
}

.credit-name {
    font-size: 0.75rem; /* Reducido */
    color: #fff;
    margin: 1px 0; /* Reducido */
    padding: 3px 5px; /* Reducido */
    background: rgba(16, 6, 6, 0.5);
    border-left: 2px solid #ff0000;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1; /* Reducido */
    min-height: 20px; /* Reducido */
}

/* Efectos hover */
.credit-category:hover {
    transform: translateY(-5px);
    border-color: #ff0000;
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3);
}

.credit-name:hover {
    color: #ff0000;
    transform: translateX(5px);
    background: rgba(40, 10, 10, 0.7);
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

#back-from-credits {
    margin-top: 8px; /* Reducido */
    align-self: center;
    padding: 6px 16px; /* Reducido */
    font-size: 0.8rem; /* Reducido */
}