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

body {
    font-family: 'Space Mono', 'Courier New', monospace;
    background: #0a0a0f;
    color: #ffffff;
    overflow: hidden;
}

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

.loading-content {
    text-align: center;
}

.cosmic-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(157, 78, 221, 0.2);
    border-top-color: #9d4edd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    font-size: 1.2rem;
    color: #9d4edd;
    margin-bottom: 10px;
}

.loading-subtext {
    font-size: 0.9rem;
    color: #888;
}

#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: 20px 30px;
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.8) 0%, rgba(10, 10, 15, 0) 100%);
    backdrop-filter: blur(10px);
}

.app-title {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, #9d4edd, #d946ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

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

.icon-btn {
    background: rgba(157, 78, 221, 0.2);
    border: 1px solid rgba(157, 78, 221, 0.4);
    color: #fff;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.icon-btn:hover {
    background: rgba(157, 78, 221, 0.4);
    border-color: #9d4edd;
    transform: translateY(-2px);
}

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

.time-display {
    font-size: 6rem;
    font-weight: bold;
    font-family: 'Orbitron', 'Space Mono', monospace;
    background: linear-gradient(135deg, #9d4edd, #d946ef, #6b2c91);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(157, 78, 221, 0.8), 0 0 60px rgba(157, 78, 221, 0.4);
    letter-spacing: 8px;
    animation: glow 3s ease-in-out infinite;
}

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

.date-display {
    font-size: 1.2rem;
    color: #d946ef;
    margin-top: 10px;
    letter-spacing: 2px;
    opacity: 0.9;
}

#cosmic-insights {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background: rgba(26, 26, 46, 0.3);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(157, 78, 221, 0.3);
    border-radius: 16px;
    padding: 20px;
    animation: slideUp 0.5s ease;
}

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

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.panel-header h3 {
    font-size: 1.1rem;
    color: #9d4edd;
}

.refresh-btn {
    background: rgba(157, 78, 221, 0.2);
    border: 1px solid rgba(157, 78, 221, 0.4);
    color: #fff;
    font-size: 1.3rem;
    width: 32px;
    height: 32px;
    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.4);
    transform: rotate(180deg);
}

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

.cosmic-fact {
    font-size: 1rem;
    line-height: 1.6;
    color: #e0e0ff;
}

.loading-insight {
    color: #888;
    font-style: italic;
}

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

.timezone-info {
    font-size: 0.9rem;
    color: #888;
}

.berrry-link {
    color: #d946ef;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.berrry-link:hover {
    color: #9d4edd;
}

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

.modal-content {
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid rgba(157, 78, 221, 0.4);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    font-size: 1.4rem;
    color: #9d4edd;
}

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

.close-btn:hover {
    color: #9d4edd;
}

.modal-body {
    padding: 25px;
}

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

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

.setting-group input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
}

.setting-group input[type="range"] {
    width: 100%;
    margin-top: 8px;
}

.setting-group select {
    width: 100%;
    padding: 8px;
    background: rgba(157, 78, 221, 0.1);
    border: 1px solid rgba(157, 78, 221, 0.3);
    border-radius: 8px;
    color: #fff;
    margin-top: 8px;
}

#particle-count-label {
    margin-left: 10px;
    color: #9d4edd;
}

@media (max-width: 768px) {
    .time-display {
        font-size: 3.5rem;
        letter-spacing: 4px;
    }
    
    .date-display {
        font-size: 1rem;
    }
    
    .app-title {
        font-size: 1.2rem;
    }
    
    #cosmic-insights {
        width: 95%;
        padding: 15px;
        bottom: 80px;
    }
    
    .cosmic-fact {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .time-display {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }
}