/* ==========================================================================
   Лотерея — минимализм в духе apple.com. Один акцент #0a84ff.
   ========================================================================== */
:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --fg: #1d1d1f;
  --fg-2: #6e6e73;
  --fg-3: #86868b;
  --line: #e5e5e7;
  --accent: #0a84ff;
  --red: #ff3b30;
  --red-soft: #fff1f0;
  --green: #30d158;
  --black: #000000;
  --radius: 18px;
  --radius-lg: 20px;
  --radius-sm: 12px;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.04), 0 12px 40px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.05), 0 24px 64px rgba(0, 0, 0, 0.1);
  --t: 300ms cubic-bezier(0.25, 0.1, 0.25, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --nav-h: 56px;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: opacity var(--t); }
a:hover { opacity: 0.75; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
[hidden] { display: none !important; }
::selection { background: rgba(10, 132, 255, 0.2); }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 640px; }
.center { text-align: center; }
.muted { color: var(--fg-2); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); letter-spacing: 0; word-break: break-all; }

/* ------------------------------------------------------------------ nav -- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--t), border-color var(--t), backdrop-filter var(--t);
}
.nav.scrolled, .nav.solid {
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--line);
}
.nav .wrap { height: 100%; display: flex; align-items: center; gap: 28px; }
.nav-logo { display: flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 600; font-size: 17px; }
.nav-logo img { width: 28px; height: 28px; border-radius: 8px; }
.nav-links { display: flex; gap: 28px; margin-left: 12px; }
.nav-links a, .nav-links button { color: var(--fg); font-size: 14px; opacity: 0.8; background: none; border: 0; padding: 0; cursor: pointer; }
.nav-links a:hover, .nav-links button:hover { opacity: 1; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.nav-account { font-size: 14px; color: var(--fg); opacity: 0.8; white-space: nowrap; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 4px 10px;
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
  color: var(--fg); background: transparent; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.lang-btn:hover { border-color: currentColor; }
.nav-dark .lang-btn { color: #f5f5f7; border-color: rgba(255, 255, 255, 0.28); }
.lang-btn { font-size: 16px; line-height: 1; padding: 4px 9px; }
.lang-wrap { position: relative; display: inline-flex; }
.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 150px;
  display: flex; flex-direction: column; padding: 6px;
  background: #fff; border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}
.lang-menu[hidden] { display: none; }
.lang-item {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 12px;
  font: inherit; font-size: 15px; text-align: left; color: #1d1d1f; background: none; border: 0; border-radius: 9px; cursor: pointer;
}
.lang-item:hover, .lang-item:focus-visible { background: #f2f2f4; }
.lang-item[aria-checked="true"] { font-weight: 600; }
.lang-item[aria-checked="true"]::after { content: "✓"; color: #0a7a3d; }

/* -------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 980px; cursor: pointer;
  font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: transform var(--t), background var(--t), opacity var(--t), box-shadow var(--t);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { opacity: 1; }
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.35; cursor: not-allowed; transform: none; }
.btn-sm { padding: 7px 16px; font-size: 14px; }
.btn-md { padding: 12px 24px; font-size: 17px; }
.btn-lg { padding: 20px 44px; font-size: 21px; font-weight: 600; }
.btn-black { background: var(--black); color: #fff; }
.btn-black:hover { background: #2a2a2c; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #0077ed; }
.btn-ghost { background: var(--bg-soft); color: var(--fg); }
.btn-ghost:hover { background: #ebebee; }
.btn-outline { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.btn-outline:hover { box-shadow: inset 0 0 0 1px #c7c7cc; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-size: inherit; }
.btn-block { width: 100%; }

/* ----------------------------------------------------------------- hero -- */
.hero { padding: calc(var(--nav-h) + 96px) 0 40px; text-align: center; }
.jackpot-label { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: #86868b; }
.jackpot {
  margin: 12px 0 0;
  font-size: clamp(56px, 17vw, 96px);
  font-weight: 700; line-height: 1; letter-spacing: -0.04em; color: #000;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

.countdown { margin-top: 56px; }
.countdown-value {
  font-family: "SF Mono", ui-monospace, Menlo, "DejaVu Sans Mono", Consolas, monospace;
  font-size: clamp(38px, 11.5vw, 96px);
  font-weight: 600; line-height: 1; letter-spacing: -0.02em; color: #000;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.countdown-label { margin-top: 14px; font-size: 14px; color: #86868b; }
/* Дни — отдельной строкой над таймером: «8 ДНЕЙ» */
.countdown-days {
  font-weight: 800; font-size: clamp(26px, 7vw, 52px); line-height: 1.05;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; color: #b07d12;
}
.countdown-dark .countdown-days { color: #ffd66b; }
.countdown.phase2 .countdown-days { color: #ff453a; }
.countdown.phase2 .countdown-value { color: #ff3b30; animation: lastChance 1.5s ease-in-out infinite; }
.countdown.phase2 .countdown-label { color: #ff3b30; font-weight: 700; }
.countdown.done .countdown-value { color: #86868b; animation: none; }
.countdown.done .countdown-label { color: #86868b; font-weight: 400; }
@keyframes lastChance { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.draw-date { margin-top: 10px; font-size: 12px; color: #86868b; }

.hero-slogan { margin: 18px 0 0; font-size: clamp(22px, 3.2vw, 32px); font-weight: 600; letter-spacing: -0.02em; color: var(--fg); }
.btn-xl { padding: 28px 72px; font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; min-width: 420px; letter-spacing: -0.02em; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18); }
.btn-xl:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22); }
.hero-cta { margin-top: 48px; display: flex; flex-direction: column; align-items: center; gap: 12px; }

.hero-badge-row { display: flex; justify-content: center; padding: 0 var(--gutter) 88px; }
.pill-badge {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 20px; padding: 6px 14px;
  font-size: 13px; color: var(--fg-2); background: var(--bg);
  transition: border-color var(--t), color var(--t);
}
a.pill-badge:hover { opacity: 1; border-color: #c7c7cc; color: var(--fg); }

.info-note { margin-top: 24px; background: #f5f5f7; border-radius: 12px; padding: 14px; font-size: 14px; color: var(--fg); line-height: 1.45; }
.cta-caption { font-size: 12px; color: #86868b; }

/* -------------------------------------------------------------- section -- */
.section { padding: 120px 0; }
.section-soft { background: var(--bg-soft); }
.section h2 { font-size: clamp(36px, 5.5vw, 56px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.07; margin: 0 0 16px; text-align: center; }
.section .lead { text-align: center; color: var(--fg-2); font-size: 21px; margin: 0 auto 64px; max-width: 620px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 40px 32px; box-shadow: var(--shadow);
  transition: transform var(--t), box-shadow var(--t);
}
.step:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.step-num { width: 44px; height: 44px; border-radius: 50%; background: var(--fg); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 17px; margin-bottom: 28px; }
.step h3 { font-size: 28px; letter-spacing: -0.03em; margin: 0 0 10px; }
.step p { margin: 0; color: var(--fg-2); }
.step-arrow { display: none; }

.support-block { text-align: center; }
.support-block p { color: var(--fg-2); font-size: 19px; margin: 0 auto 32px; max-width: 520px; }

/* --------------------------------------------------------------- footer -- */
.footer { border-top: 1px solid var(--line); padding: 32px 0 48px; font-size: 13px; color: var(--fg-3); }
.footer .wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer a { color: var(--fg-2); }
.footer .copy { margin-left: auto; }

/* ----------------------------------------------------------------- page -- */
.page { padding: calc(var(--nav-h) + 64px) 0 96px; min-height: 100vh; }
.page h1 { font-size: clamp(36px, 6vw, 56px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.07; margin: 0 0 12px; }
.page .lead { color: var(--fg-2); font-size: 19px; margin: 0 0 40px; }

.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
/* Покупка: необязательное «Кто тебя пригласил?» */
.ref-box { text-align: left; margin: 18px 0 14px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bg-soft); }
.ref-label { display: block; font-weight: 600; margin-bottom: 8px; }
.ref-row { display: flex; gap: 8px; }
.ref-row .input { flex: 1; min-width: 0; }
.ref-row .btn { flex: none; }
.ref-msg { margin-top: 8px; font-size: 14px; color: var(--fg-2); }
.ref-msg.form-error { color: var(--red); margin: 8px 0 0; min-height: 0; }
.ref-msg.form-ok { color: inherit; }
.card-soft { background: var(--bg-soft); border-color: transparent; box-shadow: none; }

/* ----------------------------------------------------------------- forms -- */
.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: 14px; font-weight: 500; color: var(--fg-2); margin-bottom: 8px; }
.field > span em { font-style: normal; color: var(--fg-3); font-weight: 400; }
.input {
  width: 100%; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg); outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  font-size: 17px;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.15); }
textarea.input { min-height: 120px; resize: vertical; }
.form-error { color: var(--red); font-size: 14px; min-height: 20px; margin: 4px 0 12px; }
.form-ok { color: #1a7f37; font-size: 15px; margin: 4px 0 12px; }

/* ------------------------------------------------------------------ buy -- */
.warnings { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 8px; }
.warnings li {
  color: var(--red); background: var(--red-soft); border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 15px; font-weight: 600; line-height: 1.35;
}
.pay-amount { text-align: center; margin: 8px 0 28px; }
.pay-amount .big { font-size: clamp(48px, 9vw, 72px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.pay-amount .cur { color: var(--fg-2); font-size: 17px; margin-top: 8px; }
.pay-grid { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: center; }
.qr { width: 220px; height: 220px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.qr svg { width: 100%; height: 100%; display: block; }
.addr-label { font-size: 14px; color: var(--fg-2); margin-bottom: 8px; }
.addr {
  font-family: var(--mono); font-size: 17px; letter-spacing: 0; word-break: break-all;
  background: var(--bg-soft); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 12px; user-select: all;
}
.pay-status { display: flex; align-items: center; gap: 12px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--fg-2); font-size: 15px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 6px; background: var(--bg-soft); border-radius: 6px; overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width 600ms ease; }

.ticket-reveal { text-align: center; padding: 24px 0 8px; animation: rise 600ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.ticket-reveal .emoji { font-size: 64px; line-height: 1; }
.ticket-reveal .label { font-size: 21px; color: var(--fg-2); margin: 20px 0 8px; }
.ticket-code { font-size: clamp(28px, 7.4vw, 56px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ticket-number { margin-top: 12px; font-size: 17px; color: var(--fg-2); }
.ticket-actions { margin-top: 36px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
@keyframes rise { from { opacity: 0; transform: translateY(20px) scale(0.98); } to { opacity: 1; transform: none; } }

.state-box { text-align: center; padding: 24px 0; }
.state-box .icon { font-size: 48px; }
.state-box h2 { font-size: 28px; letter-spacing: -0.03em; margin: 16px 0 8px; }
.state-box p { color: var(--fg-2); margin: 0 0 24px; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100; }

/* ---------------------------------------------------------- tickets list -- */
.tlist { display: grid; gap: 12px; }
.titem { display: flex; align-items: center; gap: 16px; padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); transition: box-shadow var(--t); }
.titem:hover { box-shadow: var(--shadow); }
.titem .code { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.titem .meta { font-size: 14px; color: var(--fg-2); }
.titem .badge { margin-left: auto; }
.titem-more { margin-top: 10px; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 980px; font-size: 13px; font-weight: 500; background: var(--bg-soft); color: var(--fg-2); white-space: nowrap; }
.badge-blue { background: rgba(10, 132, 255, 0.1); color: var(--accent); }
.badge-green { background: rgba(48, 209, 88, 0.14); color: #1a7f37; }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-gray { background: var(--bg-soft); color: var(--fg-3); }
.empty { text-align: center; padding: 64px 24px; color: var(--fg-2); }
.empty .icon { font-size: 44px; margin-bottom: 12px; }

/* --------------------------------------------------------------- profile -- */
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 14px 24px; margin: 0; }
.kv dt { color: var(--fg-2); }
.kv dd { margin: 0; font-weight: 500; }

/* ----------------------------------------------------------------- modal -- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.36); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade var(--t); }
.modal-card { position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; background: var(--bg); border-radius: 24px; padding: 36px 32px 28px; box-shadow: var(--shadow-lg); animation: rise var(--t); }
.modal-card h2 { margin: 0 0 6px; font-size: 28px; letter-spacing: -0.03em; }
.modal-card .lead { color: var(--fg-2); margin: 0 0 24px; font-size: 15px; }
.modal-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--bg-soft); cursor: pointer; font-size: 18px; line-height: 1; color: var(--fg-2); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(20px); background: var(--fg); color: #fff; padding: 12px 20px; border-radius: 980px; font-size: 15px; opacity: 0; transition: opacity var(--t), transform var(--t); z-index: 120; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------------------------------------------------------- tables -- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; letter-spacing: -0.01em; }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-weight: 600; color: var(--fg-2); background: var(--bg-soft); position: sticky; top: 0; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.mono { font-size: 12px; max-width: 220px; }
.tbl .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- admin -- */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 28px; padding: 4px; background: var(--bg-soft); border-radius: 980px; width: max-content; max-width: 100%; overflow-x: auto; }
.admin-tabs button { border: 0; background: none; padding: 8px 18px; border-radius: 980px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--fg-2); transition: background var(--t), color var(--t); white-space: nowrap; }
.admin-tabs button.active { background: var(--bg); color: var(--fg); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); }
.admin-tabs .count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; line-height: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--bg-soft); border-radius: var(--radius); padding: 22px 24px; }
.stat .v { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .k { color: var(--fg-2); font-size: 14px; margin-top: 4px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .input { width: auto; flex: 1; min-width: 180px; padding: 10px 14px; font-size: 15px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 980px; padding: 6px 14px; font-size: 13px; cursor: pointer; transition: all var(--t); }
.chip.active { background: var(--fg); color: #fff; border-color: var(--fg); }
.draw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.winner-code { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; }

/* ------------------------------------------------------------ responsive -- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .draw-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .hero { padding-top: calc(var(--nav-h) + 56px); }
  .countdown { margin-top: 44px; }
  .hero-cta { margin-top: 40px; }
  .hero-badge-row { padding-bottom: 64px; }
  .btn-lg { padding: 18px 24px; font-size: 18px; width: 100%; white-space: normal; }
  .btn-xl { padding: 24px 20px; font-size: 22px; width: 100%; min-width: 0; }
  .section { padding: 80px 0; }
  .card { padding: 22px 18px; }
  .pay-grid { grid-template-columns: 1fr; justify-items: center; }
  .pay-grid > div:last-child { width: 100%; }
  .kv { grid-template-columns: 1fr; gap: 4px; }
  .kv dd { margin-bottom: 12px; }
  .titem { flex-wrap: wrap; padding: 16px 18px; }
  .titem .badge { margin-left: 0; }
  .footer .copy { margin-left: 0; width: 100%; }
  .nav .wrap { gap: 12px; }
  .nav-right { gap: 10px; }
  .nav-account { display: none; }
  .modal-card { padding: 30px 20px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===================================================== главная: тёмный hero */
.btn-white { background: #fff; color: #000; }
.btn-white:hover { background: #f2f2f2; }

.nav-dark .nav-logo, .nav-dark .nav-links a, .nav-dark .nav-links button, .nav-dark .nav-account { color: #f5f5f7; }
.nav-dark .nav-logo img { filter: invert(1); }
.nav-dark.scrolled { background: rgba(0, 0, 0, 0.72); border-bottom-color: rgba(255, 255, 255, 0.08); }

.hero-dark {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 56px) 0 64px;
  background: #000; color: #f5f5f7; text-align: center;
}
.hero-glow {
  position: absolute; z-index: -1; left: 50%; top: 34%;
  width: min(1100px, 160vw); aspect-ratio: 1; transform: translate(-50%, -50%);
  background:
    radial-gradient(closest-side, rgba(255, 196, 77, 0.30), rgba(255, 160, 40, 0.10) 45%, transparent 70%),
    radial-gradient(closest-side at 70% 70%, rgba(10, 132, 255, 0.14), transparent 70%);
  filter: blur(10px);
  animation: glowBreath 6s ease-in-out infinite;
}
@keyframes glowBreath { 0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } }
.hero-inner { position: relative; }

.hero-eyebrow {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  color: #f5c451; padding: 6px 14px; border: 1px solid rgba(245, 196, 81, 0.35); border-radius: 20px;
  background: rgba(245, 196, 81, 0.08);
}
.jackpot-gold {
  margin: 18px 0 0;
  font-size: clamp(64px, 20vw, 176px); font-weight: 800; line-height: 0.95; letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  background: linear-gradient(180deg, #fff7dc 0%, #ffd66b 38%, #f0a92b 72%, #b8741a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 8px 48px rgba(255, 190, 60, 0.35));
}
.hero-slogan-big { margin: 22px 0 0; font-size: clamp(26px, 4.4vw, 48px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; color: #fff; }
.hero-slogan-big .gold { color: #ffd66b; white-space: nowrap; }
.hero-slogan-big .strike { color: #86868b; text-decoration: line-through; text-decoration-thickness: 3px; text-decoration-color: rgba(255, 59, 48, 0.85); }
.hero-anchor { margin: 12px 0 0; font-size: 17px; color: #a1a1a6; }
.hero-anchor b { color: #f5f5f7; font-weight: 600; }

.countdown-dark { margin-top: 52px; }
.countdown-dark .countdown-value { color: #fff; }
.countdown-dark .countdown-label { color: #a1a1a6; }
.countdown-dark.phase2 .countdown-value, .countdown-dark.phase2 .countdown-label { color: #ff453a; }
.countdown-dark.done .countdown-value, .countdown-dark.done .countdown-label { color: #6e6e73; }
.hero-dark .draw-date { color: #86868b; }

.hero-dark .hero-cta { margin-top: 44px; }
.btn-glow { position: relative; animation: ctaGlow 2.4s ease-in-out infinite; }
@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 214, 107, 0.0), 0 12px 40px rgba(255, 190, 60, 0.25); }
  50% { box-shadow: 0 0 0 10px rgba(255, 214, 107, 0.12), 0 12px 56px rgba(255, 190, 60, 0.45); }
}
.btn-glow[aria-disabled="true"] { animation: none; background: #2c2c2e; color: #86868b; }
.cta-sub { font-size: 13px; color: #86868b; }

.trust-row { margin-top: 40px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pill-dark { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.14); color: #c7c7cc; }
a.pill-dark:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }

@media (max-width: 600px) {
  .hero-dark { min-height: auto; padding-top: calc(var(--nav-h) + 40px); }
  .hero-slogan-big { margin-top: 16px; }
  .countdown-dark { margin-top: 40px; }
  .trust-row { flex-direction: column; align-items: center; }
  .nav-dark .btn-white { padding: 7px 14px; }
}

/* ===================================================== мобильная оплата */
.buy-lead b { color: var(--fg); }
.x-badge { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 8px; background: #fff4d6; color: #a86800 !important; font-size: 0.9em; }
.x-badge:empty { display: none; }
.pay-amount { margin: 4px 0 24px; }
.pay-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.pay-actions .btn { width: 100%; white-space: normal; text-align: center; }
.pay-status { align-items: flex-start; margin-top: 24px; padding-top: 20px; }
.pay-status .spinner { margin-top: 2px; }
.pay-eta { margin-top: 10px; font-size: 15px; font-weight: 600; color: var(--fg); }
.pay-expiry { margin-top: 4px; font-size: 13px; color: var(--fg-3); }
.qr-box { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.qr-box summary { cursor: pointer; font-size: 14px; color: var(--accent); list-style: none; }
.qr-box summary::-webkit-details-marker { display: none; }
.qr-box summary::before { content: '▸ '; }
.qr-box[open] summary::before { content: '▾ '; }
.qr-box .qr { margin: 16px auto 0; }

/* ===================================================== липкая кнопка (телефон) */
.sticky-buy { display: none; }
@media (max-width: 760px) {
  .sticky-buy {
    display: flex; align-items: center; gap: 12px;
    position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    padding: 10px 10px 10px 18px; border-radius: 22px;
    background: rgba(18, 18, 20, 0.92); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); color: #fff;
    transform: translateY(140%); opacity: 0; transition: transform var(--t), opacity var(--t);
  }
  .sticky-buy.show { transform: none; opacity: 1; }
  .sticky-buy-info { display: flex; flex-direction: column; line-height: 1.15; }
  .sticky-buy-label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: #a1a1a6; }
  .sticky-buy-info b { font-size: 22px; color: #ffd66b; font-variant-numeric: tabular-nums; }
  .sticky-buy .btn { margin-left: auto; padding: 14px 22px; font-weight: 700; }
}

@media (max-width: 600px) {
  .page { padding-top: calc(var(--nav-h) + 32px); }
  .page h1 { font-size: 34px; }
  .buy-lead { font-size: 16px; margin-bottom: 20px; }
  #vPay .card { padding: 18px 14px; }
  .warnings { margin-bottom: 16px; }
  .warnings li { padding: 10px 12px; font-size: 14px; }
  .pay-amount .big { font-size: 56px; }
  .addr { font-size: 15px; padding: 12px 14px; }
  .pay-actions { grid-template-columns: 1fr 1fr; }
  .pay-actions #copyAddr { grid-column: 1 / -1; padding: 16px; font-size: 18px; font-weight: 600; }
  .pay-actions .btn-ghost { font-size: 14px; padding: 12px 10px; }
  .footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

.addr span { margin-right: 0.4em; }
.addr span:last-child { margin-right: 0; }
.btn.copied { background: #1f9d55 !important; color: #fff !important; }
.wallet-hint { margin: 10px 0 0; font-size: 13px; color: var(--fg-3); text-align: center; }
.pay-help { margin: 16px 0 0; font-size: 14px; color: var(--fg-2); text-align: center; }
@media (max-width: 600px) {
  .warnings li { font-size: 13px; }
  .addr { font-size: 16px; letter-spacing: 0.02em; }
}
.addr span { display: inline-block; }

/* ===================================================== вау-слой главной */
.hero-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.hero-dark.last-chance .hero-glow {
  background:
    radial-gradient(closest-side, rgba(255, 69, 58, 0.30), rgba(255, 120, 40, 0.12) 45%, transparent 70%),
    radial-gradient(closest-side at 70% 70%, rgba(255, 196, 77, 0.14), transparent 70%);
}

/* блик по золотой сумме */
.jackpot-gold.shimmer {
  background:
    linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.85) 50%, transparent 62%) -150% 0 / 60% 100% no-repeat,
    linear-gradient(180deg, #fff7dc 0%, #ffd66b 38%, #f0a92b 72%, #b8741a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: goldShine 4.5s ease-in-out infinite;
}
@keyframes goldShine { 0%, 55% { background-position: -150% 0, 0 0; } 85%, 100% { background-position: 250% 0, 0 0; } }

/* блик по кнопке */
.btn-glow { overflow: hidden; }
.btn-glow::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(105deg, transparent, rgba(255, 214, 107, 0.55), transparent);
  transform: skewX(-20deg); animation: btnShine 3.2s ease-in-out infinite;
}
@keyframes btnShine { 0%, 60% { left: -60%; } 100% { left: 130%; } }

/* второй экран: золотой билет */
.ticket-show { background: radial-gradient(120% 80% at 50% 0%, #1a1305 0%, #000 60%); color: #f5f5f7; text-align: center; padding: 72px 0 96px; }
.ticket-show-kicker { font-size: 13px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: #a1a1a6; }
.gold-ticket {
  position: relative; width: min(360px, 100%); margin: 28px auto 0; padding: 22px 26px;
  border-radius: 22px; color: #3b2400; text-align: left;
  background: linear-gradient(135deg, #fff3c4 0%, #ffd66b 30%, #f0a92b 65%, #ffe9a6 100%);
  box-shadow: 0 30px 80px rgba(255, 180, 40, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  animation: ticketFloat 6s ease-in-out infinite;
}
@keyframes ticketFloat {
  0%, 100% { transform: rotate(-2.5deg) translateY(0); }
  50% { transform: rotate(1.5deg) translateY(-10px); }
}
.gt-notch { position: absolute; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%; background: #0b0802; }
.gt-notch-l { left: -13px; } .gt-notch-r { right: -13px; }
.gt-top, .gt-bottom { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; opacity: 0.75; }
.gt-bottom b { font-size: 22px; letter-spacing: -0.02em; opacity: 1; text-transform: none; }
.gt-code { margin: 14px 0; font-family: "SF Mono", ui-monospace, Menlo, "DejaVu Sans Mono", monospace; font-size: clamp(24px, 7.4vw, 32px); font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; color: #241400; }
.gt-code.rolling { filter: blur(0.6px); }
.gt-line { border-top: 2px dashed rgba(59, 36, 0, 0.25); margin: 0 0 12px; }
.ticket-show-text { margin: 32px auto 28px; font-size: 19px; color: #c7c7cc; line-height: 1.45; }
.ticket-show-text .gold { color: #ffd66b; }

@media (max-width: 600px) {
  .ticket-show { padding: 56px 0 72px; }
  .gold-ticket { padding: 18px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .jackpot-gold.shimmer, .btn-glow::after, .gold-ticket { animation: none !important; }
}

/* ===================================================== призовые места */
.hero-places { margin: 14px auto 0; display: inline-block; padding: 8px 16px; border-radius: 20px; font-size: 15px; color: #f5f5f7;
  background: rgba(255, 214, 107, 0.10); border: 1px solid rgba(255, 214, 107, 0.28); }
.hero-places b { color: #ffd66b; }
.prize-ladder { width: min(360px, 100%); margin: 0 auto 32px; display: grid; gap: 8px; }
.pl-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.10); font-size: 17px; }
.pl-row .pl-place { color: #c7c7cc; }
.pl-row .pl-sum { font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.pl-first { padding: 16px 18px; background: linear-gradient(135deg, rgba(255, 214, 107, 0.22), rgba(240, 169, 43, 0.12)); border-color: rgba(255, 214, 107, 0.45); }
.pl-first .pl-place { color: #ffd66b; font-weight: 600; }
.pl-first .pl-sum { color: #ffd66b; font-size: 24px; }
.win-row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.win-row:last-of-type { border-bottom: 0; }
.win-place { font-size: 14px; color: var(--fg-2); }
.winner-code-sm { font-size: 24px; }
.adm-winner { padding: 14px 0; border-bottom: 1px solid var(--line); }
.adm-winner:last-child { border-bottom: 0; }
.buy-places { display: block; margin: 6px 0 2px; color: var(--fg); font-weight: 600; }

.pl-sum small { font-size: 0.7em; font-weight: 500; opacity: 0.7; margin-right: 2px; }
.sticky-buy-label span { font-family: "SF Mono", ui-monospace, Menlo, monospace; letter-spacing: 0; color: #f5f5f7; }
.my-count { display: inline-block; margin-top: 16px; padding: 8px 16px; border-radius: 20px; background: #fff4d6; color: #7a4a00; font-weight: 600; font-size: 15px; }

/* ===================================================== приведи друга */
.ref-section { background: #000; padding: 0 0 88px; }
.ref-box { border-radius: 22px; padding: 26px 22px; text-align: center; }
.ref-box:empty { display: none; }
.ref-dark { max-width: 520px; margin: 0 auto; color: #f5f5f7;
  background: linear-gradient(160deg, rgba(48, 209, 88, 0.16), rgba(10, 132, 255, 0.10)); border: 1px solid rgba(48, 209, 88, 0.35); }
.ref-light { background: linear-gradient(160deg, #eafaf0, #eef5ff); border: 1px solid #cdeedd; color: var(--fg); text-align: center; }
.ref-title { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.ref-text { margin: 10px auto 18px; max-width: 420px; font-size: 15px; line-height: 1.45; opacity: 0.85; }
.ref-link { padding: 12px 14px; border-radius: 12px; font-size: 14px; word-break: break-all; margin-bottom: 14px; }
.ref-dark .ref-link { background: rgba(255, 255, 255, 0.08); color: #fff; }
.ref-light .ref-link { background: #fff; border: 1px solid var(--line); }
.ref-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ref-actions .btn { width: 100%; white-space: normal; }
.ref-light .btn-white { background: var(--black); color: #fff; }
.ref-stats { margin-top: 14px; font-size: 14px; opacity: 0.8; }
.ref-btn { margin-top: 4px; }
.ticket-actions .ref-box { margin-top: 18px; width: 100%; }
@media (max-width: 600px) {
  .ref-actions { grid-template-columns: 1fr; }
  .ref-section { padding-bottom: 64px; }
}

/* ===================================================== доступность (WCAG 2.2), без изменения внешнего вида */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -100px; z-index: 300; padding: 10px 16px; border-radius: 12px; background: #fff; color: #000; font-weight: 600; box-shadow: var(--shadow-lg); }
.skip-link:focus { top: 12px; }
/* рамка фокуса — только при навигации с клавиатуры */
:focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; }
.hero-dark :focus-visible, .ticket-show :focus-visible, .ref-dark :focus-visible, .sticky-buy :focus-visible, .nav-dark :focus-visible { outline-color: #ffd66b; }
.input:focus-visible { outline: 2px solid #0a84ff; outline-offset: 1px; }
/* невидимые увеличенные зоны нажатия у мелких кнопок */
.modal-close::after { content: ''; position: absolute; inset: -8px; }
.btn-link { position: relative; }
.btn-link::after { content: ''; position: absolute; inset: -12px -8px; }
/* скрытая липкая плашка не должна получать фокус */
.sticky-buy:not(.show) { visibility: hidden; }
.sticky-buy { transition: transform var(--t), opacity var(--t), visibility 0s linear 0.3s; }
.sticky-buy.show { transition: transform var(--t), opacity var(--t), visibility 0s; }
/* фокус не прячется под шапку и липкую плашку */
html { scroll-padding-top: 72px; }
@media (max-width: 760px) { html { scroll-padding-bottom: 96px; } }
/* режим «уменьшить движение»: анимации не мерцают бесконечно */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .btn-glow, .hero-glow, .countdown.phase2 .countdown-value, .jackpot-gold.shimmer, .gold-ticket, .btn-glow::after { animation: none !important; }
}
/* режим высокой контрастности Windows: золотой текст-градиент не исчезает */
@media (forced-colors: active) {
  .jackpot-gold { background: none; color: CanvasText; -webkit-text-fill-color: currentColor; }
}

/* ===================================================== контраст текста (WCAG AA), одобрено владельцем */
:root { --red: #d70015; --fg-3: #6e6e73; --accent-text: #0066cc; }
a, .btn-link, .qr-box summary, .pay-help a { color: var(--accent-text); }
.badge-blue { color: var(--accent-text); }
.jackpot-label, .countdown-label, .draw-date, .cta-caption { color: #6e6e73; }
.x-badge { color: #8a5600 !important; }
.countdown-dark.done .countdown-value, .countdown-dark.done .countdown-label { color: #8e8e93; }
.btn-glow[aria-disabled="true"] { color: #a1a1a6; }
/* на тёмном фоне — прежние светлые цвета */
.hero-dark .draw-date, .hero-dark .cta-sub { color: #86868b; }
.countdown-dark .countdown-label { color: #a1a1a6; }
.countdown-dark.phase2 .countdown-label { color: #ff453a; }
.nav-dark a, .ref-dark a, .footer a { color: inherit; }
.ref-dark .btn-white, .nav-dark .btn-white { color: #000; }
.footer a { color: var(--fg-2); }

/* ===================================================== демо-режим (TRON_MODE=mock) */
.demo-badge {
  position: fixed; right: 8px; bottom: 8px; z-index: 49; pointer-events: none;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; opacity: 0.9;
  background: #ffe066; color: #3d2f00; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.demo-pay { margin: 16px 0; padding: 14px; border: 2px dashed #e0b400; border-radius: 14px; background: #fffbe6; display: grid; gap: 10px; }
.demo-pay-title { font-weight: 700; color: #5c4400; }
.demo-pay-note { font-size: 14px; color: #5c4400; min-height: 1em; }

/* золотой билет на экране «оплачено» (светлая карточка) */
.gold-ticket-paid { margin: 8px auto 18px; animation: none; box-shadow: 0 18px 50px rgba(240, 169, 43, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.7); text-align: left; }
.gold-ticket-paid .gt-notch { background: var(--bg, #fff); }
.ticket-reveal .gold-ticket-paid .gt-code { color: #241400; }
.i-paid { margin-top: 20px; }
.pay-status.checking { color: var(--fg); font-weight: 500; }

/* «←» назад — маленькая кнопка справа вверху, рядом с 🌐 */
.back-btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 32px; padding: 0 10px;
  font: inherit; font-size: 18px; font-weight: 600; line-height: 1; color: var(--fg);
  background: transparent; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.back-btn:hover { border-color: currentColor; }
.nav-dark .back-btn { color: #f5f5f7; border-color: rgba(255, 255, 255, 0.28); }
.nav-logo span { white-space: nowrap; }
/* Телефон, внутренние страницы: справа «←» и 🌐; кнопку «Купить билет» в шапке убираем — она есть на самих страницах */
@media (max-width: 440px) {
  body:not([data-page="index"]) .nav-right > .btn { display: none; }
  .nav-right { gap: 8px; }
}
.payout-note { margin-bottom: 10px; font-weight: 500; }

/* Вошедший игрок на телефоне: «Мои билеты» значком 🎟 (гостю ссылки нет — вход после «Купить билет») */
@media (max-width: 600px) {
  .nav-account.is-user {
    display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 32px; padding: 0 9px;
    font-size: 17px; line-height: 1; opacity: 1; border: 1px solid var(--line); border-radius: 999px;
  }
  .nav-dark .nav-account.is-user { border-color: rgba(255, 255, 255, 0.28); }
  .nav-account.is-user .acc-text { display: none; }
}
@media (max-width: 440px) {
  body.has-user .nav-right > .btn { display: none; }
}

/* адрес кошелька — целиком, без групп; на узком экране переносится по символам */
.addr { word-break: break-all; overflow-wrap: anywhere; }
