:root {
  --bg: #0b0d14;
  --bg2: #121521;
  --card: #171b2a;
  --card2: #1e2336;
  --line: #2a3048;
  --text: #e8eaf3;
  --muted: #8b91a8;
  --accent: #7c5cff;
  --accent2: #22d3ee;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; line-height: 1.5; }
a { color: var(--accent2); text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg2);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 10px;
  padding: 10px 16px; background: var(--card2); color: var(--text); font-weight: 600; }
.btn:hover { filter: brightness(1.15); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #a855f7); color: #fff; }
.btn.cyan { background: linear-gradient(135deg, #0891b2, var(--accent2)); color: #04111a; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }

.wrap { max-width: 1150px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px;
  background: var(--card2); border: 1px solid var(--line); color: var(--muted); }
.pill.good { color: var(--good); border-color: #1f5f3a; }
.pill.warn { color: var(--warn); border-color: #6b4a12; }
.grid { display: grid; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h3 { margin: 0 0 10px; font-size: 17px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.space { justify-content: space-between; }
.logo { font-weight: 800; font-size: 20px; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.logo b { background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Landing ---------- */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(11,13,20,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav .links { display: flex; gap: 18px; align-items: center; }
.nav .links a.text { color: var(--muted); }
.nav .links a.text:hover { color: var(--text); }
.hero { padding: 90px 0 60px; text-align: center;
  background: radial-gradient(800px 400px at 50% -10%, rgba(124,92,255,.35), transparent),
              radial-gradient(600px 300px at 90% 20%, rgba(34,211,238,.15), transparent); }
.hero h1 { font-size: clamp(34px, 6vw, 62px); line-height: 1.08; margin: 0 0 18px; }
.hero h1 span { background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 19px; color: var(--muted); max-width: 640px; margin: 0 auto 28px; }
.hero .row { justify-content: center; }
.section { padding: 60px 0; }
.section h2 { font-size: 32px; margin: 0 0 8px; text-align: center; }
.section > .wrap > p.muted { text-align: center; margin: 0 0 32px; }
.features { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.i { flex: none; vertical-align: middle; }
[data-icon] { display: inline-flex; }
.feature .icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: var(--accent2);
  background: linear-gradient(135deg, rgba(124,92,255,.22), rgba(34,211,238,.12)); border: 1px solid var(--line); }
.step { font-weight: 800; font-size: 28px; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ico-box { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--accent2); background: var(--bg2); border: 1px solid var(--line); flex: none; }
.coin { color: var(--warn); }
.initial { font-weight: 800; color: #fff; font-size: 36px; }
.avatar.sm.initial { font-size: 16px; }
.color-dot { width: 30px; height: 30px; border-radius: 50%; border: 3px solid transparent; padding: 0; }
.color-dot.active { border-color: #fff; }
.btn.liked { color: #f472b6; }
.btn.liked svg path { fill: currentColor; }
h3.row { gap: 8px; }
[hidden] { display: none !important; }
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(700px 360px at 50% -10%, rgba(124,92,255,.3), transparent), var(--bg); }
.gate-card { width: min(420px, 100%); padding: 28px; }
.gate-card h2 { margin: 6px 0 8px; font-size: 24px; }
.gate-card label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.btn.full { width: 100%; justify-content: center; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; display: inline-grid; place-items: center; }
.dot.new { background: var(--accent2); width: 9px; height: 9px; }
.msg { position: relative; }
.msg-report { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--muted); display: none; place-items: center; padding: 0; }
.msg:hover .msg-report { display: grid; }
.msg.gift { color: var(--warn); display: inline-flex; gap: 6px; align-items: center; }
textarea { resize: vertical; }
.side button.tab .i, .logo .i { flex: none; }
.feature h3 { margin: 8px 0 6px; }
.feature p { margin: 0; color: var(--muted); }
.download { text-align: center; background: linear-gradient(135deg, rgba(124,92,255,.18), rgba(34,211,238,.10)); }
.btn.big { font-size: 17px; padding: 14px 24px; }
.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 14px; }

/* ---------- Web app ---------- */
.app { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--bg2); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; }
.side .logo { padding: 4px 10px 16px; }
.side button.tab { text-align: left; background: transparent; border: 0; color: var(--muted); padding: 10px 12px; border-radius: 10px; display: flex; gap: 10px; align-items: center; font-weight: 600; }
.side button.tab:hover { background: var(--card); color: var(--text); }
.side button.tab.active { background: var(--card2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.side .bottom { margin-top: auto; display: grid; gap: 8px; }
.wallet { display: flex; gap: 8px; padding: 0 6px; flex-wrap: wrap; }
.main { padding: 24px; min-width: 0; }
.main h2 { margin: 0 0 16px; }

.profile-banner { height: 130px; border-radius: var(--radius) var(--radius) 0 0; }
.profile-card { padding: 0; overflow: hidden; }
.profile-body { padding: 0 18px 14px; display: flex; gap: 16px; align-items: flex-start; margin-top: -40px; flex-wrap: wrap; }
.profile-text { flex: 1; min-width: 160px; margin-top: 46px; }
.avatar { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; font-size: 44px; background: var(--card2); border: 4px solid var(--card); }
.avatar.sm { width: 38px; height: 38px; font-size: 20px; border-width: 2px; }
.title-tag { color: var(--accent2); font-weight: 700; font-size: 13px; }
.xpbar { height: 10px; background: var(--bg2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.xpbar > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.quest { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--card2); border-radius: 12px; border: 1px solid var(--line); }
.quest .q-icon { font-size: 24px; }
.quest .q-main { flex: 1; min-width: 0; }
.quest .q-main .xpbar { margin-top: 6px; height: 6px; }
.quest.done { border-color: #1f5f3a; }
.quest.claimed { opacity: .55; }

.clip { padding: 0; overflow: hidden; }
.clip video { width: 100%; aspect-ratio: 16/9; background: #000; display: block; }
.clip .meta { padding: 12px; }

.chat { display: grid; grid-template-columns: 240px 1fr; height: calc(100vh - 110px); padding: 0; overflow: hidden; }
.chat .friends { border-right: 1px solid var(--line); overflow-y: auto; }
.chat .friend { display: flex; gap: 10px; align-items: center; padding: 12px; width: 100%; background: transparent; border: 0; color: var(--text); text-align: left; border-bottom: 1px solid var(--line); }
.chat .friend.active, .chat .friend:hover { background: var(--card2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); display: inline-block; }
.dot.off { background: var(--muted); }
.thread { display: flex; flex-direction: column; min-width: 0; }
.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 72%; padding: 8px 12px; border-radius: 14px; background: var(--card2); word-wrap: break-word; }
.msg.me { align-self: flex-end; background: linear-gradient(135deg, var(--accent), #9b5cff); color: #fff; }
.msg.sys { align-self: center; background: transparent; color: var(--muted); font-size: 13px; }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.composer input { flex: 1; }

.shop-item { display: flex; flex-direction: column; gap: 10px; }
.swatch { height: 70px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; }
.sound-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.sound-btn { height: 90px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font-weight: 700; display: grid; place-items: center; font-size: 15px; }
.sound-btn span { font-size: 28px; display: block; }
.sound-btn:active { transform: scale(.96); background: var(--accent); }
.sound-btn.locked { opacity: .4; }

.game-row { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--card2); border-radius: 10px; border: 1px solid var(--line); }
.game-row .name { flex: 1; font-weight: 600; }
.game-row select { width: auto; padding: 6px 8px; }

.toast-box { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 50; }
.toast { background: var(--card2); border: 1px solid var(--accent); padding: 12px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: pop .25s ease; max-width: 320px; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { width: min(460px, 100%); }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.notice { font-size: 13px; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }
.mobile-top { display: none; }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 8px; }
  .side .logo, .side .bottom { display: none; }
  .side button.tab { white-space: nowrap; }
  .mobile-top { display: flex; }
  .cols-2 { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 1fr; height: auto; }
  .chat .friends { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .chat .friend { border-bottom: 0; white-space: nowrap; width: auto; }
  .messages { height: 50vh; }
  .main { padding: 16px; }
  .nav .links a.text { display: none; }
}
