:root {
  --bg: #121416;             
  --text: #ffffff;            /* Основной белый текст */
  --text-secondary: #c0c0c0;  /* Второстепенный текст */
  --blue-500: #007BFF;
  --blue-300: #66B2FF;
}


/* Сброс */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--bg); 
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 4.5rem; /* место под .bottom-nav */
}

/* Приветственное сообщение */
.greeting {
  background: #111;
  color: #fff;
  padding: 1rem;
  text-align: center;
  font-size: 1.25rem;
  border-bottom: 1px solid #fff;
  display: none;
}
.greeting.show {
  display: block;
}

/* Заголовки */
.hero__title,
.section-title {
  font-size: 2.75rem;
  text-align: center;
  color: var(--text);
  margin-bottom: 2rem;
}

/* Общие стили для всех «боксов» */
.hero__card {
  display: flex;
  flex-wrap: wrap;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0;
  background: var(--bg);
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

/* HERO */
.hero {
  padding: 4rem 1rem;
}

.hero__info {
  flex: 1 1 300px;
  padding: 2rem;
  text-align: left;
}

.hero__info h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.hero__info p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.hero__illustration {
  flex: 1 1 50%;
  max-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: hidden;
}

.hero__illustration img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Действия в hero */
.hero__actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
}
.hero__actions .btn {
  font-size: 1.2rem;
  padding: 1.2rem 2.5rem;
  min-width: 220px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.hero__actions .btn:hover {
  background: linear-gradient(90deg, #555, #222);
}

@media (max-width: 480px) {
  .hero__actions {
    flex-direction: column;
    align-items: center;
  }
}



/* Секция возможностей */
.features__grid {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 3rem auto 4rem;
  padding: 0 1rem;
}

.features__grid h3 {
  margin: 0;
  flex: 0 0 auto;
  text-align: center;
}

.features__grid .btn {
  display: inline-block;
  width: auto;
  max-width: 200px;
}

/* Карточки */
.card {
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.card h3 {
  margin-bottom: 0.75rem;
  color: var(--text);
}

.card p {
  color: var(--text-secondary);
}

/* Секция контактов */
.contact {
  padding: 2rem 1rem 4rem;
}

.contact__inner {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}

.contact__info {
  flex: 1 1 250px;
  text-align: center;
}

.contact__qr img {
  width: 160px;
  height: 160px;
}

/* Нижняя навигация */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #111;
  border-top: 1px solid #fff;
  display: flex;
  justify-content: space-around;
  padding: 0.75rem 0;
  z-index: 1000;
}

.bottom-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: bold;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.75rem;
}

.bottom-nav i {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.bottom-nav a.active {
  border-bottom: 2px solid #fff;
}

/* Верхняя навигация */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #111;
  border-bottom: 1px solid #fff;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0.5rem 1rem;
  z-index: 1100;
}

.top-nav .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.connect-wallet {
  padding: 0.5rem 0.75rem;
  border: 1px solid #fff;
  background: transparent;
  color: var(--text);
  border-radius: 1rem;
  cursor: pointer;
}

#pwd-input {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.5rem;
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.25rem;
}

/* Подарочные карточки */
.gift-list {
  display: grid;
  grid-template-columns: 1fr; /* одна колонка */
  gap: 1rem;
  padding: 1rem;
}

.gift-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  position: relative;
  background: #111;
  border: 1px solid #333;
  border-radius: 0.5rem;
  transition: background 0.2s;
  cursor: pointer;
}

.gift-card:hover {
  background: #222;
}

.gift-icon {
  font-size: 1.5rem;
  color: #ffffff; 
}

.gift-title {
  font-weight: bold;
  color: #fff;
}

.withdraw-icon {
  position: absolute;
  right: 1rem;
  top: 1rem;
  font-size: 1.5rem;
  color: #f76b6b;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}
.withdraw-icon:hover {
  color: #fff;
}


#exchange-info {
  color: white;
}

.button-group {
  text-align: center;
  margin-top: 1.5rem;
}

/* Общий стиль */
.button-group button {
  display: block;
  width: 90%;
  max-width: 300px;
  margin: 0.5rem auto;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 8px;
  transition: background 0.3s ease, color 0.3s ease, border 0.3s ease;
  cursor: pointer;
}

/* Добавить предмет — белая кнопка */
.add-gift-btn {
  background-color: #fff;
  color: #000;
  border: 1px solid #888;
}
.add-gift-btn:hover {
  background-color: #ddd;
}

/* Отменить обмен — красная кнопка */
.cancel-btn {
  background-color: #111;
  color: #f76b6b;
  border: 1px solid #f76b6b;
}
.cancel-btn:hover {
  background-color: #f76b6b;
  color: #fff;
}

.accept-btn {
  display: block;
  margin: 1rem auto;
  padding: 0.75rem 1.5rem;
  background-color: #1e1e1e;
  color: #7cf76b;
  border: 1px solid #7cf76b;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.accept-btn:hover {
  background-color: #7cf76b;
  color: #000;
}

/*  Окно с добавлением подарков в трейде*/
/* Затемнённый фон */
.gift-choice-btn {
  display: block;
  margin: 0.5rem 0;
  padding: 0.75rem;
  background: #222;
  color: #fff;
  border: 1px solid #444;
  border-radius: 8px;
  cursor: pointer;
}
.gift-choice-btn:hover {
  background: #333;
}

.gift-choice-btn {
  display: block;
  margin: 0.5rem 0;
  padding: 0.75rem;
  background: #222;
  color: #fff;
  border: 1px solid #444;
  border-radius: 8px;
  cursor: pointer;
}
.gift-choice-btn:hover {
  background: #333;
}

.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #111;
  padding: 20px;
  border-radius: 12px;
  max-width: 90%;
  width: 400px;
  color: white;
  box-shadow: 0 0 20px rgba(0,0,0,0.7);
  position: relative;
  text-align: center;
}

.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  color: #ccc;
  cursor: pointer;
}

.warning-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ff4d4d;
  padding: 16px 24px;
  color: white;
  font-weight: bold;
  border-radius: 8px;
  z-index: 99999;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

.input-field {
  width: 100%;
  padding: 10px;
  margin: 15px 0;
  font-size: 1rem;
  border: 1px solid #555;
  border-radius: 8px;
  background: #222;
  color: #fff;
}

.confirm-btn {
  background: #4caf50;
  color: white;
  padding: 10px 20px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.confirm-btn:hover {
  background: #45a049;
}

.join-btn {
  display: block;
  margin: 1rem auto;
  padding: 0.75rem 1.5rem;
  background-color: #222;
  color: white;
  border: 1px solid #4caf50; /* Зелёная рамка */
  border-radius: 10px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

.join-btn:hover {
  background-color: #4caf50;
  color: #fff;
}

#success-added-modal .modal-content {
  text-align: center;
}

.remove-gift {
  color: white;
  cursor: pointer;
  font-weight: bold;
  margin-left: 6px;
}
.remove-gift:hover {
  color: rgb(255, 255, 255);
}

/* Модалка подтверждения обмена */
#confirm-modal .modal-content {
  background: #111;
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid #fff;
  width: 90%;
  max-width: 400px;
  color: #fff;
  text-align: center;
}

#confirm-password {
  width: 100%;
  padding: 0.75rem;
  margin: 1rem 0;
  background: #222;
  color: #fff;
  border: 1px solid #555;
  border-radius: 8px;
  font-size: 1rem;
}

#confirm-submit {
  background-color: #4caf50;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  margin-right: 0.5rem;
}

#confirm-submit:hover {
  background-color: #45a049;
}

#confirm-cancel {
  background-color: #666;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

#confirm-cancel:hover {
  background-color: #555;
}

.modal .modal-content button {
  background-color: #333;
  color: #fff;
  border: 1px solid #555;
  padding: 0.5rem 1rem;
  margin: 0.25rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.modal .modal-content button:hover {
  background-color: #444;
}

#stars-balance {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid #ffffff55;
  border-radius: 999px;
  padding: 6px 12px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: default;
  user-select: none;
  transition: background 0.2s, border-color 0.2s;
}

#stars-balance:hover {
  border-color: #f9d949;
  background: #ffffff10;
}

#stars-balance::before {
  content: "⭐";
  font-size: 1.2rem;
}

.accepted-user {
  color: #7CFC00; /* или любой другой зелёный: lightgreen, limegreen и т.д. */
  font-weight: bold;
}

/* === История обменов === */
.history-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
}

.history-item {
  background: #2a2a2a;
  color: #fff;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
  transition: background .2s;
}

.history-item:hover {
  background: #444;
}

/* Центрируем заголовок */
.hero__title {
  text-align: center;
}


/* Кнопка открытия модалки истории */
.history-btn {
  position: fixed;
  top: 4rem;    
  right: 1rem;
  z-index: 2000;   
  background: #222;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background .2s;
}


.history-btn:hover {
  background: #333;
}

/* Модалка истории обменов */
#history-modal .modal-content {
  max-width: 400px;
  width: 90%;
}
#history-modal .history-list {
  max-height: 60vh;
  overflow-y: auto;
  margin-top: 1rem;
}
#history-modal .history-item {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #444;
  cursor: pointer;
  transition: background .2s;
}
#history-modal .history-item:hover {
  background: #333;
}

/* -------------------------------------------------------------------
   Модалки: всегда display:flex, но скрыты через opacity+visibility
------------------------------------------------------------------- */
.modal {
  display: flex;               /* держим модалку в потоке */
  align-items: center;
  justify-content: center;

  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);

  /* Скрываем через opacity+visibility */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 2000;
}

.modal.show {
  /* Показываем */
  opacity: 1;
  visibility: visible;
}

/* -------------------------------------------------------------------
   Анимация «всплытия» самого окна внутри модалки
------------------------------------------------------------------- */
.modal-content {
  transform: translateY(-20px) scale(0.95);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal.show .modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* === Анимации для модалки истории обменов === */
@keyframes history-backdrop-fade {
  from { background-color: rgba(0, 0, 0, 0); }
  to   { background-color: rgba(0, 0, 0, 0.8); }
}

@keyframes history-content-pop {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Плавное появление затемнённого фона */
#history-modal.show {
  animation: history-backdrop-fade 0.2s ease-out forwards;
}

/* Плавный «pop»-эффект для содержимого модалки */
#history-modal .modal-content {
  animation: history-content-pop 0.25s ease-out forwards;
}

#stars-balance {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid #ffffff55;
  border-radius: 999px;
  padding: 6px 12px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: default;
  user-select: none;
  transition: background 0.2s, border-color 0.2s;
}
#stars-balance:hover {
  border-color: #f9d949;
  background: #ffffff10;
}
#stars-balance::before {
  content: "⭐";
  font-size: 1.2rem;
}

/* ===== Filters Bar ===== */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
  background: #1e1e1e;
  border-radius: 1rem;
  margin: 1rem;
}
.filter-item {
  display: flex;
  align-items: center;
  background: #2a2a2a;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  color: #ddd;
  font-size: 0.95rem;
}
.filter-item i {
  margin-right: 0.5rem;
}
.filter-item input[type="text"],
.filter-item input[type="number"] {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.95rem;
  width: 5rem;
}
.price-filter .price-range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Toggle switch */
.toggle-filter .switch {
  position: relative;
  display: inline-block;
  width: 2.4rem;
  height: 1.2rem;
  margin-right: 0.5rem;
}
.toggle-filter .switch input {
  opacity: 0;
  width: 0; height: 0;
}
.toggle-filter .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #444;
  transition: .3s;
  border-radius: 1rem;
}
.toggle-filter .slider:before {
  position: absolute;
  content: "";
  height: 0.9rem; width: 0.9rem;
  left: 0.15rem; bottom: 0.15rem;
  background: #fff;
  transition: .3s;
  border-radius: 50%;
}
.toggle-filter input:checked + .slider {
  background: #4caf50;
}
.toggle-filter input:checked + .slider:before {
  transform: translateX(1.2rem);
}

/* ===== Grid & Cards ===== */
.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  padding: 1rem;
}
.market-card {
  background: #2a2a2a;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  transition: transform .2s;
}
.market-card:hover {
  transform: translateY(-3px);
}
.market-card__img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
}
.market-card__body {
  padding: 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.market-card__title {
  font-size: 1rem;
  color: #fff;
  margin: 0 0 0.5rem;
}
.market-card__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.market-card__price {
  font-weight: bold;
  color: #4caf50;
}
.market-card__btn {
  background: #4caf50;
  border: none;
  color: #fff;
  padding: 0.6rem 0.8rem;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background .2s;
}
.market-card__btn:hover {
  background: #43a047;
}

/* Специальный стиль для кнопки «Добавить товар» */
.create-btn {
  background: #4caf50;
  color: #fff;
  font-weight: bold;
  border: none;
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background .2s;
}
.create-btn i {
  margin-right: 0.5rem;
  font-size: 1rem;
}
.create-btn:hover {
  background: #43a047;
}

.featured-gift {
  margin-top: 1rem;
  text-align: center;
}
.featured-gift h3 {
  margin: 0.5rem 0;
}
.featured-gift img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
}






/* Уменьшаем отступы и центрируем контейнер */
.gifts-section {
  width: 100%;
  padding: 0.5rem 0;
}
/* Сетка: теперь минимальный размер карточки 120px */
.gift-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  padding: 0 8px;
}

/* Карточка */
.gift-card {
  width: 100%;
  background: #202734;
  border-radius: 12px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-sizing: border-box;
}

/* Квадратное превью — вписываемся в 120×120 */
.gift-card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(255,255,255,0.25);
  filter: brightness(1.05) contrast(1.1);
  image-rendering: auto;
}


/* Новый flex-заголовок */
.gift-card .gift-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 0.9rem;
}

/* Название — обрезаем, если длинное */
.gift-card .gift-name {
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  padding-right: 4px;
}

/* Номер — справа, цвет другой */
.gift-card .gift-id {
  color: #888;
  flex-shrink: 0;
  font-size: 0.8rem;
}

/* Кнопка «Вывести» — чуть больше */
.gift-card .withdraw-btn {
  margin-top: auto;      /* подтянуть вниз */
  padding: 6px 0;
  width: 100%;
  font-weight: 700;
  background-color: #4da6ff;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color .2s;
}

.gift-card .withdraw-btn:hover {
  background-color: #3399ff;
}

@media (max-width: 480px) {
  .gift-list {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px; /* можно чуть уменьшить */
    padding: 0 6px;
  }
}

/* чтобы Lottie-анимация вписывалась как картинка */
.gift-animation {
  border-radius: 8px;
  overflow: hidden;
}

