/* ========================================================================
   CONVERSAS PAGE — Máquina de Conversas (Interactive Roulette)
   ======================================================================== */


/* PAGE-LEVEL TOKENS */

.conversas-page {
    --pb-font-editorial: 'Playfair Display', Georgia, serif;
    --pb-font-body: 'Quicksand', sans-serif;
    --pb-reading-width: 65ch;
    --pb-warm-bg: #faf8f5;
    --pb-accent: var(--color-primary);
    --pb-ink: var(--color-ink);
    --pb-muted: var(--color-muted);
    --cv-phone-bezel: #1a1a1a;
    --cv-phone-screen-bg: #e5ddd5;
    --cv-phone-radius: 40px;
    --cv-phone-width: calc(100vw - 25px);
    --cv-hero-bg: #0a0f1e;
    background: var(--cv-hero-bg);
}

.conversas-page .header-nav-link,
.conversas-page .mobile-menu-btn {
    color: #ffffff;
}

.conversas-page .mobile-nav {
    background: var(--cv-hero-bg);
}

.conversas-page .mobile-nav-link {
    color: rgba(255, 255, 255, 0.7);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.conversas-page .mobile-nav-link:hover {
    color: #ffffff;
}


/* ========================================================================
   COVER SECTION — CINEMATIC EDITORIAL HERO
   ======================================================================== */


/* COVER LAYOUT */

.conversas-cover {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 50px 25px;
    text-align: center;
    background: var(--cv-hero-bg);
    overflow: hidden;
}


/* BOTTOM EDGE ACCENT */

.conversas-cover::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 111, 60, 0.3), transparent);
    z-index: 2;
}


/* ATMOSPHERIC GLOW */

.conversas-cover .conversas-cover__glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140%;
    height: 140%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse at center, rgba(28, 145, 228, 0.08) 0%, transparent 65%);
    pointer-events: none;
}


/* FLOATING CHAT BUBBLES — CONTAINER */

.conversas-cover .conversas-cover__bubbles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}


/* FLOATING CHAT BUBBLES — BASE */

.conversas-cover .conversas-cover__bubbles .conversas-cover__bubble {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.012);
    animation: cv-float 8s ease-in-out infinite;
}


/* FLOATING CHAT BUBBLES — POSITIONS */

.conversas-cover .conversas-cover__bubbles .conversas-cover__bubble:nth-child(1) {
    top: 12%;
    left: 5%;
    width: 100px;
    height: 60px;
    animation-duration: 8s;
}

.conversas-cover .conversas-cover__bubbles .conversas-cover__bubble:nth-child(2) {
    top: 18%;
    right: 8%;
    width: 140px;
    height: 80px;
    animation-duration: 10s;
    animation-delay: -3s;
}

.conversas-cover .conversas-cover__bubbles .conversas-cover__bubble:nth-child(3) {
    bottom: 28%;
    left: 10%;
    width: 120px;
    height: 70px;
    animation-duration: 9s;
    animation-delay: -5s;
}

.conversas-cover .conversas-cover__bubbles .conversas-cover__bubble:nth-child(4) {
    top: 55%;
    right: 12%;
    width: 90px;
    height: 50px;
    animation-duration: 7s;
    animation-delay: -2s;
}

.conversas-cover .conversas-cover__bubbles .conversas-cover__bubble:nth-child(5) {
    bottom: 12%;
    right: 20%;
    width: 160px;
    height: 90px;
    animation-duration: 11s;
    animation-delay: -7s;
}

@keyframes cv-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}


/* CONTENT WRAPPER */

.conversas-cover .conversas-cover__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
}


/* GLOWING ACCENT RULE */

.conversas-cover .conversas-cover__content .conversas-cover__rule {
    width: 80px;
    height: 2px;
    background: var(--color-accent);
    border: none;
    margin: 25px auto;
    box-shadow: 0 0 25px rgba(255, 111, 60, 0.4), 0 0 50px rgba(255, 111, 60, 0.12);
}


/* TITLE */

.conversas-cover .conversas-cover__content .conversas-cover__title {
    font-family: var(--pb-font-editorial);
    font-size: clamp(48px, 8vw, 100px);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
    margin: 0;
    letter-spacing: -0.02em;
    text-shadow: 0 0 50px rgba(28, 145, 228, 0.15);
}


/* SUBTITLE */

.conversas-cover .conversas-cover__content .conversas-cover__subtitle {
    font-family: var(--pb-font-editorial);
    font-size: 22px;
    font-weight: 400;
    font-style: italic;
    color: rgba(255, 255, 255, 0.45);
    margin: 10px 0 0 0;
}


/* INTRO TEXT */

.conversas-cover .conversas-cover__content .conversas-cover__intro {
    font-family: var(--pb-font-body);
    font-size: 18px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.65);
    max-width: var(--pb-reading-width);
    margin: 0 auto;
}


.conversas-cover .conversas-cover__content .conversas-cover__extractable {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* CTA BUTTON */

.conversas-cover .conversas-cover__content .conversas-cover__cta {
    margin-top: 50px;
    box-shadow: 0 0 25px rgba(28, 145, 228, 0.3), 0 0 50px rgba(28, 145, 228, 0.1);
}


/* STATS ROW */

.conversas-cover .conversas-cover__content .conversas-cover__stats {
    display: flex;
    flex-direction: column;
    gap: 50px;
    margin-top: 50px;
}

.conversas-cover .conversas-cover__content .conversas-cover__stats .conversas-cover__stat {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.conversas-cover .conversas-cover__content .conversas-cover__stats .conversas-cover__stat .conversas-cover__stat-value {
    font-family: var(--pb-font-editorial);
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
    line-height: 1;
}

.conversas-cover .conversas-cover__content .conversas-cover__stats .conversas-cover__stat .conversas-cover__stat-label {
    font-family: var(--pb-font-body);
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.1em;
    text-transform: lowercase;
}


/* STAGGERED REVEAL ANIMATION */

.conversas-cover .conversas-cover__content .conversas-cover__anim {
    opacity: 0;
    animation: cv-hero-reveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.conversas-cover .conversas-cover__content .conversas-cover__anim:nth-child(1) { animation-delay: 0.15s; }

.conversas-cover .conversas-cover__content .conversas-cover__anim:nth-child(2) { animation-delay: 0.3s; }

.conversas-cover .conversas-cover__content .conversas-cover__anim:nth-child(3) { animation-delay: 0.45s; }

.conversas-cover .conversas-cover__content .conversas-cover__anim:nth-child(4) { animation-delay: 0.6s; }

.conversas-cover .conversas-cover__content .conversas-cover__anim:nth-child(5) { animation-delay: 0.75s; }

.conversas-cover .conversas-cover__content .conversas-cover__anim:nth-child(6) { animation-delay: 0.9s; }

.conversas-cover .conversas-cover__content .conversas-cover__anim:nth-child(7) { animation-delay: 1.05s; }

@keyframes cv-hero-reveal {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* SCROLL HINT */

.conversas-cover .conversas-cover__scroll {
    position: absolute;
    bottom: 25px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    color: rgba(255, 255, 255, 0.25);
    z-index: 2;
    animation: cv-scroll-bounce 2s ease-in-out infinite;
}

@keyframes cv-scroll-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}


/* ========================================================================
   SCROLL ANIMATIONS (NON-COVER ELEMENTS)
   ======================================================================== */

.conversas-reveal {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.conversas-reveal--visible {
    opacity: 1;
    transform: translateY(0);
}


/* ========================================================================
   GAME SECTION
   ======================================================================== */

.conversas-game {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    height: 100dvh;
    box-sizing: border-box;
    padding: 10px;
    background: #ffffff;
    gap: 10px;
    margin-bottom: 100px;
}


/* WAVE DIVIDER — TOP EDGE */

.conversas-game::before {
    content: "";
    position: absolute;
    top: -79px;
    left: 0;
    width: 100%;
    height: 80px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'%3E%3Cpath d='M0,0 C360,80 1080,0 1440,60 L1440,80 L0,80 Z' fill='%23ffffff'/%3E%3C/svg%3E");
    background-size: 100% 100%;
    pointer-events: none;
    z-index: 2;
}


/* ========================================================================
   PHONE FRAME
   ======================================================================== */

.conversas-game .conversas-game__phone {
    position: relative;
    width: var(--cv-phone-width);
    background: var(--cv-phone-bezel);
    border-radius: var(--cv-phone-radius);
    padding: 10px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25), 0 10px 25px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.conversas-game .conversas-game__phone .conversas-game__phone-notch {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 25px;
    background: var(--cv-phone-bezel);
    border-radius: 0 0 25px 25px;
    z-index: 2;
}

.conversas-game .conversas-game__phone .conversas-game__phone-screen {
    position: relative;
    background: var(--cv-phone-screen-bg);
    border-radius: calc(var(--cv-phone-radius) - 10px);
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}


/* SCROLL HINT GRADIENT — FADES BOTTOM EDGE TO HINT MORE CONTENT */

.conversas-game .conversas-game__phone::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    height: 50px;
    background: linear-gradient(transparent, var(--cv-phone-screen-bg));
    border-radius: 0 0 calc(var(--cv-phone-radius) - 10px) calc(var(--cv-phone-radius) - 10px);
    pointer-events: none;
    z-index: 1;
}

.conversas-game .conversas-game__phone .conversas-game__phone-screen::-webkit-scrollbar {
    display: none;
}

.conversas-game .conversas-game__phone .conversas-game__phone-screen .conversas-game__phone-img {
    display: block;
    width: 100%;
    transition: opacity 0.4s ease;
}


/* CROSSFADE — STAGING IMAGE OVERLAYS THE CURRENT ONE */

.conversas-game .conversas-game__phone .conversas-game__phone-screen .conversas-game__phone-img--staging {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

.conversas-game .conversas-game__phone .conversas-game__phone-screen .conversas-game__phone-img--fade-in {
    opacity: 1;
}


/* ========================================================================
   CATEGORY BADGE
   ======================================================================== */

.conversas-game .conversas-game__phone .conversas-game__phone-badge {
    position: absolute;
    top: 25px;
    right: 10px;
    z-index: 3;
    font-family: var(--pb-font-body);
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    background: #6b7280;
    padding: 4px 10px;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}


/* EMPTY STATE — SHOWN WHEN FILTER YIELDS NO RESULTS */

.conversas-game .conversas-game__phone .conversas-game__phone-empty {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 2;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--pb-font-body);
    color: rgba(0, 0, 0, 0.4);
    text-align: center;
    padding: 50px 25px;
}

.conversas-game .conversas-game__phone .conversas-game__phone-empty.conversas-game__phone-empty--visible {
    display: flex;
}

.conversas-game .conversas-game__phone .conversas-game__phone-empty .conversas-game__phone-empty-icon {
    font-size: 36px;
    line-height: 1;
    opacity: 0.5;
}

.conversas-game .conversas-game__phone .conversas-game__phone-empty .conversas-game__phone-empty-text {
    font-weight: 500;
}


/* ========================================================================
   ACTION ROW (FILTER + SHUFFLE BUTTON)
   ======================================================================== */

.conversas-game .conversas-game__action {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    max-width: 100%;
}


/* ========================================================================
   FILTER SELECT
   ======================================================================== */

.conversas-game .conversas-game__action .conversas-game__filter {
    font-family: var(--pb-font-body);
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 100px;
    height: 48px;
    padding: 0 25px;
    padding-right: 35px;
    margin-bottom: 10px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: border-color 0.2s ease;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversas-game .conversas-game__action .conversas-game__shuffle-btn {
    flex-shrink: 0;
}

.conversas-game .conversas-game__action .conversas-game__filter:hover {
    border-color: #9ca3af;
}

.conversas-game .conversas-game__action .conversas-game__filter:focus {
    outline: none;
    border-color: var(--color-primary);
}


/* ========================================================================
   PARTICLES
   ======================================================================== */

.conversas-game .conversas-game__action .conversas-game__particles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    width: 0;
    height: 0;
}

.conversas-game .conversas-game__action .conversas-game__particles .conversas-game__particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0;
}

.conversas-game .conversas-game__action .conversas-game__particles .conversas-game__particle:nth-child(1) { background: var(--color-primary); }

.conversas-game .conversas-game__action .conversas-game__particles .conversas-game__particle:nth-child(2) { background: var(--color-secondary); }

.conversas-game .conversas-game__action .conversas-game__particles .conversas-game__particle:nth-child(3) { background: var(--color-tertiary, #06b6d4); }

.conversas-game .conversas-game__action .conversas-game__particles .conversas-game__particle:nth-child(4) { background: var(--color-primary); }

.conversas-game .conversas-game__action .conversas-game__particles .conversas-game__particle:nth-child(5) { background: var(--color-secondary); }

.conversas-game .conversas-game__action .conversas-game__particles .conversas-game__particle:nth-child(6) { background: var(--color-tertiary, #06b6d4); }


/* PARTICLE BURST ANIMATION */

.conversas-game .conversas-game__action .conversas-game__particles--burst .conversas-game__particle:nth-child(1) { animation: cv-burst-1 0.6s ease-out both; }

.conversas-game .conversas-game__action .conversas-game__particles--burst .conversas-game__particle:nth-child(2) { animation: cv-burst-2 0.6s ease-out 0.05s both; }

.conversas-game .conversas-game__action .conversas-game__particles--burst .conversas-game__particle:nth-child(3) { animation: cv-burst-3 0.6s ease-out 0.1s both; }

.conversas-game .conversas-game__action .conversas-game__particles--burst .conversas-game__particle:nth-child(4) { animation: cv-burst-4 0.6s ease-out 0.05s both; }

.conversas-game .conversas-game__action .conversas-game__particles--burst .conversas-game__particle:nth-child(5) { animation: cv-burst-5 0.6s ease-out 0.1s both; }

.conversas-game .conversas-game__action .conversas-game__particles--burst .conversas-game__particle:nth-child(6) { animation: cv-burst-6 0.6s ease-out 0.15s both; }

@keyframes cv-burst-1 {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(-50px, -50px) scale(0); }
}

@keyframes cv-burst-2 {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(50px, -50px) scale(0); }
}

@keyframes cv-burst-3 {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(50px, 25px) scale(0); }
}

@keyframes cv-burst-4 {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(-50px, 25px) scale(0); }
}

@keyframes cv-burst-5 {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(0, -50px) scale(0); }
}

@keyframes cv-burst-6 {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(0, 50px) scale(0); }
}


/* ========================================================================
   RESPONSIVE — MOBILE (639px)
   ======================================================================== */

@media (max-width: 639px) {

    .conversas-game::before {
        height: 50px;
        top: -49px;
    }
}


/* ========================================================================
   RESPONSIVE — TABLET (768px)
   ======================================================================== */

@media (min-width: 768px) {

    .conversas-page {
        --cv-phone-width: 380px;
        --cv-phone-radius: 50px;
    }


    /* BADGE — OVERHANG ON TABLET+ WHERE THERE'S ROOM */

    .conversas-game .conversas-game__phone .conversas-game__phone-badge {
        right: -10px;
    }


    /* GAME SECTION — RESTORE BREATHING ROOM ON TABLET */

    .conversas-game {
        padding: 50px 25px;
        gap: 25px;
    }

    .conversas-cover .conversas-cover__content .conversas-cover__stats {
        flex-direction: row;
        justify-content: center;
    }

    .conversas-cover .conversas-cover__content .conversas-cover__stats .conversas-cover__stat {
        flex: 1;
        max-width: 200px;
    }
}


/* ========================================================================
   RESPONSIVE — DESKTOP (1024px)
   ======================================================================== */

@media (min-width: 1024px) {

    .conversas-page {
        --cv-phone-width: 400px;
    }

    .conversas-cover .conversas-cover__content .conversas-cover__stats .conversas-cover__stat .conversas-cover__stat-value {
        font-size: 64px;
    }


    /* GAME SECTION — ROW ON DESKTOP */

    .conversas-game {
        flex-direction: row;
        align-items: center;
        gap: 50px;
    }

    .conversas-game .conversas-game__phone {
        flex: none;
        align-self: stretch;
    }
}
