/* ==========================================================================
   ScreenShare Hub - Dark Obsidian Glassmorphic Styling & Animations
   ========================================================================== */

:root {
  --bg-main: #090a0f;
  --bg-card: rgba(16, 18, 28, 0.75);
  --bg-card-hover: rgba(24, 27, 44, 0.85);
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-glass-bright: rgba(255, 255, 255, 0.2);
  
  --accent-indigo: #6366f1;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  
  --glow-indigo: rgba(99, 102, 241, 0.35);
  --glow-cyan: rgba(6, 182, 212, 0.35);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Glowing Background Orbs */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.45;
  animation: orbFloat 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-indigo);
  top: -100px;
  left: -100px;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: var(--accent-cyan);
  bottom: -150px;
  right: -100px;
  animation-delay: -6s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: #8b5cf6;
  top: 40%;
  left: 40%;
  animation-delay: -12s;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 80px) scale(0.95); }
}

/* App Container Layout */
.app-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.glass-pill {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 100px;
}

/* Views Section */
.view-section {
  display: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.view-section.active {
  display: flex;
  opacity: 1;
  flex-direction: column;
}

/* ==========================================================================
   LOBBY VIEW STYLING
   ========================================================================== */

#lobby-view {
  min-height: 100vh;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

.lobby-header {
  text-align: center;
  margin-bottom: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.brand-icon {
  position: relative;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  box-shadow: 0 0 25px var(--glow-indigo);
}

.pulse-ring {
  position: absolute;
  inset: -4px;
  border-radius: 20px;
  border: 2px solid var(--accent-cyan);
  opacity: 0;
  animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}

.brand h1 {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.brand h1 span {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  color: var(--text-muted);
  font-size: 1.05rem;
  font-weight: 400;
}

.lobby-card {
  width: 100%;
  max-width: 480px;
  padding: 32px;
}

/* Tabs */
.tab-nav {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 28px;
  border: 1px solid var(--border-glass);
}

.tab-btn {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(6, 182, 212, 0.3));
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass-bright);
}

/* Forms */
.tab-content {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.tab-content.active {
  display: flex;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-group input:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 15px var(--glow-indigo);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.toggle-pwd {
  position: absolute;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  transition: color var(--transition-fast);
}

.toggle-pwd:hover {
  color: var(--text-main);
}

.input-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin-top: 2px;
}

.info-card.audio-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  color: #e0f2fe;
  font-size: 0.85rem;
}

.audio-info .info-icon {
  color: var(--accent-cyan);
  font-size: 1.2rem;
  margin-top: 2px;
}

.audio-info strong {
  color: var(--accent-cyan);
  display: block;
  margin-bottom: 2px;
}

.error-banner {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fecdd3;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
}

.error-banner.hidden {
  display: none;
}

/* Buttons */
.primary-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all var(--transition-fast);
  box-shadow: 0 10px 25px var(--glow-indigo);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px var(--glow-indigo);
}

.primary-btn.create-theme {
  background: linear-gradient(135deg, #8b5cf6, var(--accent-indigo));
}

/* ==========================================================================
   ROOM VIEW STYLING
   ========================================================================== */

#room-view {
  height: 100vh;
  padding: 16px;
  gap: 16px;
}

/* Room Navbar */
.room-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  gap: 16px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.room-title-badge {
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-icon {
  font-size: 1.3rem;
  color: var(--accent-rose);
  animation: pulseBeat 1.8s infinite;
}

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

.room-title-badge h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.code-pill {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
}

/* 20s Passcode Widget */
.passcode-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 18px;
}

.timer-ring-container {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 3.5;
}

.circle-progress {
  fill: none;
  stroke: var(--accent-cyan);
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dasharray 1s linear, stroke var(--transition-fast);
}

#timer-text {
  position: absolute;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.passcode-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.code-val {
  font-family: 'Courier New', monospace;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-emerald);
  letter-spacing: 2px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.primary-pill-btn {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  border: none;
  color: #fff;
  padding: 6px 14px;
  border-radius: 100px;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.primary-pill-btn:hover {
  transform: scale(1.04);
}

.danger-btn {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fecdd3;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.danger-btn:hover {
  background: rgba(244, 63, 94, 0.3);
  color: #fff;
}

/* ==========================================================================
   ROOM GRID & VIEWPORT
   ========================================================================== */

.room-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  min-height: 0;
}

/* Viewport Section */
.viewport-section {
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.viewport-container {
  flex: 1;
  position: relative;
  background: #040508;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-glass);
}

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

.local-pip {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 220px;
  height: 140px;
  border-radius: var(--radius-md);
  border: 2px solid var(--accent-indigo);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 10;
  object-fit: cover;
}

.local-pip.hidden {
  display: none;
}

/* Audio Canvas Spectrum Visualizer Overlay */
.audio-canvas {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  pointer-events: none;
  z-index: 5;
  opacity: 0.85;
}

/* Floating Emoji Layer */
.emoji-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  overflow: hidden;
}

.floating-emoji {
  position: absolute;
  bottom: 20px;
  font-size: 2.5rem;
  animation: floatUpEmoji 3s ease-out forwards;
}

@keyframes floatUpEmoji {
  0% {
    transform: translateY(0) scale(0.6) rotate(0deg);
    opacity: 1;
  }
  70% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(-400px) scale(1.3) rotate(15deg);
    opacity: 0;
  }
}

/* Stream Placeholder */
.stream-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(circle at center, rgba(30, 35, 60, 0.6) 0%, rgba(5, 6, 12, 0.95) 100%);
  padding: 20px;
  z-index: 4;
}

.stream-placeholder.hidden {
  display: none;
}

.placeholder-icon {
  width: 90px;
  height: 90px;
  margin: 0 auto 20px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid var(--accent-indigo);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--accent-cyan);
  box-shadow: 0 0 40px var(--glow-indigo);
}

.placeholder-content h3 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.placeholder-content p {
  color: var(--text-muted);
  max-width: 440px;
  margin: 0 auto 20px;
  font-size: 0.98rem;
  line-height: 1.5;
}

.audio-tip-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Streamer Active Badge */
.streamer-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  z-index: 10;
}

.streamer-badge.hidden {
  display: none;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-emerald);
}

.audio-badge {
  font-size: 0.75rem;
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 4px;
}

/* Floating Bottom Control Bar */
.control-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 24px;
  align-self: center;
}

.ctrl-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.ctrl-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.ctrl-btn.btn-primary-glow {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  border: none;
  color: #fff;
  box-shadow: 0 6px 20px var(--glow-indigo);
}

.ctrl-btn.btn-stop-glow {
  background: linear-gradient(135deg, var(--accent-rose), #e11d48);
  border: none;
  color: #fff;
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4);
}

.ctrl-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.v-divider {
  width: 1px;
  height: 24px;
  background: var(--border-glass);
}

.reaction-bar {
  display: flex;
  gap: 6px;
}

.reaction-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.reaction-btn:hover {
  transform: scale(1.25);
  background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   SIDEBAR STYLING (CHAT & PEERS)
   ========================================================================== */

.sidebar-section {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-glass);
}

.sb-tab-btn {
  flex: 1;
  padding: 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.sb-tab-btn:hover {
  color: var(--text-main);
}

.sb-tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.05);
}

.badge {
  background: var(--accent-rose);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
}

.badge.hidden {
  display: none;
}

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

.sb-content.active {
  display: flex;
}

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

.chat-system-msg {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

.chat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 90%;
}

.chat-item.self {
  align-self: flex-end;
}

.chat-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.chat-item.self .chat-meta {
  justify-content: flex-end;
}

.chat-author {
  font-weight: 600;
  color: var(--accent-cyan);
}

.chat-bubble {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
}

.chat-item.self .chat-bubble {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(6, 182, 212, 0.4));
  border-color: rgba(99, 102, 241, 0.5);
  color: #fff;
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.2);
}

.chat-input-area input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
}

.chat-input-area input:focus {
  border-color: var(--accent-cyan);
}

.chat-send-btn {
  background: var(--accent-indigo);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.chat-send-btn:hover {
  background: var(--accent-cyan);
}

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

.peer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 12px 14px;
  border-radius: var(--radius-md);
}

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

.peer-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.peer-details {
  display: flex;
  flex-direction: column;
}

.peer-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.peer-role {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(16, 18, 28, 0.9);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass-bright);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease-out forwards;
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 900px) {
  .room-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 300px;
  }
  .room-navbar {
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   SCREEN SHARE ANNOTATION & WHITEBOARD OVERLAY STYLING
   ========================================================================== */

.annotation-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 12;
  pointer-events: none;
  touch-action: none;
}

.annotation-canvas.active {
  pointer-events: auto;
}

/* Dynamic Tool Cursors */
.annotation-canvas.cursor-pen {
  cursor: crosshair;
}
.annotation-canvas.cursor-highlighter {
  cursor: cell;
}
.annotation-canvas.cursor-laser {
  cursor: none;
}
.annotation-canvas.cursor-eraser {
  cursor: grab;
}
.annotation-canvas.cursor-arrow {
  cursor: pointer;
}

/* Floating Glassmorphic Annotation Toolbar */
.annotation-toolbar {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 100px;
  background: rgba(12, 14, 24, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass-bright);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 20px var(--glow-cyan);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  user-select: none;
}

.annotation-toolbar.hidden {
  display: none !important;
}

.toolbar-drag-handle {
  color: var(--text-dim);
  cursor: grab;
  padding: 4px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-drag-handle:hover {
  color: var(--text-muted);
}

.tool-group, .color-group, .stroke-group, .action-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-divider {
  width: 1px;
  height: 22px;
  background: var(--border-glass-bright);
  margin: 0 2px;
}

/* Tool Buttons */
.tool-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  transition: all var(--transition-fast);
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.tool-btn.active {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 12px var(--glow-cyan);
}

.danger-tool:hover {
  background: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
}

.close-tool:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

/* Color Swatches */
.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.color-swatch:hover {
  transform: scale(1.2);
}

.color-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  transform: scale(1.18);
}

/* Stroke Buttons */
.stroke-btn {
  background: transparent;
  border: 1px solid transparent;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.stroke-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.stroke-btn.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-cyan);
}

.stroke-btn .dot {
  background: var(--text-main);
  border-radius: 50%;
  display: inline-block;
}

.stroke-btn .dot-sm { width: 4px; height: 4px; }
.stroke-btn .dot-md { width: 7px; height: 7px; }
.stroke-btn .dot-lg { width: 11px; height: 11px; }

/* Control bar annotate button active state */
#btn-toggle-annotate.active {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  color: #fff;
  box-shadow: 0 0 15px var(--glow-cyan);
}

