/* ── VARIABLES ─────────────────────────────────────────────── */
:root {
  --bg-primary: #0d0a1a;
  --bg-secondary: #12102a;
  --bg-card: #1a1730;
  --bg-card2: #211d3a;
  --accent: #a855f7;
  --accent2: #7c3aed;
  --accent3: #ec4899;
  --gold: #f59e0b;
  --text-primary: #ffffff;
  --text-secondary: #a0a0c0;
  --text-muted: #6b6b8a;
  --online: #22c55e;
  --danger: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --font-main: 'Poppins', sans-serif;
  --font-display: 'Rajdhani', sans-serif;
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--bg-primary); font-family: var(--font-main); color: var(--text-primary); -webkit-font-smoothing: antialiased; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select { font-family: inherit; }
img { display: block; object-fit: cover; }

/* ── APP CONTAINER ─────────────────────────────────────────── */
#app { width: 100%; max-width: 480px; height: 100dvh; margin: 0 auto; position: relative; overflow: hidden; background: var(--bg-primary); }

/* ── SCREENS ───────────────────────────────────────────────── */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity 0.3s ease, transform 0.3s ease; z-index: 1; }
.screen.active { opacity: 1; pointer-events: all; z-index: 10; }
.screen.slide-up { transform: translateY(100%); }
.screen.slide-up.active { transform: translateY(0); }

/* ── AUTH SCREEN ───────────────────────────────────────────── */
#auth-screen { background: var(--bg-primary); justify-content: center; align-items: center; }
.auth-bg { position: absolute; inset: 0; overflow: hidden; }
.auth-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.3; animation: orbFloat 6s ease-in-out infinite; }
.orb1 { width: 300px; height: 300px; background: var(--accent); top: -100px; left: -100px; animation-delay: 0s; }
.orb2 { width: 250px; height: 250px; background: var(--accent3); bottom: -50px; right: -80px; animation-delay: 2s; }
.orb3 { width: 200px; height: 200px; background: #3b82f6; top: 40%; left: 30%; animation-delay: 4s; }
@keyframes orbFloat { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(20px,-20px) scale(1.1); } }

.auth-container { position: relative; z-index: 1; width: 90%; max-width: 360px; }
.auth-logo { text-align: center; margin-bottom: 40px; }
.logo-icon { width: 70px; height: 70px; border-radius: 20px; background: linear-gradient(135deg, var(--accent), var(--accent3)); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 36px; font-weight: 700; margin: 0 auto 12px; box-shadow: 0 0 40px rgba(168,85,247,0.5); }
.auth-logo h1 { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: 2px; }
.auth-logo h1 span { color: var(--accent); }
.auth-logo p { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }

.auth-tabs { display: flex; background: var(--bg-card); border-radius: 50px; padding: 4px; margin-bottom: 24px; }
.auth-tab { flex: 1; padding: 10px; border-radius: 50px; font-size: 15px; font-weight: 500; color: var(--text-secondary); transition: all 0.3s; }
.auth-tab.active { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: white; box-shadow: 0 4px 15px rgba(168,85,247,0.4); }

.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.active { display: flex; }

.auth-input { background: var(--bg-card); border: 1px solid rgba(168,85,247,0.2); border-radius: var(--radius-sm); padding: 14px 16px; color: white; font-size: 15px; outline: none; transition: border-color 0.3s; }
.auth-input:focus { border-color: var(--accent); }
.auth-input option { background: var(--bg-card); }

.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent3)); color: white; padding: 14px; border-radius: 50px; font-size: 16px; font-weight: 600; letter-spacing: 0.5px; transition: all 0.3s; box-shadow: 0 4px 20px rgba(168,85,247,0.4); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(168,85,247,0.5); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary { background: var(--bg-card2); color: var(--text-secondary); padding: 12px 20px; border-radius: 50px; font-size: 14px; font-weight: 500; }

.auth-demo { text-align: center; color: var(--text-muted); font-size: 12px; }
.auth-demo strong { color: var(--accent); }

/* ── MAIN SCREEN ───────────────────────────────────────────── */
#main-screen { background: var(--bg-primary); flex-direction: column; overflow: hidden; }

/* ── BANNER ────────────────────────────────────────────────── */
.banner-slider { height: 180px; position: relative; overflow: hidden; flex-shrink: 0; }
.banner-slide { position: absolute; inset: 0; display: flex; align-items: center; padding: 20px 24px; opacity: 0; transition: opacity 0.5s ease; }
.banner-slide.active { opacity: 1; }
.banner-content h2 { font-family: var(--font-display); font-size: 28px; font-weight: 700; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.banner-content h2 span { color: var(--gold); }
.banner-content p { color: rgba(255,255,255,0.8); font-size: 13px; margin-top: 4px; }
.banner-icon { position: absolute; right: 24px; width: 90px; height: 90px; border-radius: 20px; background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 48px; font-weight: 700; }

.banner-dots { display: flex; justify-content: center; gap: 6px; padding: 8px 0; flex-shrink: 0; }
.banner-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); transition: all 0.3s; }
.banner-dot.active { width: 20px; border-radius: 3px; background: var(--accent); }

/* ── NAV TABS ──────────────────────────────────────────────── */
.nav-tabs { display: flex; align-items: center; padding: 0 16px 12px; flex-shrink: 0; gap: 4px; }
.nav-tab { flex: 1; padding: 8px; font-size: 15px; font-weight: 500; color: var(--text-secondary); border-bottom: 2px solid transparent; transition: all 0.3s; }
.nav-tab.active { color: white; border-bottom-color: var(--accent); font-weight: 600; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-avatar-btn { position: relative; width: 36px; height: 36px; cursor: pointer; }
.user-avatar-btn img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--accent); }
.vip-badge { position: absolute; bottom: -4px; right: -4px; background: var(--gold); border-radius: 4px; font-size: 9px; font-weight: 700; padding: 1px 3px; color: #000; }
.icon-btn { background: var(--bg-card); width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: background 0.2s; }
.icon-btn:hover { background: var(--bg-card2); }

/* ── TAB CONTENT ───────────────────────────────────────────── */
.tab-content { display: none; flex-direction: column; flex: 1; overflow-y: auto; padding-bottom: 70px; }
.tab-content.active { display: flex; }
.tab-content::-webkit-scrollbar { width: 3px; }
.tab-content::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }

/* ── MINE TAB ──────────────────────────────────────────────── */
.mine-actions { display: flex; gap: 12px; padding: 0 16px 16px; }
.mine-btn { flex: 1; background: var(--bg-card); border-radius: var(--radius); padding: 16px; display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 500; color: white; transition: all 0.3s; }
.mine-btn.primary { background: linear-gradient(135deg, rgba(168,85,247,0.3), rgba(124,58,237,0.3)); border: 1px solid rgba(168,85,247,0.3); }
.mine-btn.secondary { background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(59,130,246,0.3)); border: 1px solid rgba(59,130,246,0.3); }
.mine-btn-icon { width: 40px; height: 40px; border-radius: 10px; overflow: hidden; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.mine-btn-icon img { width: 100%; height: 100%; }

.filter-tabs { display: flex; padding: 0 16px 12px; gap: 8px; }
.filter-tab { padding: 8px 20px; border-radius: 50px; font-size: 13px; font-weight: 500; background: var(--bg-card); color: var(--text-secondary); transition: all 0.3s; }
.filter-tab.active { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: white; }

/* ── PARTY FILTERS ─────────────────────────────────────────── */
.party-filters { display: flex; padding: 0 16px 12px; gap: 8px; overflow-x: auto; flex-shrink: 0; }
.party-filters::-webkit-scrollbar { display: none; }
.filter-pill { padding: 8px 16px; border-radius: 50px; font-size: 13px; font-weight: 500; background: var(--bg-card); color: var(--text-secondary); white-space: nowrap; transition: all 0.3s; flex-shrink: 0; }
.filter-pill.active { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: white; box-shadow: 0 4px 12px rgba(168,85,247,0.3); }

/* ── ROOMS LIST ────────────────────────────────────────────── */
.rooms-list { display: flex; flex-direction: column; gap: 10px; padding: 0 16px; }
.room-card { background: var(--bg-card); border-radius: var(--radius); padding: 14px; display: flex; gap: 12px; align-items: center; cursor: pointer; transition: all 0.3s; border: 1px solid transparent; }
.room-card:hover { border-color: rgba(168,85,247,0.2); transform: translateX(2px); }
.room-thumb { width: 70px; height: 70px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; background: var(--bg-card2); }
.room-thumb img { width: 100%; height: 100%; }
.room-details { flex: 1; min-width: 0; }
.room-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.room-owner { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-members { display: flex; align-items: center; gap: 4px; }
.member-avatar { width: 24px; height: 24px; border-radius: 50%; overflow: hidden; background: var(--bg-card2); margin-right: -8px; border: 1px solid var(--bg-card); }
.member-avatar img { width: 100%; height: 100%; }
.room-count { margin-left: 16px; display: flex; align-items: center; gap: 4px; color: var(--accent); font-size: 14px; font-weight: 600; flex-shrink: 0; }

/* ── NEWS SECTION ──────────────────────────────────────────── */
.news-section { padding: 16px; margin-top: 8px; }
.news-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.news-header span { font-size: 16px; font-weight: 600; }
.news-header button { color: var(--accent); font-size: 14px; }
.news-card { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; }
.news-tabs { display: flex; background: var(--bg-card2); }
.news-tab { flex: 1; padding: 10px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.news-tab.active { color: white; border-bottom: 2px solid var(--accent); }
.news-categories { display: flex; padding: 12px 16px; gap: 8px; overflow-x: auto; }
.news-categories::-webkit-scrollbar { display: none; }
.news-cat { padding: 4px 14px; border-radius: 50px; font-size: 12px; font-weight: 500; background: var(--bg-card2); color: var(--text-secondary); white-space: nowrap; cursor: pointer; }
.news-cat.active { background: var(--accent); color: white; }
.leaderboard-list { padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.lb-item { display: flex; align-items: center; gap: 10px; }
.lb-rank { width: 24px; font-size: 14px; font-weight: 700; text-align: center; color: var(--text-secondary); }
.lb-rank.gold { color: var(--gold); }
.lb-rank.silver { color: #9ca3af; }
.lb-rank.bronze { color: #cd7c4b; }
.lb-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; }
.lb-avatar img { width: 100%; height: 100%; }
.lb-info { flex: 1; }
.lb-name { font-size: 14px; font-weight: 500; }
.lb-score { font-size: 12px; color: var(--gold); }
.lb-badge { font-size: 20px; }

/* ── LIVE GRID ─────────────────────────────────────────────── */
.live-stories { display: flex; gap: 12px; padding: 0 16px 12px; overflow-x: auto; flex-shrink: 0; }
.live-stories::-webkit-scrollbar { display: none; }
.story-item { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; flex-shrink: 0; }
.story-avatar { width: 60px; height: 60px; border-radius: 50%; padding: 3px; background: linear-gradient(135deg, var(--accent), var(--accent3)); }
.story-avatar img { width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--bg-primary); }
.story-live-badge { background: var(--danger); font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; margin-top: -10px; }
.story-name { font-size: 11px; color: var(--text-secondary); max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }

.live-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; }
.live-card { border-radius: var(--radius); overflow: hidden; cursor: pointer; position: relative; aspect-ratio: 3/4; background: var(--bg-card); transition: transform 0.2s; }
.live-card:hover { transform: scale(0.98); }
.live-card img { width: 100%; height: 100%; object-fit: cover; }
.live-card-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%); padding: 12px; display: flex; flex-direction: column; justify-content: flex-end; }
.live-card-views { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); border-radius: 50px; padding: 3px 8px; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.live-card-badge { position: absolute; top: 8px; right: 8px; background: linear-gradient(135deg, var(--gold), #f97316); border-radius: 50px; padding: 3px 8px; font-size: 11px; font-weight: 700; color: #000; }
.live-card-country { position: absolute; top: 8px; right: 8px; background: rgba(168,85,247,0.8); border-radius: 4px; padding: 2px 6px; font-size: 11px; font-weight: 700; }
.live-card-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.live-card-user { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.live-card-user img { width: 20px; height: 20px; border-radius: 50%; }
.live-card-user span { font-size: 11px; color: var(--text-secondary); }
.live-card-gender { background: rgba(59,130,246,0.7); border-radius: 50px; padding: 2px 8px; font-size: 11px; margin-left: auto; }

/* ── BOTTOM NAV ────────────────────────────────────────────── */
.bottom-nav { position: absolute; bottom: 0; left: 0; right: 0; display: flex; background: var(--bg-card); border-top: 1px solid rgba(168,85,247,0.1); padding: 8px 0; padding-bottom: max(8px, env(safe-area-inset-bottom)); z-index: 100; }
.bottom-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: var(--text-secondary); position: relative; transition: color 0.2s; }
.bottom-btn.active { color: var(--accent); }
.bottom-icon { font-size: 20px; }
.notif-badge { position: absolute; top: 0; right: 20%; background: var(--danger); color: white; border-radius: 50px; font-size: 10px; font-weight: 700; padding: 1px 5px; min-width: 18px; text-align: center; }
.notif-dot { position: absolute; top: 2px; right: 25%; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; }

/* ── ROOM SCREEN ───────────────────────────────────────────── */
#room-screen { background: var(--bg-primary); }
.room-bg { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(168,85,247,0.2) 0%, var(--bg-primary) 40%); z-index: 0; }
.room-header { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 48px 16px 12px; }
.back-btn { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; font-size: 22px; color: white; flex-shrink: 0; }
.room-info { flex: 1; min-width: 0; }
.room-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.room-viewers { font-size: 12px; color: var(--text-secondary); }
.room-actions { display: flex; gap: 8px; }

.mic-seats { position: relative; z-index: 1; padding: 16px; }
.mic-row { display: flex; justify-content: center; gap: 16px; margin-bottom: 12px; }
.mic-seat { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; width: 60px; }
.seat-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--bg-card2); border: 2px solid rgba(168,85,247,0.3); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 20px; position: relative; transition: border-color 0.3s; }
.seat-avatar img { width: 100%; height: 100%; }
.mic-seat.owner .seat-avatar { border-color: var(--gold); width: 68px; height: 68px; }
.mic-seat.occupied .seat-avatar { border-color: var(--accent); }
.mic-seat.speaking .seat-avatar { border-color: var(--online); box-shadow: 0 0 12px rgba(34,197,94,0.5); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 12px rgba(34,197,94,0.5); } 50% { box-shadow: 0 0 20px rgba(34,197,94,0.8); } }
.seat-name { font-size: 11px; color: var(--text-secondary); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.seat-mic { font-size: 12px; }
.seat-number { font-size: 18px; color: var(--text-muted); }

.chat-area { flex: 1; overflow: hidden; position: relative; z-index: 1; }
.chat-messages { height: 100%; overflow-y: auto; padding: 8px 16px; display: flex; flex-direction: column; gap: 6px; }
.chat-messages::-webkit-scrollbar { display: none; }
.chat-msg { display: flex; gap: 8px; align-items: flex-start; animation: slideInLeft 0.3s ease; }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
.chat-msg-avatar { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; background: var(--bg-card2); flex-shrink: 0; }
.chat-msg-avatar img { width: 100%; height: 100%; }
.chat-msg-bubble { background: rgba(26,23,48,0.85); backdrop-filter: blur(8px); border-radius: 0 12px 12px 12px; padding: 8px 12px; max-width: 75%; }
.chat-msg-name { font-size: 11px; color: var(--accent); font-weight: 600; margin-bottom: 2px; }
.chat-msg-text { font-size: 13px; line-height: 1.4; }
.system-msg { text-align: center; font-size: 12px; color: var(--text-muted); padding: 2px 0; }

.gift-overlay, .live-gift-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.gift-animation { position: absolute; bottom: 80px; left: 16px; background: rgba(26,23,48,0.9); backdrop-filter: blur(10px); border-radius: var(--radius); padding: 10px 14px; display: flex; align-items: center; gap: 10px; animation: giftSlide 3s ease forwards; border: 1px solid rgba(168,85,247,0.3); }
@keyframes giftSlide { 0% { opacity: 0; transform: translateX(-100%); } 15% { opacity: 1; transform: translateX(0); } 80% { opacity: 1; transform: translateX(0); } 100% { opacity: 0; transform: translateX(-100%); } }
.gift-anim-avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; }
.gift-anim-avatar img { width: 100%; height: 100%; }
.gift-anim-info span { display: block; font-size: 12px; color: var(--text-secondary); }
.gift-anim-info strong { font-size: 14px; }
.gift-anim-emoji { font-size: 32px; animation: giftBounce 0.5s ease; }
@keyframes giftBounce { 0%,100% { transform: scale(1); } 50% { transform: scale(1.3); } }

.room-footer { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); background: rgba(13,10,26,0.95); border-top: 1px solid rgba(168,85,247,0.1); }
.room-footer-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-card); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; transition: background 0.2s; }
.room-footer-btn:hover { background: var(--bg-card2); }
.pk-btn { background: linear-gradient(135deg, #dc2626, #7c3aed) !important; }
.gift-btn { background: linear-gradient(135deg, #d97706, #dc2626) !important; }
.chat-input-wrap { flex: 1; display: flex; background: var(--bg-card); border-radius: 50px; overflow: hidden; border: 1px solid rgba(168,85,247,0.2); }
.chat-input { flex: 1; background: none; border: none; outline: none; color: white; padding: 10px 14px; font-size: 14px; }
.send-btn { background: var(--accent); color: white; border-radius: 50%; width: 34px; height: 34px; margin: 2px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }

/* ── LIVE SCREEN ───────────────────────────────────────────── */
#live-screen { background: #000; }
.live-video-bg { position: absolute; inset: 0; background: #000; }
.live-video-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }
.live-gradient { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 30%, transparent 60%, rgba(0,0,0,0.8) 100%); }
.live-header { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 48px 16px 12px; }
.streamer-info { flex: 1; display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.4); backdrop-filter: blur(8px); border-radius: 50px; padding: 6px 12px; }
.streamer-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--accent3); }
.streamer-name { font-size: 14px; font-weight: 600; }
.streamer-stats { font-size: 11px; color: rgba(255,255,255,0.7); }
.follow-btn { background: linear-gradient(135deg, var(--accent3), var(--accent)); color: white; border-radius: 50px; padding: 5px 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.live-rank-banner { position: relative; z-index: 2; padding: 0 16px; }
.rank-chip { display: inline-block; background: linear-gradient(135deg, var(--gold), #f97316); border-radius: 50px; padding: 4px 12px; font-size: 12px; font-weight: 700; color: #000; }
.live-chat { position: relative; z-index: 2; flex: 1; padding: 8px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; justify-content: flex-end; }
.live-chat::-webkit-scrollbar { display: none; }
.live-chat-msg { display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); border-radius: 20px; padding: 5px 10px; width: fit-content; }
.live-chat-msg img { width: 20px; height: 20px; border-radius: 50%; }
.live-chat-msg .name { font-size: 12px; color: var(--accent); font-weight: 600; }
.live-chat-msg .text { font-size: 13px; }
.live-footer { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.live-footer-btn { width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,0.5); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.live-input-wrap { flex: 1; display: flex; background: rgba(0,0,0,0.5); backdrop-filter: blur(8px); border-radius: 50px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); }
.live-input { flex: 1; background: none; border: none; outline: none; color: white; padding: 10px 14px; font-size: 14px; }
.live-input::placeholder { color: rgba(255,255,255,0.4); }

/* ── GIFT PANEL ────────────────────────────────────────────── */
.bottom-sheet { position: absolute; bottom: -100%; left: 0; right: 0; background: var(--bg-card); border-radius: 24px 24px 0 0; padding: 16px; z-index: 200; transition: bottom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); max-height: 70vh; overflow-y: auto; }
.bottom-sheet.open { bottom: 0; }
.sheet-handle { width: 40px; height: 4px; background: var(--bg-card2); border-radius: 2px; margin: 0 auto 16px; }
.sheet-title { font-size: 18px; font-weight: 600; text-align: center; margin-bottom: 16px; }
.gift-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gift-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; border: 2px solid transparent; }
.gift-item:hover, .gift-item.selected { background: rgba(168,85,247,0.15); border-color: var(--accent); }
.gift-emoji { font-size: 32px; }
.gift-name { font-size: 11px; font-weight: 500; text-align: center; }
.gift-price { font-size: 11px; color: var(--gold); display: flex; align-items: center; gap: 2px; }
.gift-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(168,85,247,0.1); }
.coin-balance { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; }

/* ── PROFILE ───────────────────────────────────────────────── */
#profile-screen { background: var(--bg-primary); }
.profile-bg { height: 200px; background: linear-gradient(135deg, var(--accent2), var(--accent3)); position: relative; flex-shrink: 0; }
.settings-btn { position: absolute; top: 48px; right: 16px; font-size: 22px; background: rgba(255,255,255,0.1); width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.profile-card { background: var(--bg-primary); border-radius: 24px 24px 0 0; margin-top: -24px; flex: 1; padding: 20px 20px 100px; display: flex; flex-direction: column; align-items: center; gap: 12px; overflow-y: auto; }
.profile-avatar-large { width: 90px; height: 90px; border-radius: 50%; border: 4px solid var(--bg-primary); margin-top: -45px; }
.vip-crown { background: linear-gradient(135deg, var(--gold), #f97316); color: #000; font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 50px; }
#profile-name { font-size: 22px; font-weight: 700; font-family: var(--font-display); }
#profile-bio { font-size: 14px; color: var(--text-secondary); text-align: center; }
.profile-stats { display: flex; gap: 32px; margin: 8px 0; }
.stat { text-align: center; }
.stat span { display: block; font-size: 20px; font-weight: 700; }
.stat label { font-size: 12px; color: var(--text-secondary); }
.profile-balance { display: flex; align-items: center; gap: 12px; background: var(--bg-card); padding: 12px 20px; border-radius: var(--radius); width: 100%; }
.profile-balance div { flex: 1; font-size: 16px; font-weight: 600; }

/* ── MODAL ─────────────────────────────────────────────────── */
.modal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 300; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.modal.open { opacity: 1; pointer-events: all; }
.modal-card { background: var(--bg-card); border-radius: var(--radius); padding: 24px; width: 90%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.modal-card h3 { font-size: 20px; font-weight: 700; text-align: center; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions button { flex: 1; padding: 12px; border-radius: 50px; font-size: 15px; font-weight: 600; }

/* ── LEADERBOARD SCREEN ────────────────────────────────────── */
#leaderboard-screen { background: var(--bg-primary); }
.screen-header { display: flex; align-items: center; gap: 12px; padding: 48px 16px 16px; }
.screen-header h2 { font-size: 20px; font-weight: 700; }
.lb-tabs { display: flex; padding: 0 16px 12px; gap: 8px; }
.lb-tab { padding: 8px 20px; border-radius: 50px; font-size: 14px; font-weight: 500; background: var(--bg-card); color: var(--text-secondary); transition: all 0.3s; }
.lb-tab.active { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: white; }
#full-leaderboard { padding: 0 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; flex: 1; padding-bottom: 20px; }
.full-lb-item { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border-radius: var(--radius); padding: 12px 16px; }
.full-lb-rank { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; background: var(--bg-card2); flex-shrink: 0; }
.full-lb-rank.r1 { background: linear-gradient(135deg, var(--gold), #f97316); color: #000; }
.full-lb-rank.r2 { background: linear-gradient(135deg, #9ca3af, #6b7280); }
.full-lb-rank.r3 { background: linear-gradient(135deg, #cd7c4b, #92400e); }
.full-lb-avatar { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; }
.full-lb-avatar img { width: 100%; height: 100%; }
.full-lb-info { flex: 1; }
.full-lb-name { font-size: 15px; font-weight: 600; }
.full-lb-stats { font-size: 12px; color: var(--text-secondary); }
.full-lb-diamonds { color: var(--gold); font-size: 16px; font-weight: 700; }

/* ── OVERLAY ───────────────────────────────────────────────── */
.overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 150; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.overlay.active { opacity: 1; pointer-events: all; }

/* ── TOAST ─────────────────────────────────────────────────── */
.toast { position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--bg-card2); color: white; padding: 10px 20px; border-radius: 50px; font-size: 14px; z-index: 999; opacity: 0; transition: all 0.3s; white-space: nowrap; border: 1px solid rgba(168,85,247,0.3); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── LOADING ───────────────────────────────────────────────── */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--text-muted); flex-direction: column; gap: 12px; }
.spinner { width: 36px; height: 36px; border: 3px solid rgba(168,85,247,0.2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 360px) { .gift-grid { grid-template-columns: repeat(3, 1fr); } }
@media (prefers-color-scheme: light) { #app { background: var(--bg-primary); } }
