:root {
  --bg: #0a0d18;
  --bg2: #10152a;
  --card: rgba(255, 255, 255, 0.045);
  --card-hi: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef1ff;
  --muted: #98a2c3;
  --green: #22e07a;
  --green-2: #12b85f;
  --gold: #ffcc33;
  --red: #ff5d6c;
  --blue: #6aa8ff;
  --radius: 18px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Fredoka", "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; font-family: var(--font); color: var(--text); line-height: 1.55;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(34, 224, 122, 0.16), transparent 60%),
    radial-gradient(700px 500px at -10% 20%, rgba(106, 168, 255, 0.12), transparent 60%),
    var(--bg);
  min-height: 100vh;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.wrap { width: min(1120px, 100%); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* auth toggles */
body:not(.authed) .only-auth { display: none !important; }
body.authed .only-guest { display: none !important; }

/* topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(10, 13, 24, 0.78); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-weight: 700; font-size: 19px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 22px; margin-left: 12px; }
.nav a { color: var(--muted); font-weight: 500; font-size: 15px; }
.nav a:hover { color: var(--text); text-decoration: none; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang {
  width: auto;
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 8px; font: 600 13px var(--font); cursor: pointer;
}
.lang option { background: var(--bg2); }
.chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
}
.chip img { width: 28px; height: 28px; border-radius: 50%; background: var(--bg2); }
.chip-bal { display: flex; align-items: center; gap: 6px; font-weight: 700; }

/* coin */
.coin {
  display: inline-block; width: 26px; height: 26px; flex: none;
  background: url("/static/coin.svg") center / contain no-repeat;
}
.coin.sm { width: 18px; height: 18px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 11px 18px; cursor: pointer;
  font: 700 15px var(--font); color: #04140b;
  background: linear-gradient(180deg, var(--green), var(--green-2));
  box-shadow: 0 6px 20px rgba(34, 224, 122, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.big { width: 100%; padding: 15px 20px; font-size: 17px; border-radius: 14px; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.ghost {
  background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: none;
}
.btn.ghost:hover { background: var(--card-hi); }

/* cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.card h3 { margin: 0 0 6px; font-family: var(--display); font-weight: 600; font-size: 21px; }
.card h4 { margin: 22px 0 8px; font-size: 15px; color: var(--muted); }

/* hero */
.hero { padding: 64px 0 40px; }
.hero-in { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
.badge {
  display: inline-block; padding: 5px 12px; border-radius: 999px; font-weight: 600; font-size: 13px;
  color: var(--green); background: rgba(34, 224, 122, 0.1); border: 1px solid rgba(34, 224, 122, 0.25);
}
.hero h1 {
  font-family: var(--display); font-weight: 700; font-size: clamp(40px, 6vw, 68px);
  line-height: 1.02; margin: 16px 0 16px; letter-spacing: -0.5px;
}
.lead { font-size: 18px; color: #c8cfea; max-width: 34em; margin: 0 0 14px; }
.nopass { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; }
.lock {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: rgba(255, 204, 51, 0.14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffcc33' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3Cpath d='M4 4l16 16'/%3E%3C/svg%3E") center / 18px no-repeat;
}
.stats { display: flex; gap: 28px; margin-top: 26px; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-family: var(--display); font-size: 30px; color: var(--gold); }
.stats span { color: var(--muted); font-size: 13px; }

.hero-card { padding: 28px; background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03)); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.hero-card h2 { margin: 0 0 18px; font-family: var(--display); font-weight: 600; font-size: 26px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 7px; }
input, select {
  width: 100%; background: rgba(0, 0, 0, 0.25); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font: 500 16px var(--font); outline: none; transition: border-color .15s;
}
input:focus, select:focus { border-color: var(--green); }
select option { background: var(--bg2); }
.input-row { position: relative; margin-bottom: 16px; }
.input-row .at { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.input-row input { padding-left: 32px; font-size: 18px; }
.consent-note { color: var(--muted); font-size: 13px; margin: 12px 0 0; text-align: center; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.form-err { color: var(--red); font-size: 14px; font-weight: 600; margin: 10px 0 0; min-height: 0; }
.form-err:empty { display: none; }

/* кабинет после входа */
.dash { padding-top: 22px; }
.dash-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
}
.dash-me { display: flex; gap: 14px; align-items: center; min-width: 0; }
.dash-me img { width: 56px; height: 56px; border-radius: 16px; background: var(--bg2); border: 1px solid var(--line); flex: none; }
.me-hello { font-family: var(--display); font-size: 22px; font-weight: 600; }
.dash-bal { min-width: 0; }
.bal { display: flex; align-items: center; gap: 8px; font-size: 30px; font-family: var(--display); }
.bal b { color: var(--gold); }
.progress { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin: 8px 0 6px; max-width: 420px; }
.progress .bar { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--green-2), var(--green)); transition: width .4s ease; }
.dash-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }

/* задания */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 16px 0; }
.tile p { margin: 0; color: var(--muted); font-size: 14px; }
.tile-ic { font-size: 28px; display: block; margin-bottom: 8px; }
.bonus-banner {
  display: flex; gap: 10px; align-items: center; margin: 12px 0; padding: 12px 16px; border-radius: 14px;
  background: rgba(255, 204, 51, .1); border: 1px solid rgba(255, 204, 51, .3); color: var(--gold);
}
.bonus-hint { color: var(--gold); text-align: center; }
.block-banner { flex-wrap: wrap; color: var(--text, #fff); background: rgba(255, 93, 108, .1); border-color: rgba(255, 93, 108, .35); }
.block-banner > div { flex: 1; min-width: 200px; }
.block-banner b { color: var(--red); }
.block-banner .small { margin-top: 4px; opacity: .85; }
.stack { display: grid; gap: 16px; align-content: start; }

/* sections */
.section { padding: 34px 16px; }
.h2 { font-family: var(--display); font-weight: 600; font-size: 32px; margin: 0 0 10px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.step .num {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  font-family: var(--display); font-weight: 700; font-size: 19px; color: #04140b;
  background: linear-gradient(180deg, var(--green), var(--green-2)); margin-bottom: 14px;
}
.step p { margin: 0; color: var(--muted); }

.locked { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.locked p { margin: 0; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 12px; }
.tab {
  background: var(--card); color: var(--muted); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; font: 600 14px var(--font); cursor: pointer;
}
.tab.active { color: #04140b; background: var(--green); border-color: var(--green); }
.tab small { opacity: .7; font-weight: 500; margin-left: 4px; }
.wall-frame { padding: 0; overflow: hidden; height: 720px; }
.wall-frame iframe { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
.empty p { margin: 0; color: var(--muted); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.inline-form { display: flex; gap: 10px; margin-top: 12px; }
#promoCode { text-transform: uppercase; letter-spacing: 1px; }
#wdForm label { margin-top: 14px; }
#wdForm .btn { margin-top: 18px; }
.method-box { margin-top: 4px; }
.link { display: inline-block; margin-top: 8px; font-weight: 600; font-size: 14px; }

.history { margin-top: 16px; }
.hist { list-style: none; margin: 8px 0 0; padding: 0; }
.hist li {
  display: flex; align-items: center; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--line); font-size: 15px;
}
.hist li:last-child { border-bottom: 0; }
.hist .what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .when { color: var(--muted); font-size: 13px; white-space: nowrap; }
.amt { font-weight: 700; white-space: nowrap; }
.amt.plus { color: var(--green); }
.amt.minus { color: var(--muted); }
.pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill.pending { background: rgba(255, 204, 51, .14); color: var(--gold); }
.pill.paid { background: rgba(34, 224, 122, .14); color: var(--green); }
.pill.rejected { background: rgba(255, 93, 108, .14); color: var(--red); }
.hist .none { color: var(--muted); }

.payouts { list-style: none; margin: 16px 0 0; padding: 6px 22px; }
.payouts li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.payouts li:last-child { border-bottom: 0; }
.payouts .who { flex: 1; font-weight: 600; }
.payouts .none { color: var(--muted); justify-content: center; padding: 22px 0; }

.faq { display: grid; gap: 10px; margin-top: 16px; }
.faq details { padding: 0; }
.faq summary { cursor: pointer; padding: 18px 22px; font-weight: 600; font-size: 16px; list-style: none; position: relative; padding-right: 48px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0; padding: 0 22px 18px; color: var(--muted); }

.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 28px 0 110px; }
.footer-in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.small-brand { font-size: 16px; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.foot-links a { color: var(--muted); font-size: 14px; }
.foot-links a:hover { color: var(--text); }

/* cookie bar */
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50;
  max-width: 760px; margin: 0 auto; display: flex; gap: 18px; align-items: center;
  padding: 16px 18px; border-radius: 16px; background: #151b33; border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.cookie p { margin: 0; font-size: 14px; color: #c8cfea; flex: 1; }
.cookie-btns { display: flex; gap: 8px; flex: none; }
.cookie .btn { padding: 10px 14px; font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: #18213f; border: 1px solid var(--line); color: var(--text);
  padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 10px 40px rgba(0,0,0,.5);
  max-width: calc(100% - 32px);
}
.toast.ok { border-color: rgba(34, 224, 122, .5); }
.toast.err { border-color: rgba(255, 93, 108, .5); }

/* legal pages */
.legal { padding: 40px 16px 60px; max-width: 820px; }
.legal h1 { font-family: var(--display); font-size: 40px; margin: 0 0 6px; }
.legal h2 { font-family: var(--display); font-weight: 600; font-size: 22px; margin: 32px 0 8px; }
.legal p, .legal li { color: #c8cfea; }
.legal table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.legal th, .legal td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal th { color: var(--muted); font-weight: 600; }
.legal .back { display: inline-block; margin-bottom: 24px; }
.legal-lang { display: none; }
.legal-lang.on { display: block; }

@media (max-width: 900px) {
  .nav { display: none; }
  .dash-card { grid-template-columns: 1fr; gap: 14px; }
  .dash-actions { flex-direction: row; }
  .dash-actions .btn { flex: 1; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .hero { padding: 36px 0 20px; }
  .hero-in { grid-template-columns: 1fr; gap: 28px; }
  .steps, .grid2 { grid-template-columns: 1fr; }
  .wall-frame { height: 640px; }
}
@media (max-width: 560px) {
  .brand .site-name { display: none; }
  .small-brand .site-name { display: inline; }
  .cookie { flex-direction: column; align-items: stretch; }
  .cookie-btns { flex-direction: column-reverse; }
  .cookie .btn { width: 100%; }
  .inline-form { flex-direction: column; }
  .bal { font-size: 26px; }
  .tile p { font-size: 13px; }
  .hist .when { display: none; }
}
