/* ============================================
   AnimeRusFest — Главная таблица стилей
   ============================================ */

/* === CSS-переменные и базовые стили === */
:root {
  --bg: #0d0a1a;
  --bg-secondary: #131025;
  --bg-card: #1a1530;
  --bg-card-hover: #221d3d;
  --fg: #f0eef6;
  --fg-secondary: #c8c3d9;
  --muted: #7b7494;
  --accent-pink: #ff2d78;
  --accent-pink-glow: rgba(255, 45, 120, 0.4);
  --accent-blue: #00d4ff;
  --accent-blue-glow: rgba(0, 212, 255, 0.35);
  --accent-purple: #8b5cf6;
  --accent-gold: #fbbf24;
  --border: #2a2445;
  --border-light: #362f55;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow-pink: 0 0 30px rgba(255, 45, 120, 0.25);
  --shadow-glow-blue: 0 0 30px rgba(0, 212, 255, 0.2);
  --font-display: 'Righteous', cursive;
  --font-ui: 'Nunito', sans-serif;
  --nav-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* === Skip-link (a11y) === */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--accent-pink);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  z-index: 10000;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 10px;
}

/* === Утилиты === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.section {
  padding: 80px 0;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  text-align: center;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 48px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* === Навигация === */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(13, 10, 26, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: background 0.3s;
}
nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--fg);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 4px;
  border-radius: 8px;
}
.nav-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-blue));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
}
.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
}
.nav-links a {
  color: var(--fg-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.25s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.06);
}
.nav-links a:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
.nav-telegram {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #2AABEE, #229ED9);
  color: #fff !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  padding: 8px 16px !important;
  border-radius: 8px !important;
}
.nav-telegram:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(42, 171, 238, 0.4);
}
.nav-telegram:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Мобильное меню */
.nav-burger {
  display: none;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 8px;
}
.nav-burger:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
  border-radius: 6px;
}
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 10, 26, 0.97);
  backdrop-filter: blur(20px);
  z-index: 999;
  padding: 24px;
  flex-direction: column;
  gap: 4px;
}
.mobile-menu.open {
  display: flex;
}
.mobile-menu a {
  color: var(--fg-secondary);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 14px 16px;
  border-radius: 10px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}
.mobile-menu a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
}
.mobile-menu a:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-burger {
    display: block;
  }
}

/* === Hero === */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 40px) 20px 60px;
  overflow: hidden;
  /* Фоновое аниме-изображение */
  background:
    linear-gradient(180deg, rgba(13, 10, 26, 0.55) 0%, rgba(13, 10, 26, 0.75) 60%, rgba(13, 10, 26, 0.92) 100%),
    url('https://w.wallhaven.cc/full/qr/wallhaven-qrm2zq.jpg') center 30% / cover no-repeat;
  background-color: var(--bg);
}

/* Второй слой фона — более светлый вариант для светлой темы */
[data-theme="light"] .hero {
  background:
    linear-gradient(180deg, rgba(245, 243, 250, 0.5) 0%, rgba(245, 243, 250, 0.75) 60%, rgba(245, 243, 250, 0.92) 100%),
    url('https://w.wallhaven.cc/full/qr/wallhaven-qrm2zq.jpg') center 30% / cover no-repeat;
  background-color: #f5f3fa;
}

/* Фолбэк: градиент, если изображение не загрузилось */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(139, 92, 246, 0.2) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 80%, rgba(255, 45, 120, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 60% 30%, rgba(0, 212, 255, 0.1) 0%, transparent 70%);
  /* Фолбэк-градиент всегда виден, но перекрывается основным фоном */
}
.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.hero-bg-gradient {
  display: none; /* заменён на ::after */
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 45, 120, 0.12);
  border: 1px solid rgba(255, 45, 120, 0.25);
  color: var(--accent-pink);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 24px;
  animation: fadeInUp 0.8s ease both;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 20px;
  animation: fadeInUp 0.8s ease 0.15s both;
}
.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--fg-secondary);
  max-width: 560px;
  margin: 0 auto 36px;
  animation: fadeInUp 0.8s ease 0.3s both;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.45s both;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
}
.btn:focus-visible {
  outline: 3px solid var(--accent-blue);
  outline-offset: 3px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-pink), #d4145a);
  color: #fff;
  box-shadow: var(--shadow-glow-pink);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(255, 45, 120, 0.45);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}
.hero-stats {
  display: flex;
  gap: 40px;
  justify-content: center;
  margin-top: 48px;
  animation: fadeInUp 0.8s ease 0.6s both;
}
.hero-stat-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--accent-blue);
}
.hero-stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

/* === Telegram-баннер === */
.tg-banner {
  position: relative;
  z-index: 2;
  margin: -40px auto 0;
  max-width: 900px;
  padding: 32px 36px;
  background: linear-gradient(135deg, rgba(42, 171, 238, 0.12), rgba(255, 45, 120, 0.08));
  border: 1px solid rgba(42, 171, 238, 0.2);
  border-radius: var(--radius-lg);
  text-align: center;
  backdrop-filter: blur(12px);
  animation: fadeInUp 0.8s ease 0.75s both;
}
.tg-banner-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #2AABEE, #229ED9);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  margin: 0 auto 16px;
  box-shadow: 0 4px 20px rgba(42, 171, 238, 0.35);
}
.tg-banner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  color: var(--fg);
  margin-bottom: 10px;
  line-height: 1.3;
}
.tg-banner p {
  color: var(--fg-secondary);
  font-size: 0.95rem;
  max-width: 600px;
  margin: 0 auto 20px;
  line-height: 1.6;
}
.btn-tg {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #2AABEE, #229ED9);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 1.05rem;
  padding: 16px 36px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 4px 24px rgba(42, 171, 238, 0.35);
}
.btn-tg:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 36px rgba(42, 171, 238, 0.5);
}
.btn-tg:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.btn-tg i {
  font-size: 1.2rem;
}

@media (max-width: 640px) {
  .tg-banner {
    margin: -20px 12px 0;
    padding: 24px 20px;
  }
  .hero-stats {
    gap: 24px;
  }
  .hero-stat-num {
    font-size: 1.4rem;
  }
}

/* === Ближайшие мероприятия === */
.upcoming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.35s;
  position: relative;
}
.event-card:focus-visible {
  outline: 2px solid var(--accent-pink);
  outline-offset: 2px;
}
.event-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-pink);
  box-shadow: var(--shadow-glow-pink);
}
/* Пререндеренная ссылка-обёртка (работает без JS) */
.event-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
/* После гидрации JS убираем ссылки (управление через JS) */
.js-hydrated .event-card-link {
  pointer-events: none;
}
.event-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}
.event-card:hover .event-card-img {
  transform: scale(1.05);
}
.event-card-img-wrap {
  overflow: hidden;
  position: relative;
}
.event-card-type {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.type-anime {
  background: rgba(139, 92, 246, 0.9);
  color: #fff;
}
.type-cosplay {
  background: rgba(255, 45, 120, 0.9);
  color: #fff;
}
.type-games {
  background: rgba(0, 212, 255, 0.9);
  color: #0d0a1a;
}
.type-mixed {
  background: rgba(251, 191, 36, 0.9);
  color: #0d0a1a;
}
.event-card-body {
  padding: 18px;
}
.event-card-date {
  font-size: 0.8rem;
  color: var(--accent-blue);
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.event-card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 8px;
  line-height: 1.3;
}
.event-card-city {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* === Каталог с фильтрами === */
.filters-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  align-items: center;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.filter-select,
.filter-input {
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.filter-select:focus,
.filter-input:focus {
  border-color: var(--accent-pink);
}
.filter-btn {
  background: var(--accent-pink);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover {
  background: #e0245f;
  transform: translateY(-1px);
}
.filter-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
.filter-reset {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 10px 16px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-reset:hover {
  border-color: var(--fg-secondary);
  color: var(--fg-secondary);
}
.filter-reset:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 1.1rem;
}

/* === Календарь === */
.calendar-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 800px;
  margin: 0 auto;
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.calendar-header h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
}
.calendar-nav {
  display: flex;
  gap: 8px;
}
.calendar-nav button {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.calendar-nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-pink);
}
.calendar-nav button:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-day-name {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  padding: 8px 0;
  letter-spacing: 0.5px;
}
.calendar-day {
  text-align: center;
  padding: 10px 4px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: default;
  transition: all 0.2s;
  position: relative;
}
.calendar-day.empty {
  pointer-events: none;
}
.calendar-day.today {
  background: rgba(139, 92, 246, 0.2);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.4);
}
.calendar-day.has-event {
  cursor: pointer;
  color: var(--accent-pink);
  font-weight: 800;
}
.calendar-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  background: var(--accent-pink);
  border-radius: 50%;
}
.calendar-day.has-event:hover {
  background: rgba(255, 45, 120, 0.12);
}
.calendar-day.has-event:focus-visible {
  outline: 2px solid var(--accent-pink);
  outline-offset: 1px;
}
.calendar-day.other-month {
  color: var(--border-light);
}
.calendar-events-list {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.calendar-events-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-blue);
  margin-bottom: 10px;
}
.calendar-event-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}
.calendar-event-item:hover {
  background: rgba(255, 255, 255, 0.07);
}
.calendar-event-item:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 1px;
}

/* === Персонажи === */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.character-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  padding: 20px 14px 18px;
  transition: all 0.35s;
  cursor: default;
  position: relative;
}
.character-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--char-color, var(--accent-pink));
  opacity: 0;
  transition: opacity 0.3s;
}
.character-card:hover::before {
  opacity: 1;
}
.character-card:hover {
  transform: translateY(-4px);
  border-color: var(--char-color, var(--accent-pink));
  /* color-mix с фолбэком */
  box-shadow:
    0 0 24px rgba(255, 45, 120, 0.2),
    0 0 24px color-mix(in srgb, var(--char-color, var(--accent-pink)) 30%, transparent);
}
.character-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 12px;
  object-fit: cover;
  border: 3px solid var(--border);
  transition: border-color 0.3s;
}
.character-card:hover .character-avatar {
  border-color: var(--char-color, var(--accent-pink));
}
.character-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.character-anime {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.character-trait {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg-secondary);
}

/* === О проекте === */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: all 0.3s;
}
.about-card:hover {
  border-color: var(--accent-purple);
  transform: translateY(-2px);
}
.about-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 16px;
}
.about-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.about-card p {
  font-size: 0.9rem;
  color: var(--fg-secondary);
  line-height: 1.6;
}

/* === Контакты === */
.contacts-block {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}
.contacts-block p {
  color: var(--fg-secondary);
  margin-bottom: 28px;
  font-size: 1rem;
  line-height: 1.7;
}
.contacts-links {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.contact-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 24px;
  color: var(--fg);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.3s;
}
.contact-link:hover {
  transform: translateY(-2px);
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow-blue);
}
.contact-link:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
.contact-link i {
  font-size: 1.2rem;
}

/* === Модальное окно === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open {
  display: flex;
}
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease;
  position: relative;
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.modal-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-body {
  padding: 28px;
}
.modal-body h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 12px;
}
.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}
.modal-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--fg-secondary);
}
.modal-meta i {
  color: var(--accent-blue);
}
.modal-desc {
  font-size: 0.95rem;
  color: var(--fg-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 1;
}
.modal-close:hover {
  background: rgba(255, 45, 120, 0.7);
}
.modal-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Скрытый фокусный якорь для фокус-ловушки */
.modal-focus-guard {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === Футер === */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  background: var(--bg-secondary);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.footer-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}
.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  color: var(--fg-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 4px 0;
  transition: color 0.2s;
}
.footer-col a:hover {
  color: var(--accent-pink);
}
.footer-col a:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}
@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* === Уведомление (тост) === */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--accent-blue);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 0.9rem;
  color: var(--fg);
  z-index: 3000;
  box-shadow: var(--shadow-glow-blue);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* === NoScript-баннер === */
.noscript-banner {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: var(--accent-pink);
  color: #fff;
  text-align: center;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 0.95rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* === Анимации === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Скроллбар === */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-canvas {
    display: none;
  }
}

/* === Мини-промо в секции персонажей === */
.promo-inline {
  margin-top: 32px;
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 45, 120, 0.08), rgba(0, 212, 255, 0.06));
  border: 1px dashed rgba(255, 45, 120, 0.25);
  border-radius: var(--radius);
  color: var(--fg-secondary);
  font-size: 0.95rem;
}
.promo-inline a {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 700;
}
.promo-inline a:hover {
  text-decoration: underline;
}
.promo-inline a:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* === Счётчик мероприятий === */
.events-count {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 20px;
}
.events-count strong {
  color: var(--accent-pink);
}

/* ============================================
   СВЕТЛАЯ ТЕМА
   ============================================ */
[data-theme="light"] {
  --bg: #f5f3fa;
  --bg-secondary: #ede9f6;
  --bg-card: #ffffff;
  --bg-card-hover: #f0ecf8;
  --fg: #1a1333;
  --fg-secondary: #4a3f6b;
  --muted: #8b80a9;
  --border: #d8d0e8;
  --border-light: #e4def0;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-glow-pink: 0 0 24px rgba(255, 45, 120, 0.15);
  --shadow-glow-blue: 0 0 24px rgba(0, 180, 220, 0.12);
}
[data-theme="light"] nav {
  background: rgba(245, 243, 250, 0.9);
}
[data-theme="light"] .mobile-menu {
  background: rgba(245, 243, 250, 0.97);
}
[data-theme="light"] .modal-overlay {
  background: rgba(0, 0, 0, 0.4);
}
[data-theme="light"] .tg-banner {
  background: linear-gradient(135deg, rgba(42, 171, 238, 0.08), rgba(255, 45, 120, 0.04));
}
[data-theme="light"] tr {
  border-color: var(--border-light);
}
[data-theme="light"] .calendar-day.today {
  background: rgba(139, 92, 246, 0.1);
}
[data-theme="light"] .calendar-day.has-event:hover {
  background: rgba(255, 45, 120, 0.06);
}
[data-theme="light"] .calendar-nav button {
  background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .calendar-event-item {
  background: rgba(0, 0, 0, 0.02);
}
[data-theme="light"] .calendar-event-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Переключатель темы */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.25s;
  margin-left: 4px;
  display: flex;
  align-items: center;
}
.theme-toggle:hover {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.08);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

/* ============================================
   ПОИСК
   ============================================ */
.search-bar {
  position: relative;
  max-width: 500px;
  margin-bottom: 20px;
}
.search-bar input {
  width: 100%;
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px 12px 44px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.search-bar input:focus {
  border-color: var(--accent-pink);
}
.search-bar input::placeholder {
  color: var(--muted);
}
.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1rem;
  pointer-events: none;
}
.search-bar .search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 8px;
  border-radius: 4px;
  display: none;
}
.search-bar .search-clear.visible {
  display: block;
}
.search-bar .search-clear:hover {
  color: var(--accent-pink);
}
mark {
  background: rgba(255, 45, 120, 0.2);
  color: var(--accent-pink);
  border-radius: 2px;
  padding: 0 1px;
}
[data-theme="light"] mark {
  background: rgba(255, 45, 120, 0.15);
}

/* ============================================
   ВКЛАДКИ ТИПОВ
   ============================================ */
.type-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.type-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--fg-secondary);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.type-tab:hover {
  border-color: var(--accent-pink);
  color: var(--fg);
}
.type-tab.active {
  background: var(--accent-pink);
  border-color: var(--accent-pink);
  color: #fff;
}
.type-tab:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
.type-tab .tab-count {
  font-size: 0.7rem;
  opacity: 0.7;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  padding: 2px 8px;
  min-width: 24px;
  text-align: center;
}

/* ============================================
   ИЗБРАННОЕ (сердечки)
   ============================================ */
.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  z-index: 2;
  backdrop-filter: blur(4px);
}
.fav-btn:hover {
  transform: scale(1.15);
}
.fav-btn.is-fav {
  color: var(--accent-pink);
  background: rgba(255, 45, 120, 0.2);
}
.fav-btn.is-fav i {
  font-weight: 900;
}
.fav-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

/* Счётчик избранного в навигации */
.fav-counter {
  display: none;
  align-items: center;
  gap: 4px;
  color: var(--accent-pink);
  font-weight: 700;
  font-size: 0.85rem;
  margin-left: 2px;
}
.fav-counter.has-items {
  display: flex;
}

/* Фильтр «Избранное» */
.filter-fav {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 10px 16px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-fav:hover {
  border-color: var(--accent-pink);
  color: var(--accent-pink);
}
.filter-fav.active {
  border-color: var(--accent-pink);
  color: var(--accent-pink);
  background: rgba(255, 45, 120, 0.08);
}
.filter-fav:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* ============================================
   СОРТИРОВКА
   ============================================ */
.sort-group {
  margin-left: auto;
}

/* ============================================
   КНОПКА «ЗАГРУЗИТЬ ЕЩЁ»
   ============================================ */
.load-more-wrap {
  text-align: center;
  margin-top: 32px;
}
.btn-load-more {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 40px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-load-more:hover {
  border-color: var(--accent-pink);
  box-shadow: var(--shadow-glow-pink);
  transform: translateY(-2px);
}
.btn-load-more:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
.btn-load-more:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ============================================
   ПЛЕЙСХОЛДЕРЫ ИЗОБРАЖЕНИЙ (градиенты)
   ============================================ */
.event-placeholder {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.event-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.5) 100%);
}
.event-placeholder .placeholder-icon {
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.3);
  z-index: 1;
}
.event-placeholder .placeholder-text {
  position: absolute;
  bottom: 12px;
  left: 16px;
  right: 16px;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  z-index: 1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.character-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 12px;
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: rgba(255, 255, 255, 0.5);
  transition: border-color 0.3s;
}
.character-card:hover .character-avatar-placeholder {
  border-color: var(--char-color, var(--accent-pink));
}

/* ============================================
   ОБРАТНЫЙ ОТСЧЁТ
   ============================================ */
.countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-pink);
  background: rgba(255, 45, 120, 0.1);
  border: 1px solid rgba(255, 45, 120, 0.2);
  padding: 4px 10px;
  border-radius: 100px;
  margin-left: auto;
  white-space: nowrap;
}
.hero-countdown {
  text-align: center;
  margin-top: 20px;
  animation: fadeInUp 0.8s ease 0.7s both;
}
.hero-countdown-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.hero-countdown-num {
  font-family: var(--font-display);
  font-size: 2rem;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   ШЕРИНГ (в модальном окне)
   ============================================ */
.share-block {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-top: 4px;
}
.share-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--fg-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.share-btn:hover {
  transform: translateY(-1px);
  color: var(--fg);
}
.share-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
.share-btn.share-tg:hover {
  border-color: #2AABEE;
  box-shadow: 0 2px 12px rgba(42, 171, 238, 0.25);
}
.share-btn.share-vk:hover {
  border-color: #4C75A3;
  box-shadow: 0 2px 12px rgba(76, 117, 163, 0.25);
}
.share-btn.share-copy:hover {
  border-color: var(--accent-pink);
  box-shadow: 0 2px 12px rgba(255, 45, 120, 0.2);
}
.share-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 8px;
}

/* ============================================
   АДАПТИВ: ФИЛЬТРЫ НА МОБИЛЬНЫХ
   ============================================ */
@media (max-width: 640px) {
  .type-tabs {
    gap: 4px;
  }
  .type-tab {
    font-size: 0.78rem;
    padding: 8px 14px;
  }
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-bar {
    max-width: 100%;
  }
  .sort-group {
    margin-left: 0;
  }
}

/* ============================================
   АНИМЕ-ДЕКОРАЦИИ (плавающие элементы)
   ============================================ */

/* Плавающие светящиеся сферы на фоне hero */
.hero-floating-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(60px);
  opacity: 0.4;
  animation: floatOrb 12s ease-in-out infinite;
}
.hero-floating-orb:nth-child(1) {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 45, 120, 0.5), transparent 70%);
  top: 10%;
  left: 5%;
  animation-delay: 0s;
  animation-duration: 14s;
}
.hero-floating-orb:nth-child(2) {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(0, 180, 255, 0.4), transparent 70%);
  top: 50%;
  right: 8%;
  animation-delay: -3s;
  animation-duration: 16s;
}
.hero-floating-orb:nth-child(3) {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent 70%);
  bottom: 15%;
  left: 25%;
  animation-delay: -6s;
  animation-duration: 18s;
}
.hero-floating-orb:nth-child(4) {
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.3), transparent 70%);
  top: 25%;
  right: 30%;
  animation-delay: -9s;
  animation-duration: 13s;
}

@keyframes floatOrb {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(40px, -30px) scale(1.15);
  }
  50% {
    transform: translate(-20px, 30px) scale(0.9);
  }
  75% {
    transform: translate(-40px, -20px) scale(1.05);
  }
}

/* Аниме-сияние по краям hero */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse 80% 50% at 20% 50%, rgba(255, 150, 200, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(150, 180, 255, 0.05) 0%, transparent 70%);
}

@media (prefers-reduced-motion: reduce) {
  .hero-floating-orb {
    animation-duration: 0.01ms !important;
  }
}
