/* ============================================================
   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 {
  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%);
}

/* "снежная шапка" — один плавный сугроб, лежащий прямо на верхушках букв/плашки */
body.theme-new-year .eyebrow,
body.theme-new-year h1,
body.theme-new-year .phase-name,
body.theme-new-year .tc-name,
body.theme-new-year .zc-name,
body.theme-new-year .pc-name {
  position: relative;
}
body.theme-new-year .eyebrow::before,
body.theme-new-year h1::before,
body.theme-new-year .phase-name::before,
body.theme-new-year .tc-name::before,
body.theme-new-year .zc-name::before,
body.theme-new-year .pc-name::before {
  content: '';
  position: absolute; top: -4px; left: 6%; right: 6%; height: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M0 20 L0 12 Q8 5 16 10 T32 9 T48 11 T64 7 T80 12 T96 8 T112 10 T128 6 T144 11 T160 8 T176 10 T192 7 L200 10 L200 20 Z' fill='white'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3));
  pointer-events: none; opacity: .92;
}
body.theme-new-year .eyebrow::before { left: 12%; right: 12%; top: -3px; height: 7px; }
body.theme-new-year h1::before { top: 2px; height: 7px; }

/* ---------- Новый год, 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-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; }
}
