/* ============================================================
   MLBB.MOBI — design system
   Self-contained, no runtime deps. Dark gaming vibe, RU/CIS.
   ============================================================ */

:root {
  /* base */
  --bg-0: #070a14;
  --bg-1: #0b1020;
  --bg-2: #111934;
  --bg-3: #18203f;
  --line: #232c52;
  --line-soft: #1a2342;

  /* text */
  --tx-0: #f4f7ff;
  --tx-1: #c2cbe8;
  --tx-2: #8a96bd;
  --tx-3: #5d6890;

  /* brand accents */
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --violet: #8b5cf6;
  --pink: #ec4899;
  --gold: #fbbf24;
  --green: #34d399;
  --red: #fb5b6b;

  --grad-brand: linear-gradient(120deg, #22d3ee 0%, #6366f1 55%, #8b5cf6 100%);
  --grad-gift: linear-gradient(120deg, #ec4899 0%, #a855f7 100%);
  --grad-gold: linear-gradient(120deg, #fbbf24 0%, #f59e0b 100%);
  --grad-card: linear-gradient(160deg, rgba(34,211,238,0.08), rgba(139,92,246,0.05));

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --shadow: 0 18px 50px -20px rgba(0,0,0,0.7);
  --glow-cyan: 0 0 0 1px rgba(34,211,238,0.3), 0 10px 40px -12px rgba(34,211,238,0.5);
  --glow-pink: 0 10px 40px -10px rgba(236,72,153,0.6);

  --ff: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --ff-display: 'Oswald', var(--ff);
}

/* Oswald display weight (condensed face defaults to 400 — force bold on display elements) */
.brand, .hero h1, .pack .amt, .how .step .n, .lb-rank, .pick .a, .perk .preview, .stat-row .tile b, .hero-stats .s b { font-weight: 600; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ff);
  color: var(--tx-0);
  background:
    radial-gradient(1100px 600px at 80% -10%, rgba(139,92,246,0.18), transparent 60%),
    radial-gradient(900px 500px at -5% 0%, rgba(34,211,238,0.14), transparent 55%),
    var(--bg-0);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 84px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }
::selection { background: rgba(34,211,238,0.35); }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- layout ---------- */
.container { width: min(1180px, 100% - 32px); margin: 0 auto; }
.section { margin: 38px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.section-head h2 { font-size: 22px; margin: 0; letter-spacing: 0.2px; }
.section-head .link { color: var(--cyan); font-weight: 600; font-size: 14px; }
.muted { color: var(--tx-2); }
.dim { color: var(--tx-3); }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; }
.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.hide { display: none !important; }

/* ---------- topbar ---------- */
#topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(8,11,22,0.72);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--ff-display); font-size: 20px; letter-spacing: 1px; }
.brand .logo { width: 30px; height: 30px; filter: drop-shadow(0 4px 12px rgba(34,211,238,0.6)); }
.brand .dot { color: var(--cyan); }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a {
  padding: 9px 14px; border-radius: 11px; color: var(--tx-1); font-weight: 600; font-size: 14px;
  transition: .15s; position: relative;
}
.nav-links a:hover { color: var(--tx-0); background: var(--bg-2); }
.nav-links a.active { color: var(--tx-0); background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); }
.topbar-spacer { flex: 1; }

.streak-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: linear-gradient(120deg, rgba(251,191,36,0.16), rgba(236,72,153,0.12));
  box-shadow: inset 0 0 0 1px rgba(251,191,36,0.35); font-weight: 700; font-size: 13px; color: var(--gold);
}
.wallet-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px;
  background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); font-weight: 700; font-size: 13px;
  white-space: nowrap;
}
.wallet-pill .gem { color: var(--cyan); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 13px; font-weight: 700; font-size: 14px;
  background: var(--bg-2); color: var(--tx-0); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .12s, box-shadow .2s, background .2s; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--grad-brand); color: #06121f; box-shadow: 0 10px 30px -10px rgba(99,102,241,0.7); }
.btn.gift { background: var(--grad-gift); color: #fff; box-shadow: var(--glow-pink); }
.btn.gold { background: var(--grad-gold); color: #1c1304; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 8px 13px; font-size: 13px; border-radius: 11px; }
.btn.lg { padding: 15px 26px; font-size: 16px; border-radius: 15px; }
.btn.block { width: 100%; }
.btn.icon { padding: 10px; width: 40px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; background: var(--bg-2); color: var(--tx-1);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.chip.cyan { color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(34,211,238,0.35); background: rgba(34,211,238,0.08); }
.chip.violet { color: #c4b5fd; box-shadow: inset 0 0 0 1px rgba(139,92,246,0.4); background: rgba(139,92,246,0.1); }
.chip.gold { color: var(--gold); box-shadow: inset 0 0 0 1px rgba(251,191,36,0.4); background: rgba(251,191,36,0.1); }
.chip.green { color: var(--green); box-shadow: inset 0 0 0 1px rgba(52,211,153,0.4); background: rgba(52,211,153,0.1); }
.chip.btn-like { cursor: pointer; transition: .15s; }
.chip.btn-like:hover { color: var(--tx-0); }
.chip.btn-like.on { background: var(--grad-brand); color: #06121f; box-shadow: none; }

/* ---------- cards ---------- */
.card {
  background: linear-gradient(165deg, var(--bg-1), var(--bg-0));
  box-shadow: inset 0 0 0 1px var(--line-soft), var(--shadow);
  border-radius: var(--radius); padding: 18px;
}
.card.glow { box-shadow: inset 0 0 0 1px var(--line), var(--glow-cyan); }
.card.pad-lg { padding: 24px; }
.tile {
  background: var(--bg-2); border-radius: var(--radius-sm); padding: 14px;
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

/* ---------- avatars ---------- */
.av {
  border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #06121f;
  position: relative; flex-shrink: 0; font-family: var(--ff-display); letter-spacing: .5px;
}
.av .ring { position: absolute; inset: -3px; border-radius: 50%; padding: 3px; }
.av.lg { width: 96px; height: 96px; font-size: 34px; }
.av.md { width: 52px; height: 52px; font-size: 18px; }
.av.sm { width: 38px; height: 38px; font-size: 14px; }
.av.xs { width: 28px; height: 28px; font-size: 11px; }
.av-online { position: absolute; right: 0; bottom: 2px; width: 26%; height: 26%; min-width: 9px; min-height: 9px;
  background: var(--green); border-radius: 50%; box-shadow: 0 0 0 3px var(--bg-0); }
.av-frame-gold { box-shadow: 0 0 0 3px var(--gold), 0 0 22px -2px rgba(251,191,36,0.8); }
.av-frame-cyan { box-shadow: 0 0 0 3px var(--cyan), 0 0 22px -2px rgba(34,211,238,0.7); }
.av-frame-pink { box-shadow: 0 0 0 3px var(--pink), 0 0 22px -2px rgba(236,72,153,0.7); }

/* nickname cosmetics (paid perks) */
.nick { font-weight: 800; }
.nick-cyan { color: var(--cyan); }
.nick-grad { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nick-gold { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nick-pink { background: var(--grad-gift); -webkit-background-clip: text; background-clip: text; color: transparent; }

.verified { display: inline-flex; align-items: center; gap: 4px; color: var(--cyan); font-weight: 700; font-size: 12px; }
.verified svg { width: 15px; height: 15px; }

/* ---------- hero (landing) ---------- */
.hero { position: relative; overflow: hidden; border-radius: var(--radius-lg); margin-top: 22px;
  background:
    radial-gradient(700px 320px at 78% 10%, rgba(236,72,153,0.22), transparent 60%),
    radial-gradient(640px 360px at 12% 90%, rgba(34,211,238,0.2), transparent 60%),
    linear-gradient(150deg, #141c3c, #0a0f22);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow); padding: 56px 44px; }
.hero h1 { font-family: var(--ff-display); font-size: clamp(30px, 5vw, 52px); line-height: 1.04; margin: 0 0 16px; letter-spacing: .5px; }
.hero h1 .accent { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 18px; color: var(--tx-1); max-width: 560px; margin: 0 0 26px; line-height: 1.55; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 28px; margin-top: 30px; flex-wrap: wrap; }
.hero-stats .s b { font-family: var(--ff-display); font-size: 26px; display: block; }
.hero-stats .s span { color: var(--tx-2); font-size: 13px; }
.hero-orbs span { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .8; }
.float-card { position: absolute; right: 44px; top: 50%; transform: translateY(-50%); width: 300px; }

.how { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.how .step { background: var(--bg-1); border-radius: var(--radius); padding: 18px; box-shadow: inset 0 0 0 1px var(--line-soft); }
.how .step .n { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-family: var(--ff-display);
  background: var(--grad-brand); color: #06121f; margin-bottom: 12px; }
.how .step h3 { margin: 0 0 6px; font-size: 16px; }
.how .step p { margin: 0; color: var(--tx-2); font-size: 13.5px; line-height: 1.5; }

/* ---------- player card ---------- */
.pcard { display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: transform .14s, box-shadow .2s; }
.pcard:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--line), var(--glow-cyan); }
.pcard .top { display: flex; gap: 12px; align-items: center; }
.pcard .meta { min-width: 0; }
.pcard .meta .name { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.pcard .meta .sub { color: var(--tx-2); font-size: 12.5px; margin-top: 2px; }
.pcard .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.pcard .foot { display: flex; gap: 8px; }

/* ---------- profile ---------- */
.profile-hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; padding: 0; }
.profile-cover { height: 150px; background: var(--grad-brand); position: relative; }
.profile-cover.alt { background: var(--grad-gift); }
.profile-cover .pattern { position: absolute; inset: 0; opacity: .25;
  background-image: radial-gradient(circle at 20% 40%, rgba(255,255,255,.5) 0, transparent 8%),
    radial-gradient(circle at 70% 70%, rgba(255,255,255,.4) 0, transparent 7%); }
.profile-body { padding: 0 26px 24px; margin-top: -52px; position: relative; }
.profile-id { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.profile-id .who h1 { margin: 0; font-size: 27px; display: flex; align-items: center; gap: 9px; }
.profile-id .who .handle { color: var(--tx-2); font-size: 14px; margin-top: 3px; }
.profile-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 20px; }
.stat-row .tile { text-align: center; }
.stat-row .tile b { font-family: var(--ff-display); font-size: 22px; display: block; }
.stat-row .tile span { color: var(--tx-2); font-size: 12px; }

.heroes { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-pill { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 12px; background: var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--line-soft); }
.hero-pill .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; color: #06121f; font-size: 13px; }

.gift-wall { display: flex; gap: 10px; flex-wrap: wrap; }
.gift-bubble { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px;
  background: linear-gradient(120deg, rgba(236,72,153,0.12), rgba(168,85,247,0.1)); box-shadow: inset 0 0 0 1px rgba(236,72,153,0.3); }

/* big gift CTA */
.gift-cta { position: relative; overflow: hidden; }
.gift-cta::after { content:''; position: absolute; inset: 0; background: radial-gradient(120px 60px at 30% 0%, rgba(255,255,255,.35), transparent 70%); pointer-events: none; }

/* ---------- feed ---------- */
.composer textarea { width: 100%; resize: vertical; min-height: 64px; background: var(--bg-2); border: none; border-radius: 13px;
  box-shadow: inset 0 0 0 1px var(--line-soft); color: var(--tx-0); padding: 13px; font-size: 14.5px; }
.composer textarea::placeholder { color: var(--tx-3); }
.post { }
.post .head { display: flex; gap: 11px; align-items: center; margin-bottom: 11px; }
.post .head .meta .name { font-weight: 700; font-size: 14.5px; display: flex; gap: 6px; align-items: center; }
.post .head .meta .time { color: var(--tx-3); font-size: 12px; }
.post .text { font-size: 15px; line-height: 1.55; color: var(--tx-0); white-space: pre-wrap; }
.post .actions { display: flex; gap: 8px; margin-top: 13px; }

.clip { margin-top: 13px; border-radius: 14px; overflow: hidden; position: relative; aspect-ratio: 16/9;
  box-shadow: inset 0 0 0 1px var(--line); }
.clip .thumb { position: absolute; inset: 0; }
.clip .play { position: absolute; inset: 0; display: grid; place-items: center; }
.clip .play .pbtn { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(8,11,22,0.55); backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.clip .src { position: absolute; left: 12px; top: 12px; font-size: 11.5px; font-weight: 700; padding: 5px 9px; border-radius: 8px;
  background: rgba(8,11,22,0.7); }
.clip .dur { position: absolute; right: 12px; bottom: 12px; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 7px;
  background: rgba(8,11,22,0.75); }

/* ---------- filters bar ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--tx-2); font-weight: 600; padding-left: 2px; }
.select, .input {
  background: var(--bg-2); border: none; box-shadow: inset 0 0 0 1px var(--line-soft); color: var(--tx-0);
  padding: 11px 13px; border-radius: 12px; font-size: 14px; min-width: 130px;
}
.select:focus, .input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--cyan); }

.toggle-now { display: inline-flex; align-items: center; gap: 9px; padding: 11px 16px; border-radius: 13px;
  background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); font-weight: 700; cursor: pointer; transition: .15s; }
.toggle-now.on { background: rgba(52,211,153,0.12); box-shadow: inset 0 0 0 1px rgba(52,211,153,0.5); color: var(--green); }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--green); position: relative; }
.pulse::after { content:''; position: absolute; inset: -4px; border-radius: 50%; background: var(--green); opacity: .5; animation: ping 1.4s ease-out infinite; }
@keyframes ping { 0%{transform:scale(.6);opacity:.6} 100%{transform:scale(2.2);opacity:0} }

/* ---------- leaderboard ---------- */
.lb-row { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line-soft); }
.lb-row:last-child { border-bottom: none; }
.lb-rank { width: 30px; text-align: center; font-family: var(--ff-display); font-size: 17px; color: var(--tx-2); }
.lb-rank.top { color: var(--gold); }
.lb-amt { margin-left: auto; font-weight: 800; color: var(--gold); display: flex; align-items: center; gap: 5px; }

/* ---------- shop ---------- */
.perk { display: flex; flex-direction: column; gap: 12px; }
.perk .preview { height: 92px; border-radius: 13px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line-soft);
  background: var(--bg-2); font-family: var(--ff-display); font-size: 22px; }
.perk h3 { margin: 0; font-size: 15.5px; }
.perk p { margin: 0; color: var(--tx-2); font-size: 13px; line-height: 1.45; flex: 1; }
.perk .price { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.perk .price b { font-size: 17px; }
.owned-tag { color: var(--green); font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 5px; }

.pack { text-align: center; cursor: pointer; transition: transform .14s, box-shadow .2s; }
.pack:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--line), var(--glow-cyan); }
.pack .gem-big { font-size: 30px; }
.pack .amt { font-family: var(--ff-display); font-size: 22px; margin: 4px 0; }
.pack .amt .b { color: var(--cyan); }
.pack .bonus { color: var(--green); font-size: 12px; font-weight: 700; }
.pack .rub { margin-top: 8px; font-weight: 800; font-size: 16px; }
.pack.pass { background: var(--grad-card); }

/* ---------- modal ---------- */
#modal-layer:empty { display: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(4,6,14,0.7); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 18px; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: 90vh; overflow: auto; border-radius: var(--radius-lg);
  background: linear-gradient(165deg, var(--bg-2), var(--bg-1)); box-shadow: inset 0 0 0 1px var(--line), var(--shadow);
  padding: 24px; animation: pop .25s cubic-bezier(.2,.9,.3,1.3); }
@keyframes pop { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.modal .x { position: absolute; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { margin: 0; font-size: 20px; }

/* pick grid for packs in gift modal */
.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pick { background: var(--bg-3); border-radius: 13px; padding: 12px 8px; text-align: center; cursor: pointer; transition: .15s;
  box-shadow: inset 0 0 0 1px var(--line-soft); }
.pick:hover { box-shadow: inset 0 0 0 1px var(--line); }
.pick.sel { box-shadow: inset 0 0 0 2px var(--cyan); background: rgba(34,211,238,0.1); }
.pick .a { font-family: var(--ff-display); font-size: 17px; color: var(--cyan); }
.pick .r { font-size: 13px; font-weight: 700; margin-top: 3px; }

.card-designs { display: flex; gap: 9px; }
.cdesign { flex: 1; height: 46px; border-radius: 11px; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line-soft); }
.cdesign.sel { box-shadow: inset 0 0 0 2px #fff; }

/* pay options */
.pay-opt { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 13px; cursor: pointer;
  background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line-soft); transition: .15s; }
.pay-opt:hover { box-shadow: inset 0 0 0 1px var(--line); }
.pay-opt.sel { box-shadow: inset 0 0 0 2px var(--cyan); }
.pay-opt .ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 12px; }

/* spinner */
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--bg-3); border-top-color: var(--cyan);
  animation: spin .8s linear infinite; margin: 18px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* success burst */
.burst { font-size: 64px; text-align: center; animation: burst .6s cubic-bezier(.2,.9,.3,1.4); }
@keyframes burst { from { transform: scale(.3); opacity: 0; } }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .3; } }

/* ---------- toast ---------- */
#toast-layer { position: fixed; right: 18px; top: 76px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 11px; padding: 13px 16px; border-radius: 14px; min-width: 240px; max-width: 340px;
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1)); box-shadow: inset 0 0 0 1px var(--line), var(--shadow);
  animation: slidein .3s cubic-bezier(.2,.9,.3,1.3); font-size: 14px; font-weight: 600; }
.toast.out { animation: slideout .3s forwards; }
@keyframes slidein { from { transform: translateX(120%); opacity: 0; } }
@keyframes slideout { to { transform: translateX(120%); opacity: 0; } }
.toast .tic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 17px; }

/* ---------- mobile nav ---------- */
#mobilenav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; display: none;
  background: rgba(8,11,22,0.9); backdrop-filter: blur(18px); border-top: 1px solid var(--line-soft);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
#mobilenav .mn-inner { display: flex; justify-content: space-around; }
#mobilenav a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--tx-3); font-size: 10.5px; font-weight: 700;
  padding: 4px 8px; }
#mobilenav a.active { color: var(--cyan); }
#mobilenav a svg { width: 22px; height: 22px; }

/* banner */
.banner { display: flex; gap: 12px; align-items: center; padding: 13px 16px; border-radius: 14px; font-size: 13.5px;
  background: rgba(251,191,36,0.08); box-shadow: inset 0 0 0 1px rgba(251,191,36,0.3); color: var(--tx-1); }
.banner .ic { font-size: 18px; }

/* empty states */
.empty { text-align: center; padding: 40px 20px; color: var(--tx-2); }
.empty .e-emoji { font-size: 40px; margin-bottom: 10px; }

/* utility grids */
.cols-2 { grid-template-columns: 1.6fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.auto-cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* badges strip */
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 11px; font-size: 12.5px; font-weight: 700;
  background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-soft); }

/* ---------- chat (Discord-style 3 columns) ---------- */
.chat-wrap { display: grid; grid-template-columns: 232px minmax(0,1fr) 216px; gap: 14px; align-items: start; }

/* channel sidebar */
.chat-side { background: linear-gradient(165deg, var(--bg-1), var(--bg-0)); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line-soft);
  position: sticky; top: 80px; overflow: hidden; }
.server-head { display: flex; align-items: center; gap: 9px; padding: 14px 14px; border-bottom: 1px solid var(--line-soft); font-weight: 800; font-size: 14px; }
.server-head .sv { width: 26px; height: 26px; border-radius: 8px; background: var(--grad-brand); display: grid; place-items: center; font-size: 13px; }
.chat-side .body { padding: 8px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 200px); overflow-y: auto; }
.cat { font-size: 11px; font-weight: 800; letter-spacing: .6px; color: var(--tx-3); margin: 12px 8px 3px; }
.ch-item { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 9px; cursor: pointer; color: var(--tx-2); font-weight: 600; font-size: 14px; transition: .12s; }
.ch-item:hover { background: var(--bg-2); color: var(--tx-1); }
.ch-item.active { background: var(--bg-2); color: var(--tx-0); box-shadow: inset 0 0 0 1px var(--line); }
.ch-item .h { color: var(--tx-3); font-weight: 800; }

/* main column */
.chat-main { display: flex; flex-direction: column; height: calc(100vh - 130px); min-height: 480px; min-width: 0; padding: 0; position: relative; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.chat-head .hh { color: var(--tx-3); font-size: 20px; font-weight: 800; }
.chat-head .rinfo h2 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 9px; }
.chat-head .rinfo .rt { font-size: 12px; color: var(--tx-2); margin-top: 1px; }
.safe-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
  color: var(--green); background: rgba(52,211,153,0.1); box-shadow: inset 0 0 0 1px rgba(52,211,153,0.35); }

.chat-scroll { flex: 1; overflow-y: auto; padding: 12px 8px; display: flex; flex-direction: column; }
.chat-rules { margin: 6px 8px 14px; padding: 11px 14px; border-radius: 12px; font-size: 12.5px; color: var(--tx-2);
  background: rgba(34,211,238,0.06); box-shadow: inset 0 0 0 1px rgba(34,211,238,0.2); }

/* messages + grouping */
.msg { display: flex; gap: 14px; position: relative; padding: 2px 12px; }
.msg:hover { background: rgba(34,211,238,0.035); border-radius: 8px; }
.msg.head { margin-top: 14px; }
.msg .av-col { width: 40px; flex-shrink: 0; display: flex; justify-content: center; align-items: flex-start; padding-top: 2px; }
.msg .hovertime { font-size: 10px; color: var(--tx-3); opacity: 0; padding-top: 4px; }
.msg:hover .hovertime { opacity: 1; }
.msg .body { min-width: 0; flex: 1; }
.msg .mhead { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.msg .mname { font-weight: 700; font-size: 14px; }
.msg .mtime { font-size: 11px; color: var(--tx-3); }
.msg .mtext { font-size: 14.5px; line-height: 1.45; color: var(--tx-1); word-break: break-word; }
.msg .mtext code { background: var(--bg-3); padding: 1px 6px; border-radius: 5px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.msg .mactions { position: absolute; top: -10px; right: 14px; display: flex; gap: 4px; opacity: 0; transition: .12s;
  background: var(--bg-2); border-radius: 9px; box-shadow: inset 0 0 0 1px var(--line), var(--shadow); padding: 3px; }
.msg:hover .mactions { opacity: 1; }
.act-ic { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; cursor: pointer; font-size: 14px; color: var(--tx-2); }
.act-ic:hover { background: var(--bg-3); color: var(--tx-0); }
.act-ic.danger:hover { color: var(--red); }

.mention { color: var(--cyan); background: rgba(34,211,238,0.13); padding: 0 5px; border-radius: 5px; font-weight: 600; cursor: pointer; }
.ch-mention { color: var(--violet); background: rgba(139,92,246,0.14); padding: 0 5px; border-radius: 5px; font-weight: 600; }

.reply-ref { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--tx-2); margin-bottom: 3px; padding-left: 2px; }
.reply-ref .rr-name { color: var(--cyan); font-weight: 600; }
.reply-ref .rr-text { color: var(--tx-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.reply-ref .rr-arc { color: var(--tx-3); }

.reactions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.reaction { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 9px; font-size: 13px; cursor: pointer; transition: .12s;
  background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-soft); }
.reaction:hover { box-shadow: inset 0 0 0 1px var(--line); }
.reaction.mine { background: rgba(34,211,238,0.12); box-shadow: inset 0 0 0 1px var(--cyan); }
.reaction .rc { font-weight: 700; font-size: 12px; color: var(--tx-1); }
.reaction.mine .rc { color: var(--cyan); }

.official-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; font-weight: 800; color: #06121f; background: var(--grad-brand); padding: 1px 6px; border-radius: 5px; }
.role-tag { font-size: 9.5px; font-weight: 800; padding: 1px 6px; border-radius: 5px; }
.fake-tag { font-size: 10px; font-weight: 800; color: var(--red); background: rgba(251,91,107,0.12); box-shadow: inset 0 0 0 1px rgba(251,91,107,0.4); padding: 1px 6px; border-radius: 5px; }

.msg.flagged .mtext { color: var(--tx-3); }
.flag-note { margin-top: 7px; display: flex; gap: 9px; align-items: flex-start; padding: 9px 12px; border-radius: 11px; font-size: 12.5px; line-height: 1.45;
  background: rgba(251,91,107,0.08); box-shadow: inset 0 0 0 1px rgba(251,91,107,0.3); color: var(--tx-1); }
.flag-note .fi { font-size: 15px; flex-shrink: 0; }
.blurred { filter: blur(5px); cursor: pointer; user-select: none; transition: .2s; }
.blurred:hover { filter: blur(2px); }

.msg-system { align-self: center; max-width: 92%; text-align: center; font-size: 12.5px; padding: 10px 14px; border-radius: 12px; margin: 8px auto 2px;
  background: rgba(251,91,107,0.08); box-shadow: inset 0 0 0 1px rgba(251,91,107,0.3); color: var(--tx-1); }
.msg-system.ok { background: rgba(52,211,153,0.08); box-shadow: inset 0 0 0 1px rgba(52,211,153,0.3); }

/* typing + composer */
.typing { font-size: 12px; color: var(--tx-2); padding: 3px 18px; height: 20px; display: flex; align-items: center; gap: 7px; }
.typing b { color: var(--tx-1); }
.typing .dots { display: inline-flex; gap: 3px; }
.typing .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--tx-2); animation: td 1s infinite; }
.typing .dots i:nth-child(2) { animation-delay: .15s; } .typing .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes td { 0%,60%,100%{opacity:.3;transform:translateY(0)} 30%{opacity:1;transform:translateY(-3px)} }

.compose-zone { padding: 4px 16px 16px; position: relative; }
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 8px 13px; background: var(--bg-2); border-radius: 12px 12px 0 0; font-size: 12.5px; color: var(--tx-2);
  box-shadow: inset 0 0 0 1px var(--line-soft); border-bottom: none; }
.reply-bar b { color: var(--cyan); }
.reply-bar .x { margin-left: auto; cursor: pointer; color: var(--tx-3); font-weight: 700; }
.chat-compose { display: flex; gap: 6px; align-items: center; background: var(--bg-2); border-radius: 13px; box-shadow: inset 0 0 0 1px var(--line-soft); padding: 5px 6px; }
.chat-compose.has-reply { border-radius: 0 0 13px 13px; }
.chat-compose:focus-within { box-shadow: inset 0 0 0 1px var(--cyan); }
.chat-compose textarea { flex: 1; resize: none; height: 42px; max-height: 120px; background: transparent; border: none; color: var(--tx-0); padding: 11px 6px; font-size: 14.5px; }
.chat-compose textarea:focus { outline: none; }
.compose-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-3); font-size: 17px; cursor: pointer; color: var(--tx-2); flex-shrink: 0; transition: .12s; }
.compose-btn:hover { color: var(--tx-0); }
.compose-btn.disabled { opacity: .4; cursor: not-allowed; }
.emoji-pop { position: absolute; bottom: 70px; right: 16px; background: linear-gradient(165deg, var(--bg-2), var(--bg-1)); border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow); padding: 10px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; z-index: 30; }
.emoji-pop span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; cursor: pointer; font-size: 18px; }
.emoji-pop span:hover { background: var(--bg-3); }
.chat-locked { margin: 0 16px 16px; padding: 13px; text-align: center; color: var(--tx-2); font-size: 13.5px; background: var(--bg-2); border-radius: 13px; box-shadow: inset 0 0 0 1px var(--line-soft); }

/* voice channel nested participants in sidebar */
.ch-voice-members { display: flex; flex-direction: column; gap: 1px; margin: 1px 0 4px 26px; }
.cv-mem { display: flex; align-items: center; gap: 7px; padding: 3px 6px; border-radius: 7px; font-size: 12.5px; color: var(--tx-2); }
.cv-mem.spk { color: var(--green); }
.cv-mem .cvdot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.cv-mem.spk .cvdot { background: var(--green); box-shadow: 0 0 6px var(--green); }

/* voice stage (main area for voice channel) */
.voice-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px; min-height: 0; overflow-y: auto; }
.voice-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; padding: 7px 14px; border-radius: 999px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-soft); }
.voice-status.live { color: var(--green); box-shadow: inset 0 0 0 1px rgba(52,211,153,0.4); background: rgba(52,211,153,0.08); }
.voice-status .ld { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.vtiles { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; max-width: 720px; }
.vtile { display: flex; flex-direction: column; align-items: center; gap: 9px; width: 130px; }
.vring { padding: 4px; border-radius: 50%; box-shadow: 0 0 0 3px transparent; transition: box-shadow .12s, transform .12s; position: relative; }
.vtile.speaking .vring { box-shadow: 0 0 0 3px var(--green), 0 0 24px -2px rgba(52,211,153,0.8); transform: scale(1.04); }
.vtile .vname { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 5px; }
.vtile .vmuted { position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--red); display: grid; place-items: center; font-size: 13px; box-shadow: 0 0 0 3px var(--bg-0); }
.vtile .vyou { font-size: 11px; color: var(--cyan); font-weight: 700; }

.voice-controls { display: flex; gap: 12px; padding: 16px; border-top: 1px solid var(--line-soft); justify-content: center; }
.vctrl { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 20px; cursor: pointer; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); transition: .12s; }
.vctrl:hover { transform: translateY(-2px); }
.vctrl.on { background: rgba(251,91,107,0.15); box-shadow: inset 0 0 0 1px rgba(251,91,107,0.5); color: var(--red); }
.vctrl.leave { background: var(--red); color: #fff; }
.voice-join-cta { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.voice-note { font-size: 12px; color: var(--tx-3); max-width: 420px; text-align: center; line-height: 1.5; }

/* persistent voice bar (sidebar bottom) */
.voice-bar { margin: 6px; padding: 10px 12px; border-radius: 12px; background: rgba(52,211,153,0.1); box-shadow: inset 0 0 0 1px rgba(52,211,153,0.35);
  display: flex; align-items: center; gap: 9px; }
.voice-bar .vb-info { min-width: 0; }
.voice-bar .vb-status { font-size: 12px; font-weight: 800; color: var(--green); display: flex; align-items: center; gap: 6px; }
.voice-bar .vb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); transition: box-shadow .1s; }
.voice-bar.spk .vb-dot { box-shadow: 0 0 8px 2px var(--green); }
.voice-bar .vb-ch { font-size: 11px; color: var(--tx-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-bar .vb-btns { margin-left: auto; display: flex; gap: 6px; }
.voice-bar .vb-btn { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; cursor: pointer; background: var(--bg-2); }
.voice-bar .vb-btn.on { color: var(--red); }
.voice-bar .vb-btn.leave:hover { background: var(--red); color: #fff; }

/* member list */
.chat-members { background: linear-gradient(165deg, var(--bg-1), var(--bg-0)); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line-soft);
  position: sticky; top: 80px; padding: 10px; max-height: calc(100vh - 150px); overflow-y: auto; }
.mem-grp { font-size: 11px; font-weight: 800; letter-spacing: .5px; color: var(--tx-3); margin: 12px 6px 4px; }
.mem-grp:first-child { margin-top: 4px; }
.mem { display: flex; align-items: center; gap: 9px; padding: 6px 7px; border-radius: 10px; cursor: pointer; transition: .12s; }
.mem:hover { background: var(--bg-2); }
.mem .mn { font-weight: 600; font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem.offline { opacity: .42; }
.mem .rtag { font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 5px; margin-left: auto; flex-shrink: 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .cols-2, .cols-3, .cols-4, .how { grid-template-columns: 1fr 1fr; }
  .float-card { display: none; }
  .hero { padding: 38px 24px; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .pick-grid { grid-template-columns: repeat(3, 1fr); }
  .chat-wrap { grid-template-columns: 200px minmax(0,1fr); }
  .chat-members { display: none; }
  .chat-main { height: calc(100vh - 150px); }
}
@media (max-width: 680px) {
  .chat-wrap { grid-template-columns: 1fr; }
  .chat-side { position: static; }
  .chat-side .body { flex-direction: row; overflow-x: auto; max-height: none; }
  .cat { display: none; }
  .ch-item { flex-shrink: 0; }
  .chat-main { height: auto; min-height: 64vh; }
}
@media (max-width: 680px) {
  body { padding-bottom: 78px; }
  .nav-links { display: none; }
  #mobilenav { display: block; }
  .cols-2, .cols-3, .cols-4, .how, .auto-cards { grid-template-columns: 1fr; }
  .how { grid-template-columns: 1fr 1fr; }
  .section { margin: 26px 0; }
  .hero h1 { font-size: 30px; }
  .profile-actions { margin-left: 0; width: 100%; }
  .streak-pill { display: none; }
}
