body {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #000;
    overflow: hidden;
    position: relative;
    --sphere-color: transparent; 
}

#appLogo {
    position: fixed;
    top: 30px;
    left: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 900;
    transition: opacity 1s;
    pointer-events: none; /* Let clicks pass through unless on specific interactive parts */
}

.logoBall {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    animation: logoFloat 4s ease-in-out infinite, logoColorCycle 10s linear infinite;
    box-shadow: inset -2px -2px 6px rgba(0,0,0,0.2), inset 2px 2px 6px rgba(255,255,255,0.8);
}

.logoText {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    letter-spacing: 4px;
    font-weight: 300;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.logoText > span {
    display: inline-block;
    opacity: 0;
    animation-fill-mode: forwards;
}

@keyframes fadeIn {
    to { opacity: 0.7; }
}

@keyframes slideFromLeft {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 0.7; }
}

@keyframes slideFromTop {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 0.7; }
}

@keyframes scaleIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 0.7; }
}

@keyframes rotateIn {
    from { transform: rotate(-180deg); opacity: 0; }
    to { transform: rotate(0); opacity: 0.7; }
}

@keyframes slideFromRight {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 0.7; }
}

@keyframes slideFromBottom {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 0.7; }
}

.the-text {
    animation: fadeIn 0.6s ease-out 0s forwards;
}

.o-f1 { 
    font-family: 'Times New Roman', serif; 
    font-weight: bold;
    animation: slideFromLeft 0.6s ease-out 0.5s forwards;
}

.o-f2 { 
    font-family: 'Courier New', monospace; 
    font-weight: bold;
    animation: slideFromTop 0.6s ease-out 1s forwards;
}

.o-f3 { 
    font-family: 'Arial Black', sans-serif; 
    font-weight: bold;
    animation: scaleIn 0.6s ease-out 1.5s forwards;
}

.o-f4 { 
    font-family: 'Georgia', serif; 
    font-weight: bold;
    animation: rotateIn 0.6s ease-out 2s forwards;
}

.o-f5 { 
    font-family: 'Impact', sans-serif; 
    font-weight: bold;
    animation: slideFromRight 0.6s ease-out 2.5s forwards;
}

.o-f6 { 
    font-family: 'Verdana', sans-serif; 
    font-weight: bold;
    animation: slideFromBottom 0.6s ease-out 3s forwards;
}

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

@keyframes logoColorCycle {
    0% { background-color: #ff3333; box-shadow: 0 0 15px #ff3333, inset -2px -2px 6px rgba(0,0,0,0.2); }
    20% { background-color: #ffff33; box-shadow: 0 0 15px #ffff33, inset -2px -2px 6px rgba(0,0,0,0.2); }
    40% { background-color: #33ff33; box-shadow: 0 0 15px #33ff33, inset -2px -2px 6px rgba(0,0,0,0.2); }
    60% { background-color: #33ffff; box-shadow: 0 0 15px #33ffff, inset -2px -2px 6px rgba(0,0,0,0.2); }
    80% { background-color: #3333ff; box-shadow: 0 0 15px #3333ff, inset -2px -2px 6px rgba(0,0,0,0.2); }
    100% { background-color: #ff33ff; box-shadow: 0 0 15px #ff33ff, inset -2px -2px 6px rgba(0,0,0,0.2); }
}

#halCircle {
    width: 60vmin;
    height: 60vmin;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: transparent;
    overflow: hidden;
    transition: background-color 0.1s, box-shadow 0.1s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10vmin;
    font-family: 'Arial', sans-serif;
    color: white;
    z-index: 100;
    box-shadow:
        inset -10px -10px 30px rgba(255, 255, 255, 0.5), 
        inset 10px 10px 30px rgba(0, 0, 0, 0.25), 
        0 0 50px var(--sphere-color);
}

@keyframes shrinkGlow {
    0% {
        box-shadow: inset -10px -10px 30px rgba(255, 255, 255, 0.5), inset 10px 10px 30px rgba(0, 0, 0, 0.25), 0 0 50px var(--sphere-color, #FF0000);
    }
    100% {
        box-shadow: inset -10px -10px 30px rgba(255, 255, 255, 0.5), inset 10px -10px 30px rgba(0, 0, 0, 0.25);
    }
}

.halCircleInactive {
    animation: shrinkGlow 5s forwards;
}

#eclipseBall {
    position: absolute;
    width: 60vmin;
    height: 60vmin;
    border-radius: 50%;
    background-color: black;
    top: 50%;
    left: 100%;
    transform: translateX(120%);
    z-index: 3;
    transition: transform 60s linear, background-color 5s;
    display: none;
}

.star, .galaxy {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 2s, background-color 0.5s;
    transform-origin: 50vw 50vh -500px;
}

.galaxy {
    width: 4px;
    height: 4px;
}

#frequencyText {
    position: fixed;
    bottom: 80px;
    right: 20px;
    transform: translateX(0);
    font-size: 7.2vmin; 
    font-family: 'Tahoma', sans-serif; 
    color: #FF0000;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8), 0 0 4px black, 0 0 2px black;
    transition: color 0.1s, text-shadow 0.1s, opacity 1s;
    text-align: right;
    width: auto;
    opacity: 1;
}

#controls {
    position: fixed;
    bottom: 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    right: 20px;
    z-index: 1000;
    gap: 15px;
}

.toggleMic {
    background: #444444;
    color: #FFF;
    border: none;
    padding: 10px 20px;
    margin-top: 0;
    cursor: pointer;
    transition: background 0.3s, opacity 1s;
    border-radius: 20px;
}

.sensitivitySlider {
    margin-top: 10px;
    width: 300px;
    transition: opacity 1s;
}

.fade {
    opacity: 0;
    pointer-events: none;
}

.fullscreenBtn, .settingsBtn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: #666;
    color: #FFF;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s, opacity 1s, transform 0.2s;
    padding: 0;
    line-height: 1;
}

.fullscreenBtn:hover, .settingsBtn:hover {
    background: #888;
    transform: scale(1.1);
}

body.cursor-hidden, body.cursor-hidden * {
    cursor: none !important;
}

@keyframes fadeOutSequentially {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.fadeOutSequentially {
    animation: fadeOutSequentially 5s forwards;
}

@keyframes floatUpDown {
    0%, 100% {
        transform: translateY(0%);
    }
    25% {
        transform: translateY(-2%);
    }
    50% {
        transform: translateY(0%);
    }
    75% {
        transform: translateY(2%);
    }
}

.floatGlow {
    animation: floatUpDown 60s infinite;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.rotate {
    animation: rotateAroundBall 60s linear infinite;
}

.rotateView {
    perspective: 1000px;
}

/* Settings modal */
#settingsModal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 1;
    transition: opacity 1s;
    backdrop-filter: blur(2px);
}

.modalContent {
    background-color: rgba(15, 15, 15, 0.95);
    background-image: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, transparent 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #eee;
    padding: 0;
    border-radius: 16px;
    width: 380px;
    max-width: 90vw;
    max-height: 85vh; /* Ensure it fits vertically */
    box-shadow: 
        0 20px 60px rgba(0,0,0,0.9), 
        0 0 0 1px rgba(255,255,255,0.08);
    position: relative; 
    border: none;
    display: flex;
    flex-direction: column;
}

.modalContent h3 {
    margin: 0;
    padding: 18px 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
    cursor: grab;
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    flex-shrink: 0;
}

.settingsScrollContainer {
    padding: 24px 30px;
    overflow-y: auto;
    flex-grow: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.settingsScrollContainer::-webkit-scrollbar {
    width: 6px;
}
.settingsScrollContainer::-webkit-scrollbar-track {
    background: transparent;
}
.settingsScrollContainer::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.settingRow {
    margin: 0 0 16px 0;
    padding-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.settingRow:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.settingRow label {
    font-family: 'Segoe UI', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.settingRow.checkboxRow {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}
.settingRow.checkboxRow label {
    width: auto;
}

/* Styled Range Sliders */
.settingRow input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    outline: none;
    border: none;
    transition: background 0.3s;
    margin: 0;
}

.settingRow input[type="range"]:hover {
    background: rgba(255,255,255,0.15);
}

.settingRow input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #fff;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: 0 0 10px rgba(255,255,255,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 0;
}

.settingRow input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(255,255,255,0.5);
}

.settingRow input[type="range"]::-moz-range-track {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    border: none;
}

.settingRow input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #fff;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.settingRow input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    background-color: rgba(255,255,255,0.05);
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    display: grid;
    place-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.settingRow input[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em #fff;
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.settingRow input[type="checkbox"]:checked {
    background-color: #333;
    border-color: #fff;
}

.settingRow input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.modalActions {
    display: none; 
}

/* Save checkmark */
#saveCheck {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(34, 139, 34, 0.95);
    color: #fff;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 20px;
    font-family: Arial, sans-serif;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 8px 20px rgba(0,0,0,0.6);
}

@keyframes flashSave {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1.0); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
}

#saveCheck.show {
    animation: flashSave 500ms ease-out forwards;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .modalContent {
        width: 90vw;
        max-width: 360px;
        /* max-height is handled by main class to fit screen */
    }
    
    .modalContent h3 {
        font-size: 12px;
        padding: 15px 0;
    }
    
    .settingsScrollContainer {
        padding: 15px 20px;
    }
    
    .settingRow {
        margin-bottom: 12px;
        padding-bottom: 12px;
        gap: 8px;
    }
    
    .settingRow label {
        font-size: 10px;
    }
    
    .settingRow input[type="range"] {
        height: 6px; 
    }
    
    .settingRow input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }
}