body {
    margin: 0;
    padding: 85px 0 40px 0; /* Espacio para la barra superior fija y el dashboard */
    min-height: 100vh;
    background-color: #2F2235;
    color: #ecf0f1;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Branding Styles --- */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 65px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 9999;
    background: transparent;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, background 0.3s ease;
}

.top-bar--hidden {
    transform: translateY(-100%);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.brand-link:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-name {
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: -0.5px;
    background: -webkit-linear-gradient(45deg, #fff, #3498db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

        h1 {
            color: #ecf0f1;
            margin-bottom: 10px;
        }

        .control-group,
        #visualization {
            background-color: #2c3e50;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
            margin-bottom: 20px;
            width: 80%;
            max-width: 800px;
        }

        /* --- Estilos del Mezclador --- */
        .mixer-panel {
            display: flex;
            justify-content: space-between;
            gap: 20px;
            margin-bottom: 20px;
        }

        .track-controls {
            background: #34495e;
            padding: 15px;
            border-radius: 6px;
            flex: 1;
            border-left: 5px solid #bdc3c7;
            /* Color por defecto */
        }

        .track-controls.loaded {
            border-color: #2ecc71;
            background: rgba(46, 204, 113, 0.05);
        }

        #masterTimerDisplay {
            font-family: 'Courier New', Courier, monospace;
            font-size: 2.5rem;
            color: #2ecc71;
            text-align: center;
            margin-top: 10px;
            text-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
            background: rgba(0, 0, 0, 0.3);
            padding: 5px 15px;
            border-radius: 8px;
            display: inline-block;
            min-width: 200px;
        }

        .visualizer-container {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .track-title {
            font-weight: bold;
            display: block;
            margin-bottom: 10px;
            border-bottom: 1px solid #7f8c8d;
            padding-bottom: 5px;
        }

        /* Inputs y Sliders */
        input[type="file"] {
            width: 100%;
            font-size: 0.8em;
            margin-bottom: 10px;
        }

        .volume-control {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
        }

        input[type="range"] {
            flex-grow: 1;
            cursor: pointer;
        }

        .vol-label {
            font-size: 0.9em;
            min-width: 30px;
        }

        /* Loop Checkbox */
        .loop-control {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.9em;
            background: rgba(0, 0, 0, 0.1);
            padding: 5px;
            border-radius: 4px;
        }

        /* Sliders de configuración global */
        .settings-row {
            margin-bottom: 10px;
            display: flex;
            align-items: center;
        }

        .settings-label {
            width: 180px;
            font-weight: bold;
        }

        /* Canvas */
        canvas {
            display: block;
            width: 100%;
            height: 400px;
            background-color: #e0e0e0;
            border-radius: 4px;
            border: 1px solid #ccc;
        }

        /* Botones Maestros */
        .master-controls {
            text-align: center;
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid #7f8c8d;
        }

        button {
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            margin: 0 5px;
            font-weight: bold;
            text-transform: uppercase;
            font-size: 0.9em;
            transition: all 0.2s;
        }

        .btn-play {
            background-color: #27ae60;
            color: white;
        }

        .btn-play:hover {
            background-color: #2ecc71;
        }

        .btn-play:disabled {
            background-color: #555;
            color: #888;
            cursor: not-allowed;
        }

        .btn-stop {
            background-color: #c0392b;
            color: white;
        }

        .btn-stop:hover {
            background-color: #e74c3c;
        }

        .btn-secondary {
            background-color: #7f8c8d;
            color: white;
        }

        .btn-secondary:hover {
            background-color: #95a5a6;
        }

        /* Estilo para cuando el botón de grabación está listo */
        #recordBtn:not(:disabled) {
            background-color: #27ae60 !important;
            color: white;
            box-shadow: 0 0 15px rgba(39, 174, 96, 0.5);
            font-weight: bold;
        }

        #recordBtn:not(:disabled):hover {
            background-color: #2ecc71 !important;
            transform: translateY(-1px);
        }

        #status {
            text-align: center;
            font-style: italic;
            color: #bdc3c7;
            margin-top: 10px;
            min-height: 1.2em;
        }

        #colorPickerContainer {
            display: none;
            margin-left: 10px;
        }

        /* Dashboard Styles */
        #dashboard {
            width: 80%;
            max-width: 800px;
            background-color: #2c3e50;
            color: #ecf0f1;
            padding: 15px;
            margin-top: 20px;
            border-top: 2px solid #7f8c8d;
            border-radius: 8px;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 15px;
            font-size: 0.9em;
            box-sizing: border-box;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        }

        .dash-item {
            background: rgba(0, 0, 0, 0.2);
            padding: 10px;
            border-radius: 4px;
            display: flex;
            flex-direction: column;
        }

        .dash-item span:first-child {
            font-weight: bold;
            color: #bdc3c7;
            margin-bottom: 5px;
            font-size: 0.8em;
            text-transform: uppercase;
        }

        .dash-item span:last-child {
            color: #fff;
            font-weight: bold;
            word-break: break-all;
        }

        /* --- Countdown Overlay --- */
        #countdownOverlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            z-index: 9999;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-family: 'Segoe UI', sans-serif;
        }

        #countdownNumber {
            font-size: 8rem;
            color: #2ecc71;
            font-weight: bold;
            text-shadow: 0 0 20px rgba(46, 204, 113, 0.5);
        }

        .hot-record-active {
            background-color: #e67e22 !important;
            animation: pulse-red 1s infinite;
        }

        @keyframes pulse-red {
            0% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.05);
            }

            100% {
                transform: scale(1);
            }
        }

        @keyframes pulse-glow {
            0% {
                box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
                filter: brightness(1);
            }

            50% {
                box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
                filter: brightness(1.3);
            }

            100% {
                box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
                filter: brightness(1);
            }
        }

        .btn-active-glow {
            animation: pulse-glow 1.5s infinite ease-in-out !important;
        }

        /* Tooltip Styles */
        .has-tooltip {
            position: relative;
            cursor: help;
        }

        .has-tooltip::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: 125%;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.9);
            color: white;
            padding: 5px 12px;
            border-radius: 4px;
            font-size: 0.8em;
            white-space: nowrap;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            z-index: 1000;
            pointer-events: none;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
            border: 1px solid #444;
            font-weight: normal;
            text-transform: none;
            letter-spacing: normal;
        }

        .has-tooltip:hover::after {
            opacity: 1;
            visibility: visible;
            bottom: 140%;
        }

        /* --- Mobile Warning Overlay --- */
        #mobileWarningOverlay {
            display: none;
        }

        /* --- Optimizacion para Moviles --- */
        @media (max-width: 768px) {
            #mobileWarningOverlay:not(.dismissed) {
                display: flex;
                position: fixed;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                background: #111111; /* Color sólido para ocultar completamente la página */
                z-index: 10000;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                text-align: center;
                padding: 20px;
                box-sizing: border-box;
            }
            
            /* Ocultar el resto de la página mientras el aviso esté activo */
            #mobileWarningOverlay:not(.dismissed) ~ #mainContent {
                display: none !important;
            }
            
            .mobile-warning-content {
                background: #2c3e50;
                padding: 30px 20px;
                border-radius: 12px;
                box-shadow: 0 10px 30px rgba(0,0,0,0.5);
                border: 2px solid #e74c3c;
                max-width: 90%;
            }

            .mobile-warning-content h2 {
                color: #e74c3c;
                margin-top: 0;
            }

            .mobile-warning-content p {
                font-size: 1.1em;
                line-height: 1.5;
                margin-bottom: 20px;
            }

            .control-group,
            #visualization,
            #dashboard {
                width: 95%;
                padding: 15px 10px;
            }

            .mixer-panel {
                flex-direction: column;
                gap: 15px;
            }

            .settings-row {
                flex-wrap: wrap;
                gap: 5px;
            }

            .settings-label {
                width: 100%;
                margin-bottom: 5px;
            }

            canvas {
                height: 250px;
            }

            .master-controls {
                display: flex;
                flex-direction: column;
                gap: 10px;
            }

            .master-controls button, 
            .master-controls div {
                width: 100%;
                margin: 0;
            }

            #masterTimerDisplay {
                font-size: 1.8rem;
                min-width: 150px;
            }
        }