@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600&family=Outfit:wght@300;400;600&display=swap');

:root {
    --primary-color: #c4b5fd; --glow-r: 139; --glow-g: 92; --glow-b: 246; --accent-color: #8b5cf6;
}
body.theme-emerald { --primary-color: #6ee7b7; --glow-r: 16; --glow-g: 185; --glow-b: 129; --accent-color: #10b981; }
body.theme-celestial { --primary-color: #93c5fd; --glow-r: 59; --glow-g: 130; --glow-b: 246; --accent-color: #3b82f6; }
body.theme-obsidian { --primary-color: #fde047; --glow-r: 113; --glow-g: 113; --glow-b: 122; --accent-color: #fbbf24; }

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { background-color: #050507; color: #f4f4f5; font-family: 'Outfit', sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; overflow: hidden; position: relative; }

/* Ambient Glow & Particles */
.ambient-glow { position: absolute; width: 150vw; height: 150vw; max-width: 600px; max-height: 600px; background: radial-gradient(circle, rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.15) 0%, rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.05) 40%, rgba(0,0,0,0) 70%); top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 0; pointer-events: none; animation: breathe 8s infinite ease-in-out alternate; transition: background 1s ease; }
@keyframes breathe { 0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.6; } 100% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; } }
#particles { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.particle { position: absolute; background: rgba(255, 255, 255, 0.4); border-radius: 50%; animation: float 15s infinite linear; }
@keyframes float { 0% { transform: translateY(100vh) translateX(0); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateY(-100px) translateX(20px); opacity: 0; } }

/* Stardust Touch Effect */
.stardust { position: absolute; pointer-events: none; border-radius: 50%; background: radial-gradient(circle, rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.8) 0%, rgba(255,255,255,0.4) 40%, transparent 80%); animation: stardustFade 1s forwards cubic-bezier(0.1, 0.8, 0.3, 1); z-index: 9999; }
@keyframes stardustFade { 0% { opacity: 1; transform: scale(1) translateY(0); } 100% { opacity: 0; transform: scale(0.2) translateY(20px); } }

/* PIN Lock Screen */
#pin-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(5, 5, 7, 0.95); backdrop-filter: blur(20px); z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity 0.5s ease, visibility 0.5s ease; }
.pin-dots { display: flex; gap: 15px; margin-bottom: 30px; }
.pin-dot { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--primary-color); transition: all 0.3s; }
.pin-dot.filled { background: var(--primary-color); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.key-btn { width: 60px; height: 60px; border-radius: 50%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #fff; font-size: 1.5rem; font-family: 'Outfit'; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.key-btn:active { background: rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.3); transform: scale(0.9); }
.pin-message { font-family: 'Cinzel', serif; color: var(--primary-color); font-size: 1.2rem; margin-bottom: 20px; letter-spacing: 2px; text-transform: uppercase;}

/* App Container */
.app-container { width: 100%; max-width: 420px; padding: 1rem 1.5rem; display: flex; flex-direction: column; align-items: center; z-index: 1; height: 100vh; }

/* Top Bar */
.top-bar { width: 100%; display: flex; justify-content: space-between; align-items: flex-start; padding: 0.5rem 0 1.5rem 0; z-index: 2; }
.top-widgets { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; max-width: 70%; }
.small-widget { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--primary-color); font-family: 'Cinzel', serif; background: rgba(255,255,255,0.03); padding: 4px 10px; border-radius: 15px; border: 1px solid rgba(255,255,255,0.1); transition: color 1s ease; width: fit-content; }
.icon-group { display: flex; gap: 10px; align-items: center; }
.top-btn { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); color: var(--primary-color); width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; transition: all 0.3s; }
.top-btn.playing { background: rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.3); box-shadow: 0 0 15px rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.4); animation: pulse-audio 2s infinite; }

/* Main Card */
.card { background: rgba(20, 20, 25, 0.4); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 2rem 1.5rem; border-radius: 32px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.8), inset 0 1px 1px rgba(255,255,255,0.08); text-align: center; width: 100%; border: 1px solid rgba(255, 255, 255, 0.05); display: flex; flex-direction: column; flex: 1; overflow: hidden; position: relative; margin-bottom: 80px; }
.view { display: none; flex-direction: column; height: 100%; width: 100%; animation: fadeIn 0.4s ease; }
.view.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

h1 { font-family: 'Cinzel', serif; font-size: 1.1rem; color: var(--primary-color); letter-spacing: 5px; text-transform: uppercase; font-weight: 600; margin-bottom: 1.5rem; transition: color 1s ease;}

/* ECHOES VIEW */
.categories { display: flex; gap: 8px; justify-content: center; margin-bottom: 2rem; flex-wrap: wrap; }
.category-chip { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #a1a1aa; padding: 6px 12px; border-radius: 20px; font-size: 0.75rem; text-transform: uppercase; cursor: pointer; transition: all 0.3s; }
.category-chip.active { background: rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.2); border-color: rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.5); color: var(--primary-color); }
.message-wrapper { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; }
.message { font-size: 1.4rem; line-height: 1.6; font-weight: 300; font-style: italic; color: #f8fafc; transition: opacity 0.8s, transform 0.8s; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.message.hidden { opacity: 0; transform: translateY(10px); }

.echo-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; opacity: 0; transition: opacity 2s ease; border-radius: 20px; z-index: -1; pointer-events: none; }
.message-wrapper.ritual-active .echo-bg { opacity: 0.3; }

.breathing-circle { position: absolute; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.4) 0%, rgba(0,0,0,0) 70%); opacity: 0; transform: scale(0.5); pointer-events: none; transition: all 0.5s ease; z-index: 0; }
.breathing-text { position: absolute; font-size: 0.9rem; color: var(--primary-color); opacity: 0; text-transform: uppercase; letter-spacing: 2px; z-index: 1;}
.message-container { z-index: 1; position: relative; padding: 20px;}
.ritual-active .message { opacity: 0 !important; }
.ritual-active .breathing-circle { opacity: 1; animation: ritual-breathe 4s ease-in-out; }
.ritual-active .breathing-text { opacity: 1; }

/* Chakras */
.chakra-container { display: flex; flex-direction: column-reverse; align-items: center; gap: 10px; }
.chakra-bowl { width: 35px; height: 35px; border-radius: 50%; cursor: pointer; border: 2px solid rgba(255,255,255,0.2); transition: all 0.3s; box-shadow: 0 0 10px rgba(0,0,0,0.5); }
.chakra-bowl:active { transform: scale(0.9); }
.chakra-bowl.active { border-color: #fff; box-shadow: 0 0 20px currentColor; animation: breathe 1.5s infinite alternate; }
.chakra-bowl.root { background: #ef4444; color: #ef4444; }
.chakra-bowl.sacral { background: #f97316; color: #f97316; }
.chakra-bowl.solar { background: #eab308; color: #eab308; }
.chakra-bowl.heart { background: #22c55e; color: #22c55e; }
.chakra-bowl.throat { background: #3b82f6; color: #3b82f6; }
.chakra-bowl.thirdeye { background: #6366f1; color: #6366f1; }
.chakra-bowl.crown { background: #a855f7; color: #a855f7; }

/* DIVINATION VIEW */
.divination-toggle { display: flex; gap: 10px; justify-content: center; margin-bottom: 1rem; }
.div-btn { background: none; border: 1px solid rgba(255,255,255,0.1); color: #94a3b8; padding: 5px 15px; border-radius: 20px; font-size: 0.8rem; cursor: pointer; }
.div-btn.active { border-color: var(--accent-color); color: var(--primary-color); }

.tarot-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; perspective: 1000px; width: 100%; }
.tarot-card-container { display: flex; justify-content: center; gap: 12px; width: 100%; }
.tarot-card-wrapper { position: relative; display: flex; flex-direction: column; align-items: center; width: 150px; }
.tarot-card-container.spread-3 .tarot-card-wrapper { width: 95px; }
.tarot-card { width: 100%; aspect-ratio: 2/3; position: relative; transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.2, 1); transform-style: preserve-3d; cursor: pointer; }
.tarot-card.flipped { transform: rotateY(180deg); }
.tarot-face { position: absolute; top: 0; left: 0; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 10px; border: 1px solid rgba(255,255,255,0.2); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px; text-align: center; overflow: hidden; }
.tarot-back { background: linear-gradient(135deg, rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.8), #0f172a); background-image: radial-gradient(circle at center, rgba(255,255,255,0.1) 0%, transparent 60%); }
.tarot-back::after { content: "✦"; color: rgba(255,255,255,0.5); font-size: 2rem; }
.tarot-front { background: #0f172a; background-size: cover; background-position: center; transform: rotateY(180deg); color: #e2e8f0; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.tarot-front::before { content: ""; position: absolute; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.4); z-index: -1; } /* Dark overlay for text readability */
.tarot-name { font-family: 'Cinzel', serif; font-size: 0.9rem; color: var(--primary-color); margin-bottom: 5px; text-align: center; z-index: 1;}
.tarot-desc { font-size: 0.7rem; color: #f8fafc; font-style: italic; line-height: 1.2; text-align: center; z-index: 1;}
.reversed-text { color: #f43f5e; font-size: 0.6rem; margin-top: 5px; text-transform: uppercase; letter-spacing: 1px; z-index: 1;}
.tarot-label { font-size: 0.7rem; color: var(--primary-color); margin-top: 10px; font-family: 'Cinzel', serif; text-transform: uppercase; letter-spacing:1px; opacity:0; transition: opacity 0.5s; text-align: center; width:100%; position:absolute; bottom: -20px; left:0;}
.tarot-card-wrapper { position: relative; margin-bottom:20px;}

.spread-toggle { margin-bottom: 1.5rem; display: flex; justify-content: center; gap: 20px;}
.spread-radio { display: flex; align-items: center; gap: 5px; font-size: 0.8rem; color: #cbd5e1; cursor:pointer;}

.pendulum-stage { flex: 1; display: none; flex-direction: column; align-items: center; justify-content: center; }
.pendulum-crystal { height: 150px; width: auto; object-fit: contain; transform-origin: top center; animation: none; cursor: pointer; transition: filter 0.3s; filter: drop-shadow(0 0 10px rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.5));}
.pendulum-crystal:hover { filter: drop-shadow(0 0 20px rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.9)); }
.pendulum-swinging { animation: swing 1.5s ease-in-out infinite alternate; }
@keyframes swing { 0% { transform: rotate(-35deg); } 100% { transform: rotate(35deg); } }
.pendulum-answer { font-family: 'Cinzel', serif; font-size: 1.5rem; color: #f8fafc; margin-top: 2rem; opacity: 0; transition: opacity 0.5s; text-shadow: 0 0 10px rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.5);}

/* MEDITATION VIEW */
.meditation-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative;}
.box-breathing-circle { width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.3) 0%, transparent 70%); border: 2px solid rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.6); display: flex; align-items: center; justify-content: center; transition: all 4s linear; }
.box-breathing-text { font-family: 'Cinzel', serif; font-size: 1.2rem; color: var(--primary-color); letter-spacing: 2px; }

/* JOURNAL & ALTAR VIEW */
.journal-area { flex: 1; display: flex; flex-direction: column; gap: 15px; text-align: left; overflow-y:auto; padding-right:5px; }
.altar-section { background: rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.05); border: 1px solid rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.2); border-radius: 12px; padding: 15px; margin-bottom: 10px;}
.altar-title { font-family: 'Cinzel', serif; font-size: 0.9rem; color: var(--primary-color); margin-bottom: 10px; text-align: center; letter-spacing: 1px;}
.altar-input { width: 100%; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 8px 12px; color: #fff; font-family: 'Outfit'; font-size: 0.85rem; margin-bottom: 10px;}
.journal-input { width: 100%; height: 100px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 1rem; color: #e2e8f0; font-family: 'Outfit', sans-serif; resize: none; font-size: 0.95rem; line-height: 1.4; }
.journal-input:focus, .altar-input:focus { outline: none; border-color: rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.5); }
.journal-entries { display: flex; flex-direction: column; gap: 10px; }
.entry { background: rgba(255,255,255,0.03); padding: 15px; border-radius: 12px; border-left: 2px solid var(--accent-color); font-size: 0.85rem; color: #cbd5e1; position: relative; }
.entry-date { font-size: 0.7rem; color: #64748b; margin-bottom: 8px; text-transform:uppercase; letter-spacing:1px;}
.entry-altar { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.05); font-style: italic; color: var(--primary-color);}

/* Actions */
.actions { width: 100%; margin-top: 1.5rem; display: flex; gap: 10px;}
.btn-primary { background: linear-gradient(135deg, rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.2), rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.1)); color: #e2e8f0; border: 1px solid rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.4); padding: 16px; border-radius: 30px; font-size: 1rem; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; transition: all 0.3s; width: 100%; font-family: 'Outfit', sans-serif; }
.btn-primary:active { transform: scale(0.98); background: rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.4); }
.btn-secondary { background: none; border: 1px solid rgba(255,255,255,0.1); color: #94a3b8; padding: 10px; border-radius: 12px; cursor: pointer; transition: all 0.3s; }
.btn-secondary:hover { color: var(--primary-color); border-color: var(--accent-color); }
.btn-secondary.recording { color: #f43f5e; border-color: rgba(244,63,94,0.5); animation: pulse-audio 1s infinite alternate; box-shadow: 0 0 15px rgba(244,63,94,0.3); }
@keyframes pulse-audio { 0% { transform: scale(1); } 100% { transform: scale(1.05); } }

/* Bottom Nav */
.bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; background: rgba(10, 10, 15, 0.8); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); display: flex; justify-content: space-around; padding: 1rem 0; border-top: 1px solid rgba(255,255,255,0.05); z-index: 10; }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #64748b; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; transition: color 0.3s; }
.nav-item i { font-size: 1.5rem; }
.nav-item.active { color: var(--primary-color); }

/* Settings Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); z-index: 100; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-content { background: rgba(20, 20, 25, 0.9); border: 1px solid rgba(255,255,255,0.1); border-radius: 24px; width: 90%; max-width: 350px; padding: 2rem; display: flex; flex-direction: column; gap: 15px;}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-header h2 { font-family: 'Cinzel', serif; font-size: 1.2rem; color: var(--primary-color); letter-spacing: 2px; margin-bottom: 0;}
.close-btn { background: none; border: none; color: #94a3b8; font-size: 1.8rem; cursor: pointer; }
.setting-group { margin-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 15px;}
.setting-title { font-size: 0.85rem; color: #cbd5e1; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px;}
.theme-selector { display: flex; gap: 10px; }
.theme-dot { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: all 0.3s;}
.theme-dot.amethyst { background: #c4b5fd; }
.theme-dot.emerald { background: #6ee7b7; }
.theme-dot.celestial { background: #93c5fd; }
.theme-dot.obsidian { background: #fde047; }
.theme-dot.active { border-color: #fff; transform: scale(1.1); }
.custom-echo-input { width: 100%; padding: 10px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: #fff; font-family: 'Outfit'; margin-bottom: 10px;}
.pin-settings { display: flex; gap: 10px; align-items: center; }
.pin-input { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 8px; color: #fff; font-family: 'Outfit'; width: 100px; text-align:center; letter-spacing: 5px;}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
::-webkit-scrollbar-thumb { background: rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.3); border-radius: 10px; }