/* =========================================================
   ДиноЗемля — стили (яркие, детские, дружелюбные)
   ========================================================= */

:root {
  --c-bg: #fffbe9;
  --c-bg-2: #fff5d4;
  --c-primary: #ff7a3d;        /* оранжевый */
  --c-primary-dark: #e85d1f;
  --c-secondary: #4ec9b0;      /* мятный */
  --c-accent: #ffd84d;         /* солнце */
  --c-purple: #9b6bff;
  --c-pink: #ff7ab8;
  --c-green: #6ec24e;
  --c-blue: #5fbcf0;
  --c-text: #2d2640;
  --c-text-soft: #5a5470;
  --c-card: #ffffff;
  --c-shadow: rgba(45, 38, 64, 0.15);
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 10px;
  --shadow-card: 0 8px 24px rgba(45, 38, 64, 0.12);
  --shadow-pop: 0 14px 32px rgba(45, 38, 64, 0.22);
  --font: "Comic Sans MS", "Trebuchet MS", "Nunito", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-bg);
  scroll-behavior: smooth;
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; }

.hidden { display: none !important; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ----------- ССЫЛКА «ПЕРЕЙТИ К КОНТЕНТУ» (a11y) ----------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: #2d2640;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  z-index: 1000;
  font-weight: 700;
}
.skip-link:focus { left: 16px; outline: 3px solid var(--c-accent); }

/* ----------- ВВОДНЫЙ AEO-АБЗАЦ ----------- */
.intro-aeo { padding: 26px 0 0; position: relative; z-index: 2; }
.lead-paragraph {
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.6;
  color: var(--c-text);
  background: #fff;
  border-radius: var(--r-md);
  padding: 18px 22px;
  box-shadow: var(--shadow-card);
  border-left: 5px solid var(--c-primary);
  margin: 0;
}
.lead-paragraph strong { color: var(--c-primary-dark); }

/* ----------- ОБЛАКА НА ФОНЕ ----------- */
.clouds { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.cloud {
  position: absolute;
  font-size: 60px;
  opacity: 0.55;
  filter: blur(0.3px);
  animation: drift 40s linear infinite;
}
.cloud-1 { top: 8%;  left: -10%; animation-duration: 60s; }
.cloud-2 { top: 30%; left: -10%; font-size: 80px; animation-duration: 90s; animation-delay: -20s; opacity: 0.4; }
.cloud-3 { top: 70%; left: -10%; font-size: 50px; animation-duration: 75s; animation-delay: -50s; opacity: 0.35; }
@keyframes drift {
  from { transform: translateX(0); }
  to   { transform: translateX(120vw); }
}

/* ----------- ШАПКА (HERO) ----------- */
.hero {
  position: relative;
  background: linear-gradient(180deg, #ffd84d 0%, #ffb13d 45%, #ff8a52 100%);
  padding: 28px 20px 90px;
  overflow: hidden;
  z-index: 1;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 12% 20%, rgba(255,255,255,.25) 0 6px, transparent 7px),
    radial-gradient(circle at 80% 30%, rgba(255,255,255,.18) 0 4px, transparent 5px),
    radial-gradient(circle at 60% 70%, rgba(255,255,255,.2) 0 5px, transparent 6px),
    radial-gradient(circle at 25% 80%, rgba(255,255,255,.18) 0 5px, transparent 6px);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(36px, 6vw, 64px);
  margin: 0 0 12px;
  line-height: 1.05;
  text-shadow: 3px 3px 0 #ffffff66, 5px 5px 0 #00000010;
  color: #2d2640;
}
.title-emoji { display: inline-block; animation: wobble 2.4s ease-in-out infinite; }
.title-emoji:last-child { animation-delay: -1.2s; }
.title-accent {
  background: #ff5a3d;
  color: #fff;
  padding: 0 12px;
  border-radius: 14px;
  display: inline-block;
  transform: rotate(-3deg);
  box-shadow: 0 6px 0 #b03715;
}
@keyframes wobble {
  0%,100% { transform: rotate(-8deg) translateY(0); }
  50%     { transform: rotate(8deg)  translateY(-6px); }
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 22px);
  color: #2d2640;
  margin: 0 0 22px;
  font-weight: 600;
  max-width: 580px;
}

.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-art {
  position: relative;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dino-bounce, .dino-float {
  font-size: 140px;
  filter: drop-shadow(0 10px 0 rgba(0,0,0,0.15));
}
.dino-bounce {
  animation: bounce 1.6s ease-in-out infinite;
  position: relative;
  z-index: 2;
}
.dino-float {
  font-size: 110px;
  position: absolute;
  right: 0; top: 10%;
  animation: float 3.5s ease-in-out infinite;
  opacity: 0.95;
}
@keyframes bounce {
  0%,100% { transform: translateY(0) rotate(-3deg); }
  50%     { transform: translateY(-22px) rotate(3deg); }
}
@keyframes float {
  0%,100% { transform: translateY(0) rotate(-5deg); }
  50%     { transform: translateY(-14px) rotate(5deg); }
}

.hero-wave {
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 80px;
  z-index: 2;
}
.hero-wave svg { width: 100%; height: 100%; display: block; }

/* ----------- КНОПКИ ----------- */
.btn {
  border: none;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .3px;
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: #ff5a3d;
  color: #fff;
  box-shadow: 0 6px 0 #b03715, 0 8px 16px rgba(0,0,0,0.15);
}
.btn-primary:hover { background: #ff6e54; }
.btn-primary:active { box-shadow: 0 2px 0 #b03715; }

.btn-secondary {
  background: #fff;
  color: var(--c-text);
  box-shadow: 0 6px 0 #d0c8a8, 0 8px 16px rgba(0,0,0,0.1);
}
.btn-secondary:hover { background: #fff8e1; }

.btn-roar {
  background: linear-gradient(135deg, #ff5a3d 0%, #ff8a3d 100%);
  color: #fff;
  font-size: 22px;
  padding: 16px 30px;
  margin-top: 20px;
  width: 100%;
  box-shadow: 0 6px 0 #b03715, 0 10px 24px rgba(255,90,61,.35);
}
.btn-roar:active { animation: shake .35s ease; }
@keyframes shake {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-3px, 1px); }
  40% { transform: translate(3px, -1px); }
  60% { transform: translate(-2px, 2px); }
  80% { transform: translate(2px, -2px); }
}

.btn-tiny {
  background: #fff;
  border: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 18px;
  box-shadow: var(--shadow-card);
  transition: transform .2s ease;
}
.btn-tiny:hover { transform: rotate(180deg); }

/* ----------- ФАКТ ДНЯ ----------- */
.fact-of-day {
  position: relative;
  padding: 30px 0 10px;
  z-index: 3;
}
.fact-card {
  background: linear-gradient(135deg, #fff 0%, #fff8e1 100%);
  border: 3px dashed var(--c-accent);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-card);
}
.fact-icon {
  font-size: 48px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.15) rotate(8deg); }
}
.fact-content { flex: 1; }
.fact-content h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--c-primary-dark);
}
.fact-content p {
  margin: 0;
  font-size: 17px;
  color: var(--c-text);
  line-height: 1.45;
}

/* ----------- ЗАГОЛОВКИ СЕКЦИЙ ----------- */
.section-title {
  font-size: clamp(28px, 4vw, 40px);
  text-align: center;
  margin: 14px 0 8px;
  color: var(--c-text);
}
.section-sub {
  text-align: center;
  font-size: 17px;
  color: var(--c-text-soft);
  margin: 0 0 22px;
}

/* ----------- ПОИСК И ФИЛЬТРЫ ----------- */
.controls { padding: 32px 0 16px; }

.search-box {
  position: relative;
  max-width: 520px;
  margin: 18px auto 22px;
}
.search-icon {
  position: absolute;
  left: 18px; top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
}
#searchInput {
  width: 100%;
  padding: 16px 18px 16px 52px;
  font-size: 17px;
  border: 3px solid #ffd84d;
  border-radius: 999px;
  background: #fff;
  outline: none;
  font-family: inherit;
  box-shadow: var(--shadow-card);
  transition: border-color .2s ease, transform .2s ease;
}
#searchInput:focus { border-color: var(--c-primary); transform: scale(1.01); }

.filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}
.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}
.filter-label {
  font-weight: 700;
  color: var(--c-text-soft);
  margin-right: 4px;
}
.chip {
  border: none;
  background: #fff;
  color: var(--c-text);
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 3px 0 #e3dab8;
  transition: transform .1s, background .2s, color .2s, box-shadow .2s;
}
.chip:hover { transform: translateY(-2px); }
.chip.active {
  background: var(--c-primary);
  color: #fff;
  box-shadow: 0 3px 0 var(--c-primary-dark);
}

/* ----------- СЕТКА ДИНОЗАВРОВ ----------- */
.dinos-section { padding: 14px 0 50px; position: relative; z-index: 1; }

.dinos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

.dino-card {
  background: var(--c-card);
  border-radius: var(--r-lg);
  padding: 14px 14px 18px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease;
  position: relative;
  overflow: hidden;
  border: 4px solid transparent;
  animation: cardIn .5s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.dino-card:hover {
  transform: translateY(-8px) rotate(-1deg);
  box-shadow: var(--shadow-pop);
  border-color: var(--c-accent);
}
.dino-card:active { transform: translateY(-2px) scale(.98); }

.dino-card .card-illustration {
  background: var(--card-bg, #f5fbe9);
  border-radius: var(--r-md);
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
  position: relative;
}
.dino-card .card-illustration::after {
  content: "";
  position: absolute; inset: auto 0 0 0;
  height: 18px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.06));
}
.dino-card .card-illustration svg {
  width: 95%;
  height: 95%;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,0.12));
  transition: transform .35s ease;
}
.dino-card:hover .card-illustration svg { transform: translateY(-4px) scale(1.04); }

.dino-card .card-name {
  font-size: 19px;
  font-weight: 800;
  margin: 4px 0 6px;
  color: var(--c-text);
}
.dino-card .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f3eecc;
  color: var(--c-text);
}
.tag.diet-carnivore { background: #ffd9d0; color: #b53b1a; }
.tag.diet-herbivore { background: #d6f3c8; color: #2e6e1a; }
.tag.diet-omnivore  { background: #ffe6b8; color: #8a5a14; }
.tag.period         { background: #e3e0ff; color: #4d3aa8; }

.no-results {
  text-align: center;
  font-size: 22px;
  padding: 40px;
  color: var(--c-text-soft);
}

/* ----------- СРАВНЕНИЕ РАЗМЕРОВ ----------- */
.compare-section {
  background: linear-gradient(180deg, #fff5d4 0%, #ffe2b8 100%);
  padding: 50px 0;
  position: relative;
  z-index: 1;
}
.compare-stage {
  position: relative;
  height: 280px;
  margin: 30px auto 20px;
  max-width: 900px;
}
.ground {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 30px;
  background: linear-gradient(180deg, #b88a4f 0%, #8a5e2a 100%);
  border-radius: 8px;
  box-shadow: inset 0 4px 0 rgba(255,255,255,0.2);
}
.ground::before {
  content: "🌱 🌱   🌿   🌱  🪨   🌿  🌱   🌱";
  position: absolute;
  top: -22px; left: 0; right: 0;
  text-align: center;
  font-size: 18px;
  letter-spacing: 8px;
}
.kid-figure, .bus-figure, .dino-figure {
  position: absolute;
  bottom: 30px;
  text-align: center;
  font-weight: bold;
  transition: all 0.6s cubic-bezier(.34,1.56,.64,1);
}
.kid-figure {
  left: 6%;
  font-size: 50px;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,0.15));
}
.kid-figure::after {
  content: "Ты (1.3 м)";
  display: block;
  font-size: 12px;
  margin-top: 2px;
  color: var(--c-text-soft);
}
.bus-figure {
  left: 22%;
  font-size: 80px;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,0.15));
}
.bus-figure::after {
  content: "Автобус (10 м)";
  display: block;
  font-size: 12px;
  color: var(--c-text-soft);
}
.dino-figure {
  right: 6%;
  font-size: 100px;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,0.18));
  animation: dinoIdle 3s ease-in-out infinite;
}
@keyframes dinoIdle {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-6px); }
}

.compare-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.compare-controls label {
  font-weight: 700;
  font-size: 17px;
}
#compareSelect {
  padding: 12px 20px;
  font-size: 17px;
  border: 3px solid var(--c-primary);
  border-radius: 999px;
  background: #fff;
  font-family: inherit;
  cursor: pointer;
  font-weight: 700;
  outline: none;
  min-width: 240px;
}
.compare-info {
  background: #fff;
  padding: 14px 22px;
  border-radius: var(--r-md);
  font-size: 16px;
  font-weight: 600;
  box-shadow: var(--shadow-card);
  text-align: center;
  max-width: 600px;
}

/* ----------- ВИКТОРИНА ----------- */
.quiz-section { padding: 50px 0 70px; position: relative; z-index: 1; }

.quiz-card {
  background: linear-gradient(135deg, #9b6bff 0%, #5fbcf0 100%);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 26px;
  max-width: 720px;
  margin: 24px auto 0;
  box-shadow: 0 14px 40px rgba(155, 107, 255, 0.3);
  position: relative;
  overflow: hidden;
}
.quiz-card::before {
  content: "✨";
  position: absolute;
  top: 10px; right: 18px;
  font-size: 30px;
  animation: spin 8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.quiz-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 16px;
  font-size: 16px;
}
.quiz-question {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  margin: 0 0 22px;
  text-align: center;
  min-height: 60px;
}
.quiz-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.quiz-option {
  background: rgba(255,255,255,0.95);
  color: var(--c-text);
  border: none;
  padding: 16px 18px;
  border-radius: var(--r-md);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s;
  text-align: left;
  font-family: inherit;
}
.quiz-option:hover:not([disabled]) { transform: translateY(-3px); background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,0.15); }
.quiz-option.correct { background: #6ec24e; color: #fff; }
.quiz-option.wrong   { background: #ff5a5a; color: #fff; }
.quiz-option[disabled] { cursor: default; }

.quiz-footer { text-align: center; }

.quiz-explain {
  background: rgba(255,255,255,0.18);
  border-radius: var(--r-md);
  padding: 12px 16px;
  margin-bottom: 14px;
  text-align: center;
  font-size: 16px;
}

.quiz-final {
  text-align: center;
  padding: 10px;
}
.quiz-final h3 { margin: 0 0 8px; font-size: 28px; }
.quiz-final .stars { font-size: 50px; margin: 12px 0; }
/* Награда за викторину — золотая плашка под результатом */
.quiz-eggs-reward {
  display: inline-block;
  margin: 14px auto 0;
  padding: 10px 18px;
  background: linear-gradient(135deg, #fff5d4, #ffd84d);
  color: #6b4500;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(170, 105, 0, 0.25);
  animation: titlePop 0.5s cubic-bezier(.4, 1.6, .6, 1);
}

/* ----------- FAQ ----------- */
.faq-section {
  background: linear-gradient(180deg, #fffbe9 0%, #fff5d4 100%);
  padding: 50px 0 60px;
  position: relative;
  z-index: 1;
}
.faq-list {
  max-width: 800px;
  margin: 24px auto 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-item {
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  border: 3px solid transparent;
  transition: border-color .2s ease, transform .2s ease;
}
.faq-item[open] {
  border-color: var(--c-accent);
}
.faq-item:hover { transform: translateY(-2px); }

.faq-question {
  padding: 16px 22px;
  font-size: 18px;
  font-weight: 800;
  color: var(--c-text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: "▼";
  color: var(--c-primary);
  font-size: 14px;
  transition: transform .25s ease;
  flex-shrink: 0;
}
.faq-item[open] .faq-question::after { transform: rotate(180deg); }
.faq-question:hover { color: var(--c-primary-dark); }

.faq-answer {
  padding: 0 22px 18px;
  color: var(--c-text);
  font-size: 16px;
  line-height: 1.6;
  animation: faqOpen .3s ease;
}
.faq-answer p { margin: 0; }
.faq-answer strong { color: var(--c-primary-dark); }

@keyframes faqOpen {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ----------- ПОДВАЛ ----------- */
.footer {
  background: #2d2640;
  color: #fff;
  padding: 30px 0;
  text-align: center;
}
.footer p { margin: 6px 0; }
.footer a {
  color: #7ee8a2;
  text-decoration: none;
  border-bottom: 1px solid rgba(126, 232, 162, 0.4);
  transition: color 0.2s, border-color 0.2s;
}
.footer a:hover,
.footer a:focus-visible {
  color: #b8f5cc;
  border-bottom-color: #b8f5cc;
}
.footer-mini { color: #a8a0c0; font-size: 14px; }

/* ----------- МОДАЛКА ----------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(45, 38, 64, 0.55);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  background: #fff;
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
  animation: popIn .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.85) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 40px; height: 40px;
  border: none;
  border-radius: 50%;
  background: #fff5d4;
  font-size: 18px;
  font-weight: 800;
  color: var(--c-text);
  box-shadow: 0 3px 0 #d0c8a8;
  z-index: 2;
}
.modal-close:hover { background: var(--c-primary); color: #fff; box-shadow: 0 3px 0 var(--c-primary-dark); }

.modal-illustration {
  background: var(--modal-bg, #f5fbe9);
  border-radius: var(--r-md);
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.modal-illustration svg {
  width: 90%;
  height: 90%;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,0.12));
  animation: gentleBounce 2.2s ease-in-out infinite;
}
@keyframes gentleBounce {
  0%,100% { transform: translateY(0) rotate(-1deg); }
  50%     { transform: translateY(-6px) rotate(1deg); }
}

.modal-name {
  margin: 0 0 4px;
  font-size: 32px;
  color: var(--c-text);
}
.modal-pronounce {
  margin: 0 0 14px;
  color: var(--c-text-soft);
  font-style: italic;
  font-size: 16px;
}
.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.modal-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  background: #fff8e1;
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.stat-icon { font-size: 28px; }
.stat b {
  display: block;
  font-size: 17px;
  color: var(--c-text);
}
.stat span {
  display: block;
  font-size: 12px;
  color: var(--c-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-description {
  font-size: 17px;
  line-height: 1.55;
  margin: 0 0 18px;
  color: var(--c-text);
}
.modal-funfacts {
  background: #f5fbe9;
  border-radius: var(--r-md);
  padding: 16px 18px;
}
.modal-funfacts h4 {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--c-primary-dark);
}
.modal-funfacts ul {
  margin: 0;
  padding-left: 22px;
}
.modal-funfacts li {
  margin-bottom: 6px;
  font-size: 16px;
  line-height: 1.5;
}

/* ----------- АДАПТИВНОСТЬ ----------- */
@media (max-width: 800px) {
  .hero { padding-top: 18px; padding-bottom: 100px; }
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-buttons { justify-content: center; }
  .hero-art { height: 180px; order: -1; }
  .dino-bounce { font-size: 100px; }
  .dino-float { font-size: 80px; }

  .fact-card { flex-direction: column; text-align: center; }

  .filter-group { justify-content: center; }
  .filter-label { width: 100%; text-align: center; }

  .modal-stats { grid-template-columns: 1fr; }
  .modal-name { font-size: 26px; }

  .compare-stage { height: 220px; }
  .kid-figure { font-size: 36px; }
  .bus-figure { font-size: 60px; }
  .dino-figure { font-size: 70px; }
}

@media (max-width: 480px) {
  .dinos-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .dino-card { padding: 10px 10px 14px; }
  .dino-card .card-illustration { height: 130px; }
  .dino-card .card-name { font-size: 16px; }
  .tag { font-size: 11px; padding: 3px 8px; }
}

/* Уважение к настройкам motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   I18N: ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКА (top-right)
   ========================================================= */

.lang-switcher {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1100;
  font-family: var(--font);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 2px solid #fff;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(45, 38, 64, 0.18);
  font-weight: 700;
  font-size: 14px;
  color: var(--c-text);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.lang-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(45, 38, 64, 0.25);
  background: var(--c-accent);
}
.lang-toggle:active { transform: translateY(0); }
.lang-toggle:focus-visible { outline: 3px solid var(--c-primary); outline-offset: 2px; }

.lang-flag { font-size: 18px; line-height: 1; }
.lang-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-caret { font-size: 12px; opacity: 0.7; transition: transform 0.2s; }
.lang-toggle[aria-expanded="true"] .lang-caret { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: 0 14px 32px rgba(45, 38, 64, 0.25);
  min-width: 220px;
  max-height: 70vh;
  overflow-y: auto;
  border: 2px solid #fff5d4;
  animation: langFadeIn 0.18s ease-out;
}
.lang-menu[hidden] { display: none; }

@keyframes langFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lang-menu li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
.lang-menu li:hover,
.lang-menu li:focus { background: var(--c-bg-2); outline: none; }
.lang-menu li[aria-selected="true"] {
  background: var(--c-primary);
  color: #fff;
}
.lang-menu li .lang-flag { font-size: 18px; }

/* =========================================================
   I18N: RTL (для арабского, урду)
   ========================================================= */

html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .lang-switcher { right: auto; left: 14px; }
html[dir="rtl"] .lang-menu { right: auto; left: 0; }
html[dir="rtl"] .skip-link { left: auto; right: -9999px; }
html[dir="rtl"] .skip-link:focus { left: auto; right: 16px; }
html[dir="rtl"] .lead-paragraph { border-left: none; border-right: 5px solid var(--c-primary); }
html[dir="rtl"] .filter-label { margin-right: 0; }
html[dir="rtl"] .search-icon { left: auto; right: 14px; }
html[dir="rtl"] .search-box input { padding: 14px 48px 14px 18px; text-align: right; }
html[dir="rtl"] .modal-close { right: auto; left: 14px; }

/* Сжать меню на мобильных */
@media (max-width: 480px) {
  .lang-toggle { padding: 6px 10px; font-size: 13px; }
  .lang-name { max-width: 80px; }
  .lang-menu { min-width: 200px; }
}

/* =========================================================
   ОНБОРДИНГ: «Кто ты сегодня?»
   ========================================================= */

.onb-modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.3s ease;
}
.onb-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 122, 61, 0.85), rgba(155, 107, 255, 0.85));
  backdrop-filter: blur(6px);
}
.onb-card {
  position: relative;
  background: #fffbe9;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  padding: 28px 26px 24px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: popIn 0.45s cubic-bezier(.4, 1.6, .6, 1);
}
.onb-skip {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(45, 38, 64, 0.08);
  font-size: 18px;
  color: var(--c-text);
  z-index: 2;
  transition: background 0.2s, transform 0.2s;
}
.onb-skip:hover { background: rgba(45, 38, 64, 0.18); transform: rotate(90deg); }

.onb-title {
  margin: 0 0 6px;
  font-size: clamp(22px, 3.2vw, 30px);
  text-align: center;
  color: var(--c-primary-dark);
}
.onb-subtitle {
  margin: 0 0 20px;
  text-align: center;
  color: var(--c-text-soft);
  font-size: 15px;
}

.onb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 12px;
}
.onb-dino {
  background: #fff;
  border: 3px solid transparent;
  border-radius: var(--r-md);
  padding: 8px 6px 10px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.onb-dino:hover, .onb-dino:focus-visible {
  transform: translateY(-4px) scale(1.04);
  border-color: var(--c-primary);
  outline: none;
  box-shadow: var(--shadow-pop);
}
.onb-dino svg { width: 100%; height: 60px; }
.onb-dino-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
  margin-top: 4px;
  line-height: 1.2;
}

/* Шаг 2: имя и рык */
.onb-step-result { text-align: center; padding: 8px 4px; }
.onb-result-art {
  width: 180px;
  height: 130px;
  margin: 0 auto 4px;
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: gentleBounce 2.4s ease-in-out infinite;
}
.onb-result-art svg { width: 90%; height: 90%; }
.onb-greet {
  font-size: 17px;
  color: var(--c-text-soft);
  margin: 8px 0 2px;
}
.onb-result-name {
  margin: 0 0 4px;
  font-size: clamp(28px, 5vw, 40px);
  color: var(--c-primary-dark);
  animation: wobble 0.6s ease;
}
.onb-you-are {
  margin: 0 0 16px;
  font-size: 17px;
  color: var(--c-text);
}
.onb-result-species { color: var(--c-purple); }
.onb-roar-box {
  background: #fff;
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-card);
  max-width: 360px;
}
.onb-your-roar {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--c-text-soft);
}
.onb-roar-btn {
  display: inline-block;
  padding: 12px 22px;
  font-size: 17px;
}
.onb-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}
.btn-ghost {
  background: transparent;
  border: 2px solid var(--c-text-soft);
  color: var(--c-text);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-ghost:hover { background: var(--c-text); color: #fff; border-color: var(--c-text); }
.btn-shuffle {
  background: var(--c-accent);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 22px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s;
}
.btn-shuffle:hover { transform: rotate(360deg) scale(1.1); }

/* =========================================================
   ВИДЖЕТ «Я-ДИНОЗАВР» (top-left)
   ========================================================= */

.me-widget {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 90;
  display: flex;
  align-items: stretch;
  gap: 6px;
  animation: popIn 0.5s cubic-bezier(.4, 1.6, .6, 1);
}
.me-roar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  background: linear-gradient(135deg, var(--c-primary), #ff9a5e);
  color: #fff;
  border: none;
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.me-roar-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 16px 40px rgba(255, 122, 61, 0.4);
}
.me-roar-btn:active { animation: shake 0.4s ease; }
.me-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}
.me-avatar svg { width: 90%; height: 90%; }
.me-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  text-align: left;
}
.me-name {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.me-species {
  font-size: 11px;
  opacity: 0.92;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Бейдж «🥚 N» — коллекция золотых яиц игрока, накапливается между
   забегами и викторинами. Виден только если есть хотя бы 1 яйцо. */
.me-eggs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
  padding: 1px 8px;
  background: linear-gradient(135deg, #fff5d4, #ffd84d);
  color: #6b4500;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(170, 105, 0, 0.25);
}
.me-eggs.hidden { display: none; }
/* Реф-баннер «Тебя пригласил X! Получи N яиц» — золотая плашка
   над заголовком онбординга */
.onb-referral-banner {
  margin: -4px auto 14px;
  padding: 12px 18px;
  max-width: 480px;
  background: linear-gradient(135deg, #fff5d4, #ffd84d);
  color: #6b4500;
  border-radius: 16px;
  font-weight: 800;
  font-size: 15px;
  text-align: center;
  line-height: 1.35;
  box-shadow: 0 6px 22px rgba(170, 105, 0, 0.25);
  animation: titlePop 0.5s cubic-bezier(.4, 1.6, .6, 1);
}
.onb-referral-banner.hidden { display: none; }
.onb-referral-banner b, .onb-referral-banner strong {
  color: #5a2e00;
  background: #ffe89a;
  padding: 0 6px;
  border-radius: 8px;
}
/* Анимация пульсации при добавлении яиц — JS добавляет класс «pulse» */
.me-eggs.pulse { animation: eggPulse 0.6s cubic-bezier(.4, 1.6, .6, 1); }
@keyframes eggPulse {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.35); box-shadow: 0 0 18px rgba(255, 216, 77, 0.85); }
  100% { transform: scale(1); }
}
.me-roar-icon {
  font-size: 18px;
  margin-left: 4px;
  animation: pulse 1.6s ease-in-out infinite;
}
.me-roar-btn.is-roaring { animation: shake 0.5s ease; }

.me-change {
  width: 36px;
  height: 36px;
  align-self: center;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--c-text);
  box-shadow: var(--shadow-card);
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}
.me-change:hover { transform: rotate(180deg); background: var(--c-accent); }

/* =========================================================
   РОСТЕР: список всех динозавров
   ========================================================= */

.roster-section { padding: 8px 0 24px; }
.roster {
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.roster-summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #fff, #fff5d4);
  font-size: 18px;
  font-weight: 800;
  color: var(--c-text);
  user-select: none;
  transition: background 0.2s;
}
.roster-summary::-webkit-details-marker { display: none; }
.roster-summary:hover { background: linear-gradient(135deg, #fffbe9, #ffeab0); }
.roster-icon { font-size: 28px; animation: gentleBounce 3s ease-in-out infinite; }
.roster-title { flex: 1; }
.roster-count {
  background: var(--c-primary);
  color: #fff;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 14px;
  min-width: 32px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(255, 122, 61, 0.4);
}
.roster-caret {
  display: inline-block;
  font-size: 22px;
  color: var(--c-text-soft);
  transition: transform 0.3s;
}
.roster[open] .roster-caret { transform: rotate(180deg); }
.roster-hint {
  margin: 0;
  padding: 12px 22px 4px;
  font-size: 14px;
  color: var(--c-text-soft);
  background: #fff;
}
.roster-list {
  list-style: none;
  margin: 0;
  padding: 12px 18px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  background: #fff;
  animation: faqOpen 0.4s ease;
}
.roster-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--c-bg);
  border-radius: var(--r-md);
  transition: transform 0.2s, background 0.2s;
}
.roster-item:hover { transform: translateY(-2px); background: var(--c-bg-2); }
.roster-thumb {
  width: 56px;
  height: 44px;
  flex-shrink: 0;
  background: #fff;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(45, 38, 64, 0.1);
}
.roster-thumb svg { width: 100%; height: 100%; }
.roster-name {
  flex: 1;
  font-weight: 700;
  font-size: 14px;
  color: var(--c-text);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.roster-roar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--c-primary);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 2px 8px rgba(255, 122, 61, 0.4);
  font-family: inherit;
}
.roster-roar-btn:hover { background: var(--c-primary-dark); transform: scale(1.1); }
.roster-roar-btn:active { animation: shake 0.35s ease; }

/* =========================================================
   ЖИВАЯ ЛЕНТА РЫКОВ (sticky bottom-right)
   ========================================================= */

.live-feed {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  z-index: 95;
  font-family: inherit;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.live-feed.collapsed .live-body { display: none; }
.live-feed.collapsed { width: auto; }
.live-feed.collapsed .live-title { display: inline; }
.live-feed.collapsed .live-count { display: inline-flex; }
.live-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(135deg, #2d2640, #4a3d6b);
  color: #fff;
  border: none;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.live-header:hover { background: linear-gradient(135deg, #3a304f, #5a4d7d); }
.live-dot {
  width: 10px;
  height: 10px;
  background: #ff4d6b;
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(255, 77, 107, 0.6);
}
.live-title {
  flex: 1;
  text-align: left;
  font-size: 14px;
}
.live-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 2px 8px;
  background: var(--c-accent);
  color: var(--c-text);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.live-caret {
  font-size: 16px;
  transition: transform 0.3s;
}
.live-feed.collapsed .live-caret { transform: rotate(180deg); }

.live-body { background: #fff; }
.live-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(45, 38, 64, 0.08);
  font-size: 13px;
  color: var(--c-text-soft);
}
.live-mute {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--c-bg);
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
}
.live-mute:hover { background: var(--c-bg-2); transform: scale(1.1); }
.live-mute.muted { background: #ffd6d6; }
.live-hint { flex: 1; }
.live-list {
  list-style: none;
  margin: 0;
  padding: 6px 8px 10px;
  max-height: 280px;
  overflow-y: auto;
}
.live-list::-webkit-scrollbar { width: 6px; }
.live-list::-webkit-scrollbar-thumb { background: rgba(45, 38, 64, 0.2); border-radius: 6px; }
.live-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  line-height: 1.3;
  margin-bottom: 4px;
  background: var(--c-bg);
  animation: cardIn 0.4s ease;
}
.live-item.is-me { background: linear-gradient(135deg, #fff5d4, #ffeab0); }
.live-item-art {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.live-item-art svg { width: 100%; height: 100%; }
.live-item-text {
  flex: 1;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-item-text b { color: var(--c-primary-dark); }
.live-item-time {
  font-size: 11px;
  color: var(--c-text-soft);
  flex-shrink: 0;
}

/* =========================================================
   RTL для новых блоков
   ========================================================= */

html[dir="rtl"] .me-widget { left: auto; right: 14px; }
html[dir="rtl"] .lang-switcher { right: auto; left: 14px; }
html[dir="rtl"] .me-info { text-align: right; align-items: flex-end; }
html[dir="rtl"] .live-feed { right: auto; left: 16px; }
html[dir="rtl"] .live-title { text-align: right; }
html[dir="rtl"] .onb-skip { right: auto; left: 14px; }

/* =========================================================
   Мобильные адаптации
   ========================================================= */

@media (max-width: 640px) {
  .me-widget { top: 10px; left: 10px; }
  .me-name, .me-species { max-width: 90px; }
  .me-avatar { width: 36px; height: 36px; }
  .me-roar-btn { padding: 6px 10px 6px 6px; gap: 6px; }
  .me-change { width: 30px; height: 30px; font-size: 14px; }

  .live-feed { width: 280px; bottom: 10px; right: 10px; }
  html[dir="rtl"] .live-feed { left: 10px; right: auto; }
  .roster-list { grid-template-columns: 1fr; }
  .onb-card { padding: 22px 16px 18px; }
  .onb-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
  .onb-dino svg { height: 50px; }
  .onb-dino-name { font-size: 12px; }
  .onb-result-art { width: 140px; height: 100px; }
}

@media (max-width: 380px) {
  /* iPhone SE 2/3 (375), Galaxy S8 — поджимаем имя/вид жёстче, но
     оставляем их видимыми. Бейдж «🥚 N» — обязательно виден. */
  .me-name, .me-species { max-width: 70px; font-size: 12px; }
  .me-name { font-size: 13px; }
  .live-feed { width: calc(100vw - 20px); }
}

@media (max-width: 340px) {
  /* Совсем узкие экраны (iPhone SE 1, старые Android < 360px).
     Здесь места реально нет — прячем имя и вид, но бейдж яиц
     оставляем: это ключевой гамификационный элемент. */
  .me-name, .me-species { display: none; }
  .me-info { gap: 0; }
}

/* =========================================================
   ИГРА: «Беги, динозавр!»
   ========================================================= */

.game-section {
  padding: 50px 0 60px;
  position: relative;
  z-index: 1;
}
.btn-game {
  background: linear-gradient(135deg, #9b6bff, #c997ff);
  color: #fff;
  border: none;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 17px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(155, 107, 255, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: 0.5px;
}
.btn-game:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 28px rgba(155, 107, 255, 0.55);
}
.btn-game:active { transform: translateY(0) scale(0.98); }

.game-wrap {
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  max-width: 920px;
  margin: 0 auto;
}

.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: linear-gradient(135deg, #2d2640, #4a3d6b);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  gap: 12px;
}
.hud-left, .hud-right { flex: 1; }
.hud-right { text-align: right; }
.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}
.hud-score {
  font-size: 28px;
  font-weight: 900;
  color: var(--c-accent);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  font-variant-numeric: tabular-nums;
}
.hud-best {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 2px;
}
/* Маленькая «🔄» кнопка под значением рекорда — сбрасывает best.
   Показывается только когда best > 0 (управляется через .hidden из JS). */
.hud-reset-btn {
  margin-top: 4px;
  padding: 2px 10px;
  background: rgba(255, 255, 255, 0.15);
  color: #ffd84d;
  border: 1px solid rgba(255, 216, 77, 0.45);
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.hud-reset-btn:hover { background: rgba(255, 216, 77, 0.25); transform: scale(1.08); }
.hud-reset-btn:active { transform: scale(0.92); }
.hud-reset-btn.hidden { display: none; }
.hud-name {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 14px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hud-eggs {
  background: rgba(255, 216, 77, 0.25);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.game-stage {
  position: relative;
  width: 100%;
  background: linear-gradient(to bottom, #b8e8ff 0%, #d4f1ff 60%, #e8f8ff 100%);
  overflow: hidden;
  border-bottom: 4px solid #6ec24e;
}
#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 900 / 320;
  image-rendering: -webkit-optimize-contrast;
  touch-action: manipulation;
}

.game-overlay {
  position: absolute;
  inset: 0;
  background: rgba(45, 38, 64, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}
.game-overlay.hidden { display: none; }
.game-overlay-card {
  background: #fffbe9;
  border-radius: var(--r-md);
  padding: 22px 28px;
  text-align: center;
  box-shadow: var(--shadow-pop);
  max-width: 380px;
  width: 100%;
  animation: popIn 0.4s cubic-bezier(.4, 1.6, .6, 1);
}
.game-overlay-card h3 {
  margin: 0 0 8px;
  font-size: clamp(20px, 3vw, 26px);
  color: var(--c-primary-dark);
}
.game-overlay-card p {
  margin: 0 0 14px;
  color: var(--c-text-soft);
  font-size: 15px;
  line-height: 1.4;
}
.game-overlay-stats {
  margin: 8px 0 14px;
  padding: 12px;
  background: #fff;
  border-radius: var(--r-sm);
  font-size: 15px;
  color: var(--c-text);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.game-overlay-stats .new-best {
  color: var(--c-primary-dark);
  font-weight: 800;
  margin-top: 4px;
  animation: wobble 0.6s ease;
}

.game-pause-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.8);
  color: var(--c-text);
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  z-index: 5;
  box-shadow: var(--shadow-card);
  transition: background 0.2s, transform 0.2s;
}
.game-pause-btn:hover { background: #fff; transform: scale(1.1); }

.game-jump-btn {
  display: none;
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.7);
  background: linear-gradient(135deg, var(--c-primary), #ff9a5e);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  font-family: inherit;
  z-index: 4;
  box-shadow: 0 6px 18px rgba(255, 122, 61, 0.5);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s;
}
.game-jump-btn:active { transform: scale(0.92); }

.game-hint {
  margin: 0;
  padding: 10px 18px 14px;
  font-size: 13px;
  color: var(--c-text-soft);
  text-align: center;
}
.game-hint kbd {
  display: inline-block;
  padding: 1px 8px;
  background: var(--c-bg);
  border-radius: 4px;
  border: 1px solid rgba(45, 38, 64, 0.15);
  font-size: 12px;
  font-family: var(--font);
}

/* На сенсорных устройствах показываем кнопку прыжка */
@media (hover: none) and (pointer: coarse) {
  .game-jump-btn { display: flex; align-items: center; justify-content: center; }
}

/* RTL */
html[dir="rtl"] .hud-left { text-align: right; }
html[dir="rtl"] .hud-right { text-align: left; }
html[dir="rtl"] .game-pause-btn { right: auto; left: 10px; }
html[dir="rtl"] .game-jump-btn { right: auto; left: 14px; }

/* Мобильные */
@media (max-width: 640px) {
  .game-hud { padding: 10px 12px; font-size: 14px; gap: 8px; }
  .hud-score { font-size: 22px; }
  .hud-name { max-width: 110px; font-size: 13px; padding: 3px 10px; }
  .hud-eggs { padding: 3px 10px; font-size: 13px; }
  .game-overlay-card { padding: 18px 18px; }
}

/* =========================================================
   ТИТУЛ В ВИДЖЕТЕ «Я-ДИНОЗАВР»
   ========================================================= */
.me-title-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ffd84d, #ffb13d);
  color: #6b4500;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2px;
  margin-right: 4px;
  text-transform: uppercase;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
  vertical-align: 1px;
  animation: titlePop 0.6s cubic-bezier(.4, 1.6, .6, 1);
}
@keyframes titlePop {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

/* =========================================================
   КНОПКА ПОДЕЛИТЬСЯ + БЛОК ТИТУЛА В OVERLAY ИГРЫ
   ========================================================= */
.title-earned-row {
  margin-top: 6px;
  padding: 8px 10px;
  background: linear-gradient(135deg, #fff5d4, #ffe4a3);
  border-radius: var(--r-sm);
  font-size: 14px;
  color: #6b4500;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  animation: titleRowPop 0.6s cubic-bezier(.4, 1.6, .6, 1);
}
.title-earned-label { font-size: 12px; opacity: 0.85; font-weight: 600; }
.title-earned-name {
  font-size: 18px;
  color: #b03715;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
@keyframes titleRowPop {
  0%   { transform: translateY(-8px) scale(0.8); opacity: 0; }
  60%  { transform: translateY(0) scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}

.btn-share-record {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 8px 0 0;
  padding: 10px 18px;
  background: linear-gradient(135deg, #4ec9b0 0%, #6bd9c2 100%);
  color: #0e3f37;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 5px 0 #2a8a78, 0 8px 16px rgba(78, 201, 176, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-share-record:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #2a8a78, 0 12px 22px rgba(78, 201, 176, 0.5); }
.btn-share-record:active { transform: translateY(2px); box-shadow: 0 2px 0 #2a8a78; }

/* =========================================================
   МОДАЛКА «ПОДЕЛИТЬСЯ РЕКОРДОМ»
   ========================================================= */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.25s ease;
}
.share-modal.hidden { display: none; }
.share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 38, 64, 0.78);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.share-modal-card {
  position: relative;
  background: var(--c-bg);
  border-radius: var(--r-lg);
  padding: 22px 22px 18px;
  max-width: 460px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-pop);
  animation: popIn 0.4s cubic-bezier(.4, 1.6, .6, 1);
  text-align: center;
}
.share-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--c-text);
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 3px 0 #d0c8a8;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.share-close:hover { background: var(--c-primary); color: #fff; box-shadow: 0 3px 0 var(--c-primary-dark); }
.share-modal-h {
  margin: 0 0 6px;
  font-size: clamp(20px, 3vw, 24px);
  color: var(--c-primary-dark);
}
.share-modal-sub {
  margin: 0 0 14px;
  color: var(--c-text-soft);
  font-size: 14px;
  line-height: 1.4;
}
.share-card-preview {
  display: flex;
  justify-content: center;
  margin: 0 auto 10px;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: #fff;
}
.share-card-preview canvas {
  display: block;
  /* Карточка 9:16 для Instagram Stories и TikTok.
     Размер ограничен по высоте, ширина считается через aspect-ratio. */
  width: auto;
  height: clamp(320px, 52vh, 480px);
  aspect-ratio: 9 / 16;
  image-rendering: -webkit-optimize-contrast;
}
.share-card-preview video {
  display: block;
  width: auto;
  height: clamp(320px, 52vh, 480px);
  aspect-ratio: 9 / 16;
  background: #fff;
  object-fit: cover;
}
.share-social-hint {
  margin: 0 0 12px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #fff5d4, #ffe4a3);
  border-radius: var(--r-sm);
  font-size: 13px;
  line-height: 1.4;
  color: #6b4500;
  text-align: center;
}
.share-social-hint b { color: #b03715; }
.share-media-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  margin: 0 0 10px;
}
.share-media-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-text-soft);
}
.share-media-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: #f3f0ff;
  border: 1px solid #ddd4ff;
}
.share-media-btn {
  border: none;
  background: transparent;
  color: #4a3d6b;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}
.share-media-btn:hover { transform: translateY(-1px); }
.share-media-btn.is-active {
  background: linear-gradient(135deg, #8f73ff, #6e4dff);
  color: #fff;
  box-shadow: 0 3px 10px rgba(111, 77, 255, 0.35);
}
.share-media-btn[disabled] {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
}
.share-btn {
  font-size: 14px;
  padding: 10px 16px;
  flex: 1 1 auto;
  min-width: 130px;
  white-space: nowrap;
}
.share-tip {
  margin: 4px auto 8px;
  padding: 6px 14px;
  display: inline-block;
  background: #d4f3e8;
  color: #1d6e57;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  animation: titlePop 0.4s cubic-bezier(.4, 1.6, .6, 1);
}

/* Плавающий тост-уведомление поверх страницы — для подтверждения
   действий (лайк, установка PWA, сброс рекорда), когда шер-модалка
   закрыта. Появляется снизу по центру и сам пропадает через 2.8 сек. */
.floating-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 350;
  padding: 12px 22px;
  background: linear-gradient(135deg, #2d2640, #4a3d6b);
  color: #fff;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 8px 28px rgba(45, 38, 64, 0.35);
  animation: toastIn 0.35s cubic-bezier(.4, 1.6, .6, 1);
  max-width: calc(100vw - 40px);
  text-align: center;
  pointer-events: none;
}
.floating-toast.hidden { display: none; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@media (max-width: 640px) {
  .floating-toast { font-size: 14px; padding: 10px 18px; bottom: 20px; }
}
.share-link-row {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--c-text-soft);
}
.share-link-row a {
  color: var(--c-primary-dark);
  text-decoration: none;
  font-weight: 700;
  word-break: break-all;
}
.share-link-row a:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .share-modal-card { padding: 18px 14px 14px; }
  .share-card-preview canvas { height: clamp(280px, 44vh, 380px); }
  .share-card-preview video { height: clamp(280px, 44vh, 380px); }
  .share-social-hint { font-size: 12px; padding: 6px 10px; }
  .share-media-picker { justify-content: stretch; }
  .share-media-label { width: 100%; text-align: center; }
  .share-media-toggle { width: 100%; }
  .share-media-btn { flex: 1 1 50%; text-align: center; }
  .share-btn { font-size: 13px; padding: 9px 12px; min-width: 110px; }
}

/* RTL */
html[dir="rtl"] .share-close { right: auto; left: 10px; }

/* =========================================================
   СОЦ-ПАНЕЛЬ: лайк / поделиться / установить
   ========================================================= */
.social-bar-section {
  padding: 28px 0 36px;
  position: relative;
  z-index: 1;
}
.social-bar-card {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border: 3px dashed var(--c-accent);
  position: relative;
  overflow: hidden;
}
.social-bar-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255, 216, 77, 0.45), transparent 70%);
  pointer-events: none;
}
.social-bar-text { flex: 1 1 280px; min-width: 0; }
.social-bar-h {
  margin: 0 0 4px;
  font-size: clamp(20px, 2.4vw, 26px);
  color: var(--c-primary-dark);
}
.social-bar-sub {
  margin: 0;
  font-size: 15px;
  color: var(--c-text-soft);
  line-height: 1.4;
}
.social-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 0 0 auto;
}
.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  color: #fff;
  font-size: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.2s;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.18), 0 8px 16px rgba(0, 0, 0, 0.12);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.social-btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 rgba(0, 0, 0, 0.18), 0 12px 22px rgba(0, 0, 0, 0.18); }
.social-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.social-btn-icon {
  font-size: 22px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(.4, 1.6, .6, 1);
}
.social-btn-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  text-align: left;
}
.social-btn-count {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.3px;
}
.social-btn-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.92;
  font-weight: 700;
}
html[dir="rtl"] .social-btn-stack { text-align: right; }

/* Лайк — красный градиент. Когда liked — добавляет анимацию пульса. */
.social-like {
  background: linear-gradient(135deg, #ff5a8c 0%, #ff3d6b 100%);
}
.social-like.liked .social-btn-icon { animation: heartPop 0.6s cubic-bezier(.4, 1.6, .6, 1); }
@keyframes heartPop {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.6); }
  60%  { transform: scale(0.85); }
  100% { transform: scale(1); }
}
.social-like.liked .social-btn-icon::after {
  content: "";
}

/* Поделиться — мятный */
.social-share-site {
  background: linear-gradient(135deg, #4ec9b0 0%, #3aaf95 100%);
}

/* Установить (PWA) — фиолетовый */
.social-subscribe {
  background: linear-gradient(135deg, #9b6bff 0%, #7d4dff 100%);
}
.social-subscribe.subscribed {
  background: linear-gradient(135deg, #6ec24e 0%, #4f8d44 100%);
}

/* Летающие сердечки при клике лайка */
.heart-burst {
  position: fixed;
  font-size: 32px;
  pointer-events: none;
  z-index: 250;
  user-select: none;
}

@media (max-width: 640px) {
  .social-bar-card { padding: 18px 16px; gap: 14px; flex-direction: column; align-items: stretch; text-align: center; }
  .social-bar-actions { justify-content: center; }
  .social-btn { padding: 9px 14px 9px 10px; font-size: 13px; }
  .social-btn-icon { width: 32px; height: 32px; font-size: 19px; }
  .social-btn-stack { text-align: center; }
}

/* =========================================================
   МОДАЛКА «УСТАНОВИТЬ КАК ПРИЛОЖЕНИЕ» (PWA)
   ========================================================= */
.install-modal {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.25s ease;
}
.install-modal.hidden { display: none; }
.install-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 38, 64, 0.78);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.install-modal-card {
  position: relative;
  background: var(--c-bg);
  border-radius: var(--r-lg);
  padding: 26px 24px 22px;
  max-width: 460px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-pop);
  animation: popIn 0.4s cubic-bezier(.4, 1.6, .6, 1);
  text-align: center;
}
.install-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--c-text);
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 3px 0 #d0c8a8;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.install-close:hover { background: var(--c-primary); color: #fff; box-shadow: 0 3px 0 var(--c-primary-dark); }
html[dir="rtl"] .install-close { right: auto; left: 10px; }
.install-modal-art {
  font-size: 72px;
  margin: 4px 0 6px;
  animation: bounce 1.6s ease-in-out infinite;
}
.install-modal-h {
  margin: 0 0 8px;
  font-size: clamp(20px, 3vw, 24px);
  color: var(--c-primary-dark);
}
.install-modal-sub {
  margin: 0 0 16px;
  color: var(--c-text-soft);
  font-size: 14px;
  line-height: 1.45;
}
.install-steps {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.install-step {
  background: #fff;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 14px;
  line-height: 1.4;
  border-left: 4px solid var(--c-purple);
  box-shadow: 0 2px 6px rgba(45, 38, 64, 0.08);
}
html[dir="rtl"] .install-step { border-left: none; border-right: 4px solid var(--c-purple); text-align: right; }
.install-step:nth-child(2) { border-color: var(--c-secondary); }
.install-step:nth-child(3) { border-color: var(--c-accent); }
.install-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.install-actions .btn { font-size: 14px; padding: 10px 18px; }
