:root {
    --bg-dark: #070b14;
    --bg-surface: #0e1526;
    --bg-card: rgba(17, 26, 46, 0.85);
    --bg-glass: rgba(14, 21, 38, 0.75);
    --border-color: rgba(56, 75, 112, 0.4);
    --border-glow: rgba(99, 102, 241, 0.3);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.4);
    --danger: #f43f5e;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6), 0 10px 15px -6px rgba(0, 0, 0, 0.5);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 28px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-badge {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(16, 185, 129, 0.2));
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 0 15px var(--primary-glow);
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #a5b4fc, #38bdf8, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.room-info-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
}

.room-badge strong {
    color: #38bdf8;
    letter-spacing: 1px;
}

.host-badge {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.2));
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
}

.lock-badge {
    background: rgba(244, 63, 94, 0.15);
    color: var(--danger);
    border-color: rgba(244, 63, 94, 0.3);
}

.latency-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
    direction: ltr;
    padding: 5px 10px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot.green { background: #10b981; box-shadow: 0 0 8px #10b981; }
.dot.yellow { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.dot.red { background: #ef4444; box-shadow: 0 0 8px #ef4444; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.8);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: rgba(51, 65, 85, 0.9);
    border-color: rgba(148, 163, 184, 0.4);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}
.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius-md);
}

.btn-icon {
    padding: 9px;
    border-radius: var(--radius-sm);
    font-size: 16px;
}

/* Main Layout */
.main-container {
    display: grid;
    grid-template-columns: 1fr 370px;
    gap: 20px;
    padding: 20px 28px;
    flex: 1;
    transition: var(--transition);
}

.main-container.theater-mode {
    grid-template-columns: 1fr;
}
.main-container.theater-mode .sidebar-section {
    display: none;
}

/* Video Player Section */
.player-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.video-wrapper {
    position: relative;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    cursor: pointer;
}

/* Floating Emoji Reactions Overlay */
.reactions-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 25;
}

.floating-reaction {
    position: absolute;
    font-size: 38px;
    bottom: 20px;
    animation: floatReactionUp 2.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.8));
}

@keyframes floatReactionUp {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.6) rotate(0deg);
    }
    15% {
        opacity: 1;
        transform: translateY(-40px) scale(1.3) rotate(-8deg);
    }
    80% {
        opacity: 0.9;
        transform: translateY(-220px) scale(1.1) rotate(12deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-320px) scale(0.9) rotate(-15deg);
    }
}

/* Central Play/Pause Splash Animation */
.center-play-indicator {
    position: absolute;
    width: 80px;
    height: 80px;
    background: rgba(14, 21, 38, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    pointer-events: none;
    z-index: 30;
    animation: pulseSplash 0.6s ease-out forwards;
}

@keyframes pulseSplash {
    0% { transform: scale(0.6); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
}

/* Buffering Overlay */
.sync-overlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 11, 20, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 40;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Player Toast Notification */
.player-toast {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(14, 21, 38, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glow);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 35;
    animation: fadeInSlide 0.3s ease;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Quick Floating Reaction Bar */
.quick-reaction-bar {
    position: absolute;
    bottom: 80px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(14, 21, 38, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 8px 6px;
    border-radius: 30px;
    z-index: 30;
    transition: var(--transition);
    opacity: 0.85;
}
.quick-reaction-bar:hover {
    opacity: 1;
    transform: scale(1.05);
}

.btn-react {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.btn-react:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.25);
}

/* Custom Modern Video Controls Bar */
.custom-player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
    padding: 14px 20px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 30;
    transition: opacity 0.35s ease, transform 0.35s ease;
    opacity: 1;
}

.video-wrapper.controls-hidden .custom-player-controls {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}
.video-wrapper.controls-hidden .quick-reaction-bar {
    opacity: 0;
    pointer-events: none;
}

/* Timeline Scrubber */
.timeline-container {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: height 0.15s ease;
}
.timeline-container:hover {
    height: 10px;
}

.timeline-buffer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    width: 0%;
    transition: width 0.2s ease;
}

.timeline-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #38bdf8);
    border-radius: 4px;
    width: 0%;
}

.timeline-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    box-shadow: 0 0 10px var(--primary-glow);
    transition: transform 0.15s ease;
}
.timeline-container:hover .timeline-thumb {
    transform: translate(-50%, -50%) scale(1);
}

.timeline-tooltip {
    position: absolute;
    bottom: 16px;
    transform: translateX(-50%);
    background: rgba(14, 21, 38, 0.95);
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
    pointer-events: none;
    white-space: nowrap;
}

/* Bottom Controls Row */
.controls-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-control {
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 18px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.btn-control:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: scale(1.08);
}

.btn-control-pill {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-control-pill:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Volume Slider Container */
.volume-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.volume-slider {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    outline: none;
    transition: width 0.2s ease;
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}

.time-display {
    font-size: 13px;
    font-family: monospace;
    color: #cbd5e1;
    direction: ltr;
    display: flex;
    gap: 4px;
}
.time-separator {
    color: #64748b;
}

/* Dropdown Menu (Speed, etc.) */
.dropdown-container {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    bottom: 45px;
    right: 0;
    background: rgba(14, 21, 38, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
    box-shadow: var(--shadow);
    z-index: 50;
}

.dropdown-item {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    text-align: right;
}
.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}
.dropdown-item.active {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

/* Video Meta Bar */
.video-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.meta-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.media-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.drift-badge {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

/* Voice & Video Controls */
.voice-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.active-speaker-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    animation: speakerPulse 1.5s infinite;
}

@keyframes speakerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.btn.active-mic {
    background: var(--accent) !important;
    color: #fff !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 12px var(--accent-glow);
}

.btn.active-cam {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 12px var(--primary-glow);
}

/* ============================================================
   Webcam Strip — Horizontal row of user video tiles below video
   ============================================================ */
.webcam-strip {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
    background: rgba(7, 11, 20, 0.7);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    min-height: 120px;
    max-height: 160px;
}

.webcam-strip::-webkit-scrollbar {
    height: 4px;
}

.webcam-strip::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* Each individual webcam tile */
.webcam-tile {
    position: relative;
    flex: 0 0 auto;
    width: 160px;
    height: 120px;
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: default;
}

/* Glowing ring when participant is actively speaking */
.webcam-tile.speaking {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.45), 0 0 18px rgba(16, 185, 129, 0.3);
}

.webcam-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: calc(var(--radius-md) - 2px);
}

/* Dark gradient at bottom for label legibility */
.webcam-tile::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 40px;
    background: linear-gradient(to top, rgba(7, 11, 20, 0.85), transparent);
    pointer-events: none;
}

/* Name label pinned to bottom-left of tile */
.webcam-label {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(7, 11, 20, 0.7);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
    z-index: 2;
    backdrop-filter: blur(4px);
}

/* Mic on/off indicator badge (top-right) */
.webcam-mic-indicator {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(7, 11, 20, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    z-index: 2;
    backdrop-filter: blur(4px);
}

/* Avatar fallback when camera is off */
.webcam-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-surface));
    font-size: 36px;
    color: var(--text-muted);
}

/* Mobile: slightly smaller tiles */
@media (max-width: 768px) {
    .webcam-tile {
        width: 120px;
        height: 90px;
    }

    .webcam-strip {
        min-height: 96px;
        max-height: 110px;
    }
}

/* Legacy .webcam-grid alias (kept for backward-compat with JS) */
.webcam-grid {
    /* same as webcam-strip */
}


/* Sidebar Section (Participants & Chat) */
.sidebar-section {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    height: calc(100vh - 120px);
    position: sticky;
    top: 90px;
}

.sidebar-tabs {
    display: flex;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}
.tab-btn.active {
    color: #fff;
    border-bottom-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.tab-content {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}
.tab-content.active {
    display: flex;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.system-message {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(30, 41, 59, 0.5);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-color);
}

.chat-bubble {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    gap: 4px;
}
.chat-bubble.mine {
    align-self: flex-start;
}
.chat-bubble.theirs {
    align-self: flex-end;
}

.sender-name {
    font-size: 11px;
    font-weight: 700;
}

.message-text {
    background: var(--bg-surface);
    padding: 9px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid var(--border-color);
    word-break: break-word;
}
.chat-bubble.mine .message-text {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
}

.chat-input-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.8);
    border-top: 1px solid var(--border-color);
}

.chat-input-form input {
    flex: 1;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}
.chat-input-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Participants List */
.participants-list {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.participant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.participant-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 800;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.5);
}

/* Lobby Hero Card Modal */
.lobby-card {
    max-width: 680px;
    border: 1px solid var(--border-glow);
}

.lobby-banner-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.lobby-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lobby-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(7, 11, 20, 0.95) 0%, rgba(7, 11, 20, 0.3) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px 28px;
}

.lobby-banner-overlay h2 {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #fff, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lobby-banner-overlay p {
    font-size: 14px;
    color: #cbd5e1;
}

.lobby-card-body {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lobby-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.lobby-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(15, 23, 42, 0.6);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.feat-item {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 600;
}

/* Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.form-group input {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}
.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.hint {
    font-size: 12px;
    color: var(--text-muted);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    cursor: pointer;
}

/* Settings Modal Elements */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}
.settings-group:last-child {
    border-bottom: none;
}

.settings-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
}

.slider-control-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-input {
    background: var(--bg-dark);
    border: 1px dashed var(--border-color);
    padding: 10px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
}

.host-only-group {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 14px;
    border-radius: var(--radius-sm);
}
.host-only-group h4 {
    font-size: 14px;
    color: #fbbf24;
    margin-bottom: 8px;
}

/* Shortcuts Table */
.shortcuts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.shortcuts-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
}
.shortcuts-table code {
    background: rgba(30, 41, 59, 0.9);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    color: #38bdf8;
    border: 1px solid var(--border-color);
}

/* Utilities */
.hidden {
    display: none !important;
}
.w-100 {
    width: 100%;
}
.mb-2 {
    margin-bottom: 8px;
}
.mt-2 {
    margin-top: 8px;
}
.justify-center {
    justify-content: center !important;
}
.text-center {
    text-align: center !important;
}

/* Unmute Banner for Mobile / Inactive Audio */
.unmute-banner {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    z-index: 45;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
    animation: bouncePulse 1.8s infinite;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (max-width: 768px) {
    .unmute-banner {
        font-size: 16px;
        padding: 14px 28px;
        top: 16px;
        min-height: 48px; /* WCAG touch target */
    }
}


@keyframes bouncePulse {
    0%, 100% { transform: translateX(-50%) translateY(0) scale(1); }
    50% { transform: translateX(-50%) translateY(-4px) scale(1.03); }
}

/* Danger Button */
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border: none;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}
.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

/* Responsive */
@media (max-width: 960px) {
    .main-container {
        grid-template-columns: 1fr;
        padding: 14px;
    }
    .sidebar-section {
        height: 500px;
        position: static;
    }
    .lobby-actions {
        grid-template-columns: 1fr;
    }
}
