/* css/entrance.css */

/* Importando a fonte subindo um nível para achar a pasta fonts/ na raiz */
@font-face {
    font-family: 'Arisawa-Kaisho';
    src: url('../fonts/Arisawa-Kaisho.TTF') format('truetype');
}

body {
    margin: 0;
    padding: 0;
    background-color: #000000;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center; 
    overflow: hidden; 
}

/* ==========================================================================
   EFEITO CRT (ブラウン管)
   ========================================================================== */
.crt::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 9999;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

@keyframes flicker {
    0% { opacity: 0.27861; }
    5% { opacity: 0.34769; }
    10% { opacity: 0.23604; }
    15% { opacity: 0.10626; }
    20% { opacity: 0.18128; }
    25% { opacity: 0.10626; }
    30% { opacity: 0.18128; }
    35% { opacity: 0.23604; }
}

.crt::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 9998;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

/* ==========================================================================
   ELEMENTOS DO ALTAR E TEXTO (AJUSTADO PARA 1844x934)
   ========================================================================== */

/* Travado no tamanho real do seu background para matar a faixa preta superior */
#viewport-container {
    position: relative;
    width: 1844px;
    height: 934px;
    background: url('../entrance/entrance-bg.png') no-repeat center center;
    background-size: cover;
    flex-shrink: 0;
}

/* Caixa de Texto ajustada milimetricamente para a moldura do novo tamanho */
.text-box {
    position: absolute;
    top: 290px;    
    right: 200px;  
    width: 340px;  
    height: 310px; 
    font-family: 'Arisawa-Kaisho', sans-serif;
    color: #ffffff;
    font-size: 14px;
    white-space: pre-wrap; 
    line-height: 1.5;
    overflow-y: auto; 
    padding-right: 10px;
}

/* Customização da barra de rolagem (Escondida por padrão) */
.text-box::-webkit-scrollbar {
    width: 2px;
}
.text-box::-webkit-scrollbar-track {
    background: transparent; /* Invisível inicialmente */
    transition: background 0.3s ease;
}
.text-box::-webkit-scrollbar-thumb {
    background: transparent; /* Invisível inicialmente */
    border-radius: 1px;
    transition: background 0.3s ease;
}

/* Ativa visualmente a barra apenas quando o mouse estiver em cima da caixa */
.text-box:hover::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
}
.text-box:hover::-webkit-scrollbar-thumb {
    background: #FF0000; /* Linha vermelha surge no hover */
}

.highlight-red {
    color: #FF0000;
}

/* Base para itens arrastáveis */
.interactive-element {
    position: absolute;
    cursor: grab;
    user-select: none;
    z-index: 10;
}
.interactive-element:active {
    cursor: grabbing;
}

/* ==========================================================================
   COORDENADAS DOS ELEMENTOS NO ALTAR
   ========================================================================== */

/* Coordenadas aproximadas baseadas na mesa central */
#candle1 {
    top: 620px;
    left: 1020px;
}

#candle2 {
    top: 620px;
    left: 1065px;
}

#incense-container {
    position: absolute;
    top: 660px;
    left: 855px;
    z-index: 5;
    width: 130px;  /* Ajuste inicial baseado no vaso */
    height: 130px; 
}

#incense-img {
    width: 100%;
    height: auto;
}

#incense-smoke {
    position: absolute;
    top: -332px; /* Mudado de -110px para -240px para jogar a fumaça bem mais para cima */
    left: -20px;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    pointer-events: none;
}


/* 1. Animação de entrada: sobe do vaso e aparece (roda uma vez) */
@keyframes smokeEntrance {
    0% {
        transform: translateY(20px) scale(0.9);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.65; /* Fixa na opacidade ideal de visibilidade */
    }
}

/* 2. Animação contínua: paira no ar de forma estática com micro-movimentos e pulsação */
@keyframes smokeHover {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.65;
    }
    50% {
        transform: translateY(-3px) translateX(3px) scale(1.02); /* Balanço quase imperceptível */
        opacity: 0.55; /* Leve variação de brilho/densidade */
    }
    100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.65;
    }
}

#incense-smoke.active {
    opacity: 0;
    /* Aplica a entrada (1.5s) e depois engata o balanço eterno (4s) em loop */
    animation: smokeEntrance 1.5s ease-out forwards, 
               smokeHover 4s infinite ease-in-out 1.5s;
}


#orin {
    top: 590px;
    left: 700px;
}

/* Mude apenas este bloco no seu css/entrance.css */
#orin.used {
    filter: brightness(1.2); /* Dá um leve brilho para indicar que foi usado, sem quebrar o HTML */
    content: url('../entrance/orin-prayerbell-whenusedorhovered.png');
}

#rinbou {
    top: 760px;
    left: 640px;
}

/* Botão de Entrada inicialmente oculto/bloqueado */
#entrance-button {
    position: absolute;
    top: 685px;
    right: 340px;
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none; 
    z-index: 20;
}

#entrance-button.active {
    cursor: pointer;
    opacity: 1;
    pointer-events: auto;
}

/* Botão Sair */
#leave-button {
    position: absolute;
    bottom: 05px;
    left: 02px;
    cursor: pointer;
    z-index: 20;
}
