/* ===================================
   VARIABLES
=================================== */

:root {
    --bg: #f0f0f0;
    --bg2: #e8e8e8;
    --card: #ffffff;
    --card-hover: #f7f7f7;
    --border: #d0d0d0;
    --text: #111111;
    --text-inv: #ffffff;
    --muted: #666666;
    --muted2: #999999;

    --accent: #444444;
    --accent2: #222222;

    --sidebar-bg: #1a1a1a;
    --sidebar-card: #232323;
    --sidebar-border: #2e2e2e;
    --sidebar-text: #ffffff;
    --sidebar-muted: #999999;

    --cyan: #00f7ff;
    --purple: #7c5cff;
    --green: #35d07f;
    --red: #ff5d73;

    --shadow: 0 4px 24px rgba(0,0,0,.10);
    --shadow-deep: 0 12px 40px rgba(0,0,0,.16);
}

/* ===================================
   RESET
=================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
}

.hidden {
    display: none !important;
}

/* ===================================
   APP LAYOUT
=================================== */

.app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

/* ===================================
   SIDEBAR — dark
=================================== */

.sidebar {
    padding: 22px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-right: 1px solid var(--sidebar-border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: #2e2e2e;
    border: 1px solid #3a3a3a;
}

.logo h1 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--sidebar-text);
}

.logo span {
    color: var(--sidebar-muted);
    font-size: .78rem;
}

.sidebar-card {
    background: var(--sidebar-card);
    border: 1px solid var(--sidebar-border);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
}

.sidebar-card h3 {
    margin-bottom: 10px;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--sidebar-muted);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: .88rem;
    color: #cccccc;
}

.stat-row strong {
    color: #ffffff;
}

.level-number {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 12px 0;
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff;
}

.xp-bar {
    height: 9px;
    background: #2e2e2e;
    border-radius: 999px;
    overflow: hidden;
}

#xp-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #555, #aaa);
    transition: width .4s ease;
}

#xp-texto {
    display: block;
    margin-top: 6px;
    color: var(--sidebar-muted);
    font-size: .78rem;
}

.current-track {
    margin-top: 6px;
    color: #dddddd;
    font-weight: 600;
    font-size: .86rem;
}

/* ===================================
   MAIN
=================================== */

.main {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg);
}

/* ===================================
   HERO
=================================== */

.hero {
    padding: 26px 30px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.hero h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111;
    margin-bottom: 6px;
}

.hero p {
    color: var(--muted);
    font-size: .92rem;
}

/* ===================================
   PANEL (general)
=================================== */

.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.panel-header {
    margin-bottom: 14px;
}

.panel-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent2);
}

/* ===================================
   BIBLIOTECA — ACCORDION
=================================== */

.genre-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.genre-card {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}

.genre-card:last-child {
    border-bottom: none;
}

.genre-btn {
    width: 100%;
    border: none;
    cursor: pointer;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-weight: 600;
    font-size: .92rem;
    background: transparent;
    text-align: left;
    transition: background .15s;
}

.genre-btn:hover {
    background: #f3f3f3;
}

.genre-arrow {
    font-size: 1.1rem;
    display: inline-block;
    transition: transform .22s ease;
    color: var(--muted);
    line-height: 1;
    width: 18px;
    text-align: center;
}

.genre-card.open .genre-arrow {
    transform: rotate(90deg);
}

.song-list {
    overflow: hidden;
    max-height: 0;
    transition: max-height .35s ease, padding .25s ease;
    padding: 0 12px;
    background: #fafafa;
}

.song-list:not(.collapsed) {
    max-height: 600px;
    padding: 10px 12px 14px;
}

.song-item {
    width: 100%;
    border: none;
    cursor: pointer;
    text-align: left;
    color: var(--text);
    padding: 10px 14px;
    border-radius: 10px;
    background: transparent;
    margin-bottom: 4px;
    font-size: .88rem;
    transition: background .15s;
    display: block;
}

.song-item:hover {
    background: #ebebeb;
}

.song-item.active {
    background: #e0e0e0;
    font-weight: 600;
}

.empty-message {
    color: var(--muted2);
    font-size: .87rem;
    padding: 6px 14px;
}

.song-item.noise-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.song-item.noise-item::before {
    content: "〰";
    font-size: 1rem;
    opacity: .5;
}

/* ===================================
   UPLOAD
=================================== */

.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.upload-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-box label {
    font-weight: 600;
    font-size: .86rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.upload-box input {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f7f7f7;
    color: var(--text);
    font-family: inherit;
}

/* ===================================
   BUTTONS
=================================== */

.primary-btn {
    border: none;
    cursor: pointer;
    color: #ffffff;
    padding: 11px 18px;
    border-radius: 12px;
    font-weight: 700;
    font-size: .88rem;
    background: #222222;
    transition: background .15s, transform .1s;
    white-space: nowrap;
}

.primary-btn:hover:not(:disabled) {
    background: #333333;
    transform: translateY(-1px);
}

.primary-btn:disabled {
    background: #bbb;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 11px 18px;
    border-radius: 12px;
    color: var(--text);
    background: #f0f0f0;
    font-family: inherit;
    font-size: .88rem;
    transition: background .15s;
}

.secondary-btn:hover:not(:disabled) {
    background: #e0e0e0;
}

.secondary-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ===================================
   TABS (rango de entrenamiento)
=================================== */

.tabs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.tab {
    flex: 1;
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 13px;
    border-radius: 14px;
    color: var(--muted);
    background: #f5f5f5;
    font-family: inherit;
    font-weight: 600;
    font-size: .88rem;
    transition: .2s;
}

.tab:hover {
    background: #ebebeb;
    color: var(--text);
}

.tab[aria-selected="true"] {
    background: #222222;
    color: #ffffff;
    border-color: #222222;
}

.active-range {
    margin-top: 14px;
    color: var(--muted);
    font-size: .88rem;
}

.active-range strong {
    color: var(--text);
}

/* ===================================
   MAIN TABS — Bandas de Frecuencia / Compresión
=================================== */

.main-tabs-panel {
    padding: 0;
    overflow: hidden;
}

.main-tabs {
    display: flex;
    flex-direction: column;
}

.main-tab-card {
    border-bottom: 1px solid var(--border);
}

.main-tab-card:last-child {
    border-bottom: none;
}

.main-tab-btn {
    width: 100%;
    border: none;
    cursor: pointer;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-weight: 700;
    font-size: 1rem;
    background: transparent;
    text-align: left;
    transition: background .15s;
}

.main-tab-btn:hover {
    background: #f5f5f5;
}

.main-tab-content {
    overflow: hidden;
    max-height: 0;
    transition: max-height .4s ease;
    padding: 0 20px;
    background: #fafafa;
}

.main-tab-content:not(.collapsed) {
    max-height: 4000px;
    padding: 4px 20px 24px;
}

/* ===================================
   PLAYER
=================================== */

.player {
    display: flex;
    gap: 20px;
    align-items: center;
}

.mini-player {
    padding: 16px;
    margin-bottom: 18px;
    background: #f7f7f7;
    border: 1px solid var(--border);
    border-radius: 16px;
}



/* ===================================
   NOTA DESPLEGABLE DE EXPLICACIÓN
=================================== */

.explicacion-card {
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: #fafafa;
}

.explicacion-card.hidden {
    display: none;
}

.explicacion-btn {
    width: 100%;
    border: none;
    cursor: pointer;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    font-weight: 600;
    font-size: .88rem;
    color: var(--accent2);
    text-align: left;
    transition: background .15s;
}

.explicacion-btn:hover {
    background: #f0f0f0;
}

.explicacion-arrow {
    display: inline-block;
    transition: transform .22s ease;
    color: var(--muted);
    line-height: 1;
}

.explicacion-card.open .explicacion-arrow {
    transform: rotate(90deg);
}

.explicacion-content {
    overflow: hidden;
    max-height: 0;
    transition: max-height .35s ease, padding .25s ease;
    padding: 0 16px;
    font-size: .88rem;
    color: var(--muted);
    line-height: 1.5;
}

.explicacion-content:not(.collapsed) {
    max-height: 300px;
    padding: 4px 16px 14px;
    border-top: 1px solid var(--border);
}

.explicacion-content strong {
    color: var(--text);
}

.play-btn {
    width: 68px;
    height: 68px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    font-size: 1.3rem;
    background: #222222;
    flex-shrink: 0;
    transition: background .15s, transform .1s;
}

.play-btn:hover:not(:disabled) {
    background: #333333;
    transform: scale(1.05);
}

.play-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.bypass-btn {
    width: 68px;
    height: 68px;
    border: 2px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    background: #f5f5f5;
    flex-shrink: 0;
    transition: .2s;
    letter-spacing: .04em;
}

.bypass-btn.activo {
    background: #222;
    color: #fff;
    border-color: #222;
}

.bypass-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.player-info {
    flex: 1;
}

.progress {
    height: 9px;
    border-radius: 999px;
    overflow: hidden;
    background: #e0e0e0;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    width: 0;
    height: 100%;
    background: #333333;
    transition: width .1s linear;
}

.progress-cursor {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: #666;
    opacity: 0;
    pointer-events: none;
}

.player-time {
    margin-top: 7px;
    color: var(--muted);
    font-size: .82rem;
}

.vu-meter {
    height: 12px;
    margin-top: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: linear-gradient(90deg, #35d07f, #e9c34f, #ff5d73);
    position: relative;
}

.vu-mask {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: #e8e8e8;
    transition: width .05s;
}

/* ===================================
   EJERCICIO (genérico: frecuencia, ratio, ADSR)
=================================== */

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.exercise-header h2,
.exercise-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.question {
    margin-bottom: 16px;
    font-size: 1rem;
    color: var(--muted);
}

.question.no-margin {
    margin-bottom: 0;
}

.options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.opcion {
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 15px;
    border-radius: 14px;
    color: var(--text);
    background: #f5f5f5;
    font-family: inherit;
    font-weight: 600;
    font-size: .92rem;
    transition: .2s;
}

.opcion:hover:not(:disabled) {
    background: #e8e8e8;
    transform: translateY(-2px);
}

.opcion:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.correcta {
    background: var(--green) !important;
    color: #fff !important;
    border-color: var(--green) !important;
}

.incorrecta {
    background: var(--red) !important;
    color: #fff !important;
    border-color: var(--red) !important;
}

.result-box {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f5f5f5;
    border: 1px solid var(--border);
    font-size: .92rem;
    color: var(--muted);
}

/* ===================================
   MODE TOGGLE (compartido: EQ y Compresión)
=================================== */

.mode-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.mode-btn {
    flex: 1;
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 12px;
    border-radius: 12px;
    color: var(--muted);
    background: #f5f5f5;
    font-family: inherit;
    font-weight: 600;
    font-size: .86rem;
    transition: .2s;
}

.mode-btn.active {
    background: #222;
    color: #fff;
    border-color: #222;
}

/* ===================================
   HINT TEXT
=================================== */

.hint-text {
    display: block;
    color: var(--muted2);
    font-size: .78rem;
}

/* ===================================
   EQ PANEL — DARK + NEON
=================================== */

.eq-panel {
    position: relative;
    overflow: hidden;
    background: #070707;
    border: 1px solid #1e1e1e;
    border-radius: 20px;
    padding: 18px;
    margin-top: 18px;
}

.eq-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at center,
        rgba(0,247,255,.05),
        transparent 70%
    );
    pointer-events: none;
}

.eq-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.eq-top h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
}

.eq-top-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #1d1d1d;
    border: 1px solid #2c2c2c;
    cursor: pointer;
    transition: .2s;
}

.lock-btn:hover:not(:disabled) {
    border-color: var(--cyan);
}

.lock-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.lock-btn.libre {
    border-color: var(--purple);
    background: rgba(124, 92, 255, .18);
}

.lock-icon {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #ddd;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lock-icon.hidden {
    display: none;
}

.lock-btn.libre .lock-icon {
    stroke: var(--purple);
}

#estado-eq,
#estado-comp,
#estado-env {
    padding: 6px 12px;
    border-radius: 999px;
    background: #1d1d1d;
    border: 1px solid #2c2c2c;
    color: var(--cyan);
    font-size: .8rem;
}

/* EQ Wrapper */
.eq-wrapper {
    position: relative;
    width: 100%;
    height: 320px;
    margin-bottom: 22px;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, #111111, #060606);
    border: 1px solid #1e1e1e;
    box-shadow:
        inset 0 2px 4px rgba(255,255,255,.03),
        inset 0 -15px 25px rgba(0,0,0,.8),
        0 10px 40px rgba(0,0,0,.6);
}

.eq-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to right,
        transparent 0px,
        transparent 119px,
        rgba(255,255,255,.035) 120px
    );
    pointer-events: none;
}

.eq-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 74px,
        rgba(255,255,255,.035) 75px
    );
    pointer-events: none;
}

.eq-svg {
    width: 100%;
    height: 100%;
    display: block;
}

#curva-eq {
    fill: none;
    stroke: var(--cyan);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter:
        drop-shadow(0 0 8px var(--cyan))
        drop-shadow(0 0 20px var(--cyan))
        drop-shadow(0 0 40px rgba(0,247,255,.8));
    animation: neonPulse 2.5s infinite ease-in-out;
}

#punto-eq {
    fill: var(--purple);
    stroke: white;
    stroke-width: 2;
    filter:
        drop-shadow(0 0 10px var(--purple))
        drop-shadow(0 0 20px var(--purple))
        drop-shadow(0 0 40px rgba(124,92,255,.7));
}

.eq-labels {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    text-align: center;
    font-size: .78rem;
    color: #bfbfbf;
    pointer-events: none;
}

.eq-labels span {
    position: relative;
}

.eq-labels span::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -10px;
    width: 1px;
    height: 8px;
    background: #444;
}

/* EQ / Comp / Env Controls */
.eq-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#fader-eq,
#fader-env {
    width: 100%;
    appearance: none;
    height: 9px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--purple), var(--cyan));
    cursor: pointer;
}

#fader-eq::-webkit-slider-thumb,
#fader-env::-webkit-slider-thumb {
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--cyan);
    cursor: pointer;
    box-shadow: 0 0 15px var(--cyan), 0 0 30px rgba(0,247,255,.5);
}

#fader-eq::-moz-range-thumb,
#fader-env::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: white;
}

#fader-eq:disabled,
#fader-env:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.eq-readout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 14px;
    background: #111111;
    border: 1px solid #222222;
}

#eq-banda,
#env-param-label {
    font-weight: 700;
    color: var(--cyan);
    font-size: .9rem;
}

#eq-valor,
#env-param-valor {
    font-weight: 700;
    color: white;
    font-size: .9rem;
}

#btn-reset-eq,
#btn-replay-env {
    background: linear-gradient(135deg, #252525, #151515);
    border: 1px solid #333;
    color: #ddd;
}

#btn-reset-eq:hover:not(:disabled),
#btn-replay-env:hover:not(:disabled) {
    border-color: var(--cyan);
    color: #fff;
}

.eq-grid-line {
    stroke: rgba(255,255,255,.07);
    stroke-width: 1;
}

.eq-grid-center {
    stroke: rgba(255,255,255,.18);
    stroke-width: 1.5;
    stroke-dasharray: 6 4;
}

.eq-grid-label {
    fill: #777;
    font-size: 20px;
    font-family: 'Inter', sans-serif;
}

@keyframes neonPulse {
    0% {
        filter:
            drop-shadow(0 0 8px var(--cyan))
            drop-shadow(0 0 18px var(--cyan));
    }
    50% {
        filter:
            drop-shadow(0 0 15px var(--cyan))
            drop-shadow(0 0 35px var(--cyan));
    }
    100% {
        filter:
            drop-shadow(0 0 8px var(--cyan))
            drop-shadow(0 0 18px var(--cyan));
    }
}

.bloqueado {
    opacity: .55;
}

.eq-panel.bloqueado .eq-wrapper,
.comp-graphic.bloqueado .comp-wrapper,
.comp-graphic.bloqueado .env-svg {
    filter: grayscale(.5);
}

/* ===================================
   COMPRESIÓN
=================================== */

.comp-block {
    margin-top: 4px;
}

.comp-graphic {
    position: relative;
    overflow: hidden;
    background: #070707;
    border: 1px solid #1e1e1e;
    border-radius: 20px;
    padding: 18px;
    margin-top: 18px;
    color: #fff;
}

.comp-graphic-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-weight: 700;
    font-size: .95rem;
}

.comp-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.comp-svg {
    width: 260px;
    height: 260px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #111111, #060606);
    border: 1px solid #1e1e1e;
    border-radius: 14px;
}

#comp-linea-1a1 {
    stroke: rgba(255,255,255,.15);
    stroke-width: 1.5;
    stroke-dasharray: 5 5;
}

#comp-curva {
    fill: none;
    stroke: var(--cyan);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter:
        drop-shadow(0 0 6px var(--cyan))
        drop-shadow(0 0 16px rgba(0,247,255,.7));
}

.knob-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.knob {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #333, #111 70%);
    border: 2px solid #2c2c2c;
    position: relative;
    cursor: ns-resize;
    box-shadow: 0 0 20px rgba(124,92,255,.25), inset 0 2px 4px rgba(255,255,255,.05);
}

.knob-indicador {
    position: absolute;
    top: 6px;
    left: 50%;
    width: 4px;
    height: 30px;
    background: var(--purple);
    border-radius: 2px;
    transform-origin: 50% 36px;
    transform: translateX(-50%) rotate(var(--rot, -135deg));
    box-shadow: 0 0 8px var(--purple);
}

.knob.bloqueado {
    cursor: not-allowed;
    opacity: .5;
}

#comp-knob-valor {
    font-weight: 700;
    font-size: .88rem;
    color: var(--cyan);
}

/* ADSR envelope */

.env-svg {
    width: 100%;
    height: 220px;
    margin-bottom: 18px;
    border-radius: 14px;
    background: linear-gradient(180deg, #111111, #060606);
    border: 1px solid #1e1e1e;
    display: block;
}

#env-curva {
    fill: none;
    stroke: var(--cyan);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter:
        drop-shadow(0 0 6px var(--cyan))
        drop-shadow(0 0 16px rgba(0,247,255,.7));
}

/* ===================================
   RESPONSIVE
=================================== */

@media (max-width: 900px) {
    .app {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: static;
        height: auto;
    }
    .eq-wrapper {
        height: 260px;
    }
    .eq-labels {
        font-size: .68rem;
    }
    .comp-wrapper {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .main {
        padding: 14px;
        gap: 12px;
    }
    .options {
        grid-template-columns: 1fr;
    }
    .eq-readout {
        flex-direction: column;
        gap: 8px;
    }
    .comp-svg {
        width: 100%;
        height: 220px;
    }
}

/* =========================================================
   PISTA ALEATORIA
========================================================= */

.random-track-box {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.random-track-box label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.95rem;
    font-weight: 600;
}

.random-track-box .primary-btn {
    width: 100%;
    margin-bottom: 8px;
}


/* =========================================================
   OPCIONES DEL EJERCICIO ADSR
========================================================= */

.env-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 16px;
}

.env-options .env-opcion {
    min-height: 50px;
    padding: 12px 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}


/* =========================================================
   REPRODUCTOR ADSR CON CANCIÓN REAL
========================================================= */

.player[data-player="env"] {
    margin-top: 18px;
}

.player[data-player="env"] .player-info {
    flex: 1;
    min-width: 0;
}

.player[data-player="env"] .progress {
    width: 100%;
}

.player[data-player="env"] .bypass-btn.activo {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}


/* =========================================================
   INFORMACIÓN Y CONTROLES ADSR
========================================================= */

#modulo-env .eq-controls {
    margin-top: 18px;
}

#modulo-env .eq-readout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#env-param-label {
    font-weight: 600;
}

#env-param-valor {
    font-weight: 700;
    font-size: 1rem;
}

#hint-env {
    display: block;
    width: 100%;
    margin-top: 8px;
    line-height: 1.5;
}


/* =========================================================
   GRÁFICO ADSR
========================================================= */

.env-svg {
    display: block;
    width: 100%;
    height: auto;
    min-height: 220px;
    margin-top: 14px;
}

#env-curva {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* =========================================================
   ESTADOS DE RESPUESTAS ADSR
========================================================= */

.env-opcion.correcta {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.16);
    color: #86efac;
}

.env-opcion.incorrecta {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
}


/* =========================================================
   DISEÑO RESPONSIVE
========================================================= */

@media (max-width: 900px) {

    .env-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 520px) {

    .env-options {
        grid-template-columns: 1fr;
    }

    .env-options .env-opcion {
        width: 100%;
    }

    .player[data-player="env"] {
        flex-wrap: wrap;
    }

    .player[data-player="env"] .player-info {
        width: 100%;
        flex-basis: 100%;
    }

}