/* --- Reset Básico e Configuração Global --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    /* font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; */
    font-family: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
    background-color: var(--color-background-canvas);
    font-weight: lighter;
}

/* --- Cabeçalho Fixo e Sobreposto --- */
.cabecalho-sobreposto {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0 auto;
    /* padding: 15px 20px; */
    text-align: center;
    z-index: 10;
    background-color: var(--color-transparent-background);
    backdrop-filter: blur(var(--blur-1));
    -webkit-backdrop-filter: blur(var(--blur-1));
    color: var(--color-text);
    /* border-bottom: 1px solid rgba(255, 255, 255, 0.2); */
}

/* --- Menu Fixo e Sobreposto --- */
.menu-sobreposto {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 20px);
    max-width: 500px;
    z-index: 10;
    border-radius: 999px;
    /* background-color: rgba(255, 255, 255, 0.1); */
    background-color: #86868630;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 0px 5px rgba(0, 0, 0, 0.1);
    /* animation: subtle-breathing 5s infinite ease-in-out; */
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    --mouse-x: 50%;
    --mouse-y: 50%;
}

/* O BRILHO LÍQUIDO */
.menu-sobreposto::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: radial-gradient(circle at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 0.4) 0%,
            rgba(255, 255, 255, 0) 40%);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;

    /* --- CORREÇÃO 1: GARANTIR QUE O BRILHO FIQUE ATRÁS --- */
    z-index: -1;
}

/* ANIMAÇÃO "RESPIRAÇÃO" */
@keyframes subtle-breathing {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
    }

    50% {
        transform: translateX(-50%) scale(1.02);
    }
}

/* --- ESTILOS DA NAVEGAÇÃO E LINKS (AJUSTADOS) --- */

.menu-sobreposto nav {
    display: flex;
    justify-content: space-around;
    position: relative;
    /* Essencial para posicionar o indicador */
    z-index: 1;
    padding: 0 5px;
    /* Cria uma pequena margem interna */
}

/* O NOVO INDICADOR VIAJANTE */
.active-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: calc(100% - 10px);
    width: 0%;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 999px;
    z-index: -1;
    /* AQUI ESTÁ A MÁGICA DA ANIMAÇÃO! */
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    /* Easing suave e elástico */
}


.menu-sobreposto nav a {
    /* Renomeei para .nav-link se você usou a classe */
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    color: #818085;
    text-decoration: none;
    position: relative;
    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
}

/* Efeito hover continua o mesmo */
.menu-sobreposto nav a:hover {
    /* transform: scale(1.1); */
}

/* O item ativo agora só muda a cor do texto, o fundo é o indicador */
.menu-sobreposto nav a.active {
    color: #fff;
    /* font-weight: 600; */
}

.menu-sobreposto .material-icons,
.menu-sobreposto .fa-solid {
    font-size: 24px;
}

.menu-sobreposto .menu-texto {
    font-size: 12px;
    margin-top: 4px;
}

/* --- Conteúdo Principal (Ajustado) --- */
.conteudo-principal {
    padding-top: 60px;
    padding-bottom: 90px;
    /* Aumentei um pouco para dar mais espaço para o menu com texto */
    padding-left: 20px;
    padding-right: 20px;
    background-color: var(--color-background-canvas);
    color: var(--color-text);

    /* 1. Garante que ele continue se adaptando em telas menores */
    width: 100%;

    /* 2. Define o limite máximo da largura do conteúdo.
       Valores comuns variam de 960px a 1280px. 1120px é um ótimo valor moderno. */
    max-width: 800px;

    /* 3. A "mágica" para centralizar o bloco na horizontal */
    margin-left: auto;
    margin-right: auto;

    /* Não se esqueça do padding lateral para telas menores! */
    padding-left: 20px;
    padding-right: 20px;

}

/* --- Apenas para o exemplo visual ficar melhor --- */
.bloco-imagem-fundo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 40vh;
    background-image: url('https://source.unsplash.com/random/800x600?nature');
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.conteudo-principal h2 {
    margin-bottom: 20px;
}

.conteudo-principal p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.bloco-exemplo {
    height: 300px;
    background-color: var(--color-background-surface);
    color: white;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}


.header-menu>div {
    cursor: pointer;
}

.header-menu>:not(.active) {
    cursor: pointer;
    color: var(--color-text);
    opacity: 0.5;
}

.header-menu>.active {
    color: var(--color-text);
    opacity: 1;
    font-weight: 400;
    /* text-shadow: 0px 0px 2px var(--color-text), 0px 0px 2px var(--color-text); */
}

.icon-div {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
}

/* style.css ou utilities.css */

/* =========================== MODAL =========================== */

/* Adicionado para travar o scroll quando o modal estiver aberto */
body.modal-open {
    overflow-y: hidden;
    height: 100vh;
}

/* O Fundo Escuro que Cobre TUDO */
.modal-overlay {
    /* 1. Começa escondido */
    display: flex;

    /* 2. Posição fixa para cobrir a tela inteira, não importa o scroll */
    position: fixed;
    inset: 0;
    /* cobre 100% da tela */
    width: 100vw;
    height: 100vh;
    /* fallback */
    height: 100dvh;
    /* suporte a navegadores modernos */
    height: -webkit-fill-available;
    /* suporte iOS Safari */

    /* 3. Fundo semi-transparente */
    /* background-color: var(--color-transparent-background); */
    background-color: var(--color-transparent-background-overlay);
    backdrop-filter: blur(var(--blur-1));
    -webkit-backdrop-filter: blur(var(--blur-1));
    color: var(--color-text);

    /* 4. O SEGREDO MÁGICO: Z-INDEX! */
    /* Seu header/footer tem z-index: 10. Um número maior como 1000 garante que o modal fique por cima de TUDO. */
    z-index: 1000;

    /* 5. Usa flexbox para centralizar o conteúdo do modal na tela */
    /* display: flex; */
    align-items: center;
    justify-content: center;

    /* Começa invisível para uma transição suave */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    /* invisível inicialmente */
    pointer-events: none;
    /* não clicável enquanto invisível */

}

#battle-window {
    background-color: var(--color-background-canvas);

}

/* Classe que será adicionada via JavaScript para mostrar o modal */
.modal-overlay.active {
    display: flex;
    opacity: 1;
    pointer-events: all;
}

/* A "Janela" Branca do Modal */
.modal-content {
    /* background-color: var(--color-background-surface); */
    padding: 20px;
    /* 24px */
    border-radius: var(--border-radius);
    /* 1rem */
    /* box-shadow: var(--shadow-lg); */
    max-width: 600px;
    width: calc(100%);
    /* Ocupa 100% da largura menos 20px de cada lado */
    max-height: 100%;
    height: 100%;
    overflow-y: auto;
    /* Adiciona scroll se o conteúdo for muito grande */
    position: relative;
    /* Necessário para posicionar o botão de fechar */

    /* Animação de entrada */
    transform: scale(0.95);
    transition: transform 0.3s ease-in-out;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* O Botão de Fechar (X) */
.modal-close-button {
    /* position: absolute; */
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text);
    opacity: 0.5;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.modal-close-button:hover {
    opacity: 1;
}

/* SCROLLBAR  */

html {
    overflow: scroll;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 0;
    height: 0;
    /* Remove scrollbar space */
    background: transparent;
    /* Optional: just make scrollbar invisible */
}

/* Optional: show position indicator in red */
::-webkit-scrollbar-thumb {
    background: #FF0000;
}

.overflow-auto {
    overflow: auto;
}

/* DIGIMON WINDOW  */

.dw-btn-stage>div {
    cursor: pointer;
}

.dw-btn-stage>.active {
    font-weight: 500;
}

/* CONFIRM WINDOW - BATTLE START  */
.confirm-modal {
    /* 1. Começa escondido */
    display: flex;
    flex-direction: column;
    /* 2. Posição fixa para cobrir a tela inteira, não importa o scroll */
    position: fixed;
    inset: 0;
    /* 1º: Fallback mais básico para navegadores muito antigos */
    height: 100vh;
    /* 2º: Hack antigo para Safari iOS (opcional, mas mal não faz se vier antes) */
    height: -webkit-fill-available;
    /* 3º: O Padrão Moderno (Vence todos os anteriores se o navegador suportar) */
    height: 100dvh;
    /* suporte a navegadores modernos */

    /* 3. Fundo semi-transparente */
    background-color: var(--color-transparent-background);
    backdrop-filter: blur(var(--blur-1));
    -webkit-backdrop-filter: blur(var(--blur-1));
    color: var(--color-text);

    /* 4. O SEGREDO MÁGICO: Z-INDEX! */
    /* Seu header/footer tem z-index: 10. Um número maior como 1000 garante que o modal fique por cima de TUDO. */
    z-index: 1000;

    /* 5. Usa flexbox para centralizar o conteúdo do modal na tela */
    /* display: flex; */
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;

    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

.confirm-modal.active {
    opacity: 1;
    pointer-events: all;
}

.confirm-modal>#question-div {
    background-color: var(--color-background-surface);
    padding: 20px;
    border-radius: var(--border-radius);
    border-bottom-right-radius: 0px;
    border-bottom-left-radius: 0px;
    border-bottom: 1px solid var(--color-background-surface-1);
    max-width: 600px;
    width: calc(100%);
    max-height: 100%;
    overflow-y: auto;
    position: relative;
    /* transform: scale(0.95); */
    /* transition: transform 0.3s ease-in-out; */
}

.confirm-modal>#yes-div {
    background-color: var(--color-background-surface);
    padding: 20px;
    border-radius: var(--border-radius);
    border-top-right-radius: 0px;
    border-top-left-radius: 0px;
    max-width: 600px;
    width: calc(100%);
    max-height: 100%;
    overflow-y: auto;
    position: relative;
    cursor: pointer;
    color: var(--color-link);
    font-weight: 400;
    /* transform: scale(0.95);
            transition: transform 0.3s ease-in-out; */
}

.confirm-modal>#no-div {
    margin-top: 20px;
    background-color: var(--color-background-surface);
    padding: 20px;
    border-radius: var(--border-radius);
    max-width: 600px;
    width: calc(100%);
    max-height: 100%;
    overflow-y: auto;
    position: relative;
    cursor: pointer;
    color: var(--color-red);
    font-weight: 400;
}

/* ALERT MODAL */

.alert-modal {
    /* 1. Começa escondido */
    display: flex;
    flex-direction: column;
    /* 2. Posição fixa para cobrir a tela inteira, não importa o scroll */
    position: fixed;
    inset: 0;
    /* cobre 100% da tela */
    width: 100vw;
    /* 1º: Fallback mais básico para navegadores muito antigos */
    height: 100vh;
    /* 2º: Hack antigo para Safari iOS (opcional, mas mal não faz se vier antes) */
    height: -webkit-fill-available;
    /* 3º: O Padrão Moderno (Vence todos os anteriores se o navegador suportar) */
    height: 100dvh;
    /* suporte a navegadores modernos */

    /* 3. Fundo semi-transparente */
    background-color: var(--color-transparent-background);
    backdrop-filter: blur(var(--blur-1));
    -webkit-backdrop-filter: blur(var(--blur-1));
    color: var(--color-text);

    /* 4. O SEGREDO MÁGICO: Z-INDEX! */
    /* Seu header/footer tem z-index: 10. Um número maior como 1000 garante que o modal fique por cima de TUDO. */
    z-index: 1000;

    /* 5. Usa flexbox para centralizar o conteúdo do modal na tela */
    /* display: flex; */
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;

    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

.alert-modal.active {
    opacity: 1;
    pointer-events: all;
}

.alert-modal>#text-div {
    background-color: var(--color-background-surface);
    padding: 20px;
    border-radius: var(--border-radius);
    border-bottom-right-radius: 0px;
    border-bottom-left-radius: 0px;
    border-bottom: 1px solid var(--color-background-surface-1);
    max-width: 600px;
    width: calc(100%);
    max-height: 100%;
    overflow-y: auto;
    position: relative;
    /* transform: scale(0.95); */
    /* transition: transform 0.3s ease-in-out; */
}

.alert-modal>#dismiss-div {
    background-color: var(--color-background-surface);
    padding: 20px;
    border-radius: var(--border-radius);
    border-top-right-radius: 0px;
    border-top-left-radius: 0px;
    max-width: 600px;
    width: calc(100%);
    max-height: 100%;
    overflow-y: auto;
    position: relative;
    cursor: pointer;
    color: var(--color-link);
    font-weight: 400;
    /* transform: scale(0.95);
            transition: transform 0.3s ease-in-out; */
}


/* LOADING MODAL */

.loading-modal {
    /* 1. Começa escondido */
    display: flex;
    flex-direction: column;
    /* 2. Posição fixa para cobrir a tela inteira, não importa o scroll */
    position: fixed;
    inset: 0;
    /* cobre 100% da tela */
    width: 100vw;
    /* 1º: Fallback mais básico para navegadores muito antigos */
    height: 100vh;
    /* 2º: Hack antigo para Safari iOS (opcional, mas mal não faz se vier antes) */
    height: -webkit-fill-available;
    /* 3º: O Padrão Moderno (Vence todos os anteriores se o navegador suportar) */
    height: 100dvh;
    /* suporte a navegadores modernos */

    /* 3. Fundo semi-transparente */
    background-color: var(--color-transparent-background);
    backdrop-filter: blur(var(--blur-1));
    -webkit-backdrop-filter: blur(var(--blur-1));
    color: var(--color-text);

    /* 4. O SEGREDO MÁGICO: Z-INDEX! */
    /* Seu header/footer tem z-index: 10. Um número maior como 1000 garante que o modal fique por cima de TUDO. */
    z-index: 1000;

    /* 5. Usa flexbox para centralizar o conteúdo do modal na tela */
    /* display: flex; */
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;

    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

.loading-modal.active {
    opacity: 1;
    pointer-events: all;
}

.loading-modal>#text-div {
    /* background-color: var(--color-background-surface); */
    padding: 20px;
    border-radius: var(--border-radius);
    border-bottom-right-radius: 0px;
    border-bottom-left-radius: 0px;
    /* border-bottom: 1px solid var(--color-background-surface-1); */
    max-width: 600px;
    width: calc(100%);
    max-height: 100%;
    overflow-y: auto;
    position: relative;
    /* transform: scale(0.95); */
    /* transition: transform 0.3s ease-in-out; */
}

/* FIM */

.digimon-image {
    image-rendering: pixelated;
}

.table {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    border-collapse: separate;
    /* permite o arredondamento */
    border-spacing: 0;
    /* remove espaço entre células */
    overflow: hidden;
    /* mantém o arredondamento */
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    color: white;
    font-family: "Poppins", sans-serif;
}

.table th,
.table td {
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 14px;
    text-align: left;
}

.table th {
    background: rgba(255, 255, 255, 0.15);
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.table tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.05);
}

.table tr:hover td {
    background: rgba(255, 255, 255, 0.12);
    transition: background 0.3s ease;
}

.table.text-center td,
.table.text-center th {
    text-align: center;
}