/* Lightning sits BEHIND the page content (z-index -1), so it never covers
   text, cards or buttons. In dark mode the body background is made transparent
   so the layer shows through; html keeps the same dark colour. */
.aj-storm {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.aj-storm-cloud,
.aj-storm-flash,
.aj-storm-bolt {
  position: absolute;
  inset: 0;
}

.aj-storm-cloud {
  background:
    linear-gradient(90deg, rgba(37, 99, 235, .22), transparent 18%, transparent 82%, rgba(14, 165, 233, .2)),
    radial-gradient(50vmax 24vmax at 50% -10%, rgba(125, 211, 252, .28), transparent 70%);
  animation: aj-storm-drift 10s ease-in-out infinite alternate;
}

html[data-theme="dark"] body#app-body:has(> .aj-storm) {
  background: transparent !important;
}

html[data-theme="dark"] .aj-storm-cloud {
  background:
    linear-gradient(90deg, rgba(56, 189, 248, .34), transparent 22%, transparent 78%, rgba(129, 140, 248, .32)),
    radial-gradient(60vmax 28vmax at 50% -8%, rgba(186, 230, 253, .2), transparent 68%);
}

/* Soft glow from the top instead of a full-screen white wash. */
.aj-storm-flash {
  background: radial-gradient(70vmax 40vmax at 50% -10%, rgba(186, 230, 253, .35), transparent 70%);
  opacity: 0;
  animation: aj-storm-flash 9s linear infinite;
}

html[data-theme="dark"] .aj-storm-flash {
  background: radial-gradient(70vmax 40vmax at 50% -10%, rgba(186, 230, 253, .28), transparent 70%);
}

.aj-storm-bolt {
  background-repeat: no-repeat;
  opacity: .18;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, .6));
}

.aj-storm-bolt-a {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 220'><path d='M48 0 L18 92 H40 L16 220 L68 96 H42 Z' fill='%23f0f9ff'/></svg>");
  background-size: 120px 320px;
  background-position: 4% 0;
  animation: aj-storm-bolt 9s linear infinite;
}

.aj-storm-bolt-b {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 220'><path d='M46 0 L16 90 H38 L14 220 L66 94 H40 Z' fill='%23e0f2fe'/></svg>");
  background-size: 100px 280px;
  background-position: 92% 6%;
  animation: aj-storm-bolt 9s linear .15s infinite;
}

.aj-storm-bolt-c {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 220'><path d='M44 0 L20 86 H40 L18 220 L64 92 H40 Z' fill='%23ffffff'/></svg>");
  background-size: 78px 210px;
  background-position: 48% -20px;
  animation: aj-storm-bolt 13s linear 2s infinite;
}

@keyframes aj-storm-drift {
  from { transform: translate3d(-2%, 0, 0); }
  to { transform: translate3d(2%, 0, 0); }
}

@keyframes aj-storm-flash {
  0% { opacity: 0; }
  3% { opacity: .9; }
  6% { opacity: .2; }
  8% { opacity: .7; }
  14% { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes aj-storm-bolt {
  0%, 2% { opacity: .18; }
  4% { opacity: .8; }
  7% { opacity: .2; }
  9% { opacity: .7; }
  14% { opacity: .18; }
  100% { opacity: .18; }
}

/* Phones: no bolts, just the soft glow. */
@media (max-width: 767px) {
  .aj-storm-bolt { display: none; }
}

html.khs-pay .aj-storm,
body:has(#bakongModal:not(.hidden)) .aj-storm,
body:has(#joykneaModal:not(.hidden)) .aj-storm {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .aj-storm-cloud,
  .aj-storm-flash,
  .aj-storm-bolt { animation: none; }
  .aj-storm-flash { opacity: 0; }
  .aj-storm-bolt { opacity: .18; }
}

@media print {
  .aj-storm { display: none !important; }
}

/* Lightning on the header logo, in front of the crown. */
.aj-brand-mark { position: relative; }
.aj-brand-mark::after {
  content: "";
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 0;
  width: 18px;
  height: 24px;
  pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 64'><path d='M24 1 L8 28 H18 L6 63 L34 30 H22 Z' fill='%23fff7c2'/></svg>") center / contain no-repeat;
  filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 8px #38bdf8);
  opacity: 0;
  transform: translateX(-50%) scale(.7);
  animation: aj-logo-bolt 2.6s linear infinite;
}
.aj-brand-jak {
  animation: aj-logo-flash 2.6s ease-in-out infinite;
}
.aj-brand-ch::after {
  animation-duration: 2.6s;
}
@keyframes aj-logo-bolt {
  0%, 62%, 100% { opacity: 0; transform: translateX(-50%) scale(.55); }
  68% { opacity: 1; transform: translateX(-50%) scale(1.15); }
  73% { opacity: .15; transform: translateX(-50%) scale(.8); }
  78% { opacity: 1; transform: translateX(-50%) scale(1); }
  88% { opacity: 0; transform: translateX(-50%) scale(.7); }
}
@keyframes aj-logo-flash {
  0%, 62%, 100% { filter: drop-shadow(0 0 5px rgba(96, 165, 250, .55)); }
  70%, 80% { filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 14px #38bdf8); }
}
@media (prefers-reduced-motion: reduce) {
  .aj-brand-mark::after,
  .aj-brand-jak { animation: none; }
  .aj-brand-mark::after { opacity: 0; }
}

/* ------------------------------------------------------------------
   2026-11-18: lightning retired. The bolts, the flash and the logo bolt
   are switched off; only the soft blue side glow (.aj-storm-cloud) stays.
   The home hero now has the AnaJak mascot boy instead (see below).
   ------------------------------------------------------------------ */
.aj-storm-flash,
.aj-storm-bolt { display: none !important; }
.aj-brand-mark::after { content: none !important; }
.aj-brand-jak { animation: none !important; filter: drop-shadow(0 0 5px rgba(96, 165, 250, .55)); }

/* Hero mascot: the AnaJak boy beside the home banner (desktop) or under it, right side (phones/tablets). */
.aj-hero-stage { position: relative; }
/* Phones + tablets (below 1024px): the banner is full width, so a smaller boy stands just under it on the right,
   beside the "Premium Accounts" heading. The heading gets room on the right so nothing is covered. */
.aj-hero-boy {
  display: block;
  position: absolute;
  z-index: 5;
  right: 0;
  top: calc(100% + 4px);
  width: 84px;
  height: auto;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 8px 12px rgba(2, 6, 23, .4));
  animation: aj-boy-in .9s cubic-bezier(.2, .8, .2, 1) .2s both;
}
html[data-theme="light"] .aj-hero-boy { filter: drop-shadow(0 8px 12px rgba(30, 58, 138, .2)); }
@media (max-width: 1023.98px) {
  .aj-hero-stage + #premium-accounts > .ds-section-head { padding-right: 92px; min-height: 104px; }
  .aj-hero-stage + #premium-accounts > .ds-section-head > .khs-at-head { display: none; }
}
@media (min-width: 640px) and (max-width: 1023.98px) {
  .aj-hero-boy { width: 104px; }
  .aj-hero-stage + #premium-accounts > .ds-section-head { padding-right: 116px; min-height: 124px; }
}
@media (min-width: 1024px) {
  .aj-hero-boy {
    display: block;
    position: absolute;
    z-index: 5;
    width: 190px;
    height: auto;
    top: auto;
    right: auto;
    bottom: -14px;
    /* sit in the left gutter, overlapping the dimmed side slide, never the active banner or the arrow */
    left: max(-60px, calc((100% - 100vw) / 2 + 4px));
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(0 10px 18px rgba(2, 6, 23, .45));
    animation: aj-boy-in .9s cubic-bezier(.2, .8, .2, 1) .2s both;
  }
  html[data-theme="light"] .aj-hero-boy { filter: drop-shadow(0 10px 16px rgba(30, 58, 138, .22)); }
}
@media (min-width: 1700px) {
  /* wide screens: more room in the gutter, so a bigger boy fully outside the slider */
  .aj-hero-boy {
    width: 230px;
    left: max(-250px, calc((100% - 100vw) / 2 + 10px));
  }
}
@keyframes aj-boy-in {
  from { opacity: 0; transform: translateY(24px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .aj-hero-boy { animation: none; }
}
@media print {
  .aj-hero-boy { display: none !important; }
}
