/* ============================================================
   LOBY – night purple & gold theme
   ============================================================ */
:root {
  --bg: #120a24;
  --bg2: #1a1033;
  --card: rgba(255, 255, 255, .06);
  --card-solid: #221641;
  --card2: rgba(255, 255, 255, .10);
  --line: rgba(255, 255, 255, .12);
  --txt: #f6f2ff;
  --mut: #a99cc9;
  --acc: #8b5cf6;
  --acc2: #ec4899;
  --gold: #fbbf24;
  --gold2: #f59e0b;
  --ok: #22c55e;
  --bad: #ef4444;
  --grad: linear-gradient(135deg, #8b5cf6, #ec4899);
  --gold-grad: linear-gradient(135deg, #fde68a, #f59e0b 55%, #b45309);
  --nav-h: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--txt); }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background:
    radial-gradient(600px 400px at 0% -10%, rgba(139, 92, 246, .35), transparent 60%),
    radial-gradient(500px 400px at 110% 10%, rgba(236, 72, 153, .22), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
body.wide { max-width: 1200px; padding: 0 16px 40px; }
h1, h2, h3, h4 { margin: 0 0 10px; }
h4 { margin-top: 14px; color: var(--mut); font-weight: 600; }
.hide { display: none !important; }
.mut { color: var(--mut); }
.center { text-align: center; }
.small-p { font-size: 13px; margin: 0 0 8px; }
small { font-size: 12px; }
button { font-family: inherit; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 14px; backdrop-filter: blur(10px); }

input, select, textarea {
  width: 100%; padding: 12px 14px; margin: 6px 0;
  background: var(--card2); color: var(--txt);
  border: 1px solid var(--line); border-radius: 14px; font-size: 15px; outline: none; font-family: inherit;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--acc); }
input::placeholder, textarea::placeholder { color: #8a7fae; }

.btn {
  display: inline-block; width: 100%; padding: 13px 16px; margin: 6px 0;
  border: 0; border-radius: 14px; cursor: pointer;
  background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(139, 92, 246, .35);
  font-weight: 700; font-size: 15px; text-align: center; text-decoration: none;
}
.btn:disabled { opacity: .5; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--txt); box-shadow: none; }
.btn.gold { background: var(--gold-grad); color: #3b1d00; box-shadow: 0 6px 18px rgba(245, 158, 11, .35); }
.btn.small { width: auto; padding: 7px 12px; font-size: 13px; margin: 2px; box-shadow: none; }
.btn.ok { background: var(--ok); }
.btn.bad { background: var(--bad); }

/* ---------- Avatars & level badges ---------- */
.av { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; font-weight: 800; color: #fff; flex: none; background: var(--card2); }
.av.xs { width: 22px; height: 22px; font-size: 11px; }
.av.sm { width: 30px; height: 30px; font-size: 14px; }
.av.md { width: 48px; height: 48px; font-size: 20px; }
.av.lg { width: 84px; height: 84px; font-size: 34px; }
.av.xl { width: 96px; height: 96px; font-size: 40px; }
.lv { display: inline-flex; align-items: center; gap: 1px; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 8px; color: #fff; vertical-align: middle; line-height: 16px; }
.lv.t1 { background: linear-gradient(135deg, #64748b, #94a3b8); }
.lv.t2 { background: linear-gradient(135deg, #10b981, #34d399); }
.lv.t3 { background: linear-gradient(135deg, #3b82f6, #8b5cf6); }
.lv.t4 { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.lv.t5 { background: var(--gold-grad); color: #3b1d00; box-shadow: 0 0 8px rgba(251, 191, 36, .7); }

/* ---------- Auth ---------- */
#auth { padding: 70px 20px; position: relative; }
.auth { position: relative; }
.auth-glow { position: absolute; inset: -40px 0 auto; height: 200px; background: radial-gradient(closest-side, rgba(236, 72, 153, .35), transparent); filter: blur(20px); z-index: -1; }
.logo {
  font-size: 26px; font-weight: 900; letter-spacing: -1px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo.big { font-size: 56px; text-align: center; }

/* ---------- Layout ---------- */
.view { padding: 0 14px calc(var(--nav-h) + 90px); min-height: 100vh; }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: 14px 2px 10px; background: linear-gradient(var(--bg) 70%, transparent);
}
.top .logo { flex: 1; }
.top .title { flex: 1; font-size: 20px; font-weight: 800; }
.pill { background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; font-weight: 700; cursor: pointer; color: var(--txt); font-size: 14px; white-space: nowrap; }
.pill.gold { color: var(--gold); border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .1); }

.search input { margin: 0 0 10px; border-radius: 999px; }
.tabs { display: flex; gap: 6px; margin: 4px 0 12px; overflow-x: auto; }
.tabs button { background: transparent; border: 0; color: var(--mut); font-size: 16px; font-weight: 700; padding: 6px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: #fff; background: var(--card2); }
.tabs.small button { font-size: 13px; padding: 5px 12px; border: 1px solid var(--line); }
.tabs.small button.on { background: var(--grad); border-color: transparent; }

/* Bottom menu */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 30;
  display: flex; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(18, 10, 36, .92); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.bottom-nav button { flex: 1; background: none; border: 0; color: var(--mut); font-size: 11px; font-weight: 600; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.bottom-nav button span { font-size: 22px; filter: grayscale(1) opacity(.6); transition: .2s; }
.bottom-nav button.on { color: #fff; }
.bottom-nav button.on span { filter: none; transform: translateY(-2px) scale(1.1); }

/* ---------- Rooms list ---------- */
.room-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rcard { background: none; border: 0; padding: 0; color: var(--txt); text-align: left; cursor: pointer; font: inherit; min-width: 0; }
.rcover { position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: var(--grad); display: grid; place-items: center; box-shadow: 0 8px 20px rgba(0, 0, 0, .35); }
.rcover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rcover .letter { font-size: 64px; font-weight: 900; color: rgba(255, 255, 255, .9); }
.rcover::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); }
.live-dot { position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(0, 0, 0, .45); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.live-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; margin-right: 5px; box-shadow: 0 0 6px #22c55e; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.rstats { position: absolute; bottom: 8px; left: 8px; right: 8px; z-index: 2; display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; }
.rinfo { padding: 7px 2px 0; }
.rinfo b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rhost { display: flex; align-items: center; gap: 5px; color: var(--mut); font-size: 12px; margin-top: 3px; white-space: nowrap; overflow: hidden; }
.empty-state { grid-column: 1 / -1; text-align: center; color: var(--mut); padding: 40px 10px; }
.empty-state .e { font-size: 50px; display: block; margin-bottom: 8px; }

.fab {
  position: fixed; z-index: 25; right: max(16px, calc(50% - 224px)); bottom: calc(var(--nav-h) + 86px + env(safe-area-inset-bottom));
  border: 0; border-radius: 999px; padding: 12px 18px; background: var(--grad); color: #fff; font-weight: 800; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; gap: 6px; box-shadow: 0 10px 26px rgba(236, 72, 153, .5);
}
.fab span { font-size: 15px; }

/* ---------- Ranking ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; margin: 10px 0 16px; text-align: center; }
.podium button { background: none; border: 0; color: var(--txt); cursor: pointer; font: inherit; min-width: 0; }
.podium .pl { border-radius: 16px 16px 8px 8px; padding: 10px 4px; background: var(--card); border: 1px solid var(--line); }
.podium .p1 .pl { background: linear-gradient(180deg, rgba(251, 191, 36, .35), rgba(251, 191, 36, .05)); border-color: rgba(251, 191, 36, .5); padding-top: 14px; }
.podium .medal { font-size: 26px; display: block; }
.podium b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.podium .av { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--line); }
.podium .p1 .av { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--gold); }
.list .row-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); margin-bottom: 8px; width: 100%; color: var(--txt); text-align: left; cursor: pointer; font: inherit; }
.row-item .rk { width: 24px; text-align: center; font-weight: 800; color: var(--mut); }
.row-item .nm { flex: 1; min-width: 0; }
.row-item .nm b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .amt { font-weight: 800; color: var(--gold); white-space: nowrap; }

/* ---------- Wallet ---------- */
.wallet-card { border-radius: 20px; padding: 18px; margin-bottom: 14px; color: #fff; position: relative; overflow: hidden; }
.wallet-card.coins { background: linear-gradient(135deg, #f59e0b, #b45309); box-shadow: 0 10px 26px rgba(245, 158, 11, .3); }
.wallet-card.diamonds { background: linear-gradient(135deg, #8b5cf6, #db2777); box-shadow: 0 10px 26px rgba(139, 92, 246, .35); }
.wallet-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.wallet-card span { opacity: .9; font-weight: 600; }
.big { font-size: 34px; font-weight: 900; margin: 4px 0; }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pack { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px; border-radius: 14px; background: rgba(251, 191, 36, .08); border: 1px solid rgba(251, 191, 36, .3); color: var(--txt); text-decoration: none; }
.pack b { color: var(--gold); font-size: 17px; }
.pack span { font-size: 13px; color: var(--mut); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.pos { color: var(--ok); }
.neg { color: #f87171; }
.tag { font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--card2); white-space: nowrap; }
.tag.paid { background: var(--ok); color: #000; }
.tag.pending { background: var(--gold); color: #000; }
.tag.rejected { background: var(--bad); }

/* ---------- Profile ---------- */
.profile-head { text-align: center; padding: 26px 10px 10px; position: relative; }
.profile-head .av { box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--acc); }
.profile-head h2 { margin: 10px 0 4px; }
.profile-head .bio { color: var(--mut); margin: 6px 0; white-space: pre-wrap; }
.lv-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.lv-box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: left; }
.lv-box small { color: var(--mut); display: block; margin-top: 4px; }
.bar { height: 6px; border-radius: 6px; background: var(--card2); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: 6px; }
.lv-box.s .bar i { background: var(--gold-grad); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 72px; padding: 8px 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 11px; color: var(--mut); text-align: center; }
.badge span { font-size: 26px; }
.giftwall { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.giftwall div { text-align: center; padding: 8px 2px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 11px; color: var(--mut); }
.giftwall .gi { font-size: 26px; display: block; height: 32px; }
.giftwall .gi img { width: 32px; height: 32px; object-fit: contain; }
.supporters { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.supporters button { background: none; border: 0; color: var(--txt); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; cursor: pointer; min-width: 60px; }
.section-t { font-weight: 800; margin: 16px 0 8px; display: flex; justify-content: space-between; }
.menu-list button { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--txt); padding: 14px 4px; font-size: 15px; cursor: pointer; text-align: left; }
.menu-list button:last-child { border-bottom: 0; }
.menu-list button span { font-size: 20px; }
.menu-list button b { margin-left: auto; color: var(--mut); }
.profile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.profile-actions .btn { margin: 0; }

/* ---------- Room ---------- */
#v-room { position: fixed; inset: 0; max-width: 480px; margin: 0 auto; z-index: 20; display: flex; flex-direction: column; padding: 10px 12px calc(8px + env(safe-area-inset-bottom)); overflow: hidden; background: #0d0718; }
.room-bg { position: absolute; inset: 0; z-index: -1; background: radial-gradient(500px 360px at 50% 0%, rgba(139, 92, 246, .45), transparent 70%), linear-gradient(#1b0f38, #0d0718); }
.room-bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(24px) brightness(.45) saturate(1.3); transform: scale(1.2); }
.room-top { display: flex; align-items: center; gap: 8px; }
.hostbox { display: flex; align-items: center; gap: 8px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 4px; color: var(--txt); cursor: pointer; min-width: 0; flex: 1; text-align: left; font: inherit; }
.hostbox .av { width: 38px; height: 38px; border-radius: 12px; }
.hb-text { min-width: 0; display: flex; flex-direction: column; }
.hb-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.hb-text small { color: var(--mut); font-size: 11px; }
.room-actions { display: flex; align-items: center; gap: 6px; }
.viewers { display: flex; align-items: center; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px 3px 3px; color: #fff; cursor: pointer; gap: 4px; font: inherit; font-size: 13px; }
.viewers .av { width: 24px; height: 24px; font-size: 11px; margin-right: -8px; border: 2px solid #0d0718; }
.viewers b { margin-left: 10px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); color: #fff; font-size: 17px; cursor: pointer; display: grid; place-items: center; }
.room-sub { display: flex; gap: 6px; margin: 8px 0 2px; }
.room-sub .pill { font-size: 12px; padding: 5px 10px; background: rgba(0, 0, 0, .35); }
#r-trophy { color: var(--gold); }

.seat-host { display: flex; justify-content: center; margin: 6px 0 2px; }
.seats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 2px; margin: 4px 0 6px; }
.seat { background: none; border: 0; color: var(--txt); cursor: pointer; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; font: inherit; }
.seat small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d8cff0; font-size: 11px; display: flex; align-items: center; gap: 3px; }
.seat-ring { position: relative; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; }
.seat-ring .av { width: 100%; height: 100%; font-size: 22px; }
.seat.empty .seat-ring { background: rgba(255, 255, 255, .07); border: 1.5px dashed rgba(255, 255, 255, .25); color: #cbbef0; font-size: 22px; }
.seat.locked .seat-ring { background: rgba(0, 0, 0, .3); border: 1.5px solid rgba(255, 255, 255, .15); font-size: 18px; }
.seat.filled .seat-ring { box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.seat.mine .seat-ring { box-shadow: 0 0 0 2px var(--gold); }
.seat.host .seat-ring { width: 74px; height: 74px; box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(251, 191, 36, .5); }
.seat.host .seat-ring .av { font-size: 30px; }
.host-tag { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); background: var(--gold-grad); color: #3b1d00; font-size: 9px; font-weight: 900; padding: 1px 6px; border-radius: 6px; }
.seat-ring.talking::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid #67e8f9; animation: ripple 1s infinite; }
.seat-ring.talking::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid #67e8f9; animation: ripple 1s .5s infinite; }
@keyframes ripple { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.mute-badge { position: absolute; right: -3px; bottom: -3px; font-size: 11px; background: #0d0718; border-radius: 50%; padding: 2px; line-height: 1; z-index: 2; }

#chat { flex: 1; overflow-y: auto; padding: 4px 0; mask-image: linear-gradient(transparent, #000 18px); -webkit-mask-image: linear-gradient(transparent, #000 18px); }
.msg { display: flex; gap: 7px; align-items: flex-start; margin: 6px 0; animation: msgIn .25s ease-out; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.msg .av { width: 28px; height: 28px; font-size: 12px; cursor: pointer; }
.msg .mcol { min-width: 0; max-width: 84%; }
.msg .bubble { display: inline-block; background: rgba(0, 0, 0, .38); border-radius: 4px 14px 14px 14px; padding: 6px 10px; max-width: 100%; word-wrap: break-word; }
.msg .bubble img { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; }
.msg .who { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #c4b5fd; font-weight: 700; cursor: pointer; margin-bottom: 1px; }
.msg.giftmsg .bubble { background: linear-gradient(135deg, rgba(139, 92, 246, .55), rgba(236, 72, 153, .55)); border: 1px solid rgba(255, 255, 255, .15); }
.msg.giftmsg .gx { color: var(--gold); font-weight: 900; }
.msg.sys { justify-content: center; }
.msg.sys .bubble { background: rgba(251, 191, 36, .12); color: #fde68a; font-size: 13px; border-radius: 12px; text-align: center; }
.msg.join .bubble { background: rgba(255, 255, 255, .07); color: #d8cff0; font-size: 12px; border-radius: 12px; padding: 4px 10px; }

.room-bar { display: flex; gap: 8px; align-items: center; padding-top: 6px; }
.room-bar form { flex: 1; display: flex; background: rgba(0, 0, 0, .4); border: 1px solid var(--line); border-radius: 999px; padding: 3px; min-width: 0; }
.room-bar input { margin: 0; border: 0; background: transparent; padding: 9px 12px; min-width: 0; }
.room-bar .send { border: 0; background: var(--grad); color: #fff; border-radius: 50%; width: 38px; height: 38px; font-size: 16px; cursor: pointer; flex: none; }
.round { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: rgba(0, 0, 0, .4); font-size: 21px; cursor: pointer; flex: none; color: #fff; }
.round.off { background: rgba(239, 68, 68, .35); }
.round.gift { background: var(--grad); border: 0; font-size: 24px; box-shadow: 0 6px 18px rgba(236, 72, 153, .55); animation: giftBob 2s infinite; }
@keyframes giftBob { 50% { transform: translateY(-3px) rotate(-6deg); } }

/* ---------- Sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .15s; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet-body { width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto; background: var(--card-solid); border-radius: 24px 24px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.sheet-head b { font-size: 17px; }
#menu-list .btn { margin: 5px 0; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; }
.chip { display: flex; align-items: center; gap: 5px; background: var(--card2); border: 1px solid var(--line); color: var(--txt); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.chip.on { background: var(--grad); border-color: transparent; }
.chips.qty .chip { padding: 6px 12px; }
.gift-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: 300px; overflow-y: auto; }
.gift { position: relative; background: rgba(255, 255, 255, .04); border: 1.5px solid transparent; border-radius: 14px; padding: 8px 2px 6px; color: var(--txt); cursor: pointer; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gift .e { font-size: 34px; height: 42px; display: grid; place-items: center; transition: transform .2s; }
.gift .e img { width: 40px; height: 40px; object-fit: contain; }
.gift small { color: var(--gold); font-weight: 700; }
.gift.on { border-color: var(--acc2); background: rgba(236, 72, 153, .14); }
.gift.on .e { transform: scale(1.2); animation: giftBob 1.2s infinite; }
.gift .hot { position: absolute; top: 3px; right: 4px; font-size: 9px; font-weight: 900; background: var(--gold-grad); color: #3b1d00; padding: 0 4px; border-radius: 4px; }
.gift-send { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.gift-send .chips { flex: 1; padding: 0; }
.gift-send .btn { width: auto; padding: 11px 22px; margin: 0; }

.cover-pick { display: grid; place-items: center; aspect-ratio: 16/9; border-radius: 18px; border: 1.5px dashed var(--line); background: var(--card); margin-bottom: 8px; cursor: pointer; overflow: hidden; color: var(--mut); position: relative; }
.cover-pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 6px 0 10px; cursor: pointer; color: var(--mut); }
.av-pick .av { width: 96px; height: 96px; font-size: 40px; box-shadow: 0 0 0 3px var(--acc); }

/* ---------- Gift effects ---------- */
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.gbanner {
  position: absolute; top: 108px; left: 0; display: flex; align-items: center; gap: 8px; max-width: 92%;
  padding: 4px 16px 4px 4px; border-radius: 0 999px 999px 0; color: #fff; font-size: 13px;
  background: linear-gradient(90deg, rgba(139, 92, 246, .95), rgba(236, 72, 153, .9)); box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
  animation: bannerIn 3.2s cubic-bezier(.2, .8, .2, 1) forwards;
}
.gbanner.t2 { background: linear-gradient(90deg, rgba(59, 130, 246, .95), rgba(139, 92, 246, .95)); }
.gbanner.t3 { background: var(--gold-grad); color: #3b1d00; }
.gbanner .gi { font-size: 30px; line-height: 1; }
.gbanner .gi img { width: 34px; height: 34px; object-fit: contain; }
.gbanner .x { font-size: 22px; font-weight: 900; font-style: italic; color: #fde68a; text-shadow: 0 2px 0 #b45309; }
.gbanner.t3 .x { color: #fff; text-shadow: 0 2px 0 #92400e; }
.gbanner .txt { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes bannerIn {
  0% { transform: translateX(-110%); }
  12%, 85% { transform: translateX(0); }
  100% { transform: translateX(-110%); opacity: 0; }
}

.fx1 { position: absolute; left: 50%; bottom: 90px; font-size: 64px; animation: fx1 1.8s ease-out forwards; }
.fx1 img { width: 80px; height: 80px; object-fit: contain; }
@keyframes fx1 {
  0% { transform: translate(-50%, 0) scale(.3); opacity: 0; }
  20% { transform: translate(-50%, -40px) scale(1.25); opacity: 1; }
  40% { transform: translate(-50%, -80px) rotate(-8deg) scale(1); }
  60% { transform: translate(-50%, -130px) rotate(8deg); }
  100% { transform: translate(-50%, -260px) scale(.8); opacity: 0; }
}

.fx2 { position: absolute; inset: 0; display: grid; place-items: center; }
.fx2 .rays { position: absolute; width: 360px; height: 360px; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 255, 255, .22) 0 10deg, transparent 10deg 30deg); mask-image: radial-gradient(closest-side, #000 30%, transparent); -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent); animation: spin 3s linear, fadeOut 2.8s forwards; }
.fx2 .icon { font-size: 120px; filter: drop-shadow(0 0 24px rgba(236, 72, 153, .9)); animation: pop 2.8s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.fx2 .icon img { width: 150px; height: 150px; object-fit: contain; }
.spark { position: absolute; left: 50%; top: 50%; font-size: 22px; animation: spark 1.4s ease-out forwards; }
@keyframes spark { from { transform: translate(-50%, -50%) scale(.4); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeOut { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pop {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  25% { transform: scale(1.15) rotate(4deg); opacity: 1; }
  40%, 80% { transform: scale(1) rotate(0); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.fx3 { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle, rgba(60, 20, 0, .55), rgba(0, 0, 0, .8)); animation: fadeOut 4.4s forwards; }
.fx3 .rays { position: absolute; width: 900px; height: 900px; background: repeating-conic-gradient(rgba(251, 191, 36, .35) 0 6deg, transparent 6deg 18deg); mask-image: radial-gradient(closest-side, #000 10%, transparent 70%); -webkit-mask-image: radial-gradient(closest-side, #000 10%, transparent 70%); animation: spin 6s linear infinite; }
.fx3 .ring { position: absolute; width: 260px; height: 260px; border-radius: 50%; border: 3px solid rgba(253, 230, 138, .8); box-shadow: 0 0 40px rgba(251, 191, 36, .8), inset 0 0 40px rgba(251, 191, 36, .5); animation: ringPulse 1.2s ease-in-out infinite; }
@keyframes ringPulse { 50% { transform: scale(1.12); opacity: .6; } }
.fx3 .icon { font-size: 170px; filter: drop-shadow(0 0 30px rgba(251, 191, 36, 1)); animation: bigPop 4.2s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.fx3 .icon img { width: 200px; height: 200px; object-fit: contain; }
@keyframes bigPop {
  0% { transform: scale(0) rotate(-180deg); }
  20% { transform: scale(1.25) rotate(10deg); }
  30%, 85% { transform: scale(1) rotate(0); }
  100% { transform: scale(2); opacity: 0; }
}
.fx3 .title { position: absolute; bottom: 22%; left: 0; right: 0; text-align: center; font-size: 20px; font-weight: 900; color: #fde68a; text-shadow: 0 2px 10px #000; padding: 0 20px; animation: up .6s .4s both; }
.fx3 .title .x { font-size: 34px; color: #fff; font-style: italic; }
.confetti { position: absolute; top: -30px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* Someone joined */
.entry { position: absolute; top: 150px; right: 0; padding: 5px 14px 5px 5px; border-radius: 999px 0 0 999px; background: rgba(0, 0, 0, .5); border: 1px solid var(--line); display: flex; align-items: center; gap: 6px; font-size: 13px; animation: entryIn 3s ease forwards; }
.entry.vip { background: var(--gold-grad); color: #3b1d00; border: 0; box-shadow: 0 0 20px rgba(251, 191, 36, .7); }
@keyframes entryIn { 0% { transform: translateX(100%); } 15%, 80% { transform: translateX(0); } 100% { transform: translateX(100%); opacity: 0; } }

/* Big gift announcement on every screen */
#global-banner { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); width: calc(100% - 20px); max-width: 460px; z-index: 70; padding: 8px 12px; border-radius: 16px; background: var(--gold-grad); color: #3b1d00; font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 8px; box-shadow: 0 10px 30px rgba(245, 158, 11, .5); cursor: pointer; animation: gbIn 6s ease forwards; }
#global-banner .gi { font-size: 26px; }
@keyframes gbIn { 0% { transform: translate(-50%, -120%); } 10%, 88% { transform: translate(-50%, 0); } 100% { transform: translate(-50%, -120%); } }

/* ---------- Admin ---------- */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.admin-tabs button { background: var(--card); border: 1px solid var(--line); color: var(--txt); padding: 9px 14px; border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 14px; }
.admin-tabs button.on { background: var(--grad); border-color: transparent; }
.admin-tabs .count { background: var(--bad); color: #fff; border-radius: 999px; padding: 0 7px; margin-left: 4px; font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.stat b { display: block; font-size: 24px; margin: 2px 0; }
.stat.hl { border-color: var(--ok); background: rgba(34, 197, 94, .08); }
.stat.warn { border-color: var(--gold); background: rgba(251, 191, 36, .08); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--mut); font-weight: 600; font-size: 13px; }
td input { margin: 0; padding: 7px 9px; font-size: 14px; }
.table-wrap { overflow-x: auto; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline input { flex: 1; min-width: 120px; }
.userline { display: flex; align-items: center; gap: 8px; }
.switch { width: 18px; height: 18px; accent-color: var(--acc); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; left: 0; right: 0; top: 14px; z-index: 99; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; padding: 0 16px; }
.toast { background: #2b1f52; color: #fff; padding: 10px 16px; border-radius: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); max-width: 440px; animation: up .2s; }
.toast.bad { background: var(--bad); }
