/* ==========================================================================
   WatchTogether — Modern Dark Minimalist Theme with Inter font
   ========================================================================== */

:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Color Palette */
  --bg-darkest: #09090b;
  --bg-card: #121215;
  --bg-card-hover: #18181c;
  --bg-input: #1a1a20;
  --bg-glass: rgba(18, 18, 22, 0.75);
  
  --border-subtle: #22222a;
  --border-light: #2d2d38;
  --border-focus: #4f46e5;
  
  --text-main: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-yellow: #f59e0b;
  
  --telegram-blue: #229ed9;
  --telegram-hover: #1b87ba;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
}

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

body.dark-theme {
  font-family: var(--font-family);
  background-color: var(--bg-darkest);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================================================
   Header Navigation
   ========================================================================== */
.app-header {
  height: 64px;
  background-color: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 26px;
  height: 26px;
  color: var(--primary);
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.brand-name span {
  color: var(--primary);
}

.room-nav-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

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

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-card-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 30px;
}

.user-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border-light);
}

.user-meta-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.badge-tg {
  display: inline-flex;
  align-items: center;
  color: var(--telegram-blue);
  margin-left: 4px;
}

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-family);
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-glow);
}

.btn-glow {
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-light);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-main);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
}

.btn-telegram {
  background: var(--telegram-blue);
  color: #fff;
}
.btn-telegram:hover {
  background: var(--telegram-hover);
  box-shadow: 0 0 15px rgba(34, 158, 217, 0.4);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Home View: Hero & Code Input
   ========================================================================== */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.home-hero {
  max-width: 960px;
  margin: 60px auto;
  padding: 0 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--primary);
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-bottom: 18px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 650px;
  line-height: 1.6;
  margin-bottom: 40px;
}

/* Room Input Card */
.room-enter-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  margin-bottom: 60px;
  backdrop-filter: blur(8px);
}

.input-code-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0 16px;
  margin-bottom: 18px;
  transition: var(--transition);
}

.input-code-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-prefix {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  user-select: none;
}

.room-code-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-family);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  padding: 14px 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.room-code-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: normal;
}

.room-buttons-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  width: 100%;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: left;
  transition: var(--transition);
}

.feature-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.feature-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.feature-icon-wrap svg {
  width: 22px;
  height: 22px;
}

.icon-purple { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.icon-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.icon-cyan { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.icon-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Room View Layout
   ========================================================================== */
.room-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
}

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

.room-code-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.room-code-tag:hover {
  border-color: var(--primary);
  background: #202029;
}

.tag-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.tag-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.05em;
}

.copy-icon {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
}

.sync-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #34d399;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

.sync-status-indicator.drifted {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}
.sync-status-indicator.drifted .sync-dot {
  background: var(--accent-yellow);
  box-shadow: 0 0 6px var(--accent-yellow);
}

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

/* Two Columns: Video Player + Sidebar */
.room-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1px;
  background: var(--border-subtle);
  overflow: hidden;
}

.player-column {
  background: var(--bg-darkest);
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  overflow-y: auto;
}

/* Video URL Input */
.video-input-card {
  margin-bottom: 16px;
}

.url-input-container {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 6px 6px 14px;
  gap: 10px;
  transition: var(--transition);
}

.url-input-container:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.url-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.video-url-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-family);
  font-size: 0.92rem;
  color: var(--text-main);
}

.quick-links-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.url-hint-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

.url-hint-text strong {
  color: var(--text-secondary);
}

.quick-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.chip-link {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.chip-link:hover {
  border-color: var(--primary);
  color: var(--text-main);
}

/* Player Wrapper & Container */
.player-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-container {
  width: 100%;
  height: 100%;
}

.player-container iframe,
.player-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.player-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

.placeholder-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--text-muted);
}

.placeholder-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.placeholder-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 320px;
}

/* Floating Reactions Overlay */
.reactions-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 20;
}

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

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.6);
  }
  50% {
    opacity: 0.9;
    transform: translateY(-120px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-240px) scale(0.9);
  }
}

/* ==========================================================================
   Custom Unified Player Controls Bar
   ========================================================================== */
.custom-controls-bar {
  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: 24px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 1;
  transition: opacity 0.3s ease;
  z-index: 30;
}

.player-wrapper:hover .custom-controls-bar {
  opacity: 1;
}

/* Timeline */
.timeline-container {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  cursor: pointer;
  transition: height 0.15s ease;
}

.timeline-container:hover {
  height: 10px;
}

.timeline-buffered {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  width: 0%;
}

.timeline-played {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--primary);
  border-radius: 3px;
  width: 0%;
}

.timeline-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s ease;
  box-shadow: 0 0 6px rgba(0,0,0,0.5);
}

.timeline-container:hover .timeline-handle {
  transform: translate(-50%, -50%) scale(1);
}

.timeline-tooltip {
  position: absolute;
  top: -30px;
  left: 0%;
  transform: translateX(-50%);
  background: rgba(18, 18, 22, 0.95);
  border: 1px solid var(--border-light);
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  display: none;
  pointer-events: none;
}

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

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

.ctrl-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  transition: var(--transition);
}

.ctrl-btn:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.1);
}

.ctrl-btn svg {
  width: 20px;
  height: 20px;
}

.ctrl-btn-text {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.ctrl-btn-text:hover {
  background: var(--primary);
  border-color: var(--primary);
}
.ctrl-btn-text svg {
  width: 14px;
  height: 14px;
}

.time-display {
  font-size: 0.85rem;
  font-weight: 500;
  color: #e4e4e7;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.time-divider {
  color: var(--text-muted);
}

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

.volume-slider {
  width: 70px;
  height: 4px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

/* Dropdowns in Controls */
.custom-dropdown {
  position: relative;
}

.dropdown-trigger {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.dropdown-trigger svg {
  width: 12px;
  height: 12px;
}

.dropdown-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: #18181b;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px;
  min-width: 120px;
  box-shadow: var(--shadow-card);
  z-index: 50;
  max-height: 180px;
  overflow-y: auto;
}

.dropdown-item {
  padding: 6px 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.dropdown-item:hover, .dropdown-item.active {
  background: var(--primary);
  color: #fff;
}

/* Video Meta Card */
.video-meta-card {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.video-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.video-badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-type {
  padding: 3px 8px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Sidebar: Chat & Participants
   ========================================================================== */
.room-sidebar {
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-darkest);
}

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

.tab-btn svg {
  width: 16px;
  height: 16px;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--bg-card);
}

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

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

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

.chat-msg {
  display: flex;
  gap: 10px;
}

.chat-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border-light);
}

.chat-msg-body {
  flex: 1;
}

.chat-msg-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 3px;
}

.chat-msg-author {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
}

.chat-msg-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.chat-msg-bubble {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.45;
  color: #f4f4f5;
  word-break: break-word;
}

.chat-msg.self .chat-msg-bubble {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
}

.chat-system-msg {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: 12px;
  align-self: center;
  max-width: 90%;
}

/* Reactions Bar */
.quick-reactions-bar {
  display: flex;
  justify-content: space-around;
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.btn-emoji {
  background: transparent;
  border: none;
  font-size: 1.35rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: transform 0.15s ease;
}

.btn-emoji:hover {
  transform: scale(1.3);
  background: rgba(255, 255, 255, 0.08);
}

/* Chat Input Form */
.chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font-family);
  font-size: 0.88rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.chat-input:focus {
  border-color: var(--primary);
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

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

.chat-send-btn svg {
  width: 18px;
  height: 18px;
}

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

.participant-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.participant-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.participant-info {
  flex: 1;
}

.participant-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.participant-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.badge-host {
  padding: 1px 6px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
}

/* ==========================================================================
   Auth Modal
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background: #18181b;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.tg-icon {
  width: 20px;
  height: 20px;
}

.modal-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.modal-divider::before, .modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.modal-divider span {
  padding: 0 10px;
}

.guest-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guest-input {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font-family);
  font-size: 0.92rem;
  color: var(--text-main);
  outline: none;
}

.guest-input:focus {
  border-color: var(--primary);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}

.toast {
  background: #1e1e24;
  border: 1px solid var(--border-light);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-card);
  animation: slideIn 0.25s ease forwards;
}

.toast.toast-error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

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

/* Utilities */
.hidden {
  display: none !important;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
  .room-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 360px;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 2.1rem;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .room-buttons-row {
    grid-template-columns: 1fr;
  }
  .controls-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .volume-slider {
    width: 50px;
  }
}
