/* Motyw Halloween strony: działa tylko z klasą html.is-halloween (ustawia ją halloween.js do 31.10, 18:30). */

/* ---------- kolory: dyniowy pomarańcz + fiolet zamiast czerwieni ---------- */
html.is-halloween {
  --red: #ff7a1a;
  --red-soft: #ffa24a;
  --red-deep: #c84a0c;
  --hw-purple: #8e4cc8;
}

html.is-halloween body {
  background: #07040b;
}

html.is-halloween .o1 { background: radial-gradient(circle, #ff7a1a, transparent 68%); opacity: 0.45; }
html.is-halloween .o2 { background: radial-gradient(circle, #6b2fd6, transparent 68%); opacity: 0.45; }
html.is-halloween .o3 { background: radial-gradient(circle, #ff4d1a, transparent 68%); opacity: 0.25; }

/* ---------- scena: obraz z gry, księżyc, mgła ---------- */
.hw-scene {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 4, 11, 0.55) 0%, rgba(7, 4, 11, 0.82) 55%, #07040b 100%),
    url("/assets/halloween/scene.jpg") center 30% / cover no-repeat;
  opacity: 0.9;
}

.hw-moon {
  position: absolute;
  top: 9vh;
  right: 8vw;
  width: clamp(90px, 12vw, 170px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 38%, rgba(180, 150, 110, 0.35) 0 9%, transparent 10%),
    radial-gradient(circle at 62% 60%, rgba(180, 150, 110, 0.3) 0 7%, transparent 8%),
    radial-gradient(circle at 58% 30%, rgba(180, 150, 110, 0.25) 0 5%, transparent 6%),
    radial-gradient(circle at 40% 35%, #fff6dc, #ffd98a 60%, #f2b04a);
  box-shadow: 0 0 60px rgba(255, 210, 120, 0.55), 0 0 160px rgba(255, 150, 60, 0.35);
  animation: hw-moon 9s ease-in-out infinite;
}

@keyframes hw-moon {
  50% { box-shadow: 0 0 80px rgba(255, 210, 120, 0.7), 0 0 200px rgba(255, 150, 60, 0.45); }
}

.hw-fog {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -6vh;
  height: 34vh;
  background:
    radial-gradient(60% 70% at 30% 70%, rgba(160, 120, 200, 0.22), transparent 70%),
    radial-gradient(50% 60% at 75% 80%, rgba(255, 140, 60, 0.16), transparent 70%);
  filter: blur(18px);
  animation: hw-fog 38s ease-in-out infinite alternate;
}

.hw-fog-b {
  bottom: -10vh;
  opacity: 0.7;
  animation-duration: 52s;
  animation-direction: alternate-reverse;
}

@keyframes hw-fog {
  to { transform: translateX(12%); }
}

/* ---------- nietoperze ---------- */
.hw-bats {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.hw-site-bat {
  position: absolute;
  top: var(--top);
  left: -60px;
  width: var(--size);
  animation: hw-bat-cross var(--dur) linear var(--delay) infinite;
}

.hw-site-bat svg {
  display: block;
  width: 100%;
  fill: #140a1c;
  filter: drop-shadow(0 0 4px rgba(255, 140, 60, 0.35));
  animation: hw-bat-wing 0.2s ease-in-out infinite alternate;
  transform-origin: 50% 40%;
}

@keyframes hw-bat-cross {
  0% { transform: translate(0, 0); }
  25% { transform: translate(28vw, -6vh); }
  50% { transform: translate(55vw, 4vh); }
  75% { transform: translate(82vw, -5vh); }
  100% { transform: translate(calc(100vw + 120px), 2vh); }
}

@keyframes hw-bat-wing {
  to { transform: scaleY(0.4); }
}

/* ---------- dusze (płótno) ---------- */
.hw-souls-site {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

/* ---------- pajęczyny ---------- */
.hw-web {
  position: fixed;
  top: 0;
  z-index: 2;
  width: clamp(90px, 11vw, 150px);
  color: rgba(230, 220, 255, 0.22);
  pointer-events: none;
}

.hw-web svg { display: block; width: 100%; }
.hw-web-left { left: 0; }
.hw-web-right { right: 0; transform: scaleX(-1); }

/* ---------- baner eventu ---------- */
.hw-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: min(760px, 100%);
  margin-bottom: 18px;
  padding: 8px 16px 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 140, 26, 0.55);
  background:
    radial-gradient(circle at 6% 50%, rgba(255, 140, 26, 0.35), transparent 40%),
    linear-gradient(90deg, rgba(40, 14, 52, 0.85), rgba(18, 8, 24, 0.85));
  box-shadow: 0 0 30px rgba(255, 122, 26, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  text-align: left;
  animation: hw-ribbon-glow 2.8s ease-in-out infinite;
}

.hw-ribbon img {
  width: 34px;
  flex-shrink: 0;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 8px rgba(255, 170, 50, 0.7));
  animation: hw-pumpkin-bob 2.4s ease-in-out infinite;
}

.hw-ribbon-text { display: flex; flex-direction: column; min-width: 0; }
.hw-ribbon-text b { color: #ffb24a; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.hw-ribbon-text span { color: #fff3e0; font-size: 0.9rem; font-weight: 600; line-height: 1.3; }

.hw-ribbon-left {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 122, 26, 0.16);
  color: #ffc27a;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

@keyframes hw-ribbon-glow {
  50% { box-shadow: 0 0 44px rgba(255, 122, 26, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
}

@keyframes hw-pumpkin-bob {
  50% { transform: translateY(-3px) rotate(-4deg); }
}

/* ---------- tytuł, przyciski, akcenty ---------- */
html.is-halloween .hero h1 {
  background: linear-gradient(180deg, #fff3e0 25%, #ffb066 75%, #ff7a1a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 28px rgba(255, 122, 26, 0.25));
}

html.is-halloween .btn-red {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 52%),
    linear-gradient(180deg, #ffa24a, #ff7a1a 55%, #c84a0c);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 6px rgba(110, 30, 0, 0.35),
    0 10px 30px rgba(255, 122, 26, 0.45),
    0 0 0 1px rgba(142, 76, 200, 0.35);
}

html.is-halloween .btn-red:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 6px rgba(110, 30, 0, 0.35),
    0 16px 44px rgba(255, 122, 26, 0.6),
    0 0 26px rgba(142, 76, 200, 0.45);
}

html.is-halloween .kicker .dot {
  background: #ff7a1a;
  box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.2), 0 0 14px #ff7a1a;
}

html.is-halloween .glass {
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 180, 0.2),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    inset 0 0 0 1px rgba(142, 76, 200, 0.12),
    var(--shadow);
}

html.is-halloween ::selection {
  background: rgba(255, 122, 26, 0.45);
}

/* dynie siedzące na ramce zrzutów ekranu */
html.is-halloween .device { overflow: visible; }

.hw-sit {
  position: absolute;
  bottom: -14px;
  z-index: 3;
  width: clamp(44px, 6vw, 72px);
  image-rendering: pixelated;
  pointer-events: none;
  filter: drop-shadow(0 0 12px rgba(255, 160, 40, 0.6)) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.5));
  animation: hw-flicker-site 2.4s infinite;
}

.hw-sit-l { left: -18px; transform: rotate(-8deg); }
.hw-sit-r { right: -18px; transform: rotate(7deg) scale(0.85); animation-delay: -1.1s; }

@keyframes hw-flicker-site {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(255, 160, 40, 0.6)) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.5)); }
  45% { filter: drop-shadow(0 0 18px rgba(255, 190, 60, 0.85)) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.5)); }
  48% { filter: drop-shadow(0 0 7px rgba(255, 150, 40, 0.4)) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.5)); }
}

/* stopka: rządek dyń */
.hw-foot-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
}

.hw-foot-row img {
  width: 30px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 8px rgba(255, 160, 40, 0.55));
  animation: hw-pumpkin-bob 2.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.4s);
}

@media (max-width: 700px) {
  .hw-ribbon { flex-wrap: wrap; border-radius: 22px; }
  .hw-ribbon-left { margin-left: 46px; }
  .hw-web { width: 70px; }
  .hw-sit { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hw-bats, .hw-fog { display: none; }
  .hw-moon, .hw-ribbon, .hw-ribbon img, .hw-sit, .hw-foot-row img { animation: none; }
}
