:root {
    --bg-void: #020308;
    --nebula-purple: rgba(85, 23, 145, 0.4);
    --gold: #FFD700;
    --gold-glow: rgba(255, 215, 0, 0.7);
    --neon-blue: #00f2ff;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.15);
    --font-main: 'Quicksand', sans-serif;
    --font-mystic: 'Cinzel', serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-main);
    color: #f0f0ff;
    background-color: var(--bg-void);
}

/* Cosmic Layers */
#space-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, #0a0b1e 0%, var(--bg-void) 100%);
    z-index: -3;
}

#nebula-layer {
    position: fixed;
    width: 200%; height: 200%;
    top: -50%; left: -50%;
    background: 
        radial-gradient(ellipse at 30% 20%, var(--nebula-purple) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 80%, rgba(0, 80, 200, 0.3) 0%, transparent 40%);
    z-index: -2;
    filter: blur(80px);
    animation: nebulaMove 40s ease-in-out infinite alternate;
}

@keyframes nebulaMove {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 100px) scale(1.1); }
}

#stars-layer {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: transparent url('data:image/svg+xml;utf8,<svg width="400" height="400" xmlns="http://www.w3.org/2000/svg"><circle cx="20" cy="50" r="1" fill="white" opacity="0.3"/><circle cx="150" cy="120" r="1.5" fill="white" opacity="0.6"/><circle cx="340" cy="300" r="1.2" fill="white" opacity="0.5"/><circle cx="200" cy="350" r="1" fill="white" opacity="0.3"/><circle cx="80" cy="220" r="0.8" fill="white" opacity="0.4"/></svg>') repeat;
    z-index: -1;
    animation: starsTwinkle 180s linear infinite;
}

@keyframes starsTwinkle {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* UI Structure */
.ui-header {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 20;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.coin-balance {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    font-size: 1.3rem;
    font-weight: bold;
    border-color: rgba(255, 215, 0, 0.3);
}

.coin-icon {
    width: 30px; height: 30px;
    background: radial-gradient(circle at 30% 30%, #fff 0%, var(--gold) 40%, #b28a00 100%);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--gold-glow);
    border: 1px solid rgba(255,255,255,0.7);
}

.header-actions { display: flex; flex-direction: column; gap: 10px; }

.glass-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: var(--font-main);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s ease;
}
.glass-btn:hover { background: rgba(255,255,255,0.1); transform: translateY(-2px); }

/* Portal de Singularidade */
.interaction-area {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 5;
    perspective: 2000px;
}

.portal-container {
    position: relative;
    width: 350px; height: 180px;
    transform-style: preserve-3d;
    transform: rotateX(20deg);
}

.orbital-rings {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

.ring {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(0, 242, 255, 0.2);
    box-shadow: 0 0 10px var(--neon-blue);
}
.ring-1 { width: 380px; height: 200px; animation: ringRot 10s linear infinite; }
.ring-2 { width: 320px; height: 160px; animation: ringRot 7s linear infinite reverse; opacity: 0.6; }
.ring-3 { width: 440px; height: 240px; animation: ringRot 15s linear infinite; opacity: 0.3; }

@keyframes ringRot {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.event-horizon {
    width: 280px; height: 120px;
    background: var(--bg-void);
    border-radius: 50%;
    border: 6px solid #1a1a2e;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 
        0 0 60px rgba(0,0,0,1),
        inset 0 0 40px var(--neon-blue),
        0 0 30px var(--neon-blue);
    overflow: hidden;
    z-index: 5;
}

.singularity-core {
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at center, #000 0%, #050a1b 100%);
    position: relative;
}

.vortex-particles {
    position: absolute;
    width: 200%; height: 200%;
    top: -50%; left: -50%;
    background: conic-gradient(transparent, var(--neon-blue), transparent);
    opacity: 0.2;
    animation: spinVortex 4s linear infinite;
}

@keyframes spinVortex {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* FLOW: MANIFESTATION AREA */
.manifestation-area {
    margin-top: 60px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    z-index: 10;
    transition: all 1s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.mystic-title {
    font-family: var(--font-mystic);
    font-size: 1.6rem;
    margin-bottom: 25px;
    background: linear-gradient(to right, #fff, var(--gold), #fff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.wish-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#wish-input {
    width: 100%;
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 18px 30px;
    color: white;
    font-size: 1.1rem;
    outline: none;
    text-align: center;
    border-bottom: 2px solid var(--neon-blue);
}

.or-divider {
    font-size: 0.8rem;
    opacity: 0.6;
    letter-spacing: 3px;
    margin: 5px 0;
}

#btn-mental-wish {
    width: 100%;
    padding: 15px;
    border-radius: 30px;
    border: 1px solid var(--neon-blue);
    background: transparent;
    color: var(--neon-blue);
    font-size: 1rem;
}
#btn-mental-wish:hover { background: rgba(0, 242, 255, 0.1); }

/* THROW AREA */
.throw-action {
    position: absolute;
    bottom: 50px;
    text-align: center;
    z-index: 15;
    animation: fadeIn 0.8s ease;
}

#action-hint { margin-bottom: 15px; font-size: 0.9rem; font-style: italic; opacity: 0.8; color: var(--gold); }

.primary-btn {
    background: linear-gradient(135deg, #120033, #3b0066);
    color: white;
    padding: 22px 70px;
    font-size: 1.4rem;
    font-weight: bold;
    border-radius: 50px;
    border: 2px solid var(--gold);
    cursor: pointer;
    font-family: var(--font-mystic);
    box-shadow: 0 10px 50px rgba(0,0,0,0.8), 0 0 20px rgba(255, 215, 0, 0.4);
    transition: all 0.4s ease;
}
.primary-btn:hover { transform: scale(1.05) translateY(-5px); box-shadow: 0 15px 60px rgba(255, 215, 0, 0.5); }

/* WELCOME MODAL & QUOTES */
.welcome-content {
    padding: 50px 30px;
    width: 90%;
    max-width: 440px;
    text-align: center;
}

#daily-quote-text {
    font-family: var(--font-main);
    font-style: italic;
    font-size: 1.4rem;
    line-height: 1.6;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.4);
    margin: 30px 0;
    padding: 0 20px;
    border-left: 2px solid var(--neon-blue);
    border-right: 2px solid var(--neon-blue);
}

/* INSTALL GUIDE */
#install-guide {
    position: fixed;
    bottom: 20px;
    left: 15px; right: 15px;
    z-index: 300;
    animation: slideUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.guide-content {
    padding: 20px;
    border: 1px solid var(--neon-blue);
    position: relative;
}

.guide-steps {
    margin-top: 15px;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.share-icon {
    display: inline-block;
    width: 18px; height: 18px;
    border: 1.5px solid #fff;
    position: relative;
    vertical-align: middle;
    margin: 0 5px;
}
.share-icon::after {
    content: '↑';
    position: absolute;
    top: -8px; left: 50%;
    transform: translateX(-50%);
    font-weight: bold;
}

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

/* MODALS */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.cosmic-spinner {
    width: 50px; height: 50px;
    border: 4px solid var(--glass-border);
    border-top: 4px solid var(--neon-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

/* EFFECTS */
.hidden { display: none !important; }
.fade-out { opacity: 0; transform: translateY(-50px) scale(0.8); pointer-events: none; }

/* ANIMATED COIN POV THROW */
#animated-coin {
    position: absolute;
    width: 60px; height: 60px;
    z-index: 100;
    pointer-events: none;
    transform-style: preserve-3d;
    left: 50%;
    bottom: -100px;
    margin-left: -30px;
}

.coin-inner {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff, var(--gold), #b28a00);
    border: 2px solid #fff;
    box-shadow: 0 0 40px var(--gold-glow);
    animation: spin3D 0.4s linear infinite;
}

.coin-throwing {
    animation: coinPOVPhysics 1.5s cubic-bezier(0.25, 0.1, 0.25, 1.0) forwards;
}

@keyframes coinPOVPhysics {
    0% { bottom: -100px; transform: scale(3.0); opacity: 0; }
    10% { opacity: 1; }
    40% { bottom: 65%; transform: scale(1.5); }
    100% { bottom: 50%; transform: scale(0.1) rotate(720deg); opacity: 0; }
}

/* SUCCESS MESSAGE OVERLAY */
#success-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    animation: successFade 0.8s ease-out forwards;
}

.success-content {
    text-align: center;
    padding: 40px;
}

.success-content .mystic-title {
    font-size: 2.2rem;
    animation: textShimmer 3s infinite alternate;
}

@keyframes successFade {
    0% { opacity: 0; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes textShimmer {
    from { filter: drop-shadow(0 0 5px #fff); }
    to { filter: drop-shadow(0 0 20px var(--gold)); }
}

.celestial-glitter {
    margin-top: 20px;
    height: 2px;
    width: 0;
    margin: 20px auto;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
    animation: lineGrow 2s ease-out forwards;
}

@keyframes lineGrow {
    to { width: 100%; }
}

#impact-flash {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: white; opacity: 0; pointer-events: none;
}
.flash-active { animation: flashAnim 0.5s ease-out; }

@keyframes flashAnim {
    0% { opacity: 1; transform: scale(0.5); }
    100% { opacity: 0; transform: scale(2); }
}

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
