:root {
    --bg-dark: #07070a;
    --bg-surface: rgba(20, 21, 30, 0.7);
    --bg-card: rgba(30, 31, 45, 0.6);
    --primary: #d4af37; /* Metallic Gold */
    --primary-glow: rgba(212, 175, 55, 0.4);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --accent: #10b981;
    --radius: 16px;
    --glass: blur(12px) saturate(180%);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(212, 175, 55, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 40%);
    overflow-x: hidden;
    width: 100%;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.2rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary-glow);
}

.badges {
    display: flex;
    gap: 0.5rem;
}

.badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Config badges - inside the settings panel */
.config-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.config-badge {
    background: rgba(212, 175, 55, 0.08);
    color: var(--primary);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    cursor: help;
    transition: background 0.2s;
}

.config-badge:hover {
    background: rgba(212, 175, 55, 0.15);
}

.hero {
    text-align: center;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.2rem;
    letter-spacing: -1.5px;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary), #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-muted);
    max-width: 550px;
    margin: 0 auto;
    font-size: 1.15rem;
    font-weight: 300;
}

.config-panel {
    background: var(--bg-surface);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.08), 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
}

.config-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.04) 0%, transparent 60%);
    pointer-events: none;
}

.config-panel h3 {
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-panel h3::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
}

.form-group select {
    width: 100%;
    padding: 0.9rem 1.2rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s;
}

.form-group select:focus {
    border-color: var(--primary);
}

.controls {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    margin-bottom: 3.5rem;
}

button {
    font-family: inherit;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    padding: 1rem 1.8rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-dark);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.25);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 32px rgba(212, 175, 55, 0.35);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(45, 46, 65, 0.8);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Result Display */
.result-display {
    background: var(--bg-surface);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    margin-bottom: 3.5rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-display.hidden { display: none; }

.number-balls {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin: 2.5rem 0;
    flex-wrap: wrap;
}

.ball {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #2a2c3d, #0f1015);
    border: 2px solid var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4), inset 0 2px 4px rgba(255,255,255,0.1);
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.analysis-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

/* History */
.history-section {
    margin-top: 2rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.history-header h3 { font-size: 1.1rem; font-weight: 600; opacity: 0.8; }

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s;
}
.btn-text:hover { color: #f87171; }

.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s;
}

.history-item:hover {
    transform: scale(1.01);
    border-color: rgba(212, 175, 55, 0.3);
}

.history-numbers {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
}

.history-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Ads */
.ad-container {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0.5rem;
    text-align: center;
    display: block;
    width: 100%;
    position: relative;
    overflow: hidden;
    /* Altura fija: nunca toma más que un banner chico */
    height: 60px;
    max-height: 60px;
}

/* Ad entre header y tabs */
/* Ad entre header y tabs o debajo de botones */
.ad-top-banner, .ad-mid-banner {
    height: auto;
    min-height: 66px;
    max-height: 280px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    background: transparent;
}

/* Ocultar banner superior/central en PC cuando hay laterales */
@media (min-width: 1000px) {
    .ad-top-banner, .ad-mid-banner {
        display: none !important;
    }
}

.ad-container ins.adsbygoogle {
    display: block !important;
    width: 100% !important;
    min-height: 50px;
    max-height: 280px;
    margin: 0 auto;
    overflow: hidden;
}

.ad-label {
    font-size: 0.55rem;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.5;
    letter-spacing: 0.5px;
    line-height: 1;
    margin-bottom: 2px;
}

/* Footer */
.app-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-links a:hover { color: var(--primary); }

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-surface);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    border: 1px solid var(--primary);
    border-radius: 16px;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    transform: translateY(150%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner.visible { transform: translateY(0); }

.cookie-banner p { font-size: 0.85rem; }

.cookie-accept {
    background: var(--primary);
    color: var(--bg-dark);
    font-size: 0.85rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
}

/* Animations */
@keyframes popIn {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes slideUp {
    0% { transform: translateY(30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Tabs */
.app-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--bg-card);
    padding: 0.4rem;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    transition: all 0.3s;
}

.tab-btn:hover { color: var(--text-main); }

.tab-btn.active {
    background: var(--primary);
    color: var(--bg-dark);
}

.tab-content { display: none; animation: fadeIn 0.4s ease; }
.tab-content.active { display: block; }

/* Zodiac Grid */
.zodiac-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.zodiac-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.zodiac-card span { font-size: 1.8rem; }

.zodiac-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    background: rgba(212, 175, 55, 0.1);
}

.zodiac-card.active {
    border-color: var(--primary);
    background: rgba(212, 175, 55, 0.15);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Stats Input */
.stats-input-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

.num-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem 0;
    text-align: center;
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 800;
    outline: none;
}

.num-input:focus { border-color: var(--primary); }

/* FAQ Section */
.faq-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 1.8rem;
    color: var(--primary);
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.2rem;
}

.faq-item h3 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.faq-item p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Result Action Buttons Container */
.result-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.result-actions.hidden { display: none; }

/* WhatsApp Share Button */
.btn-whatsapp {
    background: #25D366;
    color: #fff;
    border: none;
    padding: 0.85rem 1.4rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 180px;
}

.btn-whatsapp:hover {
    background: #20bc5a;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 28px rgba(37, 211, 102, 0.45);
}

.btn-whatsapp:active {
    transform: translateY(-1px) scale(1);
}

/* Official Site Button */
.btn-official {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.85rem 1.2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-official:hover {
    background: var(--accent);
    color: var(--bg-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.official-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.official-card {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 1.2rem;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s;
    font-size: 0.9rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.official-card:hover {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.2);
}

.official-card strong { color: var(--primary); font-size: 0.95rem; }

/* Responsive */
@media (max-width: 600px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
    }

    .app-container {
        padding: 1.2rem 1rem;
        width: 100%;
    }

    .app-header {
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
    }

    .hero {
        margin-bottom: 1.2rem;
    }

    .hero h1 { font-size: 2rem; letter-spacing: -1px; margin-bottom: 0.75rem; }
    .hero p { font-size: 0.95rem; }

    .controls { flex-direction: column; margin-bottom: 2rem; }
    .ball { width: 48px; height: 48px; font-size: 1.4rem; }

    .cookie-banner { 
        flex-direction: column; 
        bottom: 0; left: 0; right: 0; 
        border-radius: 16px 16px 0 0;
        left: 0;
        right: 0;
        max-width: 100%;
    }

    .zodiac-grid { grid-template-columns: repeat(3, 1fr); }
    .stats-input-grid { grid-template-columns: repeat(3, 1fr); }
    .official-links-grid { grid-template-columns: 1fr; }

    /* Ad banner smaller on mobile */
    .ad-container {
        min-height: 50px;
        max-height: 90px;
        margin-bottom: 1.2rem;
        padding: 0.25rem;
    }

    .config-badges {
        gap: 0.4rem;
    }

    .config-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.6rem;
    }

    .config-panel {
        padding: 1.2rem;
        margin-bottom: 1.2rem;
    }
}

/* =============================================
   ADS LATERALES - Solo en pantallas anchas
   ============================================= */
.side-ad {
    display: none; /* Ocultos por defecto (mobile/tablet) */
}

@media (min-width: 1140px) {
    .side-ad {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
        width: 160px;
        z-index: 10;
    }

    .side-ad-left {
        left: calc(50% - 400px - 180px); /* izquierda del contenido centrado */
    }

    .side-ad-right {
        right: calc(50% - 400px - 180px); /* derecha del contenido centrado */
    }

    .side-ad-label {
        font-size: 0.55rem;
        text-transform: uppercase;
        color: var(--text-muted);
        opacity: 0.4;
        letter-spacing: 0.5px;
    }

    .side-ad ins.adsbygoogle {
        border-radius: 8px;
        overflow: hidden;
        background: var(--bg-card);
        border: 1px solid var(--border);
    }
}

/* Para pantallas muy anchas, ajustar posición */
@media (min-width: 1400px) {
    .side-ad-left {
        left: calc(50% - 430px - 160px);
    }
    .side-ad-right {
        right: calc(50% - 430px - 160px);
    }
}
