/* --- ESTILOS GLOBALES Y DE FONDO --- */
:root {
    --shadow-deep: 0 10px 30px rgba(0, 0, 0, 0.5);
    --primary-color: #03a9f4; /* Azul para Amigos */
    --danger-color: #EF4444;
    --text-dark: #1e293b;
    --text-medium: #475569;
    --text-light: #94a3b8;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    color: #fff;
    overflow-y: auto;
    background-color: #111827;
    user-select: none;
}

.background-container {
    position: fixed;
    top: -5%; left: -5%; width: 110%; height: 110%;
    z-index: -1;
    background-size: cover;
    animation: ken-burns 30s infinite alternate;
}

@keyframes ken-burns {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.main {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 1rem;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

/* --- ANIMACIÓN DE CARGA --- */
.loading-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none; flex-direction: column; justify-content: center; align-items: center;
    z-index: 100; backdrop-filter: blur(8px);
}
.shuffle-animation-container {
    position: relative; width: 70vw; max-width: 300px;
    aspect-ratio: 7 / 10; margin: 1rem auto;
}
.card-shuffle {
    position: absolute; width: 100%; height: 100%; border-radius: 15px;
    box-shadow: var(--shadow-deep); background-size: cover; background-position: center;
}
.loading-container .card-1 { animation: shuffle-1 2.5s ease-in-out; background-image: url('../images/amigos/RetoNew.webp'); }
.loading-container .card-2 { animation: shuffle-2 2.5s ease-in-out; background-image: url('../images/amigos/SecretoNew.webp'); }
.loading-container .card-3 { animation: shuffle-3 2.5s ease-in-out; background-image: url('../images/amigos/ConfesionNew.webp'); }
.shuffling-text { margin-top: 2rem; font-size: 1.5rem; color: #fff; letter-spacing: 1px; }
@keyframes shuffle-1 { 0%, 100% { transform: translate(0, 0) rotate(-8deg); } 25% { transform: translate(-40vw, -10vh) rotate(-25deg); } 50% { transform: translate(40vw, 10vh) rotate(25deg); } 75% { transform: translate(0, 0) rotate(0); } }
@keyframes shuffle-2 { 0%, 100% { transform: translate(0, 0) rotate(2deg); } 25% { transform: translate(35vw, -8vh) rotate(20deg); } 50% { transform: translate(-35vw, 8vh) rotate(-20deg); } 75% { transform: translate(0, 0) rotate(0); } }
@keyframes shuffle-3 { 0%, 100% { transform: translate(0, 0) rotate(10deg); } 25% { transform: translate(-30vw, 12vh) rotate(-15deg); } 50% { transform: translate(30vw, -12vh) rotate(15deg); } 75% { transform: translate(0, 0) rotate(0); } }

/* --- CONTENEDOR DEL JUEGO --- */
.game-container {
    display: none; flex-direction: column; justify-content: center;
    align-items: center; width: 100%; max-width: 400px;
    text-align: center; position: relative;
    padding-top: 3rem;
}

.game-board {
    position: relative; width: 70vw; max-width: 300px;
    aspect-ratio: 7 / 10;
    margin: 0.5rem auto 1rem auto;
    perspective: 1500px;
}
.card-inner {
    position: relative; width: 100%; height: 100%;
    transition: transform 0.8s cubic-bezier(0.6, 0.02, 0.4, 1);
    transform-style: preserve-3d;
}
.card-inner.is-flipped { transform: rotateY(180deg); }
.card-face {
    position: absolute; width: 100%; height: 100%;
    backface-visibility: hidden; border-radius: 20px;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; padding: 20px; box-sizing: border-box;
    background-size: cover; background-position: center;
    box-shadow: var(--shadow-deep);
}
.card-back { background-image: url('../images/amigos/LindaNew.webp'); }
.card-front { transform: rotateY(180deg); background-color: rgba(0, 0, 0, 0.3); }
.content-wrapper { background-color: rgba(0, 0, 0, 0.6); padding: 15px; border-radius: 10px; backdrop-filter: blur(4px); }
.card-icon { font-size: clamp(2rem, 8vw, 3rem); margin-bottom: 1rem; text-shadow: 0 0 10px rgba(0,0,0,0.5); }
.card-text { font-size: clamp(1rem, 4vw, 1.5rem); font-weight: 600; text-shadow: 0 2px 8px rgba(0,0,0,0.7); }

.top-right-icons {
    position: fixed; top: 20px; right: 20px;
    display: flex; flex-direction: column; gap: 15px; z-index: 100;
}
.btn-icon {
    font-size: 2.5rem; color: var(--primary-color); cursor: pointer;
    background: none; border: none; padding: 0; margin: 0;
    transition: transform 0.2s ease, color 0.3s;
}
.btn-icon:hover { transform: scale(1.15); }

/* --- INDICADOR DE DEMO --- */
.timer-section {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 5;
    white-space: nowrap;
}
.timer-section .fa-duotone { font-size: 1.4em; color: var(--primary-color); }

/* --- BOTONES --- */
.section-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    margin-top: 1rem;
    width: 70vw;
    max-width: 300px;
}
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    transition: all 250ms ease;
    text-decoration: none;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.3); }
.btn:disabled { cursor: not-allowed; opacity: 0.6; transform: none; }
.btn-success { background-image: linear-gradient(135deg, rgba(3, 169, 244, 0.85), rgba(0, 131, 194, 0.85)); }
.btn-danger { background-image: linear-gradient(135deg, rgba(239, 68, 68, 0.85), rgba(185, 28, 28, 0.85)); }
.btn-primary { background-image: linear-gradient(135deg, #007bff, #0069d9); border: none; }

/* --- MODALES GENERALES --- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); display: none; justify-content: center; align-items: center; z-index: 200; padding: 1rem; box-sizing: border-box; }
.modal-content { background: #1a1a1a; border: 1px solid #444; border-radius: 15px; padding: 2rem; width: 100%; max-width: 500px; text-align: center; position: relative; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); max-height: 85vh; overflow-y: auto; box-sizing: border-box; }
.btn-close-modal { position: absolute; top: 10px; right: 15px; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; z-index: 10; }
.animate-fade-in { animation: fadeIn 0.8s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- MODAL DE INSTRUCCIONES (ESTILO COMPRA) --- */
#instructions-modal .modal-content {
    background-color: var(--bg-white) !important;
    color: var(--text-dark) !important;
    border: none !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    padding: 0 !important;
    overflow: hidden;
    display: block !important;
}

#instructions-modal .modal-container {
    width: 100%;
    max-width: 100%;
    padding: 2rem;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: 90vh;
}

#instructions-modal .btn-close-modal { color: var(--text-light) !important; top: 1rem; right: 1rem; z-index: 20; }
#instructions-modal .btn-close-modal:hover { color: var(--danger-color) !important; }

#instructions-modal h2 {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    color: var(--text-dark) !important; font-weight: 700; font-size: 1.5rem;
    margin-top: 0; margin-bottom: 1.5rem;
}

#instructions-modal .instructions-text {
    text-align: left;
    color: var(--text-medium) !important;
}

#instructions-modal .instructions-text p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

#instructions-modal .instructions-text .fa-duotone {
    color: var(--primary-color);
    margin-right: 8px;
}

/* --- Verificación de Edad --- */
.age-verification {
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.age-verification label {
    color: var(--text-medium);
    font-size: 0.9rem;
    cursor: pointer;
}
.age-verification input[type="checkbox"] {
    accent-color: var(--primary-color);
    width: 18px;
    height: 18px;
    cursor: pointer;
}
#play-button {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
}


/* --- MODAL DE FIN DE DEMO --- */
.demo-end-content .icon-container {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}
.demo-end-content h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #fff;
}
.demo-end-content p {
    font-size: 1rem;
    color: #ccc;
    margin-bottom: 1.5rem;
}
.demo-end-content .btn-success {
    width: 100%;
    margin: 1rem auto 0 auto;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    background-image: linear-gradient(135deg, rgba(3, 169, 244, 0.85), rgba(0, 131, 194, 0.85));
}
.demo-end-content .btn-success i {
    font-size: 1.3em;
}

/* --- MODAL DE COMPRA (TEMA BLANCO PROFESIONAL) --- */
#purchase-modal .modal-content {
    background-color: var(--bg-white) !important;
    color: var(--text-dark) !important;
    border: none !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    padding: 0 !important;
    overflow: hidden;
    display: block !important;
}

#purchase-modal .modal-container {
    width: 100%;
    max-width: 100%;
    padding: 2rem;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: 90vh;
}

#purchase-modal .btn-close-modal { color: var(--text-light) !important; top: 1rem; right: 1rem; z-index: 20; }
#purchase-modal .btn-close-modal:hover { color: var(--danger-color) !important; }

#purchase-modal h2 {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    color: var(--text-dark) !important; font-weight: 700; font-size: 1.5rem;
    margin-top: 0; margin-bottom: 1.5rem;
}

#purchase-modal .product-showcase {
    background-color: var(--bg-light) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
}

#purchase-modal .product-header-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; }
#purchase-modal .product-img-thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border-color); box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
#purchase-modal .product-title-info { flex: 1; }
#purchase-modal .product-title-info h3 { font-size: 1.25rem; font-weight: 700; margin: 0 0 0.25rem 0; color: var(--text-dark) !important; }
#purchase-modal .product-desc { font-size: 0.9rem; color: var(--text-medium) !important; margin: 0; font-weight: 500; line-height: 1.4; }

#purchase-modal .product-benefits { margin-bottom: 1rem; }
#purchase-modal .product-benefits ul { list-style: none; padding: 0; margin: 0; }
#purchase-modal .product-benefits li { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; color: var(--text-medium) !important; font-size: 0.9rem; font-weight: 500; }
#purchase-modal .product-benefits .fa-duotone { color: var(--primary-color); font-size: 1.1em; }

#purchase-modal .product-pricing-highlight { display: flex; align-items: baseline; justify-content: flex-end; gap: 1rem; margin-top: 0.5rem; }
#purchase-modal .product-pricing-highlight .price-old { font-size: 1.1rem; text-decoration: line-through; color: var(--text-light) !important; font-weight: 500; }
#purchase-modal .product-pricing-highlight .price-new { font-size: 1.8rem; font-weight: 800; color: var(--danger-color) !important; line-height: 1; }

#purchase-form-inner { width: 100%; }
#purchase-modal .input-group { margin-bottom: 1rem; width: 100%; text-align: left; }
#purchase-modal .input-group label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; margin-bottom: 0.5rem; color: var(--text-medium) !important; font-weight: 600; }
#purchase-modal .input-group input { width: 100%; padding: 0.85rem; border-radius: 8px; background: var(--bg-white) !important; border: 1px solid var(--border-color) !important; color: var(--text-dark) !important; font-size: 1rem; font-weight: 500; box-sizing: border-box; transition: all 0.2s; }
#purchase-modal .input-group input:focus { border-color: var(--primary-color) !important; box-shadow: 0 0 0 3px rgba(3, 169, 244, 0.15); outline: none; }

#purchase-modal #upsell-container { display: flex; align-items: center; background: var(--bg-light) !important; padding: 0.8rem; border-radius: 10px; margin-bottom: 1.5rem; cursor: pointer; border: 1px solid var(--border-color) !important; transition: all 0.2s; }
#purchase-modal #upsell-container:hover { border-color: var(--primary-color) !important; background: #e3f2fd !important; }
#purchase-modal #upsell-container input[type="checkbox"] { display: none; }
#purchase-modal #upsell-container img { width: 48px; height: 48px; margin-right: 1rem; border-radius: 6px; }
#purchase-modal #upsell-container label { display: flex; flex-direction: column; cursor: pointer; color: var(--text-medium) !important; font-size: 0.9rem; font-weight: 500; text-align: left; }
#purchase-modal #upsell-container label .font-semibold { color: var(--primary-color) !important; font-weight: 700; text-transform: uppercase; font-size: 0.8rem; margin-bottom: 2px; }

#purchase-modal .order-summary { background: var(--bg-light) !important; padding: 1rem; border-radius: 10px; margin-top: 1rem; width: 100%; box-sizing: border-box; border: 1px solid var(--border-color) !important; }
#purchase-modal .order-summary h4 { font-size: 1rem; text-align: left; margin: 0 0 0.8rem 0; border-bottom: 1px solid var(--border-color) !important; padding-bottom: 0.5rem; color: var(--text-dark) !important; font-weight: 700; }
#purchase-modal .order-summary .flex { display: flex; justify-content: space-between; margin-bottom: 0.5rem; color: var(--text-medium) !important; font-size: 0.95rem; font-weight: 500; }
#purchase-modal .order-summary .border-t { border-top: 1px solid var(--border-color) !important; padding-top: 0.8rem; margin-top: 0.8rem; }
#purchase-modal .order-summary .text-primary { color: var(--primary-color) !important; font-size: 1.2rem; }

#purchase-modal .submit-button {
    width: 100% !important;
    margin-top: 1.5rem;
    background-image: linear-gradient(135deg, #25D366, #128C7E);
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    box-sizing: border-box;
}
#purchase-modal .submit-button i { font-size: 1.3em; }
#purchase-modal .submit-button:hover { box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5); transform: translateY(-2px); }


/* --- MODAL DE ÉXITO --- */
.success-content .btn-primary {
    width: 100%;
    max-width: 100% !important;
    margin-top: 1.5rem;
    background-image: linear-gradient(135deg, #EF4444, #B91C1C) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}
.success-content .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

@keyframes popIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
