@font-face {
  font-family: "Montserrat";
  font-weight: 300 800;
  font-display: swap;
  src: url("fonts/montserrat-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Montserrat";
  font-weight: 300 800;
  font-display: swap;
  src: url("fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

:root {
  --bg: #050807;
  --card: rgba(18, 26, 23, 0.72);
  --card-2: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f2f5f3;
  --muted: #8b9690;
  --mint: #2ff0a0;
  --mint-dim: rgba(47, 240, 160, 0.12);
  --red: #ff5c6c;
  --radius: 22px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Montserrat", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 60% at 50% 115%, rgba(47, 240, 160, 0.38), transparent 70%),
    radial-gradient(70% 40% at 100% 0%, rgba(47, 240, 160, 0.08), transparent 70%),
    linear-gradient(180deg, #050807 0%, #06110c 60%, #0a2a1c 100%);
}
.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(118deg, transparent 49.85%, rgba(47, 240, 160, 0.10) 50%, transparent 50.15%),
    linear-gradient(62deg, transparent 49.85%, rgba(47, 240, 160, 0.07) 50%, transparent 50.15%);
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.9;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='390' height='844'><g fill='%232ff0a0'><rect x='22' y='96' width='14' height='4' rx='2' transform='rotate(-35 29 98)'/><rect x='352' y='210' width='12' height='4' rx='2' transform='rotate(40 358 212)' opacity='.8'/><rect x='12' y='470' width='10' height='4' rx='2' transform='rotate(60 17 472)' opacity='.6'/><rect x='364' y='560' width='14' height='4' rx='2' transform='rotate(-30 371 562)'/><rect x='40' y='760' width='12' height='4' rx='2' transform='rotate(25 46 762)' opacity='.7'/><rect x='330' y='40' width='8' height='4' rx='2' transform='rotate(70 334 42)' opacity='.5'/></g><g fill='%23ffffff' opacity='.35'><rect x='300' y='380' width='10' height='3' rx='1.5' transform='rotate(-50 305 381)'/><rect x='70' y='300' width='8' height='3' rx='1.5' transform='rotate(30 74 301)'/></g></svg>");
  background-size: 100% auto;
  background-repeat: no-repeat;
}

main {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 18px 16px calc(28px + env(safe-area-inset-bottom));
}

.splash {
  height: 80vh;
  display: grid;
  place-items: center;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.45; } }

.accent { color: var(--mint); }

.wordmark {
  font-weight: 300;
  font-size: 20px;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}
.wordmark .accent { font-weight: 500; }
.wordmark.big { font-size: 44px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--mint);
  color: #03130c;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pill.ghost {
  background: var(--mint-dim);
  color: var(--mint);
  border: 1px solid rgba(47, 240, 160, 0.3);
}
.pill .live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.4s ease-in-out infinite;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.hero {
  text-align: center;
  padding: 6px 0 24px;
}
.hero h1 {
  margin: 14px 0 8px;
  font-size: 34px;
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.hero h1 b { font-weight: 600; color: var(--mint); }
.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.stat .label {
  font-size: 12px;
  color: var(--muted);
}
.stat .value {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#countdown { font-size: 21px; line-height: 32px; }
.stat .value.mint { color: var(--mint); font-weight: 500; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 300;
  letter-spacing: -0.01em;
}
.card h2 b { font-weight: 600; color: var(--mint); }

.prize {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.prize:first-of-type { border-top: 0; padding-top: 0; }
.prize .place {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--card-2);
  font-size: 19px;
}
.prize .name { font-weight: 600; line-height: 1.3; }
.prize .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
}
.check .dot {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--card-2);
  color: var(--muted);
}
.check.ok .dot { background: var(--mint); color: #03130c; }
.check.bad .dot { background: rgba(255, 92, 108, 0.14); color: var(--red); }
.check .text { flex: 1; line-height: 1.35; font-size: 14px; }
.check .text small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.check .go {
  flex: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #03130c;
  background: var(--mint);
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}

.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 18px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.2s ease;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.55; }
.btn.primary {
  background: var(--mint);
  color: #03130c;
  box-shadow: 0 12px 36px rgba(47, 240, 160, 0.35);
}
.btn.ghost { background: var(--card-2); color: var(--text); border: 1px solid var(--line); }
.btn + .btn { margin-top: 10px; }

.ticket {
  position: relative;
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(47, 240, 160, 0.22), transparent 60%),
    linear-gradient(135deg, #0c2219, #08130f 70%);
  border: 1px solid rgba(47, 240, 160, 0.4);
  border-radius: 24px;
  padding: 22px 20px;
  margin-bottom: 14px;
  overflow: hidden;
}
.ticket::before, .ticket::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid rgba(47, 240, 160, 0.4);
}
.ticket::before { left: -14px; }
.ticket::after { right: -14px; }
.ticket .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.ticket .code {
  margin: 18px 0 16px;
  text-align: center;
  font-size: 44px;
  font-weight: 600;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
.ticket .code .hash { color: var(--mint); font-weight: 300; }
.ticket .perf {
  border-top: 2px dashed rgba(47, 240, 160, 0.25);
  margin: 0 -20px 14px;
}
.ticket .note { font-size: 13px; color: var(--muted); text-align: center; line-height: 1.5; }

.win {
  text-align: center;
  padding: 30px 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(47, 240, 160, 0.3), transparent 70%),
    var(--card);
  border: 1px solid rgba(47, 240, 160, 0.45);
}
.win .medal { font-size: 58px; }
.win h1 { margin: 10px 0 6px; font-size: 32px; font-weight: 300; letter-spacing: -0.02em; }
.win h1 b { font-weight: 600; color: var(--mint); }
.win .prize-name { font-weight: 600; font-size: 16px; }
.claim {
  margin: 20px 0 8px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.14em;
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed var(--mint);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
}
.hint { font-size: 12px; color: var(--muted); line-height: 1.5; }

.captcha { text-align: center; padding-top: 5vh; }
.captcha h1 {
  font-size: 34px;
  margin: 30px 0 8px;
  font-weight: 300;
  letter-spacing: -0.02em;
}
.captcha h1 b { font-weight: 600; color: var(--mint); }
.captcha p { color: var(--muted); margin: 0 0 26px; font-size: 15px; }
.captcha p b { color: var(--text); font-weight: 600; }
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.grid button {
  aspect-ratio: 1;
  font-size: 42px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s, background 0.2s;
}
.grid button:active {
  transform: scale(0.94);
  border-color: var(--mint);
  background: var(--mint-dim);
}
.attempts { margin-top: 18px; font-size: 13px; color: var(--muted); }
.shake { animation: shake 0.35s; }
@keyframes shake {
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 18px;
  margin-bottom: 10px;
}
summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
details p, details li { color: var(--muted); font-size: 13px; line-height: 1.55; }
details ul { padding-left: 18px; margin: 10px 0 0; }
.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  word-break: break-all;
  color: var(--text);
  background: var(--card-2);
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 6px;
}

.empty { text-align: center; padding-top: 16vh; }
.empty h1 { font-size: 32px; font-weight: 300; letter-spacing: -0.02em; margin: 30px 0 10px; }
.empty h1 b { font-weight: 600; color: var(--mint); }
.empty p { color: var(--muted); margin: 0 0 28px; line-height: 1.5; }
.empty { margin-bottom: 24px; }

.banner {
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--mint);
  background: var(--mint-dim);
  border: 1px solid rgba(47, 240, 160, 0.25);
  border-radius: 999px;
  padding: 11px;
  margin-bottom: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 30, 26, 0.95);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 10;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.fade-in { animation: fadeIn 0.35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } }
