/* ====================================================================
   Модуль розыгрышей / Розыгрыш призов (Glassmorphic Sortition Engine)
   ==================================================================== */

.sortition {
  padding: 20px 0;
}

.heading_so {
  color: #ffffff;
  position: relative;
  font-size: 26px;
  font-weight: 800;
  margin: 4px 0 16px;
  letter-spacing: -0.4px;
}

.double_flex_sortion {
  display: flex;
  gap: 20px;
  flex-direction: row-reverse;
}

.right_sortion {
  width: 100%;
}

/* Левый контейнер: убран глухой серый фон */
.left_sotion {
  width: 100%;
  background: transparent !important;
  border-radius: 0;
  padding: 0;
  margin-bottom: 20px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
}

.sortition h3 {
  font-size: 14px;
  text-align: center;
  margin-bottom: 12px;
  font-weight: 700;
  color: #aeb6d2;
}

/* ---- Блок информации об общей сумме/призах ---- */
.block_prizes {
  padding: 14px 18px;
  margin-bottom: 20px;
  border-radius: 16px;
  gap: 15px;
  display: flex;
  align-items: center;
  background: rgba(18, 20, 29, 0.68) !important;
}

.block_prizes i {
  font-size: 19px;
  color: #08150f;
  background: linear-gradient(135deg, #4fea9f 0%, #22b877 100%);
  display: flex;
  height: 42px;
  width: 42px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 15px rgba(79, 234, 159, 0.35);
}

.block_prizes span {
  font-weight: 700;
  color: #ffffff;
  font-size: 14px;
}

/* ---- Таймер обратного отсчета ---- */
.sortition .ending {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.sortition #ending {
  text-align: center;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.sortition #ending span {
  color: #ffffff;
  font-size: 32px;
  font-weight: 800;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  background: rgba(18, 20, 29, 0.68) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 1;
  padding: 16px 12px;
  margin: 0;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.sortition #ending i {
  font-style: normal;
  font-size: 10px;
  display: block;
  font-weight: 800;
  line-height: 1;
  margin-top: 8px;
  color: #aeb6d2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#dparticipants {
  background: rgba(79, 234, 159, 0.12);
  border: 1px solid rgba(79, 234, 159, 0.3);
  color: #4fea9f;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(79, 234, 159, 0.15);
}

.sortition .with_code {
  color: #aeb6d2;
  background: rgba(18, 20, 29, 0.68) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px;
  border-radius: 16px;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
}

/* ---- Список призов ---- */
.sortition #prizes h5 {
  font-size: 12px;
  margin-top: 16px;
  z-index: 11;
  background: linear-gradient(135deg, #4fea9f 0%, #22b877 100%);
  color: #08150f;
  position: relative;
  text-shadow: none;
  padding: 8px 16px;
  box-shadow: 0 4px 15px rgba(79, 234, 159, 0.35);
  border-radius: 999px;
  margin-left: 16px;
  margin-bottom: -14px;
  font-weight: 800;
  width: auto;
  display: inline-block;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sortition #prizes .prize {
  display: block;
  position: relative;
  margin-bottom: 20px !important;
  line-height: normal;
  padding: 22px 20px 18px;
  border-radius: 18px;
  background: rgba(18, 20, 29, 0.68) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sortition #prizes .prize:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 234, 159, 0.35);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 18px rgba(79, 234, 159, 0.1);
}

.sortition #prizes .prize span {
  font-size: 15px;
  width: 100%;
  display: inline-block;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  line-height: 1.3;
  font-weight: 800;
  color: #ffffff;
}

.sortition #prizes .prize span small {
  color: #aeb6d2;
  font-size: 11.5px;
  line-height: 1.4;
  display: block;
  font-weight: 600;
  margin-top: 2px;
}

.sortition #prizes .prize i.fa {
  display: none;
}

.sortition #prizes .prize p {
  margin: 10px 0 0;
  color: #aeb6d2;
  font-size: 12.5px;
  line-height: 1.5;
}

.sortition #prizes .modal {
  text-align: left;
}

.sortition #prizes .modal-body hr {
  margin-top: 10px;
  margin-bottom: 10px;
  border-color: rgba(255, 255, 255, 0.08);
}

/* ---- Кнопка "Участвовать" ---- */
.sortition .participate {
  padding: 16px 36px;
  border: none;
  font-size: 13.5px;
  background: linear-gradient(135deg, #4fea9f 0%, #22b877 100%);
  color: #08150f;
  position: relative;
  text-shadow: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(79, 234, 159, 0.35);
  font-weight: 900;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  margin: 20px auto 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}



.sortition .participate:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(79, 234, 159, 0.5);
  opacity: 1;
}

/* ====================================================================
   ---- Новая стилизация Участников (Glassmorphic Table Layout) ----
   ==================================================================== */

.sortition #participants {
  display: block;
  text-align: left;
  margin-top: 15px;
}

.sortition #participants > p {
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Обертка для табличного отображения */
.sortition_participants_grid,
.sortition #participants_list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  counter-reset: participant-counter;
}

/* Элемент таблицы (карточка участника) */
.sortition #participants a,
.sortition_participant_item {
  position: relative;
  counter-increment: participant-counter;
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 14px !important;
  margin: 0 !important;
  border-radius: 14px !important;
  
  /* Стеклянный блок */
  background: rgba(18, 20, 29, 0.68) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  
  color: #ffffff !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Автоматическая нумерация участника (#1, #2...) */
.sortition #participants a::before {
  content: "#" counter(participant-counter);
  font-size: 11px;
  font-weight: 800;
  color: #aeb6d2;
  opacity: 0.6;
  margin-right: 2px;
  flex-shrink: 0;
}

.sortition #participants a:hover,
.sortition_participant_item:hover {
  background: rgba(18, 20, 29, 0.88) !important;
  border-color: rgba(79, 234, 159, 0.4) !important;
  color: #4fea9f !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), 0 0 15px rgba(79, 234, 159, 0.12);
}

.sortition #participants a img {
  width: 28px !important;
  height: 28px !important;
  border-radius: 10px !important;
  margin-right: 0 !important;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  transition: border-color 0.2s ease;
}

.sortition #participants a:hover img {
  border-color: rgba(79, 234, 159, 0.5);
}

/* Текст имени участника */
.sortition #participants a span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
}

/* ---- Победители ---- */
.sortition .winners {
  margin-left: -16px;
  margin-right: -16px;
  padding: 10px;
}

.sortition #winners {
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.sortition #winners a {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(18, 20, 29, 0.68) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 16px 12px;
  margin: 0;
  opacity: 1;
  width: 130px;
  text-decoration: none !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sortition #winners a:hover {
  transform: translateY(-3px);
  background: rgba(18, 20, 29, 0.88) !important;
  border-color: rgba(79, 234, 159, 0.35);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), 0 0 15px rgba(79, 234, 159, 0.1);
}

.sortition #winners a i {
  font-size: 12px;
  color: #4fea9f;
  font-style: normal;
  font-weight: 800;
  margin-bottom: 8px;
}

.sortition #winners a img {
  display: block;
  border-radius: 50%;
  height: 54px;
  width: 54px;
  margin: 0 0 10px;
  object-fit: cover;
  border: 2px solid rgba(79, 234, 159, 0.4);
  box-shadow: 0 0 12px rgba(79, 234, 159, 0.2);
}

.sortition #winners a span {
  display: block;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: 100%;
}

.sortition a.read-more {
  display: block;
  width: 100%;
  text-align: right;
  margin-top: -6px;
  margin-bottom: 16px;
  color: #aeb6d2;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none !important;
  transition: color 0.18s ease;
}

.sortition a.read-more:hover {
  color: #4fea9f;
}

/* ---- Адаптивность ---- */
@media (max-width: 991.99px) {
  .double_flex_sortion {
    display: flex;
    gap: 20px;
    flex-direction: column;
  }

  .sortition #ending {
    text-align: center;
    display: flex;
    flex-direction: row;
    justify-content: center;
    overflow: auto;
  }

  .sortition_participants_grid,
  .sortition #participants_list {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 480px) {
  .sortition_participants_grid,
  .sortition #participants_list {
    grid-template-columns: 1fr 1fr;
  }
}