* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #07080f;
  --bg2: #0c0e1a;
  --surface: rgba(24, 27, 42, 0.72);
  --surface-solid: #14172447;
  --surface2: rgba(38, 42, 64, 0.6);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0fb;
  --text-dim: #9aa0bd;
  --text-faint: #6a7090;
  --accent: #7c5cff;
  --accent2: #22d3ee;
  --accent-soft: rgba(124, 92, 255, 0.16);
  --success: #2dd4a7;
  --warn: #fbbf24;
  --danger: #fb7185;
  --gold: #ffd24a;
  --gold2: #f59e0b;
  --silver: #c7ccd8;
  --bronze: #d08a52;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0,0,0,.45);
  --grad: linear-gradient(135deg, var(--accent), var(--accent2));
  --grad-gold: linear-gradient(135deg, var(--gold), var(--gold2));
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Pretendard', Roboto, 'Apple SD Gothic Neo', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vw 60vw at 12% -10%, rgba(124,92,255,.22), transparent 60%),
    radial-gradient(50vw 50vw at 100% 0%, rgba(34,211,238,.16), transparent 55%),
    radial-gradient(40vw 40vw at 80% 100%, rgba(245,158,11,.10), transparent 60%),
    var(--bg);
}

.screen { display: none; }
.screen.active { display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

button { font-family: inherit; }
.gradient-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gold-text {
  background: var(--grad-gold); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============ LANDING / AUTH ============ */
/* display lives on .active so `.screen { display:none }` can hide it — an ID `display:flex`
   here would outrank the class rule and the landing would never clear after login. */
#auth-screen { min-height: 100vh; padding: 32px 20px; }
#auth-screen.active { display: flex; align-items: center; justify-content: center; }
.landing { width: 100%; max-width: 1040px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.landing-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600;
  color: var(--accent2); letter-spacing: .12em; text-transform: uppercase;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.landing-hero h1 { font-size: 52px; line-height: 1.05; margin: 20px 0 14px; font-weight: 800; letter-spacing: -0.02em; }
.landing-hero p.lede { font-size: 17px; color: var(--text-dim); line-height: 1.6; max-width: 460px; }
.value-props { display: flex; flex-direction: column; gap: 12px; margin: 28px 0; }
.vp { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); backdrop-filter: blur(12px); }
.vp .vp-icon { font-size: 22px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); flex-shrink: 0; }
.vp .vp-title { font-weight: 700; font-size: 15px; }
.vp .vp-desc { font-size: 13px; color: var(--text-dim); margin-top: 2px; line-height: 1.45; }
.landing-stats { display: flex; gap: 24px; margin-top: 8px; }
.landing-stats .ls-val { font-size: 22px; font-weight: 800; }
.landing-stats .ls-label { font-size: 12px; color: var(--text-faint); }

.auth-card {
  padding: 32px; background: var(--surface); backdrop-filter: blur(18px);
  border-radius: 22px; border: 1px solid var(--border-strong); box-shadow: var(--shadow);
}
.auth-card .brand-mark { font-size: 13px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.auth-card h2 { font-size: 22px; margin-bottom: 6px; font-weight: 800; }
.auth-card .subtitle { color: var(--text-dim); margin-bottom: 22px; font-size: 14px; }
.auth-card label { display: block; font-size: 12px; color: var(--text-dim); margin: 0 0 6px 2px; font-weight: 600; }
.auth-card input {
  width: 100%; padding: 13px 16px; margin-bottom: 16px;
  background: rgba(0,0,0,.25); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.auth-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-primary {
  width: 100%; padding: 14px; border: none; border-radius: 12px; cursor: pointer;
  font-size: 15px; font-weight: 700; color: #fff; background: var(--grad);
  transition: transform .15s, box-shadow .2s; box-shadow: 0 8px 24px rgba(124,92,255,.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(124,92,255,.45); }
.btn-primary:active { transform: translateY(0); }
.welcome-note { font-size: 12px; color: var(--text-faint); margin-top: 14px; text-align: center; }
.error { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 16px; }

/* ============ APP SHELL ============ */
header {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 22px; border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 22, 0.78); backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 100;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; font-size: 16px; box-shadow: 0 4px 14px rgba(124,92,255,.4); }
.brand .tag { font-size: 10px; color: var(--gold); font-weight: 700; border: 1px solid rgba(255,210,74,.3); padding: 1px 6px; border-radius: 6px; }
.header-spacer { flex: 1; }
.header-right { display: flex; align-items: center; gap: 10px; }
.log-pill {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(255,210,74,.25); background: linear-gradient(135deg, rgba(255,210,74,.10), rgba(245,158,11,.04));
  cursor: pointer; transition: transform .15s;
}
.log-pill:hover { transform: translateY(-1px); }
.log-pill .coin { font-size: 14px; }
.log-pill .amt { font-weight: 800; font-size: 14px; }
.log-pill .unit { font-size: 11px; color: var(--gold); font-weight: 700; }
.chip { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.chip-tier { color: #0a0b14; }
.chip-level { background: var(--accent-soft); color: var(--accent2); border: 1px solid var(--border); }
.icon-btn { background: rgba(255,255,255,.04); border: 1px solid var(--border); width: 38px; height: 38px; border-radius: 11px; color: var(--text); font-size: 17px; cursor: pointer; position: relative; transition: background .2s; }
.icon-btn:hover { background: rgba(255,255,255,.09); }
.notif-badge { position: absolute; top: -5px; right: -5px; background: var(--danger); color: #fff; font-size: 10px; min-width: 17px; height: 17px; line-height: 17px; padding: 0 4px; border-radius: 9px; font-weight: 700; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0; }

/* ============ NAV TABS ============ */
#tabs {
  display: flex; gap: 4px; overflow-x: auto; padding: 10px 16px;
  max-width: 1080px; margin: 0 auto; scrollbar-width: none;
}
#tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px 16px; background: transparent; border: 1px solid transparent; border-radius: 999px;
  color: var(--text-dim); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: all .18s; display: flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.tab.active { color: #fff; background: var(--accent-soft); border-color: rgba(124,92,255,.4); }
.tab .t-ico { font-size: 14px; }

/* ============ CONTENT ============ */
.tab-content { display: none; max-width: 720px; margin: 0 auto; padding: 22px 16px 80px; }
.tab-content.active { display: block; animation: fade .3s ease; }
.tab-content.wide { max-width: 980px; }
.section-title { font-size: 15px; font-weight: 700; color: var(--text-dim); margin: 26px 4px 12px; text-transform: uppercase; letter-spacing: .06em; }
.empty { text-align: center; color: var(--text-faint); padding: 48px 20px; font-size: 14px; }

.card {
  background: var(--surface); backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 20px rgba(0,0,0,.18);
}

/* Compose */
.compose-box { padding: 16px; margin-bottom: 22px; display: flex; gap: 12px; }
.compose-box .avatar { width: 42px; height: 42px; }
.compose-main { flex: 1; }
.compose-box textarea {
  width: 100%; min-height: 54px; background: transparent; border: none; color: var(--text);
  font-size: 16px; resize: none; outline: none; font-family: inherit; line-height: 1.5;
}
.compose-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; border-top: 1px solid var(--border); padding-top: 12px; }
.compose-actions .hint { color: var(--text-faint); font-size: 12px; }
.btn-sm {
  padding: 8px 20px; background: var(--grad); color: #fff; border: none; border-radius: 999px;
  font-weight: 700; font-size: 14px; cursor: pointer; transition: transform .15s, opacity .2s;
}
.btn-sm:hover { transform: translateY(-1px); }
.btn-sm:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-ghost {
  padding: 8px 18px; background: transparent; border: 1px solid var(--border-strong); color: var(--text);
  border-radius: 999px; font-weight: 600; font-size: 13px; cursor: pointer; transition: all .18s;
}
.btn-ghost:hover { background: rgba(255,255,255,.06); border-color: var(--accent); }

/* Feed */
.feed-list { display: flex; flex-direction: column; gap: 14px; }
.post-card { padding: 16px 18px; transition: transform .15s, border-color .2s; }
.post-card:hover { border-color: var(--border-strong); }
.post-top { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.post-top .meta { flex: 1; min-width: 0; }
.post-author { font-weight: 700; font-size: 15px; }
.post-handle { color: var(--text-faint); font-size: 13px; }
.tier-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 6px; vertical-align: middle; }
.post-rank { font-size: 11px; color: var(--accent2); font-weight: 600; margin-left: 4px; }
.post-time { font-size: 12px; color: var(--text-faint); }
.post-content { font-size: 15px; line-height: 1.55; margin-bottom: 14px; white-space: pre-wrap; word-break: break-word; }
.post-actions { display: flex; gap: 8px; }
.act-btn {
  background: transparent; border: 1px solid transparent; border-radius: 999px; color: var(--text-dim);
  padding: 7px 13px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 7px;
  transition: all .18s; font-weight: 600;
}
.act-btn:hover { background: rgba(255,255,255,.05); color: var(--text); }
.act-btn.liked { color: var(--danger); background: rgba(251,113,133,.1); }
.act-btn.shared { color: var(--success); background: rgba(45,212,167,.1); }

/* Profile */
.profile-hero { padding: 28px 24px; text-align: center; margin-bottom: 18px; position: relative; overflow: hidden; }
.profile-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 96px; background: var(--grad); opacity: .18; }
.profile-hero .avatar { width: 84px; height: 84px; font-size: 30px; margin: 0 auto 12px; position: relative; border: 3px solid var(--bg2); box-shadow: var(--shadow); }
.profile-name { font-size: 24px; font-weight: 800; }
.profile-username { color: var(--text-dim); font-size: 14px; margin-top: 2px; }
.profile-chips { display: flex; gap: 8px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.profile-stats { display: flex; justify-content: center; gap: 8px; margin: 18px 0 6px; }
.pstat { flex: 1; max-width: 110px; padding: 12px 6px; border-radius: 12px; background: var(--surface2); }
.pstat .v { font-size: 19px; font-weight: 800; }
.pstat .l { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.xp-bar-container { max-width: 440px; margin: 18px auto 6px; }
.bar { height: 9px; background: rgba(0,0,0,.3); border-radius: 6px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 6px; transition: width .6s cubic-bezier(.4,0,.2,1); }
.bar.xp > span { background: var(--grad); }
.bar.stake > span { background: var(--grad-gold); }
.xp-label { font-size: 12px; color: var(--text-dim); margin-top: 6px; display: flex; justify-content: space-between; }
.streak-display { color: var(--warn); font-size: 13px; margin-top: 12px; font-weight: 600; }

/* Badges */
.badges-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.badge-item { flex: 1; min-width: 88px; max-width: 120px; padding: 14px 10px; text-align: center; border-radius: 14px; background: var(--surface2); border: 1px solid var(--border); }
.badge-icon { font-size: 30px; }
.badge-name { font-size: 11px; font-weight: 700; margin-top: 6px; }

/* Leaderboard */
.leaderboard { display: flex; flex-direction: column; gap: 8px; }
.lb-entry { display: flex; align-items: center; gap: 14px; padding: 12px 16px; transition: transform .15s, border-color .2s; }
.lb-entry:hover { transform: translateX(2px); border-color: var(--border-strong); }
.lb-entry.me { border-color: var(--accent); background: var(--accent-soft); }
.lb-rank { font-size: 18px; font-weight: 800; min-width: 34px; text-align: center; }
.lb-rank.gold { color: var(--gold); } .lb-rank.silver { color: var(--silver); } .lb-rank.bronze { color: var(--bronze); }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-weight: 700; font-size: 15px; }
.lb-sub { font-size: 12px; color: var(--text-dim); display: flex; gap: 8px; align-items: center; }
.lb-right { text-align: right; }
.lb-xp { font-weight: 800; color: var(--accent2); }
.lb-log { font-size: 12px; color: var(--gold); font-weight: 600; }

/* Challenges */
.challenges { display: flex; flex-direction: column; gap: 12px; }
.challenge-card { padding: 18px; }
.challenge-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.challenge-title { font-weight: 700; font-size: 16px; }
.challenge-desc { font-size: 13px; color: var(--text-dim); margin: 6px 0 14px; line-height: 1.45; }
.challenge-progress { display: flex; align-items: center; gap: 12px; }
.challenge-progress .bar { flex: 1; }
.challenge-progress .bar > span { background: var(--grad); }
.progress-text { font-size: 12px; color: var(--text-dim); min-width: 52px; text-align: right; font-weight: 600; }
.challenge-reward { font-size: 13px; color: var(--gold); margin-top: 12px; font-weight: 600; }
.pill-done { font-size: 11px; color: var(--success); font-weight: 700; background: rgba(45,212,167,.12); padding: 3px 9px; border-radius: 999px; }

/* Weekly Season */
.season-panel { padding: 20px; }
.season-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.season-kicker { font-size: 12px; color: var(--accent2); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.season-title { font-size: 24px; font-weight: 900; margin-top: 4px; }
.season-clock { padding: 6px 11px; border-radius: 999px; background: rgba(255,210,74,.12); color: var(--gold); font-size: 12px; font-weight: 800; white-space: nowrap; }
.season-score { display: flex; justify-content: space-between; gap: 16px; margin: 18px 0 12px; color: var(--text-dim); font-size: 13px; font-weight: 700; }
.season-score span { color: var(--text); font-size: 30px; font-weight: 900; margin-right: 6px; }
.season-next { padding: 14px; border-radius: 14px; background: var(--surface2); }
.season-next .bar > span { background: var(--grad-gold); }
.season-next-label { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--text-dim); font-weight: 700; }
.season-next-label span:last-child { color: var(--gold); white-space: nowrap; }
.season-tiers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.season-tier { display: flex; align-items: center; gap: 12px; padding: 13px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255,255,255,.035); }
.season-tier.unlocked { border-color: rgba(45,212,167,.35); background: rgba(45,212,167,.08); }
.season-tier.next { border-color: rgba(255,210,74,.38); background: rgba(255,210,74,.08); }
.season-tier.locked { opacity: .64; }
.season-tier-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--surface2); font-size: 17px; }
.season-tier-main { flex: 1; min-width: 0; }
.season-tier-title { font-size: 13px; font-weight: 800; }
.season-tier-perk { font-size: 11px; color: var(--text-dim); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.season-tier-reward { text-align: right; font-size: 11px; color: var(--text-faint); font-weight: 700; white-space: nowrap; }
.season-tier-reward span { display: block; color: var(--gold); margin-top: 2px; }

/* ============ STAKING ============ */
.stake-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.stake-stat { padding: 18px; text-align: center; }
.stake-stat .label { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; justify-content: center; gap: 6px; }
.stake-stat .val { font-size: 26px; font-weight: 800; margin-top: 6px; }
.stake-stat .val small { font-size: 13px; font-weight: 600; color: var(--gold); }
.stake-stat.yield .val { color: var(--success); }
.tier-banner { padding: 18px 20px; margin-bottom: 18px; display: flex; align-items: center; gap: 16px; }
.tier-banner .tb-badge { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; flex-shrink: 0; }
.tier-banner .tb-name { font-size: 18px; font-weight: 800; }
.tier-banner .tb-sub { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.tier-banner .tb-apr { margin-left: auto; text-align: right; }
.tier-banner .tb-apr .v { font-size: 22px; font-weight: 800; color: var(--gold); }
.tier-banner .tb-apr .l { font-size: 11px; color: var(--text-dim); }

.ladder { display: flex; flex-direction: column; gap: 10px; }
.tier-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--border); transition: all .2s; }
.tier-row.current { border-color: var(--gold); background: linear-gradient(135deg, rgba(255,210,74,.08), transparent); }
.tier-row.reached { opacity: .9; }
.tier-row.locked { opacity: .55; }
.tier-row .tr-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; flex-shrink: 0; }
.tier-row .tr-main { flex: 1; min-width: 0; }
.tier-row .tr-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.tier-row .tr-perks { font-size: 12px; color: var(--text-dim); margin-top: 3px; line-height: 1.4; }
.tier-row .tr-meta { text-align: right; flex-shrink: 0; }
.tier-row .tr-stake { font-size: 13px; font-weight: 700; }
.tier-row .tr-apr { font-size: 11px; color: var(--gold); }
.tag-current { font-size: 10px; font-weight: 700; color: #0a0b14; background: var(--gold); padding: 2px 7px; border-radius: 6px; }

.stake-panel { padding: 20px; margin: 18px 0; }
.stake-panel h4 { font-size: 14px; margin-bottom: 4px; }
.stake-panel .sub { font-size: 12px; color: var(--text-dim); margin-bottom: 14px; }
.stake-input-row { display: flex; gap: 10px; margin-bottom: 12px; }
.stake-input-row input {
  flex: 1; padding: 12px 14px; background: rgba(0,0,0,.28); border: 1px solid var(--border);
  border-radius: 11px; color: var(--text); font-size: 15px; outline: none;
}
.stake-input-row input:focus { border-color: var(--gold); }
.quick-amts { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-amts button { padding: 6px 12px; font-size: 12px; background: var(--surface2); border: 1px solid var(--border); color: var(--text-dim); border-radius: 999px; cursor: pointer; transition: all .15s; }
.quick-amts button:hover { border-color: var(--gold); color: var(--text); }
.stake-btns { display: flex; gap: 10px; margin-top: 14px; }
.btn-gold { flex: 1; padding: 12px; border: none; border-radius: 11px; background: var(--grad-gold); color: #1a1407; font-weight: 800; cursor: pointer; transition: transform .15s; }
.btn-gold:hover { transform: translateY(-1px); }
.btn-gold:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* Economy */
.econ-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.econ-col { padding: 16px; }
.econ-col h5 { font-size: 13px; margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.econ-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.econ-col li { font-size: 12.5px; color: var(--text-dim); padding-left: 16px; position: relative; line-height: 1.4; }
.econ-col li::before { content: ""; position: absolute; left: 0; top: 7px; width: 6px; height: 6px; border-radius: 50%; }
.econ-col.inflow li::before { background: var(--success); }
.econ-col.outflow li::before { background: var(--danger); }
.econ-col.utility li::before { background: var(--accent2); }
.supply-row { display: flex; gap: 12px; margin-bottom: 16px; }
.supply-stat { flex: 1; padding: 14px; text-align: center; border-radius: 12px; background: var(--surface2); }
.supply-stat .v { font-size: 18px; font-weight: 800; } .supply-stat .l { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.ratio-ring { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 16px; }
.ring { width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.ratio-ring .rr-txt .v { font-weight: 700; } .ratio-ring .rr-txt .l { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* Token transactions */
.txn-list { display: flex; flex-direction: column; gap: 6px; }
.txn { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 11px; background: var(--surface2); border: 1px solid var(--border); }
.txn .tk { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 14px; flex-shrink: 0; }
.txn .tk.earn { background: rgba(45,212,167,.14); } .txn .tk.spend { background: rgba(251,113,133,.14); }
.txn .tk.stake { background: rgba(124,92,255,.16); } .txn .tk.unstake { background: rgba(34,211,238,.14); }
.txn .tk.yield { background: rgba(255,210,74,.14); } .txn .tk.grant { background: rgba(255,255,255,.08); }
.txn .tx-main { flex: 1; min-width: 0; } .txn .tx-reason { font-size: 13px; font-weight: 600; } .txn .tx-time { font-size: 11px; color: var(--text-faint); }
.txn .tx-delta { font-weight: 800; font-size: 14px; } .txn .tx-delta.pos { color: var(--success); } .txn .tx-delta.neg { color: var(--danger); }

/* Rewards */
.rewards-balance { padding: 22px; text-align: center; margin-bottom: 18px; }
.rewards-balance .bv { font-size: 34px; font-weight: 800; } .rewards-balance .bl { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.rewards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.reward-card { padding: 18px; display: flex; flex-direction: column; }
.reward-emoji { font-size: 30px; margin-bottom: 8px; }
.reward-name { font-weight: 700; font-size: 15px; } .reward-desc { font-size: 12.5px; color: var(--text-dim); margin: 5px 0 12px; line-height: 1.4; flex: 1; }
.reward-cost { font-weight: 800; color: var(--gold); font-size: 15px; } .reward-stock { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.reward-card button { margin-top: 14px; padding: 10px; border: none; border-radius: 11px; background: var(--grad-gold); color: #1a1407; font-weight: 700; cursor: pointer; transition: transform .15s; }
.reward-card button:hover { transform: translateY(-1px); } .reward-card button:disabled { opacity: .4; cursor: not-allowed; transform: none; background: var(--surface2); color: var(--text-faint); }

/* Members */
.users-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.user-card { padding: 16px; }
.user-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.user-card-top .meta { flex: 1; min-width: 0; }
.user-card-name { font-weight: 700; font-size: 14px; } .user-card-handle { font-size: 12px; color: var(--text-faint); }
.user-card-stats { display: flex; gap: 14px; font-size: 12px; color: var(--text-dim); margin-bottom: 12px; }
.user-card-stats b { color: var(--text); }
.user-card button { width: 100%; padding: 8px; background: transparent; border: 1px solid var(--accent); color: var(--accent2); border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600; transition: all .18s; }
.user-card button:hover { background: var(--accent); color: #fff; }
.user-card button.following { background: var(--surface2); border-color: var(--border); color: var(--text-dim); }

/* Notifications */
.notif-panel { position: fixed; top: 0; right: 0; width: 380px; max-width: 100vw; height: 100vh; background: var(--bg2); border-left: 1px solid var(--border); z-index: 200; overflow-y: auto; box-shadow: -8px 0 40px rgba(0,0,0,.5); }
.notif-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg2); }
.notif-header h3 { font-size: 16px; }
.notif-header button { background: none; border: none; color: var(--text); font-size: 24px; cursor: pointer; }
.notif-list { padding: 10px; }
.notif-item { padding: 13px 14px; border-radius: 12px; margin-bottom: 6px; background: var(--surface2); }
.notif-item .notif-title { font-weight: 700; margin-bottom: 3px; font-size: 14px; }
.notif-item .notif-body { color: var(--text-dim); font-size: 13px; line-height: 1.4; }
.notif-item .notif-time { font-size: 11px; color: var(--text-faint); margin-top: 5px; }

/* Toast */
.xp-toast { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%); background: var(--grad); color: #fff; padding: 13px 26px; border-radius: 999px; font-weight: 700; font-size: 14px; z-index: 300; box-shadow: 0 10px 40px rgba(124,92,255,.5); animation: toastIn .35s cubic-bezier(.2,.9,.3,1.2); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(24px) scale(.95); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); backdrop-filter: blur(4px); z-index: 250; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-content { background: var(--bg2); border: 1px solid var(--border-strong); border-radius: 18px; width: 500px; max-width: 100%; max-height: 82vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; }
.modal-header button { background: none; border: none; color: var(--text); font-size: 24px; cursor: pointer; }
.comment-list { flex: 1; overflow-y: auto; padding: 14px 20px; }
.comment-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.comment-item .avatar { width: 32px; height: 32px; font-size: 12px; }
.comment-item .comment-author { font-weight: 700; font-size: 13px; }
.comment-item .comment-body { color: var(--text-dim); margin-top: 2px; font-size: 14px; line-height: 1.4; }
.comment-input { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.comment-input input { flex: 1; padding: 10px 14px; background: rgba(0,0,0,.28); border: 1px solid var(--border); border-radius: 999px; color: var(--text); font-size: 14px; outline: none; }
.comment-input input:focus { border-color: var(--accent); }
.comment-input button { padding: 10px 18px; background: var(--grad); color: #fff; border: none; border-radius: 999px; cursor: pointer; font-weight: 700; }

.hidden { display: none !important; }
.skeleton { background: linear-gradient(90deg, var(--surface2) 25%, rgba(255,255,255,.05) 50%, var(--surface2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 12px; height: 90px; }
@keyframes shimmer { to { background-position: -200% 0; } }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* ---------- Daily Quests ---------- */
.daily-quests { padding: 14px 16px; margin-bottom: 14px; }
.daily-quests:empty { display: none; }
.dq-head { display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.dq-head .dq-progress { font-size: 12px; color: var(--gold); font-weight: 700;
  background: rgba(255,210,74,.12); padding: 2px 9px; border-radius: 999px; }
.dq-row { display: flex; align-items: center; gap: 11px; padding: 7px 0; }
.dq-row.done { opacity: .72; }
.dq-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  font-size: 16px; border-radius: 9px; background: var(--surface2); }
.dq-main { flex: 1; min-width: 0; }
.dq-title { font-size: 13px; font-weight: 600; margin-bottom: 5px;
  display: flex; gap: 8px; align-items: baseline; }
.dq-title .dq-rw { font-size: 11px; color: var(--gold); font-weight: 700; }
.dq-row.done .dq-title { text-decoration: line-through; text-decoration-color: var(--text-faint); }
.dq-bar { height: 7px; background: rgba(0,0,0,.3); border-radius: 5px; overflow: hidden; }
.dq-bar > span { display: block; height: 100%; border-radius: 5px; background: var(--grad);
  transition: width .6s cubic-bezier(.4,0,.2,1); }
.dq-row.done .dq-bar > span { background: var(--success); }
.dq-count { font-size: 12px; font-weight: 700; color: var(--text-dim); min-width: 34px; text-align: right; }
.dq-clear { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-dim); text-align: center; }
.dq-clear b { color: var(--gold); }
.dq-clear.done { color: var(--success); font-weight: 700; }

@media (max-width: 860px) {
  .landing { grid-template-columns: 1fr; gap: 28px; }
  .landing-hero h1 { font-size: 38px; }
  .stake-grid, .econ-grid { grid-template-columns: 1fr; }
  .season-tiers { grid-template-columns: 1fr; }
  .tier-banner { flex-wrap: wrap; }
  .tier-banner .tb-apr { margin-left: 0; }
}

@media (max-width: 560px) {
  /* Header: keep all controls on one row without overflowing the right edge */
  header { padding: 10px 12px; gap: 10px; }
  .brand { font-size: 15px; gap: 8px; }
  .brand .logo { width: 26px; height: 26px; font-size: 14px; }
  .brand .tag { display: none; }
  .header-right { gap: 7px; }
  .log-pill { padding: 5px 9px; gap: 5px; }
  .log-pill .unit { display: none; }
  .chip-level { display: none; }          /* level/rank also shown on profile */
  .chip-tier { max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
  .icon-btn { width: 34px; height: 34px; font-size: 15px; }
  .header-right .avatar { width: 30px; height: 30px; font-size: 12px; }

  #tabs { padding: 8px 10px; }
  .tab { padding: 8px 13px; font-size: 13px; }
  .tab-content { padding: 18px 12px 80px; }

  /* Landing/auth fit a phone column */
  #auth-screen { padding: 24px 16px; }
  .landing-hero h1 { font-size: 30px; }
  .landing-hero p.lede { font-size: 15px; }
  .auth-card { padding: 24px 20px; }
  .landing-stats { flex-wrap: wrap; gap: 16px 22px; }

  /* Staking actions: stack instead of squeezing 3 buttons across */
  .stake-btns { flex-wrap: wrap; }
  .stake-btns .btn-gold { flex: 1 1 100%; }
  .stake-btns .btn-ghost { flex: 1 1 0; }

  /* Wrap multi-stat rows so nothing clips the card edge */
  .profile-stats { flex-wrap: wrap; }
  .profile-stats .pstat { min-width: 72px; }
  .supply-row { flex-wrap: wrap; }
  .supply-row .supply-stat { min-width: 88px; }
  .season-panel { padding: 16px; }
  .season-head { align-items: flex-start; }
  .season-title { font-size: 20px; }
  .season-score, .season-next-label { flex-direction: column; gap: 4px; }
  .season-tier { align-items: flex-start; }
}
