/*
 * Petit Polisson : mode Live (/live), plein ecran, mobile d'abord.
 * Cf. templates/pages/live/index.twig et public/js/live.js. Couleurs : petit-polisson-dark-theme.css.
 *
 * Empilement dans un ecran : media (0) < zone de toucher (1) < degrade, chargement (2) < bouton lecture,
 * icone son, aide (4) < infos et boutons (5) < message "indisponible" (6).
 */

/* =============================================================== Page */
html:has(body.pageLive) { height: 100%; overflow: hidden; }
body.pageLive {
    --live-nav-h: 0px; /* hauteur de la barre du bas, mesuree par live.js */
    height: 100%;
    min-height: 0;
    padding: 0 !important; /* ni en-tete ni pied de page du site */
    overflow: hidden;
    background: #000;
    color: #fff;
    overscroll-behavior: none;
}

/* =============================================================== Haut : retour + Femmes / Hommes / Trans */
.liveTop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: calc(8px + env(safe-area-inset-top)) 10px 18px;
    background: linear-gradient(180deg, rgba(0, 0, 0, .62) 0%, rgba(0, 0, 0, .25) 60%, transparent 100%);
    pointer-events: none;
}
.liveTop > * { pointer-events: auto; }
.liveHome {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .4);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .14);
}
.liveHome:hover, .liveHome:focus { color: var(--pp-nude); }
.liveTabs { display: flex; gap: 6px; margin: 0 auto; padding-right: 38px; }
.liveTabs a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .38);
    color: rgba(255, 255, 255, .86);
    font-size: .82em;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .1);
}
.liveTabs a i { color: var(--pp-nude); }
.liveTabs a:hover { color: #fff; }
.liveTabs a.selected { background: var(--pp-btn); color: var(--pp-btn-text); box-shadow: none; }
.liveTabs a.selected i { color: var(--pp-btn-text); }
/* categorie / filtres repris de la liste (la croix revient a tout le groupe) */
.liveTop { flex-wrap: wrap; }
.liveScopeRow { display: flex; flex: 0 0 100%; justify-content: center; margin-top: -2px; }
.liveScopeRow[hidden] { display: none; } /* modeles hors categorie (suite avec tout le groupe) */
.liveScope {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 5px 8px 5px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    font-size: .78em;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 0 0 1px rgba(233, 196, 169, .35);
    backdrop-filter: blur(6px);
}
.liveScope:hover, .liveScope:focus { color: #fff; box-shadow: 0 0 0 1px rgba(233, 196, 169, .7); }
.liveScope > span:not(.fi) { display: inline-flex; align-items: center; gap: 4px; overflow: hidden; text-overflow: ellipsis; }
.liveScope .fi { flex: none; width: 1.333em; height: 1em; border-radius: 2px; }
.liveScope i.fa-comment { color: var(--pp-nude); font-size: .9em; }
.liveScope .close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    font-size: .85em;
}
@media (max-width: 359.98px) {
    .liveTabs { padding-right: 0; }
    .liveTabs a { padding: 7px 9px; }
    .liveTabs a i { display: none; }
}

/* =============================================================== Defilement : un ecran = un modele */
.liveFeed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--live-nav-h);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    outline: none;
    overflow-anchor: none; /* pas de correction automatique quand un ecran est remplace (de) */
}
.liveFeed::-webkit-scrollbar { display: none; }
.liveFeed.liveSwap { scroll-snap-type: none; }
.liveDicing .liveFeed { overflow: hidden; touch-action: none; }

.liveSlide {
    position: relative;
    height: 100%;
    overflow: hidden;
    background: #000;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* --- image / video : remplit l'ecran par defaut (body.liveCover) ; sinon entiere, avec un fond flou autour */
.liveMedia { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.liveBg {
    position: absolute;
    top: -8%;
    left: -8%;
    width: 116%;
    height: 116%;
    object-fit: cover;
    filter: blur(26px) brightness(.42) saturate(1.15);
}
.livePoster, .liveVideo, .liveFrame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
}
.liveVideo { opacity: 0; transition: opacity .35s ease; }
.liveVideo.on { opacity: 1; }
.liveCover .livePoster, .liveCover .liveVideo { object-fit: cover; }
.liveFrame { background: #000; }
/* avant la reponse a l'ecran "18 ans ou plus" : images floutees */
body.pageLive:not(.ageOk) .livePoster,
body.pageLive:not(.ageOk) .liveBg { filter: blur(30px) brightness(.45); }

.liveTap { position: absolute; inset: 0; z-index: 1; -webkit-tap-highlight-color: transparent; }
.liveShade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    height: 56%;
    background: linear-gradient(0deg, rgba(0, 0, 0, .85) 0%, rgba(0, 0, 0, .5) 40%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}

/* --- chargement */
.liveLoader {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 54px;
    height: 54px;
    margin: -27px 0 0 -27px;
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}
.liveLoader span {
    display: block;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(233, 196, 169, .2);
    border-top-color: var(--pp-nude);
    border-radius: 50%;
    animation: liveSpin .8s linear infinite;
}
body.ageOk .liveSlide.active.loading .liveLoader { opacity: 1; transition-delay: .3s; }
@keyframes liveSpin { to { transform: rotate(360deg); } }

/* --- lecture bloquee par le navigateur : bouton lecture */
.livePlay {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 4;
    display: none;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin: -38px 0 0 -38px;
    padding: 0 0 0 6px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    font-size: 1.9em;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .5), 0 8px 26px rgba(0, 0, 0, .5);
    backdrop-filter: blur(6px);
}
.liveSlide.tapToPlay .livePlay { display: flex; }

/* =============================================================== Infos du modele + bouton vers son chat */
.liveInfo {
    position: absolute;
    left: 0;
    right: 66px;
    bottom: 0;
    z-index: 5;
    padding: 0 14px 28px;
}
.liveWho { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; }
.liveTag {
    padding: 3px 7px;
    border-radius: 5px;
    background: var(--pp-live);
    color: #fff;
    font-size: .68em;
    font-weight: 900;
    letter-spacing: .6px;
    text-transform: uppercase;
}
.liveTag.isNew { background: var(--pp-nude); color: var(--pp-btn-text); }
.liveName {
    max-width: 100%;
    overflow: hidden;
    color: #fff;
    font-size: 1.22em;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}
.liveName:hover, .liveName:focus { color: var(--pp-nude); }
.liveFlag { flex: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); }
.liveAge, .liveViewers { color: rgba(255, 255, 255, .86); font-size: .9em; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.liveViewers i { margin-right: 4px; color: var(--pp-nude); }
.liveHeadline {
    display: -webkit-box;
    margin: 6px 0 0;
    overflow: hidden;
    color: rgba(255, 255, 255, .9);
    font-size: .92em;
    line-height: 1.38;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.liveJoin {
    margin-top: 12px;
    padding: .78em 1.25em;
    border-radius: 999px;
    font-size: 1em;
    box-shadow: 0 6px 22px rgba(0, 0, 0, .45), 0 0 26px var(--pp-action-glow), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.liveJoin i { font-size: 1.1em; }
.liveSlide.playing .liveJoin { animation: liveJoinPulse 2.6s ease-in-out 1.2s infinite; }
@keyframes liveJoinPulse {
    0%, 100% { box-shadow: 0 6px 22px rgba(0, 0, 0, .45), 0 0 26px var(--pp-action-glow), inset 0 1px 0 rgba(255, 255, 255, .25); }
    50% { box-shadow: 0 6px 22px rgba(0, 0, 0, .45), 0 0 0 6px rgba(226, 174, 76, .22), 0 0 34px var(--pp-action-glow), inset 0 1px 0 rgba(255, 255, 255, .25); }
}

/* =============================================================== Boutons a droite : son, agrandir */
.liveSide {
    position: absolute;
    right: 10px;
    bottom: 30px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.liveSide button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font-size: 1.12em;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .16);
    backdrop-filter: blur(6px);
    transition: transform .15s ease, background .15s ease;
}
.liveSide button:active { transform: scale(.92); }
.liveSide button[aria-pressed="true"] { background: rgba(233, 196, 169, .9); color: var(--pp-btn-text); }
.liveSide .isOn { display: none; }
.liveSoundOn .jsLiveSound .isOff, .liveCover .jsLiveFit .isOff { display: none; }
.liveSoundOn .jsLiveSound .isOn, .liveCover .jsLiveFit .isOn { display: inline-block; }

/* coeur (favori) : en haut de la colonne ; rempli couleur chair une fois ajoute */
.liveSide .liveFav[aria-pressed="true"] { background: rgba(0, 0, 0, .45); color: var(--pp-nude, #e9c4a9); }
.liveFav[aria-pressed="true"] .isOff { display: none; }
.liveFav[aria-pressed="true"] .isOn { display: inline-block; animation: liveFavPop .35s ease; }
@keyframes liveFavPop {
    0% { transform: scale(.6); }
    60% { transform: scale(1.25); }
    100% { transform: scale(1); }
}
.liveFlash .isFav { color: var(--pp-nude, #e9c4a9); }

/* aide "touchez pour le son" a cote du bouton (2e de la colonne, sous le coeur : 46px + 12px d'ecart) */
.liveSoundTip {
    position: absolute;
    top: 67px;
    right: calc(100% + 10px);
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .7);
    color: #fff;
    font-size: .8em;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 0 0 1px rgba(233, 196, 169, .35);
    animation: liveFadeIn .3s ease both;
    pointer-events: none;
}
.liveSoundTip.out { opacity: 0; transition: opacity .5s ease; }

/* icone au centre quand on coupe / active le son */
.liveFlash {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    margin: -42px 0 0 -42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    font-size: 2em;
    animation: liveFlash .8s ease forwards;
    pointer-events: none;
}
@keyframes liveFlash {
    0% { opacity: 0; transform: scale(.7); }
    25% { opacity: 1; transform: scale(1); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.15); }
}

/* aide "glissez vers le haut" (premiere visite) */
.liveSwipeHint {
    position: absolute;
    left: 50%;
    bottom: 34%;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    font-weight: 700;
    transform: translateX(-50%);
    text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
    animation: liveFadeIn .4s ease both;
    pointer-events: none;
}
.liveSwipeHint i { font-size: 1.5em; line-height: .7; animation: liveSwipe 1.4s ease-in-out infinite; }
.liveSwipeHint i + i { animation-delay: .12s; opacity: .7; }
.liveSwipeHint span { margin-top: 10px; padding: 6px 13px; border-radius: 999px; background: rgba(0, 0, 0, .55); font-size: .88em; white-space: nowrap; }
.liveSwipeHint.out { opacity: 0; transition: opacity .6s ease; }
@keyframes liveSwipe {
    0%, 100% { transform: translateY(6px); opacity: .4; }
    50% { transform: translateY(-8px); opacity: 1; }
}
@keyframes liveFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* =============================================================== De "au hasard" : fondu + petit de au centre */
.liveDiceFx {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--live-nav-h);
    z-index: 20; /* sur les ecrans, sous le haut (retour + onglets) */
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 50%, #2a1d15 0%, #000 62%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .3s ease, visibility 0s linear .3s; /* retour : DICE_FADE_OUT (live.js) */
}
.liveDicing .liveDiceFx {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* aucun geste pendant l'animation */
    transition: opacity .15s ease, visibility 0s;
}
.liveDiceFx .diceBadge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--pp-action);
    box-shadow: 0 0 0 5px rgba(0, 0, 0, .55), 0 10px 30px rgba(0, 0, 0, .6), 0 0 34px var(--pp-action-glow), inset 0 2px 0 rgba(255, 255, 255, .35);
    opacity: 0;
    transform: scale(.55);
    transition: transform .25s ease, opacity .2s ease;
}
.liveDicing .liveDiceFx .diceBadge {
    opacity: 1;
    transform: scale(1);
    transition: transform .28s cubic-bezier(.3, 1.5, .5, 1), opacity .12s ease;
}
.liveDiceFx .die3d { --s: 32px; }

/* =============================================================== Modele indisponible */
.liveState {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    background: rgba(10, 8, 7, .74);
    text-align: center;
    backdrop-filter: blur(4px);
}
.liveState .msg { margin: 0; font-size: 1.12em; font-weight: 700; }
.liveState .acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* =============================================================== Fin de la liste */
.liveEnd { display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 35%, #2f2823 0%, #000 72%); }
.liveEndBox { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 340px; padding: 24px; text-align: center; }
.liveEndBox > i { margin-bottom: 4px; color: var(--pp-nude); font-size: 2.4em; }
.liveEndBox .msg { margin: 0 0 6px; color: var(--pp-text); font-size: 1.08em; font-weight: 700; }
.liveEndBox .ppBtn { min-width: 220px; }

.liveNoJs {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    text-align: center;
}

/* Ecran "18 ans ou plus" : commun a tout le site (.ageGate, petit-polisson.css) */

/* =============================================================== Visiteurs : temps de video ecoule */
/* videos floutees, on peut toujours faire defiler (seule la carte capte les touchers) */
body.liveWalled .liveVideo,
body.liveWalled .liveFrame,
body.liveWalled .livePoster { filter: blur(22px) brightness(.62); }
body.liveWalled .liveSoundTip,
body.liveWalled .liveSwipeHint,
body.liveWalled .liveLoader { display: none; }
.liveWall {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--live-nav-h);
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 18px 150px; /* au-dessus des infos du modele */
    pointer-events: none;
}
.liveWall[hidden] { display: none; }
.liveWall .box {
    width: min(100%, 340px);
    padding: 22px 20px 16px;
    border: 1px solid var(--pp-line-2);
    border-radius: 18px;
    background: rgba(28, 23, 20, .9);
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
    backdrop-filter: blur(8px);
    animation: liveWallIn .45s ease both;
    pointer-events: auto;
}
.liveWall .ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: rgba(255, 93, 93, .16);
    color: var(--pp-live);
    font-size: 1.3em;
    box-shadow: inset 0 0 0 2px rgba(255, 93, 93, .5);
}
.liveWall h2 { margin: 0 0 8px; font-size: 1.25em; font-weight: 900; }
.liveWall p { margin: 0 0 14px; color: var(--pp-text-2); font-size: .93em; line-height: 1.5; }
.liveWall .ppBtn { gap: 8px; padding: .85em 1em; font-size: 1em; }
.liveWall p.login { margin: 12px 0 0; font-size: .88em; }
@keyframes liveWallIn {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to { opacity: 1; transform: none; }
}

/* =============================================================== Barre du bas : version compacte sur la video */
@media (max-width: 767.98px) {
    .pageLive .bottomNav {
        background: rgba(0, 0, 0, .94);
        border-top-color: rgba(255, 255, 255, .07);
        box-shadow: none;
    }
    .pageLive .bottomNav a { gap: 2px; padding: 6px 0 5px; font-size: .62em; }
    .pageLive .bottomNav a i { font-size: 1.3em; }
    .pageLive .bottomNav a.diceNav { padding-top: 0; }
    .pageLive .diceNav .diceBtn {
        width: 48px;
        height: 48px;
        margin-top: -14px;
        box-shadow: 0 0 0 4px #000, 0 6px 16px rgba(0, 0, 0, .5), 0 0 18px var(--pp-action-glow), inset 0 2px 0 rgba(255, 255, 255, .35);
    }
    .pageLive .diceNav .die3d { --s: 22px; }
}

/* =============================================================== Ordinateur : fleches precedent / suivant */
.liveNav { display: none; }
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
    .liveNav {
        position: fixed;
        top: 50%;
        right: 24px;
        z-index: 25; /* sur les ecrans et le fondu du de, sous le haut */
        display: flex;
        flex-direction: column;
        gap: 14px;
        transform: translateY(-50%);
    }
    .liveNav button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 54px;
        height: 54px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: rgba(0, 0, 0, .45);
        color: #fff;
        font-size: 1.25em;
        box-shadow: 0 0 0 1px rgba(255, 255, 255, .18), 0 6px 18px rgba(0, 0, 0, .35);
        backdrop-filter: blur(6px);
        cursor: pointer;
        transition: background .15s ease, color .15s ease, transform .15s ease, opacity .2s ease;
    }
    .liveNav button:hover, .liveNav button:focus-visible { background: rgba(233, 196, 169, .92); color: var(--pp-btn-text); }
    .liveNav button:active { transform: scale(.92); }
    .liveNav button:disabled { opacity: .28; background: rgba(0, 0, 0, .45); color: #fff; cursor: default; transform: none; }
    body:not(.ageOk) .liveNav { visibility: hidden; }
    /* premiere visite : la fleche "suivant" attire l'oeil quelques secondes */
    .liveNav button.nudge { background: rgba(233, 196, 169, .92); color: var(--pp-btn-text); animation: liveNudge 1.1s ease-in-out 4; }
    @keyframes liveNudge {
        0%, 100% { transform: translateY(0); box-shadow: 0 0 0 1px rgba(255, 255, 255, .18), 0 6px 18px rgba(0, 0, 0, .35); }
        50% { transform: translateY(6px); box-shadow: 0 0 0 7px rgba(233, 196, 169, .22), 0 6px 18px rgba(0, 0, 0, .35); }
    }
}

/* =============================================================== Ordinateur */
@media (min-width: 768px) {
    .liveTop { padding: 14px 20px 26px; }
    .liveTabs { padding-right: 38px; }
    .liveInfo { right: auto; max-width: 560px; padding: 0 28px 34px; }
    .liveName { font-size: 1.5em; }
    .liveSide { right: 24px; bottom: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    .liveSlide.playing .liveJoin, .liveSwipeHint i, .liveLoader span, .liveWall .box, .liveNav button.nudge { animation: none; }
    .liveDiceFx, .liveDiceFx .diceBadge, .liveDicing .liveDiceFx, .liveDicing .liveDiceFx .diceBadge { transition: none; }
}
