:root {
  --bg: #0b0c10;
  --bg-2: #101218;
  --card: #14171f;
  --card-2: #1a1e28;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #f3efe6;
  --muted: #9a9caa;
  --dim: #6b6e7c;
  --gold: #e8c37a;
  --gold-2: #c99a45;
  --gold-soft: rgba(232, 195, 122, 0.12);
  --green: #5fd49a;
  --green-soft: rgba(95, 212, 154, 0.12);
  --red: #ff7a7a;
  --red-soft: rgba(255, 122, 122, 0.12);
  --blue: #7aa8ff;
  --blue-soft: rgba(122, 168, 255, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, Segoe UI, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; font-size: 15px; line-height: 1.5; }
a { color: var(--gold); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.serif { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 16px; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ---------- boot ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.coin { width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3d0, var(--gold) 45%, var(--gold-2)); box-shadow: 0 0 0 4px rgba(232,195,122,.15), 0 10px 30px rgba(232,195,122,.25); }
.coin.spin { animation: spin 1.1s ease-in-out infinite; }
@keyframes spin { 0% { transform: rotateY(0) } 100% { transform: rotateY(360deg) } }
.coin-sm { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; background: radial-gradient(circle at 35% 30%, #fff3d0, var(--gold) 50%, var(--gold-2)); }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: var(--card-2); padding: 10px 16px; border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 14px; transition: .15s ease; white-space: nowrap; }
.btn:hover { border-color: rgba(255,255,255,.22); background: #212634; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.gold { background: linear-gradient(180deg, #f2d494, var(--gold) 55%, var(--gold-2)); color: #1b1407; border-color: transparent; box-shadow: 0 8px 24px -8px rgba(232,195,122,.55); }
.btn.gold:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.green { background: var(--green-soft); color: var(--green); border-color: rgba(95,212,154,.25); }
.btn.red { background: var(--red-soft); color: var(--red); border-color: rgba(255,122,122,.25); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.lg { padding: 14px 22px; font-size: 15px; border-radius: 14px; }

label.field { display: block; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.input, select.input, textarea.input { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 14px; outline: none; transition: border-color .15s; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
textarea.input { min-height: 110px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- pills & chips ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--card-2); border: 1px solid var(--line); color: var(--muted); }
.pill.gold { background: var(--gold-soft); color: var(--gold); border-color: rgba(232,195,122,.25); }
.pill.green { background: var(--green-soft); color: var(--green); border-color: rgba(95,212,154,.25); }
.pill.red { background: var(--red-soft); color: var(--red); border-color: rgba(255,122,122,.25); }
.pill.blue { background: var(--blue-soft); color: var(--blue); border-color: rgba(122,168,255,.25); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); white-space: nowrap; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; background:
  radial-gradient(800px 500px at 10% 0%, rgba(232,195,122,.18), transparent 60%),
  radial-gradient(600px 400px at 90% 100%, rgba(95,212,154,.10), transparent 60%), var(--bg-2); border-right: 1px solid var(--line); }
.auth-hero h1 { font-family: var(--serif); font-size: clamp(38px, 5vw, 64px); line-height: 1.02; font-weight: 600; letter-spacing: -0.03em; max-width: 12ch; }
.auth-hero h1 em { font-style: italic; color: var(--gold); }
.auth-hero p.lead { color: var(--muted); font-size: 17px; max-width: 42ch; margin-top: 18px; }
.ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 520px; }
.way { padding: 16px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.way b { display: block; font-size: 14px; }
.way span { font-size: 13px; color: var(--muted); }
.auth-panel { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 400px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 24px; }
.tabs button { border: 0; background: transparent; padding: 10px; border-radius: 10px; font-weight: 700; cursor: pointer; color: var(--muted); }
.tabs button.on { background: var(--card-2); color: var(--text); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 22px; font-weight: 700; }
.brand .coin { width: 28px; height: 28px; box-shadow: none; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 32px 22px; border-right: 0; border-bottom: 1px solid var(--line); gap: 28px; }
  .ways { display: none; }
}

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 22px 14px; border-right: 1px solid var(--line); background: var(--bg-2); display: flex; flex-direction: column; gap: 22px; overflow-y: auto; }
.side .brand { padding: 0 10px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); padding: 14px 12px 6px; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; font-size: 14px; }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { color: var(--text); background: rgba(255,255,255,.03); }
.nav a.on { color: var(--text); background: var(--card-2); box-shadow: inset 2px 0 0 var(--gold); }
.nav .count { margin-left: auto; background: var(--gold); color: #1b1407; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 7px; }
.side-foot { margin-top: auto; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }

.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: rgba(11,12,16,.8); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top h2 { font-size: 18px; }
.balance-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border-radius: 999px; background: var(--card); border: 1px solid var(--line-2); font-weight: 800; cursor: pointer; }
.balance-pill .coin { width: 20px; height: 20px; box-shadow: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: linear-gradient(135deg, #2a2f3d, #1a1e28); border: 1px solid var(--line-2); font-size: 14px; cursor: pointer; }
.page { padding: 28px; max-width: 1180px; margin: 0 auto; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-family: var(--serif); font-size: 32px; font-weight: 600; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); margin: 6px 0 0; }

.bottom-nav { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .top { padding: 12px 16px; }
  .page { padding: 18px 16px 100px; }
  .page-head h1 { font-size: 26px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: rgba(16,18,24,.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--dim); font-weight: 700; padding: 4px 0; }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a.on { color: var(--gold); }
}

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card.tight { padding: 16px; }
.card h3 { font-size: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.grid { display: grid; gap: 18px; }
.dash { grid-template-columns: repeat(12, 1fr); }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }
@media (max-width: 1100px) { .span-8, .span-7, .span-5, .span-4 { grid-column: span 12; } .span-3 { grid-column: span 6; } .span-6 { grid-column: span 12; } }

.hero-card { position: relative; overflow: hidden; padding: 28px; background:
  radial-gradient(500px 260px at 100% 0%, rgba(232,195,122,.22), transparent 60%),
  linear-gradient(160deg, #1b1f2a, #12151c 60%); border: 1px solid rgba(232,195,122,.18); }
.hero-card .big { font-family: var(--serif); font-size: clamp(40px, 6vw, 58px); font-weight: 600; line-height: 1; letter-spacing: -0.03em; }
.hero-card .big small { font-family: var(--sans); font-size: 16px; color: var(--muted); font-weight: 700; letter-spacing: 0; margin-left: 6px; }
.hero-card .coin-deco { position: absolute; right: -30px; top: -30px; width: 180px; height: 180px; opacity: .12; }
.level { margin-top: 22px; }
.bar { height: 8px; background: rgba(255,255,255,.07); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--gold), #fff0c9); border-radius: 999px; transition: width .6s ease; }
.bar.green > i { background: linear-gradient(90deg, #2e9e6b, var(--green)); }

.stat { padding: 18px; }
.stat .k { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); font-weight: 700; }
.stat .v { font-family: var(--serif); font-size: 30px; font-weight: 600; margin-top: 6px; letter-spacing: -0.02em; }
.stat .s { font-size: 13px; color: var(--muted); }

/* check-in */
.checkin-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin: 16px 0; }
.cday { text-align: center; padding: 10px 4px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.cday .d { font-size: 11px; color: var(--dim); font-weight: 700; }
.cday .r { font-weight: 800; font-size: 14px; margin-top: 4px; }
@media (max-width: 520px) { .cday .dl { display: none; } .checkin-strip { gap: 6px; } }
.cday.done { background: var(--gold-soft); border-color: rgba(232,195,122,.3); }
.cday.done .r { color: var(--gold); }
.cday.next { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }

/* chart */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b i { width: 100%; max-width: 38px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--gold), rgba(201,154,69,.35)); min-height: 3px; transition: height .5s ease; }
.bars .b.today i { background: linear-gradient(180deg, #fff0c9, var(--gold)); }
.bars .b span { font-size: 11px; color: var(--dim); font-weight: 700; }
.bars .b em { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 700; }

/* lists */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--card-2); font-size: 16px; }
.amt { font-weight: 800; white-space: nowrap; }
.amt.pos { color: var(--green); }
.amt.neg { color: var(--red); }

/* tasks */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.task { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.task:hover { border-color: var(--line-2); }
.task.done { opacity: .6; }
.task .reward { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--gold); display: inline-flex; align-items: center; gap: 6px; }
.plat { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; color: #fff; }
.plat.tiktok { background: linear-gradient(135deg, #25f4ee, #fe2c55); }
.plat.youtube { background: #ff0033; }
.plat.instagram { background: linear-gradient(135deg, #feda75, #d62976 50%, #4f5bd5); }
.plat.x { background: #000; border: 1px solid #333; }
.plat.facebook { background: #1877f2; }
.plat.telegram { background: #229ed9; }
.plat.whatsapp { background: #25d366; }
.plat.website { background: #3a4152; }
.plat.other { background: #3a4152; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; }

/* articles */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.post-card { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: var(--card); border: 1px solid var(--line); cursor: pointer; transition: transform .15s, border-color .15s; }
.post-card:hover { transform: translateY(-2px); border-color: var(--line-2); }
.post-cover { height: 150px; background: linear-gradient(135deg, #2b2416, #14171f 70%); background-size: cover; background-position: center; position: relative; }
.post-cover .serif { position: absolute; left: 18px; bottom: 14px; font-size: 44px; color: rgba(232,195,122,.25); }
.post-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-body h3 { font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.2; }
.article { max-width: 720px; margin: 0 auto; }
.article h1 { font-family: var(--serif); font-size: clamp(30px, 4vw, 44px); line-height: 1.1; font-weight: 600; letter-spacing: -0.02em; }
.article .content { font-size: 17px; line-height: 1.75; color: #dcd8ce; }
.article .content h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 32px 0 8px; color: var(--text); }
.article .content p { margin: 0 0 16px; }
.read-bar { position: sticky; top: 64px; z-index: 10; margin: 20px 0; padding: 12px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line-2); }
.quiz-q { padding: 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.quiz-q h4 { font-size: 16px; margin-bottom: 12px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); margin-top: 8px; cursor: pointer; transition: .12s; }
.opt:hover { border-color: rgba(255,255,255,.25); }
.opt input { accent-color: var(--gold); width: 18px; height: 18px; }
.opt.sel { border-color: var(--gold); background: var(--gold-soft); }

/* leaderboard */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 14px; align-items: end; margin-bottom: 18px; }
.pod { text-align: center; padding: 20px 12px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.pod.first { padding-top: 30px; background: linear-gradient(180deg, rgba(232,195,122,.18), var(--card)); border-color: rgba(232,195,122,.3); }
.pod .medal { font-size: 28px; }
.pod .nm { font-weight: 800; margin-top: 8px; }
.pod .sc { font-family: var(--serif); font-size: 22px; color: var(--gold); }
.rank { width: 30px; text-align: center; font-weight: 800; color: var(--dim); }
.li.me { background: var(--gold-soft); border-radius: 12px; padding-left: 10px; padding-right: 10px; border-bottom-color: transparent; }

/* badges */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.badge { padding: 20px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-align: center; }
.badge .ico { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; background: radial-gradient(circle at 35% 30%, rgba(255,243,208,.25), rgba(232,195,122,.15) 60%); border: 1px solid rgba(232,195,122,.35); }
.badge.locked { opacity: .45; }
.badge.locked .ico { filter: grayscale(1); border-color: var(--line-2); background: var(--card-2); }
.badge-row { display: flex; gap: 10px; flex-wrap: wrap; }
.badge-mini { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: var(--gold-soft); border: 1px solid rgba(232,195,122,.3); }

/* referral */
.ref-box { display: flex; gap: 10px; align-items: center; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--bg-2); border: 1px dashed rgba(232,195,122,.4); }
.ref-box code { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gold); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step { padding: 18px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); }
.step .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); font-weight: 800; margin-bottom: 10px; }
@media (max-width: 700px) { .steps { grid-template-columns: 1fr; } }

/* tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:hover td { background: rgba(255,255,255,.015); }

/* modal & toast */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(5,6,9,.7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--card); border: 1px solid var(--line-2); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); animation: rise .2s ease; }
.modal.wide { max-width: 820px; }
.modal h3 { font-family: var(--serif); font-size: 24px; font-weight: 600; }
@keyframes fade { from { opacity: 0 } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98) } }
#toasts { position: fixed; z-index: 200; top: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; padding: 12px 18px; border-radius: 14px; background: #1f2431; border: 1px solid var(--line-2); box-shadow: var(--shadow); font-weight: 700; font-size: 14px; animation: rise .2s ease; max-width: 90vw; }
.toast.ok { border-color: rgba(95,212,154,.35); }
.toast.err { border-color: rgba(255,122,122,.35); color: #ffd1d1; }
.toast.gold { background: linear-gradient(180deg, #2b2416, #1f2431); border-color: rgba(232,195,122,.45); color: var(--gold); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .serif { font-size: 22px; color: var(--text); margin-bottom: 6px; }
.notice { padding: 12px 16px; border-radius: 12px; background: var(--blue-soft); border: 1px solid rgba(122,168,255,.25); color: #cfe0ff; font-size: 14px; }
.notice.gold { background: var(--gold-soft); border-color: rgba(232,195,122,.25); color: #f5e3bb; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.q-edit { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; word-break: break-word; }
