/* ===========================
   ОСНОВНЫЕ НАСТРОЙКИ ТЕМЫ
   =========================== */

:root {
  --bg: #f7f7f7;              /* фоновый */
  --card-bg: #ffffff;          /* карточки */
  --border: #d6d6d6;           /* светлая граница */
  --text: #222222;             /* основной текст */
  --text-light: #666666;       /* вторичный текст */
  --tile-shadow: rgba(0,0,0,0.1);
  --tile-shadow-active: rgba(0,0,0,0.18);

  --accent1: #3b82f6;
  --accent2: #14b8a6;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  justify-content: center;
}

.app {
  width: 100%;
  max-width: 480px;
  padding: 16px;
}

/* ===========================
   КАРТОЧКИ
   =========================== */

.card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 18px 16px 12px;   /* меньше отступ снизу */
  /* min-height: calc(100vh - 32px);  ← убираем, чтобы карта не тянулась на весь экран */
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  animation: card-in 0.35s ease;
}


@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===========================
   ТЕКСТ
   =========================== */

.stage-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-light);
  margin-bottom: 4px;
}

.page-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
}

.fact {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f1f1f1;
  border: 1px dashed var(--border);
  font-size: 14px;
}

.note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-light);
}

/* ===========================
   ПЛИТКИ
   =========================== */

.tiles {
  /* чуть отступ сверху и снизу, центрируем блок */
  margin: 16px auto 8px;

  /* больше НЕ растягиваем контейнер по высоте */
  /* flex: 1;  <-- убираем */

  display: grid;

  /* 4 карточки в ряд */
  grid-template-columns: repeat(4, minmax(0, 1fr));

  /* убираем растягивание рядов по высоте */
  /* строки будут по высоте самих карточек */
  /* grid-auto-rows: minmax(110px, 1fr);  <-- убираем */

  /* отдельно задаём горизонтальный и вертикальный зазор */
  column-gap: 12px;
  row-gap: 8px; /* ↓ меньше расстояние между рядами */

  transition: opacity .25s ease, transform .25s ease;

  /* уменьшаем «окно» с карточками */
  width: 100%;
  max-width: 420px;  /* можно 400–460, подбери по вкусу */
}





.tiles.fade-out {
  opacity: 0;
  transform: scale(.97);
}
.tiles.fade-in {
  opacity: 1;
  transform: scale(1);
}

.tile {
  position: relative;
  border-radius: 0;
  cursor: pointer;
  box-shadow: 0 6px 14px var(--tile-shadow);
  transition: transform .1s ease, box-shadow .1s ease, opacity .2s ease;
  overflow: hidden;

  /* вытянутая карточка 5×7 */
  aspect-ratio: 5 / 7;
}



/* Плитка выбрана – чуть сжалась и потухла */
.tile-selected {
  opacity: 0;
  transform: scale(.95);
}

/* Плитка «исчезла», но сохраняет место в сетке */
.tile-hidden {
  visibility: hidden;
  pointer-events: none;
}


.tile:active {
  transform: scale(.97);
  box-shadow: 0 4px 10px var(--tile-shadow-active);
}

.tile-inner {
  position: absolute;
  top: 0;      /* вместо inset: 0; */
  right: 0;
  bottom: 0;
  left: 0;
}

/* ===========================
   ПРОГРЕСС
   =========================== */

.progress {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar {
  flex: 1;
  height: 4px;
  border-radius: 500px;
  background: #e5e7eb;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  transition: width .2s ease;
}

/* ===========================
   КНОПКИ
   =========================== */

.btn {
  margin-top: 16px;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: white;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 10px 24px rgba(16,185,129,0.3);
  transition: transform .12s ease, box-shadow .12s ease;
}

.btn:active {
  transform: translateY(1px) scale(.98);
  box-shadow: 0 4px 14px rgba(16,185,129,0.3);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

/* ===========================
   РЕЗУЛЬТАТ
   =========================== */

.result-summary {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text);
}

.result-pairs {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-pair-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fafafa;
  border: 1px solid var(--border);
}

.result-pair-title {
  font-size: 14px;
  font-weight: 600;
}

.result-pair-colors {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.easter-egg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    text-align: center;
  }

  .easter-egg-name {
    color: #ffffff;
    font-size: clamp(48px, 9vw, 80px); /* КРУПНО */
    font-weight: 800;
    letter-spacing: 3px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.9);
    margin-bottom: 16px;
  }

  .easter-egg-hint {
    color: #ffffffaa;
    font-size: 14px;
    margin-top: 8px;
  }

  .easter-egg-heart {
    position: absolute;
    bottom: -80px;
    left: 50%;                 /* по центру экрана */
    transform: translateX(-50%);
    font-size: 56px;           /* крупные сердца */
    user-select: none;
    animation: easter-heart-float 5s ease-out forwards;
  }

  @keyframes easter-heart-float {
    0% {
      transform: translate(-50%, 0) scale(1);
      opacity: 1;
    }
    100% {
      transform: translate(-50%, -120vh) scale(1.4);
      opacity: 0;
    }
  }
