
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
            background: #ffffff;
            color: #000000;
            line-height: 1.4;
            font-weight: 400;
            overflow-x: hidden;
        }

        /* Container improvements for better containment */
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 24px;
            overflow-x: hidden; /* Prevent horizontal overflow */
        }

        /* Remove grid, use simple block layout */
        .content {
            width: 100%;
        }

        /* Typography */
        .display-1 {
            font-size: 48px;
            font-weight: 300;
            letter-spacing: -0.02em;
            line-height: 1.1;
            margin-bottom: 8px;
        }

        .subtitle {
            font-size: 16px;
            font-weight: 400;
            color: #666666;
            letter-spacing: 0.02em;
            text-transform: uppercase;
        }

        .label {
            font-size: 12px;
            font-weight: 500;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            color: #333333;
        }

        .mono {
            font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
            font-size: 14px;
            letter-spacing: 0.05em;
        }

        /* Header */
        .header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-bottom: 1px solid #e0e0e0;
            z-index: 1000;
            padding: 16px 0;
        }

        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .logo {
            font-size: 20px;
            font-weight: 500;
            letter-spacing: -0.01em;
            color: #000000;
        }

        .nav {
            display: flex;
            gap: 32px;
            align-items: center;
        }

        .nav-item {
            font-size: 14px;
            color: #666666;
            text-decoration: none;
            transition: color 0.2s ease;
        }

        .nav-item:hover {
            color: #000000;
        }

        .nav-item.active {
            color: #000000;
            font-weight: 500;
        }

        /* Main Content */
        .main {
            margin-top: 80px;
            padding: 24px 0;
        }

        .hero {
            text-align: left;
            margin-bottom: 32px;
        }

        /* Canvas Section - Much larger by default */
        .visualizer-section {
            margin-bottom: 24px;
        }

        .canvas-container {
            position: relative;
            width: 100%;
            height: 85vh; /* Much larger - takes up 85% of viewport height */
            background: #f8f8f8;
            border: 1px solid #e0e0e0;
            margin-bottom: 24px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .canvas-container.fullwidth {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            z-index: 1000;
            border: none;
            background: #000000; /* Black background for fullscreen */
        }

        /* Fullscreen Controls Panel */
        .fullscreen-controls {
            position: fixed;
            top: 0;
            left: -320px;
            width: 320px;
            height: 100vh;
            background: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(20px);
            border-right: 1px solid rgba(0, 0, 0, 0.1);
            z-index: 1001;
            transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            overflow-y: auto;
            padding: 24px;
            box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
        }

        .fullscreen-controls.visible {
            left: 0;
        }

        .fullscreen-controls-trigger {
            position: fixed;
            top: 50%;
            left: 0;
            width: 48px;
            height: 80px;
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(0, 0, 0, 0.1);
            border-left: none;
            border-radius: 0 8px 8px 0;
            z-index: 1002;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            transform: translateY(-50%);
        }

        .fullscreen-controls-trigger:hover {
            background: rgba(255, 255, 255, 1);
            width: 56px;
        }

        .fullscreen-controls-trigger::before {
            content: '⚙';
            font-size: 20px;
            color: #000000;
            transition: transform 0.3s ease;
        }

        .fullscreen-controls-trigger.active::before {
            transform: rotate(90deg);
        }

        /* Fullscreen panel header */
        .fullscreen-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
            padding-bottom: 16px;
            border-bottom: 1px solid #e0e0e0;
        }

        .fullscreen-title {
            font-size: 18px;
            font-weight: 500;
            color: #000000;
        }

        .fullscreen-close {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #666666;
            transition: color 0.2s ease;
            padding: 4px;
        }

        .fullscreen-close:hover {
            color: #000000;
        }

        /* Compact controls for fullscreen */
        .fullscreen-control-group {
            margin-bottom: 20px;
        }

        .fullscreen-control-group .label {
            margin-bottom: 8px;
            display: block;
        }

        .compact-horizontal {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .compact-btn {
            padding: 6px 12px;
            font-size: 11px;
            min-width: auto;
            flex: 1;
        }

        .compact-slider {
            flex: 1;
            margin-right: 8px;
        }

        .compact-value {
            font-family: 'SF Mono', monospace;
            font-size: 11px;
            color: #666666;
            min-width: 35px;
            text-align: center;
        }

        /* Hide regular controls when in fullscreen */
        .canvas-container.fullwidth ~ .controls {
            display: none;
        }

        .canvas-container.fullwidth ~ .track-info {
            display: none;
        }

        .canvas-container.fullwidth ~ .data-display {
            display: none;
        }

        #visualizerCanvas {
            width: 100%;
            height: 100%;
            display: block;
        }

        /* Controls - Improved layout to maintain order across screen sizes */
        .controls {
            display: grid;
            gap: 24px;
            align-items: start;
            margin-bottom: 24px;
            /* Use explicit grid areas to maintain order */
            grid-template-areas: 
                "audio-source visualization particle-system"
                "audio-filters audio-effects analysis"
                "export export export";
        }

        /* Assign grid areas to maintain logical order */
        .control-group:nth-child(1) { grid-area: audio-source; }      /* Audio Source */
        .control-group:nth-child(2) { grid-area: visualization; }     /* Visualization */
        .control-group:nth-child(3) { grid-area: particle-system; }   /* Particle System */
        .control-group:nth-child(4) { grid-area: audio-filters; }     /* Audio Filters */
        .control-group:nth-child(5) { grid-area: audio-effects; }     /* Audio Effects */
        .control-group:nth-child(6) { grid-area: analysis; }          /* Analysis Settings */
        .control-group:nth-child(7) { grid-area: export; }            /* Export */

        .control-group {
            background: #ffffff;
            border: 1px solid #e0e0e0;
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            min-height: 240px;
        }

        .control-group .label:first-of-type {
            font-size: 14px;
            font-weight: 600;
            color: #000000;
            margin-bottom: 16px;
            padding-bottom: 8px;
            border-bottom: 1px solid #f0f0f0;
        }

        .control-group.horizontal {
            flex-direction: row;
            align-items: center;
            gap: 12px;
        }

        .file-input-wrapper {
            position: relative;
            overflow: hidden;
            display: inline-block;
        }

        .file-input {
            position: absolute;
            left: -9999px;
        }

        .btn {
            background: #000000;
            color: #ffffff;
            border: none;
            padding: 10px 20px;
            font-family: inherit;
            font-size: 12px;
            font-weight: 500;
            letter-spacing: 0.02em;
            text-transform: uppercase;
            cursor: pointer;
            transition: all 0.2s ease;
            display: inline-block;
            text-decoration: none;
            text-align: center;
            min-width: 100px;
        }

        .btn:hover {
            background: #333333;
        }

        .btn:active {
            background: #000000;
            transform: translateY(1px);
        }

        .btn:disabled {
            background: #cccccc;
            color: #666666;
            cursor: not-allowed;
            transform: none;
        }

        .btn-secondary {
            background: #ffffff;
            color: #000000;
            border: 1px solid #000000;
        }

        .btn-secondary:hover {
            background: #000000;
            color: #ffffff;
        }

        .btn-small {
            padding: 6px 12px;
            font-size: 11px;
            min-width: 70px;
        }

        /* Mode Selector */
        .mode-selector {
            display: flex;
            border: 1px solid #000000;
            overflow: hidden;
        }

        .mode-btn {
            background: #ffffff;
            color: #000000;
            border: none;
            border-right: 1px solid #000000;
            padding: 6px 12px;
            font-family: inherit;
            font-size: 11px;
            font-weight: 500;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            cursor: pointer;
            transition: all 0.2s ease;
            flex: 1;
        }

        .mode-btn:last-child {
            border-right: none;
        }

        .mode-btn:hover {
            background: #f0f0f0;
        }

        .mode-btn.active {
            background: #000000;
            color: #ffffff;
        }

        /* Color mode grid layout for better organization */
        .color-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            margin-bottom: 8px;
        }

        .color-grid .mode-selector {
            margin: 0;
        }

        /* Special styling for color mode buttons with previews */
        .color-mode-btn {
            position: relative;
            overflow: hidden;
        }

        .color-mode-btn::before {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 2px;
            transition: all 0.2s ease;
        }

        .color-mode-btn[data-color="mono"]::before {
            background: linear-gradient(to right, #000, #888, #fff);
        }

        .color-mode-btn[data-color="rainbow"]::before {
            background: linear-gradient(to right, #ff0000, #ff8800, #ffff00, #88ff00, #00ff88, #0088ff, #8800ff);
        }

        .color-mode-btn[data-color="fire"]::before {
            background: linear-gradient(to right, #ff4400, #ff6600, #ff8800, #ffaa00, #ffcc00);
        }

        .color-mode-btn[data-color="ocean"]::before {
            background: linear-gradient(to right, #0066cc, #0088cc, #00aaff, #00ccff, #00eeff);
        }

        .color-mode-btn[data-color="neon"]::before {
            background: linear-gradient(to right, #ff00ff, #00ffff, #ffff00, #ff0080, #80ff00);
        }

        .color-mode-btn[data-color="sunset"]::before {
            background: linear-gradient(to right, #ff4444, #ff6644, #ff8844, #ffaa44, #ffcc44, #ffdd88);
        }

        .color-mode-btn[data-color="forest"]::before {
            background: linear-gradient(to right, #228b22, #32cd32, #90ee90, #98fb98, #f0fff0);
        }

        .color-mode-btn[data-color="cosmic"]::before {
            background: linear-gradient(to right, #4b0082, #8a2be2, #9932cc, #ba55d3, #da70d6);
        }

        .color-mode-btn[data-color="cyberpunk"]::before {
            background: linear-gradient(to right, #ff0080, #00ff80, #8000ff, #ff8000, #0080ff);
        }

        .color-mode-btn[data-color="vaporwave"]::before {
            background: linear-gradient(to right, #ff00ff, #00ffff, #ff69b4, #9370db, #00ced1);
        }

        .color-mode-btn[data-color="aurora"]::before {
            background: linear-gradient(to right, #00ff80, #40e0d0, #9370db, #ff69b4, #ffd700);
        }

        .color-mode-btn[data-color="plasma"]::before {
            background: linear-gradient(to right, #ff1493, #ff4500, #ffd700, #00ff7f, #1e90ff);
        }

        /* Slider */
        .slider {
            width: 100%;
            height: 2px;
            background: #e0e0e0;
            outline: none;
            cursor: pointer;
            -webkit-appearance: none;
            appearance: none;
        }

        .slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 16px;
            height: 16px;
            background: #000000;
            cursor: pointer;
            border-radius: 0;
        }

        .slider::-moz-range-thumb {
            width: 16px;
            height: 16px;
            background: #000000;
            cursor: pointer;
            border-radius: 0;
            border: none;
        }

        /* Recording button active state */
        .btn.active {
            background: #ff6b6b !important;
            color: #ffffff !important;
            animation: pulse 1.5s infinite;
        }

        @keyframes pulse {
            0% { opacity: 1; }
            50% { opacity: 0.7; }
            100% { opacity: 1; }
        }

        /* Track Info - Improved layout to prevent cutoff */
        .track-info {
            background: #f8f8f8;
            border: 1px solid #e0e0e0;
            padding: 16px;
            margin-top: 16px;
            max-width: 100%;
            overflow: hidden;
            min-height: 120px; /* Ensure minimum height */
        }

        .track-info.hidden {
            display: none;
        }

        .track-header {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 16px;
            align-items: start;
            margin-bottom: 12px;
            width: 100%;
            min-height: 24px; /* Ensure minimum height for header */
        }

        .track-name {
            font-size: 16px;
            font-weight: 500;
            color: #000000;
            word-wrap: break-word;
            word-break: break-word;
            hyphens: auto;
            line-height: 1.3;
            max-width: 100%;
            overflow-wrap: break-word;
        }

        .track-time {
            font-family: 'SF Mono', monospace;
            font-size: 12px;
            color: #666666;
            white-space: nowrap;
            flex-shrink: 0;
            text-align: right;
            min-width: 50px;
        }

        .progress-container {
            position: relative;
            margin: 16px 0;
            width: 100%;
        }

        .progress-bar {
            width: 100%;
            height: 2px;
            background: #e0e0e0;
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: #000000;
            width: 0%;
            transition: width 0.1s ease;
        }

        .time-display {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-family: 'SF Mono', monospace;
            font-size: 11px;
            color: #666666;
            margin-top: 8px;
            width: 100%;
            min-height: 16px; /* Ensure consistent height */
        }

        .progress-handle {
            position: absolute;
            top: -7px;
            width: 16px;
            height: 16px;
            background: #000000;
            margin-left: -8px;
            transform: translateX(var(--progress, 0%));
            transition: transform 0.1s ease;
        }

        /* Data Display - More compact and properly contained */
        .data-display {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 16px;
            margin-top: 16px;
            max-width: 100%;
        }

        .data-item {
            background: #ffffff;
            border: 1px solid #e0e0e0;
            padding: 12px;
            min-width: 0; /* Allows flexbox items to shrink */
        }

        .data-label {
            font-size: 11px;
            font-weight: 500;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            color: #666666;
            margin-bottom: 4px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .data-value {
            font-family: 'SF Mono', monospace;
            font-size: 14px;
            font-weight: 400;
            color: #000000;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        /* Loading State */
        .loading {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 14px;
            color: #666666;
            letter-spacing: 0.05em;
            text-transform: uppercase;
        }

        .loading::after {
            content: '';
            display: inline-block;
            width: 12px;
            height: 12px;
            border: 1px solid #cccccc;
            border-top: 1px solid #000000;
            margin-left: 8px;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* Swiss Grid Overlay (for development) */
        @media (min-width: 1400px) {
            .controls {
                grid-template-areas: 
                    "audio-source visualization particle-system audio-filters audio-effects analysis"
                    "export export export export export export";
            }
        }

        @media (min-width: 1000px) and (max-width: 1399px) {
            .controls {
                grid-template-areas: 
                    "audio-source visualization particle-system"
                    "audio-filters audio-effects analysis"
                    "export export export";
            }
        }

        @media (max-width: 768px) {
            .canvas-container {
                height: 75vh; /* Slightly smaller on mobile but still large */
            }
            
            .display-1 {
                font-size: 28px;
            }
            
            .nav {
                display: none;
            }
            
            .controls {
                grid-template-areas: 
                    "audio-source"
                    "visualization"
                    "particle-system"
                    "audio-filters"
                    "audio-effects"
                    "analysis"
                    "export";
                grid-template-columns: 1fr;
            }
            
            .color-grid {
                grid-template-columns: 1fr;
            }
            
            .mode-selector {
                flex-direction: column;
            }
            
            .mode-btn {
                border-right: none;
                border-bottom: 1px solid #000000;
            }
            
            .mode-btn:last-child {
                border-bottom: none;
            }

            /* Mobile track info improvements */
            .track-header {
                grid-template-columns: 1fr;
                gap: 8px;
            }

            .track-name {
                font-size: 14px;
                line-height: 1.4;
                margin-bottom: 4px;
            }

            .track-time {
                font-size: 11px;
                text-align: left;
            }
        }

        @media (max-width: 480px) {
            .container {
                padding: 0 16px;
                overflow-x: hidden;
            }
            
            .main {
                padding: 16px 0;
            }
            
            .hero {
                margin-bottom: 20px;
            }
            
            .canvas-container {
                height: 70vh;
            }
            
            .track-info {
                padding: 12px;
                min-height: 100px;
            }

            .track-header {
                margin-bottom: 8px;
            }
            
            .track-name {
                font-size: 13px;
                line-height: 1.3;
            }

            .time-display {
                font-size: 10px;
                margin-top: 6px;
            }
            
            .controls {
                gap: 16px;
            }
            
            .control-group {
                padding: 16px;
                min-height: 180px;
            }
        }

        /* Rave Mode Styles - Less intense but still fun */
        .canvas-container.rave {
            animation: raveGlow 0.8s infinite alternate, raveRotate 8s infinite linear;
            border: 2px solid #ff66cc;
        }

        @keyframes raveGlow {
            0% {
                box-shadow: 0 0 15px rgba(255, 102, 204, 0.4), inset 0 0 10px rgba(102, 204, 255, 0.2);
            }
            25% {
                box-shadow: 0 0 20px rgba(102, 204, 255, 0.4), inset 0 0 15px rgba(255, 255, 102, 0.2);
            }
            50% {
                box-shadow: 0 0 25px rgba(255, 255, 102, 0.4), inset 0 0 10px rgba(255, 102, 204, 0.2);
            }
            75% {
                box-shadow: 0 0 20px rgba(102, 255, 102, 0.4), inset 0 0 15px rgba(255, 102, 102, 0.2);
            }
            100% {
                box-shadow: 0 0 30px rgba(255, 102, 102, 0.4), inset 0 0 10px rgba(102, 204, 255, 0.2);
            }
        }

        @keyframes raveRotate {
            from {
                filter: hue-rotate(0deg) saturate(1.2);
            }
            to {
                filter: hue-rotate(360deg) saturate(1.2);
            }
        }

        /* Rave button active state */
        .btn.rave-active {
            background: linear-gradient(45deg, #ff0080, #0080ff, #80ff00, #ff8000) !important;
            background-size: 400% 400% !important;
            animation: raveButtonGlow 0.3s infinite alternate, gradientShift 1s infinite linear !important;
            color: #ffffff !important;
            text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
        }

        @keyframes raveButtonGlow {
            from {
                box-shadow: 0 0 5px rgba(255, 0, 128, 0.7);
            }
            to {
                box-shadow: 0 0 20px rgba(0, 128, 255, 0.9);
            }
        }

        @keyframes gradientShift {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        .grid-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            pointer-events: none;
            z-index: 9999;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .grid-overlay.show {
            opacity: 0.1;
        }

        .grid-overlay::before {
            content: '';
            position: absolute;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 1200px;
            height: 100%;
            background-image: repeating-linear-gradient(
                90deg,
                transparent,
                transparent calc((100% - 11 * 24px) / 12 - 1px),
                #ff0000 calc((100% - 11 * 24px) / 12 - 1px),
                #ff0000 calc((100% - 11 * 24px) / 12),
                transparent calc((100% - 11 * 24px) / 12),
                transparent calc((100% - 11 * 24px) / 12 + 24px)
            );
        }

        /* Fullscreen button styling */
        .fullwidth-btn {
            background: #ff6b6b;
            color: #ffffff;
            border: none;
            padding: 12px 24px;
            font-size: 14px;
            font-weight: 600;
            letter-spacing: 0.02em;
            text-transform: uppercase;
            cursor: pointer;
            transition: all 0.2s ease;
            box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
        }

        .fullwidth-btn:hover {
            background: #ff5252;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
        }

        /* Special styling for sliders and selects */
        select {
            background: #ffffff;
            color: #000000;
            border: 1px solid #e0e0e0;
            padding: 8px 12px;
            font-family: inherit;
            font-size: 12px;
            font-weight: 400;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            cursor: pointer;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
        }

        select:focus {
            outline: none;
            border-color: #000000;
        }

        input[type="file"] {
            background: #ffffff;
            color: #000000;
            border: 1px solid #e0e0e0;
            padding: 8px 12px;
            font-family: inherit;
            font-size: 12px;
            cursor: pointer;
        }

        input[type="file"]:focus {
            outline: none;
            border-color: #000000;
        }

        .equalizer {
            display: flex;
            gap: 2px;
            align-items: end;
            height: 60px;
            margin-top: 16px;
            border: 1px solid #e0e0e0;
            padding: 8px;
            background: #ffffff;
        }

        .eq-bar {
            flex: 1;
            background: #000000;
            min-height: 2px;
            transition: height 0.1s ease;
        }
    