/* feed-common.css — base compartida (mobile-first). Sin reglas PC-only. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --accent: #e8193c;
    --bg:     #f5f5f5;
    --text:   #111;
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden; /* mobile: scroller controla el swipe (como optimizado) */
}

body {
    background: #000;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    color: var(--text);
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
}
body::-webkit-scrollbar { display: none; }

/* Feed dentro del shell Optimizado */
.app-feed-wrap .feed,
.app-feed-wrap #feed {
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
}
/* Shell TikTok — 1 video a la vez (móvil y PC, estilo TikTok desktop) */
.tt-shell {
    width: 100%;
    height: 100%;
    background: #000;
    touch-action: none;
}
/* Móvil snap: pan vertical nativo (override en feed-mobile.css también) */
.tt-shell.tt-shell-snap {
    touch-action: pan-y;
}
.tt-slide {
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tt-slide .feed-item {
    width: 100%;
    max-width: 100%;
    height: 100%;
    margin: 0 auto;
}

/* PC: estilo TikTok desktop — nombre en video, rail circular, flechas al lado */

/* ── TOPBAR: solo menú (sin logo LAYRANETWORK) ── */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 52px;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 12px;
    pointer-events: none;
}
.topbar-logo { display: none !important; }
.topbar-space { display: none; }
.topbar-menu {
    position: fixed;
    right: 12px; top: 10px;
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
    width: 40px; height: 40px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 4px; cursor: pointer;
    z-index: 301;
    pointer-events: auto;
}
.topbar-menu span {
    display: block; width: 17px; height: 2px;
    background: #fff; border-radius: 2px;
}

/* ── FEED: siempre 1 video (scroller) ── */
.feed { display: block; width: 100%; height: 100%; }
.feed-card { display: contents; }

/* ── ITEM ── */
.feed-item {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    background-color: #000;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
}
/*
 * Publicidad unificada (index + perfil):
 * Fondo negro full-screen #0a0a0a — NUNCA caja blanca / gris clara.
 * Preview y unidad usan el mismo marco oscuro del player de modelos.
 */
.feed-ad-slide,
.vp-ad-slide,
.pp-ad-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100%;
    background: #000 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    gap: 10px;
    touch-action: pan-y;
    overflow: hidden;
    -webkit-overflow-scrolling: auto;
    color: rgba(255,255,255,.7);
}
/* Marcaje AdSense legacy: Publicidad sin negrita + línea gris, no pegada al anuncio */
.feed-ad-slide .feed-ad-inline-label,
.vp-ad-slide .feed-ad-inline-label {
    position: static;
    color: rgba(255,255,255,.55) !important;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: .04em;
    text-transform: none;
    z-index: 2;
    margin: 0 0 8px;
    padding: 0 0 8px;
    border-bottom: 1px solid rgba(160,160,160,.55);
    width: 300px;
    max-width: min(100%, 340px);
    pointer-events: none;
    text-align: center;
    box-sizing: border-box;
}
/* Unidad de anuncio: 300×300 máx (no creativos largos) */
.feed-ad-slide .feed-ad-unit,
.feed-ad-slide .feed-ad-preview,
.vp-ad-slide .feed-ad-unit,
.vp-ad-slide .feed-ad-preview {
    width: 300px !important;
    max-width: 300px !important;
    min-height: 250px !important;
    height: 300px !important;
    max-height: 300px !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    gap: 0;
    color: rgba(255,255,255,.55) !important;
    font-size: 14px;
    font-weight: 400;
    text-align: center;
    padding: 0;
    margin-top: 6px;
    box-sizing: border-box;
    background: #111 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    z-index: 2;
}
.feed-ad-slide .feed-ad-preview,
.vp-ad-slide .feed-ad-preview {
    padding: 18px 14px !important;
    gap: 8px;
}
.feed-ad-slide .feed-ad-preview strong,
.vp-ad-slide .feed-ad-preview strong {
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
}
.feed-ad-slide .feed-ad-preview span,
.vp-ad-slide .feed-ad-preview span {
    color: rgba(255,255,255,.5) !important;
}
.feed-ad-slide .feed-ad-unit ins.adsbygoogle,
.vp-ad-slide .feed-ad-unit ins.adsbygoogle {
    display: block !important;
    width: 100% !important;
    min-height: 250px;
    background: #111 !important;
    border-radius: 0 !important;
}
/* Google a veces pinta blanco el iframe: contenedor siempre oscuro */
.feed-ad-slide .feed-ad-unit iframe,
.vp-ad-slide .feed-ad-unit iframe,
.feed-ad-slide iframe,
.vp-ad-slide iframe,
.play-ad-ui iframe {
    background: #111 !important;
    border: 0 !important;
    border-radius: 0 !important;
    max-width: 100%;
}

/* ── MEDIA ──
 * 1 sola imagen de poster en .feed-item (background).
 * El <video> solo se ve cuando tiene frame (has-frame) → sin “2–3 trozos”.
 */
.feed-media-bg {
    display: none !important; /* legado: no usar capas extra */
}
.feed-video {
    position: absolute; inset: 0;
    width: 100% !important;
    height: 100% !important;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center center;
    pointer-events: none;
    background: transparent !important;
    z-index: 1;
    /* Oculto hasta tener frame real → se ve el poster único del item */
    opacity: 0;
}
.feed-video.has-frame {
    opacity: 1;
    /* Sin transition al scrollear: evita “relámpago” al cambiar de slide */
    transition: none;
}
html.profile-player-open .pp-slide {
    transform: none !important;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Shell del motor play_core (index + perfil) */
.play-shell {
    background: #000;
}
.play-slide {
    background: #000;
}

.feed-embed {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.feed-embed iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    object-fit: cover;
}

.feed-embed > div {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
}

.feed-poster {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; object-position: top;
}

/* ── OVERLAY: sombra solo abajo para legibilidad del nombre ── */
.feed-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 55%,
        rgba(0,0,0,.25) 75%,
        rgba(0,0,0,.72) 100%
    );
    pointer-events: none;
    z-index: 1;
}
/* Se mantiene visible al reproducir (texto del pie) */
.feed-item.playing .feed-overlay { opacity: 1; }

/* ── ZONA TAP pausa (deja libres pie meta y botones laterales) ── */
.feed-tap-area {
    position: absolute;
    top: 0; left: 0; right: 64px;
    bottom: 110px;
    z-index: 2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* ── PLAY al pausar: mismo triángulo blanco que el player de perfil (TikTok) ── */
.feed-pause-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    z-index: 12;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s, transform .18s;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .45));
}
.feed-pause-icon svg {
    width: 64px !important;
    height: 64px !important;
    fill: #fff !important;
    stroke: none !important;
    margin-left: 8px;
    filter: none;
}
.feed-item.paused .feed-pause-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
@media (min-width: 768px) {
    .feed-pause-icon svg {
        width: 84px !important;
        height: 84px !important;
        margin-left: 10px;
    }
}

/* ── SPINNER — no layout shift (fixed inside item) ── */
.feed-spinner {
    position: absolute;
    top: 50%; left: 50%;
    width: 44px; height: 44px;
    margin: -22px 0 0 -22px; /* no transform fight with GPU layer */
    border: 3px solid rgba(255,255,255,.22);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .65s linear infinite;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    will-change: opacity;
}
.feed-item.buffering .feed-spinner {
    opacity: 1;
    visibility: visible;
}
.feed-item.buffering .feed-pause-icon { opacity: 0; }
/* Poster = background del .feed-item; video solo con .has-frame */

/* ── BARRA PROGRESO + tiempo (PC hover; móvil = hilo fino) ── */
.feed-progress {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 12;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    pointer-events: none;
    box-sizing: border-box;
}
.feed-progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}
.feed-progress-track {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 1.5px;
    background: rgba(255,255,255,.12);
    overflow: hidden;
    border-radius: 0;
}
.feed-progress-bar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    height: 100% !important;
    background: rgba(255,255,255,.72) !important;
    width: 0%;
    transition: width .1s linear;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}
.feed-progress-time {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
    color: rgba(255,255,255,.9);
    text-shadow: 0 1px 2px rgba(0,0,0,.45);
    white-space: nowrap;
    line-height: 1;
    font-family: Inter, system-ui, sans-serif;
    display: none; /* solo PC */
}
.feed-progress-time .feed-t-sep {
    margin: 0 1px;
    opacity: .75;
}

/* ── MUTE (sidebar, grande, encima de Chat) ── */
.feed-mute { display: none !important; }
.feed-mute-btn { margin-top: 2px; }
.feed-mute-icon-lg {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    background: rgba(0,0,0,.48) !important;
    border: 1.5px solid rgba(255,255,255,.38) !important;
    box-shadow: 0 4px 14px rgba(0,0,0,.35) !important;
    filter: none !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.feed-mute-btn:active .feed-mute-icon-lg { transform: scale(.88); background: rgba(232,25,60,.55) !important; }
.feed-mute-btn .feed-mute-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .3px;
    margin-top: 2px;
}
.feed-mute-btn[data-muted="0"] .feed-mute-icon-lg {
    background: rgba(232,25,60,.72) !important;
    border-color: rgba(255,255,255,.55) !important;
}

/* ══ BOTONES LATERALES (base) ══ */
.feed-actions {
    position: absolute;
    right: 6px;
    bottom: 110px;
    z-index: 8;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.feed-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}

/* Iconos solo blanco — sin círculo/borde oscuro */
.feed-action-icon {
    width: 34px;
    height: 34px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    filter: none;
    transition: transform .12s;
}
.feed-action-btn:active .feed-action-icon {
    transform: scale(.9);
}
.feed-action-icon svg {
    width: 28px !important;
    height: 28px !important;
    fill: #fff !important;
    stroke: #fff;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.35));
}
.feed-action-icon svg[stroke] {
    fill: none !important;
    stroke: #fff !important;
}

.feed-action-label {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,.45);
    letter-spacing: 0;
    line-height: 1;
    margin-top: 0;
}

/* ── PERFIL: anillo cyan fino + plus rosa (sin borde oscuro extra) ── */
.feed-action-perfil-wrap {
    position: relative;
    width: 42px;
    height: 42px;
    margin-bottom: 6px;
}
.feed-action-perfil-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 2px solid #25f4ee;
    box-shadow: none;
    display: block;
    background: #222;
}
.feed-action-perfil-fallback {
    background: linear-gradient(135deg, #333, #111);
}
.feed-action-perfil-plus {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    background: #fe2c55;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
}
.feed-action-disc {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1a1a1a;
    border: 6px solid #2a2a2a;
    box-shadow: none;
    overflow: hidden;
    margin-top: 2px;
    animation: discSpin 6s linear infinite;
}
.feed-action-disc img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
@keyframes discSpin { to { transform: rotate(360deg); } }

/* Antiguo botón por-video: oculto */
.feed-hard-refresh{ display: none !important; }
/* Botón Actualizar: oculto por defecto; hard-refresh.js decide (en PC nunca) */
.layra-hard-refresh-once{
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 100050 !important;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.55);
    background: rgba(0,0,0,.72);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    pointer-events: auto !important;
    -webkit-tap-highlight-color: transparent;
}
html.is-pc .layra-hard-refresh-once{
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/*
 * Index pie del video (For You):
 *  PC: "+ Más" / "- Menos" (caption oculto hasta clic)
 *  Móvil: caption siempre visible (ver feed-mobile.css) — sin botón Más
 */
.feed-meta {
    position: absolute;
    left: 10px;
    right: 54px; /* hasta casi el rail */
    bottom: 4px; /* bien abajo */
    z-index: 16;
    padding: 0 4.5em 2px 0; /* hueco fijo a la derecha para el botón */
    box-sizing: border-box;
    pointer-events: auto;
    text-align: left;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    max-width: none;
    width: auto;
}
.feed-item.playing .feed-meta,
.feed-item.paused .feed-meta {
    opacity: 1 !important;
    pointer-events: auto;
    transform: none;
}
.feed-ciudad { display: none; }

.feed-meta-line {
    display: block;
    width: 100%;
    position: relative;
    min-height: 1.3em;
    padding-right: 0;
    box-sizing: border-box;
}
.feed-nombre {
    font-family: 'Inter', sans-serif;
    font-size: 0.98rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.25;
    margin: 0;
    text-shadow: 0 1px 8px rgba(0,0,0,.75), 0 0 1px rgba(0,0,0,.8);
    letter-spacing: .2px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.feed-nombre a {
    color: #fff !important;
    text-decoration: none;
}
.feed-nombre a:hover { text-decoration: underline; }
.feed-user { display: none; }
.feed-enganche { display: none; }

/* Botón SIEMPRE esquina inferior-derecha del pie (cerrado y abierto) */
.feed-meta .cap-more,
.feed-meta.is-cap-open .cap-more {
    position: absolute !important;
    right: -28px !important; /* más a la derecha (recta iconos) */
    bottom: 2px !important;
    left: auto !important;
    top: auto !important;
    display: inline-block !important;
    margin: 0 !important;
    padding: 6px 2px !important;
    border: none !important;
    background: transparent !important;
    color: #fff !important;
    font-size: 0.95rem !important;
    font-weight: 400 !important; /* normal, sin negrita */
    font-family: inherit;
    cursor: pointer;
    line-height: 1.15;
    text-shadow: 0 1px 5px rgba(0,0,0,.75);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 5;
    text-align: right;
}
.feed-meta .cap-more:hover,
.feed-meta .cap-more:focus,
.feed-meta .cap-more:active {
    color: #fff !important;
    text-decoration: none !important;
    outline: none !important;
    filter: none;
}

/* Caption: oculto; al abrir debajo del nombre (izquierda, no tapa el botón) */
.feed-meta .cap-text {
    display: none !important;
    font-family: 'Inter', sans-serif;
    font-size: 0.84rem;
    font-weight: 500;
    color: rgba(255,255,255,.95) !important;
    line-height: 1.4;
    text-shadow: 0 1px 6px rgba(0,0,0,.65);
    margin: 6px 0 0;
    max-width: 100%;
    word-break: break-word;
    white-space: normal;
}
.feed-meta .cap-text.is-open {
    display: block !important;
}
.feed-caption-row { display: contents; }

.feed-tags {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #7dd3fc;
    line-height: 1.35;
    text-shadow: 0 1px 2px rgba(0,0,0,.45);
    word-break: break-word;
}
/* caption viejo unificado en .feed-meta */
.feed-caption-overlay { display: none !important; }

/* ── ADS (slide a pantalla completa en mobile) ── */
.feed-ad-inline-label {
    display: flex;
    align-items: center;
    width: 100%;
    font-size: 9px; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase;
    color: rgba(255,255,255,.35);
    margin-bottom: 12px;
    justify-content: center;
}

/* ── LIKE BUTTON (rojo al marcar + contador simulado) ── */
.feed-like-btn { background: none; border: none; padding: 0; }
.feed-like-btn[data-liked="1"] .feed-like-icon svg,
.feed-like-btn.is-liked .feed-like-icon svg {
    fill: #fe2c55 !important;
    filter: drop-shadow(0 0 6px rgba(254,44,85,.65));
}
/* El número de likes siempre blanco (solo el corazón en rojo) */
.feed-like-btn .feed-like-count,
.feed-like-btn[data-liked="1"] .feed-like-count,
.feed-like-btn.is-liked .feed-like-count {
    color: #fff !important;
}
.feed-like-icon { transition: transform .18s ease; }
.feed-like-btn:active .feed-like-icon { transform: scale(1.3); }

@keyframes spin { to { transform: rotate(360deg); } }
