        :root {
            --primary: #f97316; 
            --secondary: #8b5cf6;
            --danger: #ef4444; 
            --success: #10b981;
            --primary-grad: linear-gradient(135deg, #f97316, #f43f5e);
        }

        [data-theme="light"] {
            --bg-dark: #f1f5f9; --bg-panel: #ffffff; --bg-board: #ffffff;
            --border-color: #e2e8f0; --border-dark: #cbd5e1;
            --text-main: #0f172a; --text-dark: #1e293b; --text-muted: #64748b;
            --chat-bg: #f8fafc; --chat-theirs: #e2e8f0; --chat-theirs-txt: #0f172a; --input-bg: #f1f5f9;
        }

        [data-theme="dark"] {
            --bg-dark: #0f172a; --bg-panel: #1e293b; --bg-board: #0f172a; 
            --border-color: #e2e8f0; --border-dark: #334155;
            --text-main: #f8fafc; --text-dark: #f8fafc; --text-muted: #94a3b8;
            --chat-bg: #182235; --chat-theirs: #334155; --chat-theirs-txt: #ffffff; --input-bg: #0f172a;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; }
        body { background: var(--bg-dark); color: var(--text-main); height: 100vh; width: 100vw; overflow: hidden; display: flex; padding: 8px; gap: 8px; transition: background 0.3s ease; }

        /* LOADER, UNAUTHORIZED, END SESSION & JOIN UI */
        #loader, #unauthorizedBox, #endSessionBox, #joinOverlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: var(--bg-dark); z-index: 999999; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity 0.5s ease; text-align: center; padding: 20px;}
        #unauthorizedBox, #endSessionBox, #joinOverlay { display: none; }
        
        .ripple-container { position: relative; width: 100px; height: 100px; display: flex; justify-content: center; align-items: center; margin-bottom: 30px; }
        .ripple-logo { width: 60px; height: 60px; border-radius: 16px; object-fit: contain; position: relative; z-index: 10; background: #ffffff; padding: 5px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
        .ripple-ring { position: absolute; width: 60px; height: 60px; border-radius: 50%; border: 2px solid var(--primary); opacity: 0; animation: ripple-effect 2s cubic-bezier(0.16, 1, 0.3, 1) infinite; }
        .ripple-ring:nth-child(2) { animation-delay: 0.6s; } .ripple-ring:nth-child(3) { animation-delay: 1.2s; }
        .loader-text { font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--text-dark); letter-spacing: 1.5px; animation: pulse-text 1.5s infinite; }
        
        @keyframes ripple-effect { 0% { transform: scale(1); opacity: 0.8; border-width: 3px; } 100% { transform: scale(2.5); opacity: 0; border-width: 0px; } }
        @keyframes pulse-text { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

        /* JOIN BUTTON */
        .tap-join-btn { background: var(--primary-grad); color: white; border: none; padding: 15px 40px; border-radius: 30px; font-family: 'Space Grotesk'; font-size: 1.3rem; cursor: pointer; box-shadow: 0 8px 25px rgba(249,115,22,0.4); transition: transform 0.2s, box-shadow 0.2s; display: flex; align-items: center; gap: 10px; margin-top: 30px; }
        .tap-join-btn:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 12px 30px rgba(249,115,22,0.6); }

        /* LEFT PANE & TOOLBAR */
        .left-pane { flex: 1; background: var(--bg-board); border-radius: 12px; position: relative; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 5px 20px rgba(0,0,0,0.2); border: 2px solid var(--border-dark); transition: background 0.3s ease;}
        
        .top-toolbar-wrapper { position: absolute; top: 0; left: 0; right: 0; z-index: 101; transform: translateY(-100%); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); display: none; }
        .top-toolbar-wrapper.open { transform: translateY(0); }
        .top-bar-toggle { position: absolute; bottom: -28px; left: 50%; transform: translateX(-50%); background: rgba(248, 250, 252, 0.95); border: 1px solid var(--border-color); border-top: none; padding: 4px 20px; border-radius: 0 0 10px 10px; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(10px); box-shadow: 0 5px 10px rgba(0,0,0,0.05); transition: 0.2s; }
        .top-bar-toggle:hover { background: #ffffff; color: var(--primary); }

        .wb-toolbar { background: rgba(248, 250, 252, 0.95); backdrop-filter: blur(10px); padding: 0 15px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; height: 50px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); flex-wrap: nowrap;}
        .tools-group { display: flex; gap: 4px; align-items: center; height: 100%;}
        
        .tool-wrap { position: relative; display: flex; align-items: center; justify-content: center; height: 100%; padding: 0 2px; }
        .tool-btn { width: 34px; height: 34px; border-radius: 6px; border: none; background: transparent; cursor: pointer; font-size: 1.05rem; color: #475569; transition: 0.2s; display: flex; align-items: center; justify-content: center; position: relative;}
        .tool-btn.active { background: #e0e7ff; color: var(--secondary); box-shadow: inset 0 0 0 1px var(--secondary); }
        .tool-btn:hover:not(.active) { background: #e2e8f0; }
        .divider { width: 1px; height: 20px; background: #cbd5e1; margin: 0 5px; }

        .dropdown-menu { position: absolute; top: 48px; left: 50%; transform: translateX(-50%); background: white; border: 1px solid var(--border-color); border-radius: 8px; padding: 6px; display: none; flex-direction: row; gap: 5px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); z-index: 1000; align-items: center; }
        .dropdown-menu::before { content: ''; position: absolute; top: -10px; left: 0; right: 0; height: 10px; background: transparent; }
        .tool-wrap:hover .dropdown-menu { display: flex; }
        .drop-item { width: 30px; height: 30px; border-radius: 4px; border: none; background: transparent; cursor: pointer; font-size: 1rem; color: #475569; display: flex; align-items: center; justify-content: center; transition: 0.2s;}
        .drop-item:hover { background: #f1f5f9; color: var(--secondary); }
        
        .thick-opt { display: flex; align-items: center; justify-content: center; width: 100%; height: 30px; cursor: pointer; border-radius: 4px; transition: 0.2s;}
        .thick-opt:hover, .thick-opt.active { background: #f1f5f9; }
        .thick-line { background: #475569; border-radius: 2px; width: 24px; }
        .thick-opt.active .thick-line { background: var(--secondary); }

        .color-dot { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 2px solid #e2e8f0; box-shadow: 0 0 0 1px transparent; transition: 0.1s;}
        .color-dot.active { transform: scale(1.15); box-shadow: 0 0 0 2px var(--secondary); }

        .poll-tool-btn { font-family: 'Space Grotesk'; font-weight: 700; font-size: 0.85rem; padding: 0 10px; width: auto; color: var(--primary); background: rgba(249, 115, 22, 0.1); border: 1px solid rgba(249, 115, 22, 0.2); }
        .poll-tool-btn:hover { background: var(--primary); color: white; }
        .quiz-tool-btn { color: var(--secondary); background: rgba(139, 92, 246, 0.1); border: 1px solid rgba(139, 92, 246, 0.2); }
        .quiz-tool-btn:hover { background: var(--secondary); color: white; }

        /* CUTE & SMALL LIVE BADGE */
        .student-live-badge {
            position: absolute; top: 10px; left: 10px;
            background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(8px);
            color: white; padding: 4px 10px; border-radius: 20px;
            font-family: 'Space Grotesk'; font-size: 0.7rem; font-weight: 700;
            display: flex; align-items: center; gap: 5px; z-index: 50;
            border: 1px solid rgba(255,255,255,0.15); box-shadow: 0 3px 10px rgba(0,0,0,0.2);
            letter-spacing: 0.5px;
        }
        .student-live-badge .dot {
            width: 6px; height: 6px; background: #ef4444; border-radius: 50%;
            box-shadow: 0 0 8px #ef4444; animation: blink 1.5s infinite;
        }
        @keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

        /* SIDEBAR */
        .sidebar-toggle { position: absolute; left: 0; top: 50%; transform: translateY(-50%); background: white; border: 1px solid var(--border-color); border-left: none; padding: 15px 5px; border-radius: 0 8px 8px 0; cursor: pointer; z-index: 90; box-shadow: 2px 0 10px rgba(0,0,0,0.05); color: #64748b; display: none;}
        .pages-sidebar { position: absolute; left: -100px; top: 0; bottom: 0; width: 90px; background: rgba(248, 250, 252, 0.95); backdrop-filter: blur(10px); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; align-items: center; padding: 15px 0; gap: 12px; overflow-y: auto; z-index: 80; transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 5px 0 15px rgba(0,0,0,0.05); scrollbar-width: none; }
        .pages-sidebar::-webkit-scrollbar { display: none; }
        .pages-sidebar.open { left: 0; }
        
        .page-thumb { width: 70px; height: 50px; background: white; border: 2px solid #cbd5e1; border-radius: 6px; cursor: pointer; transition: 0.2s; position: relative; overflow: hidden; display: flex; justify-content: center; align-items: center; flex-shrink: 0;}
        .page-thumb.active { border-color: var(--secondary); box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3); }
        .page-thumb img { width: 100%; height: 100%; object-fit: contain; }
        .page-num { position: absolute; bottom: 2px; left: 4px; font-size: 0.6rem; font-weight: bold; background: rgba(0,0,0,0.6); color: white; padding: 1px 4px; border-radius: 4px;}
        .add-slide-btn { width: 35px; height: 35px; border-radius: 50%; background: #e0e7ff; color: var(--secondary); border: none; font-size: 1rem; cursor: pointer; transition: 0.2s; flex-shrink: 0; margin-bottom: 20px;}
        .add-slide-btn:hover { background: var(--secondary); color: white; transform: scale(1.1); }

        /* CANVAS AREA & CURSORS (16:9 LOCKED) */
        .canvas-wrapper { flex: 1; position: relative; background: transparent; overflow: hidden; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; }
        .canvas-container { position: absolute !important; }
        
        .hide-native-cursor .canvas-container, .hide-native-cursor .upper-canvas { cursor: none !important; }
        #customCursor { position: fixed; pointer-events: none; z-index: 99999; transform: translate(-50%, -50%); border-radius: 50%; display: none; }
        .cursor-laser-style { width: 15px; height: 15px; background: #ef4444; box-shadow: 0 0 15px 5px rgba(239, 68, 68, 0.8), inset 0 0 5px white; border: none; }
        .cursor-eraser-style { border: 2px solid #cbd5e1; background: rgba(0,0,0,0.05); }

        #studentLaserDot { position: absolute; width: 15px; height: 15px; background: #ef4444; border-radius: 50%; box-shadow: 0 0 15px 5px rgba(239, 68, 68, 0.8), inset 0 0 5px white; pointer-events: none; display: none; z-index: 999; transform: translate(-50%, -50%); }

        /* CUTE TIMER UI */
        #quizTimerBox { position: absolute; top: 10px; right: 10px; background: var(--primary); color: white; padding: 4px 10px; border-radius: 20px; font-family: 'Space Grotesk'; font-size: 0.85rem; font-weight: 700; box-shadow: 0 4px 10px rgba(249,115,22,0.3); z-index: 900; display: none; align-items: center; gap: 6px; border: none; letter-spacing: 1px;}
        .end-early-btn { background: rgba(0,0,0,0.2); border: none; color: white; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: bold; cursor: pointer; margin-left: 5px; }
        .end-early-btn:hover { background: rgba(0,0,0,0.4); }

        /* FULL SCREEN BUTTON */
        .fullscreen-btn { position: absolute; bottom: 15px; right: 15px; width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: white; border: none; box-shadow: 0 5px 15px rgba(249,115,22,0.4); z-index: 900; font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
        .fullscreen-btn:hover { transform: scale(1.1); background: #ea580c; }

        /* PREMIUM FLOATING POLL UI (NOW INSIDE CANVAS WRAPPER) */
        .hotspot-container { position: absolute; bottom: 20px; left: 0; width: 100%; background: transparent; display: none; justify-content: center; align-items: center; padding: 15px; z-index: 10000; border: none; pointer-events: none; animation: slideUpBottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);}
        @keyframes slideUpBottom { from { transform: translateY(100%) scale(0.9); opacity: 0;} to { transform: translateY(0) scale(1); opacity: 1;} }
        
        .poll-options-row { display: flex; gap: 15px; justify-content: center; pointer-events: auto; flex-wrap: wrap; } 
        .hotspot-btn { 
            width: 70px; height: 70px; border-radius: 50%; 
            background: linear-gradient(135deg, #ffffff, #f8fafc); 
            border: 2px solid #cbd5e1; color: #0f172a; 
            font-family: 'Space Grotesk'; font-size: 1.8rem; font-weight: 800; 
            cursor: pointer; display: flex; align-items: center; justify-content: center; 
            box-shadow: 0 8px 25px rgba(0,0,0,0.1); transition: all 0.2s;
        }
        .hotspot-btn:hover:not(:disabled) { 
            transform: translateY(-3px); /* Subtle lift, no scale/zoom */
            box-shadow: 0 10px 25px rgba(249, 115, 22, 0.3); 
            color: white; background: var(--primary-grad); border-color: transparent; 
        }
        .hotspot-btn:disabled { cursor: not-allowed; opacity: 0.6; }

        /* ENHANCED BOTTOM CENTER POLL RESULT */
        .poll-result-overlay { 
            position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); 
            width: 90%; max-width: 450px; height: auto; 
            background: rgba(255,255,255,0.98); z-index: 10000; 
            display: none; flex-direction: column; justify-content: center; align-items: center; 
            border-radius: 16px; padding: 20px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.2); border: 1px solid var(--border-color);
            animation: slideUpBottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        [data-theme="dark"] .poll-result-overlay { background: rgba(15,23,42,0.98); border-color: var(--border-dark); }
        
        .close-poll-x { 
            position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; 
            border-radius: 50%; background: #f1f5f9; color: #64748b; 
            display: flex; justify-content: center; align-items: center; 
            font-size: 1rem; cursor: pointer; border: none; transition: 0.2s; 
        }
        .close-poll-x:hover { background: #e2e8f0; color: var(--danger); transform: scale(1.1); }
        
        .result-box { text-align: center; width: 100%; z-index: 10;}
        .graph-container { 
            display: flex; justify-content: space-around; align-items: flex-end; 
            height: 120px; margin: 15px 0 10px 0; border-bottom: 2px solid #cbd5e1; 
            padding-bottom: 5px; position: relative; width: 100%;
            background: repeating-linear-gradient(0deg, transparent, transparent 29px, rgba(226,232,240,0.3) 30px); background-size: 100% 30px; 
        }
        .bar-wrap { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; width: 45px; z-index: 2;}
        .bar-perc { font-size: 0.95rem; font-weight: 800; margin-bottom: 8px; color: var(--text-main); font-family: 'Space Grotesk'; }
        .bar-bg { width: 100%; height: 100%; position: relative; display: flex; align-items: flex-end; }
        .bar-fill { width: 100%; background: #3b82f6; height: 0%; transition: height 0.8s cubic-bezier(0.1, 0.9, 0.2, 1); border-radius: 4px 4px 0 0;} 
        .bar-fill.correct { background: var(--success); }
        .bar-label { margin-top: 10px; font-family: 'Space Grotesk'; font-weight: bold; font-size: 1.2rem; color: var(--text-main); }
        
        /* SETUPS (Quiz) */
        .poll-setup-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; padding: 25px; border-radius: 16px; box-shadow: 0 15px 40px rgba(0,0,0,0.2); border: 1px solid var(--border-color); z-index: 1000; display: none; flex-direction: column; align-items: stretch; width: 320px;}
        [data-theme="dark"] .poll-setup-overlay { background: var(--bg-panel); border-color: var(--border-dark); }
        .setup-input { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--border-dark); margin-bottom: 15px; font-family: 'Outfit'; font-size: 1rem; outline: none; background: transparent; color: var(--text-main);}
        .setup-input:focus { border-color: var(--secondary); box-shadow: 0 0 0 2px rgba(139,92,246,0.2); }

        /* LEADERBOARD OVERLAY */
        #leaderboardOverlay { display:none; position:fixed; top:0; left:0; width:100vw; height:100vh; background:rgba(15,23,42,0.9); z-index:999999; flex-direction:column; justify-content:center; align-items:center; backdrop-filter: blur(5px); }
        .lb-card { background:white; padding:40px; border-radius:20px; width:90%; max-width:450px; text-align:center; position:relative; box-shadow: 0 25px 50px rgba(0,0,0,0.25); border: 4px solid #f8fafc; }
        .lb-stats-grid { display:flex; justify-content:space-around; margin:30px 0; background:#f8fafc; padding:20px; border-radius:16px; border: 1px solid #e2e8f0; }
        .lb-stat-box { display:flex; flex-direction:column; align-items:center; }
        .lb-val { font-size:2.5rem; font-weight:bold; font-family:'Space Grotesk'; line-height:1; margin-bottom:5px; }
        .lb-lbl { color:#64748b; font-size:0.85rem; font-weight:600; text-transform:uppercase; letter-spacing:1px; }

        /* --- RIGHT PANE --- */
        .right-pane { width: 320px; display: flex; flex-direction: column; gap: 10px; z-index: 10;}

        /* VIDEO CAROUSEL */
        .video-wrapper { width: 100%; height: 220px; background: #000; border-radius: 12px; overflow: hidden; border: 1px solid var(--border-dark); box-shadow: 0 5px 15px rgba(0,0,0,0.2); flex-shrink: 0; position: relative;}
        .video-carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; height: 100%; width: 100%; scrollbar-width: none;}
        .video-carousel::-webkit-scrollbar { display: none; }
        .vid-container { min-width: 100%; height: 100%; scroll-snap-align: start; position: relative; background:#111; display: flex; justify-content: center; align-items: center;}
        
        /* INVERT LOCAL VIDEO FOR MIRROR EFFECT */
        #localVideo { transform: scaleX(-1); }

        .vid-container video { width: 100%; height: 100%; object-fit: cover; }
        .vid-avatar { position: absolute; width: 100%; height: 100%; background: #1e293b; color: white; display: flex; flex-direction: column; justify-content: center; align-items: center; font-size: 3.5rem; z-index: 2;}
        .vid-avatar i { margin-bottom: 10px; opacity: 0.5;}
        .vid-name-tag { position: absolute; bottom: 10px; left: 10px; background: rgba(0,0,0,0.6); color: white; padding: 4px 10px; border-radius: 6px; font-size: 0.8rem; font-weight: bold; pointer-events: none; z-index: 5;}

        .interaction-card { background: var(--bg-panel); border-radius: 12px; border: 1px solid var(--border-dark); flex: 1; display: flex; flex-direction: column; overflow: hidden; transition: background 0.3s;}
        
        /* TABS */
        .tabs-container { padding: 10px; background: var(--bg-panel); border-bottom: 1px solid var(--border-color); }
        .tabs-segmented { display: flex; background: #e2e8f0; border-radius: 8px; padding: 3px; }
        [data-theme="dark"] .tabs-segmented { background: #334155; }
        .tab-btn { flex: 1; padding: 6px 12px; border-radius: 6px; border: none; background: transparent; color: var(--text-muted); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: 0.2s; font-family: 'Space Grotesk'; }
        .tab-btn.active { background: white; color: var(--primary); box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
        [data-theme="dark"] .tab-btn.active { background: #1e293b; color: var(--primary); }

        .panel { flex: 1; display: none; flex-direction: column; overflow: hidden; height: 100%; width: 100%; }
        .panel.active { display: flex; }

        /* HIDDEN CHAT SCROLLBAR */
        .chat-messages { 
            flex: 1; padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; 
            background: var(--chat-bg); font-size: 0.9rem; transition: background 0.3s;
            scrollbar-width: none; /* Firefox */
            -ms-overflow-style: none;  /* IE and Edge */
        }
        .chat-messages::-webkit-scrollbar { display: none; } /* Chrome, Safari and Opera */

        .msg-bubble { max-width: 85%; padding: 8px 12px; border-radius: 12px; word-wrap: break-word; }
        .msg-bubble.mine { background: var(--primary); color: white; align-self: flex-end; border-bottom-right-radius: 2px; }
        .msg-bubble.theirs { background: var(--chat-theirs); color: var(--chat-theirs-txt); align-self: flex-start; border-bottom-left-radius: 2px; }
        
        .chat-input-area { padding: 10px; background: var(--bg-panel); border-top: 1px solid var(--border-dark); display: flex; gap: 8px; align-items: center; width: 100%; }
        .chat-input { flex: 1; min-width: 0; background: var(--input-bg); border: 1px solid var(--border-dark); padding: 8px 15px; border-radius: 20px; color: var(--text-dark); outline: none; font-size: 0.85rem; font-family: 'Outfit';}
        .chat-input:focus { border-color: var(--primary); }
        .send-msg-btn { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: white; border: none; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: 0.2s;}

        /* SLIM CONTROLS PANEL */
        .settings-panel { padding: 20px; display: flex; flex-direction: column; gap: 15px; height: 100%; justify-content: space-between;}
        .av-controls { display: flex; justify-content: center; gap: 15px; }
        .av-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: #e2e8f0; color: #475569; font-size: 1rem; cursor: pointer; transition: 0.2s;}
        [data-theme="dark"] .av-btn { background: #334155; color: #cbd5e1; }
        .av-btn:hover { background: #cbd5e1; transform: translateY(-2px);}
        [data-theme="dark"] .av-btn:hover { background: #475569; }
        .av-btn.off { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }

        .end-btn { width: 100%; padding: 10px; border: none; border-radius: 10px; font-size: 0.95rem; font-weight: 700; cursor: pointer; font-family: 'Outfit'; display: flex; justify-content: center; align-items: center; gap: 8px; transition: 0.2s; }
        .end-btn.danger { background: rgba(239,68,68,0.1); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
        .end-btn.danger:hover { background: var(--danger); color: white; transform: translateY(-2px);}
        .end-btn.gold { background: rgba(234,179,8,0.1); color: #ca8a04; border: 1px solid rgba(234,179,8,0.2); }
        .end-btn.gold:hover { background: #eab308; color: white; transform: translateY(-2px); }
        .end-btn.outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
        .end-btn.outline:hover { background: var(--primary); color: white; transform: translateY(-2px); }

        /* ================= MOBILE LAYOUT (ONLY APPLIES IN PORTRAIT) ================= */
        @media (max-width: 900px) and (orientation: portrait) {
            body { flex-direction: column; padding: 0; overflow-y: auto; overflow-x: hidden; height: 100vh; }
            .left-pane { border-radius: 0; border: none; flex: none; height: auto; min-height: unset; width: 100vw; height: 56.25vw; }
            
            /* FORCE 16:9 on Mobile */
            .canvas-wrapper { width: 100vw; height: 56.25vw; max-height: 50vh; aspect-ratio: 16/9; }
            
            .right-pane { width: 100vw; flex: 1; flex-direction: column; height: calc(100vh - 56.25vw); display: flex; }
            .interaction-card { flex: 1; border-radius: 0; border: none; }
            .wb-toolbar { overflow-x: auto; padding: 4px 5px; height: auto; flex-wrap: wrap;}

            /* FLOATING VIDEO DRAGGABLE */
            .video-wrapper {
                position: fixed;
                bottom: 80px; /* Above chat input */
                right: 15px;
                width: 120px;
                height: 180px;
                z-index: 9999;
                box-shadow: 0 10px 30px rgba(0,0,0,0.5);
                border-radius: 12px;
                cursor: grab;
                transition: transform 0.1s;
            }
            .video-wrapper:active { cursor: grabbing; transform: scale(1.05); }
            .video-carousel { flex-direction: column; overflow-y: auto; overflow-x: hidden; scroll-snap-type: y mandatory;}
            .vid-container { min-height: 50%; height: 50%; min-width: 100%; border-bottom: 1px solid #333; }
            
            .hotspot-btn { width: 60px; height: 60px; font-size: 1.5rem; }
            .student-live-badge { font-size: 0.65rem; padding: 4px 8px; }
        }

        /* ================= MOBILE LANDSCAPE (TIGHT LAPTOP FEEL) ================= */
        @media (max-width: 950px) and (orientation: landscape) {
            .right-pane { width: 250px; }
            .video-wrapper { height: 140px; position: relative; bottom: auto; right: auto; width: 100%; box-shadow: none; border-radius: 12px; } 
            .wb-toolbar { overflow-x: auto; padding: 4px 5px; height: auto; flex-wrap: nowrap;}
            .hotspot-btn { width: 50px; height: 50px; font-size: 1.2rem; }
        }
        