:root { 
    --bg-dark: #000000; 
    --bg-card: #0f172a; 
    --primary: #3b82f6; 
    --success: #10b981; 
    --warning: #fbbf24; 
    --danger: #ef4444; 
    --text-muted: #94a3b8;
}

html, body { width: 100%; height: 100%; margin: 0; padding: 0; font-family: 'Poppins', sans-serif; background: var(--bg-dark); color: white; overflow: hidden; touch-action: manipulation; }

.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }

/* HOME TOP BAR */
.home-top-bar { position: fixed; top: 0; left: 0; width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(15px); z-index: 3000; box-sizing: border-box; border-bottom: 1px solid rgba(255,255,255,0.1); }
.profile-sec { display: flex; align-items: center; gap: 8px; font-weight: bold; font-size: 0.9rem; }
.profile-sec img { width: 35px; height: 35px; border-radius: 50%; border: 2px solid var(--primary); object-fit: cover; }
.coin-sec { background: rgba(255,255,255,0.1); padding: 5px 12px; border-radius: 20px; font-weight: 800; color: var(--warning); display: flex; align-items: center; gap: 5px; font-size: 0.9rem;}
.buy-pass-btn { background: linear-gradient(45deg, #3b82f6, #2563eb); color: white; padding: 6px 12px; border-radius: 8px; font-weight: bold; text-decoration: none; font-size: 0.85rem; display: flex; align-items: center; gap: 5px; transition: 0.2s; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4); }

/* MENUS */
.menu-overlay { position: fixed; inset: 0; background: radial-gradient(circle, #1e293b, var(--bg-dark)); z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.menu-box { background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(20px); padding: 30px; border-radius: 24px; border: 1px solid rgba(255,255,255,0.1); width: 90%; max-width: 350px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.8); position: relative; display: flex; flex-direction: column; gap: 15px; }
.back-btn { position: absolute; top: 15px; left: 15px; background: transparent; border: none; font-weight: bold; cursor: pointer; font-family: 'Poppins'; }
.brand-title { margin: 0; color: white; font-size: 2.2rem; text-shadow: 0 0 10px rgba(255,255,255,0.2); }
.menu-btn { width: 100%; border: none; padding: 15px; border-radius: 14px; color: white; font-weight: bold; font-size: 1.1rem; cursor: pointer; transition: 0.2s; font-family: 'Poppins'; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: linear-gradient(45deg, var(--primary), #8b5cf6); box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4); }
.btn-primary:active { transform: scale(0.96); }
.warning-box { margin-top: 10px; font-size: 0.75rem; color: #fca5a5; font-weight: bold; background: rgba(239,68,68,0.1); padding: 10px; border-radius: 8px; border: 1px solid rgba(239,68,68,0.2); }

.radar-spinner { margin: 10px auto; width: 60px; height: 60px; border: 4px solid rgba(255,255,255,0.1); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* STUDIO NAV */
.studio-nav { width: 100%; height: 60px; padding: 0 15px; box-sizing: border-box; background: transparent; position: fixed; top: 0; z-index: 1000; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.btn-quit { pointer-events: auto; background: rgba(239,68,68,0.8); backdrop-filter: blur(5px); border: none; color: white; padding: 6px 15px; border-radius: 20px; font-weight: bold; cursor: pointer; font-family: 'Poppins'; box-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.nav-brand { color: white; font-weight: 900; font-size: 1.2rem; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
.secure-badge { pointer-events: auto; color: var(--success); font-weight: bold; font-size: 0.8rem; background: rgba(0,0,0,0.5); backdrop-filter: blur(5px); padding: 5px 12px; border-radius: 20px; }

/* 📹 WORKSPACE */
.app-container { width: 100%; height: 100dvh; background: #000; position: relative; }
.video-workspace { display: flex; flex-direction: column; width: 100%; height: 100%; position: relative; }

/* Mobile First Layout: Stranger takes full screen, you are small pip */
.stranger-half { width: 100%; height: 100%; position: absolute; top: 0; left: 0; background: #111; z-index: 1; }
.stranger-half video { width: 100%; height: 100%; object-fit: cover; }

.local-half { width: 120px; height: 160px; position: absolute; top: 70px; right: 15px; z-index: 2; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 20px rgba(0,0,0,0.5); border: 2px solid rgba(255,255,255,0.2); background: #000; }
.local-half video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }

.cam-loading { color: white; font-weight: bold; font-size: 1rem; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-shadow: 0 2px 5px rgba(0,0,0,0.8); }

.vid-label { position: absolute; bottom: 8px; left: 8px; color: white; padding: 2px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: bold; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(5px); z-index: 10; }

/* Floating Video Controls */
.controls-overlay { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; gap: 15px; z-index: 20; width: auto; justify-content: center; padding: 10px 20px; box-sizing: border-box; background: rgba(0,0,0,0.4); backdrop-filter: blur(15px); border-radius: 30px; border: 1px solid rgba(255,255,255,0.1); transition: opacity 0.3s ease; }
.ctrl-btn { border: none; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; transition: 0.2s; }
.ctrl-btn:active { transform: scale(0.9); }
.round-btn { width: 45px; height: 45px; border-radius: 50%; background: rgba(255,255,255,0.2); font-size: 1.2rem; }
.skip-btn { padding: 0 30px; height: 45px; border-radius: 25px; background: var(--primary); font-weight: bold; font-size: 1.1rem; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5); }

/* Chat Badge */
.chat-badge-count { position: absolute; top: -5px; right: -5px; background: var(--danger); color: white; font-size: 0.7rem; font-weight: bold; min-width: 20px; height: 20px; border-radius: 50%; display: none; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,0.5); border: 2px solid #000; }

/* 🚀 CHAT POPUP (Mobile Bottom Sheet Style) */
.chat-popup { position: absolute; bottom: 0; left: 0; width: 100%; height: 50vh; background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(20px); border-radius: 24px 24px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,0.6); display: flex; flex-direction: column; z-index: 100; overflow: hidden; border-top: 1px solid rgba(255,255,255,0.1); animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.chat-header { background: rgba(0,0,0,0.3); padding: 15px; display: flex; justify-content: space-between; align-items: center; color: white; font-weight: bold; font-size: 1rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.close-chat-btn { background: rgba(255,255,255,0.1); border: none; width: 30px; height: 30px; border-radius: 50%; color: white; font-size: 1rem; cursor: pointer; }

.chat-messages { flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; font-size: 0.95rem; color: #e2e8f0; }
.system-msg { text-align: center; color: var(--warning); font-size: 0.8rem; font-weight: bold; margin: 5px 0; background: rgba(251, 191, 36, 0.1); padding: 4px; border-radius: 8px; }
.chat-line { word-wrap: break-word; line-height: 1.4; background: rgba(255,255,255,0.05); padding: 8px 12px; border-radius: 12px; width: fit-content; max-width: 85%; }
.chat-me { color: var(--primary); font-weight: bold; }
.chat-stranger { color: #f472b6; font-weight: bold; }
.chat-text { color: white; }

.chat-input-area { padding: 10px; background: rgba(0,0,0,0.5); display: flex; gap: 10px; align-items: center; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.chat-input-area input { flex: 1; padding: 12px 15px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.05); color: white; outline: none; font-size: 0.95rem; }
.chat-input-area input::placeholder { color: #94a3b8; }
.send-btn { background: var(--primary); border: none; width: 45px; height: 45px; border-radius: 50%; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; box-shadow: 0 4px 10px rgba(59, 130, 246, 0.4); }

/* TOP ICON BTN */
.top-icon-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: white; width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; font-size: 0.9rem; }
.blocked-list-container { max-height: 250px; overflow-y: auto; text-align: left; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; padding-right: 5px; }
.blocked-item { display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.3); padding: 12px; border-radius: 12px; font-size: 0.85rem; border: 1px solid rgba(255,255,255,0.1); color: white; font-weight: bold;}
.unblock-btn { background: var(--success); color: white; border: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: bold; font-family: 'Poppins'; font-size: 0.75rem;}

.top-right-block { position: absolute; top: 15px; right: 15px; z-index: 50; width: 40px; height: 40px; box-shadow: 0 4px 10px rgba(0,0,0,0.6); background: rgba(239, 68, 68, 0.8); backdrop-filter: blur(5px); border-radius: 50%; border: none; color: white; cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; }

/* Desktop View Layout */
@media (min-width: 768px) {
    .video-workspace { flex-direction: row; }
    .stranger-half { position: relative; flex: 1; }
    .local-half { position: relative; flex: 1; width: auto; height: auto; top: 0; right: 0; border-radius: 0; border: none; border-left: 2px solid #334155; }
    .chat-popup { left: 20px; bottom: 90px; width: 350px; height: 500px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.1); }
}
