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

:root {
  --bg:       #05080f;
  --bg2:      #090d16;
  --bg3:      #0e1220;
  --s1:       rgba(255,255,255,0.032);
  --s2:       rgba(255,255,255,0.058);
  --s3:       rgba(255,255,255,0.09);
  --b1:       rgba(255,255,255,0.065);
  --b2:       rgba(255,255,255,0.11);
  --b3:       rgba(255,255,255,0.18);
  --p:        #7c3aed;
  --p2:       #9333ea;
  --p3:       #a78bfa;
  --p4:       #c4b5fd;
  --glow:     rgba(124,58,237,0.22);
  --glow2:    rgba(124,58,237,0.08);
  --t1:       #eef2ff;
  --t2:       #94a3b8;
  --t3:       #475569;
  --t4:       #1e2d42;
  --red:      #f87171;
  --green:    #34d399;
  --yellow:   #fbbf24;
  --blue:     #60a5fa;
  --r1:       20px;
  --r2:       14px;
  --r3:       10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--t1);
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: fixed; inset: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 80% 5%,  rgba(124,58,237,0.13) 0%, transparent 60%),
    radial-gradient(ellipse 45% 30% at 10% 90%, rgba(147,51,234,0.08) 0%, transparent 55%),
    radial-gradient(ellipse 35% 25% at 50% 50%, rgba(124,58,237,0.04) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}

.page {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  position: relative; z-index: 1;
}
.page::-webkit-scrollbar { display: none; }

.inner { max-width: 520px; margin: 0 auto; padding: 14px 13px 26px; }

/* ─── Header ─────────────────────────────────────────────────── */
header {
  height: 56px; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(5,8,15,0.75);
  border-bottom: 1px solid var(--b1);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  flex-shrink: 0; z-index: 60; position: relative;
}

.logo { display: flex; align-items: center; gap: 8px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--p), var(--p2));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; color: #fff;
  box-shadow: 0 0 14px var(--glow);
}
.logo-text { font-size: 15px; font-weight: 800; letter-spacing: -0.5px; }
.logo-text span { color: var(--p3); }
.logo-version {
  font-size: 9px; font-weight: 700; color: var(--t3);
  background: var(--s2); border: 1px solid var(--b1);
  border-radius: 4px; padding: 2px 5px; letter-spacing: 0.5px;
}

/* ─── Hamburger ───────────────────────────────────────────────── */
.hamburger {
  width: 26px; height: 18px; display: flex; flex-direction: column;
  justify-content: space-between; cursor: pointer; z-index: 110;
}
.hamburger span {
  display: block; height: 2px; background: var(--t2); border-radius: 2px;
  transition: all 0.28s cubic-bezier(0.4,0,0.2,1); transform-origin: center;
}
.hamburger span:nth-child(1) { width: 100%; }
.hamburger span:nth-child(2) { width: 68%; margin-left: auto; }
.hamburger span:nth-child(3) { width: 100%; }
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); background: var(--p3); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); background: var(--p3); }

/* ─── Backdrop ────────────────────────────────────────────────── */
.backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.72); backdrop-filter: blur(5px);
  z-index: 90; opacity: 0; visibility: hidden;
  transition: opacity 0.28s, visibility 0.28s;
}
.backdrop.show { opacity: 1; visibility: visible; }

/* ─── Drawer ──────────────────────────────────────────────────── */
.drawer {
  position: fixed; top: 0; right: -100%;
  width: min(80vw, 270px); height: 100%;
  background: var(--bg2); border-left: 1px solid var(--b1);
  z-index: 100; transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column; overflow-y: auto;
}
.drawer.open { right: 0; }

.drawer-top {
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--b1);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.drawer-logo-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--p), var(--p2));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; color: #fff;
}
.drawer-logo-text { font-size: 14px; font-weight: 800; }
.drawer-logo-text span { color: var(--p3); }

.drawer-section {
  font-size: 9px; font-weight: 700; color: var(--t4);
  letter-spacing: 1.6px; text-transform: uppercase;
  padding: 14px 18px 5px;
}
.drawer-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; margin: 2px 8px; border-radius: 11px;
  text-decoration: none; font-size: 13px; font-weight: 500; color: var(--t2);
  transition: all 0.18s; border: none; background: none;
  width: calc(100% - 16px); cursor: pointer; font-family: 'Inter', sans-serif;
}
.drawer-item i { font-size: 17px; width: 20px; text-align: center; flex-shrink: 0; }
.drawer-item:hover { background: var(--s2); color: var(--t1); }
.drawer-item.active { background: rgba(124,58,237,0.1); color: var(--p3); border: 1px solid rgba(124,58,237,0.15); }
.drawer-item.danger { color: var(--red); }
.drawer-item.danger:hover { background: rgba(248,113,113,0.07); }
.drawer-spacer { flex: 1; min-height: 12px; }
.drawer-bottom { padding: 0 0 12px; border-top: 1px solid var(--b1); margin-top: 8px; padding-top: 8px; }

/* ─── Bottom Nav ──────────────────────────────────────────────── */
.bottom-nav {
  height: 62px; display: flex; align-items: center; justify-content: space-around;
  background: rgba(5,8,15,0.82); border-top: 1px solid var(--b1);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  flex-shrink: 0; z-index: 60; position: relative;
  padding-bottom: env(safe-area-inset-bottom);
}
.bn-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; color: var(--t3); font-size: 9px; font-weight: 700;
  letter-spacing: 0.5px; padding: 6px 16px; border-radius: 12px;
  transition: color 0.18s; min-width: 55px; position: relative;
  background: none; border: none; cursor: pointer; font-family: 'Inter', sans-serif;
}
.bn-item i { font-size: 22px; line-height: 1; }
.bn-item.active { color: var(--p3); }
.bn-item.active::before {
  content: ''; position: absolute; bottom: -1px;
  width: 20px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--p), var(--p2));
  box-shadow: 0 0 8px var(--glow);
}
.bn-item.danger { color: var(--red); }

/* ─── Glass card ──────────────────────────────────────────────── */
.card {
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r1); overflow: hidden;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--b2); }

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 13px 20px; border-radius: var(--r2); border: none;
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; user-select: none; letter-spacing: -0.2px;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--p), var(--p2));
  color: #fff; box-shadow: 0 2px 18px rgba(124,58,237,0.35);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 4px 28px rgba(124,58,237,0.5); }
.btn-ghost {
  background: var(--s1); color: var(--t2); border: 1px solid var(--b1);
}
.btn-ghost:hover { background: var(--s2); color: var(--t1); border-color: var(--b2); }
.btn-full { width: 100%; }

/* ─── Inputs ──────────────────────────────────────────────────── */
input, textarea, select {
  font-family: 'Inter', sans-serif; width: 100%;
  padding: 12px 14px; background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r2); color: var(--t1); font-size: 14px;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus {
  border-color: rgba(124,58,237,0.5);
  box-shadow: 0 0 0 3px var(--glow2);
}
input::placeholder { color: var(--t4); }

.field { display: flex; flex-direction: column; gap: 7px; }
.field-label {
  font-size: 10.5px; font-weight: 700; color: var(--t2);
  letter-spacing: 0.9px; text-transform: uppercase;
}

/* ─── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 100px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.3px;
}
.badge-admin   { background: rgba(124,58,237,0.1); color: var(--p3); border: 1px solid rgba(124,58,237,0.22); }
.badge-premium { background: rgba(251,191,36,0.09); color: var(--yellow); border: 1px solid rgba(251,191,36,0.2); }
.badge-level   { background: rgba(167,139,250,0.08); color: var(--p3); border: 1px solid rgba(167,139,250,0.18); }
.badge-get     { background: rgba(52,211,153,0.08); color: #34d399; border: 1px solid rgba(52,211,153,0.18); }
.badge-post    { background: rgba(251,191,36,0.08); color: var(--yellow); border: 1px solid rgba(251,191,36,0.18); }

/* ─── XP bar ──────────────────────────────────────────────────── */
.xp-bar-wrap { height: 5px; background: var(--s2); border-radius: 100px; overflow: hidden; }
.xp-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--p), var(--p3));
  border-radius: 100px; transition: width 0.9s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 0 10px rgba(167,139,250,0.45);
}

/* ─── Stats ───────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.stat-box {
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: 16px; padding: 15px 14px;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color 0.18s, background 0.18s;
}
.stat-box:hover { border-color: var(--b2); background: var(--s2); }
.stat-icon { font-size: 18px; color: var(--p3); opacity: 0.85; margin-bottom: 4px; display: block; }
.stat-label { font-size: 9.5px; color: var(--t2); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; }
.stat-val { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; color: var(--t1); }

/* ─── Key box ─────────────────────────────────────────────────── */
.key-box {
  background: rgba(124,58,237,0.045); border: 1px solid rgba(124,58,237,0.16);
  border-radius: var(--r2); padding: 13px 14px;
  display: flex; align-items: center; gap: 10px;
}
.key-val {
  font-family: 'SF Mono','Fira Code',monospace;
  font-size: 13px; font-weight: 600; color: var(--p3);
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0.6px;
}
.key-copy { color: var(--t3); cursor: pointer; font-size: 16px; transition: color 0.18s; flex-shrink: 0; }
.key-copy:hover { color: var(--p3); }

/* ─── Section label ───────────────────────────────────────────── */
.section-label {
  font-size: 9.5px; font-weight: 700; color: var(--t3);
  letter-spacing: 1.3px; text-transform: uppercase;
  margin-bottom: 9px; display: flex; align-items: center; gap: 8px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--b1); }

/* ─── Toast ───────────────────────────────────────────────────── */
.toast {
  position: fixed; top: 16px; left: 50%;
  transform: translateX(-50%) translateY(-90px);
  background: rgba(9,13,22,0.95); border: 1px solid var(--b2);
  border-radius: 100px; padding: 11px 20px;
  display: flex; align-items: center; gap: 9px;
  font-size: 12.5px; font-weight: 600; z-index: 9999;
  white-space: nowrap; box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  backdrop-filter: blur(20px);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(52,211,153,0.3); color: var(--green); }
.toast.error   { border-color: rgba(248,113,113,0.3); color: var(--red); }
.toast.info    { border-color: rgba(167,139,250,0.3); color: var(--p3); }

/* ─── Flash ───────────────────────────────────────────────────── */
.flash { padding: 11px 14px; border-radius: 11px; font-size: 13px; font-weight: 500; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.flash-success { background: rgba(52,211,153,0.06); border: 1px solid rgba(52,211,153,0.18); color: var(--green); }
.flash-error   { background: rgba(248,113,113,0.06); border: 1px solid rgba(248,113,113,0.18); color: var(--red); }

/* ─── Notif (auth) ────────────────────────────────────────────── */
.notif { padding: 11px 14px; border-radius: 10px; font-size: 13px; font-weight: 500; display: none; align-items: center; gap: 8px; }
.notif.error   { background: rgba(248,113,113,0.07); border: 1px solid rgba(248,113,113,0.2); color: var(--red);   display: flex; }
.notif.success { background: rgba(52,211,153,0.07);  border: 1px solid rgba(52,211,153,0.2);  color: var(--green); display: flex; }

/* ─── Divider ─────────────────────────────────────────────────── */
.divider { display: flex; align-items: center; gap: 10px; color: var(--t4); font-size: 11px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--b1); }

@media (min-width: 480px) { .inner { padding: 18px 20px 30px; } }
