/* =========================================
   VARIÁVEIS E CONFIGURAÇÃO BASE
   ========================================= */
:root {
    --p4-yellow: #facc15;
    --p4-dark: #0a0f1f;
    --p4-black: #050505;
    --p4-white: #ffffff;
}

/* CORES DINÂMICAS DOS PERSONAGENS */
.yu { --char-color: #facc15; }
.yosuke { --char-color: #f97316; }
.chie { --char-color: #22c55e; }
.yukiko { --char-color: #ef4444; }
.kanji { --char-color: #3b82f6; }
.rise { --char-color: #ec4899; }
.teddie { --char-color: #06b6d4; }
.naoto { --char-color: #8b5cf6; }

/* CORES DOS PERSONAGENS SECUNDÁRIOS */
.dojima { --char-color: #64748b; }   
.nanako { --char-color: #fb7185; }   
.marie { --char-color: #a855f7; }    
.adachi { --char-color: #ef4444; }   
.namatame { --char-color: #fbbf24; }
.mitsuo { --char-color: #4ade80; }   

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

body {
    font-family: 'Kumbh Sans', sans-serif;
    background-color: var(--p4-dark);
    color: var(--p4-white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* EFEITO MIDNIGHT CHANNEL (SOBREPOSIÇÃO DE TV) */
.tv-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.1) 50%),
                linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    background-size: 100% 3px, 3px 100%;
    z-index: 9999;
    pointer-events: none;
}

/* HEADER ESTILIZADO */
header {
    background: var(--p4-yellow);
    padding: 20px 0;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0% 100%);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo { color: black; font-weight: 900; }

.nav ul { display: flex; list-style: none; gap: 20px; }

.nav a {
    text-decoration: none;
    color: black;
    font-weight: 900;
    position: relative;
    padding: 5px 0;
    transition: 0.3s ease;
}

.nav a:hover {
    transform: translateY(-2px);
    letter-spacing: 1px;
}

/* SECTION HERO */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-around;
    min-height: 80vh;
    padding: 0 10%;
}

.hero-texto { flex: 1; text-align: center; padding: 20px; }

.hero-texto h2 {
    font-size: 4rem;
    color: var(--p4-yellow);
    text-transform: uppercase;
    line-height: 0.9;
    animation: fadeUp 0.8s ease-out forwards;
    opacity: 0;
}

.hero-texto p {
    animation: fadeUp 1s ease-out 0.2s forwards;
    opacity: 0;
}

.hero-btns {
    animation: fadeUp 1.2s ease-out 0.4s forwards;
    opacity: 0;
}

.btn-yellow {
    background: var(--p4-yellow);
    color: black;
    padding: 15px 40px;
    text-decoration: none;
    font-weight: 900;
    font-size: 1.2rem;
    border: 4px solid black;
    display: inline-block;
    transition: 0.2s;
    transform: skew(-10deg);
    margin-top: 20px;
    cursor: pointer;
}

.btn-yellow:hover {
    background: white;
    transform: skew(-10deg) scale(1.1);
    box-shadow: 8px 8px 0px var(--p4-black);
}

.hero-img-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 400px;
}

.hero-img-wrapper img {
    width: 380px !important; 
    height: 380px !important;
    object-fit: cover;
    object-position: top; 
    border-radius: 50%;
    border: 6px solid var(--char-color, #facc15);
    box-shadow: 0 0 30px var(--char-color, rgba(250, 204, 21, 0.5));
    transition: all 0.4s ease;
}

/* SECTION SOBRE */
.sobre { padding: 60px 20px; max-width: 900px; margin: 0 auto; }

.sobre-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border: 1px solid var(--p4-yellow);
    text-align: center;
    border-radius: 8px;
    transition: 0.3s ease;
}

.sobre-card:hover {
    transform: scale(1.01);
    box-shadow: 0 0 30px rgba(250, 204, 21, 0.1);
}

/* GRID DE PERSONAGENS */
.titulo-secao {
    text-align: center;
    margin: 40px 0;
    color: var(--p4-yellow);
    font-size: 2.5rem;
}

.grid-personagens {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 30px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.center-flex {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.card, .card-secundario {
    background: #121826;
    border: 3px solid transparent;
    padding: 20px;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    flex: 1 1 250px;
    max-width: 280px;
    position: relative;
    overflow: hidden;
}

.card:hover, .card-secundario:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--char-color);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 20px var(--char-color);
}

.card img, .card-secundario img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.arcana { 
    background: var(--p4-black); 
    color: var(--char-color, var(--p4-yellow)); 
    border: 2px solid var(--char-color, var(--p4-yellow));
    font-weight: 900; 
    display: inline-block; 
    padding: 4px 15px; 
    margin-bottom: 15px;
    text-transform: uppercase; 
    font-size: 0.8rem;
    transition: 0.3s ease-in-out;
}

.card:hover .arcana, .card-secundario:hover .arcana {
    background: var(--char-color);
    color: var(--p4-black);
    box-shadow: 0 0 15px var(--char-color);
}

/* GALERIA E FILTROS */
.filtros-galeria {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.btn-filtro {
    background: transparent;
    border: 2px solid var(--p4-yellow);
    color: var(--p4-yellow);
    padding: 8px 20px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.3s;
    transform: skew(-10deg);
}

.btn-filtro.active, .btn-filtro:hover {
    background: var(--p4-yellow);
    color: black;
    box-shadow: 4px 4px 0px black;
}

.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.galeria-grid img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    filter: brightness(0.8);
    transition: 0.4s ease;
    border: 4px solid transparent;
}

.galeria-grid img:hover {
    filter: brightness(1.1) contrast(1.2);
    transform: scale(1.08); /* Corrigido de 'scarle' */
    border-color: var(--p4-yellow);
}

/* FOOTER */
footer {
    text-align: center;
    padding: 60px 20px;
    border-top: 1px solid #1f2a3a;
    margin-top: 50px;
}

footer a { color: var(--p4-yellow); font-weight: 900; text-decoration: none; }

/* ANIMAÇÕES */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* RESPONSIVIDADE (MOBILE) */
@media (max-width: 768px) {
    .hero {
        flex-direction: column-reverse;
        text-align: center;
        padding: 80px 20px;
    }
    
    .hero-img-wrapper { min-width: auto; }

    .hero-img-wrapper img {
        width: 280px !important; 
        height: 280px !important;
    }

    .hero-texto h2 { font-size: 2.8rem; }

    .galeria-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .filtros-galeria { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .galeria-grid { grid-template-columns: 1fr; }
}