/* _PLACEAI_HALLOWEEN_THEME_2026_V1_ 25.10 Руслан: «сделаем тему Хэллоуин». Включается классом hw-theme на <html>
   (ставит скрипт в <head> index.html до 1 ноября, не на placeai.net, можно выключить кнопкой 🎃 в шапке).
   Кислотный акцент меняем на тыквенный, фон чуть уводим в фиолетовый, плюс летучие мыши и паутина. */
html.hw-theme {
  --acid: #ff8a1f;
  --acid-bright: #ffb866;
  --acid-rgb: 255,138,31;
  --acid-dim: rgba(255, 138, 31, .14);
  --acid-soft: #e0904a;
  --black: #110d14;
  --black-soft: #1b1520;
  --line: #352b3a;
}
html.hw-theme body {
  background:
    radial-gradient(900px 420px at 78% -8%, rgba(150, 70, 220, .16), transparent 62%),
    radial-gradient(700px 360px at 8% 108%, rgba(255, 122, 24, .08), transparent 60%),
    var(--black);
  background-attachment: fixed;
}
html.hw-theme textarea:focus, html.hw-theme select:focus { border-color: #b8661f; }

/* логотип: тыква вместо звёздочки */
html.hw-theme .logo-mark { font-size: 0; background: transparent; }
html.hw-theme .logo-mark::after { display: none; }
html.hw-theme .logo-mark::before { font-size: 21px; line-height: 1; content: "🎃"; }
html.hw-theme body.home-mode .topbar-logo .logo-mark::before,
html.hw-theme body.chat-mode .topbar-logo .logo-mark::before { font-size: 18px; }

/* кнопка темы в шапке */
.hw-theme-toggle { display: none; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid #4b4d48; border-radius: 50%;
  background: transparent; font-size: 17px; line-height: 1; filter: grayscale(1); opacity: .6; transition: filter .2s, opacity .2s, border-color .2s; }
html.hw-season .hw-theme-toggle { display: grid; }
html.hw-theme .hw-theme-toggle { border-color: rgba(255, 138, 31, .55); filter: none; opacity: 1; box-shadow: 0 0 14px rgba(255, 122, 24, .25); }
.hw-theme-toggle:hover { opacity: 1; filter: none; border-color: var(--acid); }

/* декор: паутина в углу и летучие мыши, мимо них можно кликать */
.hw-decor { position: fixed; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
html:not(.hw-theme) .hw-decor { display: none; }
.hw-web { position: absolute; top: 0; right: 0; width: 150px; height: 150px; color: #d8c8e8; opacity: .12; }
.hw-bat-fly { position: absolute; left: -60px; width: 34px; color: #4a3358; opacity: 0; filter: drop-shadow(0 0 8px rgba(255, 138, 31, .6));
  animation: hw-cross 26s linear infinite; }
.hw-bat-fly svg { display: block; width: 100%; animation: hw-flap .32s ease-in-out infinite alternate; transform-origin: 50% 40%; }
.hw-bat-fly.f1 { top: 14vh; }
.hw-bat-fly.f2 { top: 32vh; width: 24px; animation-delay: -9s; animation-duration: 31s; }
.hw-bat-fly.f3 { top: 8vh; width: 20px; animation-delay: -18s; animation-duration: 37s; }
@keyframes hw-cross {
  0% { transform: translate(0, 0); opacity: 0; }
  4% { opacity: .9; }
  25% { transform: translate(30vw, -3vh); }
  50% { transform: translate(60vw, 4vh); }
  75% { transform: translate(90vw, -2vh); opacity: .9; }
  80%, 100% { transform: translate(110vw, 0); opacity: 0; }
}
@keyframes hw-flap { from { transform: scaleY(1); } to { transform: scaleY(.45); } }
/* переключение темы: новый вид раскрывается кругом от кнопки (clip-path ставит halloween-theme.js), без обычного
   перекрёстного затухания; стая мышей отдельным живым слоем поверх */
html.hw-switching::view-transition-old(root),
html.hw-switching::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.hw-switching::view-transition-group(hw-burst),
html.hw-switching::view-transition-new(hw-burst) { animation: none; }
.hw-burst { position: fixed; inset: 0; z-index: 1000; pointer-events: none; view-transition-name: hw-burst; }
.hw-burst-bat { position: absolute; width: 46px; color: #ff9a33; opacity: 0; filter: drop-shadow(0 0 10px rgba(255, 122, 24, .9)) drop-shadow(0 0 2px #1a0d05); will-change: transform, opacity; }
.hw-burst-bat svg { display: block; width: 100%; animation: hw-flap .16s ease-in-out infinite alternate; transform-origin: 50% 40%; }
.hw-theme-toggle:active { transform: scale(.94); }

@media (max-width: 760px) {
  .hw-web { width: 96px; height: 96px; }
  .hw-bat-fly.f3 { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hw-bat-fly { display: none; }
}
