/* ===== RADIO THEME — QHANANCHIRI / INSTITUCIONAL ===== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap');

/* ── Tokens ── */
:root {
    /* Fondo café oscuro */
    --bg1: #2c1e14;
    --bg2: #3a2a1d;
    --surface: #3e2d20;
    --surface2: #4a3628;

    --ink: #f0e6dc;
    --inkSoft: rgba(240, 230, 220, .55);

    /* Verde alegre */
    --primary: #4caf50;
    --primaryLight: #66bb6a;
    --primaryDark: #388e3c;
    --primarySoft: rgba(76, 175, 80, .12);

    --accent: #4caf50;
    --live: #ef5350;

    /* Acento café degradado */
    --brown1: #8d6e53;
    --brown2: #a1887f;
    --brown3: #bcaaa4;
    --brown4: #d7ccc8;
    --brown-grad: linear-gradient(90deg,
            var(--brown1) 0%,
            var(--brown2) 35%,
            var(--brown3) 65%,
            var(--brown4) 100%);

    --strokeColor: rgba(240, 230, 220, .10);
    --stroke: 1px solid var(--strokeColor);
    --shadow: 0 2px 8px rgba(0, 0, 0, .18);
    --shadow2: 0 4px 16px rgba(0, 0, 0, .25);

    --r: 12px;

    --safeB: env(safe-area-inset-bottom, 0px);
    --safeT: env(safe-area-inset-top, 0px);
}

/* ── Reset / Global ── */
html,
body {
    height: 100%;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: 'Nunito', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Animations ── */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: .35;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .2;
    }
}

@keyframes dance {

    0%,
    100% {
        transform: scaleY(.15);
        opacity: .35;
    }

    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

@keyframes brownPulse {
    0% {
        background-size: 100% 100%;
    }

    50% {
        background-size: 200% 100%;
    }

    100% {
        background-size: 100% 100%;
    }
}

@keyframes capFade {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes subtleGlow {
    0%,
    100% {
        box-shadow: 0 0 8px rgba(76, 175, 80, .15);
    }

    50% {
        box-shadow: 0 0 18px rgba(76, 175, 80, .30);
    }
}

/* ── Page shell ── */
.page {
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-top: var(--safeT);
    padding-bottom: var(--safeB);
    overflow: hidden;
}

.wrap {
    flex: 1;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 12px 14px;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(76, 175, 80, .30) transparent;
    box-sizing: border-box;
}

.wrap::-webkit-scrollbar {
    width: 4px;
}

.wrap::-webkit-scrollbar-thumb {
    background: rgba(76, 175, 80, .30);
    border-radius: 4px;
}

.wrap::-webkit-scrollbar-track {
    background: transparent;
}

/* ── Section order: Hero, Carousel, Socials, Player ── */
.hero {
    order: 1;
    flex-shrink: 0;
}

.carousel {
    order: 2;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.socials {
    order: 3;
    flex-shrink: 0;
}

.player {
    order: 4;
    flex-shrink: 0;
}

/* ── Card base ── */
.card {
    background: var(--surface);
    border: var(--stroke);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: box-shadow .35s ease, transform .35s ease;
}

.card:hover {
    box-shadow: var(--shadow2);
}

.card::after {
    display: none !important;
}

/* ── Hero ── */
.hero {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primaryLight));
    border: none;
    color: #fff;
    animation: fadeInUp .5s ease;
}

.hero:hover {
    box-shadow: 0 4px 22px rgba(76, 175, 80, .25);
}

.logo {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, .35);
    overflow: hidden;
    flex: 0 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
    transition: transform .35s ease, box-shadow .35s ease;
}

.logo:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.heroText {
    min-width: 0;
}

.heroText h1 {
    margin: 0;
    font-family: 'Nunito', sans-serif;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

.heroText p {
    margin: 2px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, .80);
    font-weight: 500;
    letter-spacing: .01em;
}

.heroActions {
    margin-left: auto;
    flex: 0 0 auto;
}

/* ── Buttons (Material Ripple) ── */
.btn {
    cursor: pointer;
    border: 1px solid var(--strokeColor);
    background: var(--surface);
    color: var(--ink);
    padding: 9px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    font-family: 'Nunito', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .10);
    transition: all .3s ease;
    user-select: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(76, 175, 80, .22) 10%, transparent 10.01%);
    transform: scale(0);
    opacity: 0;
    border-radius: inherit;
    pointer-events: none;
}

.btn:active::after {
    animation: ripple .5s ease-out;
}

.btn:hover {
    background: var(--primarySoft);
    border-color: rgba(76, 175, 80, .30);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(76, 175, 80, .15);
}

.btn:active {
    transform: translateY(0) scale(.97);
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btnPrimary {
    background: var(--primary);
    border-color: transparent;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(76, 175, 80, .25);
}

.btnPrimary::after {
    background: radial-gradient(circle, rgba(255, 255, 255, .30) 10%, transparent 10.01%);
}

.btnPrimary:hover {
    background: var(--primaryLight);
    box-shadow: 0 4px 16px rgba(76, 175, 80, .32);
    color: #fff;
}

/* ── Player ── */
.boombox.player {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primaryDark));
    border: none;
    color: #fff;
    animation: subtleGlow 3s ease-in-out infinite;
}

.boombox.player:hover {
    box-shadow: 0 4px 22px rgba(76, 175, 80, .25);
}

.rowTop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 8px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: .06em;
    text-transform: uppercase;
    transition: background .3s ease;
}

.liveDot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--live);
    box-shadow: 0 0 6px rgba(239, 83, 80, .6);
    animation: blink 1.2s ease-in-out infinite;
}

/* EQ */
.eq {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.eq .bar {
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .75);
    transform-origin: bottom;
    animation: dance .65s ease-in-out infinite;
}

.eq .bar:nth-child(2) {
    animation-delay: .07s;
}

.eq .bar:nth-child(3) {
    animation-delay: .14s;
}

.eq .bar:nth-child(4) {
    animation-delay: .21s;
}

.eq .bar:nth-child(5) {
    animation-delay: .28s;
}

.eq .bar:nth-child(6) {
    animation-delay: .35s;
}

.eq .bar:nth-child(7) {
    animation-delay: .42s;
}

.eq.paused .bar {
    animation: none;
    transform: scaleY(.12);
    opacity: .25;
}

/* Controls */
.controls {
    display: flex;
    gap: 14px;
    align-items: center;
}

.bigPlay {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, .30);
    background: rgba(255, 255, 255, .12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
    transition: all .3s ease;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.bigPlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, .35) 10%, transparent 10.01%);
    transform: scale(0);
    opacity: 0;
    border-radius: inherit;
    pointer-events: none;
}

.bigPlay:active::after {
    animation: ripple .5s ease-out;
}

.bigPlay #playText {
    display: none;
}

.bigPlay #playIcon {
    font-size: 18px;
    margin-left: 2px;
}

.bigPlay:hover {
    transform: scale(1.08);
    background: rgba(255, 255, 255, .20);
    border-color: rgba(255, 255, 255, .50);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .20);
}

.bigPlay:active {
    transform: scale(.94);
}

.bigPlay:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.track {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tiny {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: rgba(255, 255, 255, .70);
    gap: 8px;
    font-weight: 500;
}

/* ── Progress bar — Café degradado accent ── */
.progress {
    height: 6px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, .12);
    overflow: hidden;
    position: relative;
}

/* Sutil franja café detrás del fill */
.progress::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--brown-grad);
    border-radius: 8px;
    opacity: .18;
}

.fill {
    height: 100%;
    width: 0%;
    background: var(--brown-grad);
    background-size: 300% 100%;
    border-radius: 8px;
    transition: width .2s linear;
    position: relative;
    z-index: 1;
    animation: brownPulse 4s ease infinite;
}

.volRow {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    font-size: 11px;
    color: rgba(255, 255, 255, .65);
    font-weight: 500;
}

.range {
    width: 100px;
    accent-color: rgba(255, 255, 255, .8);
}

/* ── Carousel ── */
.polaroid.carousel {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.frame {
    flex: 1;
    min-height: 120px;
    border-radius: var(--r);
    border: 1px solid var(--strokeColor);
    background: var(--surface2);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow);
    transition: box-shadow .35s ease;
}

.frame:hover {
    box-shadow: var(--shadow2);
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.04);
    transition:
        opacity .6s cubic-bezier(.4, 0, .2, 1),
        transform .8s cubic-bezier(.16, 1, .3, 1);
    pointer-events: none;
}

.slide.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(30, 18, 10, .88) 0%, transparent 100%);
    border: none;
    border-radius: 0;
    padding: 32px 16px 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    color: #fff;
}

.cap h3 {
    margin: 0;
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .01em;
}

.cap p {
    margin: 2px 0 0;
    font-size: 11px;
    color: rgba(255, 255, 255, .70);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.slide.active .cap {
    animation: capFade .45s ease;
}

.nav {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px;
}

.dots {
    display: flex;
    gap: 6px;
    flex: 1;
    justify-content: center;
    align-items: center;
}

.dots button {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    border: none;
    background: rgba(76, 175, 80, .20);
    cursor: pointer;
    transition: all .3s ease;
    padding: 0;
}

.dots button:hover {
    background: rgba(76, 175, 80, .40);
}

.dots button.active {
    background: var(--primary);
    width: 22px;
    box-shadow: 0 1px 6px rgba(76, 175, 80, .30);
}

/* ── Socials ── */
.socials {
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    background: transparent;
    border: none;
    box-shadow: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid var(--strokeColor);
    background: var(--surface);
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
    font-size: 12px;
    font-family: 'Nunito', sans-serif;
    transition: all .3s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .10);
    position: relative;
    overflow: hidden;
}

.chip::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(76, 175, 80, .18) 10%, transparent 10.01%);
    transform: scale(0);
    opacity: 0;
    border-radius: inherit;
    pointer-events: none;
}

.chip:active::after {
    animation: ripple .5s ease-out;
}

.chip:hover {
    background: var(--primarySoft);
    border-color: rgba(76, 175, 80, .30);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(76, 175, 80, .18);
    color: var(--primaryLight);
}

.chipIcon {
    background: var(--primarySoft);
    color: var(--primary);
    width: 24px;
    height: 24px;
    font-size: 11px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .3s ease, color .3s ease;
}

.chip:hover .chipIcon {
    background: rgba(76, 175, 80, .22);
    color: var(--primaryLight);
}

/* ── Decorative brown stripe at very bottom ── */
body::after {
    content: "";
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brown-grad);
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .15);
}
