/* ============================================================
   MÚSICA DE FONDO — pantalla de entrada y botón del ecualizador
   ============================================================ */

/* Botón de la barra (entre el tema y la hamburguesa) */
.music-toggle {
    width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
    background: var(--glass-flat); border: 1px solid var(--border); border-radius: 50%;
    color: var(--accent3); cursor: pointer;
    transition: transform .5s var(--spring), background .3s, box-shadow .3s, border-color .3s;
}
.music-toggle:hover { transform: scale(1.12); box-shadow: 0 0 22px var(--glow); }
.music-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--glow); }
.music-toggle.on { border-color: var(--accent3); box-shadow: 0 0 18px -4px var(--glow); }
body.light-mode .music-toggle { color: var(--accent2); }

.eq { display: flex; align-items: center; gap: 3px; height: 18px; }
.eq i { width: 3px; height: 3px; border-radius: 3px; background: currentColor; transition: height .3s var(--spring); }
.music-toggle.on .eq i { animation: eqBar 1s ease-in-out infinite; }
.music-toggle.on .eq i:nth-child(1) { animation-delay: -.2s; }
.music-toggle.on .eq i:nth-child(2) { animation-delay: -.65s; }
.music-toggle.on .eq i:nth-child(3) { animation-delay: -.4s; }
.music-toggle.on .eq i:nth-child(4) { animation-delay: -.85s; }
@keyframes eqBar { 0%, 100% { height: 4px; } 25% { height: 17px; } 50% { height: 8px; } 75% { height: 14px; } }

/* Botón del sonido del mouse (mismo estilo que el de música) */
.click-toggle .cs-ico { display: block; }
.click-toggle .cs-slash { opacity: 0; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .35s ease, opacity .2s; }
.click-toggle:not(.on) .cs-slash { opacity: 1; stroke-dashoffset: 0; }
.click-toggle:not(.on) { color: var(--text2, var(--accent3)); opacity: .8; }
.click-toggle.on:active .cs-ico { transform: scale(.85); }
.click-toggle .cs-ico { transition: transform .3s var(--spring); }

/* Pantalla de entrada: con música / sin música */
.sound-gate {
    position: fixed; inset: 0; z-index: 10050; display: grid; place-items: center; padding: 1.5rem; text-align: center;
    color: #fff; overflow-y: auto;
    background:
        radial-gradient(circle at 25% 25%, rgba(34, 211, 238, .24), transparent 45%),
        radial-gradient(circle at 75% 75%, rgba(139, 92, 246, .3), transparent 50%),
        #05060b;
    transition: opacity .6s ease, transform .8s var(--curtain), visibility .8s;
}
.sound-gate.out { opacity: 0; transform: scale(1.08); visibility: hidden; pointer-events: none; }
.sg-inner { display: grid; justify-items: center; gap: 1.1rem; max-width: 440px; }
.sg-inner > * { animation: sgUp .9s var(--spring) backwards; }
.sg-inner > :nth-child(2) { animation-delay: .1s; } .sg-inner > :nth-child(3) { animation-delay: .2s; }
.sg-inner > :nth-child(4) { animation-delay: .3s; } .sg-inner > :nth-child(5) { animation-delay: .42s; }
.sg-inner > :nth-child(6) { animation-delay: .55s; } .sg-inner > :nth-child(7) { animation-delay: .65s; }

.sg-logo {
    font-family: var(--font-head); font-weight: 700; font-size: clamp(3.4rem, 14vw, 5.4rem); letter-spacing: -.06em; line-height: 1;
    background: linear-gradient(120deg, #22d3ee, #8b5cf6, #f472b6, #22d3ee); background-size: 300% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: gradMove 3s linear infinite, sgUp .9s var(--spring) backwards;
}
.sg-eq { display: flex; align-items: center; gap: 5px; height: 46px; color: #22d3ee; }
.sg-eq i { width: 5px; height: 6px; border-radius: 5px; background: linear-gradient(#22d3ee, #8b5cf6); animation: sgBar 1.1s ease-in-out infinite; }
.sg-eq i:nth-child(2) { animation-delay: -.3s; } .sg-eq i:nth-child(3) { animation-delay: -.7s; }
.sg-eq i:nth-child(4) { animation-delay: -.5s; } .sg-eq i:nth-child(5) { animation-delay: -.9s; }
.sg-eq i:nth-child(6) { animation-delay: -.15s; } .sg-eq i:nth-child(7) { animation-delay: -.6s; }
@keyframes sgBar { 0%, 100% { height: 6px; } 30% { height: 44px; } 55% { height: 16px; } 80% { height: 34px; } }
@keyframes sgUp { from { opacity: 0; transform: translateY(34px) scale(.95); } }

.sg-title { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: clamp(1.9rem, 6vw, 2.6rem); letter-spacing: -.03em; color: #fff !important; }
.sg-text { margin: 0; color: rgba(255, 255, 255, .72); line-height: 1.6; }
.sg-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6rem; width: min(320px, 100%);
    padding: 1rem 1.6rem; border: 0; border-radius: 999px; cursor: pointer; font: 700 1.05rem/1 var(--font-body); color: #fff;
    background: var(--grad); box-shadow: 0 14px 40px -12px var(--glow); overflow: hidden;
    transition: transform .5s var(--spring), box-shadow .3s;
}
.sg-btn:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 18px 50px -10px var(--glow); }
.sg-btn:active { transform: scale(.97); }
.sg-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.sg-btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%); translate: -120% 0; animation: sgShine 3.2s ease-in-out infinite; }
@keyframes sgShine { 0%, 55% { translate: -120% 0; } 80%, 100% { translate: 120% 0; } }
.sg-skip {
    padding: .5rem .8rem; background: none; border: 0; cursor: pointer; font: 600 .98rem/1 var(--font-body);
    color: rgba(255, 255, 255, .85); text-decoration: underline; text-underline-offset: 5px; transition: color .3s, transform .4s var(--spring);
}
.sg-skip:hover { color: #fff; transform: scale(1.06); }
.sg-skip:focus-visible { outline: 2px solid #22d3ee; outline-offset: 3px; border-radius: 8px; }
.sg-hint { margin: .4rem 0 0; font: 500 .74rem/1.5 var(--font-mono, monospace); letter-spacing: .04em; color: rgba(255, 255, 255, .45); }

/* Mientras se elige, todo el sitio queda en pausa (arranca al entrar) */
body.gate-open *:not(.sound-gate), body.gate-open *::before, body.gate-open *::after { animation-play-state: paused !important; }
body.gate-open .sound-gate, body.gate-open .sound-gate *, body.gate-open .sound-gate *::before, body.gate-open .sound-gate *::after { animation-play-state: running !important; }
body.gate-open { overflow: hidden; }
