:root {
  --bg: #0E0F0C;
  --card: #1A1C18;
  --line: #2A2D27;
  --line2: #3A3D36;
  --text: #F4F2EC;
  --soft: #C9C7C0;
  --muted: #A3A69C;
  --accent: #C8F25A;
  --orange: #FF8A3D;
  --warnbg: #241A12;
  --warntext: #FFC49E;
  --display: 'Barlow Condensed', sans-serif;
  --body: 'Manrope', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: var(--body); font-size: 16px; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.loading { padding: 80px 20px; text-align: center; color: var(--muted); }

/* ---------- phone shell ---------- */
.shell { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.page { padding: 28px 20px 110px; display: flex; flex-direction: column; gap: 16px; flex-grow: 1; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; background: #121310; border-top: 1px solid var(--line); padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); z-index: 10; }
.nav-inner { max-width: 480px; margin: 0 auto; display: flex; justify-content: space-around; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--muted); }
.nav a.on { color: var(--accent); }
.nav svg { width: 22px; height: 22px; }

h1.title { margin: 0; font-family: var(--display); font-weight: 700; font-size: 40px; text-transform: uppercase; line-height: 1; }
h2 { margin: 0; font-size: 16px; font-weight: 700; }
.sub { font-size: 13px; color: var(--muted); }
.card { background: var(--card); border-radius: 18px; padding: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.big { font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 1; }
.label { font-size: 12px; color: var(--muted); }
.accent { color: var(--accent); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack6 { display: flex; flex-direction: column; gap: 6px; }
.empty { color: var(--muted); font-size: 14px; line-height: 1.5; text-align: center; padding: 24px 12px; }

/* header */
.top { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 999px; background: var(--line); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.iconbtn { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); display: flex; align-items: center; justify-content: center; position: relative; }
.dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 999px; background: var(--orange); }

/* hero */
.hero { background: var(--accent); color: var(--bg); border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.hero .k { font-size: 13px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.hero .v { font-family: var(--display); font-weight: 700; font-size: 72px; line-height: .9; }
.chip { border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; }
.chip.dark { background: var(--bg); color: var(--accent); }
.chip.soft { background: rgba(14,15,12,.12); font-weight: 600; }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; height: 64px; }
.bars div { background: rgba(14,15,12,.25); border-radius: 4px; min-height: 3px; }
.bars div.today { background: var(--bg); }
.barlabels { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; font-size: 11px; font-weight: 600; text-align: center; }

.progress { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 999px; }
.lvl { width: 52px; height: 52px; border-radius: 14px; border: 2px solid var(--accent); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--accent); }

.badges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.badge { background: var(--card); border-radius: 14px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.badge .b { width: 40px; height: 40px; border-radius: 999px; background: var(--accent); color: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.badge.locked { border: 1px dashed var(--line2); }
.badge.locked .b { background: var(--line); color: #8A8D83; }
.badge span { font-size: 11px; color: var(--soft); line-height: 1.3; }

/* ad cards */
.thumb { width: 60px; height: 80px; border-radius: 10px; background: var(--line2); flex-shrink: 0; object-fit: cover; display: flex; align-items: center; justify-content: center; }
.thumb.lg { width: 72px; height: 96px; border-radius: 12px; }
.adcard { background: var(--card); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.adname { font-size: 15px; font-weight: 700; line-height: 1.3; word-break: break-word; }
.pill { flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--line); color: var(--soft); }
.pill.live { background: var(--accent); color: var(--bg); }
.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.stats3 .v { font-size: 15px; font-weight: 700; }
.tip { background: var(--warnbg); border-radius: 12px; padding: 10px 12px; font-size: 12px; line-height: 1.45; color: var(--warntext); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.fbtn { height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; color: var(--text); font-weight: 600; font-size: 13px; }
.fbtn.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 700; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--card); border-radius: 999px; padding: 4px; }
.seg button { height: 40px; border-radius: 999px; border: none; background: transparent; color: var(--soft); font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--text); color: var(--bg); font-weight: 700; }

/* leaderboard */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.pod .blk { width: 100%; border-radius: 14px 14px 0 0; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.pod.first .blk { background: var(--accent); color: var(--bg); }
.pod .n { font-family: var(--display); font-weight: 700; font-size: 32px; }
.lbrow { display: flex; align-items: center; gap: 12px; border-radius: 14px; padding: 10px 14px; background: var(--card); }
.lbrow.me { background: var(--accent); color: var(--bg); }
.lbrow .rk { width: 28px; font-family: var(--display); font-weight: 700; font-size: 22px; }

/* ad detail */
.media { position: relative; border-radius: 20px; background: var(--line2); overflow: hidden; aspect-ratio: 4 / 5; display: flex; align-items: center; justify-content: center; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.playbtn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 76px; height: 76px; border-radius: 999px; border: none; background: rgba(14,15,12,.72); display: flex; align-items: center; justify-content: center; }
.playbtn:hover { background: rgba(14,15,12,.9); }
.media.playing { background: #fff; }
.meter { height: 8px; border-radius: 999px; background: var(--line); position: relative; }
.meter > div { height: 100%; border-radius: 999px; }
.meter .mark { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--text); }
.spark { display: flex; gap: 4px; align-items: flex-end; height: 80px; }
.spark div { flex: 1 1 0; border-radius: 3px; background: var(--line2); min-height: 2px; }
.spark div.recent { background: var(--accent); }
.num { width: 28px; height: 28px; border-radius: 999px; background: var(--accent); color: var(--bg); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.comment { display: flex; gap: 10px; }
.comment .avatar { width: 36px; height: 36px; font-size: 12px; }
.comment p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: #E3E1DA; white-space: pre-wrap; word-break: break-word; }

/* forms */
label.f { font-size: 14px; font-weight: 600; display: block; margin-bottom: 6px; }
.input, textarea.input, select.input { width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); padding: 10px 14px; }
textarea.input { resize: vertical; min-height: 72px; }
.btn { min-height: 48px; padding: 0 20px; border-radius: 12px; border: none; background: var(--accent); color: var(--bg); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line2); font-weight: 600; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; min-height: 44px; color: var(--soft); }
.msg { font-size: 13px; line-height: 1.5; padding: 10px 12px; border-radius: 12px; background: var(--card); color: var(--soft); }
.msg.err { background: #2A1414; color: #FFB4A8; }

/* notifications sheet */
.sheet { background: var(--card); border-radius: 18px; padding: 8px; display: flex; flex-direction: column; }
.sheet .n { padding: 12px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.sheet .n:last-child { border-bottom: none; }
.sheet .n.unread { color: var(--text); font-weight: 600; }
.sheet .n .when { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }

/* login */
.login { max-width: 480px; margin: 0 auto; min-height: 100vh; padding: 56px 24px 32px; display: flex; flex-direction: column; gap: 28px; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: 3px; }
.club { font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.login h1 { margin: 40px 0 0; font-family: var(--display); font-weight: 700; font-size: 64px; line-height: .92; text-transform: uppercase; }
.login p.lead { margin: 0; font-size: 16px; line-height: 1.5; color: var(--soft); }

/* ---------- admin (desktop) ---------- */
.admin { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side { flex: 1 1 220px; max-width: 260px; padding: 28px 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 24px; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a { padding: 12px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--soft); }
.side nav a.on { background: var(--card); color: var(--accent); font-weight: 700; }
.amain { flex: 999 1 560px; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 24px; }
.tablewrap { overflow-x: auto; background: var(--card); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; padding: 14px 16px; white-space: nowrap; }
td { padding: 10px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
td .thumb { width: 40px; height: 52px; border-radius: 8px; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
@media (max-width: 760px) {
  .side { max-width: none; border-right: none; border-bottom: 1px solid var(--line); padding: 20px; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .amain { padding: 20px 16px 48px; }
}

/* brand */
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; letter-spacing: 2px; line-height: 1; color: var(--text); }
.brand b { color: var(--accent); font-weight: 800; }
