:root {
  --bg: #0f1115;
  --bg2: #151821;
  --card: #1a1d26;
  --card2: #222633;
  --line: #2a2f3d;
  --text: #eef0f5;
  --muted: #9aa1b2;
  --dim: #6b7285;
  --accent: #ffd84d;
  --accent2: #ffb800;
  --accent-ink: #1b1600;
  --green: #3ddc84;
  --red: #ff5c6c;
  --blue: #5aa9ff;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #2a2410 0%, transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.25; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); font-size: 13px; }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.mt { margin-top: 14px; }
.mt2 { margin-top: 22px; }

/* buttons */
.btn {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 18px; border-radius: 14px;
  font: inherit; font-weight: 600; color: var(--text);
  background: var(--card2); transition: transform .08s, background .15s, opacity .15s;
  text-decoration: none !important; text-align: center;
}
.btn:hover { background: #2a2f3e; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { background: rgba(255, 92, 108, .14); color: var(--red); }
.btn.danger:hover { background: rgba(255, 92, 108, .22); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.tg { background: #2aabee; color: #fff; }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.linklike { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }
.linklike:hover { color: var(--text); }

input.field {
  width: 100%; padding: 14px 16px; border-radius: 14px;
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  font: inherit; outline: none; transition: border .15s;
}
input.field:focus { border-color: var(--accent); }
input.code { letter-spacing: 10px; text-align: center; font-size: 26px; font-weight: 700; }
.error { color: var(--red); font-size: 13px; min-height: 18px; }
.note {
  background: rgba(255, 216, 77, .08); border: 1px solid rgba(255, 216, 77, .25);
  border-radius: 14px; padding: 12px 14px; font-size: 13px; color: #f3e3a6;
}
.note.blue { background: rgba(90, 169, 255, .08); border-color: rgba(90, 169, 255, .25); color: #bcdcff; }

/* loading */
.loading-screen { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* login */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card {
  width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line);
  border-radius: 24px; padding: 28px 24px; box-shadow: var(--shadow);
}
.login-foot { margin-top: 18px; color: var(--dim); font-size: 13px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none !important; }
.logo span { background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo.big { font-size: 26px; margin-bottom: 18px; }
.login h1 { font-size: 22px; }
.back { margin-bottom: 14px; }
.timer { font-variant-numeric: tabular-nums; }

/* layout */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: rgba(15, 17, 21, .85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topnav { display: flex; align-items: center; gap: 22px; }
.topnav a { color: var(--muted); font-weight: 500; position: relative; }
.topnav a:hover { color: var(--text); text-decoration: none; }
.topnav a.active { color: var(--text); }
.topnav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -18px; height: 2px; background: var(--accent); }
.badge {
  display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-style: normal;
}
.page { max-width: 1080px; margin: 0 auto; padding: 24px 20px 110px; }
.bottombar { display: none; }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; position: relative; overflow: hidden;
}
.col-7 { grid-column: span 7; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-12 { grid-column: span 12; }
.card .emoji-bg { position: absolute; right: -10px; top: -14px; font-size: 110px; opacity: .08; pointer-events: none; }

/* subscription */
.sub-card { background: linear-gradient(160deg, #262111 0%, var(--card) 55%); }
.days { font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -2px; margin: 10px 0 6px; }
.days small { font-size: 18px; font-weight: 600; letter-spacing: 0; color: var(--muted); margin-left: 6px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 700; background: rgba(61, 220, 132, .12); color: var(--green);
}
.status-pill.off { background: rgba(255, 92, 108, .12); color: var(--red); }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sub-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }

/* referral */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.stats.single { grid-template-columns: 1fr; }
.stat { background: var(--bg2); border-radius: 14px; padding: 12px 14px; }
.stat b { display: block; font-size: 24px; }
.stat span { color: var(--muted); font-size: 12px; }
.copybox { display: flex; gap: 8px; }
.copybox input { flex: 1; min-width: 0; font-size: 13px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 12px 0 0; }
.steps li { counter-increment: s; position: relative; padding-left: 34px; margin-bottom: 10px; color: var(--muted); font-size: 14px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--card2); color: var(--accent); font-weight: 700; font-size: 12px; display: grid; place-items: center;
}
.tabs { display: inline-flex; background: var(--bg2); border-radius: 12px; padding: 3px; gap: 3px; }
.tabs button { background: none; border: 0; color: var(--muted); padding: 7px 12px; border-radius: 9px; font: inherit; font-size: 13px; cursor: pointer; }
.tabs button.on { background: var(--card2); color: var(--text); }

.linked { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 600; }

/* list rows */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 600; }
.list-row .sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.icon-circle { width: 42px; height: 42px; border-radius: 12px; background: var(--card2); display: grid; place-items: center; font-size: 20px; flex: none; }

/* switches */
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--card2); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--accent2); }
.switch input:checked + span::before { transform: translateX(20px); }

/* notifications */
.notif { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.notif .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; background: transparent; flex: none; }
.notif.unread .dot { background: var(--accent); }
.notif .when { color: var(--dim); font-size: 12px; }

/* help */
.search { position: relative; }
.search input { padding-left: 42px; }
.search::before { content: "🔍"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); opacity: .6; }
.faq-cat { margin-top: 22px; }
.faq-cat h3 { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
details.faq { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; }
details.faq summary { cursor: pointer; padding: 15px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; }
details.faq[open] summary::after { content: "−"; }
details.faq .faq-body { padding: 0 18px 16px; color: var(--muted); }
details.faq .faq-body ol, details.faq .faq-body ul { padding-left: 20px; margin: 6px 0; }
details.faq .faq-body li { margin-bottom: 4px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); }
.sheet {
  position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 26px 22px; box-shadow: var(--shadow);
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: translateY(12px); opacity: 0; } }
.sheet-close { position: absolute; right: 14px; top: 14px; background: var(--card2); border: 0; color: var(--muted); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 14px; }

.plan {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px; border-radius: 16px; background: var(--bg2); border: 2px solid transparent; cursor: pointer;
}
.plan.on { border-color: var(--accent); background: #1f1c12; }
.plan .price { font-weight: 800; font-size: 18px; }
.plan .tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); margin-left: 8px; }

.platforms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.platform { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 16px 8px; text-align: center; cursor: pointer; color: var(--text); font: inherit; }
.platform:hover { border-color: var(--accent); }
.platform i { display: block; font-size: 28px; font-style: normal; margin-bottom: 6px; }
.qr { background: #fff; border-radius: 16px; padding: 10px; width: 220px; height: 220px; margin: 0 auto; display: block; }
.step-block { background: var(--bg2); border-radius: 16px; padding: 16px; }
.step-block .n { color: var(--accent); font-weight: 800; font-size: 13px; margin-bottom: 4px; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 60;
  background: #2a2f3e; color: var(--text); padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow);
  font-weight: 600; max-width: calc(100vw - 32px);
}
.toast.err { background: #4a1f26; }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty i { display: block; font-size: 40px; font-style: normal; margin-bottom: 8px; }

@media (max-width: 860px) {
  .col-7, .col-5, .col-6 { grid-column: span 12; }
  .topnav { display: none; }
  .topbar { padding: 12px 16px; }
  .page { padding: 16px 14px 100px; }
  .bottombar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(21, 24, 33, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  }
  .bottombar a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--dim); font-size: 11px; text-decoration: none; }
  .bottombar a i { font-style: normal; font-size: 20px; position: relative; }
  .bottombar a i .badge { position: absolute; top: -4px; right: -12px; }
  .bottombar a.active { color: var(--accent); }
  .days { font-size: 54px; }
  .platforms { grid-template-columns: repeat(2, 1fr); }
  .modal { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 24px 24px 0 0; max-height: 92vh; }
}
