/* Logos animadas dos jogos na aba Nossos Jogos (dono, 24/11/2026). As regras abaixo são as ORIGINAIS de cada jogo
   (kazbia-logo.css do Kazbia e logo-anim.css do Ninja Tatics), só com o endereço das máscaras trocado para as
   cópias do site. As camadas são montadas por logos.js. No fim, o encaixe das duas no cartão. */

/* ================================================================== Kazbia (kazbia-logo.css) */
/* Kazbia Online logo (KazbiaLogo.tsx). Sizes follow the places the reference game draws its logo:
   header 34 px high, "Entering world" cover 86 % of the frame, landing min(560px, 84vw, 62vh),
   login card min(200px, 62%). The animation is the owner's page (kazbia-site/kazbia-logo). */

.kz-top { display: block; width: 68px; height: 34px; object-fit: contain; user-select: none; -webkit-user-drag: none; }

.kz-logo { position: relative; aspect-ratio: 2 / 1; margin: 0 auto; isolation: isolate; user-select: none; }
.kz-logo--card { width: min(240px, 72%); } /* um pouco maior no login (dono, 05/11/2026; era 200px / 62%) */
.kz-logo--hero { width: min(560px, 84vw, 62vh); }
.kz-logo--loading { width: calc(var(--loading-frame, 480px) * 0.86); }
.kz-logo--splash { width: min(420px, 80vw); }

.kz-intro-box, .kz-float, .kz-surge { position: absolute; inset: 0; }
.kz-intro-box { z-index: 2; }
.kz-logo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; }
/* Until the picture arrives the <img> has no srcset yet (the splash waits 250 ms) or is still
   downloading: browsers draw an empty <img> as a broken-image icon with a grey border, which
   flashed on the "Carregando…" splash (owner's print, 26/10). Hidden until it has loaded. */
.kz-logo:not(.is-loaded) .kz-logo-img { visibility: hidden; }
/* Shadow on the picture only: a filter on the whole box would redraw it with the canvases every frame. */
.kz-logo--card .kz-logo-img { filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55)); }
.kz-logo--hero .kz-logo-img, .kz-logo--loading .kz-logo-img, .kz-logo--splash .kz-logo-img { filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.6)); }

/* Particles canvases reach past the logo box (embers rise, lightning comes from above). */
.kz-fx { position: absolute; left: -22%; right: -22%; top: -55%; bottom: -18%; width: 144%; height: 173%; pointer-events: none; }
.kz-logo--card .kz-fx { left: -12%; right: -12%; top: -30%; bottom: -8%; width: 124%; height: 138%; }
.kz-fx-back { z-index: 1; }
.kz-fx-front { z-index: 3; }
.kz-flash {
  position: absolute; left: -30%; right: -30%; top: -45%; bottom: -30%; z-index: 4; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(255, 200, 150, 0.35), transparent 65%);
}
.kz-flash.on { animation: kz-flash 0.6s ease-out; }
.kz-aura {
  position: absolute; left: -12%; right: -12%; top: -12%; bottom: -12%; z-index: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse, rgba(255, 70, 20, 0.3) 0%, rgba(200, 30, 10, 0.1) 40%, transparent 70%);
  opacity: 0;
}
.kz-logo--card .kz-aura { opacity: 0; display: none; }
.kz-anim.is-loaded .kz-aura { animation: kz-aura 4s ease-in-out infinite; }

.kz-anim.kz-intro .kz-intro-box { opacity: 0; }
.kz-anim.kz-intro.is-loaded .kz-intro-box { opacity: 1; animation: kz-enter 2s cubic-bezier(0.2, 1.2, 0.3, 1) both; }
.kz-anim .kz-float { animation: kz-float 6s ease-in-out infinite; }
.kz-surge.boom { animation: kz-boom 0.9s ease-out; }

.kz-shine {
  position: absolute; inset: 0; overflow: hidden; mix-blend-mode: overlay; pointer-events: none;
  -webkit-mask: var(--kz-mask) center / contain no-repeat; mask: var(--kz-mask) center / contain no-repeat;
}
.kz-shine::before {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: -20%; width: 12%;
  background: linear-gradient(90deg, transparent, rgba(255, 250, 220, 0.95), transparent);
  transform: skewX(-22deg);
  animation: kz-sweep 4.5s ease-in-out 0.5s infinite; /* mounted 1.5 s after the logo: first pass at 2 s, as the owner's page */
}

.kz-glow { position: absolute; border-radius: 50%; mix-blend-mode: screen; transform: translate(-50%, -50%); pointer-events: none; }
.kz-eye { width: 4.5%; aspect-ratio: 1; background: radial-gradient(circle, rgba(255, 240, 170, 1) 0%, rgba(255, 140, 30, 0.9) 25%, rgba(255, 60, 0, 0.3) 55%, transparent 72%); animation: kz-pulse 2.2s ease-in-out infinite; }
.kz-mouth { width: 9%; aspect-ratio: 1; background: radial-gradient(ellipse, rgba(255, 190, 70, 0.9) 0%, rgba(255, 90, 10, 0.5) 35%, transparent 70%); animation: kz-flicker 1.2s steps(6) infinite; }
.kz-belly { width: 16%; aspect-ratio: 1.4; background: radial-gradient(ellipse, rgba(255, 120, 30, 0.55) 0%, rgba(255, 60, 0, 0.2) 40%, transparent 70%); animation: kz-breathe 3.2s ease-in-out infinite; }
.kz-gem { width: 4%; aspect-ratio: 1; background: radial-gradient(circle, rgba(255, 170, 150, 0.95) 0%, rgba(255, 30, 30, 0.55) 35%, transparent 70%); animation: kz-pulse 2.8s ease-in-out infinite; }
.boom .kz-eye, .boom .kz-mouth, .boom .kz-belly, .boom .kz-gem { animation: kz-flare 0.9s ease-out; }

.kz-star { position: absolute; width: 3%; aspect-ratio: 1; transform: translate(-50%, -50%); mix-blend-mode: screen; pointer-events: none; opacity: 0; animation: kz-twinkle 2.6s ease-in-out infinite; }
.kz-star::before, .kz-star::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 100%; height: 8%;
  background: linear-gradient(90deg, transparent, #fff6d6, transparent);
  transform: translate(-50%, -50%);
}
.kz-star::after { transform: translate(-50%, -50%) rotate(90deg); }

@keyframes kz-enter {
  0% { opacity: 0; transform: scale(1.35); filter: blur(14px) brightness(3); }
  60% { opacity: 1; filter: blur(0) brightness(1.6); }
  100% { opacity: 1; transform: scale(1); filter: blur(0) brightness(1); }
}
@keyframes kz-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.2%); } }
@keyframes kz-aura { 0%, 100% { opacity: 0.6; transform: scale(0.95); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes kz-flash { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes kz-boom { 0% { filter: brightness(1); } 15% { filter: brightness(1.45) saturate(1.25); } 45% { filter: brightness(1.2); } 100% { filter: brightness(1); } }
@keyframes kz-sweep { 0% { left: -20%; } 55%, 100% { left: 110%; } }
@keyframes kz-pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@keyframes kz-breathe { 0%, 100% { opacity: 0.35; scale: 0.9; } 50% { opacity: 1; scale: 1.08; } }
@keyframes kz-flicker { 0% { opacity: 0.6; } 20% { opacity: 0.95; } 40% { opacity: 0.7; } 60% { opacity: 1; } 80% { opacity: 0.65; } 100% { opacity: 0.85; } }
@keyframes kz-flare { 0% { opacity: 0.8; } 20% { opacity: 1; } 100% { opacity: 0.7; } }
@keyframes kz-twinkle { 0%, 100% { opacity: 0; scale: 0.3; rotate: 0deg; } 45% { opacity: 1; scale: 1; rotate: 45deg; } 60% { opacity: 0; scale: 0.4; } }

@media (prefers-reduced-motion: reduce) {
  .kz-logo, .kz-logo *, .kz-logo *::before, .kz-logo *::after { animation: none !important; }
  .kz-logo .kz-intro-box { opacity: 1 !important; }
}


/* ============================================================ Ninja Tatics (logo-anim.css) */
/* Logo animada do dono (marca/ninjatatics-logo/index.html e mini.html), levada sem perder efeito (pedido do dono,
   05/11/2026). Saiu do portal.css para servir também a tela de entrada do jogo (/play) sem duplicar nada; a ordem e as
   regras são as mesmas de antes. O que é da cena/rodapé do portal continua no portal.css. Camadas em logo-anim.ts.
   Só arquivos nossos em /portal/img (a CSP do portal e a do jogo não deixam nada de fora). */

/* logo animada do dono (marca/ninjatatics-logo/index.html e mini.html; camadas em logo-anim.ts): brilho de fogo e de
   chakra pelas máscaras, reflexo nas letras, flutuação, "estouro" a cada golpe de lâmina e entrada com corte */
.logo-anim {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}
.la-wrap,
.la-fx {
  position: relative;
  display: block;
}
.la-wrap {
  animation: la-flutua 5s ease-in-out infinite;
}
@keyframes la-flutua {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.3%); }
}
.la-fx > img {
  display: block;
  width: 100%;
  height: auto;
}
.la-m,
.la-halo,
.la-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.la-m {
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  mix-blend-mode: screen;
}
.la-halo {
  filter: blur(7px);
  mix-blend-mode: screen;
}
.la-halo .la-m {
  mix-blend-mode: normal;
}
.logo-anim-mini .la-halo {
  filter: blur(3px);
}
.la-fogo {
  background: #ff8a2a;
}
.la-chakra {
  background: #4fe6ff;
}
.logo-anim-grande .la-fogo { -webkit-mask-image: url('./img/games/nt-mascara-fogo.webp'); mask-image: url('./img/games/nt-mascara-fogo.webp'); }
.logo-anim-grande .la-chakra { -webkit-mask-image: url('./img/games/nt-mascara-chakra.webp'); mask-image: url('./img/games/nt-mascara-chakra.webp'); }
.logo-anim-grande .la-shine { -webkit-mask: url('./img/games/nt-mascara-letras.webp') center / contain no-repeat; mask: url('./img/games/nt-mascara-letras.webp') center / contain no-repeat; }
.la-halo-fogo {
  animation: la-fogo 1.1s steps(5) infinite;
}
@keyframes la-fogo {
  0% { opacity: 0.55; }
  25% { opacity: 0.9; }
  50% { opacity: 0.6; }
  75% { opacity: 1; }
  100% { opacity: 0.7; }
}
.la-halo-chakra {
  animation: la-chakra 2.4s ease-in-out infinite;
}
@keyframes la-chakra {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
.la-sharp-fogo {
  opacity: 0.12;
  animation: la-fogo 1.4s steps(4) infinite;
}
.la-sharp-chakra {
  opacity: 0.2;
  background: #bff6ff;
  animation: la-chakra 2.4s ease-in-out infinite;
}
.la-shine {
  overflow: hidden;
  mix-blend-mode: overlay;
}
.la-shine::before {
  content: '';
  position: absolute;
  top: -20%;
  bottom: -20%;
  width: 10%;
  left: -20%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
  transform: skewX(-22deg);
  animation: la-reflexo 4s ease-in-out 1.6s infinite;
}
@keyframes la-reflexo {
  0% { left: -20%; }
  50%, 100% { left: 115%; }
}
/* golpe de lâmina (logo-anim.ts liga .la-boom a cada 6 s) */
.la-fx.la-boom {
  animation: la-boom 0.7s ease-out;
}
@keyframes la-boom {
  0% { filter: brightness(1); }
  20% { filter: brightness(1.35) saturate(1.3); }
  100% { filter: brightness(1); }
}
.la-boom .la-halo-fogo,
.la-boom .la-halo-chakra {
  animation: la-surto 0.7s ease-out;
}
@keyframes la-surto {
  0% { opacity: 1; }
  30% { opacity: 1; filter: brightness(1.6); }
  100% { opacity: 0.7; }
}
/* entrada: a logo surge num corte de lâmina, com o risco de luz atravessando (só na 1ª montagem da página) */
.la-entrada .la-wrap {
  animation: la-corte 1s cubic-bezier(0.7, 0, 0.2, 1) 0.35s both, la-flutua 5s ease-in-out 1.35s infinite;
}
@keyframes la-corte {
  0% { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); filter: brightness(2.2); }
  100% { clip-path: polygon(0 0, 130% 0, 100% 100%, -30% 100%); filter: brightness(1); }
}
.la-slash {
  position: absolute;
  z-index: 5;
  left: -20%;
  top: 50%;
  width: 140%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #fff 30%, #bff4ff 70%, transparent);
  transform: rotate(-12deg) scaleX(0);
  transform-origin: left;
  pointer-events: none;
  animation: la-risco 0.7s ease-out 0.2s both;
}
@keyframes la-risco {
  0% { transform: rotate(-12deg) scaleX(0); opacity: 1; }
  60% { transform: rotate(-12deg) scaleX(1); opacity: 1; }
  100% { transform: rotate(-12deg) scaleX(1); opacity: 0; }
}
/* faíscas e folhas (atrás da logo) e folhas da frente e cortes (na frente); clarão no golpe */
.la-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.la-flash {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse 60% 45% at 50% 38%, rgba(255, 255, 255, 0.22), transparent 70%);
}
.la-flash.la-boom {
  animation: la-clarao 0.45s ease-out;
}
@keyframes la-clarao {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .logo-anim *,
  .logo-anim *::before {
    animation: none !important;
  }
  .la-slash { display: none; }
}

/* ============================================================================ encaixe no cartão */
.game-card { position: relative; overflow: hidden; isolation: isolate; }
.game-card > * { position: relative; }
.game-card .logo-link { display: grid; place-items: center; height: calc(var(--mf) * 11.5); }
/* Kazbia: caixa 2:1, com os canvases passando dela como na capa do jogo (raio vindo de cima, brasas subindo) */
.kz-logo--site { width: min(100%, calc(var(--mf) * 21)); }
.kz-logo--site .kz-logo-img { height: 100%; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.6)); }
/* Ninja Tatics: a logo na proporção dela (900 x 388); o palco das folhas, faíscas e cortes é o cartão */
.game-card .logo-anim-grande { width: min(100%, calc(var(--mf) * 24.3)); }
.game-card .la-fx > img { height: auto; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .6)); }
.game-card > .la-canvas { position: absolute; }
.game-card > .la-frente { z-index: 3; }
.game-card > .la-flash { position: absolute; }
