@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

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

html {
  font-size: 16px;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);    
  color: #374151;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

.min-h-screen {
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* === Цвета === */
.text-indigo-600 { color: #4f46e5; }
.text-purple-600 { color: #9333ea; }
.text-orange-600 { color: #ea580c; }
.text-red-600 { color: #dc2626; }
.text-green-600 { color: #16a34a; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }

.bg-white { background-color: #ffffff; }
.bg-indigo-600 { background-color: #4f46e5; }
.bg-purple-600 { background-color: #9333ea; }
.bg-orange-600 { background-color: #ea580c; }
.bg-red-600 { background-color: #dc2626; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-green-50 { background-color: #f0fdf4; }

/* === Радиусы === */
.rounded {
  border-radius: 0.25rem;
}

.rounded-lg {
  border-radius: 0.5rem;
}

.rounded-xl {
  border-radius: 0.75rem;
}

.rounded-full {
  border-radius: 9999px;
}

/* === Тени === */
.shadow-md {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* === Паддинги и отступы === */
.p-4 { padding: 1rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

/* === Layout === */
.flex {
  display: flex;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.flex-col {
  flex-direction: column;
}
.grid {
  display: grid;
}
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.gap-3 {
  gap: 0.75rem;
}
.w-full {
  width: 100%;
}
.max-w-xs {
  max-width: 20rem;
}
.max-w-md {
  max-width: 28rem;
}
.max-w-2xl {
  max-width: 42rem;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}

/* === Кнопки === */
button,
a.button-style {
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

button {
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background-color: #4f46e5;
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

button span.small {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.9;
}

/* Конкретные цвета для кнопок */
button.bg-purple-600:hover {
  background-color: #7e22ce;
}

button.bg-orange-600:hover {
  background-color: #c2490d;
}

button.bg-red-600:hover {
  background-color: #b91c1c;
}

button.bg-gray-500:hover {
  background-color: #374151;
}

button.bg-blue-600:hover {
  background-color: #1d4ed8;
}

/* === Адаптивность === */
@media (min-width: 640px) {
  .container {
    padding: 0 2rem;
  }
}

/* === Модальное окно затемнения фона === */
.modal-overlay {
  background-color: rgba(0, 0, 0, 0.6);
}

/* === Стили для главной страницы === */

/* Блок с SEO текстом */
#seoText {
  max-width: 768px;
  margin: 2rem auto;
  padding: 1.5rem;
  background-color: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  text-align: left;
}

#seoText h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #111827;
}

#seoText p {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: #374151;
}

#seoText strong {
  color: #4f46e5;
}

#seoText .bg-blue-50 {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 0.75rem;
}

/* Статистика игры */
#gameStats {
  background-color: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  margin: 2rem auto;
  max-width: 400px;
  text-align: center;
}

#gameStats h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #111827;
}

#gameStats .stat-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

#gameStats .stat-item div {
  flex: 1;
  text-align: center;
}

#gameStats .stat-item div:first-child {
  color: #4f46e5;
  font-weight: 600;
}

#gameStats .stat-item div:last-child {
  color: #16a34a;
  font-weight: 600;
}

/* Футер */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #6b7280;
  font-size: 0.875rem;
}

footer a {
  color: #4f46e5;
  text-decoration: underline;
}

.fas.fa-brain {
  font-size: 4rem !important; /* ~text-8xl */
}

@media (min-width: 240px) {
  .fas.fa-brain {
    font-size: 4rem !important; /* ~text-9xl */
  }
}

/* Отступы для главной страницы */
.mb-section {
  margin-bottom: 1rem;
}

.mt-section {
  margin-top: 1rem;
}

/* Размер текста для статистики */
.stat-number {
  font-size: 2rem;
  line-height: 1;
  font-weight: bold;
}

@media (min-width: 640px) {
  .stat-number {
    font-size: 2rem;
  }
}

/* === Центрирование модального окна === */
#nameInputModal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.6);
}

#nameInputModal .bg-white {
  width: 90%;
  max-width: 320px;
  margin: 0 auto;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  background-color: #ffffff;
}

#nameInputModal input[type="text"] {
  font-size: 1.125rem;
  padding: 0.75rem 1rem;
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

#nameInputModal input[type="text"]:focus {
  outline: none;
  ring: 2px solid #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

#nameInputModal button {
  font-size: 1.125rem;
  padding: 0.75rem 1rem;
  width: 100%;
  border-radius: 0.5rem;
  font-weight: bold;
  transition: all 0.3s ease;
}

@media (min-width: 640px) {
  #nameInputModal input[type="text"],
  #nameInputModal button {
    font-size: 1.25rem;
    padding: 1rem;
  }
}

@media (min-width: 640px) {
    #gameScreen {
        display: flex;
        align-items: center;         /* Вертикальное центрирование */
        justify-content: center;     /* Горизонтальное центрирование */
        overflow: hidden;            /* Отключаем прокрутку, если не нужно */
    }

    #gameScreen .max-w-md {
        height: auto;                /* Можно задать min-height, если нужно */
        display: flex;
        flex-direction: column;
        justify-content: center;     /* Дополнительное выравнивание по центру */
        min-height: 80vh;            /* Занимает минимум 80% высоты экрана */
    }
}

@media (min-width: 640px) {
    #resultsScreen {
        display: block;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        height: 100%;
        overflow: auto;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #resultsScreen .bg-white {
        margin: 0 auto;
    }
}

/* === Отступы между кнопками режимов игры === */
.grid-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem; /* ~16px отступ между кнопками */
}

/* === Отступы между кнопками (все блоки) === */
.button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem; /* ~16px отступ между кнопками */
}

/* === Крупная иконка кубка с отступом сверху в окне результатов === */
#resultsScreen .fa-trophy {
    font-size: 4rem; /* ~4xl */
    margin-top: 1rem; /* Отступ сверху */
}

@media (min-width: 640px) {
    #resultsScreen .fa-trophy {
        font-size: 5rem; /* ~5xl на десктопах */
        margin-top: 1.5rem;
    }
}

#resultsScreen img[src*="reward_success_achievement_icon_256747.png"] {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem auto;
    display: block;
}

/* === Стиль окна результатов === */
#resultsScreen .bg-white {
    padding: 2rem;
}

/* === Увеличенный счёт в конце игры === */
#finalScore {
    font-size: 3.5rem; /* ~56px */
}

@media (min-width: 640px) {
    #finalScore {
        font-size: 4rem; /* ~64px на десктопах */
    }
}

.question-header {
    background-color: #4f46e5; /* indigo-600 */
    padding: 1rem;
    text-align: center;
}

.question-header h2 {
    color: white;
    font-size: 1.125rem; /* ~text-lg */
    font-weight: bold;
    margin: 0;
}

/* Увеличиваем размер иконок */
#mainMenuScreen .fas {
    font-size: 1rem; /* Увеличиваем до ~32px */
    margin-right: 0.5rem; /* Добавляем небольшой отступ между иконкой и текстом */
}

/* Центрируем иконки и текст внутри кнопок */
#mainMenuScreen .grid-buttons button {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Увеличиваем размер иконок */
.game-mode-icon {
    font-size: 2rem; /* Увеличиваем до ~32px */
    margin-bottom: 0.5rem; /* Добавляем небольшой отступ между иконкой и текстом */
}

/* Центрируем иконки внутри контейнера */
.game-mode-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}