/* ===== RADIO THEME — INSTITUCIONAL / PROFESIONAL ===== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap');

/* ── Tokens ── */
:root {
    --bg1: #f4f6f8;
    --bg2: #eaecef;
    --surface: #ffffff;
    --surface2: #f0f2f4;

    --ink: #1e2a38;
    --inkSoft: rgba(30, 42, 56, .55);

    --primary: #1B7A3D;
    --primaryLight: #239b4e;
    --primaryDark: #145d2e;
    --primarySoft: rgba(27, 122, 61, .10);

    --accent: #1B7A3D;
    --live: #d32f2f;

    /* Wiphala palette */
    --wiphala-red: #E4002B;
    --wiphala-orange: #F39200;
    --wiphala-yellow: #FFD700;
    --wiphala-green: #1B7A3D;
    --wiphala-blue: #0072CE;
    --wiphala-violet: #7B2D8E;

    --strokeColor: rgba(30, 42, 56, .10);
    --stroke: 1px solid var(--strokeColor);
    --shadow: 0 2px 8px rgba(30, 42, 56, .07);
    --shadow2: 0 4px 16px rgba(30, 42, 56, .10);

    --r: 12px;

    --safeB: env(safe-area-inset-bottom, 0px);
    --safeT: env(safe-area-inset-top, 0px);

    --wiphala-grad: linear-gradient(90deg,
            var(--wiphala-red) 0%,
            var(--wiphala-orange) 18%,
            var(--wiphala-yellow) 36%,
            var(--wiphala-green) 54%,
            var(--wiphala-blue) 72%,
            var(--wiphala-violet) 100%);
}

/* ── 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 wiphalaPulse {
    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);
    }
}

/* ── 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(27, 122, 61, .25) transparent;
    box-sizing: border-box;
}

.wrap::-webkit-scrollbar {
    width: 4px;
}

.wrap::-webkit-scrollbar-thumb {
    background: rgba(27, 122, 61, .25);
    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 .3s 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 20px rgba(27, 122, 61, .20);
}

.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, .12);
    transition: transform .3s ease, box-shadow .3s ease;
}

.logo:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}

.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, .12);
}

.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, .06);
    transition: all .25s ease;
    user-select: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(27, 122, 61, .20) 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(27, 122, 61, .25);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(27, 122, 61, .12);
}

.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(27, 122, 61, .20);
}

.btnPrimary::after {
    background: radial-gradient(circle, rgba(255, 255, 255, .30) 10%, transparent 10.01%);
}

.btnPrimary:hover {
    background: var(--primaryLight);
    box-shadow: 0 4px 14px rgba(27, 122, 61, .28);
    color: #fff;
}

/* ── Player ── */
.boombox.player {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primaryDark));
    border: none;
    color: #fff;
}

.boombox.player:hover {
    box-shadow: 0 4px 20px rgba(27, 122, 61, .20);
}

.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 .25s ease;
}

.liveDot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #ff4444;
    box-shadow: 0 0 6px rgba(255, 68, 68, .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, .15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
    transition: all .25s 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, .22);
    border-color: rgba(255, 255, 255, .50);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .16);
}

.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 — Wiphala accent ── */
.progress {
    height: 6px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, .15);
    overflow: hidden;
    position: relative;
}

/* Wiphala rainbow stripe behind the fill */
.progress::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--wiphala-grad);
    border-radius: 8px;
    opacity: .20;
}

.fill {
    height: 100%;
    width: 0%;
    background: var(--wiphala-grad);
    background-size: 300% 100%;
    border-radius: 8px;
    transition: width .2s linear;
    position: relative;
    z-index: 1;
    animation: wiphalaPulse 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(--surface);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow);
    transition: box-shadow .3s 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, 42, 56, .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(27, 122, 61, .18);
    cursor: pointer;
    transition: all .25s ease;
    padding: 0;
}

.dots button:hover {
    background: rgba(27, 122, 61, .35);
}

.dots button.active {
    background: var(--primary);
    width: 22px;
    box-shadow: 0 1px 6px rgba(27, 122, 61, .25);
}

/* ── 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 .25s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
    position: relative;
    overflow: hidden;
}

.chip::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(27, 122, 61, .15) 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(27, 122, 61, .25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27, 122, 61, .12);
    color: var(--primary);
}

.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 .25s ease, color .25s ease;
}

.chip:hover .chipIcon {
    background: rgba(27, 122, 61, .18);
    color: var(--primaryDark);
}

/* ── Wiphala decorative stripe at very bottom ── */
body::after {
    content: "";
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: var(--wiphala-grad);
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .10);
}