:root {
    --gold: #D4AF37;
    --dark-blue: #0A0A0A; 
    --text-light: rgba(255, 255, 255, 0.8);
    --border-color: rgba(212, 175, 55, 0.2);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
    font-family: 'Inter', sans-serif;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
    background-color: var(--dark-blue);
    /* ** THE FIX: Darker background using a layered gradient ** */
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('img/background.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

#top-right-controls {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 101;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

#developer-link, #info-btn, #guide-btn {
    background: rgba(30, 30, 30, 0.5);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

#developer-link { color: var(--text-light); padding: 0.4rem 0.8rem; border-radius: 20px; font-size: 0.75rem; text-decoration: none; border: 1px solid var(--border-color); }
#developer-link:hover { background: rgba(212, 175, 55, 0.2); color: var(--gold); }
#info-btn, #guide-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-color); color: var(--text-light); cursor: pointer; }
#info-btn { font-family: 'Times New Roman', serif; font-style: italic; font-size: 1rem; }
#guide-btn { font-family: sans-serif; font-weight: bold; font-size: 1rem; }
#info-btn:hover, #guide-btn:hover { background: rgba(212, 175, 55, 0.2); color: var(--gold); transform: scale(1.1); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

#main-title {
    position: fixed;
    top: 1.5rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: clamp(1.5rem, 4vw, 1.75rem);
    font-weight: 600;
    color: var(--gold);
    text-shadow: 0 0 15px var(--gold), 0 0 25px rgba(212, 175, 55, 0.4);
    z-index: 100;
    pointer-events: none;
    animation: fadeIn 0.8s ease-out;
}

#header {
    position: fixed;
    top: 4.5rem;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    pointer-events: none;
}
#header > * { pointer-events: all; }

#subtitle {
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    font-weight: 400;
    font-style: italic;
    color: var(--text-light);
    max-width: 600px;
    line-height: 1.6;
    animation: fadeInUp 0.8s ease-out 0.2s;
    animation-fill-mode: backwards;
}

#random-verse-btn {
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: var(--gold);
    padding: 0.8rem 1.75rem;
    border-radius: 50px;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
    animation: fadeInUp 0.8s ease-out 0.4s;
    animation-fill-mode: backwards;
    backdrop-filter: blur(5px);
}
#random-verse-btn:hover { background: rgba(212, 175, 55, 0.3); transform: scale(1.05); box-shadow: 0 0 30px rgba(212, 175, 55, 0.4); }

#viz-container { position: fixed; top: 0; left: 0; right: 0; bottom: 0; cursor: grab; }
#viz-container:active { cursor: grabbing; }

#network-controls {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.control-btn {
    width: 44px; height: 44px;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 50%; color: var(--gold);
    font-size: 1.5rem; font-weight: 300; cursor: pointer;
    transition: all 0.2s ease;
    display: flex; align-items: center; justify-content: center;
}
.control-btn:hover { background: rgba(212, 175, 55, 0.2); transform: scale(1.1); }

/* ** THE FIX: Hamburger Menu and Mobile Layout ** */
#hamburger-btn {
    display: none; /* Hidden by default */
    position: fixed;
    top: 1.5rem; right: 1.5rem;
    z-index: 1002;
    width: 44px; height: 44px;
    flex-direction: column;
    justify-content: space-around;
    padding: 12px;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(10px);
}
#hamburger-btn span {
    width: 100%; height: 2px;
    background-color: var(--gold);
    transition: all 0.3s ease;
}
#mobile-menu {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(15px);
    z-index: 1001;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2rem;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#mobile-menu.active { opacity: 1; visibility: visible; }
#mobile-menu a, #mobile-menu button {
    font-size: 1.2rem; color: var(--text-light);
    text-decoration: none; background: none; border: none;
    padding: 1rem;
}
#mobile-menu a:hover, #mobile-menu button:hover { color: var(--gold); }

@media (max-width: 600px) {
    #top-right-controls { display: none; }
    #hamburger-btn { display: flex; }
    #network-controls { display: none; } /* Hide zoom on mobile for cleaner look */
}

/* Modal Styles */
#modal-backdrop, #info-modal-backdrop, #guide-modal-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(10px); z-index: 200; display: none; align-items: center; justify-content: center; padding: 1rem; animation: fadeIn 0.3s ease; }
#modal { background: #111; border: 1px solid var(--border-color); border-radius: 20px; max-width: 800px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 2rem; position: relative; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.modal-close-btn { position: absolute; top: 1rem; right: 1rem; width: 36px; height: 36px; background: rgba(212, 175, 55, 0.1); border: 1px solid rgba(212, 175, 55, 0.3); border-radius: 50%; color: var(--gold); font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.modal-close-btn:hover { background: rgba(212, 175, 55, 0.2); transform: rotate(90deg); }
#modal-header { font-size: 1.25rem; font-weight: 600; color: var(--gold); margin-bottom: 1.5rem; text-align: center; }
#modal-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-bottom: 2rem; }
.tag-pill { padding: 0.5rem 1rem; background: rgba(212, 175, 55, 0.1); border: 1px solid rgba(212, 175, 55, 0.3); border-radius: 20px; font-size: 0.875rem; color: var(--gold); }
#modal-devanagari { font-family: 'Noto Serif Devanagari', serif; font-size: 1.75rem; text-align: center; margin-bottom: 1.5rem; line-height: 1.8; color: #fff; }
#modal-transliteration { font-style: italic; text-align: center; color: var(--text-light); margin-bottom: 1.5rem; font-size: 1.125rem; }
#modal-translation { text-align: center; line-height: 1.8; color: rgba(255, 255, 255, 0.9); margin-bottom: 2rem; font-size: 1.125rem; }
#modal-nav { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
#modal-nav > div { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.nav-btn { padding: 0.75rem 1.5rem; background: rgba(212, 175, 55, 0.1); border: 1px solid rgba(212, 175, 55, 0.3); border-radius: 12px; color: var(--gold); font-weight: 600; cursor: pointer; transition: all 0.2s ease; font-size: 1rem; }
.nav-btn:hover:not(:disabled) { background: rgba(212, 175, 55, 0.2); transform: translateY(-2px); }
.nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.modal-footer-note { width: 100%; text-align: center; font-size: 0.8rem; color: var(--text-light); margin-top: 0.5rem; }
#speaker-btn { position: absolute; top: 1rem; left: 1rem; width: 36px; height: 36px; background: rgba(212, 175, 55, 0.1); border: 1px solid rgba(212, 175, 55, 0.3); border-radius: 50%; color: var(--gold); font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
#speaker-btn:hover { background: rgba(212, 175, 55, 0.2); transform: scale(1.1); }
.info-header { color: var(--gold); text-align: center; margin-bottom: 1.5rem; font-size: 1.25rem; }
#info-modal-backdrop ul { list-style: none; padding-left: 1rem; margin-bottom: 2rem; }
#info-modal-backdrop li { margin-bottom: 1rem; line-height: 1.6; padding-left: 1.2rem; position: relative; }
#info-modal-backdrop li::before { content: '•'; color: var(--gold); font-weight: bold; position: absolute; left: 0; }
.info-footer { text-align: center; color: var(--text-light); font-style: italic; }
.guide-step { display: none; }
.guide-step.active { display: block; animation: fadeIn 0.5s; }
.guide-text { text-align: center; line-height: 1.7; font-size: 1.1rem; color: var(--text-light); }
#guide-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; }
.guide-nav-btn { background: none; border: none; color: var(--gold); cursor: pointer; font-size: 1rem; padding: 0.5rem 1rem; border-radius: 8px; transition: background-color 0.2s; }
.guide-nav-btn:hover { background-color: rgba(212, 175, 55, 0.1); }
#guide-step-counter { color: var(--text-light); font-size: 0.9rem; }
.toast-notification { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%); background-color: rgba(10, 14, 39, 0.9); backdrop-filter: blur(10px); color: var(--gold); padding: 1rem 1.5rem; border-radius: 12px; border: 1px solid var(--border-color); z-index: 1000; opacity: 0; transition: opacity 0.5s ease, transform 0.5s ease; pointer-events: none; font-size: 0.9rem; }
.toast-notification.show { opacity: 1; transform: translateX(-50%) translateY(-20px); }
.central-media-content { width:100%; height:100%; object-fit: cover; border-radius: 50%; }
.mandala-circle { stroke: var(--gold); stroke-width: 0.5px; fill: white; transition: transform 0.3s ease; cursor: pointer; }
.mandala-group:hover .mandala-circle { transform: scale(1.05); }
.verse-dot { fill: var(--dark-blue); cursor: pointer; }
#loading, #error { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--dark-blue); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 300; padding: 2rem; text-align: center; }
/* ** THE FIX: Matched loading circle size to main circle size ** */
#loading-media-container { width: 220px; height: 220px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 30px rgba(212, 175, 55, 0.5); animation: pulse 2.5s infinite ease-in-out; }
.loading-media-content { width: 100%; height: 100%; object-fit: cover; }
@keyframes pulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(212, 175, 55, .5); } 50% { transform: scale(1.05); box-shadow: 0 0 45px rgba(212, 175, 55, 0.7); } }
#loading-text { margin-top: 1.5rem; font-size: 1.25rem; color: var(--gold); }
#error-message { font-size: 1.5rem; color: var(--gold); max-width: 800px; }