/* ============================================================
   🌌 SUPRA ORÁCULO — PREMIUM MOBILE v3.8
   Vanguardia · Ultra Premium · Mobile-first · Justificado y alineado
   - 20 oráculos con tipografía premium uniforme
   - Justificación profesional de todos los textos
   - Quiromancia ultra-rediseñada (mobile-first)
   - Accordion cards estructuradas y limpias
   ============================================================ */

/* ===== 0) GLOBAL TYPOGRAPHY RESET — Premium baseline ===== */
.tab-content,
.tab-content p,
.tab-content li,
.tab-content td,
.tab-content .glass-card,
.tab-content .accordion-card {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* ===== 1) JUSTIFICATION + ALIGNMENT — All 20 oracles ===== */
.tab-content p,
.tab-content .palm-reading-desc,
.tab-content .op-section-desc,
.tab-content .op-premium-card p,
.tab-content .op-premium-card li,
.tab-content .accordion-content p,
.tab-content .glass-card p:not(.center):not(.text-center) {
    text-align: justify !important;
    text-justify: inter-word;
    line-height: 1.75;
    letter-spacing: 0.015em;
    color: #e8e4f5;
    font-size: 0.96rem;
    margin: 0 0 14px;
}

.tab-content h1,
.tab-content h2,
.tab-content h3,
.tab-content h4,
.tab-content .accordion-header-left h3,
.tab-content .op-section-title {
    text-align: left;
    line-height: 1.35;
    letter-spacing: 0.02em;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: none;
    -webkit-hyphens: none;
}

.tab-content ul,
.tab-content ol {
    padding-left: 22px;
    margin: 0 0 16px;
}

.tab-content li {
    text-align: justify;
    line-height: 1.7;
    margin-bottom: 8px;
    color: #e8e4f5;
}

/* Tables — premium readability */
.tab-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 0.88rem;
}
.tab-content table th,
.tab-content table td {
    padding: 10px 12px;
    text-align: left;
    line-height: 1.55;
    vertical-align: top;
    border-bottom: 1px solid rgba(124, 106, 239, 0.12);
}
.tab-content table th {
    color: #f0b429;
    font-weight: 700;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.05em;
    background: rgba(240, 180, 41, 0.04);
}

/* Accordion content — uniform padding */
.tab-content .accordion-content,
.tab-content .accordion-card .accordion-content {
    padding: 16px 18px 20px;
}

/* ===== 2) OVERVIEW (RESUMEN) — premium grid ===== */
.overview-grid,
#overviewGrid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 4px 2px;
}

.overview-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 18px 12px 16px;
    border-radius: 18px;
    background: linear-gradient(155deg, rgba(28, 20, 65, 0.78), rgba(14, 10, 38, 0.82));
    border: 1.5px solid rgba(124, 106, 239, 0.22);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    min-height: 140px;
    overflow: hidden;
}

.overview-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(240, 180, 41, 0.08), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.overview-card:hover,
.overview-card:active {
    transform: translateY(-3px);
    border-color: rgba(240, 180, 41, 0.45);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 18px rgba(240, 180, 41, 0.18);
}

.overview-card:hover::before { opacity: 1; }

.overview-card .overview-icon {
    font-size: 2.1rem;
    line-height: 1;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 8px rgba(124, 106, 239, 0.35));
}

.overview-card .overview-title {
    font-family: 'Cinzel', serif;
    color: #f0b429;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.25;
    margin-bottom: 6px;
    text-transform: uppercase;
    text-align: center;
}

.overview-card .overview-value {
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
    word-break: break-word;
}

.overview-card .overview-sub {
    color: rgba(232, 228, 245, 0.6);
    font-size: 0.72rem;
    line-height: 1.35;
    letter-spacing: 0.02em;
}

/* ===== Acierto badge — only on consulted oracles ===== */
.overview-consulted {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 900;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.55), 0 0 0 2px rgba(255, 255, 255, 0.15);
    z-index: 3;
    animation: overviewCheckIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes overviewCheckIn {
    0%   { transform: scale(0) rotate(-90deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.overview-card-done {
    border-color: rgba(34, 197, 94, 0.4);
    background: linear-gradient(155deg, rgba(28, 50, 35, 0.82), rgba(14, 28, 22, 0.86));
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.32), 0 0 18px rgba(34, 197, 94, 0.12), inset 0 1px 0 rgba(34, 197, 94, 0.12);
}

.overview-card-done .overview-title {
    color: #4ade80;
}

/* CRITICAL: NON-consulted oracles must NOT show ✓ — even if data exists */
.overview-card:not(.overview-card-done) .overview-consulted {
    display: none !important;
}

/* Locked premium cards */
.overview-locked-card {
    border-color: rgba(148, 163, 184, 0.25) !important;
    background: linear-gradient(155deg, rgba(20, 18, 38, 0.88), rgba(10, 8, 22, 0.92)) !important;
    opacity: 0.78;
    cursor: not-allowed;
}
.overview-locked-card .overview-icon { filter: grayscale(0.6) opacity(0.6); }
.overview-locked-card .overview-title { color: rgba(232, 228, 245, 0.5); }

.overview-lock-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1rem;
    color: rgba(232, 228, 245, 0.65);
    background: rgba(0, 0, 0, 0.5);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

/* ===== 3) PREMIUM CARDS — uniform padding & justification ===== */
.op-premium-card,
.glass-card,
.accordion-card {
    border-radius: 18px;
    padding: 18px 18px 20px;
    margin-bottom: 14px;
    background: linear-gradient(155deg, rgba(28, 20, 65, 0.72), rgba(14, 10, 38, 0.78));
    border: 1px solid rgba(124, 106, 239, 0.20);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

.op-premium-card h3,
.op-premium-card h4,
.glass-card h3,
.accordion-card h3 {
    color: #f0b429;
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
    line-height: 1.35;
}

.op-premium-card p,
.glass-card p {
    text-align: justify !important;
    line-height: 1.75 !important;
    color: #e8e4f5;
    font-size: 0.94rem;
    margin: 0 0 12px;
}

.op-section-title {
    font-family: 'Cinzel', serif;
    color: #f0b429;
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    margin: 18px 0 12px;
    line-height: 1.3;
}

.op-section-desc {
    text-align: justify;
    color: #e8e4f5;
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: 14px;
}

/* ===== 4) PALMISTRY (QUIROMANCIA) — ULTRA PREMIUM REDESIGN ===== */
#tab-palmistry {
    padding: 0 4px;
}

#tab-palmistry .accordion-card {
    border-radius: 22px;
    padding: 20px 18px 22px;
    margin-bottom: 16px;
    background: linear-gradient(165deg, rgba(28, 20, 65, 0.82), rgba(14, 10, 38, 0.88));
    border: 1.5px solid rgba(124, 106, 239, 0.28);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    position: relative;
}

#tab-palmistry .accordion-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #f0b429, #7c6aef, transparent);
    opacity: 0.6;
}

#tab-palmistry .accordion-header-left h3 {
    font-family: 'Cinzel', serif;
    color: #f0b429;
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1.3;
    text-shadow: 0 2px 12px rgba(240, 180, 41, 0.3);
}

#tab-palmistry .accordion-header-left .card-icon {
    font-size: 1.7rem;
    margin-right: 10px;
    filter: drop-shadow(0 4px 10px rgba(240, 180, 41, 0.4));
}

#tab-palmistry p,
#tab-palmistry .palm-reading-desc {
    text-align: justify !important;
    text-justify: inter-word;
    line-height: 1.78;
    letter-spacing: 0.012em;
    color: #e8e4f5;
    font-size: 0.95rem;
    margin: 0 0 14px;
}

#tab-palmistry strong {
    color: #f0b429;
    font-weight: 700;
}

#tab-palmistry em {
    color: #c4b5fd;
    font-style: italic;
}

/* Palm capture grid — single column on mobile, two on desktop */
.palm-capture-grid,
.palm-capture-grid-optional {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 16px 0;
}

@media (min-width: 900px) {
    .palm-capture-grid,
    .palm-capture-grid-optional {
        grid-template-columns: 1fr 1fr;
    }
}

.palm-capture-card {
    border-radius: 20px;
    padding: 20px 18px;
    background: linear-gradient(155deg, rgba(34, 25, 80, 0.6), rgba(18, 14, 45, 0.7));
    border: 2px solid rgba(124, 106, 239, 0.35);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.palm-capture-card.active {
    border-color: rgba(34, 211, 238, 0.6);
    box-shadow: 0 8px 28px rgba(34, 211, 238, 0.22), 0 0 0 3px rgba(34, 211, 238, 0.1);
    background: linear-gradient(155deg, rgba(20, 38, 60, 0.7), rgba(14, 22, 38, 0.78));
}

.palm-capture-card.done {
    border-color: rgba(34, 197, 94, 0.55);
    box-shadow: 0 8px 28px rgba(34, 197, 94, 0.2);
}

.palm-capture-step {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #22d3ee;
    margin-bottom: 10px;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(34, 211, 238, 0.1);
    display: inline-block;
}

.palm-capture-card:nth-child(2) .palm-capture-step {
    color: #f0b429;
    background: rgba(240, 180, 41, 0.1);
}

.palm-capture-card .card-icon-large,
.palm-capture-card .palm-icon {
    font-size: 3rem;
    line-height: 1;
    margin: 8px 0 10px;
    filter: drop-shadow(0 4px 12px rgba(240, 180, 41, 0.35));
    display: block;
}

.palm-capture-card h4,
.palm-capture-card h3 {
    font-family: 'Cinzel', serif;
    color: #f0b429;
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin: 6px 0 8px;
    line-height: 1.3;
    text-align: center;
}

.palm-capture-card .palm-hint,
.palm-capture-card p {
    text-align: center !important;
    color: rgba(232, 228, 245, 0.78);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 14px;
}

/* Palm capture buttons — large, accessible, mobile-friendly */
.palm-capture-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 20px;
    margin-bottom: 10px;
    border-radius: 14px;
    border: 2px solid rgba(240, 180, 41, 0.4);
    background: linear-gradient(135deg, rgba(240, 180, 41, 0.15), rgba(124, 106, 239, 0.1));
    color: #fde68a;
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.25s ease;
    min-height: 60px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.palm-capture-btn:hover,
.palm-capture-btn:active {
    background: linear-gradient(135deg, rgba(240, 180, 41, 0.28), rgba(124, 106, 239, 0.18));
    border-color: rgba(240, 180, 41, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(240, 180, 41, 0.25);
    color: #ffffff;
}

.palm-capture-btn i {
    font-size: 1.3rem;
}

/* Palm preview — image preview after upload */
.palm-preview {
    margin-top: 12px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    min-height: 80px;
}

.palm-preview img {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

/* Palm tips bar */
.palm-tips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px;
    margin: 14px 0;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(240, 180, 41, 0.06), rgba(124, 106, 239, 0.04));
    border: 1px solid rgba(240, 180, 41, 0.18);
}

.palm-tips .tip {
    flex: 1 1 calc(50% - 4px);
    font-size: 0.78rem;
    color: #e8e4f5;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    text-align: left;
    line-height: 1.4;
}

@media (min-width: 600px) {
    .palm-tips .tip {
        flex: 1 1 calc(33.33% - 6px);
    }
}

/* Analyze button — sticky, hero CTA */
#analyzePalmBtn,
.btn-analyze-palm {
    display: block;
    width: 100%;
    padding: 22px 24px;
    margin: 18px 0;
    border-radius: 16px;
    border: 2px solid rgba(240, 180, 41, 0.5);
    background: linear-gradient(135deg, #f0b429, #e5a820);
    color: #1a1538;
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 32px rgba(240, 180, 41, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-align: center;
    min-height: 64px;
}

#analyzePalmBtn:hover,
.btn-analyze-palm:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(240, 180, 41, 0.55);
}

/* Palm sub-cards (lines, mounts, fingers) — premium framing */
#tab-palmistry .palm-sub-card,
#tab-palmistry .palm-line-card,
#tab-palmistry .palm-mount-card,
#tab-palmistry .palm-finger-card {
    padding: 16px 16px 18px;
    margin-bottom: 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(124, 106, 239, 0.06), rgba(240, 180, 41, 0.04));
    border-left: 4px solid rgba(240, 180, 41, 0.5);
    text-align: justify;
}

#tab-palmistry .palm-sub-card h4,
#tab-palmistry .palm-line-card h4 {
    font-family: 'Cinzel', serif;
    color: #f0b429;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 8px;
}

#tab-palmistry .palm-sub-card p,
#tab-palmistry .palm-line-card p {
    text-align: justify !important;
    line-height: 1.75 !important;
    color: #e8e4f5;
    font-size: 0.92rem;
}

/* Palm tables — enhanced readability */
#tab-palmistry table {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    margin: 14px 0;
}

#tab-palmistry table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.025);
}

#tab-palmistry table th {
    background: linear-gradient(135deg, rgba(240, 180, 41, 0.12), rgba(124, 106, 239, 0.08));
    font-size: 0.85rem;
    padding: 12px 10px;
}

#tab-palmistry table td {
    font-size: 0.85rem;
    padding: 11px 10px;
    line-height: 1.5;
}

/* ===== 5) MOBILE OPTIMIZATIONS (≤768px) ===== */
@media (max-width: 768px) {
    .tab-content p,
    .tab-content li {
        font-size: 0.95rem;
        line-height: 1.72;
    }

    .tab-content h2 { font-size: 1.3rem; }
    .tab-content h3 { font-size: 1.1rem; }
    .tab-content h4 { font-size: 1rem; }

    .accordion-card,
    .glass-card,
    .op-premium-card {
        padding: 16px 14px 18px;
        margin-bottom: 12px;
        border-radius: 16px;
    }

    .accordion-header-left h3 {
        font-size: 1rem !important;
    }

    /* Overview grid — 2 columns on mobile */
    .overview-grid,
    #overviewGrid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .overview-card {
        padding: 14px 8px 12px;
        min-height: 124px;
        border-radius: 14px;
    }

    .overview-card .overview-icon { font-size: 1.8rem; margin-bottom: 8px; }
    .overview-card .overview-title { font-size: 0.72rem; letter-spacing: 0.04em; }
    .overview-card .overview-value { font-size: 0.85rem; }
    .overview-card .overview-sub { font-size: 0.66rem; }
    .overview-consulted { width: 22px; height: 22px; font-size: 0.72rem; top: 6px; right: 6px; }
    .overview-lock-icon { width: 22px; height: 22px; font-size: 0.85rem; top: 6px; right: 6px; }

    /* Palmistry mobile */
    #tab-palmistry .accordion-card {
        padding: 16px 14px 18px;
        border-radius: 18px;
    }

    .palm-capture-card {
        padding: 18px 14px;
        border-radius: 18px;
    }

    .palm-capture-card .card-icon-large,
    .palm-capture-card .palm-icon {
        font-size: 2.5rem;
    }

    .palm-capture-card h4,
    .palm-capture-card h3 {
        font-size: 1.05rem;
    }

    .palm-capture-btn {
        padding: 16px 18px;
        font-size: 0.98rem;
        min-height: 56px;
    }

    .palm-tips .tip { flex: 1 1 100%; }

    #analyzePalmBtn,
    .btn-analyze-palm {
        padding: 18px 20px;
        font-size: 1.05rem;
        min-height: 58px;
    }

    /* Tables → block layout on small screens */
    #tab-palmistry table,
    .tab-content table {
        font-size: 0.82rem;
    }
    #tab-palmistry table th,
    #tab-palmistry table td,
    .tab-content table th,
    .tab-content table td {
        padding: 8px 8px;
    }
}

/* ===== 6) EXTRA-SMALL MOBILE (≤400px) ===== */
@media (max-width: 400px) {
    .tab-content p,
    .tab-content li {
        font-size: 0.92rem;
        line-height: 1.7;
    }

    .overview-grid,
    #overviewGrid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .overview-card {
        padding: 12px 6px 10px;
        min-height: 110px;
    }

    .overview-card .overview-icon { font-size: 1.6rem; }
    .overview-card .overview-title { font-size: 0.66rem; }

    .accordion-card,
    .glass-card,
    .op-premium-card {
        padding: 14px 12px 16px;
    }

    #tab-palmistry .accordion-header-left h3 {
        font-size: 0.96rem;
    }

    .palm-capture-card {
        padding: 16px 12px;
    }
}

/* ===== 7) DAY MODE COMPATIBILITY ===== */
body.day-mode .overview-card {
    background: linear-gradient(155deg, rgba(255, 248, 230, 0.92), rgba(255, 240, 210, 0.85));
    border-color: rgba(240, 180, 41, 0.35);
    color: #4a3500;
}
body.day-mode .overview-card .overview-title { color: #b8860b; }
body.day-mode .overview-card .overview-value { color: #1a1538; }
body.day-mode .overview-card .overview-sub { color: rgba(74, 53, 0, 0.7); }

body.day-mode .tab-content p,
body.day-mode .tab-content li {
    color: #2a1f00;
}

body.day-mode #tab-palmistry .palm-sub-card p,
body.day-mode #tab-palmistry .palm-line-card p {
    color: #2a1f00;
}

/* ===== 8) ANIMATIONS — premium subtle ===== */
@keyframes premiumFadeUp {
    0%   { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

.tab-content.active .glass-card,
.tab-content.active .op-premium-card,
.tab-content.active .accordion-card {
    animation: premiumFadeUp 0.5s ease backwards;
}

.tab-content.active .glass-card:nth-child(1) { animation-delay: 0.0s; }
.tab-content.active .glass-card:nth-child(2) { animation-delay: 0.05s; }
.tab-content.active .glass-card:nth-child(3) { animation-delay: 0.1s; }
.tab-content.active .glass-card:nth-child(4) { animation-delay: 0.15s; }
.tab-content.active .glass-card:nth-child(5) { animation-delay: 0.2s; }

/* ===== 9) RTL SUPPORT (Arabic) ===== */
html[dir="rtl"] .tab-content p,
html[dir="rtl"] .tab-content li,
html[dir="rtl"] .op-premium-card p,
html[dir="rtl"] .glass-card p {
    text-align: justify;
    direction: rtl;
}

html[dir="rtl"] #tab-palmistry .palm-sub-card,
html[dir="rtl"] #tab-palmistry .palm-line-card {
    border-left: none;
    border-right: 4px solid rgba(240, 180, 41, 0.5);
}

/* ===== 10) PRINT STYLES — clean export ===== */
@media print {
    .overview-card { break-inside: avoid; }
    .palm-capture-grid { display: none; }
    .tab-content p { color: #000; text-align: justify; }
    body { background: #fff; color: #000; }
}
