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

body, html { 
    width: 100%; height: 100%; 
    background: #000 !important; 
}

/* --- ESTRUTURA GERAL --- */
body#pagina-home, body#pagina-game {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* --- CONTAINER DO JOGO --- */
#game-container {
    position: relative;
    width: 100%;
    max-width: 1024px;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(50, 0, 0, 0.5);
    border: 1px solid #333;
}

/* --- TELA CHEIA --- */
#game-container:fullscreen {
    max-width: none;
    width: 100vw;
    height: 100vh;
    border: none;
}

/* --- ELEMENTOS VISUAIS --- */
#video-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 0;
}

.pendulo-container {
    position: absolute;
    top: -20px; left: 50%; transform: translateX(-50%);
    z-index: 5; text-align: center;
}

#olho {
    width: 160px; cursor: pointer;
    transform-origin: top center;
    animation: balancoLeve 4s ease-in-out infinite;
}

/* --- AJUSTES PÁGINA INICIAL --- */
#pagina-home #olho {
    width: 176px;
}

/* --- TIPOGRAFIA --- */
main {
    position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    text-align: center; width: 100%; color: white; z-index: 10;
    pointer-events: none;
}

.titulo { font-family: 'Cinzel', serif; font-size: 3.5rem; letter-spacing: 5px; pointer-events: auto; }

/* --- AJUSTES TÍTULO HOME --- */
#pagina-home .titulo {
    font-size: 3.85rem;
}

/* --- BOTÕES --- */
.badge {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 160px; height: 50px;
    border: 1px solid white;
    padding: 0;
    border-radius: 50px;
    background: rgba(0, 0, 0, 0.6); 
    pointer-events: auto;
    color: white;
    font-family: 'Cinzel', serif;
    cursor: pointer;
    text-align: center;
    line-height: 1.2;
    transition: all 0.3s ease;
}

.badge p {
    margin: 0;
    font-size: 0.8rem;
}

.badge:hover {
    background: #900;
    border-color: #900;
    transform: scale(1.05);
}

.badge .data {
    opacity: 0.7;
}

.badge.bloqueado {
    opacity: 0.6;
}

/* --- MENU INICIAL --- */
.menu-inicial {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 25px;
}

.btn-experiencia {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 160px; height: 50px;
    padding: 0;
    border: 1px solid white;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-family: 'Cinzel', serif;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    pointer-events: auto;
    font-size: 0.9rem;
}

.btn-experiencia:hover {
    background: #900;
    border-color: #900;
    transform: scale(1.05);
}

/* --- MODAL RECOMPENSA --- */
.modal-recompensa {
    display: none; position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 2000;
    justify-content: center; align-items: center;
}

.modal-conteudo {
    background: #111; padding: 20px; border: 1px solid #600;
    text-align: center; max-width: 320px; 
    width: 90%; position: relative;
}

.imagem-recompensa { 
    width: 100%; 
    max-height: 70vh; 
    object-fit: contain; 
    margin: 10px 0; 
    border: 1px solid #333; 
}

.fechar-modal {
    position: absolute;
    top: 5px;
    right: 15px;
    color: #900;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
}

/* --- GALERIA --- */
#pagina-galeria { 
    background: #050505 !important; 
    padding: 40px; 
    color: white; 
    font-family: 'Cinzel', serif; 
    min-height: 100vh;
}

.grid-colecao { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
    gap: 20px; 
    margin-top: 30px; 
}

.item-galeria { 
    width: 100%; 
    height: 180px; 
    border: 2px solid #200; 
    cursor: pointer; 
    background: #111; 
    object-fit: contain; 
    padding: 5px; 
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.item-galeria:hover {
    transform: scale(1.05);
    border-color: #900;
}

/* --- VISUALIZADOR --- */
#visualizador {
    display: none; position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95); z-index: 3000;
    justify-content: center; align-items: center;
}

#imagem-grande { 
    max-width: 90%; max-height: 90%; 
    border: 1px solid #444;
    transition: transform 0.3s ease; 
}

.zoomavel {
    cursor: zoom-in;
}

.zoomed {
    transform: scale(2);
    cursor: zoom-out;
}

#btn-play-dialogo {
    display: none;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: white;
    background: rgba(0,0,0,0.6);
    border: 2px solid white;
    border-radius: 50%;
    width: 80px; height: 80px;
    cursor: pointer;
    z-index: 3001;
    transition: transform 0.2s, background 0.2s;
}

#btn-play-dialogo:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(150,0,0,0.8);
}

/* --- BOTÃO COLEÇÃO --- */
.btn-circular {
    position: absolute; bottom: 30px; right: 30px;
    width: 80px; height: 80px; border-radius: 50%;
    background: rgba(60, 0, 0, 0.8); color: white;
    border: 1px solid white; display: flex; justify-content: center;
    align-items: center; text-decoration: none; z-index: 100;
}

/* --- ANIMAÇÕES --- */
@keyframes balancoLeve { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.olho-agitado { animation: balancoForte 0.5s ease-in-out 3 !important; }
@keyframes balancoForte { 0%, 100% { transform: rotate(-25deg); } 50% { transform: rotate(25deg); } }

#contador-visual {
    position: static;
    margin-bottom: 15px;
    display: flex;
    gap: 30px;
    color: white;
    font-family: 'Cinzel', serif;
    z-index: 10;
    pointer-events: none;
}

/* --- MOSCA --- */
#mosca {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    z-index: 100;
    cursor: pointer;
    transition: width 0.2s ease-out;
    animation: vooInfinito 6s linear infinite;
    pointer-events: auto;
}

@keyframes vooInfinito {
    0%   { transform: translate(-25vw, -10vh) scaleX(1); }
    25%  { transform: translate(10vw, -25vh) scaleX(1); }
    49.9% { transform: translate(25vw, 0) scaleX(1); }
    50%   { transform: translate(25vw, 0) scaleX(-1); } 
    75%   { transform: translate(-10vw, 20vh) scaleX(-1); }
    99.9% { transform: translate(-25vw, -10vh) scaleX(-1); }
    100%  { transform: translate(-25vw, -10vh) scaleX(1); }
}

/* --- MÃO --- */
#mao {
    position: absolute;
    top: 0;
    left: 70%; 
    transform: translate(-50%, -100%); 
    width: 190px; 
    z-index: 101;
    cursor: pointer;
    display: none;
    transition: width 0.2s ease;
}

.mao-descendo {
    animation: descerMao 1.5s ease-out forwards;
}

@keyframes descerMao {
    0%   { transform: translate(-50%, -100%); }
    100% { transform: translate(-50%, -10%); } 
}

.mao-vibrando {
    animation: vibrar 0.1s linear infinite;
}

@keyframes vibrar {
    0%   { transform: translate(-50%, -10%) rotate(0deg); }
    25%  { transform: translate(-51%, -10%) rotate(1deg); }
    75%  { transform: translate(-49%, -10%) rotate(-1deg); }
    100% { transform: translate(-50%, -10%) rotate(0deg); }
}

/* --- MOSCA CAINDO --- */
.mosca-caindo {
    display: block !important;
    animation: quedaMosca 1s ease-in forwards !important;
}

@keyframes quedaMosca {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, 500px) rotate(180deg);
        opacity: 0;
    }
}

.mao-descansando {
    transition: all 1s ease-in-out;
}

/* --- MINIONS --- */
.minion {
    position: absolute;
    bottom: 20px;
    left: 20px;
    height: 125px;
    width: auto;
    cursor: pointer;
    z-index: 95;
    transition: left 0.3s ease-out;
}

#mao {
    z-index: 101; 
}

.minion[src*="piscando"] {
    filter: brightness(1.1);
}
.mao-esmagando {
    animation: esmagarMinions 0.5s ease-in forwards !important;
}

@keyframes esmagarMinions {
    100% { transform: translate(-50%, 80%) !important; } 
}

.mao-esmagando {
    animation: esmagarMinions 0.4s cubic-bezier(0.6, 0, 0.4, 1) forwards !important;
}

@keyframes esmagarMinions {
    100% { transform: translate(-50%, 75%) !important; } 
}

.mao-entregando-item {
    animation: entregarItem 2s ease-in-out forwards;
}

@keyframes entregarItem {
    0% { transform: translate(-50%, -10%); }
    45% { transform: translate(-50%, -120%); }
    55% { transform: translate(-50%, -120%); }
    100% { transform: translate(-50%, -10%); }
}
.minion-grupo {
    height: 155px !important;
    width: auto !important;
}
.mosca-dupla {
    position: absolute;
    width: 100px;
    z-index: 100;
    cursor: pointer;
    pointer-events: auto;
}

.mosca1 {
    animation: vooMosca1 6s linear infinite;
}

.mosca2 {
    animation: vooMosca2 4.5s linear infinite;
}

@keyframes vooMosca1 {
    0%   { transform: translate(-20vw, -10vh) scaleX(1); }
    25%  { transform: translate(15vw, -25vh) scaleX(1); }
    49.9% { transform: translate(25vw, 0vh) scaleX(1); }
    50%  { transform: translate(25vw, 0vh) scaleX(-1); }
    75%  { transform: translate(-10vw, 20vh) scaleX(-1); }
    99.9% { transform: translate(-20vw, -10vh) scaleX(-1); }
    100% { transform: translate(-20vw, -10vh) scaleX(1); }
}

@keyframes vooMosca2 {
    0%   { transform: translate(20vw, 10vh) scaleX(-1); }
    25%  { transform: translate(-15vw, 25vh) scaleX(-1); }
    49.9% { transform: translate(-25vw, 0vh) scaleX(-1); }
    50%  { transform: translate(-25vw, 0vh) scaleX(1); }
    75%  { transform: translate(10vw, -20vh) scaleX(1); }
    99.9% { transform: translate(20vw, 10vh) scaleX(1); }
    100% { transform: translate(20vw, 10vh) scaleX(-1); }
}

/* --- DIÁLOGO FINAL --- */
#dialogo-container {
    display: none;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    min-height: 150px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #fff;
    padding: 20px;
    color: white;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    line-height: 1.5;
    z-index: 6000;
    cursor: pointer;
    user-select: none;
}

#texto-dialogo {
    white-space: pre-wrap;
}

#seta-proximo {
    position: absolute;
    bottom: 10px;
    right: 20px;
    font-size: 1.5rem;
    animation: piscarSeta 1s infinite;
}

@keyframes piscarSeta {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.tremor-tela {
    animation: tremer 0.1s linear infinite;
}

@keyframes tremer {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-2px, 2px); }
    50% { transform: translate(2px, -2px); }
    75% { transform: translate(-2px, -2px); }
    100% { transform: translate(0, 0); }
}

.pendulo-subindo {
    top: -150% !important;
    transition: top 5s ease-in-out;
}

/* --- ANIMAÇÃO FINAL --- */
#animacao-final {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 200;
    object-fit: cover;
}

.animacao-descendo {
    animation: descerTela 2.5s ease-out forwards;
}

@keyframes descerTela {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(0); }
}

/* --- BLOQUEIO MOBILE --- */
#aviso-mobile {
    display: none; /* Escondido por padrão no PC */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #050505;
    z-index: 10000; /* Fica acima de tudo */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-align: center;
    padding: 20px;
}

#aviso-mobile h2 { font-family: 'Cinzel', serif; font-size: 2rem; color: #900; margin-bottom: 20px; }
#aviso-mobile p { font-family: 'Cinzel', serif; font-size: 1.1rem; line-height: 1.6; color: #ccc; }

/* Se a tela for menor que 768px (celulares e tablets pequenos) */
@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
    #aviso-mobile { display: flex; }
    #game-container, #contador-visual { display: none !important; }
    body { overflow: hidden; }

    /* --- AJUSTES HOME MOBILE --- */
    #pagina-home .titulo {
        font-size: 2.5rem;
        padding: 0 10px;
    }

    #pagina-home .menu-inicial {
        flex-direction: column;
        gap: 15px;
    }

    #pagina-home .badge, 
    #pagina-home .btn-experiencia {
        width: 220px;
        height: 60px;
    }

    #pagina-home #olho {
        width: 130px;
    }

    #pagina-home .btn-circular {
        display: none !important;
    }
}

/* --- PÁGINA DE LEITURA (PILOTO) --- */
#pagina-leitura {
    background: #0a0a0a !important; 
    color: #dcdcdc;
    font-family: 'Lora', serif; 
    min-height: 100vh;
    height: auto !important;
    display: block; 
    overflow-y: visible; 
    overflow-x: hidden;
    transition: background 0.4s ease, color 0.4s ease;
}

/* MODO CLARO (Tons de Livro/Papel) */
#pagina-leitura.tema-claro {
    background: #f4ebd8 !important; 
    color: #2b2b2b;
}

html.tema-claro {
    background: #f4ebd8 !important;
}

/* --- BARRA DE PROGRESSO --- */
#barra-progresso-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 9999;
}

#barra-progresso {
    height: 100%;
    background: #900;
    width: 0%;
    transition: width 0.1s ease-out;
}

.leitura-header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background: inherit;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    z-index: 100;
    transition: transform 0.3s ease;
}

.header-escondido {
    transform: translateY(-100%);
}

.btn-voltar-leitura {
    color: #900;
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    transition: color 0.3s;
}

.btn-voltar-leitura:hover { color: #f00; }

.btn-tema {
    background: transparent;
    border: 1px solid #900;
    color: inherit;
    padding: 8px 15px;
    font-family: 'Cinzel', serif;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-tema:hover {
    background: #900;
    color: white;
}

.leitura-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 60px 20px;
    font-size: 1.15rem;
    line-height: 1.6;
}

.leitura-titulo {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
    color: #900;
}

.leitura-container p {
    margin-bottom: 10px;
    text-indent: 30px; /* Recuo na primeira linha estilo livro físico */
    text-align: justify;
}

/* Sem recuo no primeiro parágrafo após quebras, separadores ou títulos */
.quebra-pagina + p,
.separador-texto + p,
.capitulo-titulo + p {
    text-indent: 0 !important;
}

/* --- PÁGINA DE ROSTO (CAPA INTERNA) --- */
.pagina-rosto {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-bottom: 40px;
}

.livro-titulo {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    color: #900;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.livro-autora {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.livro-social {
    font-family: 'Lora', serif;
    font-size: 1rem;
    opacity: 0.7;
    font-style: italic;
}

/* --- AVISO DO PILOTO --- */
.aviso-piloto {
    margin: 60px auto 60px auto;
}

.aviso-titulo {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    text-align: center;
    color: #900;
    margin-bottom: 25px;
    font-weight: normal;
}

.aviso-piloto a {
    color: #900;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s;
}

.aviso-piloto a:hover {
    color: #f00;
    text-decoration: underline;
}

/* --- FORMATAÇÃO DO TEXTO (LIVRO) --- */
.capitulo-titulo {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    text-align: center;
    color: #900;
    margin: 60px 0 40px 0;
    letter-spacing: 2px;
}

.separador-texto {
    text-align: center;
    margin: 60px 0 20px 0;
}

.separador-texto img {
    width: 30px; /* Tamanho do ícone reduzido */
    opacity: 0.8;
}

.trecho-musica {
    text-align: center !important;
    text-indent: 0 !important;
    margin: 30px 0;
    line-height: 1.6;
}

.quebra-pagina {
    display: block;
    height: 120px; /* Cria um grande espaço em branco imitando a passagem de página */
}

/* --- NAVEGAÇÃO DE PÁGINAS --- */
.pagina-livro {
    display: none;
    flex-direction: column;
    min-height: 75vh;
    animation: fadeInPagina 0.5s ease-in-out;
}

.pagina-livro.ativa {
    display: flex;
}

@keyframes fadeInPagina {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn-nav-fixo {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 1px solid #900;
    color: inherit;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    padding: 0;
    font-family: 'Cinzel', serif;
    border-radius: 50%; /* Transforma o botão em um círculo perfeito */
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
}

.btn-nav-fixo:hover {
    background: #900;
    color: white;
}

#btn-voltar-pagina { left: 30px; }
#btn-avancar-pagina { right: 30px; }

#indicador-pagina {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    opacity: 0.6;
    z-index: 1000;
}

/* Ajustes para celular na página de leitura */
@media (max-width: 768px) {
    .leitura-container {
        font-size: 1.05rem;
        padding: 40px 20px 60px 20px;
    }
    .leitura-titulo {
        font-size: 1.8rem;
    }
    .livro-titulo {
        font-size: 2.5rem;
    }
    #container-nav-fixo {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 40px;
        padding-top: 30px;
        border-top: 1px solid rgba(128, 128, 128, 0.2);
    }
    .btn-nav-fixo {
        position: static;
        transform: none;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    #indicador-pagina {
        position: static;
        transform: none;
    }
}