/* ═══════════════════════════════════════════════════════════════════
   contests.css — конкурс-специфика поверх collaboratives.css.
   Раздел /Contests переиспользует всю раскладку совместников (collab-*/cd-*);
   здесь — только то, чего у совместника нет: победитель, призы, спонсоры.
   Оба файла подключаются вместе. Темы: light (default) + dark.
   ═══════════════════════════════════════════════════════════════════ */

/* Акцент «золото/трофей» — один на обе темы (читается на любом фоне). */
:root {
  --ct-gold: #e0a400;
  --ct-gold-soft: rgba(224, 164, 0, 0.12);
}
html[data-theme="dark"] {
  --ct-gold: #f2b731;
  --ct-gold-soft: rgba(242, 183, 49, 0.16);
}

/* ──────────────────────────────────────────
   HERO — даты отдельной строкой (у конкурса нет блока «создатель»)
   ────────────────────────────────────────── */
.ct-hero-dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.ct-hero-dates svg {
  flex-shrink: 0;
  opacity: 0.9;
}

/* ──────────────────────────────────────────
   LIST CARD — победитель (уголок обложки) + призы (подвал)
   ────────────────────────────────────────── */
.ct-card-winner {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 3px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.ct-card-winner__img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ct-gold);
}
.ct-card-winner__trophy {
  width: 14px;
  height: 14px;
  color: var(--ct-gold);
}

.ct-card-prizes {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--text-3);
  font-size: 0.8rem;
  font-weight: 500;
}
.ct-card-prizes svg {
  flex-shrink: 0;
  color: var(--ct-gold);
}

/* ──────────────────────────────────────────
   DETAIL — блок «Победитель»
   ────────────────────────────────────────── */
.ct-winner-section {
  border-bottom: 1px solid var(--border);
}
.ct-winner {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--ct-gold);
  background: var(--ct-gold-soft);
}
.ct-winner__art {
  position: relative;
  flex-shrink: 0;
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.ct-winner__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ct-winner__ribbon {
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 6px;
  background: var(--ct-gold);
  color: #1a1300;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.ct-winner__ribbon svg {
  width: 13px;
  height: 13px;
}
.ct-winner__info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.ct-winner__label {
  font-family: "Lora", serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.ct-winner__user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  width: fit-content;
}
.ct-winner__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}
.ct-winner__avatar--ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Тот же токен подложки, что у плейсхолдер-аватаров совместника (.collab-card__avatar--ph);
     раньше стоял несуществующий --bg-3 и молча падал на --border (серее задуманного). */
  background: var(--bg-subtle);
  color: var(--text-3);
  font-size: 0.8rem;
  font-weight: 700;
}
.ct-winner__name {
  font-size: 0.9rem;
  font-weight: 600;
}
.ct-winner__user:hover .ct-winner__name {
  text-decoration: underline;
}
.ct-winner__likes {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-3);
  font-size: 0.82rem;
  font-weight: 600;
}
.ct-winner__likes svg {
  width: 15px;
  height: 15px;
  fill: #ff3b30;
}

/* ──────────────────────────────────────────
   DETAIL — призы
   ────────────────────────────────────────── */
.ct-prizes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.ct-prize {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  padding-top: 30px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ct-prize__place {
  position: absolute;
  top: 10px;
  left: 14px;
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  /* Тёмный текст на медальном фоне (золото/серебро/бронза светлые) — контраст ≥4.5:1
     (WCAG AA для мелкого текста); белый на серебре/бронзе давал ~2.6–3.2:1. */
  color: #1a1300;
  background: var(--text-4);
}
.ct-prize__place--1 { background: var(--ct-gold); }
.ct-prize__place--2 { background: #b8bcc2; }
.ct-prize__place--3 { background: #d69553; }
.ct-prize__img {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.ct-prize__info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.ct-prize__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.ct-prize__desc {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-3);
  line-height: 1.4;
}

/* ──────────────────────────────────────────
   DETAIL — спонсоры
   ────────────────────────────────────────── */
.ct-sponsors {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.ct-sponsor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  height: 56px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
a.ct-sponsor:hover {
  border-color: var(--ct-gold);
  transform: translateY(-2px);
}
.ct-sponsor__logo {
  max-height: 36px;
  max-width: 140px;
  object-fit: contain;
}
.ct-sponsor__name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

/* ──────────────────────────────────────────
   DETAIL — работа-победитель в общей сетке
   ────────────────────────────────────────── */
.cd-entry--winner .cd-entry__img-wrap {
  outline: 2px solid var(--ct-gold);
  outline-offset: -2px;
  border-radius: 10px;
}
.cd-entry__winner {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ct-gold);
  color: #1a1300;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.cd-entry__winner svg {
  width: 15px;
  height: 15px;
}

/* ──────────────────────────────────────────
   Адаптив
   ────────────────────────────────────────── */
@media (max-width: 560px) {
  .ct-winner {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  .ct-winner__art {
    width: 100%;
    height: 200px;
  }
  .ct-prizes {
    grid-template-columns: 1fr;
  }
}
