/* css/ledger.css */

@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.25; }
    5% { opacity: 0.32; }
    10% { opacity: 0.21; }
    15% { opacity: 0.12; }
    20% { opacity: 0.19; }
    25% { opacity: 0.11; }
}
.crt::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: rgba(18, 16, 16, 0.08);
    opacity: 0;
    z-index: 9998;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

/* ==========================================================================
   CONTAINER PRINCIPAL (ESTICAMENTO 1920x1080)
   ========================================================================== */
#viewport-container {
    position: relative;
    width: 1920px;
    height: 1080px;
    background: url('../visitor-ledger/visitorledgerbg.png') no-repeat center center;
    background-size: 100% 100%; /* Garante o esticamento absoluto nas paredes do monitor */
    flex-shrink: 0;
}

/* DESTAQUES DE CORES DO TEXTO DO CADÁVER LAB */
.highlight-deep-red {
    color: #9E0000 !important;
    font-weight: normal;
}
.orange-title {
    color: #FA975D !important;
    font-family: 'Arisawa-Kaisho', sans-serif;
    font-size: 15px;
    margin: 15px 0 5px 0;
    font-weight: normal;
}

/* Estilos de Texto Base */
.ledger-text {
    font-family: 'Arisawa-Kaisho', sans-serif;
    color: rgba(255, 255, 255, 0.7);
    font-size: 17px;
    line-height: 1.5;
    margin-bottom: 12px;
}
.font-small { font-size: 15px; }
.italic { font-style: italic; }

/* ==========================================================================
   DIAGRAMAÇÃO DA PÁGINA ESQUERDA (CORRIGIDA E 100% CENTRALIZADA)
   ========================================================================== */
.ledger-left-page {
    position: absolute;
    top: 220px;                 /* Calibrado para dar respiro vertical */
    left: 480px;
    width: 440px;
    height: 610px;
    display: flex;
    flex-direction: column;
    align-items: center;        /* FORÇA TODOS OS ELEMENTOS DIRECTOS PRO CENTRO */
    text-align: center;         /* CENTRALIZA TODAS AS LINHAS DE TEXTO */
    overflow-y: auto;
}
.ledger-left-page::-webkit-scrollbar { display: none; }
.ledger-left-page { scrollbar-width: none; }

/* Centraliza o Logotipo no topo da folha */
.ledger-logo {
    width: 160px;               /* Ajuste o tamanho ligeiramente maior como no mockup */
    height: auto;
    display: block;
}

/* Base de texto */
.ledger-text {
    font-family: 'Arisawa-Kaisho', sans-serif;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 14px;
    width: 100%;                /* Garante que o alinhamento de texto ocupe toda a largura */
}
.font-small { font-size: 15px; }
.italic { font-style: italic; }

/* ==========================================================================
   BLOCO DO CONTADOR DE CORAÇÕES (CLAPS CENTRALIZADO)
   ========================================================================== */
.heart-counter-wrapper {
    display: flex;
    flex-direction: column;     /* Empilha o Coração em cima e os Números embaixo */
    align-items: center;        /* Centraliza ambos horizontalmente */
    justify-content: center;
    gap: 4px;                   /* Distância entre o coração e os números */
    margin: 15px auto;          /* Força a centralização do bloco no meio da página */
    cursor: pointer;
    width: fit-content;
}

.heart-gif {
    height: 65px;               /* Aumentado para dar o destaque imersivo do mockup */
    width: auto;
    transition: transform 0.1s ease;
    display: block;
}

.heart-counter-wrapper:hover .heart-gif {
    filter: drop-shadow(0 0 8px rgba(158, 0, 0, 0.7)) brightness(1.2);
}

.digits-box {
    display: flex;
    align-items: center;
    justify-content: center;    /* Centraliza a fileira de números embaixo do coração */
    gap: 1px;                   /* Pequeno espaço entre cada algarismo */
}

.digits-box img {
    height: 35px;               /* Altura corrigida e ampliada dos números retrô */
    width: auto;
    display: block;
}

/* ==========================================================================
   INSTRUÇÕES DE ESCRITA: HOW TO LEAVE A MESSAGE (CENTRALIZADO)
   ========================================================================== */
.instructions-box {
    margin: 20px 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.orange-title {
    color: #FA975D !important;
    font-family: 'Arisawa-Kaisho', sans-serif;
    font-size: 17px;
    margin: 0 0 12px 0;
    font-weight: normal;
    text-align: center;
}

.ritual-steps {
    font-family: 'Arisawa-Kaisho', sans-serif;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    padding: 0;                 /* Remove o recuo padrão que jogava a lista pra direita */
    margin: 0;
    line-height: 1.6;
    list-style-position: inside; /* Joga os números (1, 2, 3) para dentro do alinhamento central */
    text-align: center;         /* Centraliza as frases perfeitamente */
}

.ritual-steps li {
    margin-bottom: 6px;
}


/* ==========================================================================
   DIAGRAMAÇÃO DA PÁGINA DIREITA (GUESTBOOK)
   ========================================================================== */
.ledger-right-page {
    position: absolute;
    top: 220px;
    left: 980px;
    width: 470px;
    height: 620px;
    border-radius: 4px;
    overflow: hidden;
}

/* Overlay de bloqueio por Ritual */
.ledger-locked-overlay {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.15);
    padding: 30px;
    box-sizing: border-box;
}

.lock-ritual-message {
    font-family: 'Arisawa-Kaisho', sans-serif;
    color: rgba(158, 0, 0, 0.6);
    font-size: 15px;
    text-align: center;
    line-height: 1.6;
    font-style: italic;
    letter-spacing: 0.5px;
}

/* 📌 UNIFICADO E CORRIGIDO: Ocupa 100% do pergaminho direito com respiro interno */
.ledger-unlocked-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
    padding: 25px 35px 25px 25px; /* Margem interna para o texto não colar nas bordas do papel */
}

/* Área de exibição dos comentários gravados (Scroll Oculto) */
.guestbook-scroll-area {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}
.guestbook-scroll-area::-webkit-scrollbar { display: none; }
.guestbook-scroll-area { scrollbar-width: none; }

.comment-node {
    font-family: 'Arisawa-Kaisho', sans-serif;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.2); /* 📌 MUDADO PARA ESCURO: Combina com o papel claro */
    padding-bottom: 10px;
    color: #1a1a1a; /* 📌 MUDADO PARA ESCURO: Texto legível em fundo claro */
}

.comment-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.5); /* 📌 MUDADO PARA ESCURO */
    margin-bottom: 5px;
}

.comment-visitor-name {
    color: #9E0000; /* 📌 MUDADO PARA VERMELHO CLÍNICO: Combina com o tema do altar */
    font-size: 15px;
    font-weight: bold;
}

.comment-body {
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

.comment-body img {
    max-height: 24px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

/* Caixa de Resposta da Anatomista aninhada */
.comment-anatomist-reply {
    margin-top: 8px;
    margin-left: 15px;
    padding: 6px 10px;
    background: rgba(158, 0, 0, 0.1); 
    border-left: 2px solid #9E0000;
    font-size: 12px;
    color: #1a1a1a;
    line-height: 1.4;
}

.reply-header {
    font-size: 10px;
    color: #9E0000;
    margin-bottom: 3px;
    font-weight: bold;
}

.admin-reply-btn {
    background: none;
    border: none;
    color: #9E0000;
    font-family: 'Arisawa-Kaisho', sans-serif;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    margin-top: 4px;
    display: block;
}
.admin-reply-btn:hover { text-decoration: underline; }

/* FORMULÁRIO CLÍNICO DE ENVIO */
.clinic-sign-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: transparent; /* 📌 REMOVIDO O PRETO: Mostra a textura do pergaminho ao fundo */
    padding: 10px 0 0 0;
    border-top: 1px solid rgba(0, 0, 0, 0.15); /* 📌 LINHA ESCURA DIVISÓRIA */
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.form-row label {
    font-family: 'Arisawa-Kaisho', sans-serif;
    color: #1a1a1a; /* 📌 LABEL EM PRETO ENVELHECIDO */
    font-size: 13px;
}

.clinic-sign-form input, 
.clinic-sign-form textarea {
    background: rgba(255, 255, 255, 0.8) !important; /* Branco levemente translúcido para fundir com as linhas do papel */
    border: 1px solid rgba(158, 0, 0, 0.4);
    outline: none;
    padding: 8px;
    color: #000000 !important; 
    font-size: 14px !important; 
    font-family: 'Arisawa-Kaisho', sans-serif;
    font-weight: bold;
    text-shadow: none !important; 
}

.clinic-sign-form input::placeholder, 
.clinic-sign-form textarea::placeholder {
    color: rgba(0, 0, 0, 0.4) !important;
    text-shadow: none !important;
}

.clinic-sign-form textarea {
    height: 60px;
    resize: none;
}

.stamp-submit-btn {
    background: rgba(158, 0, 0, 0.15);
    border: 1px solid #9E0000;
    color: #9E0000; /* 📌 TEXTO DO BOTÃO EM VERMELHO PARA COMBINAR COM CARIMBO DE CERA */
    font-family: 'Arisawa-Kaisho', sans-serif;
    font-size: 13px;
    font-weight: bold;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

.stamp-submit-btn:hover {
    background: rgba(158, 0, 0, 0.3);
    color: #ffffff; /* Fica branco ao passar o mouse */
}

.admin-access-corner {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 8px;
    opacity: 0.1;
    cursor: pointer;
}


/* ==========================================================================
   INTERATIVOS ABSOLUTOS DO ALTAR (CANETA E POTE)
   ========================================================================== */
.altar-ink-bottle {
    position: absolute;
    bottom: 320px;
    right: 70px; /* Posicionado perfeitamente sobre a arte direita do mockup */
    width: 180px;
    height: auto;
    z-index: 50;
    user-select: none;
}

.altar-higanbana-pen {
    position: absolute;
    top: 150px;
    right: 100px; 
    width: 300px;
    height: 450px;
    z-index: 60;
    cursor: grab;
    user-select: none;
    
    /* 📌 GARANTA ESTA LINHA: Permite que ela deslize de volta de forma suave no reset */
    transition: top 0.3s ease, left 0.3s ease, right 0.3s ease, filter 0.3s ease;
}

.altar-higanbana-pen:active { cursor: grabbing; }

/* BRILHO FAINT VERMELHO PARA ITENS DO ALTAR E BOTÃO VOLTAR */
.altar-ink-bottle, .altar-higanbana-pen, .red-fan-btn {
    transition: filter 0.3s ease;
}
.altar-ink-bottle.glow, .altar-higanbana-pen:hover {
    filter: drop-shadow(0 0 8px rgba(158, 0, 0, 0.5)) brightness(1.1);
}

/* ==========================================================================
   BOTÃO VOLTAR: LEQUE VERMELHO NO CANTO ESQUERDO RECALIBRADO
   ========================================================================== */
.back-theater-wrapper {
    position: absolute;
    bottom: 10px;
    left: 20px;
    z-index: 80;
}
#link-return-theater {
    position: relative;
    display: flex;
    align-items: center;
    text-decoration: none;
}
.red-fan-btn {
    width: 260px;
    height: auto;
    display: block;
}
#link-return-theater:hover .red-fan-btn {
    filter: drop-shadow(0 0 10px rgba(158, 0, 0, 0.7)) brightness(1.15);
}
.fan-label {
    position: absolute;
    position: absolute;
    left: 280px;
    font-family: 'Arisawa-Kaisho', sans-serif;
    color: #ffffff;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateX(-10px);
    pointer-events: none;
    text-shadow: 0 0 4px #000000;
}

#link-return-theater:hover .fan-label {
    opacity: 1;
    transform: translateX(0);
}

/* ==========================================================================
   📌 CAIXA DE AVISO ESTILO CLINIC/RITUAL (SUBSTITUTA DO ALERT)
   ========================================================================== */
.clinic-custom-alert {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid #9E0000;
    color: #9E0000;
    font-family: 'Arisawa-Kaisho', sans-serif;
    font-size: 15px;
    padding: 15px 30px;
    text-align: center;
    box-shadow: 0 0 15px rgba(158, 0, 0, 0.5);
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
.clinic-custom-alert.active {
    opacity: 1;
}

/* ==========================================================================
   📌 JANELA DE LOGIN DA ANATOMISTA (REPLACE DO PROMPT DO NAVEGADOR)
   ========================================================================== */
.clinic-auth-modal {
    display: none; /* Começa invisível */
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 5000;
    justify-content: center;
    align-items: center;
}
.auth-modal-content {
    width: 320px;
    background: #0a0a0a;
    border: 1px solid #9E0000;
    padding: 20px;
    text-align: center;
    box-shadow: 0 0 15px rgba(158, 0, 0, 0.4);
    font-family: 'Arisawa-Kaisho', sans-serif;
}
.auth-header {
    color: #9E0000;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}
.auth-subtext {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    line-height: 1.4;
    margin-bottom: 15px;
}
.clinic-auth-modal input {
    width: 90%;
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid rgba(158, 0, 0, 0.4);
    padding: 6px;
    font-size: 14px;
    text-align: center;
    outline: none;
    margin-bottom: 15px;
}
.auth-modal-buttons {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}
.auth-btn {
    background: none;
    border: none;
    font-family: 'Arisawa-Kaisho', sans-serif;
    font-size: 12px;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.2s;
}
.auth-btn.cancel { color: rgba(255, 255, 255, 0.4); }
.auth-btn.cancel:hover { color: #ffffff; }
.auth-btn.confirm { color: #FA975D; }
.auth-btn.confirm:hover { color: #9E0000; }

