/* ====== Переменные ====== */
:root {
  --bg: #fdf8f2;
  --ink: #333;
  --muted: #6a6a7a;
  --primary: #ff8c42;
  --primary-2: #ff9f66;
  --accent: #6a994e;
  --accent-2: #7ab05e;
  --curtain: #ff8c42;
  --shadow: 0 20px 60px rgba(51, 51, 51, .12);
  --radius: 28px;
}

/* ====== БАЗА — ФИНАЛЬНОЕ РЕШЕНИЕ: УБИРАЕТ ВЕСЬ ЛИШНИЙ СКРОЛЛ НАВСЕГДА ====== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  height: 100dvh;
  overflow: hidden !important;                    /* жёстко блочим скролл на html */
  -webkit-overflow-scrolling: touch;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Nunito', sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  /* Главное лекарство от двойного/резинового скролла в Chrome Android */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;

  /* Убираем pull-to-refresh и резиновый эффект */
  overscroll-behavior-y: contain;                 /* contain = нет резине, но скролл до конца работает */
  touch-action: pan-y;
}

/* Пока занавес закрыт — всё заблокировано */
body.loading {
  overflow: hidden !important;
  position: fixed !important;
}

/* Как только занавес открылся — возвращаем нормальное поведение */
body.loaded {
  position: static !important;                    /* ← КРИТИЧНО: возвращаем нормальный скролл */
  overscroll-behavior-y: auto;
}

/* Плавное появление контента */
body.loading .content {
  opacity: 0;
  transition: opacity .6s ease .8s;
}
body.loaded .content {
  opacity: 1;
}

.container {
  width: min(1300px, 92%);
  margin: 0 auto;
}

/* ====== ШАПКА — НАСЛЕДУЕТСЯ ИЗ BASE.HTML И MAIN/CSS/STYLES.CSS ====== */
/* Убеждаемся, что шапка работает корректно с занавесом */
.navbar {
  z-index: 9999; /* Ниже занавеса (10000), но выше всего остального */
}

/* Пока занавес закрыт — шапка должна быть под ним */
body.loading .navbar {
  z-index: 1; /* Под занавесом пока он закрыт */
}

/* После открытия занавеса — шапка возвращается на своё место */
body.loaded .navbar {
  z-index: 9999; /* Над всем контентом, но занавес уже ушёл */
}

/* ====== Занавес — ОТКРЫВАЕТСЯ (работает как и раньше) ====== */
.curtain {
  position: fixed;
  top: 0;
  width: 51%;
  height: 100%;
  background: var(--curtain);
  z-index: 10000;
  transition: transform 1.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  box-shadow: 0 0 40px rgba(0,0,0,.3);
}
.curtain-left { left: 0; transform: translateX(0); }
.curtain-right { right: 0; transform: translateX(0); }

body.loaded .curtain-left { transform: translateX(-100%); }
body.loaded .curtain-right { transform: translateX(100%); }

/* ====== Анимация букв ====== */
.letter {
  display: inline-block;
  font-family: 'Caveat', cursive;

  /* ИЗМЕНЕНИЕ: Увеличили размер шрифта */
  /* 70px - минимум на телефоне (было 40px) */
  /* 110px - максимум на большом экране */
  font-size: clamp(70px, 15vw, 110px);

  color: var(--primary);
  text-shadow: 0 0 20px rgba(255,140,66,.4);
  animation: float 3s ease-in-out infinite;
}
.letter:nth-child(1) { animation-delay: 0s; }
.letter:nth-child(2) { animation-delay: .2s; }
.letter:nth-child(3) { animation-delay: .4s; }
.letter:nth-child(4) { animation-delay: .6s; }
.letter:nth-child(5) { animation-delay: .8s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ====== Hero ====== */
.hero {
  position: relative;
  padding: 80px 0 60px;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #fff9f0, #f0fff4);
  z-index: -1;
}
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80"><circle cx="40" cy="40" r="3" fill="%236a994e" opacity=".2"/></svg>') repeat;
  animation: clouds 30s linear infinite;
  opacity: .3;
}
@keyframes clouds {
  from { background-position: 0 0; }
  to { background-position: 80px 80px; }
}
.hero-subtitle {
  font-family: 'Caveat', cursive;
  font-size: 24px;
  color: var(--muted);
  margin-top: 12px;
}

/* ====== Фильтры ====== */
.filters-section { padding: 40px 0; }
.filters {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.filter-btn {
  position: relative;
  background: white;
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  overflow: hidden;
  transition: .4s;
}
.filter-btn span { position: relative; z-index: 2; }
.filter-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: .4s;
}
.filter-btn:hover::before,
.filter-btn.active::before { transform: scaleX(1); }
.filter-btn:hover,
.filter-btn.active { color: white; }
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,140,66,.4);
  transform: scale(0);
  animation: ripple 0.6s linear;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ====== 3D Карточки ====== */
.shows-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
  padding: 20px 0;
}
.flip-card { perspective: 1000px; height: 380px; }
.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.7, 0, 0.3, 1);
  transform-style: preserve-3d;
}
.show-card:hover .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.flip-front {
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.flip-front img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: .5s;
}
.show-card:hover .flip-front img { filter: brightness(1.1) saturate(1.2); }
.flip-front h3 {
  position: relative;
  z-index: 2;
  background: rgba(255,255,255,.9);
  padding: 16px;
  margin: 0;
  font-family: 'Amatic SC', cursive;
  font-size: 28px;
  color: var(--primary);
  text-align: center;
}
.age-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--accent);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 13px;
  z-index: 2;
}
.flip-back {
  background: linear-gradient(135deg, #fff9f0, #f0fff4);
  color: var(--ink);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transform: rotateY(180deg);
  border: 3px solid var(--accent);
}
.flip-back h3 {
  font-family: 'Amatic SC', cursive;
  font-size: 26px;
  color: var(--primary);
  margin-bottom: 12px;
}
.flip-back p { margin: 8px 0; font-size: 15px; }

/* ====== CTA ====== */
.cta-section {
  padding: 100px 0;
  text-align: center;
  background: linear-gradient(135deg, #fff9f0, #f0fff4);
}
.fairy-title {
  font-family: 'Caveat', cursive;
  font-size: clamp(44px, 7vw, 70px);
  color: var(--primary);
  margin: 0 0 16px;
  text-shadow: 0 2px 10px rgba(255,140,66,.3);
}
.section-lead { font-size: 20px; color: var(--muted); margin-bottom: 32px; }

/* ====== Адаптив ====== */
@media (max-width: 768px) {
  .curtain { display: none; }
  .shows-grid { grid-template-columns: 1fr; }
  .flip-card { height: 420px; }
}

/* ====== Анимация появления ====== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.revealed,
body.loaded .reveal {
  opacity: 1;
  transform: translateY(0);
}