:root {
  --bg0: #1c2c52;
  --bg1: #111527;
  --bg2: #0a1832;
  --card: #171a20;
  --card2: #1e222a;
  --line: #2a2e37;
  --text: #fff;
  --muted: #8a8f99;
  --lime: #d3f95f;
  --lime2: #c4f542;
  --blue: #3b82f6;
  --blue2: #2f6fe0;
  --green: #26a17b;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
html.light {
  --bg0: #eaf1ff;
  --bg1: #fff;
  --bg2: #eef4ff;
  --card: #fff;
  --card2: #f4f5f7;
  --line: #e4e7ec;
  --text: #111318;
  --muted: #6b7280;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 48%, var(--bg2) 100%);
  background-attachment: fixed;
  -webkit-text-size-adjust: 100%;
}
body { overscroll-behavior: none; }
[hidden] { display: none !important; }
button, a { font: inherit; color: inherit; }
button { border: 0; cursor: pointer; }
.boot {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #f4f5f7; color: #1f2430;
}
html.dark .boot { background: #111527; color: #fff; }
.boot-mark {
  width: 96px; height: 96px; border-radius: 28px;
  overflow: hidden;
  background: #0b1528;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.boot-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.boot p { margin-top: 18px; font-weight: 700; }
.app { min-height: 100dvh; padding-bottom: calc(92px + var(--safe-bottom)); }
.topbar {
  padding: calc(10px + var(--safe-top)) 16px 0;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: #22c55e; font-size: 13px; font-weight: 700;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.views { padding: 8px 16px 24px; }
.view { display: none; }
.view.is-active { display: block; }
.identity { display: flex; align-items: center; gap: 10px; }
.identity.compact { margin-bottom: 14px; }
.avatar-wrap {
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(180deg, #86efac, #22c55e);
  display: grid; place-items: center; font-weight: 800; overflow: hidden; flex: none;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .45);
}
.avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.identity-main { flex: 1; min-width: 0; }
.identity-main b { display: inline-block; background: #2f6fe0; border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.total-line { margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.usdt-badge { width: 18px; height: 18px; border-radius: 50%; background: #26a17b; display: grid; place-items: center; font-size: 11px; }
.muted { color: var(--muted); }
.level-chip {
  background: var(--lime); color: #141820; border-radius: 999px;
  padding: 8px 12px; font-weight: 800; white-space: nowrap;
}
.income-row { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 13px; font-weight: 600; }
.income-label { color: #fb7185; }
.profit {
  margin: 8px 0 14px;
  font-size: clamp(34px, 10vw, 46px);
  font-weight: 900; letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  color: #9aa3af;
}
.claim-row, .pair { display: flex; gap: 10px; }
.btn {
  flex: 1; border-radius: 18px; padding: 14px 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-lime { background: linear-gradient(180deg, #d3f95f, #b6e02a); color: #141820; }
.btn-blue { background: linear-gradient(180deg, #60a5fa, #2563b0); color: #fff; }
.btn-ghost { background: #22262f; color: #fff; }
html.light .btn-ghost { background: #eceff3; color: #111318; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.4; margin: 12px 0 16px; }
.stat-card {
  position: relative; flex: 1; overflow: hidden; text-align: left;
  border-radius: 22px; padding: 14px; min-height: 118px;
  background: linear-gradient(180deg, #1e222a, #14171d);
}
html.light .stat-card { background: linear-gradient(180deg, #fff, #eef1f6); }
.stat-card .card-kicker { color: var(--muted); font-size: 12px; font-weight: 700; }
.stat-card strong { display: block; margin-top: 8px; font-size: 22px; }
.stat-card small, .stat-card em { display: block; color: var(--muted); font-style: normal; font-size: 12px; }
.gift-ico { position: absolute; right: 12px; top: 12px; font-size: 28px; }
.chart-ico {
  position: absolute; right: 8px; bottom: 8px; width: 72px; height: 48px;
  background: linear-gradient(180deg, transparent, rgba(34,197,94,.35));
  clip-path: polygon(0 80%, 18% 60%, 36% 70%, 54% 40%, 72% 48%, 100% 10%, 100% 100%, 0 100%);
}
.actions { margin-top: 12px; }
.promo, .invite-card, .channel-card, .reward-board, .levels-banner {
  margin-top: 12px; border-radius: 22px; padding: 16px;
  background: #171a20; overflow: hidden;
}
html.light .promo, html.light .invite-card, html.light .channel-card,
html.light .reward-board, html.light .levels-banner { background: #fff; }
.promo { position: relative; }
.promo b { font-size: 16px; }
.promo p { color: var(--muted); font-size: 13px; line-height: 1.4; }
.invite-card p, .channel-card small { color: var(--muted); }
.channel-card {
  width: 100%; display: flex; align-items: center; justify-content: space-between; text-align: left;
}
.channel-card em {
  background: #2f6fe0; color: #fff; border-radius: 16px 0 16px 0; padding: 12px 14px; font-style: normal; font-weight: 800;
}
.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-bottom));
  height: 64px; border-radius: 22px; background: rgba(18, 21, 27, .94);
  display: grid; grid-template-columns: 1fr 1fr 64px 1fr 1fr; align-items: center;
  padding: 0 6px; z-index: 30; backdrop-filter: blur(12px);
}
html.light .tabbar { background: rgba(255,255,255,.94); }
.tabbar button {
  background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 700;
}
.tabbar button.is-on, .tabbar .fab { color: #141820; }
.tabbar .fab {
  width: 56px; height: 56px; margin: 0 auto; border-radius: 50%;
  background: var(--lime); font-size: 22px; justify-content: center;
}
.tabbar button.is-on:not(.fab) { color: var(--lime2); }
.tabbar .fab.is-on { box-shadow: 0 8px 20px rgba(211,249,95,.25); }
.pool-head { display: flex; justify-content: space-between; align-items: center; }
.range button { background: #22262f; color: var(--muted); border-radius: 999px; padding: 6px 10px; margin-left: 4px; font-weight: 700; }
.range .is-on { background: #2f6fe0; color: #fff; }
#pool-chart { width: 100%; margin: 12px 0; border-radius: 18px; background: #10141a; }
.op-list, .ref-list { display: grid; gap: 8px; }
.op-row, .ref-row {
  display: flex; justify-content: space-between; align-items: center;
  background: #1c2028; border-radius: 16px; padding: 12px 14px; font-weight: 700;
}
.op-row span:last-child { color: #22c55e; }
.reward-board { background: linear-gradient(180deg, #156b38, #0d4a28); }
.reward-board ul { list-style: none; padding: 0; margin: 10px 0 0; }
.reward-board li { padding: 10px 0; border-top: 1px solid rgba(255,255,255,.12); font-weight: 700; }
.gift-banner {
  margin-top: 12px; border-radius: 18px; padding: 16px;
  background: linear-gradient(180deg, #2563b0, #1d5aa8); font-weight: 800;
}
.levels-banner { background: linear-gradient(180deg, #f7a13a, #f0851a); color: #fff; }
.pct-row { display: flex; justify-content: space-between; margin-top: 10px; font-weight: 800; }
.gift-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gift-tile {
  aspect-ratio: 1; border-radius: 22px; overflow: hidden; position: relative;
  background: #14171d; border: 1px solid var(--line);
}
.gift-art {
  height: 78%;
  display: grid; place-items: center; font-size: 42px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.18), transparent 40%),
    linear-gradient(160deg, #3b1c1a, #14171d 60%);
}
.gift-tile b { position: absolute; left: 10px; top: 10px; font-size: 14px; }
.gift-tile small { position: absolute; left: 10px; bottom: 10px; color: var(--muted); font-size: 11px; }
.acc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acc-grid article, .acc-grid button, .acc-grid a {
  background: #1c2028; border-radius: 18px; padding: 14px; text-align: left; text-decoration: none;
}
.acc-grid small { color: var(--muted); display: block; margin-bottom: 8px; }
.build { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }
.sheet {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end;
}
.sheet-card {
  width: 100%; max-height: 88dvh; overflow: auto;
  background: #14171d; border-radius: 24px 24px 0 0; padding: 16px 16px calc(20px + var(--safe-bottom));
}
html.light .sheet-card { background: #fff; }
.sheet-card header { display: flex; justify-content: space-between; align-items: center; }
.sheet-card h2 { margin: 0; }
#sheet-close { background: #22262f; width: 36px; height: 36px; border-radius: 18px; }
.field {
  margin-top: 12px; background: #1c2028; border: 1px solid var(--line);
  border-radius: 18px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center;
}
.field input {
  width: 100%; background: none; border: 0; color: var(--text); font-weight: 800; outline: none;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chips button, .net-grid button {
  background: #1c2028; border: 1px solid var(--line); border-radius: 14px; padding: 10px; font-weight: 700;
}
.chips .is-on, .net-grid .is-on { border-color: #2f6fe0; background: #1b2740; }
.net-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.faq-item { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq-item b { display: block; margin-bottom: 6px; }
.faq-item p { margin: 0; color: var(--muted); font-size: 13px; }
.gift-play {
  position: fixed; inset: 0; z-index: 70;
  background: radial-gradient(circle at center, #c4a574 0%, #8a6a48 55%, #4a3424 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
#gift-stage { width: min(280px, 80vw); min-height: 180px; display: grid; place-items: center; text-align: center; }
.spin-card {
  width: 120px; height: 160px; border-radius: 24px; background: #f4ece0; color: #4a3424;
  display: grid; place-items: center; font-weight: 900; box-shadow: 0 20px 40px rgba(0,0,0,.25);
}
#gift-claim {
  margin-top: 28px; width: min(320px, 84vw); border-radius: 18px; padding: 14px;
  background: #efe4d2; color: #4a3424; font-weight: 800;
}
.toast {
  position: fixed; left: 16px; bottom: calc(90px + var(--safe-bottom)); z-index: 40;
  background: #1c2028; border-radius: 16px; padding: 10px 12px; display: flex; gap: 10px; align-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); font-size: 13px;
}
.toast i { width: 36px; height: 36px; border-radius: 12px; background: #26a17b; display: grid; place-items: center; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
