@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

/* ============================================================
   Paleta: Neutros Monásticos e Arte Sacra Clássica
   Fundo: #FAF6F0 (Pergaminho / Alabastro)
   Texto Principal: #2C2825 (Carvão / Tinta Antiga)
   Dourado/Bronze Sacro: #8C6A4B
   Dourado Acentuado: #B38F65
   Borda e Detalhes: #e0d6c8 / #3b332d
   ============================================================ */

:root {
    --bg-parchment: #FAF6F0;
    --bg-card: #fdfbf7;
    --text-primary: #2C2825;
    --text-muted: #7a6f64;
    --text-subtle: #5c5146;
    --gold-sacred: #8C6A4B;
    --gold-hover: #6b4d33;
    --gold-light: #d6b896;
    --frame-border: #3b332d;
    --border-soft: #e8dfd1;
}

body {
    font-family: 'Lora', serif;
    background-color: var(--bg-parchment);
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, .title-font {
    font-family: 'Cinzel', serif;
}

/* Moldura Sagrada para Contemplação */
.art-frame {
    background-color: #1a1817;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 0 25px rgba(0, 0, 0, 0.85);
    border: 12px solid var(--frame-border);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.art-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 1.5s ease-in-out;
    opacity: 0;
}

.art-image.active {
    opacity: 1;
}

/* Botões Estilo Sacro */
.btn-sacred {
    background-color: var(--gold-sacred);
    color: #FAF6F0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #6b4d33;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-sacred:hover {
    background-color: var(--gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(107, 77, 51, 0.25);
    color: #ffffff;
}

.btn-sacred:active {
    transform: translateY(0);
}

.btn-sacred-outline {
    background-color: transparent;
    color: var(--gold-sacred);
    border: 1.5px solid var(--gold-sacred);
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-sacred-outline:hover {
    background-color: var(--gold-sacred);
    color: #FAF6F0;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(140, 106, 75, 0.2);
}

/* Cartões de Mistérios (Hover elegante) */
.mystery-card {
    transition: all 0.35s ease;
    border-top: 4px solid transparent;
}

.mystery-card:hover {
    transform: translateY(-5px);
    border-top-color: var(--gold-sacred);
    background-color: #ffffff;
    box-shadow: 0 12px 24px -6px rgba(60, 40, 20, 0.12);
}

/* Indicadores de Progresso */
@keyframes pulse-subtle {
    0%, 100% { opacity: 1; transform: scale(1.15); }
    50% { opacity: 0.5; transform: scale(0.95); }
}

.indicator-active {
    animation: pulse-subtle 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ── Jogo da Memória Sacra (Efeitos 3D & Aspecto Santinho) ── */
.card-container {
    perspective: 1000px;
    cursor: pointer;
    aspect-ratio: 3/4;
    user-select: none;
    touch-action: manipulation;
    position: relative;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.card-container:hover {
    transform: translateY(-2px);
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.2, 0.85, 0.4, 1.2);
    border-radius: 8px;
}

.card-container.is-flipped .card-inner,
.card-container.is-matched .card-inner {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
}

.card-face-back {
    background: radial-gradient(circle at center, #4a3c32 0%, #221a13 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gold-sacred);
    border: 2px solid #5c4535;
    transition: all 0.3s ease;
}

.card-face-back .cross-symbol {
    font-size: clamp(1.4rem, 3.5vw, 2.4rem);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.card-container:not(.is-flipped):not(.is-matched):hover .card-face-back {
    border-color: var(--gold-sacred);
    background: radial-gradient(circle at center, #5c4a3a 0%, #30241b 100%);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.card-face-front {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotateY(180deg);
    background-color: #1a1817;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 2px solid #5c4535;
}

.card-face-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-container.is-matched .card-face-front {
    box-shadow: inset 0 0 0 3px #8C6A4B, 0 6px 16px rgba(140, 106, 75, 0.4);
    border-color: #8C6A4B;
}

.card-container.is-active-first .card-face-front {
    box-shadow: inset 0 0 0 3px #B38F65, 0 0 16px rgba(179, 143, 101, 0.7);
    border-color: #B38F65;
}

.card-container.is-matched {
    opacity: 0.88;
}

.card-mystery-badge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(20, 15, 10, 0.88);
    color: #FAF6F0;
    border-bottom: 1.5px solid #8C6A4B;
    font-family: 'Cinzel', serif;
    font-size: clamp(0.6rem, 1vw, 0.72rem);
    font-weight: 600;
    text-align: center;
    padding: 3.5px 4px;
    line-height: 1.15;
    letter-spacing: 0.03em;
    z-index: 5;
    pointer-events: none;
    backdrop-filter: blur(2px);
}

/* Transições de Fade gerais */
.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

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

/* Modal de Comparação e Contemplação */
@keyframes modalPopIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-pop {
    animation: modalPopIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Efeito de destaque na primeira carta selecionada */
.card-container.is-active-first .card-face-front {
    box-shadow: 0 0 0 3px #B38F65, 0 0 20px rgba(179, 143, 101, 0.75);
    border-color: #B38F65;
}
