/* --- GERAL E FONTES --- */
body {
    font-family: 'Boogaloo', sans-serif;
    background-color: #e0f2f7;
    /* Azul claro / Gelo */
    color: #3f51b5;
    /* Azul para textos que contrastem */

    /* !! IMPORTANTE !! 
    Troque o arquivo 'background.png' por uma imagem de Natal CLARA e suave!
    Sugestões: neve suave, luzes de natal embaçadas, textura de floco de neve.
    */
    background-image: url('../imagens/background.png');

    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    margin: 0;
    padding-top: 82px;
}

/* --- BARRA DE NAVEGAÇÃO (HEADER) --- */
.site-header {
    background: rgba(255, 255, 255, 0.85);
    /* Branco Transparente */
    backdrop-filter: blur(10px);
    padding: 10px 30px;
    border-bottom: 5px solid #ADD8E6;
    /* Azul Claro de Natal */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    /* Sombra mais suave */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-sizing: border-box;
}

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

.logo img {
    height: 60px;
}

#user-area {
    display: flex;
    align-items: center;
}

#user-info-logged-in {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-details {
    display: flex;
    align-items: center;
    gap: 10px;
    border-right: 2px solid #ADD8E6;
    padding-right: 15px;
}

/* Azul Claro */
.role-icon {
    font-size: 1.3em;
    margin-right: 5px;
    line-height: 1;
}

#welcome-message {
    font-size: 1.2em;
    font-weight: bold;
    color: #4CAF50;
}

/* Verde Esmeralda Suave */
.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #81C784;
    object-fit: cover;
}

/* Verde Menta */
.rank-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.medal {
    width: 35px;
    height: 35px;
}

#rank-name {
    font-size: 1.1em;
    color: #607D8B;
}

/* Cinza Azulado */
.xp-bar-container {
    width: 120px;
}

.xp-bar {
    height: 12px;
    background-color: #CFD8DC;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #ADD8E6;
}

/* Azul Claro */
.xp-bar-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #81C784, #4CAF50);
    transition: width 0.5s ease;
}

/* Verde Menta para Esmeralda */
#xp-text {
    font-size: 0.7em;
    text-align: center;
    margin-top: 2px;
    color: #78909C;
}

/* Cinza Azulado Escuro */
.header-button {
    padding: 10px 20px;
    font-family: 'Boogaloo', sans-serif;
    font-size: 1.1em;
    border: 3px solid #EF9A9A;
    /* Vermelho Suave */
    border-radius: 8px;
    cursor: pointer;
    background-color: #FFCDD2;
    /* Vermelho Suave mais claro */
    color: #B71C1C;
    /* Vermelho Escuro para contraste */
    transition: background-color 0.2s, color 0.2s;
}

.header-button.logout {
    background-color: #EF9A9A;
    color: #B71C1C;
    border-color: #EF9A9A;
}

/* Vermelho Suave para Sair */
.header-button:hover {
    background-color: #FFEBEE;
    color: #B71C1C;
    opacity: 0.9;
}

/* Fundo mais claro, texto escuro no hover */
.profile-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s;
}

/* Verde Esmeralda */
.profile-button:hover {
    transform: scale(1.1) rotate(45deg);
    color: white;
}

.hamburger-button {
    display: none;
    font-size: 2.5em;
    background: none;
    border: none;
    color: #4CAF50;
    cursor: pointer;
    z-index: 1010;
}

/* Verde Esmeralda */

/* ================================================= */
/* ESTA É A REGRA CORRETA PARA O COMPUTADOR */
.navbar-menu {
    display: flex;
    align-items: center;
}

/* ================================================= */

/* Esta regra SÓ se aplica a telas pequenas (celulares) */
@media (max-width: 992px) {
    .hamburger-button {
        display: block;
    }

    .navbar-menu {
        display: none;
        /* Começa escondido */
        position: absolute;
        top: 82px;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        /* Branco bem transparente */
        width: 280px;
        box-shadow: -5px 5px 15px rgba(0, 0, 0, 0.08);
        border-left: 3px solid #ADD8E6;
        /* Azul Claro */
        border-bottom: 3px solid #ADD8E6;
        /* Azul Claro */
        border-bottom-left-radius: 15px;
    }

    .navbar-menu.is-active {
        display: block;
    }

    /* O JS usa isso para mostrar */
    #user-area {
        padding: 20px;
    }

    #user-info-logged-in {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .user-details {
        border-right: none;
        padding-right: 0;
        justify-content: center;
    }
}

/* --- CONTEÚDO PRINCIPAL --- */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

section {
    margin-bottom: 60px;
}

section h2 {
    text-align: center;
    font-size: 3em;
    color: #f0f0f0;
    /* Branco para o texto */
    text-shadow: 0 0 5px #B2DFDB,
        /* Aqua claro */
        0 0 10px #B2DFDB,
        0 0 15px #80CBC4;
    /* Verde Água */
    margin-bottom: 30px;
}

/* --- CARDS DE JOGO E HALL DA FAMA --- */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.game-card,
.leaderboard-column {
    background: rgba(255, 205, 210, 0.7);
    /* Vermelho Suave (Rosé) com transparência */
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    /* Sombra mais suave */
    border: 4px solid #EF9A9A;
    /* Vermelho Suave */
    padding: 15px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(5px);
}

.game-card-image-wrapper {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}

.game-card-image-wrapper img {
    width: 100%;
    display: block;
    transition: transform 0.4s ease;
}

.game-card:hover .game-card-image-wrapper img {
    transform: scale(1.1);
}

.game-card h3 {
    margin: 15px 0 5px 0;
    font-size: 2em;
    color: #B71C1C;
    /* Vermelho Escuro para contraste */
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    background-color: #EF9A9A;
    /* Vermelho Suave */
    color: #B71C1C;
    /* Vermelho Escuro para contraste */
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.game-card-image-wrapper:hover .play-button {
    opacity: 1;
    visibility: visible;
}

.game-card-image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    /* Overlay branco suave */
    opacity: 0;
    transition: opacity 0.4s ease;
}

.game-card-image-wrapper:hover::after {
    opacity: 1;
}

/* PLACAR DE LÍDERES (HALL DA FAMA) */
.leaderboard-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.leaderboard-column h3 {
    text-align: center;
    font-size: 1.6em;
    color: #B71C1C;
    margin-top: 0;
    margin-bottom: 20px;
}

/* Vermelho Escuro para contraste */
.leaderboard-selector-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background-color: rgba(255, 205, 210, 0.6);
    border-radius: 10px;
    padding: 5px;
}

/* Vermelho Suave com transparência */
.carousel-arrow {
    background-color: #EF9A9A;
    /* Vermelho Suave */
    color: #B71C1C;
    /* Vermelho Escuro para contraste */
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1.5em;
    line-height: 35px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.carousel-arrow:hover {
    background-color: #FFEBEE;
    color: #B71C1C;
}

/* Hover mais claro */
.carousel-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #B71C1C;
    padding: 0 10px;
    transition: opacity 0.3s ease-in-out;
}

/* Vermelho Escuro para contraste */
.carousel-title.fading {
    opacity: 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 8px 5px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Linhas mais suaves */
.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-rank {
    font-size: 1.1em;
    font-weight: bold;
    color: #B71C1C;
    width: 35px;
    text-align: center;
}

/* Vermelho Escuro para contraste */
.leaderboard-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #EF9A9A;
    margin: 0 10px;
}

/* Vermelho Suave */
.leaderboard-player-info {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.leaderboard-player-info .role-icon {
    margin-right: 4px;
    font-size: 1.1em;
}

.leaderboard-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #607D8B;
    transition: color 0.2s ease;
}

/* Cinza Azulado para o nome */
.leaderboard-name-link {
    text-decoration: none;
    color: inherit;
}

.leaderboard-name-link:hover .leaderboard-name {
    text-decoration: underline;
    color: #B71C1C;
}

/* Vermelho Escuro no hover */
.leaderboard-rank-medal {
    width: 24px;
    height: 24px;
    margin-left: 8px;
}

.leaderboard-score {
    font-size: 1.1em;
    font-weight: bold;
    color: #B71C1C;
    min-width: 70px;
    text-align: right;
}

/* Vermelho Escuro para o score */
@media (max-width: 800px) {
    .leaderboard-container {
        flex-direction: column;
    }
}

/* --- RODAPÉ E ACESSIBILIDADE --- */
.site-footer {
    background-color: rgba(255, 255, 255, 0.9);
    /* Branco Transparente */
    color: #3f51b5;
    /* Azul para contraste */
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-top: 5px solid #EF9A9A;
    /* Vermelho Suave */
    position: relative;
    z-index: 1;
}

#accessibility-controls {
    display: flex;
    gap: 10px;
}

.ac-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    border: 2px solid #EF9A9A;
    border-radius: 50%;
    background-color: transparent;
    color: #B71C1C;
    cursor: pointer;
}

/* Vermelho Suave */

/* --- UTILITÁRIOS E MODAL --- */
.hidden {
    display: none !important;
}

.modal-content {
    font-family: 'Boogaloo', sans-serif;
    background-color: #FFCDD2;
    /* Vermelho Suave mais claro */
    color: #B71C1C;
    /* Vermelho Escuro para contraste */
    border: 2px solid #EF9A9A;
    /* Vermelho Suave */
}

/* --- ANIMAÇÃO (usada pelo ghost.js ou snow.js) --- */
#ghosts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ghost-pivot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 1px;
    animation: linear infinite;
    will-change: transform;
}

.ghost {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.9;
    will-change: transform;
}

.ghost img {
    display: block;
    width: 100%;
}
/* --- Controle de Música (Rodapé) --- */
#music-control {
    display: flex;
}

#music-toggle-btn {
    border-color: #EF9A9A; /* Vermelho Suave */
    color: #B71C1C; /* Vermelho Escuro */
    font-size: 1.1em;
    padding-top: 2px; /* Alinha melhor o emoji */
}

#music-toggle-btn:hover {
    background-color: #FFEBEE; /* Fundo vermelho bem claro no hover */
}