* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: #000000;
    color: #ffffff;
    overflow: hidden;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #0a0514 0%, #000000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-content {
    text-align: center;
    max-width: 400px;
}

.cosmic-spinner {
    width: 100px;
    height: 100px;
    position: relative;
    margin: 0 auto 30px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: #9d4edd;
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: #d946ef;
    animation-duration: 2s;
    animation-delay: -0.5s;
}

.spinner-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: #c084fc;
    animation-duration: 2.5s;
    animation-delay: -1s;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    color: #9d4edd;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(157, 78, 221, 0.8);
}

.loading-subtext {
    font-size: 0.95rem;
    color: #888;
    margin-bottom: 25px;
}

.loading-bar {
    width: 100%;
    height: 4px;
    background: rgba(157, 78, 221, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #9d4edd, #d946ef);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.8);
}

#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#ui-overlay > * {
    pointer-events: auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 35px;
    background: linear-gradient(180deg, rgba(10, 5, 20, 0.9) 0%, rgba(10, 5, 20, 0) 100%);
    backdrop-filter: blur(15px);
}

.app-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, #9d4edd, #d946ef, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
    text-shadow: 0 0 30px rgba(157, 78, 221, 0.6);
    animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.4); }
}

.top-controls {
    display: flex;
    gap: 12px;
}

.icon-btn {
    background: rgba(157, 78, 221, 0.25);
    border: 2px solid rgba(157, 78, 221, 0.5);
    color: #fff;
    font-size: 1.3rem;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(157, 78, 221, 0.3);
}

.icon-btn:hover {
    background: rgba(157, 78, 221, 0.5);
    border-color: #9d4edd;
    transform: translateY(-3px);
    box-shadow: 0 6px 30px rgba(157, 78, 221, 0.6);
}

#clock-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.time-display {
    font-size: 8rem;
    font-weight: 900;
    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, #9d4edd, #d946ef, #c084fc, #6b2c91);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    letter-spacing: 12px;
    animation: gradientShift 5s ease infinite, glow 3s ease-in-out infinite;
    transition: transform 0.2s ease;
    filter: drop-shadow(0 0 30px rgba(157, 78, 221, 0.8));
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes glow {
    0%, 100% { filter: brightness(1) drop-shadow(0 0 30px rgba(157, 78, 221, 0.8)); }
    50% { filter: brightness(1.5) drop-shadow(0 0 60px rgba(157, 78, 221, 1)); }
}

.date-display {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    color: #d946ef;
    margin-top: 15px;
    letter-spacing: 3px;
    opacity: 0.95;
    text-shadow: 0 0 20px rgba(217, 70, 239, 0.6);
}

#cosmic-insights {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 700px;
    background: rgba(26, 26, 46, 0.4);
    backdrop-filter: blur(25px);
    border: 2px solid rgba(157, 78, 221, 0.4);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 40px rgba(157, 78, 221, 0.3),
                inset 0 0 40px rgba(157, 78, 221, 0.1);
    animation: slideUp 0.6s ease;
    transition: opacity 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 30px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(157, 78, 221, 0.3);
}

.panel-header h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: #9d4edd;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(157, 78, 221, 0.6);
}

.refresh-btn {
    background: rgba(157, 78, 221, 0.3);
    border: 2px solid rgba(157, 78, 221, 0.5);
    color: #fff;
    font-size: 1.4rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn:hover {
    background: rgba(157, 78, 221, 0.6);
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.8);
}

.insight-content {
    min-height: 80px;
}

.cosmic-fact {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #e0e0ff;
    text-shadow: 0 0 10px rgba(224, 224, 255, 0.3);
}

.loading-insight {
    color: #9d4edd;
    font-style: italic;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.oracle-footer {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(157, 78, 221, 0.2);
}

.oracle-status {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

.bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 25px 35px;
    background: linear-gradient(0deg, rgba(10, 5, 20, 0.9) 0%, rgba(10, 5, 20, 0) 100%);
    backdrop-filter: blur(15px);
}

.bottom-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timezone-info {
    font-size: 0.95rem;
    color: #c084fc;
}

.timezone-info .label {
    color: #888;
    margin-right: 8px;
}

.mantra {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: #d946ef;
    font-style: italic;
    opacity: 0.8;
}

.berrry-link {
    color: #d946ef;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(217, 70, 239, 0.4);
}

.berrry-link:hover {
    color: #9d4edd;
    text-shadow: 0 0 20px rgba(157, 78, 221, 0.8);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.98), rgba(15, 10, 30, 0.98));
    border: 2px solid rgba(157, 78, 221, 0.5);
    border-radius: 20px;
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(157, 78, 221, 0.4);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid rgba(157, 78, 221, 0.3);
}

.modal-header h2 {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    color: #9d4edd;
    font-weight: 700;
    letter-spacing: 2px;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.close-btn:hover {
    color: #9d4edd;
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.setting-group {
    margin-bottom: 25px;
}

.setting-title {
    display: block;
    color: #c084fc;
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: 500;
}

.setting-group label {
    display: block;
    color: #e0e0ff;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.setting-group input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #9d4edd;
}

.setting-group input[type="range"] {
    width: 100%;
    margin-top: 8px;
    accent-color: #9d4edd;
    height: 6px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #888;
}

#intensity-label,
#particle-count-label,
#speed-label {
    color: #9d4edd;
    font-weight: 600;
}

.setting-group select {
    width: 100%;
    padding: 10px;
    background: rgba(157, 78, 221, 0.15);
    border: 2px solid rgba(157, 78, 221, 0.4);
    border-radius: 10px;
    color: #fff;
    margin-top: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-group select:hover {
    background: rgba(157, 78, 221, 0.25);
    border-color: #9d4edd;
}

/* Presence mode styles */
#ui-overlay.mode-meditation .top-bar,
#ui-overlay.mode-meditation .bottom-bar {
    opacity: 0.3;
}

#ui-overlay.mode-oracle #clock-display {
    transform: translate(-50%, -60%);
}

/* Responsive */
@media (max-width: 768px) {
    .time-display {
        font-size: 4.5rem;
        letter-spacing: 6px;
    }
    
    .date-display {
        font-size: 1.1rem;
    }
    
    .app-title {
        font-size: 1.3rem;
        letter-spacing: 2px;
    }
    
    #cosmic-insights {
        width: 95%;
        padding: 18px;
        bottom: 100px;
    }
    
    .cosmic-fact {
        font-size: 0.95rem;
    }
    
    .bottom-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .time-display {
        font-size: 3rem;
        letter-spacing: 4px;
    }
    
    .date-display {
        font-size: 0.95rem;
    }
    
    .app-title {
        font-size: 1.1rem;
    }
    
    .icon-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

/* Scrollbar styling */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(157, 78, 221, 0.5);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(157, 78, 221, 0.8);
}