/* ==========================================================================
   Raffly — компоненты
   Кнопки, поля, карточки, шаги, таблица участников, сцена розыгрыша.
   ========================================================================== */

/* ---------- Кнопки ---------- */

.btn {
  --btn-bg: var(--accent);
  --btn-ink: var(--accent-ink);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-6);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out),
    border-color var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  background: var(--accent-hover);
  color: var(--btn-ink);
  text-decoration: none;
}

.btn:active {
  background: var(--accent-active);
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  box-shadow: var(--shadow-accent);
}

.btn--secondary {
  --btn-bg: var(--surface);
  --btn-ink: var(--ink);
  --btn-border: var(--line);
  box-shadow: var(--shadow-sm);
}

.btn--secondary:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-ink: var(--ink-soft);
}

.btn--ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.btn--gold {
  --btn-bg: var(--gold);
  --btn-ink: #1a1408;
}

.btn--gold:hover {
  background: color-mix(in srgb, var(--gold) 88%, #000);
  color: #1a1408;
}

.btn--sm {
  min-height: 40px;
  padding-inline: var(--s-4);
  font-size: var(--text-sm);
  border-radius: var(--radius-xs);
}

.btn--lg {
  min-height: 56px;
  padding-inline: var(--s-8);
  font-size: var(--text-lg);
}

.btn--block {
  width: 100%;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ---------- Бейджи и пилюли ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Длинный бейдж (например, про гостевой розыгрыш) переносится, а не вылезает за экран */
#guest-badge {
  white-space: normal;
  max-width: 100%;
  line-height: 1.35;
}

.badge--accent {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

.badge--gold {
  background: var(--gold-soft);
  border-color: color-mix(in srgb, var(--gold) 35%, transparent);
  color: color-mix(in srgb, var(--gold) 70%, var(--ink));
}

.badge--success {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
  color: var(--success);
}

.badge--danger {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
  color: var(--danger);
}

.badge--soon {
  background: transparent;
  border-style: dashed;
}

/* ---------- Карточки ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card__body {
  padding: var(--s-6);
}

@media (max-width: 640px) {
  .card__body {
    padding: var(--s-5);
  }
}

.card--pad {
  padding: var(--s-6);
}

.card--lift {
  transition: transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base);
}

.card--lift:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.grid {
  display: grid;
  gap: var(--s-5);
}

@media (min-width: 640px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- Формы ---------- */

.field {
  display: grid;
  gap: var(--s-2);
}

.label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-soft);
}

.hint {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: var(--leading-normal);
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 48px;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-base);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast),
    background-color var(--dur-fast);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--muted-2);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.textarea {
  min-height: 172px;
  resize: vertical;
  line-height: var(--leading-normal);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.input--sm {
  min-height: 40px;
  padding-block: var(--s-2);
  font-size: var(--text-sm);
}

.field--error .input,
.field--error .textarea {
  border-color: var(--danger);
}

.field__error {
  display: none;
  font-size: var(--text-sm);
  color: var(--danger);
  font-weight: 550;
}

.field--error .field__error {
  display: block;
}

/* Переключатель */
.switch {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--dur-fast);
  min-height: 48px;
}

.switch:hover {
  background: var(--surface-2);
}

.switch input {
  appearance: none;
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  margin: 2px 0 0;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  position: relative;
  transition: background-color var(--dur-base) var(--ease-out),
    border-color var(--dur-base);
}

.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-out);
}

.switch input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.switch input:checked::after {
  transform: translateX(18px);
  background: #fff;
}

.switch__text {
  display: grid;
  gap: 2px;
}

.switch__title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--ink);
}

.switch__desc {
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: var(--leading-normal);
}

/* Сегментированный переключатель (вкладки) */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.segmented button,
.segmented a {
  min-height: 40px;
  padding: 0 var(--s-4);
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}

.segmented button[aria-selected="true"],
.segmented a[aria-current="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ---------- Шаги ---------- */

.steps {
  display: grid;
  gap: var(--s-3);
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: var(--s-3) var(--s-4);
  align-items: start;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-weight: 750;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

/* ---------- Таблица участников ---------- */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: auto;
  background: var(--surface);
  max-height: 460px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th,
.table td {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 650;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: var(--surface-2);
}

.table .is-failed {
  color: var(--muted-2);
}

.table .reason {
  white-space: normal;
  color: var(--danger);
  font-size: var(--text-xs);
}

/* ---------- Сообщения ---------- */

.alert {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.alert svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.alert--accent {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.alert--accent svg {
  color: var(--accent);
}

.alert--success {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 28%, transparent);
}

.alert--success svg {
  color: var(--success);
}

.alert--danger {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 28%, transparent);
}

.alert--danger svg {
  color: var(--danger);
}

/* ---------- Пустое состояние ---------- */

.empty {
  display: grid;
  justify-items: center;
  gap: var(--s-3);
  padding: var(--s-10) var(--s-6);
  text-align: center;
  color: var(--muted);
}

.empty__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted-2);
}

/* ---------- Диалог ---------- */

dialog.modal {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}

dialog.modal::backdrop {
  background: rgb(12 14 20 / 55%);
  backdrop-filter: blur(2px);
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-6);
  border-bottom: 1px solid var(--line);
}

.modal__title {
  font-size: var(--text-lg);
  font-weight: 700;
}

.modal__body {
  padding: var(--s-6);
}

.modal__foot {
  display: flex;
  gap: var(--s-3);
  justify-content: flex-end;
  padding: var(--s-5) var(--s-6);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ---------- Тосты ---------- */

.toast-region {
  position: fixed;
  inset: auto var(--s-4) var(--s-4) var(--s-4);
  z-index: 80;
  display: grid;
  gap: var(--s-2);
  justify-items: center;
  pointer-events: none;
}

@media (min-width: 640px) {
  .toast-region {
    inset: auto var(--s-6) var(--s-6) auto;
    justify-items: end;
  }
}

.toast {
  max-width: 420px;
  padding: var(--s-3) var(--s-5);
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font-size: var(--text-sm);
  font-weight: 550;
  box-shadow: var(--shadow-lg);
  animation: toast-in var(--dur-base) var(--ease-out);
  pointer-events: auto;
}

.toast--success {
  background: var(--success);
  color: #fff;
}

.toast--error {
  background: var(--danger);
  color: #fff;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- Аватары ---------- */

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: var(--text-sm);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar--lg {
  width: 88px;
  height: 88px;
  font-size: var(--text-2xl);
}

/* ---------- Сцена розыгрыша ---------- */

.draw-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 340px;
  padding: var(--s-8) var(--s-5);
  border-radius: var(--radius-lg);
  background: radial-gradient(
      120% 120% at 50% 0%,
      color-mix(in srgb, var(--accent) 12%, transparent) 0%,
      transparent 60%
    ),
    var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
}

.draw-stage__inner {
  display: grid;
  gap: var(--s-4);
  justify-items: center;
  text-align: center;
  width: 100%;
}

.draw-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 650;
  color: var(--muted);
}

.draw-name {
  font-size: clamp(1.75rem, 6vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  min-height: 1.2em;
  filter: blur(0);
  transition: filter 120ms, transform 120ms;
  word-break: break-word;
}

.draw-name.is-rolling {
  filter: blur(0.6px);
  opacity: 0.85;
}

.draw-name.is-winner {
  color: var(--accent);
  animation: winner-pop 620ms var(--ease-out);
}

@keyframes winner-pop {
  0% {
    transform: scale(0.82);
    opacity: 0;
    filter: blur(8px);
  }
  55% {
    transform: scale(1.06);
    opacity: 1;
    filter: blur(0);
  }
  100% {
    transform: scale(1);
  }
}

.draw-card {
  display: grid;
  gap: var(--s-2);
  justify-items: center;
  padding: var(--s-6) var(--s-8);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  max-width: 100%;
}

.draw-card__name {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  word-break: break-word;
}

.draw-card__meta {
  font-size: var(--text-sm);
  color: var(--muted);
}

.confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.draw-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-3);
}

/* Фишки участников, влетающие в сцену */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  justify-content: center;
  opacity: 0.75;
}

.chip {
  display: inline-flex;
  align-items: center;
  max-width: 180px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: var(--text-xs);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Утилиты ---------- */

.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-6 { margin-top: var(--s-6); }
.mt-8 { margin-top: var(--s-8); }
.mb-4 { margin-bottom: var(--s-4); }
.gap-2 { gap: var(--s-2); }
.full { width: 100%; }

.flow > * + * {
  margin-top: var(--s-4);
}


/* CTA в шапке: на мобильном скрыт, на десктопе — виден */
.header-cta {
  display: none;
}

@media (min-width: 900px) {
  .header-cta {
    display: inline-flex;
  }
}

/* Карточка источника: заголовок и описание друг под другом */
.source > span:nth-child(2) {
  display: grid;
  gap: 2px;
  align-content: center;
  min-width: 0;
}

.source__title,
.source__desc {
  display: block;
}

.source__desc {
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ---------- Уведомление о cookie ---------- */

.rf-note {
  position: fixed;
  inset: auto var(--s-3) var(--s-3) var(--s-3);
  z-index: 70;
  padding: var(--s-4);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  animation: cookie-in var(--dur-slow) var(--ease-out);
}

@keyframes cookie-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.rf-note__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  align-items: center;
  justify-content: space-between;
  max-width: var(--container);
  margin: 0 auto;
}

.rf-note__text {
  font-size: var(--text-sm);
  color: var(--ink-soft);
  max-width: 70ch;
  line-height: var(--leading-normal);
}

.rf-note__actions {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-shrink: 0;
}

.rf-note__link {
  font-size: var(--text-sm);
}

@media (min-width: 900px) {
  .rf-note {
    inset: auto var(--s-6) var(--s-6) var(--s-6);
  }
}

/* ---------- Кнопка языка и вход ---------- */

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  min-width: 56px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: 750;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}

.lang-btn:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--ink);
}

.lang-btn svg {
  width: 17px;
  height: 17px;
  opacity: 0.75;
}

.header-auth svg {
  width: 20px;
  height: 20px;
}

.header-auth__label {
  display: none;
  font-size: var(--text-sm);
  font-weight: 600;
}

@media (min-width: 1180px) {
  .header-auth {
    width: auto;
    padding-inline: 12px;
    gap: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .header-auth__label {
    display: inline;
  }
}

@media (max-width: 480px) {
  .header-actions {
    gap: 4px;
  }
  .icon-btn {
    width: 40px;
    height: 40px;
  }
  .lang-btn {
    height: 40px;
    min-width: 50px;
    padding: 0 8px;
  }
  .lang-btn svg {
    display: none;
  }
}

/* ---------- Отступы заголовков ---------- */

.mt-10 { margin-top: var(--s-10); }
.mt-12 { margin-top: var(--s-12); }
.mt-16 { margin-top: var(--s-16); }

/* Заголовок после блока всегда дышит */
.proof__code + .h2,
.card + .h2,
pre + .h2,
.lead + .h2,
.grid + .h2,
.table-wrap + .h2 {
  margin-top: var(--s-10);
}

/* ---------- Фильтры на страницах списков ---------- */

.filters {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  margin-bottom: var(--s-6);
}

@media (min-width: 860px) {
  .filters {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1.6fr) auto;
    align-items: end;
  }
}

.date-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.date-range .input {
  min-width: 0;
  padding-inline: 10px;
  font-size: var(--text-sm);
}

.filters--compact {
  grid-template-columns: 1fr;
}

@media (min-width: 860px) {
  .filters--compact {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }
}

.filters .field {
  gap: 6px;
}

.filters .input,
.filters .select {
  min-height: 44px;
}

.filters__count {
  font-size: var(--text-sm);
  color: var(--muted);
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* ---------- Карточки списков ---------- */

.list-item {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base);
}

a.list-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
  color: inherit;
}

.list-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.list-item__title {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.list-item__blogger {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--text-sm);
  color: var(--muted);
  text-decoration: none;
}

.list-item__blogger:hover {
  color: var(--accent);
}

.list-item__blogger .avatar {
  width: 26px;
  height: 26px;
  font-size: 11px;
}

.list-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  font-size: var(--text-sm);
  color: var(--muted);
}

.list-item__winner {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
  color: var(--ink-soft);
}

/* ---------- Блогеры ---------- */

.blogger-card {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base);
}

.blogger-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
  color: inherit;
}

.blogger-card__top {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.blogger-card__name {
  font-weight: 700;
  font-size: var(--text-base);
  line-height: 1.3;
}

.blogger-card__handle {
  font-size: var(--text-sm);
  color: var(--muted);
}

.blogger-card__bio {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: var(--leading-normal);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blogger-card__stats {
  display: flex;
  gap: var(--s-5);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
  color: var(--muted);
}

.blogger-card__stats b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- Цветные иконки соцсетей ---------- */

.social-link {
  border-color: color-mix(in srgb, var(--social, var(--accent)) 26%, var(--line));
}

.social-link svg {
  color: var(--social, var(--accent));
}

.social-link:hover {
  border-color: var(--social, var(--accent));
  background: color-mix(in srgb, var(--social, var(--accent)) 10%, var(--surface));
  color: var(--social, var(--accent));
}

.social-link--tg { --social: #229ed9; }
.social-link--vk { --social: #0077ff; }
.social-link--rutube { --social: #ef2b2d; }
.social-link--youtube { --social: #ff0033; }

[data-theme="evening"] .social-link--vk { --social: #4d9bff; }
[data-theme="evening"] .social-link--rutube { --social: #ff6b6b; }
[data-theme="evening"] .social-link--youtube { --social: #ff5470; }

/* ---------- Шеринг ---------- */

.rf-actions {
  display: grid;
  gap: var(--s-4);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.rf-actions__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: var(--s-2);
}

.rf-actions__item {
  white-space: nowrap;
}

.rf-actions__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}

.rf-actions__item:hover {
  border-color: var(--social, var(--accent));
  background: color-mix(in srgb, var(--social, var(--accent)) 10%, var(--surface));
  color: var(--social, var(--accent));
}

.rf-actions__item svg {
  width: 20px;
  height: 20px;
  min-width: 20px;
  flex: 0 0 20px;
  color: var(--social, var(--ink-soft));
  overflow: visible;
  display: block;
  flex-shrink: 0;
}

.rf-actions__item--tg { --social: #229ed9; }
.rf-actions__item--vk { --social: #0077ff; }
.rf-actions__item--wa { --social: #25d366; }

/* ---------- Модальное окно входа ---------- */

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  margin-bottom: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.auth-tabs button {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
}

.auth-tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: grid;
  gap: var(--s-4);
}

.auth-note {
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: var(--leading-normal);
}

.site-footer__mail {
  display: inline-block;
  margin-top: var(--s-3);
  font-size: var(--text-sm);
}

/* Компактные иконки соцсетей в карточках */
.social-dot {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--social, var(--accent)) 26%, var(--line));
  background: color-mix(in srgb, var(--social, var(--accent)) 9%, var(--surface));
  color: var(--social, var(--accent));
}

.social-dot svg {
  width: 15px;
  height: 15px;
}

/* ---------- Кнопка сброса кеша в подвале ---------- */

.site-footer__bottom-right {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}

.cache-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color var(--dur-fast), border-color var(--dur-fast),
    background-color var(--dur-fast);
}

.cache-btn:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.cache-btn svg {
  width: 16px;
  height: 16px;
  transition: transform var(--dur-slow) var(--ease-out);
}

.cache-btn:hover svg {
  transform: rotate(180deg);
}

/* ---------- Поле с кнопкой очистки ---------- */

.input-with-action {
  position: relative;
  display: grid;
}

.input-with-action .input {
  padding-right: 46px;
}

.input-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}

.input-clear:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.input-clear svg {
  width: 16px;
  height: 16px;
}

/* ---------- Выравнивание фильтров ---------- */

.filters {
  align-items: stretch;
}

.filters .field {
  display: grid;
  grid-template-rows: auto 48px;
  gap: 6px;
  align-content: start;
}

.filters .input,
.filters .select {
  height: 48px;
  min-height: 48px;
  padding-block: 0;
}

.filters .date-range {
  height: 48px;
}

.filters .date-range .input {
  height: 48px;
}

.filters__count {
  align-self: end;
  height: 48px;
}

.filters__error {
  display: none;
  margin: calc(var(--s-2) * -1) 0 0;
  padding: 0 var(--s-4);
  font-size: var(--text-sm);
  color: var(--danger);
}

.filters__error[data-visible="true"] {
  display: block;
}

/* Шеринг на телефоне: две колонки, чтобы блок не занимал весь экран */
@media (max-width: 640px) {
  .rf-actions__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rf-actions__item {
    white-space: normal;
    text-align: center;
    padding-inline: var(--s-2);
    font-size: var(--text-xs);
    line-height: 1.25;
  }
}

/* ---------- Ссылка на страницу блогера с розыгрыша ---------- */

.blogger-link {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  max-width: 430px;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast), background-color var(--dur-fast),
    transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base);
}

.blogger-link:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: inherit;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.blogger-link__text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.blogger-link__label {
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.blogger-link:hover .blogger-link__label {
  color: var(--accent);
}

.blogger-link__name {
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blogger-link__arrow {
  margin-left: auto;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.blogger-link:hover .blogger-link__arrow {
  color: var(--accent);
}

@media (max-width: 480px) {
  .blogger-link {
    max-width: none;
  }
}

/* ---------- Рандомайзер: скорость, звук, крупные числа ---------- */

.segmented--wide {
  display: flex;
  width: 100%;
}

.segmented--wide button {
  flex: 1;
  min-width: 0;
  padding-inline: 6px;
  font-size: var(--text-xs);
  white-space: nowrap;
}

.rng__number {
  min-width: 0;
  padding-inline: 18px;
  font-size: clamp(1.35rem, 4.6vw, 1.9rem);
  font-variant-numeric: tabular-nums;
}

.rng__number.is-rolling {
  filter: blur(0.7px);
  opacity: 0.7;
}

.rng__result {
  gap: var(--s-3);
  align-content: center;
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--dur-fast), border-color var(--dur-fast), background-color var(--dur-fast);
}

.sound-toggle svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sound-toggle .sound-toggle__on {
  display: none;
}

.sound-toggle[aria-pressed="true"] .sound-toggle__on {
  display: block;
}

.sound-toggle[aria-pressed="true"] .sound-toggle__off {
  display: none;
}

.sound-toggle[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

@media (max-width: 480px) {
  .segmented--wide button {
    font-size: 11px;
    padding-inline: 3px;
  }
}

.switch--boxed {
  min-height: 48px;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--line);
  background: var(--surface);
}

.mt-2 {
  margin-top: var(--s-2);
}


/* От/До на телефоне остаются в две колонки — они короткие */
@media (max-width: 640px) {
  .rng__range {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Почта на странице контактов ---------- */

.contact-mail {
  display: inline-block;
  margin-top: var(--s-2);
  font-size: var(--text-2xl);
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--accent);
  text-decoration: none;
  word-break: break-word;
}

.contact-mail:hover {
  text-decoration: underline;
}

/* ---------- Хлебные крошки ---------- */

.crumbs {
  padding-block: var(--s-4) 0;
  font-size: var(--text-sm);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--muted);
}

.crumbs li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.crumbs li + li::before {
  content: "›";
  color: var(--muted-2);
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
  max-width: 40ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crumbs a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.crumbs [aria-current="page"] {
  color: var(--ink-soft);
  max-width: 46ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.crumbs + .section-head,
.crumbs + section,
.crumbs + h1,
.crumbs + .eyebrow {
  margin-top: var(--s-5);
}
