/* Хэллоуин (20.10.2026). Подключается только когда оформление включено — Flavor_Halloween. */
:root { --dd-hw-orange: #f39a3d; --dd-hw-web: #8e80ad; --dd-hw-ink: #2d2340; --dd-hw-ghost-w: 96px; --dd-hw-peek: -52px; }
html[data-theme="dark"] { --dd-hw-web: #a79fc0; }

/* 1. Тыквы у логотипа — справа от «Daddy Dread», по центру строки */
.dd-halloween .header-logo { position: relative; }
.dd-hw-pumpkins { position: absolute; top: 50%; left: 100%; display: flex; align-items: flex-end; gap: 1px; margin-left: 6px; transform: translateY(-50%); pointer-events: none; }
.dd-hw-pumpkin { display: block; width: 34px; height: 34px; will-change: transform; animation: dd-hw-bob 4s ease-in-out infinite; }
.dd-hw-pumpkin--small { width: 22px; height: 22px; margin-bottom: 1px; animation-delay: -2s; }
.dd-hw-pumpkin svg { display: block; width: 100%; height: 100%; }
.dd-hw-eye--wink { transform-box: fill-box; transform-origin: center; transition: transform .09s; }
.dd-hw-pumpkins.is-wink .dd-hw-eye--wink { transform: scaleY(.1); }
@keyframes dd-hw-bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-3px) rotate(6deg); } }

/* 2. Паутинка с паучком — за содержимым шапки, клики не перехватывает */
.dd-hw-web { position: absolute; top: 0; right: 0; z-index: -1; width: 120px; height: 120px; color: var(--dd-hw-web); pointer-events: none; }
.dd-hw-web svg { display: block; width: 100%; height: 100%; overflow: visible; }
.dd-hw-web g[stroke] { stroke-width: 1.3; }
.dd-hw-spider { position: absolute; top: 42%; right: 16%; width: 15%; height: 34%; transform-origin: 50% 0; will-change: transform; animation: dd-hw-swing 5s ease-in-out infinite; }
.dd-hw-spider svg { display: block; width: 100%; height: 100%; overflow: visible; }
@keyframes dd-hw-swing { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }

/* 2б. Гирлянда под шапкой: тыквы, летучие мыши, конфеты. Видна наверху страницы, при прокрутке прячется (halloween.js) */
.dd-hw-garland { position: absolute; top: 100%; left: 0; right: 0; height: 40px; pointer-events: none; will-change: transform; transition: opacity .35s; animation: dd-hw-sway 5s ease-in-out infinite;
    background: repeat-x 0 0 / 240px 40px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 40'%3E %3Cpath d='M0 3Q60 17 120 3T240 3' stroke='%235e4d7a' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E %3Cg stroke='%235e4d7a' stroke-width='.9' stroke-linecap='round'%3E%3Cpath d='M20 7.6V12.6M60 10V12.8M100 7.6V12.2M140 7.6V11.2M180 10V15.6M220 7.6V12.4'/%3E%3C/g%3E %3Cpath d='M20 13c.4-1.6 1.4-2.6 2.8-2.7' stroke='%235b7a3a' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E %3Cpath d='M21.4 11.6c1.5-1 3-.6 3.5.5-1.3.6-2.6.4-3.5-.5z' fill='%237aa04a'/%3E %3Cellipse cx='16' cy='20' rx='4.6' ry='6' fill='%23e8822a'/%3E%3Cellipse cx='24' cy='20' rx='4.6' ry='6' fill='%23e8822a'/%3E %3Cellipse cx='20' cy='20' rx='5' ry='6.6' fill='%23f6a046'/%3E%3Cellipse cx='18' cy='17' rx='1.2' ry='2.3' fill='%23fff' opacity='.28'/%3E %3Ccircle cx='18' cy='19.6' r='.95' fill='%234a2a12'/%3E%3Ccircle cx='22' cy='19.6' r='.95' fill='%234a2a12'/%3E %3Cpath d='M18.2 22.3q1.8 1.4 3.6 0' stroke='%234a2a12' stroke-width='.9' fill='none' stroke-linecap='round'/%3E %3Ccircle cx='16.6' cy='21.4' r='.9' fill='%23ff7b7b' opacity='.45'/%3E%3Ccircle cx='23.4' cy='21.4' r='.9' fill='%23ff7b7b' opacity='.45'/%3E %3Cpath d='M60 15c-2.4-3.4-6.6-4.4-10.4-2.4 2 1 2.8 2.6 2.6 4.4 1.8-1.2 3.6-1.2 4.6.6.8-1.2 1.9-1.9 3.2-1.9s2.4.7 3.2 1.9c1-1.8 2.8-1.8 4.6-.6-.2-1.8.6-3.4 2.6-4.4C66.6 10.6 62.4 11.6 60 15z' fill='%233d2c5c'/%3E %3Cpath d='M58.2 13.6l.7-1.9.9 1.2.9-1.2.7 1.9z' fill='%233d2c5c'/%3E %3Ccircle cx='58.9' cy='15.4' r='.75' fill='%23ffd23f'/%3E%3Ccircle cx='61.1' cy='15.4' r='.75' fill='%23ffd23f'/%3E %3Cpath d='M95 12.2h10l-1.8 5h-6.4z' fill='%23ffd23f'/%3E%3Cpath d='M96.8 17.2h6.4l-1.6 4.4h-3.2z' fill='%23f39a3d'/%3E%3Cpath d='M98.4 21.6h3.2L100 26z' fill='%23fff7e0'/%3E %3Cpath d='M95 12.2h10L100 26z' fill='none' stroke='%23d9a72a' stroke-width='.4' stroke-linejoin='round'/%3E %3Cpath d='M140 11.2c-3.6 0-5.6 2.8-5.6 6.4v8.2c0 .8.8 1.1 1.3.6l1.1-1.1 1.4 1.4c.4.4 1 .4 1.4 0l.8-.8.8.8c.4.4 1 .4 1.4 0l1.4-1.4 1.1 1.1c.5.5 1.3.2 1.3-.6v-8.2c0-3.6-2-6.4-5.6-6.4z' fill='%23fff' stroke='%23d6cce8' stroke-width='.6'/%3E %3Cellipse cx='138.4' cy='17.6' rx='.9' ry='1.2' fill='%232d2340'/%3E%3Cellipse cx='141.6' cy='17.6' rx='.9' ry='1.2' fill='%232d2340'/%3E %3Ccircle cx='137.1' cy='19.6' r='.9' fill='%23ffb3c1' opacity='.75'/%3E%3Ccircle cx='142.9' cy='19.6' r='.9' fill='%23ffb3c1' opacity='.75'/%3E %3Cellipse cx='140' cy='20.4' rx='.75' ry='.95' fill='%232d2340'/%3E %3Cpath d='M180 16.2c.5-2 1.8-3.2 3.5-3.3' stroke='%235b7a3a' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E %3Cpath d='M181.6 14.6c1.8-1.2 3.6-.7 4.2.6-1.6.7-3.1.5-4.2-.6z' fill='%237aa04a'/%3E %3Cellipse cx='175' cy='25.4' rx='5.8' ry='7.4' fill='%23e8822a'/%3E%3Cellipse cx='185' cy='25.4' rx='5.8' ry='7.4' fill='%23e8822a'/%3E %3Cellipse cx='180' cy='25.4' rx='6.3' ry='8.2' fill='%23f6a046'/%3E%3Cellipse cx='177.6' cy='21.6' rx='1.5' ry='2.8' fill='%23fff' opacity='.28'/%3E %3Cpath d='M176.4 23.6l1.3-1.8 1.3 1.8zM181 23.6l1.3-1.8 1.3 1.8z' fill='%234a2a12'/%3E %3Cpath d='M176.6 27q3.4 2.6 6.8 0' stroke='%234a2a12' stroke-width='1.1' fill='none' stroke-linecap='round'/%3E %3Ccircle cx='175.6' cy='26.4' r='1.1' fill='%23ff7b7b' opacity='.45'/%3E%3Ccircle cx='184.4' cy='26.4' r='1.1' fill='%23ff7b7b' opacity='.45'/%3E %3Cpath d='M220 12.6l1.5 3.1 3.4.5-2.5 2.4.6 3.4-3-1.6-3 1.6.6-3.4-2.5-2.4 3.4-.5z' fill='%23ffd23f' stroke='%23e2b21c' stroke-width='.45' stroke-linejoin='round'/%3E %3C/svg%3E"); }
html[data-theme="dark"] .dd-hw-garland { filter: brightness(1.35) saturate(1.1); }
.dd-hw-garland.is-hidden { opacity: 0; animation-play-state: paused; }
@keyframes dd-hw-sway { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(2px); } }

/* 2в. Тыковки на подписях плиток категорий на главной */
.dd-halloween .hero-cats__label { position: relative; }
.dd-halloween .hero-cats__label::after {
    content: ""; position: absolute; top: -22px; right: -12px; width: 30px; height: 30px; transform: rotate(12deg); pointer-events: none; animation: dd-hw-bob 4s ease-in-out infinite;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 8c.6-3 2.6-4.6 5-4.8' stroke='%235b7a3a' stroke-width='2.2' fill='none' stroke-linecap='round'/%3E%3Cellipse cx='10.5' cy='18.5' rx='7' ry='9' fill='%23ec8a2e'/%3E%3Cellipse cx='21.5' cy='18.5' rx='7' ry='9' fill='%23ec8a2e'/%3E%3Cellipse cx='16' cy='18.5' rx='7.6' ry='10' fill='%23f6a046'/%3E%3Cellipse cx='12.6' cy='17' rx='1.4' ry='1.8' fill='%234a2a12'/%3E%3Cellipse cx='19.4' cy='17' rx='1.4' ry='1.8' fill='%234a2a12'/%3E%3Cpath d='M12.6 21.6q3.4 2.8 6.8 0' stroke='%234a2a12' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3Ccircle cx='10.2' cy='20.4' r='1.3' fill='%23ff7b7b' opacity='.5'/%3E%3Ccircle cx='21.8' cy='20.4' r='1.3' fill='%23ff7b7b' opacity='.5'/%3E%3C/svg%3E");
}
.dd-halloween .hero-cats__card:nth-child(2) .hero-cats__label::after { animation-delay: -1s; transform: rotate(-10deg); }
.dd-halloween .hero-cats__card:nth-child(3) .hero-cats__label::after { animation-delay: -2s; }
.dd-halloween .hero-cats__card:nth-child(4) .hero-cats__label::after { animation-delay: -3s; transform: rotate(-8deg); }

/* 3. Поздравление в верхней полоске (компьютер) */
.dd-hw-greet { font-size: 13px; letter-spacing: .02em; white-space: nowrap; }
.dd-hw-code { margin: 0 2px; padding: 0 7px; font: inherit; font-weight: 700; color: var(--dd-hw-orange); background: none; border: 1px dashed currentColor; border-radius: 6px; cursor: pointer; }
.dd-hw-code:hover, .dd-hw-code:focus-visible { background: rgba(243, 154, 61, .12); }
@media (max-width: 1023px) { .dd-hw-greet { display: none; } }

/* 4. Привидение с табличкой — слева; справа кнопки чата и категорий.
      Сначала выходит целиком на 20 с, потом прячется за край и выглядывает половинкой; нажатие — выходит снова. */
.dd-hw-ghost { position: fixed; left: 0; bottom: 28px; z-index: 45; display: flex; align-items: flex-end; gap: 6px; transform: translateX(-130%); transition: transform .9s cubic-bezier(.2, .9, .3, 1.2); }
.dd-hw-ghost[hidden] { display: none; }
.dd-hw-ghost.is-in { transform: translateX(14px); }
.dd-hw-ghost.is-peek { transform: translateX(var(--dd-hw-peek)); }
.dd-hw-ghost.is-peek .dd-hw-ghost__body { animation: dd-hw-peek 4s ease-in-out infinite; }
.dd-hw-ghost.is-peek .dd-hw-ghost__sign { opacity: 0; pointer-events: none; }
.dd-hw-ghost__body { width: var(--dd-hw-ghost-w); height: calc(var(--dd-hw-ghost-w) * 1.125); padding: 0; background: none; border: 0; cursor: pointer; filter: drop-shadow(0 8px 14px rgba(45, 35, 64, .22)); will-change: transform; animation: dd-hw-float 3s ease-in-out infinite; -webkit-tap-highlight-color: transparent; }
.dd-hw-ghost__body svg { display: block; width: 100%; height: 100%; overflow: visible; }
.dd-hw-arm { transform-box: fill-box; transform-origin: 0 100%; animation: dd-hw-wave 1.1s ease-in-out 3.4s 4; }
.dd-hw-blush { transition: opacity .3s; }
.dd-hw-ghost.is-giggle .dd-hw-ghost__body { animation: dd-hw-giggle .45s ease-in-out 2; }
.dd-hw-ghost.is-giggle .dd-hw-blush { opacity: 1; }
.dd-hw-ghost__sign { margin-bottom: 18px; padding: 8px 12px; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; color: #fff; white-space: nowrap; background: var(--dd-hw-orange); border: 0; border-radius: 12px; box-shadow: 0 5px 12px rgba(243, 154, 61, .38); transform: rotate(-6deg); cursor: pointer; transition: opacity .3s; }
.dd-hw-ghost__sign b { letter-spacing: .04em; }
html[data-theme="dark"] .dd-hw-ghost__body { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .5)) brightness(.94); }
@keyframes dd-hw-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes dd-hw-peek { 0%, 100% { transform: rotate(12deg) translateY(0); } 50% { transform: rotate(16deg) translateY(-4px); } }
@keyframes dd-hw-wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-24deg); } }
@keyframes dd-hw-giggle { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-12px) rotate(-6deg); } 60% { transform: translateY(-5px) rotate(5deg); } }

/* 5. Шапочка-тыква у активной иконки нижней панели */
.dd-halloween #mobile-bottom-nav .mbn-item--active { position: relative; }
.dd-halloween #mobile-bottom-nav .mbn-item--active::before {
    content: ""; position: absolute; top: -3px; left: 50%; width: 22px; height: 18px; margin-left: -3px; transform: rotate(16deg); pointer-events: none;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 14'%3E%3Cpath d='M9 4.5c.4-2 1.6-3.2 3.2-3.3' stroke='%235b7a3a' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3Cellipse cx='9' cy='9' rx='8' ry='4.8' fill='%23f39a3d'/%3E%3Cpath d='M9 4.4v9.2M5 5.2v7.6M13 5.2v7.6' stroke='%23d97a22' stroke-width='.8' opacity='.6'/%3E%3C/svg%3E");
}

/* 6. Карточка-поздравление в сетке товаров */
.dd-hw-tile { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; min-height: 100%; padding: 18px 12px; overflow: hidden; text-align: center; color: #fff; list-style: none; background: radial-gradient(120% 90% at 50% 0%, #6b4f9a 0%, #3d2c5c 55%, #2a1f40 100%); border-radius: 12px; }
.dd-hw-tile::after { content: ""; position: absolute; inset: 0; background: radial-gradient(2px 2px at 20% 18%, #fff8 50%, transparent 51%), radial-gradient(2px 2px at 78% 12%, #fff6 50%, transparent 51%), radial-gradient(1.5px 1.5px at 62% 30%, #fff8 50%, transparent 51%), radial-gradient(1.5px 1.5px at 12% 42%, #fff5 50%, transparent 51%); pointer-events: none; }
.dd-hw-tile__art { position: relative; width: 100%; max-width: 220px; aspect-ratio: 1 / .8; }
.dd-hw-tile__ghost { position: absolute; left: 22%; top: 0; width: 46%; animation: dd-hw-float 3s ease-in-out infinite; }
.dd-hw-tile__pumpkin { position: absolute; right: 6%; bottom: 0; width: 38%; animation: dd-hw-bob 4s ease-in-out infinite; }
.dd-hw-tile__pumpkin--small { right: auto; left: 4%; width: 26%; animation-delay: -2s; }
.dd-hw-tile__ghost svg, .dd-hw-tile__pumpkin svg { display: block; width: 100%; height: auto; }
.dd-hw-tile__text { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; line-height: 1.3; }
.dd-hw-tile__title { font-size: 20px; line-height: 1.15; letter-spacing: .01em; }
.dd-hw-tile__code { padding: 6px 14px; font-family: inherit; font-size: 18px; font-weight: 800; letter-spacing: .08em; color: var(--dd-hw-ink); background: var(--dd-hw-orange); border: 0; border-radius: 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); cursor: pointer; }
.dd-hw-tile small { font-size: 12px; opacity: .85; }

/* «Скопировано» */
.dd-hw-toast { position: fixed; left: 50%; bottom: 110px; z-index: 100000; padding: 9px 16px; font-size: 14px; color: #fff; background: var(--dd-hw-ink); border-radius: 999px; opacity: 0; transform: translate(-50%, 10px); transition: opacity .25s, transform .25s; pointer-events: none; }
.dd-hw-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Телефон */
@media (max-width: 767px) {
    :root { --dd-hw-ghost-w: 78px; --dd-hw-peek: -42px; }
    .dd-hw-web { width: 80px; height: 80px; }
    .dd-hw-pumpkins { margin-left: 4px; }
    .dd-hw-pumpkin { width: 27px; height: 27px; }
    .dd-hw-pumpkin--small { width: 18px; height: 18px; }
    .dd-hw-garland { height: 34px; background-size: 204px 34px; }
    .dd-halloween .hero-cats__label::after { top: -18px; right: -9px; width: 24px; height: 24px; }
    .dd-hw-ghost { bottom: 78px; }
    .dd-hw-ghost__sign { font-size: 13px; padding: 7px 10px; }
    .dd-hw-tile { padding: 14px 8px; gap: 8px; }
    .dd-hw-tile__title { font-size: 17px; }
    .dd-hw-tile__text { font-size: 12.5px; }
    .dd-hw-tile__code { font-size: 16px; padding: 5px 12px; }
}

/* Через 20 с после открытия страницы украшения замирают (класс от halloween.js) — дальше нагрузка как без оформления.
   Двигается только привидение, когда его вызвали нажатием. */
.dd-hw-still .dd-hw-pumpkin, .dd-hw-still .dd-hw-spider, .dd-hw-still .dd-hw-garland, .dd-hw-still .dd-hw-tile__ghost, .dd-hw-still .dd-hw-tile__pumpkin,
.dd-halloween.dd-hw-still .hero-cats__label::after, .dd-hw-still .dd-hw-ghost.is-peek .dd-hw-ghost__body { animation-play-state: paused; }

/* «Уменьшить движение»: картинки остаются, но не двигаются */
@media (prefers-reduced-motion: reduce) {
    .dd-hw-pumpkin, .dd-hw-spider, .dd-hw-ghost__body, .dd-hw-arm, .dd-hw-tile__ghost, .dd-hw-tile__pumpkin, .dd-hw-garland, .dd-halloween .hero-cats__label::after { animation: none !important; }
    .dd-hw-ghost, .dd-hw-toast { transition: none !important; }
}
