/* ==========================================================================
   Лента времени · Современная Россия 1991–2022
   Единый стиль для index / timeline / quiz / game
   ========================================================================== */

:root {
  --bg-0: #0b1020;
  --bg-1: #131a30;
  --bg-2: #1e293b;
  --card: #1e293b;
  --card-hover: #2c3a52;
  --line: #334155;
  --text: #f8fafc;
  --text-dim: #aab4c5;
  --accent: #f59e0b;
  --accent-2: #ef4444;
  --accent-3: #10b981;
  --accent-4: #3b82f6;
  --radius: 16px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  font-synthesis: none;
}

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

html, body { height: 100%; }

body {
  font-family: "Segoe UI", "Helvetica Neue", "Inter", Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 20% -10%, #1d2b52 0%, transparent 60%),
              radial-gradient(1000px 700px at 100% 0%, #3b1d2b 0%, transparent 55%),
              linear-gradient(160deg, #0b1020 0%, #0f172a 55%, #0b1020 100%);
  background-attachment: fixed;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ----- Кнопки ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #1a1206;
  border: none;
  padding: 13px 26px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  text-transform: uppercase;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(245, 158, 11, 0.4); background: #fbbf24; }
.btn:active { transform: translateY(-1px); }

.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn.ghost:hover { background: var(--accent); color: #1a1206; }

.btn.small { padding: 9px 16px; font-size: 13px; }

/* ----- Верхняя навигация ----- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(11, 16, 32, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.topnav .brand { font-weight: 800; letter-spacing: 0.5px; font-size: 16px; }
.topnav .brand span { color: var(--accent); }
.topnav .links { display: flex; gap: 8px; flex-wrap: wrap; }
.topnav .links a {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  transition: all 0.2s var(--ease);
}
.topnav .links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.topnav .links a.active { color: var(--accent); background: rgba(245, 158, 11, 0.12); }

/* ==========================================================================
   ГЛАВНАЯ (index.html)
   ========================================================================== */
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 70px 20px 30px;
  text-align: center;
}
.hero .eyebrow {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 68px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -1px;
  background: linear-gradient(120deg, #fbbf24 0%, #ef4444 45%, #3b82f6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 18px;
}
.hero .lead {
  font-size: clamp(16px, 2.4vw, 20px);
  color: var(--text-dim);
  max-width: 760px;
  margin: 0 auto 16px;
}
.hero .period {
  font-size: clamp(40px, 8vw, 90px);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.06);
  letter-spacing: 2px;
  margin-top: 10px;
  user-select: none;
}

.cards {
  max-width: 1100px;
  margin: 10px auto 0;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}
.nav-card {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 32px 28px;
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px 200px at 50% -20%, rgba(245, 158, 11, 0.18), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.nav-card:hover { transform: translateY(-8px); box-shadow: var(--shadow); border-color: var(--accent); }
.nav-card:hover::after { opacity: 1; }
.nav-card .big-icon { font-size: 54px; display: block; margin-bottom: 14px; }
.nav-card h3 { font-size: 24px; margin-bottom: 10px; position: relative; z-index: 1; }
.nav-card p { color: var(--text-dim); font-size: 15px; margin-bottom: 22px; position: relative; z-index: 1; }
.nav-card .go { position: relative; z-index: 1; }

.sources-block {
  max-width: 1100px;
  margin: 40px auto 60px;
  padding: 30px;
  background: rgba(30, 41, 59, 0.55);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.sources-block h3 { color: var(--accent); margin-bottom: 16px; }
.sources-block ol { margin-left: 22px; color: var(--text-dim); font-size: 14px; line-height: 1.9; }

/* ==========================================================================
   ЛЕНТА ВРЕМЕНИ / СЛАЙДЕР (timeline.html)
   ========================================================================== */
.viewer {
  position: fixed;
  inset: 0;
  overflow: hidden;
}
.slides {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform 0.7s var(--ease);
  will-change: transform;
}
.slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
}
.slide::-webkit-scrollbar { width: 10px; }
.slide::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 999px; }

/* --- ОБЛОЖКА события (полноэкранная, с фоновой картинкой) --- */
.slide-hero {
  position: relative;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 86px 5vw 120px;
  overflow: hidden;
  scroll-snap-align: start;
}

.bg-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  transition: opacity 0.35s var(--ease), transform 0.6s var(--ease);
  will-change: opacity, transform;
}
.bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bg-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  padding: 20px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.035) 0 16px, rgba(255, 255, 255, 0.065) 16px 32px),
    linear-gradient(150deg, var(--slide-from, #1f2937) 0%, var(--slide-to, #111827) 100%);
}
.bg-placeholder .ph-icon { font-size: 48px; opacity: 0.65; }
.bg-placeholder code {
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 12px;
  border-radius: 7px;
  font-size: 13px;
  color: #fde68a;
}
.bg-placeholder small { opacity: 0.65; max-width: 320px; }
.bg-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 11, 22, 0.5) 0%, rgba(7, 11, 22, 0.35) 38%, rgba(7, 11, 22, 0.9) 100%);
}

.slide .bg-year {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(120px, 26vw, 380px);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.07);
  z-index: 1;
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: -10px;
}

.slide-inner {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  width: 100%;
  text-align: center;
}

.slide .badge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
}
.slide .icon-big { font-size: 56px; }
.slide .date-pill {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #1a1206;
  background: var(--slide-accent, var(--accent));
  padding: 7px 16px;
  border-radius: 999px;
}
.slide .era-name {
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #e7ecf5;
  opacity: 0.85;
}
.slide h2 {
  font-size: clamp(28px, 5vw, 54px);
  font-weight: 900;
  line-height: 1.08;
  margin-bottom: 18px;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(20px);
}
.slide .lead-short {
  font-size: clamp(15px, 2.2vw, 21px);
  color: #eef2f8;
  max-width: 720px;
  margin: 0 auto 26px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(20px);
}

.slide-inner .figures {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(20px);
}
.figure {
  background: rgba(11, 16, 32, 0.55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 18px;
  min-width: 110px;
  text-align: center;
}
.figure .val { display: block; font-size: 24px; font-weight: 900; color: var(--slide-accent, var(--accent)); }
.figure .lab { display: block; font-size: 11.5px; color: #cbd5e1; margin-top: 4px; line-height: 1.3; }

.quote {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 14px 20px;
  font-style: italic;
  color: #f6ecd6;
  font-size: 14px;
  line-height: 1.55;
}
.quote .author { display: block; margin-top: 7px; font-style: normal; font-size: 12px; color: #cbd5e1; }
.hero-quote {
  max-width: 620px;
  margin: 0 auto;
  text-align: left;
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(20px);
  /* ограничиваем высоту — не больше 3 строк */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  /* градиент снизу, чтобы обрезанный текст не выглядел резко */
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 60%, transparent 100%);
}
/* на маленьких высотах экрана цитату убираем совсем */
@media (max-height: 680px) { .hero-quote { display: none; } }

/* подсказка прокрутки */
.scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #fff;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}
.scroll-hint .chev { font-size: 24px; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }

/* --- ДЕТАЛЬНАЯ ПАНЕЛЬ (открывается прокруткой вниз) --- */
.slide-detail {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, #0b1020 0%, #0d1426 100%);
  border-top: 3px solid var(--slide-accent, var(--accent));
  padding: 56px 5vw 120px;
  min-height: 100%;
  scroll-snap-align: start;
}
.detail-inner { max-width: 860px; margin: 0 auto; }
.detail-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.detail-head .icon-big { font-size: 42px; }
.detail-head .d-date {
  color: var(--slide-accent, var(--accent));
  font-weight: 800;
  letter-spacing: 1px;
  font-size: 14px;
  text-transform: uppercase;
}
.detail-title {
  font-size: clamp(22px, 3.6vw, 36px);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 32px;
}

.detail-section {
  margin-bottom: 26px;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--slide-accent, var(--accent));
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.detail-section.in { opacity: 1; transform: none; }
.detail-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  color: var(--slide-accent, var(--accent));
  margin-bottom: 10px;
}
.detail-section p { color: #dbe2ee; font-size: 15.5px; line-height: 1.78; margin-bottom: 10px; }
.detail-section ul { margin: 8px 0 8px 20px; }
.detail-section li { color: #dbe2ee; font-size: 15px; line-height: 1.6; margin-bottom: 7px; }
.detail-section.sources-sec li { font-size: 13.5px; color: var(--text-dim); }
.detail-nav { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

/* Анимация появления контента обложки */
.slide.active .badge-row  { animation: rise 0.55s var(--ease) 0.05s forwards; }
.slide.active h2          { animation: rise 0.55s var(--ease) 0.14s forwards; }
.slide.active .lead-short { animation: rise 0.55s var(--ease) 0.22s forwards; }
.slide.active .slide-inner .figures { animation: rise 0.55s var(--ease) 0.30s forwards; }
.slide.active .hero-quote { animation: rise 0.55s var(--ease) 0.38s forwards; }
.slide.active .scroll-hint { animation: rise 0.6s var(--ease) 0.8s forwards; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

.icon-big { animation: float 3.5s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Управление слайдером */
.viewer-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  z-index: 20;
}
.counter {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  background: rgba(11, 16, 32, 0.6);
  backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.viewer-top .top-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(11, 16, 32, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.icon-btn:hover { background: var(--accent); color: #1a1206; transform: scale(1.08); }

.arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(11, 16, 32, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 26px;
  cursor: pointer;
  z-index: 20;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s var(--ease);
}
.arrow:hover { background: var(--accent); color: #1a1206; }
.arrow.left { left: 18px; }
.arrow.right { right: 18px; }
.arrow:disabled { opacity: 0.25; cursor: default; }

.progress-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  gap: 6px;
  padding: 16px 20px;
  z-index: 20;
  background: linear-gradient(0deg, rgba(11, 16, 32, 0.8), transparent);
}
.dot {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: background 0.3s var(--ease), transform 0.2s var(--ease);
}
.dot:hover { transform: scaleY(1.6); }
.dot.done { background: rgba(245, 158, 11, 0.5); }
.dot.current { background: var(--accent); }

/* ==========================================================================
   КВИЗ (quiz.html)
   ========================================================================== */
.quiz-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}
.quiz-head { text-align: center; margin-bottom: 26px; }
.quiz-head h1 { font-size: clamp(26px, 5vw, 40px); font-weight: 900; margin-bottom: 8px; }
.quiz-head p { color: var(--text-dim); }

.qprogress {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 26px;
}
.qprogress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.4s var(--ease);
}

.qcard {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  animation: slideInRight 0.4s var(--ease);
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
.qcard.leaving { animation: slideOutLeft 0.3s var(--ease) forwards; }
@keyframes slideOutLeft {
  to { opacity: 0; transform: translateX(-40px); }
}

.qnum { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.qtext { font-size: 21px; font-weight: 700; margin-bottom: 22px; line-height: 1.4; }

.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  text-align: left;
  background: rgba(15, 23, 42, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 15px 18px;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  display: flex;
  align-items: center;
  gap: 12px;
}
.option .letter {
  width: 28px; height: 28px;
  flex: 0 0 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 800;
  font-size: 14px;
}
.option:hover:not(:disabled) { border-color: var(--accent); transform: translateX(4px); }
.option.correct { border-color: var(--accent-3); background: rgba(16, 185, 129, 0.15); animation: pulse 0.4s var(--ease); }
.option.wrong { border-color: var(--accent-2); background: rgba(239, 68, 68, 0.15); }
.option:disabled { cursor: default; }
@keyframes pulse {
  0% { transform: scale(1); } 50% { transform: scale(1.03); } 100% { transform: scale(1); }
}

.feedback {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14.5px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: none;
}
.feedback.show { display: block; animation: rise 0.4s var(--ease) forwards; opacity: 1; transform: none; }
.feedback b { color: var(--accent); }

.qcard .next-row { margin-top: 22px; display: flex; justify-content: flex-end; }

/* Итоговый экран */
.result {
  text-align: center;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 44px 30px;
  box-shadow: var(--shadow);
  animation: rise 0.5s var(--ease) forwards;
  opacity: 1; transform: none;
}
.result .score-ring {
  width: 180px; height: 180px;
  margin: 0 auto 24px;
  position: relative;
}
.result .score-ring svg { transform: rotate(-90deg); }
.result .score-ring .num {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.result .score-ring .num b { font-size: 44px; font-weight: 900; }
.result .score-ring .num span { font-size: 13px; color: var(--text-dim); }
.result h2 { font-size: 28px; margin-bottom: 10px; }
.result .verdict { color: var(--text-dim); margin-bottom: 26px; font-size: 17px; }
.result .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.confetti-piece {
  position: fixed;
  width: 10px; height: 14px;
  top: -20px;
  z-index: 999;
  pointer-events: none;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.9; }
}

/* ==========================================================================
   ИГРА (game.html)
   ========================================================================== */
.game-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 30px 16px 60px;
  text-align: center;
}
.game-wrap h1 { font-size: clamp(24px, 4vw, 36px); font-weight: 900; margin-bottom: 8px; }
.game-wrap p.sub { color: var(--text-dim); margin-bottom: 18px; }
.canvas-shell {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0 auto;
  max-width: 800px;
}
#game { display: block; width: 100%; height: auto; background: #87a5c9; }
.hud {
  position: absolute;
  top: 12px; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 16px;
  font-weight: 800;
  font-size: 15px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
  pointer-events: none;
}
.era-flash {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(22px, 5vw, 44px);
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 4px 20px rgba(0,0,0,0.6);
  opacity: 0;
  text-align: center;
  pointer-events: none;
}
.era-flash.show { animation: eraFlash 2s var(--ease) forwards; }
@keyframes eraFlash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); letter-spacing: 12px; }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1); letter-spacing: 2px; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.05); }
}
.game-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 11, 22, 0.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
}
.game-overlay.hidden { display: none; }
.game-overlay h2 { font-size: 28px; font-weight: 900; }
.game-overlay p { color: var(--text-dim); max-width: 420px; }
.game-controls-hint { margin-top: 16px; color: var(--text-dim); font-size: 13px; }

/* ==========================================================================
   ГЛАВНАЯ СТРАНИЦА: ЛЕВАЯ ПАНЕЛЬ СО СПИСКОМ СОБЫТИЙ
   ========================================================================== */

.page-layout {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

.events-sidebar {
  position: sticky;
  top: 60px;
  width: 260px;
  min-width: 220px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 0 28px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(7, 11, 22, 0.6);
  backdrop-filter: blur(10px);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
  flex-shrink: 0;
  align-self: stretch;
}
.events-sidebar::-webkit-scrollbar { width: 4px; }
.events-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 999px; }

.sidebar-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 6px;
}

.sidebar-events {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 16px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.35;
  border-left: 3px solid transparent;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.sidebar-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

/* цвет полоски по эпохе */
.sidebar-item.era-collapse { border-left-color: #8b8fa8; }
.sidebar-item.era-90s      { border-left-color: #d97706; }
.sidebar-item.era-2000s    { border-left-color: #f59e0b; }
.sidebar-item.era-2010s    { border-left-color: #ef4444; }
.sidebar-item.era-2022     { border-left-color: #dc2626; }

.sb-num {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.2);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  padding-top: 1px;
  min-width: 18px;
}
.sidebar-item:hover .sb-num { color: rgba(255,255,255,0.45); }

.sb-body { display: flex; flex-direction: column; gap: 2px; }
.sb-year { font-size: 10px; color: rgba(255,255,255,0.3); letter-spacing: 0.5px; }
.sidebar-item:hover .sb-year { color: rgba(255,255,255,0.55); }
.sb-title { font-size: 12.5px; }

/* Разделитель между эпохами */
.sidebar-events li:nth-child(8)  .sidebar-item,
.sidebar-events li:nth-child(13) .sidebar-item,
.sidebar-events li:nth-child(16) .sidebar-item,
.sidebar-events li:nth-child(22) .sidebar-item { border-top: 1px solid rgba(255,255,255,0.07); margin-top: 4px; padding-top: 13px; }

.page-main { flex: 1; min-width: 0; }

/* ----- Адаптив ----- */
@media (max-width: 1100px) {
  .events-sidebar { width: 200px; }
  .sb-title { font-size: 11.5px; }
}
@media (max-width: 760px) {
  .page-layout { flex-direction: column; }
  .events-sidebar { display: none; }
  .grid-4 { grid-template-columns: 1fr; }
  .slide { padding: 64px 18px 84px; }
  .arrow { width: 44px; height: 44px; font-size: 20px; }
  .arrow.left { left: 8px; } .arrow.right { right: 8px; }
  .topnav { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
