:root {
  color-scheme: dark;
  --bg: #0b0b14;
  --bg-2: #12121e;
  --card: #171726;
  --card-2: #1f1f33;
  --line: #2a2a42;
  --text: #f4f3fb;
  --muted: #9a98b5;
  --pink: #ff4d8d;
  --purple: #a033ff;
  --indigo: #5a3bff;
  --grad: linear-gradient(135deg, #ff4d8d 0%, #b03cff 55%, #5a3bff 100%);
  --grad-soft: linear-gradient(135deg, rgba(255,77,141,.18), rgba(90,59,255,.18));
  --gold: #ffc83d;
  --cyan: #3de0ff;
  --green: #2ee59d;
  --red: #ff4d5e;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --header-h: 60px;
  --tab-h: 64px;
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 10% -10%, rgba(176,60,255,.18), transparent 60%),
                    radial-gradient(900px 500px at 110% 10%, rgba(255,77,141,.12), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 21px; letter-spacing: -.02em; }
.brand img { width: 34px; height: 34px; filter: drop-shadow(0 4px 12px rgba(176,60,255,.45)); }
.brand .wm-2 { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- header ---------- */
.header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center; gap: 18px; padding: 0 20px;
  background: rgba(11,11,20,.78); backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.header nav { display: flex; gap: 4px; }
.header nav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.header nav a.active, .header nav a:hover { color: var(--text); background: rgba(255,255,255,.06); }
.header .spacer { flex: 1; }
.header .right { display: flex; align-items: center; gap: 10px; }
.chip-coins { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255,200,61,.12); color: var(--gold); font-weight: 700; font-size: 14px; }

/* ---------- bottom tabs (mobile) ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: none; align-items: center; justify-content: space-around;
  background: rgba(14,14,24,.92); backdrop-filter: blur(14px); border-top: 1px solid rgba(255,255,255,.06);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); font-weight: 600; min-width: 56px; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--text); }
.tabbar a.golive { margin-top: -26px; }
.tabbar a.golive span.plus {
  width: 56px; height: 56px; border-radius: 50%; background: var(--grad); display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(176,60,255,.5), 0 0 0 4px var(--bg);
}
.tabbar a.golive svg { color: #fff; width: 28px; height: 28px; }

main#app { min-height: calc(100dvh - var(--header-h)); }
.page { max-width: 1280px; margin: 0 auto; padding: 20px; }
.page.narrow { max-width: 560px; }

@media (max-width: 760px) {
  .header nav, .header .desk { display: none; }
  .header { padding: 0 14px; }
  .tabbar { display: flex; }
  main#app { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
  .page { padding: 14px; }
  body.in-room .tabbar, body.in-room .header { display: none; }
  body.in-room main#app { padding-bottom: 0; }
}

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; white-space: nowrap;
  background: var(--card-2); color: var(--text); transition: transform .12s ease, filter .12s ease, background .2s;
}
.btn:hover { filter: brightness(1.12); }
.btn svg, .chip-coins svg { width: 18px; height: 18px; flex: none; }
.bottombar .say button { display: grid; place-items: center; }
.bottombar .say button svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(176,60,255,.35); }
.btn.gold { background: linear-gradient(135deg, #ffd85a, #ff9d2e); color: #2a1600; }
.btn.danger { background: rgba(255,77,94,.15); color: var(--red); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.block { width: 100%; padding: 13px 18px; font-size: 15px; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.06); }
.icon-btn svg { width: 22px; height: 22px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-2);
  border: 1px solid var(--line); outline: none; transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(160,51,255,.2); }
textarea.input { resize: vertical; min-height: 80px; }
.form-error { color: var(--red); font-size: 13px; min-height: 18px; margin: -4px 0 10px; }
.hint { color: var(--muted); font-size: 13px; }

.card { background: var(--card); border: 1px solid rgba(255,255,255,.05); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 14px; }
.card h3 { margin: 0 0 12px; font-size: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.mt { margin-top: 14px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- avatar & badges ---------- */
.avatar {
  --size: 40px; width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: calc(var(--size) * .42);
  background: var(--c, #a033ff); background-image: linear-gradient(135deg, rgba(255,255,255,.25), transparent 60%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.15); text-transform: uppercase; user-select: none;
}
.avatar.xl { --size: 92px; box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--purple); }
.avatar.lg { --size: 56px; }
.avatar.sm { --size: 30px; }
.avatar.xs { --size: 24px; }
.lvl {
  display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 800; color: #fff; line-height: 16px; vertical-align: middle; background: #5b6bff;
}
.lvl.t2 { background: linear-gradient(90deg, #2fc4ff, #2f7bff); }
.lvl.t3 { background: linear-gradient(90deg, #2ee59d, #10b37a); }
.lvl.t4 { background: linear-gradient(90deg, #ffb02e, #ff7a1a); }
.lvl.t5 { background: linear-gradient(90deg, #ff4d8d, #c2185b); }
.lvl.t6 { background: linear-gradient(90deg, #ffd85a, #b37bff); color: #1b0f2e; }
.lvl.host { background: linear-gradient(90deg, #ff4d8d, #a033ff); }
.verified { color: var(--cyan); display: inline-flex; vertical-align: middle; }
.verified svg { width: 15px; height: 15px; }
.role-tag { font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 4px; background: var(--red); color: #fff; vertical-align: middle; text-transform: uppercase; }
.role-tag.moderator { background: #2f7bff; }

/* ---------- home ---------- */
.announce {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; margin-bottom: 16px;
  background: var(--grad-soft); border: 1px solid rgba(176,60,255,.25); font-size: 14px;
}
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button { padding: 8px 16px; border-radius: 999px; font-weight: 700; color: var(--muted); }
.tabs button.active { color: #fff; background: var(--grad); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { padding: 6px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; flex: none; }
.chips button.active { color: var(--text); border-color: var(--pink); background: rgba(255,77,141,.12); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr 1fr; gap: 10px; } }

.stream-card {
  position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--card);
  isolation: isolate; transition: transform .2s ease, box-shadow .2s ease;
}
.stream-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stream-card .cover { position: absolute; inset: 0; display: grid; place-items: center; z-index: -1; }
.stream-card .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stream-card .cover .avatar { --size: 84px; }
.stream-card .cover.fallback { background: radial-gradient(circle at 30% 20%, var(--c, #a033ff), #1a1030 75%); }
.stream-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, transparent 25%, transparent 55%, rgba(0,0,0,.8) 100%); z-index: -1; }
.stream-card .top { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; }
.badge-live {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 800;
  background: var(--grad); color: #fff; letter-spacing: .04em;
}
.badge-live .eq { display: inline-flex; gap: 1.5px; align-items: flex-end; height: 9px; }
.badge-live .eq i { width: 2px; background: #fff; border-radius: 1px; animation: eq 0.9s ease-in-out infinite; }
.badge-live .eq i:nth-child(2) { animation-delay: .2s; }
.badge-live .eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%,100% { height: 3px; } 50% { height: 9px; } }
.pill-dark { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: rgba(0,0,0,.45); backdrop-filter: blur(6px); }
.pill-dark svg { width: 13px; height: 13px; }
.stream-card .bottom { position: absolute; left: 10px; right: 10px; bottom: 10px; }
.stream-card .title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.stream-card .host { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255,255,255,.85); }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty img { width: 70px; margin: 0 auto 14px; opacity: .8; }
.empty h3 { color: var(--text); margin: 0 0 6px; }

.skeleton { background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- auth ---------- */
.auth-wrap { min-height: calc(100dvh - var(--header-h)); display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .logo-big { width: 76px; height: 76px; margin: 0 auto 12px; filter: drop-shadow(0 10px 30px rgba(176,60,255,.55)); }
.auth-card h1 { text-align: center; margin: 0 0 4px; font-size: 26px; letter-spacing: -.02em; }
.auth-card p.sub { text-align: center; color: var(--muted); margin: 0 0 22px; }
.auth-switch { text-align: center; margin-top: 16px; color: var(--muted); font-size: 14px; }
.auth-switch a { color: var(--pink); font-weight: 700; }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; font-weight: 700; padding: 6px; }

/* ---------- live room ---------- */
.room {
  position: relative; height: 100dvh; max-height: calc(100dvh - var(--header-h)); width: 100%; max-width: 540px; margin: 0 auto;
  background: #000; overflow: hidden; border-radius: 0;
}
@media (min-width: 761px) { .room { margin-top: 14px; height: calc(100dvh - var(--header-h) - 28px); border-radius: 22px; box-shadow: var(--shadow); } }
@media (max-width: 760px) { .room { max-height: 100dvh; } }
.room video.main { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.room video.main.mirror { transform: scaleX(-1); }
.room .shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, transparent 18%, transparent 55%, rgba(0,0,0,.65) 100%); }
.room .placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; background: radial-gradient(circle at 50% 35%, var(--c, #a033ff) 0%, #0a0612 70%); }
.room .placeholder .avatar { --size: 110px; margin: 0 auto 14px; }
.room .status-msg { color: rgba(255,255,255,.85); font-weight: 600; padding: 0 30px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin .8s linear infinite; margin: 14px auto 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.room .topbar { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; align-items: center; gap: 8px; z-index: 5; }
.host-pill { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 4px; border-radius: 999px; background: rgba(0,0,0,.38); backdrop-filter: blur(8px); max-width: 62%; }
.host-pill .meta { min-width: 0; line-height: 1.15; }
.host-pill .name { font-weight: 700; font-size: 13px; }
.host-pill .sub { font-size: 11px; color: rgba(255,255,255,.75); }
.host-pill .follow { padding: 6px 12px; border-radius: 999px; background: var(--grad); font-weight: 800; font-size: 12px; color: #fff; }
.room .viewers { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.room .viewers .tops { display: flex; }
.room .viewers .tops .avatar { --size: 30px; margin-left: -8px; box-shadow: 0 0 0 2px rgba(0,0,0,.6); }
.room .close { width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.38); display: grid; place-items: center; color: #fff; }
.room .close svg { width: 18px; height: 18px; }
.room .subbar { position: absolute; top: calc(58px + env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; gap: 6px; z-index: 5; flex-wrap: wrap; }
.q-badge { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 5px; background: rgba(0,0,0,.45); }
.q-badge.hd { color: var(--green); }
.q-badge.sd { color: var(--gold); }
.q-badge.ld { color: var(--red); }

.chat {
  position: absolute; left: 10px; right: 76px; bottom: calc(66px + env(safe-area-inset-bottom)); max-height: 38%; overflow-y: auto; z-index: 4;
  display: flex; flex-direction: column; gap: 5px; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%); mask-image: linear-gradient(180deg, transparent 0, #000 22%);
}
.chat::-webkit-scrollbar { display: none; }
.chat .msg { align-self: flex-start; max-width: 100%; padding: 5px 10px; border-radius: 14px; background: rgba(0,0,0,.35); font-size: 13.5px; line-height: 1.35; word-break: break-word; animation: pop .2s ease-out; }
.chat .msg .who { color: #ffd1e4; font-weight: 700; margin-right: 4px; cursor: pointer; }
.chat .msg .who.host { color: var(--gold); }
.chat .msg.system { color: #b8f3ff; background: rgba(0,0,0,.22); font-size: 12.5px; }
.chat .msg.gift { background: linear-gradient(90deg, rgba(255,77,141,.45), rgba(90,59,255,.35)); }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } }

.bottombar { position: absolute; left: 10px; right: 10px; bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: center; z-index: 6; }
.bottombar .say { flex: 1; display: flex; background: rgba(0,0,0,.4); border-radius: 999px; padding: 3px 3px 3px 14px; backdrop-filter: blur(8px); min-width: 0; }
.bottombar .say input { flex: 1; min-width: 0; background: none; border: 0; outline: none; padding: 7px 0; color: #fff; }
.bottombar .say button { padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; background: rgba(255,255,255,.12); }
.rbtn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.4); backdrop-filter: blur(8px); flex: none; color: #fff; }
.rbtn svg { width: 22px; height: 22px; }
.rbtn.gift { background: var(--grad); box-shadow: 0 4px 16px rgba(255,77,141,.5); }
.rbtn.like { color: #ff5c8a; }
.rbtn.off { background: rgba(255,77,94,.7); }

.hearts { position: absolute; right: 14px; bottom: 70px; width: 60px; height: 320px; pointer-events: none; z-index: 3; }
.hearts span { position: absolute; bottom: 0; left: 50%; font-size: 26px; animation: heart 2.2s ease-out forwards; }
@keyframes heart {
  0% { transform: translate(-50%, 0) scale(.4); opacity: 0; }
  12% { opacity: 1; transform: translate(-50%, -20px) scale(1); }
  100% { transform: translate(calc(-50% + var(--dx, 0px)), -300px) scale(1.1); opacity: 0; }
}

/* gift banners & effects */
.gift-banners { position: absolute; left: 0; top: 34%; z-index: 7; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.gift-banner {
  display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, rgba(255,77,141,.9), rgba(160,51,255,.75) 70%, rgba(90,59,255,0));
  animation: slideIn .35s cubic-bezier(.2,.9,.3,1.2), fadeOut .4s ease-in 2.6s forwards; min-width: 210px;
}
.gift-banner .t { line-height: 1.1; }
.gift-banner .t b { font-size: 13px; display: block; }
.gift-banner .t small { font-size: 11px; opacity: .9; }
.gift-banner .icon { font-size: 34px; margin-left: 4px; animation: bump .5s ease-out; }
.gift-banner .combo { font-size: 26px; font-weight: 900; font-style: italic; color: var(--gold); text-shadow: 0 2px 0 #b35a00, 0 0 12px rgba(255,200,61,.6); margin-left: 4px; animation: bump .35s ease-out; }
@keyframes slideIn { from { transform: translateX(-100%); opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(-30px); } }
@keyframes bump { 0% { transform: scale(2); } 100% { transform: scale(1); } }

.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 8; overflow: hidden; }
.fx-float { position: absolute; bottom: 20%; font-size: 40px; animation: fxFloat 2.4s ease-out forwards; }
@keyframes fxFloat { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-20px) scale(1.1); } 100% { transform: translateY(-260px) scale(1); opacity: 0; } }
.fx-burst { position: absolute; left: 50%; top: 45%; font-size: 30px; animation: fxBurst 1.6s cubic-bezier(.15,.8,.3,1) forwards; }
@keyframes fxBurst { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2) rotate(var(--rot)); opacity: 0; } }
.fx-full { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle, rgba(176,60,255,.45), rgba(0,0,0,.25) 60%, transparent); animation: fxFullBg 3.6s ease forwards; }
.fx-full .big { font-size: 150px; filter: drop-shadow(0 0 40px rgba(255,200,61,.8)); animation: fxBig 3.6s cubic-bezier(.2,.9,.3,1.1) forwards; text-align: center; line-height: 1; }
.fx-full .cap { display: block; font-size: 16px; font-weight: 800; margin-top: 16px; text-shadow: 0 2px 8px #000; }
.fx-full .rays { position: absolute; width: 520px; height: 520px; background: conic-gradient(from 0deg, transparent 0 10deg, rgba(255,216,90,.25) 10deg 20deg, transparent 20deg 40deg, rgba(255,77,141,.22) 40deg 50deg, transparent 50deg 70deg, rgba(255,216,90,.25) 70deg 80deg, transparent 80deg 100deg, rgba(255,77,141,.22) 100deg 110deg, transparent 110deg 130deg, rgba(255,216,90,.25) 130deg 140deg, transparent 140deg 160deg, rgba(255,77,141,.22) 160deg 170deg, transparent 170deg 190deg, rgba(255,216,90,.25) 190deg 200deg, transparent 200deg 220deg, rgba(255,77,141,.22) 220deg 230deg, transparent 230deg 250deg, rgba(255,216,90,.25) 250deg 260deg, transparent 260deg 280deg, rgba(255,77,141,.22) 280deg 290deg, transparent 290deg 310deg, rgba(255,216,90,.25) 310deg 320deg, transparent 320deg 340deg, rgba(255,77,141,.22) 340deg 350deg, transparent 350deg); border-radius: 50%; animation: spin 6s linear infinite; -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 70%); mask-image: radial-gradient(circle, #000 30%, transparent 70%); }
@keyframes fxFullBg { 0% { opacity: 0; } 10%, 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fxBig { 0% { transform: scale(.2) translateY(80px); } 20% { transform: scale(1.15); } 30%, 80% { transform: scale(1); } 100% { transform: scale(1.4); opacity: 0; } }

.global-banner {
  position: fixed; top: calc(var(--header-h) + 10px); left: 50%; transform: translateX(-50%); z-index: 90; max-width: calc(100vw - 24px);
  display: flex; align-items: center; gap: 10px; padding: 8px 18px 8px 8px; border-radius: 999px;
  background: linear-gradient(90deg, #ffb02e, #ff4d8d 50%, #a033ff); box-shadow: 0 10px 30px rgba(255,77,141,.5);
  font-size: 13px; font-weight: 700; cursor: pointer; animation: gbIn .5s cubic-bezier(.2,.9,.3,1.2), gbOut .5s ease-in 5.5s forwards;
}
.global-banner .icon { font-size: 28px; }
@keyframes gbIn { from { transform: translate(-50%, -140%); } }
@keyframes gbOut { to { transform: translate(-50%, -160%); opacity: 0; } }

/* sheets & modals */
.sheet-backdrop { position: absolute; inset: 0; z-index: 20; background: rgba(0,0,0,.35); animation: fade .2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 70%; overflow: auto;
  background: rgba(20,18,32,.97); border-radius: 20px 20px 0 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  animation: sheetUp .25s cubic-bezier(.2,.9,.3,1);
}
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.sheet .handle { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
.gift-cats { display: flex; gap: 16px; margin-bottom: 10px; font-weight: 700; font-size: 14px; }
.gift-cats button { color: var(--muted); padding: 4px 0; border-bottom: 2px solid transparent; }
.gift-cats button.active { color: var(--text); border-color: var(--pink); }
.gift-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.gift-item { padding: 10px 4px 8px; border-radius: 12px; text-align: center; border: 1.5px solid transparent; transition: background .15s; }
.gift-item:hover { background: rgba(255,255,255,.04); }
.gift-item.sel { border-color: var(--pink); background: rgba(255,77,141,.1); }
.gift-item .ic { font-size: 34px; line-height: 1.15; }
.gift-item .nm { font-size: 11.5px; margin-top: 2px; color: rgba(255,255,255,.85); }
.gift-item .pr { font-size: 11px; color: var(--gold); font-weight: 700; }
.gift-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.gift-foot .bal { display: flex; align-items: center; gap: 6px; color: var(--gold); font-weight: 800; }
.gift-foot .bal a { color: var(--pink); font-size: 12px; font-weight: 700; }
.qty { display: flex; gap: 4px; margin-left: auto; }
.qty button { padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--card-2); }
.qty button.sel { background: var(--grad); }

.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(5,5,10,.65); backdrop-filter: blur(4px); animation: fade .15s; }
.modal { width: 100%; max-width: 440px; max-height: 88dvh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); animation: pop .2s; }
.modal h3 { margin: 0 0 12px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

.end-overlay { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; text-align: center; padding: 24px; background: radial-gradient(circle at 50% 30%, rgba(176,60,255,.5), rgba(5,5,12,.96) 70%); animation: fade .3s; }
.end-overlay h2 { margin: 10px 0 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
.stat { background: rgba(255,255,255,.06); border-radius: 14px; padding: 12px 18px; min-width: 120px; }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 12px; color: var(--muted); }

/* go-live */
.golive { position: relative; }
.golive .setup { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, rgba(0,0,0,.85) 30%); }
.golive .setup .input { background: rgba(0,0,0,.45); border-color: rgba(255,255,255,.15); }
.golive .host-tools { position: absolute; right: 10px; top: calc(100px + env(safe-area-inset-top)); z-index: 6; display: flex; flex-direction: column; gap: 10px; }
.timer { font-variant-numeric: tabular-nums; }

/* profile */
.profile-head { text-align: center; padding: 26px 18px; position: relative; overflow: hidden; }
.profile-head::before { content: ""; position: absolute; inset: 0 0 50% 0; background: radial-gradient(circle at 50% 0, var(--c, #a033ff), transparent 70%); opacity: .55; z-index: 0; }
.profile-head > * { position: relative; }
.profile-head .avatar { margin: 0 auto 10px; }
.profile-head h2 { margin: 0; font-size: 22px; }
.profile-stats { display: flex; justify-content: center; gap: 28px; margin: 16px 0; }
.profile-stats b { display: block; font-size: 18px; }
.profile-stats span { font-size: 12px; color: var(--muted); }

/* wallet */
.balance-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.balance { border-radius: var(--radius); padding: 16px; position: relative; overflow: hidden; }
.balance.coins { background: linear-gradient(135deg, #3a2a00, #6b4300); }
.balance.dias { background: linear-gradient(135deg, #00334a, #1a2b6b); }
.balance b { font-size: 26px; display: block; letter-spacing: -.02em; }
.balance span { font-size: 13px; opacity: .85; }
.balance .ic { position: absolute; right: -6px; bottom: -10px; font-size: 64px; opacity: .3; }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 520px) { .packs { grid-template-columns: repeat(2, 1fr); } }
.pack { padding: 14px 10px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); text-align: center; transition: border-color .2s, transform .15s; }
.pack:hover { border-color: var(--gold); transform: translateY(-2px); }
.pack .c { font-size: 20px; font-weight: 800; color: var(--gold); }
.pack .b { font-size: 12px; color: var(--green); font-weight: 700; min-height: 17px; }
.pack .p { margin-top: 6px; font-weight: 700; }
.checkin { display: flex; gap: 6px; margin: 10px 0; }
.checkin div { flex: 1; text-align: center; padding: 8px 0; border-radius: 10px; background: var(--bg-2); font-size: 11px; color: var(--muted); }
.checkin div.done { background: var(--grad-soft); color: var(--text); border: 1px solid rgba(255,77,141,.4); }
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ledger .plus { color: var(--green); font-weight: 700; }
.ledger .minus { color: var(--red); font-weight: 700; }

/* ranking */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 10px; align-items: end; margin: 10px 0 18px; }
.podium .p { text-align: center; padding: 14px 6px; border-radius: 16px; background: var(--card); }
.podium .p .avatar { margin: 0 auto 8px; }
.podium .p.first { padding-top: 22px; background: linear-gradient(180deg, rgba(255,200,61,.22), var(--card)); }
.podium .p .medal { font-size: 26px; }
.podium .p .score { color: var(--gold); font-weight: 800; font-size: 13px; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; }
.rank-list li:nth-child(odd) { background: rgba(255,255,255,.02); }
.rank-list .n { width: 26px; text-align: center; font-weight: 800; color: var(--muted); }
.rank-list .score { color: var(--gold); font-weight: 800; }

.user-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; }
.user-row:hover { background: rgba(255,255,255,.04); }

/* toast */
.toasts { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 20px); transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 761px) { .toasts { bottom: 24px; } }
.toast { padding: 10px 18px; border-radius: 999px; background: #26243a; border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; animation: pop .2s; max-width: 90vw; }
.toast.err { background: #3a1a22; border-color: rgba(255,77,94,.5); }
.toast.ok { background: #13322a; border-color: rgba(46,229,157,.45); }

.notice-live { position: fixed; right: 16px; bottom: calc(var(--tab-h) + 20px); z-index: 150; display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid rgba(255,77,141,.4); padding: 10px 14px; border-radius: 16px; box-shadow: var(--shadow); animation: pop .25s; cursor: pointer; max-width: calc(100vw - 32px); }
@media (min-width: 761px) { .notice-live { bottom: 24px; } }

/* ---------- monetization & interaction ---------- */
.room .tops { display: flex; padding: 0; }
.subbar button.pill-dark { color: #fff; }
.subbar button.pill-dark svg { width: 13px; height: 13px; }
.room-info { position: absolute; top: calc(92px + env(safe-area-inset-top)); left: 10px; z-index: 5; width: min(62%, 300px); display: flex; flex-direction: column; gap: 6px; }
.goal { background: rgba(0,0,0,.42); backdrop-filter: blur(8px); border-radius: 12px; padding: 7px 10px; font-size: 12px; }
.goal-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.goal-top b { font-weight: 700; }
.goal-track { height: 7px; border-radius: 4px; background: rgba(255,255,255,.15); overflow: hidden; }
.goal-track i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #ffd85a, #ff4d8d); transition: width .6s cubic-bezier(.2,.9,.3,1); }
.goal.done { box-shadow: 0 0 0 1.5px var(--gold), 0 0 18px rgba(255,200,61,.45); }
.pinned { display: flex; gap: 6px; align-items: flex-start; background: rgba(0,0,0,.42); backdrop-filter: blur(8px); border-left: 3px solid var(--gold); border-radius: 10px; padding: 6px 10px; font-size: 12.5px; line-height: 1.35; word-break: break-word; }

.chat .msg.paid { background: linear-gradient(135deg, rgba(255,200,61,.92), rgba(255,122,26,.88)); color: #2a1600; font-weight: 600; padding: 7px 12px; box-shadow: 0 4px 14px rgba(255,160,40,.35); }
.chat .msg.paid .who { color: #2a1600; }
.paid-head { display: flex; align-items: center; gap: 5px; margin-bottom: 2px; font-size: 12.5px; }
.paid-tag { margin-left: auto; font-size: 11px; font-weight: 800; background: rgba(0,0,0,.18); padding: 0 7px; border-radius: 999px; }

.bottombar .say .vip { padding: 0 6px 0 0; margin-left: -6px; font-size: 17px; background: none; filter: grayscale(1) opacity(.65); transition: filter .2s, transform .2s; }
.bottombar .say .vip.active { filter: none; transform: scale(1.15); }
.bottombar .say.vip-on { box-shadow: 0 0 0 1.5px var(--gold), 0 0 16px rgba(255,200,61,.35); }
.rbtn.quickgift { font-size: 21px; background: rgba(0,0,0,.4); }

.quick { position: absolute; left: 10px; right: 10px; bottom: calc(62px + env(safe-area-inset-bottom)); z-index: 6; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px 0; }
.quick::-webkit-scrollbar { display: none; }
.quick button { flex: none; padding: 6px 12px; border-radius: 999px; background: rgba(20,18,32,.85); border: 1px solid rgba(255,255,255,.15); font-size: 13px; font-weight: 600; }

.combo-btn { position: absolute; right: 12px; bottom: calc(118px + env(safe-area-inset-bottom)); z-index: 9; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, #ff7ab0, #b03cff); box-shadow: 0 8px 24px rgba(255,77,141,.55); animation: comboIn .25s cubic-bezier(.2,.9,.3,1.4); }
.combo-btn .ic { font-size: 26px; line-height: 1; margin-top: -8px; }
.combo-btn .x { position: absolute; bottom: 8px; font-size: 13px; font-weight: 900; font-style: italic; color: var(--gold); text-shadow: 0 1px 0 #7a3a00; }
.combo-btn svg { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); transform: rotate(-90deg); }
.combo-btn svg circle { fill: none; stroke: #ffd85a; stroke-width: 3; stroke-dasharray: 113.1; stroke-dashoffset: 0; }
.combo-btn.run svg circle { animation: comboRing 5s linear forwards; }
.combo-btn:active { transform: scale(.92); }
@keyframes comboRing { to { stroke-dashoffset: 113.1; } }
@keyframes comboIn { from { transform: scale(.3); opacity: 0; } }

.gift-foot .bal { display: flex; align-items: center; gap: 6px; color: var(--gold); font-weight: 800; background: none; }
.gift-foot .bal em { font-style: normal; color: var(--pink); font-size: 12px; font-weight: 700; }
.sheet .packs .pack { background: rgba(255,255,255,.04); }
.room .placeholder.clear { background: transparent; }
.follow.pulse { animation: pulse 1s ease-in-out 3; }
@keyframes pulse { 50% { transform: scale(1.12); box-shadow: 0 0 0 6px rgba(255,77,141,.35); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
