/* -------------------------------------------------------------
   nOracle Celestial CSS Design System
   A premium, state-of-the-art stylesheet with rich cosmic assets,
   glassmorphism, interactive highlights, and modular animations.
   ------------------------------------------------------------- */

/* Reset & Basic Variables */
:root {
    --bg-deep: #040209;
    --bg-space: #0a0715;
    --bg-card: rgba(14, 11, 28, 0.45);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    
    /* Typography */
    --font-serif: 'Cinzel', Georgia, serif;
    --font-serif-dec: 'Cinzel Decorative', Georgia, serif;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Color Palette */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    /* Scripture Themes */
    --accent-torah: #dfa871;
    --accent-torah-rgb: 223, 168, 113;
    
    --accent-bible: #a855f7;
    --accent-bible-rgb: 168, 85, 247;
    
    --accent-quran: #10b981;
    --accent-quran-rgb: 16, 185, 129;
    
    --accent-universal: #0ea5e9;
    --accent-universal-rgb: 14, 165, 233;
    
    /* Neon Globals */
    --neon-gold: #f59e0b;
    --neon-rose: #f43f5e;
    
    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Stars Canvas */
#space-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Buttons and Common UI */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
    transition: var(--transition-smooth);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-weight: 500;
    border-radius: 8px;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--border-hover);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-glow {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3) 0%, rgba(14, 165, 233, 0.3) 100%);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
}
.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.15);
    color: var(--neon-rose);
    border: 1px solid rgba(244, 63, 94, 0.25);
}
.btn-danger:hover {
    background: rgba(244, 63, 94, 0.3);
    color: #fff;
    box-shadow: 0 0 15px rgba(244, 63, 94, 0.2);
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}
.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: rotate(90deg);
}
/* Glassmorphism Panel */
.card-glass {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.brand {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
}

.glow-title {
    font-family: var(--font-serif-dec);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, #fff 30%, var(--accent-universal) 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(14, 165, 233, 0.3);
}

.subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-top: 4px;
}

.entropy-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.altar-section .entropy-status {
    margin-top: 15px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
    display: inline-block;
}

.pulse-indicator.active {
    background-color: var(--accent-quran);
    box-shadow: 0 0 10px var(--accent-quran);
    animation: beacon 2s infinite;
}

.pulse-indicator.quantum {
    background-color: var(--accent-universal);
    box-shadow: 0 0 12px var(--accent-universal);
    animation: beacon 1s infinite;
}

/* Base Screens Setup */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    min-height: calc(100vh - 100px);
}

.screen {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.screen.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Altar Screen: Vessel and Setup */
.altar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 60px;
}

.altar-vessel-container {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.altar-glow {
    position: absolute;
    width: 140%;
    height: 140%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, rgba(0,0,0,0) 70%);
    z-index: 1;
    transition: var(--transition-smooth);
}

.altar-glow.active {
    background: radial-gradient(circle, rgba(14, 165, 233, 0.2) 0%, rgba(168, 85, 247, 0.05) 50%, rgba(0,0,0,0) 75%);
    animation: floatGlow 4s ease-in-out infinite alternate;
}

.altar-vessel {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 30%, #1e1b38 0%, #0d0b1d 100%);
    border: 3px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 8px 16px rgba(0, 0, 0, 0.8), 0 10px 20px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 25px;
    transition: var(--transition-smooth);
}

.altar-vessel:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.vessel-base {
    position: absolute;
    bottom: -15px;
    width: 110px;
    height: 18px;
    background: #090714;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    z-index: 1;
}

.active-visual {
    position: absolute;
    bottom: 40px;
    width: 100%;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    pointer-events: none;
    z-index: 3;
}

/* Altar Offerings Elements */
.incense-stick {
    width: 3px;
    height: 50px;
    background: linear-gradient(to top, #4a3b32, #cf8b57);
    border-radius: 2px;
    position: relative;
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
}
.incense-cherry {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: #f97316;
    border-radius: 50%;
    box-shadow: 0 0 10px #f97316, 0 0 20px #ef4444;
    animation: coalBurn 2s infinite alternate;
}
.smoke-particle {
    position: absolute;
    bottom: 50px;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    filter: blur(4px);
    animation: riseSmoke 4s var(--ease-out) infinite;
}

.candle-wax {
    width: 35px;
    height: 55px;
    background: linear-gradient(to right, #e2e8f0, #cbd5e1, #94a3b8);
    border-radius: 6px 6px 3px 3px;
    position: relative;
    box-shadow: inset -5px 0 10px rgba(0,0,0,0.2), 0 5px 15px rgba(0,0,0,0.4);
}
.candle-wick {
    width: 2px;
    height: 8px;
    background: #000;
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
}
.candle-flame {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 26px;
    background: linear-gradient(to bottom, #ffedd5 0%, #f97316 40%, #ea580c 80%, #1d4ed8 100%);
    border-radius: 50% 50% 20% 20% / 60% 60% 40% 40%;
    box-shadow: 0 0 20px #f97316, 0 0 40px rgba(234, 88, 12, 0.4);
    animation: flameFlicker 0.15s infinite alternate;
    transform-origin: bottom center;
}

.meditation-wave {
    position: absolute;
    bottom: 10px;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(14, 165, 233, 0.4);
    border-radius: 50%;
    animation: breatheRing 8s ease-in-out infinite;
}

/* Altar Controls */
.altar-controls {
    text-align: center;
    max-width: 600px;
}

.altar-prompt {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    white-space: nowrap;
}

.altar-sub {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.offering-options {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.offering-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 14px 16px;
    min-width: 125px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.offering-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.offering-btn.active {
    background: rgba(168, 85, 247, 0.08);
    border-color: rgba(168, 85, 247, 0.4);
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
}

.offering-icon {
    font-size: 1.4rem;
    color: var(--accent-universal);
}
.offering-btn.active .offering-icon {
    color: #e9d5ff;
    animation: slowSpin 6s linear infinite;
}

.offering-name {
    font-size: 0.95rem;
    font-weight: 600;
}

.offering-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Sacred Deck: Book Selection Grid */
.deck-section {
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 50px;
    transition: var(--transition-smooth);
}

.deck-section.locked {
    filter: blur(4px);
    pointer-events: none;
}

.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 2, 9, 0.3);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.deck-section:not(.locked) .lock-overlay {
    opacity: 0;
    pointer-events: none;
}

.lock-card {
    background: rgba(13, 10, 29, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-glass);
    padding: 30px 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.lock-card i {
    font-size: 2.2rem;
    color: var(--accent-torah);
    animation: lockHover 2s infinite ease-in-out;
}

.lock-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.section-title {
    font-family: var(--font-serif);
    text-align: center;
    margin-bottom: 40px;
    letter-spacing: 0.1em;
    font-size: 1.8rem;
    text-transform: uppercase;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    position: relative;
    z-index: 5;
}

.sacred-card {
    height: 360px;
    perspective: 1000px;
}

.card-inner {
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    transition: border-color 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
}

.card-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    border-radius: 50%;
    filter: blur(40px);
    z-index: -1;
    opacity: 0.05;
    transition: opacity 0.4s ease;
}

.card-icon {
    font-size: 2.6rem;
    margin-bottom: 25px;
    transition: transform 0.4s var(--ease-out);
}

.card-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: auto;
}

.card-btn {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 20px;
    border-radius: 20px;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.4s ease;
}

/* Torah Card Aesthetics */
.sacred-card.torah .card-glow { background: radial-gradient(circle, var(--accent-torah) 0%, rgba(0,0,0,0) 70%); }
.sacred-card.torah .card-icon { color: var(--accent-torah); }
.sacred-card.torah:hover .card-inner {
    border-color: rgba(var(--accent-torah-rgb), 0.4);
    box-shadow: 0 15px 45px rgba(var(--accent-torah-rgb), 0.15);
    transform: translateY(-8px);
}
.sacred-card.torah:hover .card-glow { opacity: 0.18; }
.sacred-card.torah:hover .card-btn {
    background: rgba(var(--accent-torah-rgb), 0.15);
    border-color: var(--accent-torah);
    color: var(--accent-torah);
    box-shadow: 0 0 15px rgba(var(--accent-torah-rgb), 0.3);
}

/* Bible Card Aesthetics */
.sacred-card.bible .card-glow { background: radial-gradient(circle, var(--accent-bible) 0%, rgba(0,0,0,0) 70%); }
.sacred-card.bible .card-icon { color: var(--accent-bible); }
.sacred-card.bible:hover .card-inner {
    border-color: rgba(var(--accent-bible-rgb), 0.4);
    box-shadow: 0 15px 45px rgba(var(--accent-bible-rgb), 0.15);
    transform: translateY(-8px);
}
.sacred-card.bible:hover .card-glow { opacity: 0.18; }
.sacred-card.bible:hover .card-btn {
    background: rgba(var(--accent-bible-rgb), 0.15);
    border-color: var(--accent-bible);
    color: var(--accent-bible);
    box-shadow: 0 0 15px rgba(var(--accent-bible-rgb), 0.3);
}

/* Quran Card Aesthetics */
.sacred-card.quran .card-glow { background: radial-gradient(circle, var(--accent-quran) 0%, rgba(0,0,0,0) 70%); }
.sacred-card.quran .card-icon { color: var(--accent-quran); }
.sacred-card.quran:hover .card-inner {
    border-color: rgba(var(--accent-quran-rgb), 0.4);
    box-shadow: 0 15px 45px rgba(var(--accent-quran-rgb), 0.15);
    transform: translateY(-8px);
}
.sacred-card.quran:hover .card-glow { opacity: 0.18; }
.sacred-card.quran:hover .card-btn {
    background: rgba(var(--accent-quran-rgb), 0.15);
    border-color: var(--accent-quran);
    color: var(--accent-quran);
    box-shadow: 0 0 15px rgba(var(--accent-quran-rgb), 0.3);
}

/* Universal Card Aesthetics */
.sacred-card.universal .card-glow { background: radial-gradient(circle, var(--accent-universal) 0%, rgba(0,0,0,0) 70%); }
.sacred-card.universal .card-icon { color: var(--accent-universal); }
.sacred-card.universal:hover .card-inner {
    border-color: rgba(var(--accent-universal-rgb), 0.4);
    box-shadow: 0 15px 45px rgba(var(--accent-universal-rgb), 0.15);
    transform: translateY(-8px);
}
.sacred-card.universal:hover .card-glow { opacity: 0.18; }
.sacred-card.universal:hover .card-btn {
    background: rgba(var(--accent-universal-rgb), 0.15);
    border-color: var(--accent-universal);
    color: var(--accent-universal);
    box-shadow: 0 0 15px rgba(var(--accent-universal-rgb), 0.3);
}

.sacred-card:hover .card-icon {
    transform: scale(1.15) translateY(-5px);
}

/* Scanning Entropy Screen */
.scanner-container {
    max-width: 600px;
    margin: 50px auto;
}

.scanner-box {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    backdrop-filter: blur(15px);
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

.scanner-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}

.scanner-subtitle {
    font-size: 0.85rem;
    color: var(--accent-universal);
    margin-bottom: 30px;
}

.hex-grid-container {
    height: 180px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hex-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    padding: 15px;
    font-family: monospace;
    font-size: 1.1rem;
    width: 100%;
    color: var(--text-muted);
}

.hex-byte {
    transition: color 0.1s ease;
}
.hex-byte.active {
    color: var(--accent-universal);
    text-shadow: 0 0 8px var(--accent-universal);
    font-weight: bold;
}

.scanner-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 25px;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, var(--accent-bible), var(--accent-universal));
    box-shadow: 0 0 10px var(--accent-universal);
    transition: width 0.1s linear;
}

.resolver-terminal {
    font-family: monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: left;
    height: 80px;
    overflow-y: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.resolver-terminal div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sanctuary Verse Chamber Layout */
.sanctuary-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 30px;
    align-items: start;
    margin-top: 20px;
}

.verse-chamber {
    padding: 50px 60px;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

/* Badge mapping color styles */
.scripture-badge {
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.scripture-badge.torah {
    background: rgba(var(--accent-torah-rgb), 0.15);
    color: var(--accent-torah);
    border-color: rgba(var(--accent-torah-rgb), 0.3);
}
.scripture-badge.bible {
    background: rgba(var(--accent-bible-rgb), 0.15);
    color: var(--accent-bible);
    border-color: rgba(var(--accent-bible-rgb), 0.3);
}
.scripture-badge.quran {
    background: rgba(var(--accent-quran-rgb), 0.15);
    color: var(--accent-quran);
    border-color: rgba(var(--accent-quran-rgb), 0.3);
}

.reference-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 15px;
    letter-spacing: 0.05em;
}

.chamber-body {
    margin: 40px 0;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Premium Bilingual Displays */
.original-script {
    font-family: 'Amiri', 'Traditional Arabic', 'Cinzel', Georgia, serif;
    font-size: 1.8rem;
    line-height: 2.2;
    text-align: right;
    direction: rtl;
    color: #e2e8f0;
    padding-bottom: 25px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
}

.verse-text {
    font-family: var(--font-serif);
    font-size: 1.45rem;
    line-height: 1.8;
    color: #f8fafc;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0.02em;
    position: relative;
    padding-left: 20px;
    border-left: 3px solid rgba(255, 255, 255, 0.1);
}

.chamber-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 25px;
}

.entropy-signature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.entropy-signature i {
    color: var(--accent-universal);
}

.sanctuary-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* History Side Drawer */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 380px;
    height: 100vh;
    background: rgba(6, 4, 11, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-right: 1px solid var(--border-glass);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.4s var(--ease-out);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.4);
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.empty-history-msg {
    font-size: 0.88rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.6;
    margin-top: 40px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.history-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 18px;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.history-item-ref {
    font-family: var(--font-serif);
    font-size: 0.88rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.history-item-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer {
    padding: 25px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modals Overlay Base */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 2, 7, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-card {
    width: 100%;
    max-width: 650px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.4s var(--ease-out);
    overflow: hidden;
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: bold;
    letter-spacing: 0.05em;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

/* Deepen modal surrounding context */
.context-verse-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    line-height: 1.6;
    font-size: 0.95rem;
}

.context-verse-item.highlighted {
    background: rgba(168, 85, 247, 0.05);
    border-left: 3px solid var(--accent-bible);
    padding-left: 15px;
    border-radius: 0 8px 8px 0;
}

.context-num {
    font-weight: bold;
    color: var(--accent-universal);
    margin-right: 8px;
}

.informative-content h3 {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    margin: 25px 0 10px 0;
    color: var(--accent-torah);
    letter-spacing: 0.05em;
}
.informative-content h3:first-of-type {
    margin-top: 0;
}

.informative-content p {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.informative-content blockquote {
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid var(--accent-universal);
    padding: 10px 15px;
    font-style: italic;
    font-size: 0.85rem;
    margin: 15px 0;
}

.informative-content ul {
    list-style: none;
    margin-bottom: 20px;
}

.informative-content li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding-left: 15px;
    position: relative;
}

.informative-content li::before {
    content: "•";
    color: var(--accent-torah);
    position: absolute;
    left: 0;
}

.loader-spinner {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Animations */
@keyframes beacon {
    0% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.4); opacity: 1; box-shadow: 0 0 15px cubic-bezier(0,0,1,1); }
    100% { transform: scale(1); opacity: 0.6; }
}

@keyframes floatGlow {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

@keyframes lockHover {
    0% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}

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

@keyframes coalBurn {
    0% { opacity: 0.8; filter: drop-shadow(0 0 2px #ea580c); }
    100% { opacity: 1; filter: drop-shadow(0 0 8px #f97316); }
}

@keyframes riseSmoke {
    0% {
        transform: translateY(0) scale(0.6) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    50% {
        transform: translateY(-60px) scale(1.3) translateX(15px);
        opacity: 0.15;
    }
    100% {
        transform: translateY(-110px) scale(2) translateX(-20px);
        opacity: 0;
    }
}

@keyframes flameFlicker {
    0% { transform: translateX(-50%) scaleX(0.95) rotate(-1deg); }
    100% { transform: translateX(-50%) scaleX(1.05) rotate(1deg) scaleY(1.05); }
}

@keyframes breatheRing {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    50% {
        transform: scale(4.5);
        opacity: 0;
    }
    100% {
        transform: scale(0.8);
        opacity: 0;
    }
}

/* Singing Bowl Styles */
.singing-bowl-container {
    position: absolute;
    bottom: 0px;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}
.singing-bowl {
    width: 64px;
    height: 38px;
    background: linear-gradient(135deg, #e5c158 0%, #b8860b 50%, #5d4002 100%);
    border-radius: 0 0 32px 32px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 4px 8px rgba(255,255,255,0.2), 0 8px 16px rgba(0,0,0,0.6);
    position: relative;
    transform-origin: bottom center;
}
.singing-bowl.struck {
    animation: bowlVibrate 0.1s infinite alternate;
}
.bowl-ripple {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 1.5px solid rgba(229, 193, 88, 0.6);
    border-radius: 50%;
    animation: expandResonance 3s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
    pointer-events: none;
}

/* Water Pouring Styles */
.water-pitcher {
    position: absolute;
    top: 5px;
    right: 25px;
    width: 24px;
    height: 38px;
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
    border-radius: 6px 12px 10px 10px;
    transform: rotate(-35deg);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.water-pitcher::after {
    content: "";
    position: absolute;
    top: 4px;
    left: -8px;
    width: 12px;
    height: 8px;
    background: inherit;
    border-radius: 50% 0 0 50%;
    transform: rotate(15deg);
}
.water-drop {
    position: absolute;
    top: 15px;
    width: 6px;
    height: 10px;
    background: linear-gradient(to bottom, #60a5fa, #2563eb);
    border-radius: 50% 50% 3px 3px;
    animation: fallDrop 0.8s cubic-bezier(0.5, 0.05, 0.8, 0.5) forwards;
}
.water-ripple {
    position: absolute;
    bottom: -5px;
    width: 16px;
    height: 8px;
    border: 1.5px solid rgba(96, 165, 250, 0.5);
    border-radius: 50%;
    transform-origin: center;
    animation: expandWaterRipple 1.2s ease-out forwards;
}

/* New Altar Keyframe Animations */
@keyframes bowlVibrate {
    0% { transform: scale(1.02) rotate(-0.5deg); }
    100% { transform: scale(1) rotate(0.5deg); }
}
@keyframes expandResonance {
    0% { transform: scale(0.6); opacity: 0.8; filter: blur(0); }
    100% { transform: scale(5.5); opacity: 0; filter: blur(3px); }
}
@keyframes fallDrop {
    0% { transform: translateY(0) scaleY(1.3); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(85px) scaleY(0.7); opacity: 0; }
}
@keyframes expandWaterRipple {
    0% { transform: scale(0.3) rotateX(60deg); opacity: 0.8; }
    100% { transform: scale(3.5) rotateX(60deg); opacity: 0; }
}

/* Prayer Offering Styles */
.prayer-container {
    position: absolute;
    bottom: 25px;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}
.praying-hands {
    font-size: 2.2rem;
    color: #f1f5f9;
    text-shadow: 0 0 10px rgba(229, 193, 88, 0.5);
    animation: handsPulse 2s ease-in-out infinite alternate;
}
.prayer-particle {
    position: absolute;
    bottom: 20px;
    background: radial-gradient(circle, rgba(253, 224, 71, 0.85) 0%, rgba(229, 193, 88, 0.15) 60%, rgba(0,0,0,0) 100%);
    border-radius: 50%;
    animation: risePrayerParticle 4s ease-out infinite;
    pointer-events: none;
}

@keyframes handsPulse {
    0% { transform: scale(0.92); filter: drop-shadow(0 0 4px rgba(229, 193, 88, 0.3)); }
    100% { transform: scale(1.08); filter: drop-shadow(0 0 15px rgba(229, 193, 88, 0.8)); }
}
@keyframes risePrayerParticle {
    0% { transform: translateY(0) scale(0.5) translateX(0); opacity: 0; }
    20% { opacity: 0.9; }
    100% { transform: translateY(-90px) scale(1.8) translateX(25px); opacity: 0; }
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 40px 20px 30px;
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    margin-top: 60px;
    position: relative;
    z-index: 1;
}

/* Responsive Scaling */
@media(max-width: 868px) {
    .app-container {
        padding: 20px 12px;
    }
    .main-header {
        padding: 12px 16px;
    }
    .header-left,
    .header-right {
        flex: 0 0 auto;
    }
    .brand {
        flex: 1;
    }
    .glow-title {
        font-size: 1.5rem;
    }
    .subtitle {
        font-size: 0.65rem;
        letter-spacing: 0.2em;
    }
    .main-header #open-history {
        padding: 0;
        width: 38px;
        height: 38px;
        border-radius: 50%;
    }
    .main-header #open-history span {
        display: none;
    }
    .icon-btn {
        width: 38px;
        height: 38px;
    }
    
    .altar-prompt {
        font-size: clamp(0.82rem, 4.1vw, 1.15rem);
        white-space: nowrap;
        letter-spacing: 0.02em;
    }
    .altar-sub {
        font-size: 0.8rem;
        margin-bottom: 20px;
    }
    .offering-options {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        padding: 0;
        margin: 0;
    }
    .offering-btn {
        display: grid;
        grid-template-columns: 40px 1fr;
        grid-template-rows: auto auto;
        column-gap: 12px;
        row-gap: 2px;
        align-items: center;
        text-align: left;
        padding: 14px 18px;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    .offering-btn .offering-icon {
        grid-column: 1;
        grid-row: 1 / span 2;
        font-size: 1.5rem;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .offering-btn .offering-name {
        grid-column: 2;
        grid-row: 1;
        font-size: 1rem;
        font-weight: 600;
    }
    .offering-btn .offering-desc {
        grid-column: 2;
        grid-row: 2;
        font-size: 0.75rem;
        color: var(--text-muted);
        display: block;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .sacred-card {
        height: 250px;
    }
    .card-inner {
        padding: 25px 20px;
    }
    .card-icon {
        font-size: 2rem;
        margin-bottom: 12px;
    }
    .card-title {
        font-size: 1.25rem;
        margin-bottom: 6px;
    }
    .card-btn {
        padding: 6px 16px;
        margin-top: 12px;
    }

    .scanner-box {
        padding: 25px 20px;
    }
    .scanner-title {
        font-size: 1.25rem;
    }
    .hex-grid-container {
        height: 140px;
    }
    .hex-grid {
        grid-template-columns: repeat(6, 1fr);
        font-size: 0.85rem;
        gap: 4px;
        padding: 10px;
    }

    .sanctuary-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .verse-chamber {
        padding: 30px 20px;
        border-radius: 16px;
    }
    .verse-text {
        font-size: 1.15rem;
        line-height: 1.6;
        padding-left: 15px;
    }
    .original-script {
        font-size: 1.4rem;
        line-height: 2;
        padding-bottom: 15px;
    }
    .entropy-signature {
        font-size: 0.7rem;
        flex-wrap: wrap;
    }
    .sidebar {
        width: 100%;
    }
    .modal-card {
        max-height: 90vh;
    }
    .modal-body {
        padding: 20px;
    }
}
