/* === БАЗОВАЯ НАСТРОЙКА === */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: hidden;
  font-family: 'Arial', sans-serif;
  background: url('fontvoi.png') no-repeat center center fixed;
  background-size: cover;
  background-attachment: fixed;
}

/* === АККАУНТ-КНОПКА === */
.account-button {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.account-button button {
  padding: 10px 20px;
  font-size: 16px;
  background: black;
  border: 2px solid #960013;
  color: white;
  border-radius: 10px;
  cursor: pointer;
}

.account-button button:hover {
  background: #960013;
}

/* === ГЕРОЙ-СЕКЦИЯ === */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: white;
}

.hero-content h1 {
  font-size: 64px;
  font-weight: bold;
  margin-bottom: 20px;
}

.hero-content p {
  font-size: 24px;
  margin-bottom: 30px;
}

.chat-button {
  padding: 15px 30px;
  font-size: 18px;
  font-weight: bold;
  background: #ffffff;
  color: #000000;
  border: 2px solid #960013;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.chat-button:hover {
  background: #960013;
  color: white;
}

/* === MAIN: СКРОЛЛ И СЕКЦИИ === */
main {
  height: auto;
  scroll-snap-type: y mandatory;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.section {
  scroll-snap-align: start;
  min-height: 100vh;
  padding: 80px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* === "КАК ЭТО РАБОТАЕТ" === */
.how-it-works {
  background: white;
}

.how-it-works-title {
  font-size: 48px;
  color: #960013;
  margin-bottom: 40px;
}

.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
}

.card {
  background: white;
  border: 2px solid #960013;
  border-radius: 16px;
  padding: 30px;
  width: 300px;
  min-height: 200px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.card h3 {
  color: black;
  margin-bottom: 10px;
}

.card p {
  color: black;
}

/* === ФИДБЕК === */
#feedback {
  background: rgba(255, 255, 255, 0.85);
}

.feedback-container {
  background: #1D1E27;
  padding: 60px 40px;
  border: 2px solid #960013;
  border-radius: 16px;
  width: 90%;
  max-width: 800px; /* в 2 раза шире, чем было */
  color: white;
  text-align: center;
}

.feedback-container h2 {
  font-size: 32px;
  color: white;
  margin-bottom: 10px;
}

.feedback-container p {
  font-size: 18px;
  color: white;
  margin-bottom: 30px;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.feedback-form input,
.feedback-form textarea {
  width: 100%;
  max-width: 360px; /* 🔻 уменьшено с 600px */
  padding: 10px 14px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #960013;
  background: white;
  color: black;
  box-sizing: border-box;
}

.feedback-form textarea {
  resize: vertical;
  height: 120px;
}

.feedback-form button {
  width: 220px;
  padding: 14px;
  font-size: 16px;
  font-weight: bold;
  background: black;
  color: white;
  border: 2px solid #960013;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.feedback-form button:hover {
  background: #960013;
}

/* === КОНТАКТЫ === */
/* === КОНТАКТЫ === */
#contacts {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  text-align: center;
  padding: 80px 20px;
}

#contacts h2 {
  font-size: 48px; /* Больше заголовок */
  margin-bottom: 30px;
  color: white;
}

#contacts p {
  font-size: 20px; /* Увеличенный текст */
  margin: 10px 0;
  color: white;
}

#contacts a {
  font-size: 18px;
  color: white;
  text-decoration: none;
  margin: 0 10px;
}

#contacts a:hover {
  text-decoration: underline;
}

/* === ПОДВАЛ === */
footer {
  background: #000;
  color: white;
  text-align: center;
  padding: 20px;
}

/* === ПОПАПЫ === */
.popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.popup-wrapper {
  position: relative;
  width: 90%;
  max-width: 400px;
}

.popup-content {
  background: #1D1E27;
  padding: 40px 30px;
  border-radius: 18px;
  border: 2px solid #960013;
  text-align: center;
  position: relative;
}

.popup-content h2 {
  font-size: 24px;
  color: #fff;
  margin-bottom: 20px;
}

.popup-content input {
  width: 100%;
  padding: 12px 14px;
  margin: 10px 0;
  border-radius: 8px;
  border: none;
  background: #EDF2F4;
  font-size: 16px;
  color: black;
  box-sizing: border-box;
}

/* Кнопки формы входа / регистрации */
.popup-content button:not(.close-btn) {
  width: 90%;
  max-width: 280px;
  margin: 8px auto 0;
  padding: 10px;
  background: black;
  color: white;
  font-size: 15px;
  font-weight: bold;
  border-radius: 8px;
  border: 2px solid #960013;
  cursor: pointer;
  display: block;
  transition: background-color 0.3s;
  text-align: center;
}

.popup-content button:not(.close-btn):hover {
  background: #960013;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 22px;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
}

.close-btn:hover {
  color: red;
}

/* === ЧАТ === */
#chat-popup {
  display: none;
  position: fixed;
  width: 800px;
  height: 600px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1D1E27;
  border: 2px solid #960013;
  border-radius: 20px;
  z-index: 10000;
  overflow: hidden;
  flex-direction: column;
}
/* ДОБАВЬ ЭТО: */
#chat-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.chat-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 16px;
  background: #1D1E27;
  border-bottom: 2px solid #960013;
}

.chat-title {
  font-size: 22px;
  color: white;
}

.chat-header .close-btn {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.chat-body {
  flex: 1;
  display: flex;
  min-height: 0; /* 🧨 обязательно для работы scroll внутри */
}


#history-container {
  width: 30%;
  background: #2B2B39;
  padding: 10px;
  border-right: 2px solid #960013;
  display: flex;
  flex-direction: column;
}

#chat-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chat-item {
  background: #3b3b4d;
  padding: 8px;
  border-radius: 8px;
  color: white;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
}

.chat-item.active {
  background: #960013;
}

.delete-chat {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
}

.new-chat-btn {
  background: black;
  color: white;
  border: 2px solid #960013;
  padding: 14px;
  font-weight: bold;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 10px;
}

.new-chat-btn:hover {
  background: #960013;
}

#current-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* 🧨 нужно, чтобы .chat-messages не вытеснял .chat-input */
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 15px;
  min-height: 0; /* 🔥 критично */
}

.message {
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 15px;
  max-width: 70%;
  font-size: 14px;
}

.user {
  align-self: flex-end;
  background: black;
  color: white;
}

.bot {
  align-self: flex-start;
  background: #960013;
  color: white;
}

.typing {
  align-self: flex-start;
  color: #aaa;
  font-style: italic;
  opacity: 0.8;
}

/* Ввод */
#chat-input {
  display: flex;
  padding: 10px;
  background: #1D1E27;
  border-top: 2px solid #960013;
  flex-shrink: 0; /* ❗ предотвращает сжатие input-а */
}

#user-message {
  flex: 1;
  padding: 10px;
  font-size: 16px;
  border-radius: 8px;
  border: none;
}

#send {
  margin-left: 10px;
  padding: 10px 15px;
  font-size: 16px;
  background: black;
  color: white;
  border: 2px solid #960013;
  border-radius: 8px;
  cursor: pointer;
}

#send:hover {
  background: #960013;
}
/* Верхняя панель с кнопками */
.top-bar {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}
.top-bar-buttons {
  display: flex;
  gap: 16px;
}
.top-bar-buttons button {
  padding: 10px 18px;
  font-size: 15px;
  background: black;
  border: 2px solid #960013;
  color: white;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
}
.top-bar-buttons button:hover {
  background: #960013;
  color: #fff;
}

/* Стили иконки золотой монеты */
.coin-icon {
  display: inline-block;
  vertical-align: middle;
  width: 20px;
  height: 20px;
  margin-right: 7px;
  background: radial-gradient(circle at 60% 40%, #ffd700 70%, #b8860b 100%);
  border-radius: 50%;
  border: 2px solid #ffef70;
  box-shadow: 0 1px 4px rgba(180,140,0,0.2);
  position: relative;
}
.coin-icon::before {
  content: "";
  display: block;
  position: absolute;
  left: 4px;
  top: 7px;
  width: 10px;
  height: 2px;
  background: #fff8dc;
  border-radius: 2px;
  opacity: 0.7;
}

.how-float-btn {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  box-shadow: none;
  cursor: pointer;
  border: none;
  padding: 0;
}

.how-float-btn.hide {
  display: none !important;
}

.how-float-text {
  color: #fff;
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color 0.2s;
  white-space: nowrap;
  text-align: center;
}

.how-float-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 32px;
  margin-top: -3px;
}

.how-float-icon svg {
  display: block;
  width: 56px;
  height: 28px;
  stroke: #fff;
  stroke-width: 4;
  transition: stroke 0.2s;
  animation: floatDown 1.5s infinite;
  background: none !important;
  filter: none !important;
  box-shadow: none !important;
}

@keyframes floatDown {
  0%, 100% { transform: translateY(0);}
  40% { transform: translateY(10px);}
  55% { transform: translateY(-4px);}
  70% { transform: translateY(5px);}
}

.how-float-btn:hover .how-float-text {
  color: #d00;
}

.how-float-btn:hover .how-float-icon svg,
.how-float-btn:hover .how-float-icon svg path {
  stroke: #d00;
}
@media (max-width: 768px) {
  .chat-button.fixed {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
  }
}
@media (max-width: 768px) {
  #chat-popup {
    width: 95%;
    height: 90%;
    border-radius: 12px;
  }

  #chat-container {
    flex-direction: column;
  }

  #history-container {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 2px solid #960013;
  }

  .chat-item {
    min-width: 120px;
    flex-shrink: 0;
  }

  #current-chat {
    flex: 1;
  }
}
@media (max-width: 768px) {
  .top-bar-buttons {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .top-bar-buttons button {
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
    min-width: auto;
  }
}
@media (max-width: 768px) {
  #history-container {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px;
  }

  .chat-item {
    min-width: 100px;
    font-size: 12px;
    padding: 6px 8px;
  }

  .new-chat-btn {
    padding: 10px;
    font-size: 12px;
    margin: 0;
    height: auto;
    flex-shrink: 0;
  }

  #chat-list {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  #chat-popup {
    height: 90%;
    width: 95%;
    overflow: hidden;
    border-radius: 12px;
  }
}
@media (max-width: 768px) {
  .top-bar-buttons {
    display: none;
  }

  .sidebar-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
  }

  .sidebar-buttons button {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
}
/* === ВЫДВИЖНАЯ ПАНЕЛЬ (Мобайл) === */
@media (max-width: 768px) {
  #history-container {
    position: absolute;
    left: 0;
    top: 60px;
    bottom: 0;
    width: 240px;
    background: #2B2B39;
    border: 2px solid #960013;
    border-left: none;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 2000;
    padding: 10px;
    display: flex;
    flex-direction: column;
  }

  #history-container.active {
    transform: translateX(0);
  }
}

  #current-chat {
    flex: 1;
    position: relative;
    z-index: 1000;
  }
/* Кнопка "Новый чат" — компактная */
.new-chat-btn {
  width: 48px;
  height: 48px;
  font-size: 20px;
  background: black;
  color: white;
  border: 2px solid #960013;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto 0;
}

/* Кнопка "Войти в чат" — фиксированная, снизу справа */
.chat-launch-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  background: white;
  border: 2px solid #960013;
  border-radius: 12px;
  font-size: 24px;
  color: black;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-launch-btn:hover {
  background: #f0f0f0;
}
@media (min-width: 769px) {
  .chat-launch-btn {
    display: none;
  }
}
/* === ОБРАТНОЕ ВОССТАНОВЛЕНИЕ ДЛЯ ДЕСКТОПА === */
@media (min-width: 769px) {
  .sidebar-buttons {
    display: none !important;
  }

  .new-chat-btn {
    width: auto;
    padding: 10px 18px;
    font-size: 16px;
    background: black;
    color: white;
    border: 2px solid #960013;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    margin: 10px;
    white-space: nowrap;
  }
  
  .new-chat-btn:hover {
    background: #960013;
  }
  
  .new-chat-btn:hover {
    background: #960013;
  }

  .top-bar-buttons {
    display: flex !important;
  }

  .chat-button.fixed {
    display: inline-block !important;
    position: static !important;
    transform: none !important;
    margin-top: 30px;
  }

  .hero-content h1 {
    font-size: 64px;
    margin-bottom: 20px;
  }

  .hero-content p {
    font-size: 24px;
    margin-bottom: 30px;
  }
}

/* === ТОЛЬКО ДЛЯ МОБИЛЬНЫХ === */
@media (max-width: 768px) {
  .sidebar-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
  }

  .sidebar-buttons button {
    width: 48px;
    height: 48px;
    font-size: 20px;
    background: black;
    color: white;
    border: 2px solid #960013;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .new-chat-btn {
    width: 90%;
    height: 48px;
    font-size: 16px;
    margin: 10px auto;
  }

  .chat-item {
    max-width: 90%;
    margin: 0 auto;
  }

  .chat-launch-btn {
    display: flex;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    background: white;
    border: 2px solid #960013;
    border-radius: 12px;
    font-size: 24px;
    color: black;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    cursor: pointer;
  }

  .chat-button.fixed {
    display: none !important;
  }

  .hero-content h1 {
    font-size: 44px;
    margin-bottom: 10px;
  }

  .hero-content p {
    font-size: 18px;
    margin-bottom: 20px;
  }

  .hero-content {
    margin-top: -60px;
  }
}
.chat-item span {
  display: inline-block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.new-chat-btn {
  width: calc(100% - 20px);
  padding: 12px 18px;
  margin: 10px;
  font-size: 16px;
  background: black;
  color: white;
  border: 2px solid #960013;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  display: block;
  text-align: center;
  transition: background 0.3s;
}

.new-chat-btn:hover {
  background: #960013;
}
.chat-footer-aligner {
  margin-top: auto;
  padding: 10px;
  display: flex;
  justify-content: center;
}
.chat-footer-aligner {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}
#history-container {
  display: flex;
  flex-direction: column;
}