*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* Ночная палитра. #081747 остаётся в крупных пятнах: на чёрном он слишком тёмный для текста. */
  --ink: #16130f;
  --paper: #f4efe6;
  --paper-2: #fffdf8;
  --red: #0867f9;
  --red-deep: #0647b0;
  --gold: #d9a43b;
  --gold-deep: #081747;
  --muted: #b7c3d6;
  --line: rgba(183, 195, 214, 0.28);
  --focus: #0867f9;
  --night: #05060c;
  --panel: #111a2d;
  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(720px 520px at 50% 280px, rgba(8, 103, 249, 0.24), transparent 68%),
    radial-gradient(820px 420px at 100% -10%, rgba(8, 23, 71, 0.95), transparent 62%),
    radial-gradient(640px 360px at -8% 20%, rgba(8, 23, 71, 0.8), transparent 58%),
    var(--night);
  color: #f7f9fc;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 12px;
  z-index: 5;
}

.skip:focus {
  top: 12px;
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 72px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  padding: 22px 0 16px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.brand,
.season {
  margin: 0;
  font-family: Unbounded, "Arial Narrow", sans-serif;
}

.brand {
  color: #f7f9fc;
  text-decoration: none;
  font-size: 15px;
}

.season {
  color: #d5deec;
  font-size: 13px;
}

.eyebrow {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 8px 0 12px;
  max-width: 14ch;
  font-family: Unbounded, "Arial Narrow", sans-serif;
  font-size: clamp(28px, 4.5vw, 46px);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.03em;
}

/* Плашка над заголовком убрана, поэтому на промостранице заголовок начинается сразу. */
.hero h1 {
  margin-top: 0;
}

.lede {
  max-width: 46ch;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

/* Тексты слева, таймер справа; на узком экране таймер переносится под тексты. */
.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: center;
  justify-content: space-between;
}

/* Текст сжимается и переносится сам, чтобы таймер помещался справа. */
.hero-text {
  flex: 1 1 320px;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(56px, auto));
  gap: 12px;
}

/* Подпись над цифрами занимает всю ширину сетки таймера. */
.countdown-label {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.countdown-cell {
  display: grid;
  justify-items: center;
  gap: 6px;
}

/* Насыщенный жёлтый ярче общего --gold, чтобы таймер не терялся на тёмном фоне; tabular-nums не даёт цифрам прыгать при смене. */
.countdown-cell > span {
  color: #ffd21f;
  font-family: Unbounded, "Arial Narrow", sans-serif;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 0 24px rgba(255, 210, 31, 0.55);
}

/* Сотые секунды мелким золотом у верхнего края секунд — ощущение спешки. */
.countdown-cell sup {
  margin-left: 2px;
  font-size: 0.38em;
  vertical-align: top;
  line-height: 1;
}

.countdown-cell small {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.banner {
  max-width: 46ch;
}

.banner {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(183, 195, 214, 0.4);
  color: #f7f9fc;
}

.noscript {
  width: min(1120px, calc(100% - 32px));
  margin: 16px auto;
}

.stage {
  display: grid;
  gap: 40px;
  align-items: center;
  margin-top: 48px;
}

.wheel-stage {
  display: grid;
  justify-items: center;
}

.wheel-ring {
  position: relative;
  width: min(100%, 540px);
  /* Квадрат только от ширины: без содержимого в потоке и с min-height: 0
     Safari не растягивает обод по высоте в овал. */
  aspect-ratio: 1 / 1;
  min-height: 0;
  align-self: start;
  padding: 14px;
  border-radius: 50%;
  /* Обод Чёрной пятницы: центр закрыт диском, видна только золотая полоса. */
  background:
    linear-gradient(160deg, #f6e2a8 0%, var(--gold) 38%, #8d6b2e 72%, #f0d48a 100%);
  box-shadow:
    0 0 72px rgba(217, 164, 59, 0.45),
    0 28px 60px rgba(0, 0, 0, 0.45),
    inset 0 0 0 2px rgba(246, 226, 168, 0.9);
}

.wheel-hit {
  position: absolute;
  z-index: 5;
  inset: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  appearance: none;
}

.wheel-hit:disabled {
  cursor: wait;
}

.pointer {
  position: absolute;
  z-index: 4;
  top: 4px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-right: 13px solid transparent;
  border-left: 13px solid transparent;
  border-top: 26px solid var(--red);
  filter: drop-shadow(0 0 8px rgba(8, 103, 249, 0.85));
}

/* Диск вне потока и занимает внутренний квадрат обода (отступ = padding обода). */
.wheel {
  position: absolute;
  inset: 14px;
  overflow: hidden;
  border-radius: 50%;
  background: #081747;
  transform: rotate(0deg);
  will-change: transform;
  /* Подписи секторов меряются в cqw от ширины диска. --sectors задаёт скрипт. */
  --sectors: 10;
  container-type: inline-size;
}

.disc,
.labels {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

/* Цвета секторов ставит скрипт под текущее число призов.
   Объём только по радиусу: свет у центра, темнее к ободу, без углового перепада. */
.disc {
  background: #081747;
}

.disc::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    closest-side circle at 50% 50%,
    rgba(255, 255, 255, 0.32) 0%,
    rgba(255, 255, 255, 0.14) 30%,
    rgba(255, 255, 255, 0) 58%,
    rgba(0, 0, 0, 0.2) 100%
  );
  pointer-events: none;
}

.labels {
  margin: 0;
  padding: 0;
  list-style: none;
}

.spoke {
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 50%;
  transform-origin: bottom center;
}

.spoke span {
  position: absolute;
  top: 26%;
  left: 0;
  width: max-content;
  transform: translateX(-50%);
  font-family: Unbounded, "Arial Narrow", sans-serif;
  font-size: clamp(28px, calc(720px / var(--sectors)), 72px);
  font-weight: 500;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

/* Название у обода: ширина 24cqw меньше хорды сектора на этой высоте, не больше трёх строк. */
.spoke .spoke-title {
  top: 4%;
  display: -webkit-box;
  overflow: hidden;
  width: 24cqw;
  width: calc(240cqw / var(--sectors));
  font-family: Manrope, sans-serif;
  font-size: 11px;
  font-size: clamp(9px, 2.5cqw, 13px);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  white-space: normal;
  text-wrap: balance;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.hub {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  width: 23%;
  aspect-ratio: 1;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 4px solid rgba(8, 103, 249, 0.75);
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 35%, #16356f, #081747 70%);
  color: #f7f9fc;
  font-family: Unbounded, sans-serif;
  font-size: clamp(11px, 2vw, 14px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ticket {
  position: relative;
  padding: 32px 26px 28px;
  background: var(--panel);
  color: #f7f9fc;
  border: 1px solid rgba(8, 103, 249, 0.4);
}

.ticket h2,
.result-kicker {
  margin: 0;
}

.ticket h2,
.result-title {
  font-family: Unbounded, "Arial Narrow", sans-serif;
  font-weight: 700;
  line-height: 1.05;
}

.ticket h2 {
  margin-bottom: 16px;
  font-size: 28px;
}

.field,
.check {
  display: grid;
}

.field {
  gap: 6px;
  margin-bottom: 14px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 16px;
}

.field textarea {
  resize: vertical;
}

.check {
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  margin: 0 0 12px;
  font-weight: 560;
}

.check input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--red);
}

.check a {
  color: var(--red);
}

.ticket .field input,
.ticket .field textarea,
.ticket .field select {
  border-color: #c5d0e4;
  background: #f4f7fb;
  color: #10203a;
}

.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

.form-status {
  min-height: 1.4em;
  margin: 4px 0 10px;
  color: var(--red-deep);
  font-weight: 700;
}

.ticket .form-status {
  color: #ffb4a8;
}

.spin-button,
.cta,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 18px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.spin-button,
.cta {
  width: 100%;
  font-family: Unbounded, "Arial Narrow", sans-serif;
  font-size: 16px;
}

.spin-button {
  background: var(--red);
  color: #fff;
  box-shadow: inset 0 -4px 0 var(--red-deep);
}

.spin-button:disabled {
  background: #3d4d6a;
  color: #f7f9fc;
  box-shadow: none;
  cursor: wait;
}

.cta {
  margin-top: 8px;
  background: var(--red);
  color: #fff;
}

/* Запас снизу, который учитывает scrollIntoView при подкрутке к карточке после вращения. */
.result {
  scroll-margin-bottom: 75px;
}

.result-kicker {
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.result-title {
  margin: 8px 0;
  color: var(--gold);
  font-size: clamp(28px, 5vw, 40px);
}

.result-desc,
.result-note {
  margin: 0 0 10px;
}

.result-note:empty {
  display: none;
}

/* Список подарков под колесом и формой: на всю ширину, вне грида .stage. */
.prize-list {
  margin-top: 48px;
  padding: 32px 26px 28px;
  background: var(--panel);
  border: 1px solid rgba(8, 103, 249, 0.4);
}

.prize-list h2 {
  margin: 0 0 16px;
  font-family: Unbounded, "Arial Narrow", sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
}

.prize-list ol {
  display: grid;
  gap: 10px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: prize;
}

/* Номер рисуем счётчиком, чтобы он стоял в одной колонке с эмодзи и названием. */
.prize-list li {
  display: grid;
  grid-template-columns: 2ch 1.6em minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: prize;
}

.prize-list li::before {
  content: counter(prize);
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.prize-list-emoji {
  font-size: 1.4em;
  text-align: center;
}

/* Круглая кнопка «?» в конце строки открывает описание приза. */
.prize-list-info {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.prize-list-info:hover,
.prize-list-info:focus-visible {
  border-color: var(--red);
  color: #fff;
}

.prize-modal {
  width: min(92vw, 480px);
  padding: 32px 26px 28px;
  background: var(--panel);
  color: #f7f9fc;
  border: 1px solid rgba(8, 103, 249, 0.4);
}

.prize-modal::backdrop {
  background: rgba(5, 6, 12, 0.75);
}

/* Крестик в правом верхнем углу; отступ справа у заголовка, чтобы текст под него не заходил. */
.prize-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.prize-modal-close:hover,
.prize-modal-close:focus-visible {
  color: #fff;
}

.prize-modal-title {
  margin: 0 32px 12px 0;
  color: var(--gold);
  font-family: Unbounded, "Arial Narrow", sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
}

.prize-modal-desc {
  margin: 0;
}

/* Акция закончилась: заголовок с таймером, колесо, форма и список призов уступают место финальному экрану. */
.is-over .skip,
.is-over .hero,
.is-over .banner,
.is-over .stage,
.is-over .prize-list {
  display: none;
}

.finale {
  padding: 48px 26px 40px;
  background: var(--panel);
  border: 1px solid rgba(8, 103, 249, 0.4);
}

.finale h1 {
  max-width: 16ch;
  margin-top: 0;
}

/* Плашка со счётчиком: золотая цифра, как заголовок выпавшего приза. */
.finale-stat {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 28px 0 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 16px;
}

.finale-stat[hidden] {
  display: none;
}

.finale-stat b {
  color: var(--gold);
  font-family: Unbounded, "Arial Narrow", sans-serif;
  font-size: clamp(28px, 5vw, 40px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 36px;
  color: var(--muted);
  font-size: 14px;
}

.foot a {
  width: fit-content;
  color: var(--red);
}

.sheet-page {
  padding-top: 32px;
}

.sheet {
  max-width: 760px;
  padding: 36px 28px 48px;
  background: var(--panel);
  color: #f7f9fc;
  border: 1px solid rgba(8, 103, 249, 0.28);
}

.sheet h1 {
  max-width: none;
  font-size: clamp(34px, 6vw, 56px);
}

.back {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--red);
  font-weight: 700;
  text-decoration: none;
}

.prose p {
  margin: 0 0 14px;
  font-size: 17px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (min-width: 980px) {
  .stage {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 64px;
  }

  .prize-list ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spoke span {
    font-size: clamp(32px, calc(780px / var(--sectors)), 84px);
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  /* На телефоне колесо узкое: эмодзи примерно на 30% меньше базового размера. */
  .spoke span {
    font-size: clamp(22px, calc(500px / var(--sectors)), 56px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .wheel {
    transition: none !important;
  }
}
