:root {
  --bg: #0b0b0c;
  --bg2: #111113;
  --card: #161619;
  --line: #27272d;
  --text: #f3f3ee;
  --muted: #8f8f98;
  --acc: #d7ff3a;
  --acc-ink: #0b0b0c;
  --hot: #ff5a36;
  --gold: #ffc933;
  --r: 18px;
  --display: 'Unbounded', system-ui, sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--acc); }
button { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(11, 11, 12, .82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font: 900 15px/1 var(--display); text-transform: uppercase; letter-spacing: .02em;
}
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 0 0 rgba(255, 90, 54, .7); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(255, 90, 54, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 54, 0); } }
.top nav { display: flex; align-items: center; gap: 16px; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.top nav a:hover { color: var(--text); }
.lang { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-weight: 800; font-size: 12px; cursor: pointer; }
@media (max-width: 480px) { .top nav a { display: none; } }

.banner {
  position: sticky; top: 55px; z-index: 19;
  padding: 12px 16px; text-align: center; font-weight: 800;
  background: var(--acc); color: var(--acc-ink);
}
.banner.bad { background: var(--hot); color: #fff; }

/* ---------- герой ---------- */
.hero { padding-top: 32px; padding-bottom: 28px; }
.kicker { margin: 0 0 14px; color: var(--muted); font-weight: 600; font-size: 14px; }
.rec { display: inline-block; padding: 2px 8px; margin-right: 6px; border-radius: 6px; background: var(--hot); color: #fff; font: 700 11px/1.4 var(--display); letter-spacing: .08em; }
h1 {
  margin: 0 0 24px;
  font: 900 clamp(30px, 7.4vw, 66px)/1.02 var(--display);
  letter-spacing: -.02em; text-wrap: balance;
}
h1 em { font-style: normal; color: var(--acc); }

.board {
  position: relative; overflow: hidden;
  padding: 20px 20px 18px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: radial-gradient(120% 140% at 0% 0%, rgba(215, 255, 58, .13), transparent 55%), var(--card);
}
.board-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-weight: 600; font-size: 14px; }
.cur { display: inline-flex; align-items: center; gap: 8px; }
.cur-seg { padding: 2px; border-radius: 9px; }
.cur-seg button { padding: 4px 10px; border-radius: 7px; font-size: 13px; }
.counter {
  margin: 6px 0 16px;
  font: 900 clamp(46px, 13.5vw, 132px)/1 var(--display);
  font-variant-numeric: tabular-nums; letter-spacing: -.03em;
  color: var(--acc); text-shadow: 0 0 40px rgba(215, 255, 58, .25);
  white-space: nowrap;
}
.counter.flash { animation: flash .9s ease-out; }
@keyframes flash { 0% { color: #fff; text-shadow: 0 0 60px rgba(255, 255, 255, .7); transform: scale(1.03); } 100% { transform: none; } }
.progress { height: 12px; border-radius: 999px; background: #232328; overflow: hidden; }
.bar {
  height: 100%; width: 0; border-radius: 999px; transition: width 1.2s cubic-bezier(.2, .8, .2, 1);
  background: repeating-linear-gradient(-45deg, var(--acc) 0 12px, #c3ee21 12px 24px);
  background-size: 34px 34px; animation: stripes 1s linear infinite;
}
@keyframes stripes { to { background-position: 34px 0; } }
.progress-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.progress-meta b { color: var(--text); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 20px; }
.stat { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); min-width: 0; }
.stat b { display: block; font: 700 clamp(17px, 4.6vw, 28px)/1.1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.25; }
.stat.gold b { color: var(--gold); }
.stat.hot b { color: var(--hot); }
.stat .clock { font-style: normal; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.stat span span { display: inline; margin: 0; }

.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); text-decoration: none; font-weight: 800; cursor: pointer;
  transition: transform .08s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.big { padding: 18px 26px; font: 900 18px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.cta .btn.big { flex: 1 1 260px; }
.cta .btn.ghost { flex: 1 1 200px; }
.fine { margin: 14px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- бегущая строка ---------- */
.ticker { overflow: hidden; border-block: 1px solid var(--line); background: var(--bg2); }
.ticker-track { display: inline-flex; gap: 36px; padding: 12px 0; white-space: nowrap; animation: marquee var(--dur, 40s) linear infinite; will-change: transform; }
.ticker-track span { font-weight: 600; font-size: 15px; }
.ticker-track .a { color: var(--acc); font-weight: 800; }
.ticker-track .m { color: var(--muted); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track, .bar, .live-dot { animation: none; } }

/* ---------- мой номер ---------- */
.me { margin-top: 24px; }
.me-card {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: center;
  padding: 18px; border-radius: var(--r); border: 1px solid var(--acc);
  background: linear-gradient(135deg, rgba(215, 255, 58, .10), transparent 60%), var(--card);
}
.me-num { font: 900 clamp(38px, 11vw, 64px)/1 var(--display); color: var(--acc); }
.me-num.founder { color: var(--gold); }
.me-nick { font-weight: 800; font-size: 18px; }
.me-line, .me-week { color: var(--muted); font-size: 14px; }
.me-week.ok { color: var(--acc); }
.me-week.warn { color: var(--hot); }
.me-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.me-actions .btn { flex: 1 1 150px; }

/* ---------- секции ---------- */
.sec { padding-top: 48px; }
.sec-head { margin-bottom: 16px; }
.sec-head h2 { margin: 0 0 6px; font: 900 clamp(24px, 5.4vw, 38px)/1.1 var(--display); letter-spacing: -.01em; }
.sec-head p { margin: 0; color: var(--muted); max-width: 640px; }

.ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ladder li {
  display: grid; grid-template-columns: 116px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg2);
}
.ladder .amt { font: 700 16px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.ladder .nm { font-weight: 800; }
.ladder .ds { color: var(--muted); font-size: 14px; }
.ladder .st { font-size: 20px; }
.ladder li.done { border-color: rgba(215, 255, 58, .35); }
.ladder li.done .amt { color: var(--acc); }
.ladder li.cur { border-color: var(--acc); background: linear-gradient(90deg, rgba(215, 255, 58, .12) var(--p, 0%), var(--bg2) var(--p, 0%)); }
.ladder li.lock { opacity: .55; }
@media (max-width: 520px) { .ladder li { grid-template-columns: 1fr auto; } .ladder .amt { grid-column: 1 / -1; } }

/* ---------- стена ---------- */
.wall-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; font-weight: 800; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.zoom { display: inline-flex; align-items: center; gap: 6px; }
.zoom button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); font-weight: 800; font-size: 18px; cursor: pointer; }
.zoom span { min-width: 36px; text-align: center; font-weight: 800; font-size: 14px; }
.palette { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.palette button { width: 34px; height: 34px; border-radius: 9px; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.palette button.on { border-color: var(--acc); transform: scale(1.08); }
.wall-wrap {
  position: relative; overflow: auto; max-height: 72vh;
  border: 1px solid var(--line); border-radius: 14px; background: #19191d;
  overscroll-behavior: contain;
}
.wall-stage { position: relative; line-height: 0; width: fit-content; margin: 0 auto; }
.wall-stage canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.wall-sel { position: absolute; inset: 0; pointer-events: none; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .45; } }
.wall-wrap.draw #wallCanvas { cursor: crosshair; }
.px-tip {
  position: absolute; z-index: 3; pointer-events: none; max-width: 240px;
  padding: 8px 10px; border-radius: 10px; background: #000; border: 1px solid var(--line);
  font-size: 13px; line-height: 1.35; white-space: nowrap;
}
.draw-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--acc); background: rgba(17, 17, 19, .95);
}
.draw-bar span { flex: 1 1 140px; font-weight: 800; }

/* ---------- топы ---------- */
.legend { margin-bottom: 12px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--gold); color: var(--muted); }
.legend b { color: var(--gold); }
.tabs { margin-bottom: 10px; flex-wrap: wrap; }
.board-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.board-list li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--line); background: var(--bg2); }
.board-list li:first-child { border-top: 0; }
.board-list .rk { color: var(--muted); font-weight: 800; font-variant-numeric: tabular-nums; }
.board-list .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.board-list .who small { color: var(--muted); font-weight: 600; }
.board-list .val { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.board-list li.off { opacity: .45; }
.board-list li.empty { grid-template-columns: 1fr; color: var(--muted); }
.board-list .msg { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }

.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.how > div { padding: 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg2); }
.how b { font: 900 14px/1 var(--display); color: var(--acc); }
.how h3 { margin: 10px 0 6px; font-size: 17px; }
.how p { margin: 0; color: var(--muted); font-size: 14px; }

.foot { padding-top: 48px; padding-bottom: 40px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 10px; }
.foot-links a, .linkish { color: var(--muted); font-weight: 600; font-size: 14px; }
.linkish { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

/* ---------- оплата ---------- */
.sheet {
  width: min(460px, 100vw); max-height: 92vh; margin: auto; padding: 0;
  border: 1px solid var(--line); border-radius: 22px; background: var(--card); color: var(--text);
}
.sheet::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(4px); }
@media (max-width: 520px) {
  .sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0; }
}
.sheet form { position: relative; display: grid; gap: 12px; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); }
.sheet h3 { margin: 0 32px 4px 0; font: 900 22px/1.15 var(--display); }
.x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg2); font-size: 20px; cursor: pointer; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chips button { padding: 12px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); font-weight: 800; cursor: pointer; }
.chips button.on { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.chips input { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
input, select {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--text); font: 600 16px/1.2 var(--body);
}
input:focus, select:focus { outline: 2px solid var(--acc); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--acc); }
.err { min-height: 0; color: var(--hot); font-weight: 700; font-size: 14px; }
.pix-summary { padding: 12px 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); font-weight: 700; }

.toast {
  position: fixed; left: 50%; top: 70px; z-index: 50; transform: translate(-50%, -20px);
  max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 14px;
  background: var(--acc); color: var(--acc-ink); font-weight: 800; box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
