/* ==========================================================================
   HALLOWEEN THEME: Clean, Native & Non-Obtrusive
   ========================================================================== */

/* 1. Festive Pumpkin in Logo / Brand */
.hw-pumpkin-nav {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  font-size: 19px;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(255, 119, 0, 0.45));
  animation: hwPumpkinBob 2.5s ease-in-out infinite alternate;
}

@keyframes hwPumpkinBob {
  0% { transform: translateY(0) rotate(-4deg); }
  100% { transform: translateY(-2px) rotate(4deg); }
}

/* 2. Spiderwebs (Точечные декоративные паутины) */
.hw-cobweb-left,
.hw-cobweb-right {
  position: absolute;
  top: 0;
  width: 130px;
  height: 130px;
  pointer-events: none;
  z-index: 10;
  opacity: 0.42;
}

.hw-cobweb-left {
  left: 0;
}

.hw-cobweb-right {
  right: 0;
  transform: scaleX(-1);
}

/* Паутина, натянутая между кнопками / блоками в контенте */
.hw-cobweb-inline {
  position: absolute;
  top: -12px;
  right: -8px;
  width: 65px;
  height: 65px;
  pointer-events: none;
  opacity: 0.35;
  z-index: 2;
}

/* Паутины в подвале (footer) — только в самом низу страницы, а не вечно на экране */
.site-footer {
  position: relative;
  overflow: hidden;
}

.hw-footer-web-left {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 140px;
  height: 140px;
  pointer-events: none;
  opacity: 0.38;
}

.hw-footer-web-right {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 140px;
  height: 140px;
  pointer-events: none;
  opacity: 0.38;
  transform: scaleX(-1);
}

/* ==========================================================================
   HALLOWEEN DECORATIONS: Тыквы, мерцающие свечи и мини-могилки в футере
   ========================================================================== */
.hw-graveyard-decor {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 24px;
  margin: 20px auto 0 auto;
  padding-top: 15px;
  border-top: 1px dashed rgba(234, 108, 0, 0.25);
  max-width: 600px;
  user-select: none;
}

/* Мини-могилка (RIP Gravestone) */
.hw-tombstone {
  position: relative;
  width: 38px;
  height: 48px;
  background: #334155;
  border: 2px solid #1e293b;
  border-radius: 18px 18px 2px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  transition: transform 0.2s ease;
}

.hw-tombstone:hover {
  transform: translateY(-3px) rotate(-2deg);
}

.hw-tombstone-text {
  font-family: monospace;
  font-size: 10px;
  font-weight: 900;
  color: #94a3b8;
  letter-spacing: 1px;
}

.hw-tombstone-cross {
  font-size: 11px;
  color: #64748b;
  line-height: 1;
  margin-top: 2px;
}

/* Мерцающая свеча */
.hw-candle {
  position: relative;
  width: 14px;
  height: 32px;
  background: #fef08a;
  border: 1px solid #ca8a04;
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.hw-candle-flame {
  position: absolute;
  top: -12px;
  left: 2px;
  width: 8px;
  height: 12px;
  background: radial-gradient(ellipse at bottom, #ffffff 0%, #facc15 35%, #ea580c 100%);
  border-radius: 50% 50% 35% 35%;
  filter: drop-shadow(0 0 6px #f97316);
  animation: hwFlicker 1.2s infinite alternate ease-in-out;
  transform-origin: bottom center;
}

@keyframes hwFlicker {
  0% { transform: scale(1) rotate(-2deg); opacity: 0.9; }
  30% { transform: scale(1.15, 0.9) rotate(3deg); opacity: 1; }
  70% { transform: scale(0.9, 1.1) rotate(-3deg); opacity: 0.85; }
  100% { transform: scale(1.05) rotate(1deg); opacity: 0.95; }
}

/* Мини-тыква декоративная */
.hw-mini-pumpkin {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.2));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.hw-mini-pumpkin:hover {
  transform: scale(1.22) rotate(-8deg);
}

/* 3. Hanging spider attached under the navbar */
.hw-spider-wrapper {
  position: absolute;
  top: 74px;
  right: 60px;
  z-index: 15;
  pointer-events: none;
  animation: hwSpiderDescend 9s ease-in-out infinite;
}

.hw-spider-thread {
  width: 1px;
  height: 48px;
  background: rgba(100, 120, 140, 0.35);
  margin: 0 auto;
}

.hw-spider {
  width: 22px;
  height: 22px;
  margin-top: -2px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
  animation: hwSpiderSway 3s ease-in-out infinite alternate;
  transform-origin: top center;
}

@keyframes hwSpiderDescend {
  0% { transform: translateY(-28px); }
  35% { transform: translateY(0px); }
  60% { transform: translateY(18px); }
  85% { transform: translateY(-10px); }
  100% { transform: translateY(-28px); }
}

@keyframes hwSpiderSway {
  0% { transform: rotate(-10deg); }
  100% { transform: rotate(10deg); }
}

/* 4. DRAGGABLE GUS SPOOKY BALLOON (Огненно-хэллоуинский Спуки Гаса из Brawl Stars) */
.hw-pixel-orb-container {
  position: fixed;
  top: 0;
  left: 220px;
  width: 64px;
  z-index: 999999;
  pointer-events: none;
  transform-origin: top center;
  animation: hwChaoticIdle 5.5s ease-in-out infinite;
}

@media (max-width: 768px) {
  .hw-pixel-orb-container {
    left: 140px;
  }
}

/* Хаотичное естественное покачивание шарика-призрака */
@keyframes hwChaoticIdle {
  0% { transform: rotate(0deg) scaleY(1); }
  15% { transform: rotate(6deg) scaleY(1.02); }
  30% { transform: rotate(-5deg) scaleY(0.99); }
  48% { transform: rotate(8deg) scaleY(1.03); }
  65% { transform: rotate(-7deg) scaleY(0.98); }
  82% { transform: rotate(4deg) scaleY(1.01); }
  100% { transform: rotate(0deg) scaleY(1); }
}

/* Оранжево-тыквенная ниточка шарика Гаса — идет прямо от потолка */
.hw-pixel-rope {
  width: 3px;
  height: 55px;
  margin: 0 auto;
  padding: 0;
  display: block;
  background-image: repeating-linear-gradient(
    to bottom,
    #ff7700 0px,
    #ff7700 4px,
    #8b2500 4px,
    #8b2500 8px
  );
  image-rendering: pixelated;
  transform-origin: top center;
}

/* Сам шарик Спуки — мистический оранжевый хоррор-стиль */
.hw-pixel-orb {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  margin-top: -2px;
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
  user-select: none;
  filter: drop-shadow(0 6px 18px rgba(255, 102, 0, 0.55));
  transition: transform 0.15s ease, filter 0.2s ease;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.hw-pixel-orb:active {
  cursor: grabbing;
  transform: scale(1.12);
}

.hw-pixel-orb.playing {
  filter: drop-shadow(0 0 24px #ff6600) drop-shadow(0 0 42px #d4380d);
  animation: hwSpookyPulse 1.2s ease-in-out infinite alternate;
}

@keyframes hwSpookyPulse {
  0% { filter: drop-shadow(0 0 16px #ff7700); }
  100% { filter: drop-shadow(0 0 30px #ea580c) drop-shadow(0 0 45px #f59e0b); }
}

/* Swung vigorously by passing bat gust */
.hw-pixel-orb-container.swaying {
  animation: hwRopeWindSway 3.2s cubic-bezier(0.36, 0.07, 0.19, 0.97) 1;
}

@keyframes hwRopeWindSway {
  0% { transform: rotate(0deg); }
  14% { transform: rotate(34deg) scaleY(1.05); }
  32% { transform: rotate(-26deg) scaleY(0.96); }
  50% { transform: rotate(18deg) scaleY(1.03); }
  68% { transform: rotate(-10deg) scaleY(0.98); }
  84% { transform: rotate(4deg) scaleY(1.01); }
  100% { transform: rotate(0deg) scaleY(1); }
}

/* Flying Gust Bats (Периодически пролетающая стая мышей) */
.hw-flying-bat-gust {
  position: fixed;
  z-index: 999998;
  pointer-events: none;
  width: 42px;
  height: 24px;
  fill: #1a202c;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
  transition: none;
}

.hw-flying-bat-gust path {
  animation: hwWingFlap 0.22s ease-in-out infinite alternate;
  transform-origin: center;
}

@keyframes hwWingFlap {
  0% { transform: scaleY(1); }
  100% { transform: scaleY(0.4); }
}

@keyframes hwPixelPulse {
  0% { filter: drop-shadow(0 0 14px #ff7700); }
  100% { filter: drop-shadow(0 0 26px #ff4500) drop-shadow(0 0 40px #ffaa00); }
}

.hw-pixel-canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

/* 5. Bats strictly confined to hero section background */
.hw-hero-bats {
  position: absolute;
  top: 0;
  right: 0;
  width: 180px;
  height: 90px;
  pointer-events: none;
  opacity: 0.38;
  z-index: 1;
}

.hw-bat-small {
  position: absolute;
  width: 28px;
  height: 15px;
  fill: #65788b;
  animation: hwBatFlutter 4s ease-in-out infinite alternate;
}

.hw-bat-small:nth-child(1) {
  top: 15px;
  right: 25px;
  animation-duration: 3.5s;
}

.hw-bat-small:nth-child(2) {
  top: 45px;
  right: 75px;
  animation-duration: 4.8s;
  animation-delay: 1s;
  transform: scale(0.8);
}

@keyframes hwBatFlutter {
  0% { transform: translateY(0) rotate(-4deg); }
  100% { transform: translateY(-8px) rotate(6deg); }
}

/* 6. Subtle festive theme accent */
.emerald-theme .btn.primary {
  background: #ea6c00 !important;
  border-color: #ea6c00 !important;
}

.emerald-theme .btn.primary:hover:not(:disabled) {
  background: #d45e00 !important;
  border-color: #d45e00 !important;
}

.emerald-theme .gem {
  background: #ea6c00 !important;
}
