/* --- RESET E BASE --- */
:root {
    --oro: #d4af37;
    --oro-scuro: #aa8c2c;
    --viola-scuro: #1a0b2e;
    --nero-profondo: #050505;
    --testo: #e0e0e0;
}

body {
    background-color: var(--nero-profondo);
    color: var(--testo);
    font-family: 'Lato', sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* --- SFONDO MISTICO --- */
/* Crea un effetto di luce soffusa dietro a tutto */
.sfondo-mistico {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, #2e1a47 0%, #000000 90%);
    z-index: -1;
}

/* Texture "rumore" opzionale per effetto carta antica/tessuto */
.sfondo-mistico::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.3;
}

.tavolo {
    text-align: center;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    z-index: 1;
}

/* --- TESTI E TITOLI --- */
header { margin-bottom: 40px; }

.logo-text {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--oro);
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.sottotitolo {
    font-size: 1.2rem;
    color: #a89fbed8;
    letter-spacing: 1px;
    text-transform: uppercase;
}

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

/* --- LA CARTA (GENERATIVA) --- */
.carta-container {
    perspective: 1000px;
    width: 220px;
    height: 380px;
    margin: 0 auto 40px auto;
    position: relative;
}

/* Animazione di galleggiamento per la carta principale */
.main-card {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

.carta {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Rimbalzo elastico */
}

/* Quando passi il mouse sulla carta in home, si gira leggermente */
.main-card:hover .carta {
    transform: rotateY(20deg) rotateX(10deg);
}

.faccia {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(212, 175, 55, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--oro);
}

/* RETRO DELLA CARTA: Design Generativo Complesso */
.retro {
    background: #11051b;
    /* Doppio bordo */
    outline: 4px double var(--oro-scuro);
    outline-offset: -10px;
}

/* Il pattern geometrico senza immagini */
.pattern-interno {
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 50% 50%, transparent 20%, #11051b 21%, #11051b 30%, transparent 31%),
        repeating-linear-gradient(45deg, rgba(212, 175, 55, 0.05) 0px, rgba(212, 175, 55, 0.05) 1px, transparent 1px, transparent 10px),
        repeating-linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0px, rgba(212, 175, 55, 0.05) 1px, transparent 1px, transparent 10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Simbolo centrale sul retro */
.pattern-interno::after {
    content: "☾"; /* Luna crescente */
    font-size: 3rem;
    color: var(--oro);
    opacity: 0.8;
}

/* FRONTE DELLA CARTA */
.fronte {
    background-color: #f4e4bc; /* Color pergamena */
    color: #222;
    transform: rotateY(180deg);
    border: 8px solid #2e1a47; /* Cornice spessa */
}

/* --- BOTTONE MAGICO --- */
.bottone-magico {
    position: relative;
    padding: 15px 50px;
    background: linear-gradient(135deg, var(--oro-scuro), var(--oro));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.bottone-magico:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.6);
}

.testo-btn {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: bold;
    color: #1a0b2e;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
}

/* Effetto di luce che passa sul bottone */
.bagliore {
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    transition: 0.5s;
    z-index: 1;
}

.bottone-magico:hover .bagliore {
    left: 100%;
    transition: 0.5s;
}

/* --- AREA RISULTATI (per lettura.php) --- */
.tavolo-risultati {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    flex-wrap: wrap;
}

.risultato-box {
    background: rgba(20, 10, 30, 0.9); /* Sfondo scuro semi-trasparente */
    border: 1px solid var(--oro-scuro);
    padding: 25px;
    width: 300px;
    border-radius: 4px; /* Angoli meno tondi per effetto antico */
    margin-top: 20px;
    text-align: left;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    position: relative;
}

/* Decorazione angoli dorati (CSS avanzato) */
.risultato-box::before {
    content: "";
    position: absolute;
    top: 5px; left: 5px; right: 5px; bottom: 5px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    pointer-events: none;
}

.titolo-posizione {
    color: var(--oro);
    font-family: 'Cinzel', serif;
    text-align: center;
    border-bottom: 1px solid var(--oro-scuro);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.descrizione-breve {
    color: #aaa;
    font-style: italic;
    font-size: 0.9em;
    border-left: 2px solid var(--oro);
    padding-left: 10px;
    margin: 10px 0;
}