 /* === Базовые стили для полноэкранного PWA === */

html, body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  touch-action: manipulation;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  font-family: Arial, sans-serif;
  background-image: url('mountains.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
    /* чтобы фон заходил под статус-бар */
  background-attachment: fixed; 
}

/* === Шапка === */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding:12px 8px 12px;
  width: 100%;
  box-sizing: border-box;
  gap: 10px;
  background: rgba(0,0,0,0.0); /* чуть более прозрачный для «мягкости» */
  backdrop-filter: saturate(180%) blur(10px); /* размытый фон как в Safari */
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2); /* чуть сильнее тень */
  border-bottom: 1px solid rgba(255,255,255,0.1); /* тонкая граница */
  position: sticky;
  top: 0;
  z-index: 100;
}


#title {
  font-weight: bold;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

#leftControls,
#rightControls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

header button {
  background-color: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  padding: 0;
}

header button:hover {
  background-color: rgba(255,255,255,0.25);
  transform: scale(1.05);
}

#welcomeContainer {
  background: rgba(0, 0, 0, 0.05); /* чёрный полупрозрачный фон */
  backdrop-filter: blur(8px); /* лёгкое размытие фона за контейнером */
  border-radius: 16px; /* закруглённые углы */
  padding: 20px 30px; /* внутренние отступы */
  display: flex;
  flex-direction: column;
  align-items: center;
}

#welcomeWrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column; /* вертикально */
  justify-content: center; /* по вертикали */
  align-items: center;     /* по горизонтали */
  gap: 20px;               /* расстояние между элементами */
  text-align: center;
}

#welcome {
  font-size: 3rem;
  font-weight: bold;
  text-align: center;
  color: #ffffff;
  text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

#welcomeSubtext {
  font-size: 1.5rem; /* меньше, чем основной заголовок */
  color: white;    /* тот же цвет */
  text-align: center;
  line-height: 1.4; /* делаем строки читабельными */
  max-width: 300px; /* ограничиваем ширину для iPhone */
  margin: 0 auto 20px auto; /* центрируем и добавляем отступ снизу */
}

/* Кнопки под приветствием */
#welcomeButtons {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 15px;
}

#welcomeButtons button {
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, border 0.2s;
}

#welcomeButtons button:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.05);
}

/* Поле ввода */
#answerInput {
  width: 100%;
  font-size: 1.3rem;
  padding: 14px;
  border-radius: 14px;
  border: 2px solid #ccc;
  box-sizing: border-box;
  margin-top: 5px;
  margin-bottom: 5px;  /* снизу */
  background: #fff;
  color: #000;
  transition: border-color 0.3s, box-shadow 0.3s;
}
#answerInput.error {
  border: 2px solid red !important;
  box-shadow: 0 0 10px red;
}
#answerInput.success {
  border: 2px solid #00a550 !important;
  box-shadow: 0 0 10px #00a550;
}

#answerInput.error::placeholder {
  color: #ff4d4d; /* placeholder тоже красный */
}

/* === Анимации === */
@keyframes bounce {
  0%   { transform: translateY(0); }
  25%  { transform: translateY(-12px); }
  50%  { transform: translateY(0); }
  75%  { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

/* bounce для любых элементов */
.bounce {
  animation: bounce 0.6s ease;
}


/* === Адаптив под айфон === */
@media (max-width: 480px) {
  #welcomeContainer {
    padding: 15px 20px; 
    border-radius: 12px;
    width: 95%;          /* уменьшаем ширину под маленький экран */
    max-width: 300px;    /* ограничение для iPhone SE и похожих */
    margin: 0 auto;      /* центрируем контейнер */
    box-sizing: border-box;
  }

  #welcomeWrapper {
    gap: 15px;           /* уменьшаем расстояние между элементами */
  }

  #welcome {
    font-size: 2rem;     /* уменьшаем заголовок */
  }

  #welcomeSubtext {
    font-size: 1.2rem;   /* чуть меньше подзаголовок */
    max-width: 100%;     /* подстраиваем под контейнер */
    margin-bottom: 15px;
  }

  #welcomeButtons {
    margin-top: 15px;
    gap: 10px;               /* чуть меньше расстояние между кнопками */
    flex-wrap: wrap;          /* если кнопки не влезают, переход на новую строку */
  }

  #welcomeButtons button {
    font-size: 1rem;          /* чуть меньше шрифт на iPhone */
    padding: 12px 18px;       /* фиксируем отступы */
    height: 44px;             /* фиксированная высота для всех кнопок */
    min-width: 80px;          /* минимальная ширина кнопки */
    box-sizing: border-box;   /* padding и border учитываются в высоте */
  }

   /* Запрет выделения текста на iPhone */
  * {
    -webkit-user-select: none;   /* Safari, iOS */
    -moz-user-select: none;      /* Firefox */
    -ms-user-select: none;       /* IE/Edge */
    user-select: none;           /* Современные браузеры */
    -webkit-touch-callout: none; /* Отключаем меню при долгом тапе на iPhone */
  }
}

