@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;700&display=swap');

/* --- ESTILOS GENERALES Y DE LA APLICACIÓN --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Cormorant Garamond', serif;
    background: radial-gradient(circle, #0a011a 0%, #000000 100%);
    color: #f0f0f0;
    min-height: 100vh;
    overflow: hidden; 
}
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #0a011a; }
::-webkit-scrollbar-thumb {
    background-color: #c0a87a;
    border-radius: 20px;
    border: 2px solid #0a011a;
}
::-webkit-scrollbar-thumb:hover { background-color: #e6c88e; }

.stars {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none; z-index: 1;
}
.star {
    position: absolute;
    background: linear-gradient(to bottom, #f0e6d2, #a09070);
    border-radius: 50%;
    box-shadow: 0 0 5px #f0e6d2;
    animation: twinkle 3s infinite alternate;
}
@keyframes twinkle {
    0% { opacity: 0.3; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}
.shooting-star {
    position: absolute; height: 2px;
    background: linear-gradient(-45deg, #e6c88e, rgba(0, 0, 255, 0));
    border-radius: 999px;
    filter: drop-shadow(0 0 6px #e6c88e);
    animation: tail 3s ease-in-out infinite, shooting 3s ease-in-out infinite;
}
@keyframes tail {
    0% { width: 0; } 30% { width: 100px; } 100% { width: 0; }
}
@keyframes shooting {
    0% { transform: translateX(0); } 100% { transform: translateX(100vw); }
}
.container {
    position: relative; z-index: 10;
    max-width: 1200px; margin: 0 auto;
    padding: 20px; height: 100vh;
    overflow-y: auto;
}
.header {
    text-align: center; margin-top: 80px;
    margin-bottom: 20px; animation: fadeInDown 1s ease-out;
}
.header h1 {
    font-family: 'Cinzel', serif; font-size: 3.5rem;
    color: #c0a87a; text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    margin-bottom: 10px;
}
.header p { font-size: 1.2rem; color: #b8b8b8; }

/* --- CÓDIGO CORREGIDO --- */
.ogre-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    min-height: 170px;
}

#ogre-container {
    display: grid;
    place-items: center;
}
#ogre-container > * {
    grid-column: 1;
    grid-row: 1;
    transition: opacity 0.3s ease-in-out;
    max-width: 150px;
    height: auto;
}
/* --- FIN DEL CÓDIGO CORREGIDO --- */

.speech-bubble {
    position: relative; background: rgba(16, 8, 32, 0.6);
    backdrop-filter: blur(10px); border-radius: 1em; padding: 20px;
    max-width: 500px; text-align: left; border: 2px solid #c0a87a;
    box-shadow: 0 0 15px rgba(192, 168, 122, 0.3); display: none;
}
.speech-bubble:after {
    content: ''; position: absolute; left: 0; top: 50%;
    width: 0; height: 0; border: 20px solid transparent;
    border-right-color: #c0a87a; border-left: 0; border-bottom: 0;
    margin-top: -10px; margin-left: -20px;
}
@keyframes fadeInDown {
    0% { opacity: 0; transform: translateY(-30px); }
    100% { opacity: 1; transform: translateY(0); }
}
.controls {
    display: flex; gap: 20px; justify-content: center;
    flex-wrap: wrap; margin-bottom: 40px;
    animation: fadeInUp 1s ease-out 0.3s both;
}
@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}
.control-group {
    background: rgba(16, 8, 32, 0.4); backdrop-filter: blur(10px);
    border-radius: 15px; padding: 20px; border: 2px solid #c0a87a;
    box-shadow: 0 0 10px rgba(192, 168, 122, 0.2); transition: all 0.3s ease;
}
.control-group:hover {
    border-color: #e6c88e; transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(192, 168, 122, 0.4);
}
.control-group h3 {
    color: #e6c88e; margin-bottom: 10px; font-size: 1.2rem;
    text-transform: uppercase; font-family: 'Cinzel', serif;
}
select, button {
    background: rgba(0, 0, 0, 0.5); color: #f0f0f0;
    border: 2px solid #c0a87a; border-radius: 8px;
    padding: 10px 15px; font-size: 1rem; cursor: pointer;
    transition: all 0.3s ease; font-family: 'Cormorant Garamond', serif;
}
button {
    background: linear-gradient(45deg, #c0a87a, #e6c88e);
    color: #1e0c3a; font-weight: bold; text-transform: uppercase;
    letter-spacing: 1px; position: relative; overflow: hidden;
    border: none; box-shadow: 0 5px 15px rgba(192, 168, 122, 0.4);
}
button:before {
    content: ''; position: absolute; top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}
button:hover:before { left: 100%; }
button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(192, 168, 122, 0.6);
}
button:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }
.deck-area {
    text-align: center; margin: 40px 0; display: flex;
    flex-direction: column; justify-content: center; align-items: center;
    padding-bottom: 30px;
}
.deck-wrapper {
    position: relative; width: 120px; height: 180px;
    perspective: 1000px; margin-bottom: 15px;
}
#shuffling-container, .deck {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
}
.shuffling-container { transform-style: preserve-3d; }
.shuffling-card {
    position: absolute; width: 120px; height: 180px;
    background: linear-gradient(135deg, #1e0c3a, #2d1b69);
    border-radius: 12px; border: 3px solid #c0a87a;
    transition: transform 1s, opacity 1s;
    backface-visibility: hidden;
}
.deck { cursor: pointer; transition: transform 0.3s ease; }
.deck:hover { transform: scale(1.05); }
.card-back {
    position: absolute; width: 120px; height: 180px;
    background: linear-gradient(135deg, #1e0c3a, #2d1b69);
    border-radius: 12px; border: 3px solid #c0a87a;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; transition: all 0.5s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
.card-back::after {
    content: '🔮'; font-size: 3rem; opacity: 0.8;
    text-shadow: 0 0 10px #e6c88e;
}
.deck .card-back:nth-child(1) { transform: rotate(-2deg) translate(2px, -2px); }
.deck .card-back:nth-child(2) { transform: rotate(1deg) translate(-1px, 1px); }
.deck .card-back:nth-child(3) { transform: rotate(-1deg) translate(1px, -1px); }
.reading-area {
    min-height: 220px; margin-top: 20px;
    animation: fadeIn 1s ease-out;
}
@keyframes fadeIn { 0% { opacity: 0; } 100% { opacity: 1; } }
.spread-container {
    display: flex; flex-wrap: wrap;
    justify-content: center; gap: 20px; margin-top: 40px;
}
.card {
    width: 120px; height: 180px;
    background: linear-gradient(135deg, #f8f8f8, #e8e8e8);
    border-radius: 12px; border: 3px solid #c0a87a;
    position: relative; cursor: pointer; transition: all 0.5s ease;
    transform-style: preserve-3d;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}
.card.flipping { animation: flip 1s ease-in-out forwards; }
@keyframes flip {
    0% { transform: rotateY(180deg); }
    100% { transform: rotateY(0deg); }
}
.card.revealed { transform: rotateY(0deg); }
.card.inverted { transform: rotateY(0deg) rotate(180deg); }
.card.revealed.inverted { transform: rotateY(0deg) rotate(180deg); }
.card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 35px rgba(192, 168, 122, 0.5);
}
.card-content {
    padding: 10px; height: 100%; display: flex; flex-direction: column;
    justify-content: space-between; text-align: center; color: #2c1810;
    font-weight: bold; background: linear-gradient(135deg, #fff, #f0f0f0);
    border-radius: 9px; position: relative;
}
.card-name {
    font-size: 0.8rem; margin-bottom: 5px;
    color: #8b4513; line-height: 1.1;
}
.card-symbol { font-size: 2.8rem; margin: 5px 0; }
.card-orientation { font-size: 0.75rem; color: #666; font-style: italic; }
.card-position {
    position: absolute; top: -30px; left: 50%;
    transform: translateX(-50%); background: #c0a87a; color: #1e0c3a;
    padding: 5px 12px; border-radius: 15px; font-size: 0.8rem;
    font-weight: bold; white-space: nowrap;
}
.results {
    background: rgba(16, 8, 32, 0.4); backdrop-filter: blur(10px);
    border-radius: 20px; padding: 30px; margin: 40px 0;
    border: 2px solid #c0a87a;
    box-shadow: 0 0 20px rgba(192, 168, 122, 0.2);
    animation: slideInUp 0.8s ease-out;
}
@keyframes slideInUp {
    0% { opacity: 0; transform: translateY(50px); }
    100% { opacity: 1; transform: translateY(0); }
}
.results h2 {
    font-family: 'Cinzel', serif; color: #e6c88e; text-align: center;
    margin-bottom: 20px; font-size: 1.8rem;
}
.result-item {
    margin: 15px 0; padding: 15px; background: rgba(0, 0, 0, 0.2);
    border-radius: 10px; border-left: 4px solid #e6c88e;
}
.result-item h3 { color: #e6c88e; margin-bottom: 5px; }
.result-item h4 { color: #f0f0f0; margin-bottom: 10px; }
.result-item p { color: #e0e0e0; font-style: italic; }
.export-btn {
    background: linear-gradient(45deg, #6c4675, #9c6c94); color: #fff;
}
.loading {
    display: inline-block; width: 20px; height: 20px;
    border: 3px solid rgba(255,255,255,0.3); border-radius: 50%;
    border-top-color: #fff; animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.mystical-particles {
    position: absolute; width: 100%; height: 100%;
    pointer-events: none; overflow: hidden;
}
.particle {
    position: absolute; width: 4px; height: 4px;
    background: radial-gradient(circle, #e6c88e, #c0a87a);
    border-radius: 50%; box-shadow: 0 0 5px #e6c88e;
    animation: float 5s infinite ease-in-out; opacity: 0.7;
}
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.7; }
    50% { transform: translateY(-50px) rotate(180deg); opacity: 0.9; }
}
.music-controls {
    position: fixed; top: 20px; right: 20px; z-index: 100;
}
.music-controls button {
    background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.4); color: #fff;
    font-size: 1rem; padding: 8px 12px; border-radius: 50px;
    cursor: pointer; transition: all 0.3s ease;
}
.music-controls button:hover { background: rgba(255, 255, 255, 0.2); }
.privacy-button {
    position: fixed; bottom: 20px; left: 20px; z-index: 999;
    background: rgba(16, 8, 32, 0.6); backdrop-filter: blur(10px);
    border: 1px solid #c0a87a; color: #e6c88e; width: 45px;
    height: 45px; border-radius: 50%; display: flex;
    justify-content: center; align-items: center; cursor: pointer;
    font-size: 1.5rem; transition: all 0.3s ease;
}
.privacy-button:hover {
    background: rgba(30, 12, 58, 0.8); transform: scale(1.1);
}
.cookie-banner {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: rgba(10, 5, 25, 0.9); backdrop-filter: blur(10px);
    padding: 20px; z-index: 1000; display: flex;
    justify-content: center; align-items: center; flex-wrap: wrap;
    gap: 15px; border-top: 1px solid rgba(192, 168, 122, 0.5);
    transform: translateY(100%); animation: slideUpBanner 0.5s ease-out forwards;
}
@keyframes slideUpBanner { to { transform: translateY(0); } }
.cookie-banner p {
    margin: 0; flex-grow: 1; text-align: center; color: #e0e0e0;
}
.cookie-banner p a { color: #e6c88e; text-decoration: underline; }
.cookie-banner .cookie-buttons { display: flex; gap: 10px; }
.cookie-banner button { padding: 8px 16px; border-radius: 5px; }
#cookie-accept {
    background: #c0a87a; color: #1e0c3a; border-color: #c0a87a;
}
#cookie-decline {
    background: transparent; color: #f0f0f0; border-color: #f0f0f0;
}
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px);
    z-index: 1001; display: none; justify-content: center;
    align-items: center;
}
.modal-content {
    background: #1e0c3a; padding: 30px; border-radius: 15px;
    border: 2px solid #c0a87a; max-width: 600px; width: 90%;
    max-height: 80vh; overflow-y: auto; position: relative;
}
.modal-content h2 { color: #e6c88e; margin-bottom: 15px; }
.modal-content p, .modal-content ul { margin-bottom: 15px; line-height: 1.6; }
.modal-content ul { padding-left: 20px; }
.modal-close {
    position: absolute; top: 15px; right: 15px; background: none;
    border: none; color: #fff; font-size: 1.5rem; cursor: pointer;
}
@keyframes spin-and-return {
    0% { transform: rotateY(0deg) scale(1); }
    50% { transform: rotateY(360deg) scale(1.05); }
    100% { transform: rotateY(720deg) scale(1); }
}
.card.spinning { animation: spin-and-return 1s ease-in-out; }
.card.card--major-arcana .card-content {
    background: radial-gradient(circle, #001d57 0%, #000814 100%);
    color: #f0f0f0; position: relative; overflow: hidden; 
}
.card.card--major-arcana .card-name {
    color: #e6c88e; font-family: 'Cinzel', serif;
}
.card.card--major-arcana .card-symbol {
    color: #e6c88e;
    text-shadow: 0 0 10px #e6c88e, 0 0 20px #e6c88e, 0 0 30px #e6c88e;
}
.card.card--major-arcana .card-orientation { color: #f0e6d2; }
.card.card--major-arcana .card-content::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient( 115deg, transparent 20%,
        rgba(193, 222, 255, 0.4) 46%, rgba(255, 187, 220, 0.4) 50%,
        rgba(215, 255, 201, 0.4) 54%, transparent 80% );
    background-repeat: no-repeat; background-size: 250% 250%;
    opacity: 0.5; transition: opacity 0.4s ease-in-out;
    pointer-events: none; animation: foil-shimmer 2.5s ease-in-out infinite;
}
@keyframes foil-shimmer {
    0% { background-position: 150% 150%; }
    100% { background-position: -50% -50%; }
}
.card.card--major-arcana:hover .card-content::after { opacity: 0.8; }

/* --- ESTILOS PARA EL MENÚ RESPONSIVE --- */
.main-nav {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 101;
}
#hamburger-btn {
    background: rgba(16, 8, 32, 0.6); backdrop-filter: blur(10px);
    border: 1px solid #c0a87a; color: #e6c88e; width: 45px;
    height: 45px; border-radius: 50%; cursor: pointer;
    font-size: 1.5rem; display: flex; justify-content: center;
    align-items: center; transition: all 0.3s ease;
}
#hamburger-btn:hover { transform: scale(1.1); }
#nav-links {
    display: none; position: absolute; top: 60px; left: 0;
    background: rgba(16, 8, 32, 0.9); backdrop-filter: blur(10px);
    border-radius: 15px; border: 1px solid #c0a87a;
    flex-direction: column; padding: 15px; gap: 10px;
    animation: fadeInDown 0.3s ease-out;
}
#nav-links.open { display: flex; }
#nav-links a {
    color: #e6c88e; text-decoration: none; font-family: 'Cinzel', serif;
    padding: 8px; text-align: center; border-radius: 8px;
    transition: all 0.3s ease;
}
#nav-links a:hover { background-color: rgba(192, 168, 122, 0.2); }

/* Media Queries para responsividad */
@media (max-width: 820px) {
    .music-controls { top: 20px; right: 20px; }
    .header h1 { font-size: 2.5rem; }
    .controls { flex-direction: column; align-items: center; }
    .card { width: 100px; height: 150px; }
    .spread-container { gap: 15px; }
    .card-symbol { font-size: 2rem; }
    .ogre-area { flex-direction: column; }
    .speech-bubble::after {
        top: auto; content: ''; position: absolute;
        bottom: 100%; left: 50%; margin-left: -20px;
        width: 0; height: 0; border: 20px solid transparent;
        border-bottom-color: #c0a87a;
    }
    .cookie-banner { flex-direction: column; }
}

@media (min-width: 821px) {
    #hamburger-btn { display: none; }
    .main-nav {
        left: 50%; transform: translateX(-50%);
        background: rgba(16, 8, 32, 0.6); backdrop-filter: blur(10px);
        padding: 10px 20px; border-radius: 50px;
        border: 1px solid #c0a87a;
    }
    #nav-links {
        display: flex; position: static; flex-direction: row;
        background: none; border: none; padding: 0;
        gap: 20px; animation: none;
    }
}

/* --- Estilos para el contenido estático de AdSense --- */
.static-content {
    background: rgba(16, 8, 32, 0.2);
    border-top: 1px solid #c0a87a;
    padding: 25px;
    margin: 40px auto;
    border-radius: 15px;
    max-width: 90%;
}

.static-content h2, .static-content h3 {
    font-family: 'Cinzel', serif;
    color: #e6c88e;
    text-align: center;
    margin-bottom: 15px;
}

.static-content p, .static-content li {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 15px;
    color: #e0e0e0;
}

.static-content ol {
    list-style-position: inside;
    padding-left: 20px;
}

.static-content ol li::marker {
    font-weight: bold;
    color: #e6c88e;
}
/* Estilos para compartir en redes sociales */
.share-btn {
    background: linear-gradient(45deg, #4a90e2, #64b5f6);
    color: #fff;
}

.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

.share-modal-content {
    background: rgba(16, 8, 32, 0.95);
    border: 2px solid #c0a87a;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.share-modal-content h2 {
    font-family: 'Cinzel', serif;
    color: #e6c88e;
    margin-bottom: 20px;
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.social-btn.twitter {
    background: linear-gradient(45deg, #1DA1F2, #0d8bd9);
}

.social-btn.facebook {
    background: linear-gradient(45deg, #1877f2, #145dbf);
}

.social-btn.whatsapp {
    background: linear-gradient(45deg, #25D366, #1da851);
}

.social-btn.telegram {
    background: linear-gradient(45deg, #0088cc, #006699);
}

.social-btn.copy {
    background: linear-gradient(45deg, #6c4675, #9c6c94);
}

.close-share-modal {
    margin-top: 20px;
    background: transparent;
    border: 1px solid #c0a87a;
    color: #e6c88e;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-share-modal:hover {
    background: rgba(192, 168, 122, 0.2);
}

@media (max-width: 600px) {
    .share-modal-content {
        padding: 20px;
    }
    
    .social-btn {
        font-size: 0.9rem;
        padding: 10px 15px;
    }
}

.social-btn.native {
    background: linear-gradient(45deg, #7c3aed, #a855f7);
}

.social-btn.download {
    background: linear-gradient(45deg, #10b981, #059669);
}

.download-message {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    animation: fadeIn 0.5s ease-out;
}

.download-message p {
    color: #10b981;
    margin: 0;
    font-weight: bold;
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}
/* Estilos para la pregunta del usuario */
.question-container {
    margin-bottom: 20px;
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

#userQuestion {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: 2px solid #4a90e2; /* Azul ogro */
    background: rgba(30, 12, 58, 0.8); /* Fondo oscuro */
    color: #fff;
    font-family: inherit; /* Usa tu fuente actual */
    font-size: 1.1rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    outline: none;
    transition: all 0.3s ease;
}

#userQuestion::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#userQuestion:focus {
    border-color: #a0c4ff;
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.4);
    transform: scale(1.02);
}

