/* Lenguaje holográfico de barkarum.com: ambiente de energía, paneles HUD, visor 3D y carrete 3D.
   Se carga después de styles.css. Todo lo animado se apaga con prefers-reduced-motion. */

@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* ---------- Capas de ambiente ---------- */
#energy { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.fx-noise, .fx-scan { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.fx-noise {
  opacity: .07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.fx-scan { background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .028) 0 1px, transparent 1px 4px); animation: scan-drift 9s linear infinite; }
@keyframes scan-drift { to { background-position: 0 120px; } }

/* ---------- Botones de acento ---------- */
.btn-violet {
  color: #fff;
  background: linear-gradient(90deg, #6D3FE0, var(--violet) 55%, #00A8F0);
  box-shadow: 0 0 24px rgba(139, 92, 246, .45);
}
.btn-violet:hover { color: #fff; box-shadow: 0 0 36px rgba(0, 216, 240, .4); transform: translateY(-1px); }
.btn-magenta {
  color: #fff;
  background: linear-gradient(90deg, var(--magenta), var(--pink) 55%, #8B5CF6);
  box-shadow: 0 0 24px rgba(240, 0, 192, .45);
}
.btn-magenta:hover { color: #fff; box-shadow: 0 0 36px rgba(240, 0, 192, .6); transform: translateY(-1px); }

/* ---------- Panel holográfico ---------- */
.holo {
  --cut: 18px;
  --edge: var(--cyan);
  --edge2: var(--violet);
  position: relative;
  isolation: isolate;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  background:
    radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(0, 216, 240, .12), transparent 60%),
    linear-gradient(160deg, rgba(22, 28, 52, .78), rgba(8, 10, 20, .9));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transform: perspective(1000px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg));
  transition: transform .25s ease-out;
}
.holo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1.5px;
  background: conic-gradient(from var(--a), rgba(140, 170, 255, .14) 0 55%, var(--edge) 68%, #fff 71%, var(--edge2) 76%, rgba(140, 170, 255, .14) 88%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: plasma-run 5s linear infinite;
  pointer-events: none;
}
@keyframes plasma-run { to { --a: 360deg; } }
.holo::after {
  content: "";
  position: absolute;
  inset: 7px;
  pointer-events: none;
  background:
    linear-gradient(var(--edge), var(--edge)) top right / 18px 2px no-repeat,
    linear-gradient(var(--edge), var(--edge)) top right / 2px 18px no-repeat,
    linear-gradient(var(--edge2), var(--edge2)) bottom left / 18px 2px no-repeat,
    linear-gradient(var(--edge2), var(--edge2)) bottom left / 2px 18px no-repeat;
  filter: drop-shadow(0 0 6px var(--edge));
}
.holo-magenta { --edge: var(--pink); --edge2: var(--magenta); }
.holo-violet { --edge: var(--violet-soft); --edge2: var(--cyan); }
.holo-sheen { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.holo-sheen::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: linear-gradient(115deg, transparent 40%, rgba(0, 216, 240, .10) 46%, rgba(240, 0, 192, .10) 50%, rgba(139, 92, 246, .10) 54%, transparent 60%);
  transform: translateX(var(--sheen, -30%));
  transition: transform .4s ease-out;
}
.holo-pad { padding: clamp(20px, 3vw, 32px); }

/* Barrido de escaneo sobre imágenes */
.scanline { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.scanline::before {
  content: "";
  position: absolute;
  left: 0; right: 0; height: 22%;
  background: linear-gradient(180deg, transparent, rgba(0, 216, 240, .14) 80%, rgba(180, 250, 255, .5) 100%);
  border-bottom: 1px solid rgba(180, 250, 255, .7);
  animation: sweep 4.5s cubic-bezier(.5, 0, .5, 1) infinite;
}
@keyframes sweep { 0% { top: -25%; } 70%, 100% { top: 110%; } }

.hud-label {
  position: absolute;
  z-index: 2;
  font: 600 10px/1 var(--display);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(200, 245, 255, .9);
  text-shadow: 0 0 8px rgba(0, 216, 240, .9);
}
.hud-label::before { content: "▸ "; color: var(--cyan); }

/* Marco HUD para una imagen destacada */
.holo-frame { padding: 10px; }
.holo-frame img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); }
.holo-frame .hud-label.tl { top: 22px; left: 26px; }
.holo-frame .hud-label.br { bottom: 22px; right: 26px; }
.holo-frame .chip { position: absolute; left: 22px; bottom: 20px; z-index: 2; font-size: 10px; padding: 5px 8px; }

/* ---------- Glitch ---------- */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; pointer-events: none; }
.glitch::before { color: transparent; -webkit-text-stroke: 2px rgba(0, 216, 240, .9); animation: glitch-a 4.2s steps(1) infinite; }
.glitch::after { color: transparent; -webkit-text-stroke: 2px rgba(240, 0, 192, .9); animation: glitch-b 4.2s steps(1) infinite; }
@keyframes glitch-a {
  0%, 86%, 100% { clip-path: inset(100% 0 0 0); transform: none; }
  87% { clip-path: inset(10% 0 62% 0); transform: translate(-6px, -1px); }
  89% { clip-path: inset(58% 0 18% 0); transform: translate(5px, 1px); }
  91% { clip-path: inset(30% 0 46% 0); transform: translate(-3px, 0); }
}
@keyframes glitch-b {
  0%, 87%, 100% { clip-path: inset(100% 0 0 0); transform: none; }
  88% { clip-path: inset(66% 0 8% 0); transform: translate(6px, 1px); }
  90% { clip-path: inset(18% 0 60% 0); transform: translate(-5px, -1px); }
  92% { clip-path: inset(44% 0 34% 0); transform: translate(3px, 0); }
}

/* ---------- Aparición al desplazarse ---------- */
.reveal { opacity: 0; transform: translateY(28px); filter: blur(6px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1), filter .8s ease; }
.reveal.in { opacity: 1; transform: none; filter: none; }
.no-js .reveal { opacity: 1; transform: none; filter: none; }

/* ---------- Visor 3D de personajes ---------- */
.stage-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr) 300px; gap: clamp(16px, 2.4vw, 32px); align-items: center; margin-top: 32px; }
.body-tabs { display: grid; gap: 12px; }
.body-tab { appearance: none; border: 0; margin: 0; font: inherit; text-align: left; width: 100%; cursor: pointer; display: block; padding: 16px 18px; color: var(--muted); }
.body-tab strong { display: block; font: 700 20px/1.1 var(--display); letter-spacing: .2em; color: #fff; }
.body-tab span { font: 600 11px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--cyan); }
.body-tab[aria-selected="true"] { --edge: var(--pink); }
.body-tab[aria-selected="true"]::before { animation-duration: 2.4s; }
.body-tab:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
.stage { position: relative; height: min(68vh, 600px); }
.stage model-viewer { position: absolute; inset: 0 0 6% 0; width: 100%; height: 94%; background: transparent; --poster-color: transparent; --progress-bar-color: var(--cyan); --progress-bar-height: 2px; }
.stage-base {
  position: absolute;
  left: 50%; bottom: 2%;
  width: min(78%, 420px);
  aspect-ratio: 4 / 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 216, 240, .55), rgba(139, 92, 246, .25) 55%, transparent 72%);
  filter: blur(2px);
}
.stage-base::before, .stage-base::after { content: ""; position: absolute; inset: 8%; border-radius: 50%; border: 2px dashed rgba(180, 250, 255, .55); animation: ring-spin 14s linear infinite; }
.stage-base::after { inset: 24%; border-style: solid; border-color: rgba(240, 0, 192, .45); animation-direction: reverse; animation-duration: 9s; }
@keyframes ring-spin { to { transform: rotate(360deg); } }
.stage-beam {
  position: absolute;
  left: 50%; bottom: 8%;
  width: min(60%, 320px);
  height: 86%;
  transform: translateX(-50%);
  background: linear-gradient(0deg, rgba(0, 216, 240, .16), transparent 60%);
  clip-path: polygon(34% 100%, 66% 100%, 92% 0, 8% 0);
  -webkit-mask-image: radial-gradient(60% 90% at 50% 100%, #000 30%, transparent 75%);
  mask-image: radial-gradient(60% 90% at 50% 100%, #000 30%, transparent 75%);
  pointer-events: none;
  animation: beam 3.2s ease-in-out infinite;
}
@keyframes beam { 50% { opacity: .55; } }
.stage-hint { position: absolute; left: 0; right: 0; bottom: -6px; margin: 0; text-align: center; font: 600 11px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.body-info { padding: 22px 22px 24px; }
.body-info .role { font: 600 12px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--cyan); }
.body-info h3 { font: 700 30px/1 var(--display); letter-spacing: .18em; margin: 6px 0 10px; }
.body-info p { color: #C9D1E3; margin: 0; }
.body-info .chip { margin-top: 16px; font-size: 10px; padding: 5px 8px; }

/* ---------- Armas en 3D ---------- */
.weapons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); margin-top: 32px; }
.weapon { padding: 0 0 20px; }
.weapon model-viewer { width: 100%; height: 240px; background: radial-gradient(closest-side, rgba(139, 92, 246, .25), transparent 75%); --poster-color: transparent; --progress-bar-color: var(--cyan); --progress-bar-height: 2px; }
.weapon h3 { font: 700 18px/1.2 var(--display); letter-spacing: .08em; margin: 0 20px 4px; text-transform: none; }
.weapon p { margin: 0 20px; color: var(--muted); font-size: 15px; }
.weapon .tag { display: inline-block; margin: 12px 20px 0; font: 600 10px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }

/* ---------- Carrete 3D ---------- */
.reel { position: relative; height: 240vh; }
.reel-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; padding: 88px 0 34px; }
.reel-scene { position: relative; perspective: 1500px; perspective-origin: 50% 40%; }
.reel-ring { position: absolute; left: 50%; top: 46%; width: 0; height: 0; transform-style: preserve-3d; }
.reel-card {
  position: absolute;
  margin: 0;
  width: var(--cw, 440px);
  aspect-ratio: 16 / 9;
  left: calc(var(--cw, 440px) / -2);
  top: calc(var(--cw, 440px) * -9 / 32);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  cursor: zoom-in;
  -webkit-box-reflect: below 10px linear-gradient(transparent 62%, rgba(255, 255, 255, .22));
  transition: filter .2s linear;
}
.reel-card .holo { height: 100%; padding: 6px; --cut: 14px; }
.reel-card img { display: block; width: 100%; height: 100%; object-fit: cover; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.reel-card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
.reel-caption { text-align: center; min-height: 54px; }
.reel-caption strong { display: block; font: 700 22px/1.2 var(--display); letter-spacing: .06em; }
.reel-caption span { font: 600 11px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--cyan); }
.reel-progress { position: absolute; left: 50%; bottom: 18px; width: min(320px, 60vw); height: 2px; transform: translateX(-50%); background: rgba(255, 255, 255, .1); }
.reel-progress i { display: block; height: 100%; width: var(--p, 0%); background: linear-gradient(90deg, var(--cyan), var(--pink)); box-shadow: 0 0 10px var(--cyan); }
/* Sin animación o sin JavaScript: cuadrícula normal */
.reel.reel-static { height: auto; }
.reel-static .reel-sticky { position: static; height: auto; overflow: visible; display: block; padding: 0; }
.reel-static .reel-scene { perspective: none; }
.reel-static .reel-ring { position: static; width: auto; height: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; transform: none !important; margin-top: 28px; }
.reel-static .reel-card { position: static; width: auto; transform: none !important; filter: none !important; -webkit-box-reflect: unset; }
.reel-static .reel-caption, .reel-static .reel-progress { display: none; }

dialog.lightbox { padding: 0; border: 0; background: transparent; max-width: min(1200px, 94vw); }
dialog.lightbox::backdrop { background: rgba(3, 4, 8, .86); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog.lightbox .holo { padding: 8px; }
dialog.lightbox img { display: block; width: 100%; height: auto; }
dialog.lightbox p { margin: 10px 4px 2px; color: #C9D1E3; font-size: 15px; }
dialog.lightbox button { position: absolute; top: 14px; right: 14px; z-index: 5; }

@media (max-width: 1000px) {
  .stage-wrap { grid-template-columns: 1fr; }
  .body-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .body-tab { padding: 12px; }
  .body-tab strong { font-size: 15px; letter-spacing: .12em; }
  .stage { height: 54vh; min-height: 360px; }
  .weapons { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .reel-card { --cw: 250px; }
  .holo { --cut: 14px; }
}

/* ---------- Botón grande para seguir en X ---------- */
.follow-x {
  --cut: 16px;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-height: 84px;
  padding: 14px 26px 14px 16px;
  text-align: left;
  text-decoration: none;
  color: #fff;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  background:
    linear-gradient(115deg, rgba(240, 0, 192, .28), rgba(0, 216, 240, .14) 55%, rgba(139, 92, 246, .26)),
    rgba(8, 10, 20, .88);
  box-shadow: 0 0 40px rgba(240, 0, 192, .25);
  transition: transform .2s ease, filter .2s ease;
}
.follow-x::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 2px;
  background: conic-gradient(from var(--a), rgba(255, 179, 236, .35) 0 40%, var(--pink) 55%, #fff 60%, var(--cyan) 66%, rgba(255, 179, 236, .35) 82%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: plasma-run 3.5s linear infinite;
  pointer-events: none;
}
.follow-x:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.15); }
.follow-x:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
.follow-x-icon { position: relative; flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #000; box-shadow: 0 0 0 1px rgba(255, 255, 255, .3), 0 0 22px rgba(0, 216, 240, .55); }
.follow-x-icon svg { width: 24px; height: 24px; fill: #fff; }
.follow-x-icon::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(240, 0, 192, .7); animation: follow-ping 2.4s ease-out infinite; }
@keyframes follow-ping { 0% { transform: scale(.85); opacity: .9; } 70%, 100% { transform: scale(1.35); opacity: 0; } }
.follow-x-text { display: grid; gap: 4px; }
.follow-x-main { font: 700 clamp(19px, 2.2vw, 25px)/1.15 var(--display); letter-spacing: .02em; }
.follow-x-main strong { color: #FFB3EC; text-shadow: 0 0 18px rgba(240, 0, 192, .7); }
.follow-x-sub { font: 500 14px/1.35 var(--body); color: #C9D1E3; }
.follow-x-arrow { margin-left: auto; padding-left: 8px; font: 600 26px/1 var(--display); color: var(--cyan); transition: transform .2s ease; }
.follow-x:hover .follow-x-arrow { transform: translateX(5px); }
.follow-row { margin-top: 18px; }
@media (max-width: 560px) {
  .follow-x { display: flex; width: 100%; gap: 14px; padding: 12px 18px 12px 12px; }
  .follow-x-icon { width: 46px; height: 46px; }
}

/* ---------- Banda de llamada a la acción (demo) dentro de las páginas de juego ---------- */
.cta-band-section { padding-block: clamp(36px, 6vw, 70px); }
.cta-band { --cut: 22px; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(18px, 3vw, 36px); align-items: center; }
.cta-band-art { margin: 0; overflow: hidden; clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.cta-band-art img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.cta-band-text { display: grid; justify-items: start; gap: 12px; }
.cta-band-text h2 { margin: 0; }
.cta-band-text p { margin: 0; color: #C9D1E3; }
.cta-band-text .chip-status { color: #FFB3EC; border-color: rgba(240, 0, 192, .6); }
.cta-band-text .chip-status::before { background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.cta-band-cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* Botón fijo «Obtén la demo gratis» en celular (solo aparece entre secciones, ver holo.js) */
.sticky-cta { display: none; }
@media (max-width: 760px) {
  .cta-band { grid-template-columns: 1fr; }
  .cta-band-cta .btn { width: 100%; }
  .sticky-cta {
    position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 45;
    display: block; padding: 15px 26px; border-radius: 999px; white-space: nowrap;
    font: 600 14px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: #fff; text-decoration: none;
    background: linear-gradient(90deg, var(--magenta), var(--pink) 55%, #8B5CF6); box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 26px rgba(240, 0, 192, .55);
    opacity: 0; pointer-events: none; transform: translate(-50%, 24px); transition: opacity .25s ease, transform .25s ease;
  }
  .sticky-cta.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .sticky-cta { transition: none; }
  .follow-x::before, .follow-x-icon::after,
  .fx-scan, .holo::before, .glitch::before, .glitch::after, .scanline::before, .stage-base::before, .stage-base::after, .stage-beam { animation: none !important; }
  .holo { transform: none !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
}

/* Videos alojados en YouTube (js/yt-video.js): póster con botón de play; el reproductor se carga al pulsar. */
.yt-video { position: relative; display: block; width: 100%; overflow: hidden; aspect-ratio: 16 / 9; background: #000; }
.yt-video img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, filter .3s ease; }
.yt-video:hover img { transform: scale(1.02); filter: brightness(1.08); }
.yt-video iframe { display: block; width: 100%; height: 100%; border: 0; }
.yt-play { position: absolute; left: 50%; top: 50%; z-index: 2; display: grid; place-items: center; width: 84px; height: 84px; padding: 0; transform: translate(-50%, -50%); border-radius: 50%; background: linear-gradient(135deg, rgba(139, 92, 246, .9), rgba(0, 216, 240, .8)); border: 2px solid rgba(255, 255, 255, .9); box-shadow: 0 0 36px rgba(139, 92, 246, .6); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.yt-play:hover { transform: translate(-50%, -50%) scale(1.08); box-shadow: 0 0 50px rgba(139, 92, 246, .85); }
.yt-play:focus-visible { outline: 3px solid var(--cyan); outline-offset: 6px; }
.yt-play svg { width: 34px; height: 34px; margin-left: 5px; fill: #fff; }
.yt-link { color: var(--cyan); white-space: nowrap; }
