/* ============================================================
   Horizont — сезонные темы (Новый год / Хэллоуин / Юбилей / ДР)
   Общий файл, одинаковый на всех сайтах семьи Horizont.
   ============================================================ */

.theme-particles {
  position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 2;
}
.theme-particle {
  position: absolute; top: -24px; line-height: 1; user-select: none;
}
.theme-particle.falling { animation-name: theme-fall; animation-timing-function: linear; animation-iteration-count: infinite; }
.theme-particle.rising { animation-name: theme-rise; animation-timing-function: linear; animation-iteration-count: infinite; }

@keyframes theme-fall {
  0% { transform: translateY(-5vh) translateX(0) rotate(0deg); opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { transform: translateY(110vh) translateX(var(--drift, 0px)) rotate(var(--rot, 180deg)); opacity: 0; }
}
@keyframes theme-rise {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  8% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translateY(-115vh) translateX(var(--drift, 0px)); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-particles { display: none; }
}

/* ---------- Новый год: иней на кнопках + снег на заголовках/карточках ---------- */
body.theme-new-year .pill,
body.theme-new-year .dl-button,
body.theme-new-year .btn-brass,
body.theme-new-year .eyebrow {
  box-shadow: 0 0 0 1px rgba(120, 200, 255, .22), 0 0 20px rgba(120, 200, 255, .12);
}

/* чуть морозного оттенка сверху страницы, едва заметно */
body.theme-new-year::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at top, rgba(140, 200, 255, .05), transparent 50%);
}

/* ---------- Новый год, 25 дек – 5 янв: гирлянда поверх шапки ---------- */
body.theme-garlands::before {
  content: ''; position: fixed; top: 0; left: 0; right: 0; height: 14px; z-index: 40;
  pointer-events: none;
  background-image:
    radial-gradient(circle 3.5px at 16px 9px, #ff5c5c 0 100%, transparent 101%),
    radial-gradient(circle 3.5px at 48px 9px, #f0c383 0 100%, transparent 101%),
    radial-gradient(circle 3.5px at 80px 9px, #57c26a 0 100%, transparent 101%),
    radial-gradient(circle 3.5px at 112px 9px, #7f8cff 0 100%, transparent 101%);
  background-size: 128px 14px;
  background-repeat: repeat-x;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, .35));
  animation: garland-twinkle 2.6s ease-in-out infinite;
}
@keyframes garland-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  body.theme-garlands::before { animation: none; }
}

/* ---------- Хэллоуин: тыквенно-фиолетовый редизайн ---------- */
body.theme-halloween::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at top, rgba(255, 140, 20, .08), transparent 60%),
              radial-gradient(ellipse at bottom, rgba(130, 60, 200, .08), transparent 60%);
  animation: halloween-flicker 4s ease-in-out infinite;
}
@keyframes halloween-flicker { 0%, 100% { opacity: 1; } 45% { opacity: .85; } 50% { opacity: 1; } 78% { opacity: .9; } }

/* паутина по углам экрана */
body.theme-halloween::before {
  content: '';
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: .55;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.28)' stroke-width='1'%3E%3Cpath d='M0 0 L90 90 M0 28 L58 90 M0 56 L28 90 M28 0 L90 58 M56 0 L90 28'/%3E%3Cpath d='M0 9 Q18 18 9 0 M0 33 Q28 42 19 23 Q10 9 0 9 M0 57 Q33 66 24 47 Q14 33 0 33'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.28)' stroke-width='1'%3E%3Cpath d='M90 0 L0 90 M90 28 L32 90 M90 56 L62 90 M62 0 L0 62 M32 0 L0 32'/%3E%3Cpath d='M90 9 Q72 18 81 0 M90 33 Q62 42 71 23 Q80 9 90 9'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: top left, top right;
  background-size: 90px 90px, 90px 90px;
}

/* жутковатое свечение заголовков */
body.theme-halloween .eyebrow,
body.theme-halloween h1,
body.theme-halloween h2,
body.theme-halloween .phase-name,
body.theme-halloween .tc-name,
body.theme-halloween .r-name {
  text-shadow: 0 0 16px rgba(255, 140, 30, .4), 0 0 32px rgba(130, 60, 200, .2);
}
body.theme-halloween .pill,
body.theme-halloween .dl-button,
body.theme-halloween .btn-brass {
  box-shadow: 0 0 0 1px rgba(255, 140, 30, .35), 0 0 22px rgba(130, 60, 200, .3);
}

/* ---------- Лето: солнце из правого верхнего угла ---------- */
body.theme-summer::before {
  content: ''; position: fixed; top: -25vmax; right: -25vmax; z-index: 1; pointer-events: none;
  width: 90vmax; height: 90vmax;
  background: repeating-conic-gradient(
    from 170deg at 100% 0%,
    rgba(255, 214, 120, .16) 0deg 4deg,
    transparent 4deg 13deg
  );
  -webkit-mask-image: radial-gradient(circle at 100% 0%, #000 0%, transparent 62%);
  mask-image: radial-gradient(circle at 100% 0%, #000 0%, transparent 62%);
  animation: summer-rays-spin 120s linear infinite;
}
@keyframes summer-rays-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
body.theme-summer::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse 55% 38% at 100% 0%, rgba(255, 228, 160, .35), transparent 58%),
              radial-gradient(ellipse at bottom, rgba(255, 180, 90, .05), transparent 55%);
  animation: summer-glow 6s ease-in-out infinite;
}
@keyframes summer-glow { 0%, 100% { opacity: 1; } 50% { opacity: .82; } }
@media (prefers-reduced-motion: reduce) {
  body.theme-summer::after { animation: none; }
  body.theme-summer::before { animation: none; }
}
body.theme-summer .pill,
body.theme-summer .dl-button,
body.theme-summer .btn-brass,
body.theme-summer .eyebrow {
  box-shadow: 0 0 0 1px rgba(255, 196, 92, .3), 0 0 22px rgba(255, 196, 92, .18);
}

/* ---------- Лето: бассейн с надувными кругами в углу ---------- */
.summer-pool {
  position: fixed; left: 0; bottom: 0; z-index: 3; pointer-events: none;
  width: 180px; height: 110px;
}
.summer-pool .pool-water {
  position: absolute; inset: 0 0 -40px 0; border-radius: 50% 50% 0 0 / 60% 60% 0 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(110, 200, 230, .5), rgba(50, 140, 190, .35) 70%, transparent 100%);
  border-top: 2px solid rgba(180, 230, 245, .55);
}
.summer-pool .pool-ring {
  position: absolute; width: 46px; height: 46px; padding: 0; border: 0; background: none; cursor: pointer;
  pointer-events: auto; filter: drop-shadow(0 3px 6px rgba(0,0,0,.25));
  animation: pool-bob 4s ease-in-out infinite;
  transition: transform .15s;
}
.summer-pool .pool-ring:hover { transform: scale(1.08); }
.summer-pool .pool-ring svg { width: 100%; height: 100%; }
.summer-pool .pool-ring-1 { left: 18px; bottom: 28px; animation-delay: 0s; }
.summer-pool .pool-ring-2 { left: 92px; bottom: 14px; width: 38px; height: 38px; animation-delay: 1.6s; }
@keyframes pool-bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-7px) rotate(4deg); }
}
@media (prefers-reduced-motion: reduce) {
  .summer-pool .pool-ring { animation: none; }
}
@media (max-width: 640px) {
  .summer-pool { width: 130px; height: 85px; transform: scale(.85); transform-origin: bottom left; }
}

.summer-pool-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60;
  transform: translate(-50%, 12px); opacity: 0;
  background: #1a1a1d; border: 1px solid rgba(255, 196, 92, .4); color: #f2f0ec;
  padding: 10px 18px; border-radius: 100px; font-size: .9rem; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  max-width: calc(100vw - 40px); text-align: center;
}

/* ---------- ДР: тортик в углу ---------- */
.birthday-cake-wrap {
  position: fixed; right: 20px; bottom: 20px; z-index: 3;
}
.birthday-cake {
  width: 64px; height: 64px; padding: 0; border: 0; background: none; cursor: pointer;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.3));
  animation: cake-wiggle 3.2s ease-in-out infinite;
  transition: transform .15s;
}
.birthday-cake:hover { transform: scale(1.1); }
.birthday-cake svg { width: 100%; height: 100%; }
@keyframes cake-wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}
@media (prefers-reduced-motion: reduce) {
  .birthday-cake { animation: none; }
}
@media (max-width: 640px) {
  .birthday-cake-wrap { right: 14px; bottom: 14px; }
  .birthday-cake { width: 50px; height: 50px; }
}
.summer-pool-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Новый год: снеговик в углу ---------- */
.winter-snowman-wrap {
  position: fixed; left: 20px; bottom: 20px; z-index: 3;
}
.winter-snowman {
  width: 60px; height: 66px; padding: 0; border: 0; background: none; cursor: pointer;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.35));
  animation: snowman-sway 3.6s ease-in-out infinite;
  transition: transform .15s;
}
.winter-snowman:hover { transform: scale(1.08); }
.winter-snowman svg { width: 100%; height: 100%; }
@keyframes snowman-sway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}
@media (prefers-reduced-motion: reduce) {
  .winter-snowman { animation: none; }
}
@media (max-width: 640px) {
  .winter-snowman-wrap { left: 14px; bottom: 14px; }
  .winter-snowman { width: 46px; height: 51px; }
}

/* ---------- Хэллоуин: тыква в углу ---------- */
.halloween-pumpkin-wrap {
  position: fixed; right: 20px; bottom: 20px; z-index: 3;
}
.halloween-pumpkin {
  width: 68px; height: 60px; padding: 0; border: 0; background: none; cursor: pointer;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.35)) drop-shadow(0 0 10px rgba(255, 138, 43, .35));
  animation: pumpkin-wiggle 3.4s ease-in-out infinite;
  transition: transform .15s;
}
.halloween-pumpkin:hover { transform: scale(1.1); }
.halloween-pumpkin svg { width: 100%; height: 100%; }
@keyframes pumpkin-wiggle {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}
@media (prefers-reduced-motion: reduce) {
  .halloween-pumpkin { animation: none; }
}
@media (max-width: 640px) {
  .halloween-pumpkin-wrap { right: 14px; bottom: 14px; }
  .halloween-pumpkin { width: 52px; height: 46px; }
}

/* ---------- Юбилей / ДР: тёплый золотой акцент ---------- */
body.theme-anniversary .pill,
body.theme-birthday .pill {
  box-shadow: 0 0 0 1px rgba(240, 195, 131, .35), 0 0 24px rgba(240, 195, 131, .2);
}

/* ---------- панель переключения тем (только в режиме редактирования) ---------- */
.theme-admin-panel {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 55;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 14px;
  padding: 10px 16px; max-width: calc(100vw - 32px);
  font-family: var(--mono); font-size: .78rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.theme-admin-panel .tap-label { color: var(--text-3); }
.theme-admin-panel label { display: flex; align-items: center; gap: 5px; cursor: pointer; color: var(--text-2); }
.theme-admin-panel input[type="checkbox"] { accent-color: var(--amber); cursor: pointer; }
.theme-admin-panel label:has(input:checked) { color: var(--amber-hi); }

@media (max-width: 640px) {
  .theme-admin-panel { top: 56px; font-size: .72rem; gap: 8px; padding: 8px 12px; }
}
