/* KlipTok v53 · REELS con el reproductor DENTRO del vídeo (kt-v53-reels.css)
   Todo va bajo `body.kt-reels`: quitando esa clase (KTReels.disable() o Alt+R) vuelve el formato clásico.
   Quitar del todo: borrar este archivo, kt-v53-reels.js y sus 2 etiquetas en index.html. */

/* ---------- formato: reel vertical 9:16 (escritorio) y vídeo horizontal a 16:9 ---------- */
@media (min-width: 1024px) {
  body.kt-reels:not(.kt-book-on) #feed-container .feed-card { width: min(100%, 40rem, calc((100cqh - .25rem) * .5625)) !important; }
  body.kt-reels:not(.kt-book-on) #feed-container .feed-card[data-k53o="land"] { width: min(100%, calc((100cqh - .25rem) * 1.7778)) !important; }
  body.kt-reels:not(.kt-book-on) #feed-container .feed-card video.object-cover { object-fit: cover !important; }
}
/* horizontal (en cualquier pantalla): se ve ENTERO y los bordes se rellenan con un fondo difuminado del propio vídeo */
body.kt-reels .feed-card[data-k53o="land"] video { object-fit: contain !important; background: transparent !important; position: relative; z-index: 1; }
.k53-bd { display: none; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none;
  filter: blur(26px) saturate(1.4) brightness(.55); transform: scale(1.35); }
body.kt-reels .feed-card[data-k53o="land"] .k53-bd { display: block; }
body.kt-reels .group { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* ---------- lo que ya hace el reproductor se quita de la columna de botones ---------- */
body.kt-reels:not(.kt-book-on) .group > div.cursor-pointer.h-2.bottom-0 { display: none !important; }   /* barra antigua: la sustituye la nueva */
@media (max-width: 1023px) { body.kt-reels:not(.kt-book-on) .k53-pl, body.kt-reels:not(.kt-book-on) .k53-sec { display: none !important; } }
body.kt-reels:not(.kt-book-on) .group .absolute.bottom-4.right-3 { gap: .6rem; max-height: calc(100% - 6rem); }
@media (max-width: 1023px) { .k53-o1 { order: 1; } .k53-o2 { order: 2; } .k53-o3 { order: 3; } .k53-o4 { order: 4; } .k53-o5 { order: 5; } }

/* ---------- elementos del reproductor (solo con reels activo) ---------- */
.k53-ind, .k53-burst, .k53-strip, .k53-bar, .k53-more { display: none; }
body.kt-reels .k53-ind, body.kt-reels .k53-burst, body.kt-reels .k53-bar { display: block; }
body.kt-reels .k53-ind { display: grid; }
body.kt-reels .k53-strip { display: flex; }
body.kt-reels .k53-more { display: block; }

/* indicador grande del centro (pausa / repetir) */
.k53-ind { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; z-index: 15;
  place-items: center; color: #fff; background: rgba(0,0,0,.45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transform: scale(.8); transition: opacity .18s, transform .18s; pointer-events: none; }
.k53-ind svg { width: 34px; height: 34px; }
.k53-paused .k53-ind { opacity: 1; transform: none; }

/* tira de controles (arriba a la izquierda): ±10 s · play · tiempo · velocidad · sonido */
.k53-strip { position: absolute; left: .75rem; top: 3.4rem; max-width: calc(100% - 1.5rem); align-items: center; gap: .15rem; padding: .22rem .35rem;
  border-radius: 999px; z-index: 25; color: #fff; font: 700 11px/1 system-ui, sans-serif; background: rgba(0,0,0,.5);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.12);
  opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .2s, transform .2s; }
.k53-ui .k53-strip { opacity: 1; transform: none; pointer-events: auto; }
@media (hover: hover) { body.kt-reels .group:hover .k53-strip { opacity: 1; transform: none; pointer-events: auto; } }
.k53-strip button { all: unset; box-sizing: border-box; display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px;
  border-radius: 999px; cursor: pointer; color: #fff; font: 800 11px/1 system-ui, sans-serif; }
.k53-strip button:hover, .k53-strip button:focus-visible { background: rgba(255,255,255,.2); }
.k53-strip svg { width: 18px; height: 18px; }
.k53-time { display: none; padding: 0 .4rem; font-variant-numeric: tabular-nums; opacity: .92; white-space: nowrap; }
.k53-long .k53-time { display: inline; }

/* barra de progreso (abajo del todo): fina, crece al tocarla, con burbuja de tiempo */
.k53-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; z-index: 30; cursor: pointer; touch-action: none; }
.k53-trk { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.22); transition: height .15s; }
.k53-bar:hover .k53-trk, .k53-drag .k53-trk, .k53-bar:focus-visible .k53-trk { height: 7px; }
.k53-trk i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; display: block; }
.k53-buf { background: rgba(255,255,255,.28); }
.k53-fil { background: linear-gradient(90deg, #3b82f6, #a855f7, #ec4899); }
.k53-ui .k53-fil { transition: width .25s linear; }
.k53-drag .k53-fil { transition: none; }
.k53-trk .k53-thm { position: absolute; top: 50%; left: 0; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,.5); transform: scale(0); transition: transform .15s; }
.k53-bar:hover .k53-thm, .k53-drag .k53-thm { transform: scale(1); }
.k53-bub { position: absolute; bottom: 20px; left: 0; transform: translateX(-50%); padding: 3px 8px; border-radius: 8px; background: rgba(0,0,0,.78);
  color: #fff; font: 700 12px/1.2 system-ui, sans-serif; font-variant-numeric: tabular-nums; opacity: 0; pointer-events: none; transition: opacity .12s; }
.k53-drag .k53-bub { opacity: 1; }

/* destellos: ±10 s, corazón, «continúas en…» */
.k53-burst { position: absolute; inset: 0; z-index: 28; pointer-events: none; overflow: hidden; }
.k53-pop { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #fff; font: 800 14px/1 system-ui, sans-serif;
  text-shadow: 0 1px 8px rgba(0,0,0,.65); transform: translate(-50%, -50%); animation: k53pop .75s ease-out forwards; }
.k53-pop.k53-heart { color: #ec4899; }
.k53-pop.k53-heart svg { width: 92px; height: 92px; filter: drop-shadow(0 4px 14px rgba(236,72,153,.55)); }
.k53-pop.k53-txt { padding: .45rem .8rem; border-radius: 999px; background: rgba(0,0,0,.55); font-size: 12px; animation-duration: 1.8s; }
@keyframes k53pop { 0% { opacity: 0; scale: .6; } 18% { opacity: 1; scale: 1.06; } 100% { opacity: 0; scale: 1; translate: 0 -14px; } }

/* mantener pulsado = velocidad ×2 */
body.kt-reels .group.k53-fast::after { content: "2× ▸▸"; position: absolute; top: 1.1rem; left: 50%; transform: translateX(-50%); z-index: 26;
  padding: .3rem .7rem; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font: 800 12px/1 system-ui, sans-serif; pointer-events: none; }

/* menú «más» (⋯) */
.k53-more { position: absolute; right: 4.2rem; bottom: 1rem; z-index: 40; width: min(16rem, calc(100% - 5.5rem)); max-height: calc(100% - 3rem); overflow: auto;
  padding: .35rem; border-radius: 16px; background: rgba(14,14,24,.9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.12); box-shadow: 0 14px 40px rgba(0,0,0,.5); animation: k53in .14s ease-out; }
@keyframes k53in { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
.k53-row { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: .6rem; width: 100%; padding: .6rem .7rem; border-radius: 11px;
  color: #fff; font: 600 13px/1.2 system-ui, sans-serif; cursor: pointer; }
.k53-row:hover, .k53-row:focus-visible { background: rgba(255,255,255,.13); }
.k53-row svg { width: 18px; height: 18px; flex: none; }
.k53-sep { height: 1px; margin: .3rem .4rem; background: rgba(255,255,255,.12); }

@media (prefers-reduced-motion: reduce) {
  .k53-ind, .k53-strip, .k53-trk, .k53-fil, .k53-thm, .k53-more, .k53-pop { transition: none !important; animation-duration: .01s !important; }
}


/* =====================================================================================================
   v123 · ESCRITORIO (≥1024px)
   1) La columna de acciones del formato tradicional (voto, regalo, play, velocidad, sonido, analítica, PiP, enlace,
      borrar, descargar, recortar, pantalla limpia…) queda FUERA del reel, a su derecha, como en YouTube Shorts.
      Es la misma columna con los mismos botones: solo cambia de sitio (se quita su recorte con overflow).
   2) El botón negro «⋯» y su menú siguen DENTRO del reel (abajo a la derecha).
   3) Todo lo que hay encima del vídeo (VÍDEO, #tags, creador, título, tira del reproductor, barra, «⋯»…)
      desaparece al instante al quitar el cursor del reel y reaparece al volver a poner el cursor.
   4) Menos hueco entre un reel y el siguiente: el reel es ~3 mm más alto.
   Para deshacer: borrar este bloque.
   ===================================================================================================== */

/* 1) el reel ya no recorta lo que sobresale; el recorte con esquinas redondeadas pasa a cada capa interior */
@media (min-width: 1024px) {
  body.kt-reels .feed-card:not([data-cat="infographic"]) > .group { overflow: visible !important; }
  body.kt-reels .feed-card:not([data-cat="infographic"]) > .group > :not(.absolute.bottom-4.right-3):not(.k53-more):not(.k53-moreb) { clip-path: inset(0 round 1.5rem); }

  body.kt-reels .feed-card:not([data-cat="infographic"]) > .group > .absolute.bottom-4.right-3 {
    left: calc(100% + .75rem) !important; right: auto !important; top: auto !important; bottom: 0 !important;
    max-height: 100% !important; width: max-content; gap: .45rem !important; padding: .1rem;
    overflow-y: auto; overflow-x: visible; scrollbar-width: none; align-items: center;
  }
  body.kt-reels .feed-card:not([data-cat="infographic"]) > .group > .absolute.bottom-4.right-3::-webkit-scrollbar { display: none; }
  body.kt-reels .feed-card:not([data-cat="infographic"]) > .group > .absolute.bottom-4.right-3 > * { flex: 0 0 auto; }
  body.kt-reels .feed-card:not([data-cat="infographic"]) > .group > .absolute.bottom-4.right-3 > button:not(.k53-moreb),
  body.kt-reels .feed-card:not([data-cat="infographic"]) > .group > .absolute.bottom-4.right-3 > a { padding: .55rem !important; }
  /* fuera del vídeo hay fondo claro: botones oscuros sólidos para que se vean (los de color propio se respetan) */
  body.kt-reels .feed-card:not([data-cat="infographic"]) > .group > .absolute.bottom-4.right-3 > .bg-black\/50 { background: rgba(28, 28, 40, .9); }
  body.kt-reels .feed-card:not([data-cat="infographic"]) > .group > .absolute.bottom-4.right-3 > .bg-black\/50:hover { background: rgba(70, 70, 96, .95); }

  /* a pantalla completa no hay "fuera": la columna vuelve a ir encima, a la derecha */
  body.kt-reels .group:fullscreen > .absolute.bottom-4.right-3 { left: auto !important; right: .75rem !important; bottom: 1rem !important; max-height: calc(100% - 2rem) !important; }
  body.kt-reels .group:fullscreen { overflow: hidden !important; }
}

/* 2) botón «⋯» dentro del reel (abajo a la derecha) */
.k53-moreb { position: absolute; right: .75rem; bottom: 1rem; z-index: 26; }
@media (max-width: 1023px) {
  /* en móvil la columna sigue dentro del reel: se sube para dejar sitio al «⋯» */
  body.kt-reels .feed-card:not([data-cat="infographic"]) > .group > .absolute.bottom-4.right-3 { bottom: 4.75rem !important; max-height: calc(100% - 9rem) !important; }
}
.feed-card[data-cat="infographic"] .absolute.bottom-4.right-3 > .k53-moreb { position: static; }

/* 3) fuera el cursor = desaparece TODO lo de encima del vídeo (con ratón). Se quedan el vídeo y su fondo. */
@media (hover: hover) {
  body.kt-reels .feed-card:not([data-cat="infographic"]) > .group:not(:hover) > :not(video):not(audio):not(.k53-bd):not(.k53-burst):not(.w-full.h-full) {
    opacity: 0 !important; pointer-events: none !important; transition: opacity .1s ease;
  }
  body.kt-reels .feed-card:not([data-cat="infographic"]) > .group > :not(video):not(audio):not(.k53-bd):not(.k53-burst):not(.w-full.h-full) { transition: opacity .12s ease; }
  /* en escritorio la columna de acciones está fuera del reel: se queda siempre visible (como en YouTube Shorts) */
}
@media (hover: hover) and (min-width: 1024px) {
  body.kt-reels .feed-card:not([data-cat="infographic"]) > .group.group:not(:hover) > .absolute.absolute.bottom-4.right-3 { opacity: 1 !important; pointer-events: auto !important; }
}
/* con el cursor dentro, todo visible aunque el temporizador antiguo de 5 s lo hubiera ocultado */
@media (hover: hover) {
  body.kt-reels .group:hover .k53-strip { opacity: 1 !important; transform: none; pointer-events: auto; }
}

/* 4) menos hueco entre reels: +~3 mm de alto por reel (el hueco pasa de 16 px a 4 px) */
@media (min-width: 768px) {
  body.kt-reels #feed-container #dynamic-feed > .feed-card { margin-top: .125rem !important; margin-bottom: .125rem !important; }
  body.kt-reels #feed-container #dynamic-feed > .feed-card:not([data-kt-ar]) { height: calc(100cqh - .25rem) !important; }
  body.kt-reels #feed-container #dynamic-feed > .feed-card[data-kt-ar] { --kt-h: min(calc(100cqh - .25rem), calc(100cqw / var(--ar))); }
}
@media (min-width: 1024px) {
  /* deja sitio a la derecha para la columna de acciones (reels horizontales anchos incluidos) */
  body.kt-reels #feed-container #dynamic-feed > .feed-card[data-kt-ar]:not([data-cat="infographic"]) { --kt-h: min(calc(100cqh - .25rem), calc((100cqw - 8rem) / var(--ar))); }
}
