/* HOROSCOPE APP WRAPPER (DESKTOP DEFAULT) */
#horoscope-app-wrapper {
    position: fixed;
    right: 14%;
    top: 50%;
    transform: translateY(-50%);
    width: 380px;
    height: 620px;
    z-index: 150;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 3D ZODIAC CANVAS */
#zodiac-3d-canvas {
    width: 460px;
    height: 400px;
    position: absolute;
    top: 110px;
    pointer-events: none;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.7))
            drop-shadow(0 0 20px rgba(245, 158, 11, 0.4));
}

/* METEOR SHOWER CANVAS */
#meteor-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
}

/* SINHALA UNICODE FONT OVERRIDE FIX */
p, .hero p, .panel-desc, .tab-content p, label, input {
    font-family: 'Noto Sans Sinhala', 'Inter', sans-serif !important;
}

/* TRIGGER BUTTON */
.glow-btn {
    position: absolute;
    top: 480px;
    background: linear-gradient(135deg, rgba(15, 15, 30, 0.95), rgba(5, 5, 15, 0.95));
    border: 2px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 0.85rem 2.2rem;
    border-radius: 30px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4), inset 0 0 12px rgba(245, 158, 11, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    z-index: 10;
}
.glow-btn:hover {
    background: var(--accent-gold);
    color: #000;
    box-shadow: 0 0 35px var(--accent-gold);
    transform: scale(1.08);
}

/* GLASS-MORPHISM SLIDING PANEL */
.glass-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(12, 12, 25, 0.96), rgba(4, 4, 12, 0.98));
    border: 1.5px solid rgba(245, 158, 11, 0.5);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.9), inset 0 0 15px rgba(245, 158, 11, 0.1);
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9) translateX(30px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 20;
}
.glass-panel.active { 
    opacity: 1;
    pointer-events: all;
    transform: scale(1) translateX(0);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
}
.panel-header h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--accent-gold);
    font-size: 1.1rem;
    letter-spacing: 1px;
}
#close-panel-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    transition: color 0.2s;
}
#close-panel-btn:hover { color: #f43f5e; }

.panel-body { padding: 1.5rem; }
.panel-desc { font-size: 0.85rem; color: var(--text-sub); margin-bottom: 1.2rem; line-height: 1.5; }

.input-grp { margin-bottom: 1.1rem; }
.input-grp label { display: block; font-size: 0.8rem; color: var(--accent-cyan); margin-bottom: 6px; font-family: 'Orbitron', sans-serif; }
.input-grp input {
    width: 100%; padding: 0.8rem 1rem;
    background: rgba(2, 2, 10, 0.85);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 8px; color: #fff !important;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}
.input-grp input:focus { border-color: var(--accent-gold); box-shadow: 0 0 12px rgba(245, 158, 11, 0.3); outline: none; }

.submit-btn-3d {
    width: 100%; padding: 1rem; margin-top: 10px;
    background: linear-gradient(135deg, #d97706, #f59e0b);
    border: none; border-radius: 8px; color: #000;
    font-family: 'Orbitron', sans-serif; font-weight: 900;
    cursor: pointer; letter-spacing: 1px;
    box-shadow: 0 5px 0 #92400e, 0 10px 20px rgba(0,0,0,0.5);
    transition: all 0.15s ease;
}
.submit-btn-3d:active { transform: translateY(4px); box-shadow: 0 1px 0 #92400e; }

/* BOTTOM RUNNING QUOTE BANNER */
.bottom-quote-ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 48px;
    overflow: hidden;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    background: rgba(4, 4, 15, 0.95);
    border-top: 1.5px solid rgba(245, 158, 11, 0.6);
    display: flex;
    align-items: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.9);
}

.ticker-track {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    white-space: nowrap;
    animation: marquee-smooth 85s linear infinite;
    will-change: transform;
}

.ticker-track span {
    font-family: 'Abhaya Libre', 'Noto Sans Sinhala', serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff !important;
    letter-spacing: 1.5px;
    padding-right: 80vw;
    flex-shrink: 0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 2px 2px 6px rgba(0, 0, 0, 0.95);
}

@keyframes marquee-smooth {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

/* RIGHT SIDE 3D PLANETARY POSITIONS WIDGET */
.planetary-widget-right {
    position: fixed;
    right: 20px;
    top: 140px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 120;
}

.planet-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(10, 10, 25, 0.85);
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 8px 14px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 15px rgba(0,0,0,0.8);
}

.planet-sphere {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: bold;
    color: #000;
}
.planet-sphere.sun { background: radial-gradient(circle at 30% 30%, #fef08a, #f59e0b); box-shadow: 0 0 12px #f59e0b; }
.planet-sphere.moon { background: radial-gradient(circle at 30% 30%, #ffffff, #94a3b8); box-shadow: 0 0 12px #cbd5e1; }
.planet-sphere.jupiter { background: radial-gradient(circle at 30% 30%, #38bdf8, #0284c7); box-shadow: 0 0 12px #38bdf8; color: #fff; }

.planet-info { display: flex; flex-direction: column; }
.planet-title { font-size: 0.65rem; color: var(--text-sub); font-family: 'Orbitron', sans-serif; }
.planet-info strong { font-size: 0.82rem; color: #fff; font-family: 'Noto Sans Sinhala', sans-serif; }

/* DECODE SHOCKWAVE & BURST PARTICLES */
.cosmic-shockwave {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--accent-gold);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    animation: shockwaveExpand 0.9s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes shockwaveExpand {
    0% { width: 20px; height: 20px; opacity: 1; border-width: 4px; }
    100% { width: 350px; height: 350px; opacity: 0; border-width: 1px; }
}

.burst-particle {
    position: fixed;
    width: 6px;
    height: 6px;
    background: var(--accent-gold);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 0 8px var(--accent-gold);
    animation: burstMove 0.8s ease-out forwards;
}

@keyframes burstMove {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* SOUL COMPATIBILITY MATCHER - HIGH VISIBILITY INPUT FIX */
.compat-box {
    margin-top: 15px;
    background: rgba(5, 5, 18, 0.85);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 12px;
    padding: 12px;
}
.compat-title { font-size: 0.78rem; color: var(--accent-gold); font-family: 'Orbitron', sans-serif; margin-bottom: 8px; text-align: center; }
.compat-inputs { display: flex; gap: 8px; margin-bottom: 8px; }

/* FIXED HIGH CONTRAST INPUT FIELDS */
.compat-inputs input {
    width: 50%;
    padding: 0.65rem 0.8rem;
    background: rgba(12, 12, 30, 0.95) !important;
    border: 1.5px solid rgba(245, 158, 11, 0.5) !important;
    border-radius: 8px;
    color: #ffffff !important;
    font-size: 0.88rem !important;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
}
.compat-inputs input::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
    font-weight: 400;
}
.compat-inputs input:focus {
    border-color: var(--accent-gold) !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.compat-res { text-align: center; margin-top: 8px; font-size: 0.88rem; font-family: 'Noto Sans Sinhala', sans-serif; color: #fff; }

/* HEADER ELEMENTS & WIDGETS */
.lang-btn {
    background: rgba(15, 15, 35, 0.85);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}
.lang-btn:hover { background: var(--accent-gold); color: #000; }

.audio-vis-container { display: flex; align-items: flex-end; gap: 3px; height: 22px; margin: 0 6px; }
.audio-vis-bar { width: 3px; height: 4px; background: var(--accent-gold); border-radius: 2px; box-shadow: 0 0 8px var(--accent-gold); transition: height 0.1s ease; }

.daily-badge, .celestial-badge {
    background: rgba(15, 15, 35, 0.85);
    border: 1px solid var(--accent-gold);
    color: #fff;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}
.celestial-badge span { color: var(--accent-cyan); font-weight: 800; }

.theme-picker { display: flex; gap: 8px; align-items: center; margin: 0 8px; }
.theme-dot { width: 14px; height: 14px; border-radius: 50%; cursor: pointer; transition: transform 0.2s; border: 1px solid rgba(255,255,255,0.5); }
.theme-dot:hover { transform: scale(1.3); }
.theme-dot.gold { background: #f59e0b; }
.theme-dot.cyan { background: #06b6d4; }
.theme-dot.violet { background: #c084fc; }

.freq-select {
    background: rgba(10, 10, 25, 0.9);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    outline: none;
    cursor: pointer;
}

/* MATRIX ORACLE CHAT WIDGET */
.oracle-btn {
    position: fixed;
    bottom: 60px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: 2px solid #fff;
    color: #000;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
    z-index: 200;
    transition: transform 0.2s;
}
.oracle-btn:hover { transform: scale(1.1); }

.oracle-modal {
    position: fixed;
    bottom: 120px;
    left: 20px;
    width: 310px;
    height: 380px;
    background: rgba(8, 8, 20, 0.96);
    border: 1.5px solid var(--accent-gold);
    border-radius: 14px;
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}
.oracle-modal.active { opacity: 1; pointer-events: all; transform: translateY(0); }

.oracle-header {
    background: rgba(0,0,0,0.6);
    padding: 0.8rem 1rem;
    color: var(--accent-gold);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
}
.oracle-header button { background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; }

.oracle-body { flex: 1; padding: 0.8rem; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.oracle-msg { max-width: 85%; padding: 0.6rem 0.8rem; border-radius: 10px; font-size: 0.8rem; line-height: 1.4; }
.oracle-msg.ai { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); color: #fff; align-self: flex-start; }
.oracle-msg.user { background: rgba(6, 182, 212, 0.2); border: 1px solid rgba(6, 182, 212, 0.4); color: #fff; align-self: flex-end; }

.oracle-footer { padding: 0.6rem; border-top: 1px solid rgba(255,255,255,0.1); display: flex; gap: 6px; }
.oracle-footer input {
    flex: 1; background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px; padding: 0.5rem; color: #fff !important; font-size: 0.8rem; outline: none;
}
.oracle-footer button { background: var(--accent-gold); border: none; padding: 0 0.8rem; border-radius: 6px; color: #000; cursor: pointer; }

/* CURSOR PARTICLES */
.cosmic-particle {
    position: fixed;
    pointer-events: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    z-index: 9999;
    animation: particleFade 0.7s ease-out forwards;
}

@keyframes particleFade {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(0, -25px) scale(0.3); }
}

/* =================================================================
   COMPLETE MOBILE & TABLET RESPONSIVE FIXES (NO OVERLAPS OR ERRORS)
   ================================================================= */
@media (max-width: 1100px) {
    #horoscope-app-wrapper {
        right: 5%;
        width: 320px;
    }
    .planetary-widget-right {
        right: 10px;
        top: 110px;
    }
}

@media (max-width: 850px) {
    header {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 10px;
    }
    .header-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }
    .planetary-widget-right {
        position: relative;
        right: auto;
        top: auto;
        flex-direction: row;
        justify-content: center;
        margin: 15px auto;
        z-index: 100;
    }
    #horoscope-app-wrapper {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        width: 90vw;
        max-width: 380px;
        margin: 30px auto 80px auto;
    }
    #zodiac-3d-canvas {
        top: -20px;
        width: 340px;
        height: 300px;
    }
    .glow-btn {
        top: 260px;
    }
    .glass-panel {
        height: auto;
        max-height: 85vh;
    }
    .hero h1 {
        font-size: 1.8rem;
    }
    .calc-card {
        width: 92vw;
        max-width: 440px;
        padding: 1rem;
    }
    .ticker-track span {
        font-size: 1.05rem;
        padding-right: 90vw;
    }
    .oracle-modal {
        width: 90vw;
        left: 5vw;
        bottom: 75px;
    }
}

@media (max-width: 480px) {
    .daily-badge, .celestial-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }
    .compat-inputs {
        flex-direction: column;
    }
    .compat-inputs input {
        width: 100%;
    }
}