body {
  background:
    radial-gradient(ellipse 70% 55% at 68% 30%, rgba(52, 86, 170, 0.45), transparent 70%),
    radial-gradient(ellipse 50% 40% at 70% 70%, rgba(255, 138, 31, 0.10), transparent 70%),
    var(--night);
  background-repeat: no-repeat;
  background-size: 100% 110vh;
}
.nowrap { white-space: nowrap; }
main { overflow-x: clip; }
.muted { color: var(--muted); }

/* ── шапка ── */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: max(12px, env(safe-area-inset-top)) clamp(16px, 4vw, 48px) 12px;
  background: linear-gradient(to bottom, rgba(12, 22, 51, 0.92), rgba(12, 22, 51, 0));
}
.wordmark {
  font: 800 18px/1 var(--display); letter-spacing: 0.04em; text-decoration: none;
  display: inline-flex; align-items: baseline; gap: 6px;
}
.wordmark span { font: 600 15px/1 var(--body); color: var(--mandarin); letter-spacing: 0; }
.topnav { display: flex; gap: 22px; margin-left: auto; }
.topnav a { text-decoration: none; color: var(--frost); font-weight: 600; font-size: 15px; transition: color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .topnav a:hover { color: var(--snow); } }
@media (max-width: 720px) { .topnav { display: none; } .topbar .btn { margin-left: auto; } }

/* ── первый экран ── */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
.hero-drum { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-copy {
  position: relative; z-index: 2; width: min(560px, 46vw);
  margin-left: clamp(16px, 6vw, 96px); padding: 110px 0 64px;
}
.hero-title {
  margin: 0; font: 800 clamp(28px, 4.6vw, 64px)/1.04 var(--display); letter-spacing: -0.01em;
  text-wrap: balance;
}
.hero-lead { margin: 20px 0 0; max-width: 46ch; color: var(--frost); font-size: 18px; line-height: 1.55; }

.live { margin-top: 36px; }
.live-count { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.live-count .tabnum { font: 800 clamp(56px, 7vw, 96px)/0.9 var(--display); color: var(--mandarin); }
.live-label { font-size: 18px; font-weight: 600; color: var(--snow); }
.live-last { margin: 10px 0 0; color: var(--muted); font-size: 15px; min-height: 1.5em; }
.live-last b { color: var(--snow); font-weight: 700; }

.countdown { margin-top: 26px; display: flex; flex-direction: column; gap: 4px; }
.countdown-label { color: var(--muted); font-size: 14px; font-weight: 600; }
.countdown-value { font: 700 clamp(22px, 2.4vw, 30px)/1.1 var(--display); letter-spacing: 0.01em; }

.hero-actions { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 979px) {
  .hero { flex-direction: column; align-items: stretch; min-height: 0; }
  .hero-drum { position: relative; height: 58svh; min-height: 340px; margin-top: 56px; }
  .hero-copy { width: auto; margin: -24px 16px 0; padding: 0 0 48px; }
  .hero-lead { font-size: 16px; }
  .hero-title { font-size: clamp(28px, 8.2vw, 44px); }
}

/* ── табло победителей на первом экране ── */
.board { margin: 28px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; max-width: 440px; }
.board li {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 12px; background: rgba(17, 29, 68, 0.78);
  box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(8px);
}
.board .b-prize { font: 700 15px/1 var(--display); color: var(--brass); }
.board .b-code { font: 700 15px/1 var(--display); }
.board .b-nick { color: var(--muted); font-size: 14px; text-align: right; }
.board li.pending .b-code { color: var(--muted); font-weight: 500; }
.board li.fresh { animation: board-in 520ms var(--ease-out); }
@keyframes board-in { from { opacity: 0; transform: translateY(8px) scale(0.97); } }

/* ── объявление победителя ── */
.reveal {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: end center;
  padding: 0 16px clamp(24px, 9vh, 96px); pointer-events: none;
}
.reveal-card {
  text-align: center; padding: 22px 34px 24px; border-radius: 20px;
  background: rgba(12, 22, 51, 0.82); backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 30px 80px -20px rgba(0, 0, 0, 0.6);
  transform-origin: 50% 100%;
}
.reveal-prize { margin: 0; color: var(--brass); font: 700 18px/1.2 var(--display); }
.reveal-code { margin: 10px 0 0; font-size: clamp(40px, 7vw, 88px); line-height: 1; color: var(--snow); }
.reveal-code .d { display: inline-block; min-width: 0.72em; }
.reveal-nick { margin: 12px 0 0; font-size: 20px; color: var(--frost); min-height: 1.4em; }

/* ── разделы ── */
.section { scroll-margin-top: 24px; width: min(1120px, 100% - 32px); margin: 0 auto; padding: clamp(56px, 9vw, 112px) 0 0; }
.section h2 { margin: 0 0 28px; font: 700 clamp(26px, 3.2vw, 40px)/1.15 var(--display); letter-spacing: -0.01em; }
.note { margin: 22px 0 0; max-width: 68ch; color: var(--muted); }

.prize-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; grid-template-rows: auto auto; gap: 14px; }
.prize {
  position: relative; padding: 22px 22px 20px; border-radius: var(--radius);
  background: var(--night-2); box-shadow: inset 0 0 0 1px var(--line);
}
.prize-main {
  grid-row: span 2; display: flex; flex-direction: column; justify-content: flex-end; min-height: 280px;
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 138, 31, 0.38), transparent 52%),
    linear-gradient(160deg, #1d2f6b, #111d44 70%);
  box-shadow: inset 0 0 0 1px rgba(217, 176, 98, 0.45);
}
.prize-sum { margin: 0; font: 800 clamp(24px, 3vw, 40px)/1 var(--display); white-space: nowrap; }
.prize-main .prize-sum { font-size: clamp(52px, 7vw, 92px); color: var(--snow); }
.prize-name { margin: 10px 0 0; color: var(--frost); font-weight: 600; }
.prize-main .prize-name { color: var(--brass); font-size: 18px; }
.prize-winner { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-weight: 600; }
.prize-winner .ticket-code { color: var(--mandarin); }
@media (max-width: 760px) {
  .prize-grid { grid-template-columns: 1fr 1fr; }
  .prize-main { grid-column: span 2; grid-row: auto; min-height: 200px; }
}

.step-list { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.step-list li { counter-increment: step; position: relative; padding-top: 62px; }
.step-list li::before {
  content: counter(step); position: absolute; top: 0; left: 0;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--mandarin); color: #1a0d00; font: 800 18px/1 var(--display);
}
.step-list li:nth-child(2)::before { background: var(--snow); color: var(--night); }
.step-list li:nth-child(3)::before { background: var(--brass); }
.step-list h3 { margin: 0; font: 700 19px/1.3 var(--display); }
.step-list p { margin: 10px 0 0; color: var(--frost); max-width: 40ch; }
@media (max-width: 760px) { .step-list { grid-template-columns: 1fr; gap: 26px; } }

.stats-figures { display: flex; gap: clamp(24px, 6vw, 72px); flex-wrap: wrap; margin-bottom: 30px; }
.stats-figures p { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.fig { font: 800 clamp(36px, 4.4vw, 56px)/1 var(--display); }
.stats-figures p:first-child .fig { color: var(--mandarin); }
.fig-label { color: var(--muted); font-weight: 600; }
.chart { margin: 0; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; gap: 4px; height: 180px; padding-bottom: 26px; position: relative; border-bottom: 1px solid var(--line); }
.bar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar i { display: block; width: 100%; max-width: 28px; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--mandarin); transform-origin: bottom; }
.bar.zero i { background: var(--line-strong); }
.bar b { position: absolute; top: calc(100% + 6px); font-size: 11px; font-weight: 600; color: var(--muted); }
.bar em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--frost); margin-bottom: 4px; }
.bar.future i { opacity: 0; }
@media (max-width: 720px) { .bar em { display: none; } }
.chart-caption { margin-top: 12px; color: var(--muted); font-size: 14px; }

.participants-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.participants-head h2 { margin: 0; }
.search input {
  width: min(320px, 100vw - 32px); height: 46px; padding: 0 16px; border-radius: 12px;
  background: var(--night-2); border: 1px solid var(--line-strong); font-size: 16px;
}
.search input::placeholder { color: var(--muted); }
.table-wrap { border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.ptable { width: 100%; border-collapse: collapse; }
.ptable th { text-align: left; font-size: 13px; font-weight: 700; color: var(--muted); padding: 12px 16px; background: var(--night-2); }
.ptable td { padding: 12px 16px; border-top: 1px solid var(--line); }
.ptable td:first-child { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }
.ptable td:last-child { color: var(--muted); white-space: nowrap; }
.ptable tr.win td:first-child { color: var(--mandarin); }
.ptable tr.win td:nth-child(2)::after { content: ' — победитель'; color: var(--brass); font-weight: 700; }
.ptable tr.new { animation: row-in 700ms var(--ease-out); }
@keyframes row-in { from { background: rgba(255, 138, 31, 0.18); } }
@media (max-width: 520px) { .ptable th, .ptable td { padding: 10px 12px; font-size: 14px; } }
.empty { margin: 0; padding: 28px 16px; color: var(--muted); text-align: center; }
.more { margin-top: 16px; }

.fair-list { margin: 0; padding-left: 22px; display: grid; gap: 14px; max-width: 76ch; color: var(--frost); }
.fair-list strong { color: var(--snow); }
.fair-data { margin: 28px 0 0; display: grid; gap: 12px; }
.fair-data div { display: grid; grid-template-columns: 190px 1fr; gap: 12px; }
.fair-data dt { color: var(--muted); font-weight: 600; }
.fair-data dd { margin: 0; }
.hash { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 14px; word-break: break-all; color: var(--frost); }
@media (max-width: 600px) { .fair-data div { grid-template-columns: 1fr; gap: 2px; } }
.fair-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.verify { margin: 18px 0 0; padding-left: 22px; display: grid; gap: 6px; color: var(--frost); font-size: 15px; }
.verify .ok { color: var(--pine); font-weight: 700; }
.verify .bad { color: var(--danger); font-weight: 700; }

.dates { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; position: relative; }
.dates li { position: relative; padding: 30px 16px 0 0; display: flex; flex-direction: column; gap: 6px; border-top: 2px solid var(--line-strong); }
.dates li::before { content: ''; position: absolute; top: -7px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--night); box-shadow: inset 0 0 0 2px var(--frost); }
.dates li.done { border-top-color: var(--mandarin); }
.dates li.done::before { background: var(--mandarin); box-shadow: none; }
.dates li.now::before { background: var(--mandarin); box-shadow: 0 0 0 6px rgba(255, 138, 31, 0.25); }
.dates time { font: 700 17px/1.3 var(--display); }
.dates span { color: var(--frost); }
@media (max-width: 760px) {
  .dates { grid-template-columns: 1fr; gap: 22px; }
  .dates li { border-top: 0; border-left: 2px solid var(--line-strong); padding: 0 0 0 22px; }
  .dates li.done { border-left-color: var(--mandarin); }
  .dates li::before { top: 4px; left: -7px; }
}

.footer { width: min(1120px, 100% - 32px); margin: clamp(64px, 10vw, 120px) auto 0; padding: 28px 0 calc(36px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer p { margin: 0 0 6px; }
