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

body {
    overflow: hidden;
    background: #000;
    font-family: 'Courier New', monospace;
    color: #fff;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.controls-panel {
    position: fixed;
    right: 20px;
    top: 90px;
    width: 320px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid;
    border-image: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00, #ff00ff) 1;
    border-radius: 10px;
    padding: 20px;
    z-index: 10;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.controls-toggle-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00ffff;
    color: #00ffff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    animation: psychedelic-gradient 3s ease-in-out infinite, title-glow 2s ease-in-out infinite alternate;
    z-index: 1;
}

.controls-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.6);
    background: rgba(0, 255, 255, 0.1);
}

.controls-reset-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #ff00ff;
    color: #ff00ff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
    z-index: 1;
}

.controls-reset-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(255, 0, 255, 0.6);
    background: rgba(255, 0, 255, 0.1);
}

.controls-panel.hidden {
    transform: translateX(350px);
}

.controls-panel h2 {
    text-align: center;
    background: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    animation: psychedelic-text 3s ease-in-out infinite;
}

@keyframes psychedelic-text {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(180deg); }
}

.control-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.control-section:last-child {
    border-bottom: none;
}

.control-section h3 {
    color: #00ffff;
    margin-bottom: 15px;
    text-shadow: 0 0 10px #00ffff;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: #ffff00;
    text-shadow: 0 0 5px #ffff00;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, #ff00ff, #00ffff, #ffff00);
    outline: none;
    opacity: 0.8;
    transition: opacity 0.2s;
    border-radius: 3px;
    -webkit-appearance: none;
}

input[type="range"]:hover {
    opacity: 1;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #fff;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 10px #fff;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #fff;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 10px #fff;
}

input[type="text"] {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

input[type="text"]:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 10px #00ffff;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    vertical-align: middle;
    cursor: pointer;
    accent-color: #00ffff;
}

select {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 10px #00ffff;
}

select option {
    background: #000;
    color: #fff;
}

.connect-btn, .toggle-btn {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: linear-gradient(45deg, #ff00ff, #00ffff);
    border: none;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    animation: connectPulse 2s ease-in-out infinite;
}

.connect-btn:hover, .toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: none;
}

.connect-btn:active, .toggle-btn:active {
    transform: scale(0.95);
}

.status {
    margin-top: 10px;
    text-align: center;
    padding: 5px;
    border-radius: 5px;
    font-size: 12px;
}

.status.connected {
    background: rgba(0, 255, 0, 0.2);
    color: #0f0;
    border: 1px solid #0f0;
}

.status.disconnected {
    background: rgba(255, 0, 0, 0.2);
    color: #f00;
    border: 1px solid #f00;
}

.stats-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 15px;
    border-radius: 5px;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.stats-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.stat-icon {
    font-size: 12px;
    width: 16px;
    text-align: center;
}

.stat-label {
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
}

.stat-label-short {
    display: none;
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
}

.stat-value {
    color: #ff0;
    font-weight: bold;
}

.stat-unit {
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
    font-size: 12px;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .stats-panel {
        bottom: 10px;
        left: 10px;
        padding: 8px 12px;
        border-radius: 8px;
        max-width: calc(100vw - 20px);
    }
    
    .stats-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px 12px;
    }
    
    .stat-item {
        font-size: 12px;
        gap: 4px;
    }
    
    .stat-icon {
        font-size: 10px;
        width: 14px;
    }
    
    .stat-label {
        display: none;
    }
    
    .stat-label-short {
        display: inline;
        font-size: 11px;
    }
    
    .stat-value {
        font-size: 12px;
    }
    
    .stat-unit {
        font-size: 10px;
    }
    
    .stats-footer {
        margin-top: 8px;
        padding-top: 8px;
    }
    
    .social-links svg {
        width: 14px;
        height: 14px;
    }
    
    .version {
        font-size: 10px;
    }
}

.stats-footer {
    margin-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-links {
    display: flex;
    gap: 8px;
}

.social-link {
    color: #00ffff;
    text-decoration: none;
    padding: 4px;
    border-radius: 3px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-link:hover {
    color: #ff00ff;
    background: rgba(255, 0, 255, 0.1);
    transform: scale(1.1);
    text-shadow: 0 0 8px currentColor;
}

.version {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Courier New', monospace;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #ff00ff, #00ffff);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #00ffff, #ff00ff);
}

.floating-controls {
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 10;
    display: flex;
    gap: 10px;
}

.floating-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid;
    border-color: #00ffff;
    color: #00ffff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
    background: rgba(0, 255, 255, 0.1);
}

.floating-btn.muted {
    color: #ff0000;
    border-color: #ff0000;
}

.floating-btn.paused {
    color: #ffff00;
    border-color: #ffff00;
}

.floating-btn.active {
    color: #00ff00;
    border-color: #00ff00;
    background: rgba(0, 255, 0, 0.1);
}

.ether-trip-title {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 15;
    font-size: 32px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    background: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00, #ff00ff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(255, 0, 255, 0.8);
    animation: psychedelic-gradient 3s ease-in-out infinite, title-glow 2s ease-in-out infinite alternate;
    cursor: pointer;
    user-select: none;
    letter-spacing: 2px;
}

@keyframes psychedelic-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes title-glow {
    0% { 
        filter: drop-shadow(0 0 10px rgba(255, 0, 255, 0.8));
        transform: scale(1);
    }
    100% { 
        filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.8));
        transform: scale(1.05);
    }
}

@keyframes fadeIn {
    0% { 
        opacity: 0;
        transform: scale(0.8);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes connectPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0px rgba(255, 255, 255, 0);
    }
    50% { 
        transform: scale(1.025);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
    }
}

/* Welcome Popup Styles */
.welcome-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: welcomePopupFadeIn 0.5s ease-out;
}

.welcome-popup.hidden {
    display: none;
}

.welcome-content {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid;
    border-image: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00, #ff00ff) 1;
    border-radius: 15px;
    padding: 40px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    text-align: center;
    position: relative;
    animation: welcomeContentSlideIn 0.5s ease-out 0.2s both;
}

.welcome-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: psychedelic-text 3s ease-in-out infinite;
    font-family: 'Courier New', monospace;
}

.welcome-subtitle {
    font-size: 1.1em;
    color: #00ffff;
    margin-bottom: 30px;
    text-shadow: 0 0 10px #00ffff;
}

.welcome-body p {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 25px;
    color: #fff;
}

.welcome-features {
    margin: 30px 0;
    text-align: left;
}

.feature {
    display: flex;
    align-items: center;
    margin: 15px 0;
    font-size: 1em;
    color: #fff;
}

.feature-icon {
    font-size: 1.5em;
    margin-right: 15px;
    min-width: 40px;
    text-align: center;
}

.welcome-cta-text {
    font-size: 1.2em;
    font-weight: bold;
    color: #ffff00;
    text-shadow: 0 0 10px #ffff00;
    margin-top: 30px !important;
}

.welcome-actions {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.welcome-connect-btn {
    background: linear-gradient(45deg, #ff00ff, #00ffff);
    border: none;
    color: #000;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: connectPulse 2s ease-in-out infinite;
    min-width: 180px;
}

.welcome-connect-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: none;
}

.welcome-close-btn {
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    padding: 15px 30px;
    font-size: 1.1em;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 180px;
}

.welcome-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #00ffff;
    color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

@keyframes welcomePopupFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes welcomeContentSlideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.welcome-checkbox {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.welcome-checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #fff;
    font-size: 0.9em;
    user-select: none;
}

.welcome-checkbox input[type="checkbox"] {
    display: none;
}

.welcome-checkbox .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #00ffff;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
    background: transparent;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.welcome-checkbox input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(45deg, #ff00ff, #00ffff);
    border-color: #ff00ff;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.5);
}

.welcome-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: "✓";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-weight: bold;
    font-size: 14px;
}

.welcome-checkbox:hover .checkmark {
    border-color: #ff00ff;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.4);
}

/* Mobile responsive styles for welcome popup */
@media (max-width: 768px) {
    .welcome-content {
        padding: 20px;
        margin: 20px;
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 40px);
    }
    
    .welcome-header h1 {
        font-size: 2em;
    }
    
    .welcome-subtitle {
        font-size: 1em;
    }
    
    .welcome-body p {
        font-size: 1em;
    }
    
    .welcome-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .welcome-connect-btn,
    .welcome-close-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .feature {
        font-size: 0.9em;
    }
    
    .feature-icon {
        font-size: 1.3em;
        min-width: 35px;
    }
    
    .welcome-checkbox label {
        font-size: 0.85em;
    }
    
    .welcome-checkbox .checkmark {
        width: 18px;
        height: 18px;
        margin-right: 8px;
    }
    
    /* Fix floating controls for mobile - make them vertical and reverse order */
    .floating-controls {
        flex-direction: column-reverse;
        right: 10px;
        top: 10px;
        gap: 8px;
    }
    
    .floating-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    /* Fix controls panel buttons for mobile */
    .controls-panel {
        right: 10px;
        top: 120px;
        width: calc(100vw - 20px);
        max-width: 320px;
    }
    
    .controls-toggle-btn,
    .controls-reset-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
        top: 6px;
    }
    
    .controls-toggle-btn {
        left: 6px;
        width: 40px !important;
        height: 40px !important;
    }
    
    .controls-toggle-btn:hover {
        transform: scale(1.1);
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
        background: rgba(0, 255, 255, 0.1);
    }
    .controls-reset-btn {
        right: 6px;
    }
    
    .controls-panel h2 {
        margin-top: 8px;
        margin-bottom: 15px;
        font-size: 1.2em;
    }
}