@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --gold:   #f59e0b;
  --gold2:  #f97316;
  --dk:     #080d1a;
  --dk2:    #0f1624;
  --dk3:    #1a2236;
  --card:   #111827;
  --text:   #f1f5f9;
  --muted:  #64748b;
  --border: rgba(255,255,255,0.07);
  --green:  #10b981;
  --red:    #ef4444;
  --r:      12px;
}

*  { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body, .k-wrap { font-family: 'Inter', -apple-system, sans-serif; background: var(--dk); color: var(--text); }

/* ══ HEADER ══════════════════════════════════════════════════════ */
.k-header {
  position: sticky; top: 0; z-index: 999;
  background: rgba(8,13,26,.97); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 16px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.k-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.k-brand-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900; color: #000;
}
.k-brand-text { font-size: 18px; font-weight: 900; color: #fff; letter-spacing: -.5px; }
.k-brand-text em { color: var(--gold); font-style: normal; }
.k-header nav { display: flex; align-items: center; gap: 6px; }
.k-nav-link { color: var(--muted); font-size: 13px; font-weight: 500; padding: 6px 10px; border-radius: 7px; text-decoration: none; }
.k-nav-link:hover { color: var(--text); background: rgba(255,255,255,.06); }
.k-btn-logout {
  padding: 7px 14px; background: var(--dk3); color: var(--muted);
  border: 1px solid var(--border); border-radius: 7px;
  font-size: 12px; font-weight: 500; cursor: pointer;
}

/* ══ HERO ════════════════════════════════════════════════════════ */
.k-hero {
  background: var(--dk); padding: 40px 20px 32px; text-align: center;
  position: relative; overflow: hidden;
}
.k-hero::before {
  content: ''; position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(245,158,11,.09) 0%, transparent 65%);
  pointer-events: none;
}
.k-hero-badge {
  display: inline-block; background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.2); border-radius: 20px;
  padding: 4px 12px; font-size: 11px; font-weight: 700; color: var(--green);
  margin-bottom: 14px;
}
.k-hero h1 { font-size: 24px; font-weight: 900; color: #fff; line-height: 1.2; margin-bottom: 10px; letter-spacing: -.6px; }
.k-hero p  { font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 20px; max-width: 340px; margin-left: auto; margin-right: auto; }
.k-stats   { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.k-stat    { text-align: center; }
.k-stat-val { display: block; font-size: 18px; font-weight: 900; color: var(--gold); }
.k-stat-lbl { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

/* ══ FORM CARD ═══════════════════════════════════════════════════ */
.k-form-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px 20px;
  max-width: 400px; margin: 0 auto 24px;
}
.k-form-card h2  { font-size: 16px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.k-form-sub      { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.k-field         { margin-bottom: 12px; }
.k-field label   { display: block; font-size: 10px; font-weight: 700; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; }
.k-field input,
.k-field select  {
  width: 100%; padding: 11px 14px; font-size: 16px; /* 16px prevents iOS zoom */
  background: var(--dk2); border: 1px solid rgba(255,255,255,.1);
  border-radius: 9px; color: var(--text); outline: none;
  -webkit-appearance: none; transition: border .2s;
}
.k-field input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245,158,11,.1); }
.k-field select option { background: var(--dk2); }
.k-pw   { position: relative; }
.k-pw input { padding-right: 42px; }
.k-eye  { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 16px; color: var(--muted); padding: 0; }
.k-msg  { font-size: 13px; padding: 10px 14px; border-radius: 8px; margin-top: 8px; }
.k-msg-error   { background: rgba(239,68,68,.08); color: #fca5a5; border: 1px solid rgba(239,68,68,.18); }
.k-msg-success { background: rgba(16,185,129,.08); color: #6ee7b7; border: 1px solid rgba(16,185,129,.18); }
.k-switch { text-align: center; font-size: 12px; color: var(--muted); margin-top: 14px; }
.k-switch a { color: var(--gold); text-decoration: none; font-weight: 600; }

/* ══ BUTTONS ══════════════════════════════════════════════════════ */
.k-btn-primary {
  display: inline-block; padding: 12px 24px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #000; font-size: 14px; font-weight: 800;
  border: none; border-radius: 9px; cursor: pointer;
  text-decoration: none; text-align: center;
  transition: transform .15s;
}
.k-btn-primary:active { transform: scale(.98); }
.k-btn-full    { width: 100%; }
.k-btn-sm      { padding: 7px 14px; font-size: 13px; }
.k-btn-wa {
  display: flex; align-items: center; justify-content: center;
  padding: 12px; background: #25D366; color: #fff;
  font-size: 14px; font-weight: 700; border: none; border-radius: 9px;
  cursor: pointer; text-decoration: none;
}

/* ══ HOW IT WORKS ════════════════════════════════════════════════ */
.k-how { background: var(--dk2); padding: 28px 20px; }
.k-how h2 { font-size: 18px; font-weight: 900; text-align: center; margin-bottom: 20px; }
.k-how-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.k-how-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; text-align: center; }
.k-how-ic   { font-size: 22px; margin-bottom: 8px; display: block; }
.k-how-item h3 { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.k-how-item p  { font-size: 11px; color: var(--muted); line-height: 1.5; }

/* ══ AUTH WRAP ═══════════════════════════════════════════════════ */
.k-auth-wrap { min-height: calc(100vh - 56px); display: flex; align-items: center; justify-content: center; padding: 24px 20px; }
.k-brand-center { text-align: center; margin-bottom: 18px; }
.k-brand-icon-lg {
  display: inline-flex; width: 52px; height: 52px; border-radius: 13px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; color: #000;
}
.k-brand-name { font-size: 17px; font-weight: 900; color: #fff; margin-top: 7px; }
.k-brand-name em { color: var(--gold); font-style: normal; }

/* ══ DASHBOARD ═══════════════════════════════════════════════════ */
.k-dash { max-width: 100%; }
.k-bal-section { background: linear-gradient(180deg, var(--dk2), var(--dk)); padding: 16px 20px; border-bottom: 1px solid var(--border); }
.k-user-row    { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.k-avatar      { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold2)); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 900; color: #000; flex-shrink: 0; }
.k-user-info   { flex: 1; }
.k-user-info strong { display: block; font-size: 14px; font-weight: 700; color: #fff; }
.k-user-info span   { font-size: 12px; color: var(--muted); }
.k-balance-card { background: linear-gradient(135deg, rgba(245,158,11,.09), rgba(249,115,22,.04)); border: 1px solid rgba(245,158,11,.16); border-radius: var(--r); padding: 16px; }
.k-bal-lbl  { display: block; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 4px; }
.k-bal-amt  { display: block; font-size: 30px; font-weight: 900; color: var(--gold); letter-spacing: -1px; }
.k-bal-sub  { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ══ TABS ════════════════════════════════════════════════════════ */
.k-tabs { background: var(--dk2); border-bottom: 1px solid var(--border); display: flex; overflow-x: auto; scrollbar-width: none; padding: 0 6px; }
.k-tabs::-webkit-scrollbar { display: none; }
.k-tab  { flex-shrink: 0; padding: 12px 14px; background: none; border: none; border-bottom: 2px solid transparent; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; transition: color .2s; }
.k-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.k-tab-content { padding: 14px 16px; background: var(--dk); min-height: 300px; }

/* ══ CARD ════════════════════════════════════════════════════════ */
.k-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; margin-bottom: 12px; }
.k-card-title { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.k-card-title span { font-size: 11px; color: var(--muted); font-weight: 400; }
.k-empty, .k-warn { font-size: 13px; padding: 12px 14px; border-radius: 8px; }
.k-empty { color: var(--muted); text-align: center; padding: 24px; }
.k-warn  { background: rgba(239,68,68,.08); color: #fca5a5; border: 1px solid rgba(239,68,68,.18); margin-bottom: 12px; }

/* ══ ADS ═════════════════════════════════════════════════════════ */
.k-ad-row { display: flex; align-items: center; gap: 10px; padding: 11px; background: var(--dk3); border-radius: 10px; margin-bottom: 8px; border: 1px solid var(--border); transition: border-color .2s; }
.k-ad-row.active { border-color: rgba(245,158,11,.25); }
.k-ad-num  { width: 30px; height: 30px; border-radius: 7px; background: var(--dk2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900; color: var(--gold); flex-shrink: 0; }
.k-ad-info { flex: 1; min-width: 0; }
.k-ad-info strong { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.k-ad-info small  { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.k-badge { font-size: 10px; padding: 3px 9px; border-radius: 10px; font-weight: 700; white-space: nowrap; }
.k-badge-done   { background: rgba(16,185,129,.12); color: #6ee7b7; border: 1px solid rgba(16,185,129,.15); }
.k-badge-active { background: rgba(245,158,11,.12); color: var(--gold); border: 1px solid rgba(245,158,11,.15); }
.k-badge-lock   { background: var(--dk2); color: var(--muted); border: 1px solid var(--border); }
.k-btn-watch    { padding: 7px 14px; font-size: 12px; font-weight: 700; background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #000; border: none; border-radius: 7px; cursor: pointer; white-space: nowrap; }

/* ══ PROGRESS ════════════════════════════════════════════════════ */
.k-progress-bar  { height: 5px; background: var(--dk3); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.k-progress-fill { height: 100%; background: linear-gradient(90deg, var(--green), #059669); border-radius: 3px; transition: width 1s linear; }

/* ══ WHEEL ═══════════════════════════════════════════════════════ */
.k-wheel-wrap      { text-align: center; padding: 8px 0 16px; }
.k-wheel-container { position: relative; width: 280px; height: 280px; margin: 0 auto 18px; }
.k-wheel-pointer   { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-size: 22px; color: var(--gold); text-shadow: 0 2px 8px rgba(0,0,0,.6); z-index: 10; }
#k-wheel           { border-radius: 50%; box-shadow: 0 0 0 3px var(--gold), 0 0 24px rgba(245,158,11,.2); }
.k-btn-spin        { padding: 12px 36px; background: linear-gradient(135deg,var(--gold),var(--gold2)); border: none; border-radius: 10px; font-size: 15px; font-weight: 900; color: #000; cursor: pointer; }
.k-btn-spin:disabled { opacity: .45; cursor: not-allowed; }
.k-spin-result     { margin-top: 14px; font-size: 17px; font-weight: 900; color: var(--gold); min-height: 26px; }
.k-spin-locked     { text-align: center; padding: 20px; }
.k-spin-locked p   { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.k-countdown       { font-size: 24px; font-weight: 900; color: var(--gold); }

/* ══ REFERRAL ════════════════════════════════════════════════════ */
.k-metrics-2     { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.k-metric        { background: var(--dk3); border-radius: 10px; padding: 14px; text-align: center; border: 1px solid var(--border); }
.k-metric-val    { display: block; font-size: 22px; font-weight: 900; color: var(--gold); }
.k-metric-lbl    { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.k-ref-info      { font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.6; }
.k-ref-code-row, .k-ref-link-row { display: flex; align-items: center; gap: 8px; background: var(--dk3); padding: 10px 13px; border-radius: 8px; margin-bottom: 10px; border: 1px solid var(--border); }
.k-ref-code-row code { font-family: monospace; font-size: 14px; color: var(--gold); flex: 1; font-weight: 700; }
.k-ref-link-row input { flex: 1; background: none; border: none; color: var(--muted); font-size: 12px; outline: none; }
.k-ref-code-row button, .k-ref-link-row button { padding: 6px 12px; font-size: 11px; font-weight: 600; background: var(--dk2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); cursor: pointer; white-space: nowrap; }

/* ══ HISTORY ═════════════════════════════════════════════════════ */
.k-tx-row  { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.k-tx-row:last-child { border: none; }
.k-tx-icon { font-size: 18px; flex-shrink: 0; width: 32px; text-align: center; }
.k-tx-info { flex: 1; min-width: 0; }
.k-tx-info span { display: block; font-size: 12px; color: var(--text); font-weight: 500; }
.k-tx-info small { font-size: 11px; color: var(--muted); }
.k-tx-amt { font-size: 13px; font-weight: 900; white-space: nowrap; }
.k-tx-amt.pos { color: var(--green); }
.k-tx-amt.neg { color: var(--red); }

/* ══ LEADERBOARD ════════════════════════════════════════════════ */
.k-lb-row  { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.k-lb-row:last-child { border: none; }
.k-rank    { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; flex-shrink: 0; }
.k-rank-1  { background: linear-gradient(135deg,#fbbf24,#f59e0b); color: #000; }
.k-rank-2  { background: linear-gradient(135deg,#cbd5e1,#94a3b8); color: #000; }
.k-rank-3  { background: linear-gradient(135deg,#fb923c,#f97316); color: #000; }
.k-rank-4  { background: var(--dk3); color: var(--muted); border: 1px solid var(--border); }
.k-lb-name { flex: 1; font-size: 13px; color: var(--text); font-weight: 500; }
.k-lb-name em { font-size: 10px; color: var(--gold); font-style: normal; margin-left: 4px; }
.k-lb-earn { font-size: 13px; font-weight: 900; color: var(--green); }

/* ══ WITHDRAWAL ══════════════════════════════════════════════════ */
.k-success-notice { background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.18); border-radius: 9px; padding: 16px; font-size: 13px; color: #6ee7b7; line-height: 1.9; margin-top: 12px; }

/* ══ WA MESSAGE BOX ══════════════════════════════════════════════ */
.k-wa-msg { font-size: 12px; color: var(--muted); line-height: 1.8; background: var(--dk3); border-radius: 9px; padding: 13px; margin-bottom: 12px; border: 1px solid var(--border); white-space: pre-wrap; }

/* ══ FOOTER ══════════════════════════════════════════════════════ */
.k-footer      { background: var(--dk2); border-top: 1px solid var(--border); padding: 28px 20px 18px; }
.k-footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 20px; margin-bottom: 20px; }
.k-footer-cols h4 { font-size: 10px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.k-footer-cols a  { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; text-decoration: none; transition: color .2s; }
.k-footer-cols a:hover { color: var(--text); }
.k-footer-bottom { padding-top: 16px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 11px; color: #374151; }
.k-verified { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.18); border-radius: 20px; padding: 3px 10px; font-size: 10px; color: var(--green); font-weight: 600; }

/* ══ RESPONSIVE ══════════════════════════════════════════════════ */
@media (min-width: 640px) {
  .k-hero h1 { font-size: 30px; }
  .k-how-grid { grid-template-columns: repeat(4, 1fr); }
  .k-form-card { padding: 28px 26px; }
}

/* ══ AD POPUP ════════════════════════════════════════════════════ */
.k-popup-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.85); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: kfadeIn .25s ease;
}
@keyframes kfadeIn { from{opacity:0;transform:scale(.95)} to{opacity:1;transform:scale(1)} }
.k-popup {
  background: linear-gradient(160deg, #111827 0%, #0f1624 100%);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: 20px; padding: 28px 22px;
  max-width: 360px; width: 100%;
  text-align: center;
  box-shadow: 0 0 40px rgba(245,158,11,.12), 0 20px 60px rgba(0,0,0,.6);
}
.k-popup-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg,rgba(245,158,11,.15),rgba(249,115,22,.1));
  border: 2px solid rgba(245,158,11,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin: 0 auto 18px;
}
.k-popup-title {
  font-size: 18px; font-weight: 900; color: #fff;
  margin-bottom: 6px; letter-spacing: -.3px;
}
.k-popup-subtitle {
  font-size: 13px; color: var(--gold);
  font-weight: 700; margin-bottom: 16px;
}
.k-popup-rules {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px; padding: 14px 16px;
  margin-bottom: 18px; text-align: right; direction: rtl;
}
.k-popup-rule {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 10px; font-size: 13px; color: #e2e8f0; line-height: 1.5;
}
.k-popup-rule:last-child { margin-bottom: 0; }
.k-popup-rule-icon {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; margin-top: 1px;
}
.k-popup-rule-icon.ok  { background: rgba(16,185,129,.2); color: #6ee7b7; border: 1px solid rgba(16,185,129,.3); }
.k-popup-rule-icon.err { background: rgba(239,68,68,.2);  color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }
.k-popup-reward {
  background: linear-gradient(135deg,rgba(245,158,11,.12),rgba(249,115,22,.06));
  border: 1px solid rgba(245,158,11,.2);
  border-radius: 10px; padding: 12px;
  margin-bottom: 18px;
}
.k-popup-reward-amt {
  font-size: 26px; font-weight: 900; color: var(--gold); letter-spacing: -1px;
}
.k-popup-reward-lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.k-popup-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg,var(--gold),var(--gold2));
  border: none; border-radius: 11px;
  font-size: 15px; font-weight: 900; color: #000;
  cursor: pointer; transition: transform .15s;
  letter-spacing: .2px;
}
.k-popup-btn:active { transform: scale(.98); }
.k-popup-cancel {
  display: block; margin-top: 12px;
  font-size: 12px; color: var(--muted); cursor: pointer;
  background: none; border: none; width: 100%;
}
.k-popup-cancel:hover { color: var(--text); }
/* Active timer card */
.k-timer-card {
  background: var(--card); border: 1px solid rgba(245,158,11,.2);
  border-radius: var(--r); padding: 16px; margin-bottom: 12px;
}
.k-timer-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.k-timer-label { font-size: 13px; font-weight: 700; color: #fff; }
.k-timer-badge {
  background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.2);
  border-radius: 20px; padding: 3px 10px;
  font-size: 11px; font-weight: 700; color: var(--gold);
}
.k-timer-secs-big {
  font-size: 36px; font-weight: 900; color: var(--gold);
  text-align: center; letter-spacing: -2px; margin: 8px 0;
}
.k-timer-hint { font-size: 11px; color: var(--muted); text-align: center; margin-top: 6px; }
