:root {
    --accent: #f2b320;
    --text: #fff;
    --marquee-gap: 10px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

#mute {
    margin-left: 10px;
}

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    color: var(--text);
    background: #000;
    overflow: hidden;
}

/* Fondo */
.bg {
    position: fixed;
    inset: 0;
    background: #000 url("js/fondo.webp") center/cover no-repeat;
    transform: scale(1.08);
    filter: blur(3px);
    z-index: 0;
}

.bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}

/* Contenedor a pantalla completa */
.wrap {
    position: relative;
    z-index: 1;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 12px;
    padding-top: clamp(40px, 6vh, 80px);

}

.scaler {
    transform-origin: top center;
    will-change: transform;
}

.card {
    width: 520px;
    max-width: 96vw;
    max-height: calc(100dvh - 20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
}

/* Logo */
.logoRing {
    width: 210px;
    height: 210px;
    border-radius: 50%;
    padding: 10px;
    background: rgba(255, 255, 255, .15);
    box-shadow: 0 10px 35px rgba(0, 0, 0, .35);
    margin-top: clamp(-55px, -6vh, -28px);
    position: relative;
    /* ✅ para anclar redes */
    transform: scale(1);
    transition: transform 1.5s ease-in-out, box-shadow 1.5s ease-in-out;
}

/* Pulso SOLO del logo */
.logoRing img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: rgba(0, 0, 0, .35);
    transition: transform 1.5s ease-in-out, box-shadow 1.5s ease-in-out;
}

.logoRing img.pulse {
    transform: scale(1.07);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, .55),
        0 0 35px rgba(242, 179, 32, .75),
        0 0 0px rgba(242, 179, 32, .45);
}

/* Texto */
.title {
    margin: 0;
    font-size: 34px;
    font-weight: 300;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .75), 0 10px 28px rgba(0, 0, 0, .45);
    letter-spacing: 0.3px;
}

.subtitle {
    margin: 0;
    font-size: 30px;
    font-weight: 500;
    display: inline-block;
    padding: 6px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    letter-spacing: .4px;
    transition: background .4s ease, color .4s ease, box-shadow .4s ease;
}

body.playing-live .subtitle {
    background: rgba(242, 179, 32, .15);
    color: var(--accent);
    box-shadow:
        0 0 10px rgba(242, 179, 32, .45),
        0 0 20px rgba(242, 179, 32, .25);
}

/* Marquee */
.title-scroll {
    max-width: 420px;
    width: 100%;
    overflow: hidden;
    text-align: center;

    /* ⬅️ hace que se esconda más por la izquierda */
    padding-left: 9px;
    margin-left: -9px;
}

/* Pista que se mueve */
.title-track {
    display: inline-flex;
    align-items: center;
    gap: var(--marquee-gap);
    will-change: transform;
    animation: title-marquee 25s linear infinite;
}

/* Pista sin gap */
.title-track {
    display: inline-flex;
    align-items: center;
    width: max-content;
    will-change: transform;
    animation: title-marquee 18s linear infinite;
}

/* ✅ el espacio ahora es parte de cada frase */
.title-track span {
    display: inline-block;
    font-size: 34px;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .75);

    padding-right: 3px;
    /* ⬅️ espacio entre frases, ajustá 20-60px */
}

@keyframes title-marquee {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* Timer */
.timerBox {
    width: fit-content;
    display: flex;
    justify-content: center;
}

.timerBox #timer {
    font-size: 30px;
    font-weight: 200;
    text-align: center;
    padding: 6px 10px;
    line-height: 1;
    text-shadow: 0 10px 25px rgba(0, 0, 0, .4);
}

/* EQ */
.eq {
    height: 54px;
    display: grid;
    place-items: center;
    opacity: .95;
}

.bars {
    display: inline-flex;
    gap: 6px;
    align-items: flex-end;
    height: 54px;
}

.bar {
    width: 16px;
    background: #fff;
    border-radius: 3px;
    transform-origin: bottom;
    transition: transform .45s ease, height .45s ease, opacity .35s ease;
}

.eq:not(.playing) .bar {
    height: 14px;
    opacity: .6;
    animation: calm 2.8s ease-in-out infinite;
}

@keyframes calm {

    0%,
    100% {
        transform: scaleY(.30);
    }

    50% {
        transform: scaleY(.45);
    }
}

.eq.playing .bar {
    height: 44px;
    opacity: 1;
}

.eq.playing .bar:nth-child(1) {
    animation: b1 .83s ease-in-out infinite;
}

.eq.playing .bar:nth-child(2) {
    animation: b2 1.11s ease-in-out infinite;
}

.eq.playing .bar:nth-child(3) {
    animation: b3 .97s ease-in-out infinite;
}

.eq.playing .bar:nth-child(4) {
    animation: b4 1.27s ease-in-out infinite;
}

@keyframes b1 {

    0%,
    100% {
        transform: scaleY(.25);
    }

    35% {
        transform: scaleY(1.25);
    }

    70% {
        transform: scaleY(.55);
    }
}

@keyframes b2 {

    0%,
    100% {
        transform: scaleY(.35);
    }

    20% {
        transform: scaleY(.95);
    }

    55% {
        transform: scaleY(1.35);
    }

    80% {
        transform: scaleY(.6);
    }
}

@keyframes b3 {

    0%,
    100% {
        transform: scaleY(.3);
    }

    30% {
        transform: scaleY(1.4);
    }

    50% {
        transform: scaleY(.5);
    }

    85% {
        transform: scaleY(1.05);
    }
}

@keyframes b4 {

    0%,
    100% {
        transform: scaleY(.28);
    }

    25% {
        transform: scaleY(1.1);
    }

    60% {
        transform: scaleY(.45);
    }

    75% {
        transform: scaleY(1.3);
    }
}

/* Volumen */
.volRow {
    width: 520px;
    max-width: 92vw;
    display: grid;
    grid-template-columns: 34px 1fr 34px;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.iconBtn {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    opacity: .95;
}

#maxvol {
    transform: translateX(-8px);
}

.iconBtn svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(to right,
            var(--accent) 0%,
            var(--accent) var(--vol, 80%),
            rgba(255, 255, 255, .28) var(--vol, 80%),
            rgba(255, 255, 255, .28) 100%);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow:
        0 0 0 2px var(--accent),
        0 0 10px rgba(242, 179, 32, .85),
        0 0 22px rgba(242, 179, 32, .6);
    border: none;
    cursor: pointer;
}

/* ✅ BottomBar FIX: 2 elementos centrados */
.bottomBar {
    width: 520px;
    max-width: 92vw;

    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    align-items: center;
    gap: 18px;

    margin-top: 30px;

    background: transparent;
    box-shadow: none;
    padding: 0;
}

/* Play */
.playBtn {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 18px 36px rgba(0, 0, 0, .45);
    display: grid;
    place-items: center;
    margin: 0;

    position: relative;
    overflow: visible;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    user-select: none;
    transition: transform .12s ease;
}

.playBtn:focus,
.playBtn:focus-visible {
    outline: none;
    box-shadow: none;
}

.playBtn:active {
    transform: scale(.94);
}

.playIcon {
    width: 46px;
    height: 46px;
    fill: #fff;
    pointer-events: none;
}

/* Anillo */
.playBtn::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    pointer-events: none;
    border: 3px dashed rgba(255, 255, 255, .85);
    opacity: 0;
    transform: rotate(0deg);
    transition: opacity .4s ease;
}

body.playing-ring .playBtn::before {
    opacity: 1;
    animation: spinRing 16s linear infinite;
}

@keyframes spinRing {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}


body.playing-live #reload.reloadBtn {
    background: rgba(0, 0, 0, .45);
    border-color: rgba(242, 179, 32, .22);
    box-shadow:
        0 0 8px rgba(242, 179, 32, .40),
        0 0 18px rgba(242, 179, 32, .25),
        0 0 30px rgba(242, 179, 32, .15);
    filter: none;
}

#reload.reloadBtn:active {
    transform: scale(.94);
}

.status {
    font-size: 12px;
    opacity: .75;
    margin-top: -8px;
    display: none;
}

#dbg {
    display: none;
}


/* ✅ Play centrado y Recargar debajo (FORZADO) */
.bottomBar {
    display: flex !important;
    flex-direction: column !important;
    /* uno debajo del otro */
    align-items: center !important;
    /* centrados */
    justify-content: center !important;
    gap: 25px !important;
    /* distancia entre play y recargar */
}

/* Recargar centrado */
#reload.reloadBtn {
    margin: 0 !important;
}


/* Subir play + recargar un poco más arriba */
.bottomBar {
    margin-top: 10px !important;
    /* probá 0px, 5px, -5px */
}


/* Fila: share - Timer - WA */
.timerRow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    /* separación general */
}

.redes-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    /* separación general */
}

/* Botones redes */
.timerSocial {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin-top: 10px;

    background: rgba(0, 0, 0, .35);
    border: 1px solid rgba(242, 179, 32, .35);
    box-shadow:
        0 0 10px rgba(242, 179, 32, .20),
        0 10px 24px rgba(0, 0, 0, .30);

    -webkit-tap-highlight-color: transparent;
    outline: none;
    user-select: none;
    transform: translateX(-2px);
    transition: transform .12s ease;
}

/* hundido */
.timerSocial:active {
    transform: scale(.92);
}

/* quitar cuadro blanco */
.timerSocial:focus,
.timerSocial:focus-visible {
    outline: none;
    box-shadow: none;
}

/* iconos */
.timerSocial svg {
    width: 24px;
    height: 24px;
}


/* ✅ Botones redes MÁS GRANDES */
.timerSocial {
    width: 58px !important;
    height: 58px !important;
    border-radius: 50% !important;
}

/* ✅ Iconos MÁS GRANDES */
.timerSocial svg {
    width: 32px !important;
    height: 32px !important;
}

/* WhatsApp un pelín más grande todavía (opcional) */
.timerSocial.wa svg {
    width: 34px !important;
    height: 34px !important;
}

/* FACEBOOK un pelín más grande todavía (opcional) */

.timerSocial.facebook svg {
    width: 28px !important;
    height: 28px !important;
}

/* share y WhatsApp mismo color */
.timerSocial.facebook svg,
.timerSocial.share svg,
.timerSocial.wa svg {
    fill: #25D366;
    /* verde WhatsApp */
}


/* ✅ Timer fijo: no cambia ancho, no mueve botones */
#timer {
    font-variant-numeric: tabular-nums;
    /* números de mismo ancho */
    font-feature-settings: "tnum" 1;
    /* soporte extra */
    display: inline-block;
    width: 5ch;
    /* "00:00" siempre ocupa lo mismo */
    text-align: center;
    letter-spacing: .5px;
    /* se ve más parejo */
}

/* SOLO en pantallas realmente pequeñas (no Redmi) */
@media (max-height: 560px) {
    .wrap {
        padding-top: 70px !important;
    }

    .bottomBar {
        margin-top: 14px !important;
    }
}

@media (max-height: 500px) {
    .wrap {
        padding-top: 55px !important;
    }

    .bottomBar {
        margin-top: 10px !important;
    }

    .playBtn {
        width: 82px !important;
        height: 82px !important;
    }
}