* { box-sizing: border-box; font-family: 'Segoe UI', sans-serif; }

body { 
    background-color: #030305; color: #fafafa; margin: 0; padding: 1rem;
    display: flex; justify-content: center; align-items: center; min-height: 100vh;
    overflow-x: hidden;
}

/* --- BACKGROUNDS --- */
.nebula-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -2;
    background: 
        radial-gradient(ellipse at 50% 50%, rgba(0, 210, 255, 0.4) 0%, transparent 35%),
        radial-gradient(ellipse at 25% 35%, rgba(255, 0, 150, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 65%, rgba(255, 0, 150, 0.35) 0%, transparent 55%);
    filter: blur(45px); animation: nebulaBreath 12s infinite alternate;
}
@keyframes nebulaBreath { from { transform: scale(1); opacity: 0.6; } to { transform: scale(1.1); opacity: 0.9; } }

.mystic-rays {
    position: fixed; top: 50%; left: 50%; width: 250vw; height: 250vw;
    background: repeating-conic-gradient(from 0deg, rgba(139, 92, 246, 0.12) 0deg 0.5deg, transparent 0.5deg 10deg);
    transform: translate(-50%, -50%); z-index: -1; animation: spin 180s linear infinite;
    mask-image: radial-gradient(circle at center, transparent 10%, black 40%, transparent 85%);
    -webkit-mask-image: radial-gradient(circle at center, transparent 10%, black 40%, transparent 85%);
}
@keyframes spin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }

/* --- CARD --- */
.card {
    background: #18181b; border: 1px solid #27272a; border-radius: 1.5rem;
    padding: 2.5rem; width: 100%; max-width: 440px; text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.8); z-index: 10;
}

h2, h3, #fortune-text, .loading-pulse { text-align: center; margin: 0 auto; }

/* THE GLOBE */
.globe-container { width: 80px; height: 80px; margin: 0 auto 1.5rem; }
.crystal-ball {
    width: 80px; height: 80px; border-radius: 50%;
    background: radial-gradient(circle at 35% 25%, #fff 0%, rgba(139, 92, 246, 0.4) 25%, #09090b 100%);
    box-shadow: inset 0 -10px 20px rgba(139, 92, 246, 0.5), 0 0 20px rgba(139, 92, 246, 0.3);
    animation: float 4s ease-in-out infinite; transition: 0.5s;
}
.crystal-ball.consulting { box-shadow: 0 0 50px 15px rgba(167, 139, 250, 0.8); filter: brightness(1.5); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* INPUTS */
.input-group { margin-bottom: 1.2rem; text-align: left; }
label { display: block; font-size: 0.7rem; color: #d4d4d8; margin-bottom: 0.4rem; text-transform: uppercase; font-weight: 700; }
.text-input { width: 100%; padding: 0.8rem; background: #09090b; border: 1px solid #3f3f46; border-radius: 0.5rem; color: #fff; outline: none; text-align: center; }

/* MOBILE BLOCKS & CURSOR */
.blocks-wrapper { position: relative; height: 3.2rem; width: 100%; }
#mobile-input { position: absolute; width: 100%; height: 100%; opacity: 0; z-index: 5; cursor: text; }
.blocks-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 0.3rem; height: 100%; width: 100%; }
.blocks-grid span { background: #09090b; border: 1px solid #3f3f46; border-radius: 0.4rem; display: flex; align-items: center; justify-content: center; font-weight: bold; position: relative; }
.blocks-grid span.active { border-color: #8b5cf6; color: #a78bfa; }
.blocks-grid span.cursor::after { content: ''; position: absolute; width: 2px; height: 60%; background: #8b5cf6; animation: blink 1s infinite; }
.cursor {
    border-bottom: 2px solid #a78bfa;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* BUTTONS */
.button-group { display: flex; gap: 0.8rem; margin-top: 1.5rem; }
.btn-primary { 
    flex: 2; background: #3f3f46; color: #a1a1aa; padding: 0.9rem; border-radius: 0.6rem; font-weight: bold; border: none; cursor: pointer; transition: 0.3s; position: relative; overflow: hidden;
}
.btn-primary.btn-ready {
    background: linear-gradient(135deg, #a78bfa, #7c3aed) !important;
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.8) !important;
    animation: pulse-glow 1.5s infinite ease-in-out;
	color: #FFFFFF;
    cursor: pointer;
}
.btn-primary.btn-ready::after { content: ''; position: absolute; top: -50%; left: -60%; width: 20%; height: 200%; background: rgba(255, 255, 255, 0.3); transform: rotate(30deg); animation: shimmer 3s infinite; }
@keyframes shimmer { 0% { left: -60%; } 20%, 100% { left: 120%; } }

.btn-secondary { flex: 1; background: transparent; color: #a1a1aa; border: 1px solid #3f3f46; border-radius: 0.6rem; cursor: pointer; font-weight: bold; }

.privacy-note { font-size: 0.6rem; color: #52525b; margin-top: 1.2rem; }

/* RESULTS */
#result { margin-top: 1.5rem; padding: 1.5rem; background: #09090b; border-radius: 1rem; border: 1px solid #27272a; }
.loading-pulse { color: #a78bfa; font-style: italic; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

.result-actions { display: flex; gap: 0.8rem; margin-top: 1.5rem; justify-content: center; }
.btn-action { flex: 1; max-width: 120px; height: 3.5rem; background: rgba(139, 92, 246, 0.1); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.4); border-radius: 0.6rem; cursor: pointer; }

.shop-section { margin-top: 1.5rem; padding: 0.8rem; background: rgba(139, 92, 246, 0.05); border-radius: 0.8rem; border: 1px dashed rgba(167, 139, 250, 0.3); }
.btn-shop { display: inline-block; margin-top: 0.5rem; padding: 0.5rem 1rem; background: #8b5cf6; color: white; text-decoration: none; border-radius: 2rem; font-weight: bold; font-size: 0.75rem; }

.hidden { display: none !important; }
/* --- THE SHINING AMAZON BUTTON --- */
.btn-shop {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    border-radius: 50px;
}

/* The Shine Effect Layer */
.btn-shop::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(30deg);
    animation: shine-sweep 4s infinite;
}

/* The Animation Logic */
@keyframes shine-sweep {
    0% { left: -60%; }
    15% { left: 120%; }
    100% { left: 120%; }
}

/* Hover Effect for Interaction */
.btn-shop:hover {
    transform: scale(1.08);
    filter: brightness(1.1);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
	transition: transform 0.2s;
}
#download-btn {
    background: linear-gradient(135deg, #833ab4, #fd1d1d); /* Instagram Colors */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

#download-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(253, 29, 29, 0.4);
}
/* 1. Watermark Style (Hidden by default) */
.share-only-branding {
display: none !important; 
    text-align: center;
    font-size: 0.9rem;
    color: rgba(167, 139, 250, 0.6);
    margin-top: 25px;
    letter-spacing: 2px;
}

/* 2. Capture Mode Trigger (Added by JS) */
/* When this class is present, we rearrange the card for the photo */
#result.capturing {
    padding: 35px !important; /* Give some breathing room in the photo */
    border-radius: 15px; /* ensure nice corners in photo */
}
#result.capturing .share-only-branding {
    display: block !important;
}
#result.capturing #result-watermark {
    display: block !important; /* Show ONLY in the photo */
}

/* 3. Elements to Hide in the Photo */
#result.capturing #action-buttons,
#result.capturing .shop-section,
#result.capturing .loading-pulse {
    display: none !important; /* Hide UI clutter in photo */
}

/* --- BUTTON HIGHLIGHTING & GLOW --- */

/* 1. The Main Reveal Button (Pulse Effect) */
/* Base state (Locked) */
.btn-primary {
    background: #4b5563; /* Greyish when not ready */
    opacity: 0.5;
    transition: all 0.4s ease;
}

/* Ready state (Glowing) */
.btn-primary.btn-ready {
    background: linear-gradient(135deg, #a78bfa, #7c3aed) !important;
    opacity: 1 !important;
    cursor: pointer !important;
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.8) !important;
    animation: pulse-glow 1.5s infinite;
}

/* 2. The Result Share Button (WhatsApp Green Glow) */
#share-btn {
    background: linear-gradient(135deg, #25d366, #128c7e) !important;
    color: white !important;
    border: none;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
	transition: transform 0.2s;
}

#share-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

/* The Pulse Animation for the Reveal Button */
@keyframes pulse-glow {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}