@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255,255,255,0.05);
  --glass-bg: rgba(255,255,255,0.06);
  --glass-border: rgba(255,255,255,0.1);
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #6b6b80;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-glow: rgba(139,92,246,0.3);
  --accent-gradient: linear-gradient(135deg, #8b5cf6, #ec4899);
  --success: #10b981;
  --error: #ef4444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: 250ms ease;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== LANDING PAGE ===== */
.landing-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 20% 50%, rgba(139,92,246,0.15) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 50%, rgba(236,72,153,0.1) 0%, transparent 50%),
              var(--bg-primary);
  position: relative;
}

.particles {
  position: fixed; inset:0; pointer-events: none; z-index:0;
}
.particle {
  position: absolute;
  width: 3px; height: 3px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.3;
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0% { transform: translateY(100vh) scale(0); opacity:0; }
  10% { opacity:0.4; }
  90% { opacity:0.4; }
  100% { transform: translateY(-10vh) scale(1); opacity:0; }
}

.landing-card {
  position: relative; z-index:1;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 90%;
  max-width: 440px;
  backdrop-filter: blur(20px);
  animation: fadeInUp 0.6s ease;
}
@keyframes fadeInUp {
  from { opacity:0; transform: translateY(30px); }
  to { opacity:1; transform: translateY(0); }
}

.logo { text-align: center; margin-bottom: 32px; }
.logo h1 {
  font-size: 28px; font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo p { color: var(--text-secondary); font-size: 14px; margin-top: 6px; }

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 8px;
}
.form-input {
  width: 100%; padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit; font-size: 15px;
  transition: border var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }

.btn {
  width: 100%; padding: 13px;
  border: none; border-radius: var(--radius-md);
  font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.btn-primary {
  background: var(--accent-gradient);
  color: white;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--accent-glow); }
.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); }

.divider {
  display: flex; align-items: center;
  margin: 28px 0; gap: 16px;
  color: var(--text-muted); font-size: 13px;
}
.divider::before, .divider::after {
  content:''; flex:1; height:1px;
  background: var(--glass-border);
}

.error-msg {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5; padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px;
  display: none;
}
.error-msg.show { display: block; }

.room-code-display {
  text-align: center; padding: 20px;
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: var(--radius-md);
  margin-bottom: 16px; display: none;
}
.room-code-display .code {
  font-size: 32px; font-weight: 700; letter-spacing: 6px;
  color: var(--accent);
}
.room-code-display p { color: var(--text-secondary); font-size: 13px; margin-top: 8px; }

/* ===== ROOM PAGE ===== */
.room-container {
  height: 100vh; display: flex; flex-direction: column;
  background: var(--bg-primary);
}

.room-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.room-header .room-info {
  display: flex; align-items: center; gap: 16px;
}
.room-header .room-code-badge {
  background: rgba(139,92,246,0.15);
  border: 1px solid rgba(139,92,246,0.3);
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--accent);
  cursor: pointer; transition: all var(--transition);
}
.room-header .room-code-badge:hover { background: rgba(139,92,246,0.25); }
.room-header .movie-title {
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
}
.room-header .users-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--success);
}
.room-header .users-badge .dot {
  width: 8px; height: 8px; background: var(--success);
  border-radius: 50%; animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; } 50% { opacity:0.4; }
}

.room-main {
  flex: 1; display: flex; overflow: hidden;
  min-height: 0;
}

/* Video Side */
.video-section {
  flex: 1; display: flex; flex-direction: column;
  background: #000; position: relative;
  min-width: 0;
}

.video-wrapper {
  flex: 1; position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer;
}
.video-wrapper video {
  width: 100%; height: 100%;
  object-fit: contain; background: #000;
}

/* Big play overlay */
.big-play-btn {
  position: absolute; z-index: 5;
  width: 80px; height: 80px;
  background: rgba(139,92,246,0.8);
  border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition);
}
.big-play-btn:hover { transform: scale(1.1); background: rgba(139,92,246,1); }
.big-play-btn svg { width: 32px; height: 32px; fill: white; margin-left: 4px; }
.big-play-btn.hidden { display: none; }

/* Skip buttons in controls bar */
.skip-ctrl-btn {
  position: relative;
}
.skip-ctrl-btn svg {
  width: 20px; height: 20px;
}
.skip-ctrl-label {
  position: absolute;
  font-size: 8px;
  font-weight: 700;
  color: white;
  pointer-events: none;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
/* Skip animation on press */
.skip-ctrl-btn.skip-animate-back svg {
  animation: skipRotateBack 0.4s ease;
}
.skip-ctrl-btn.skip-animate-fwd svg {
  animation: skipRotateFwd 0.4s ease;
}
@keyframes skipRotateBack {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(-40deg); }
  100% { transform: rotate(0deg); }
}
@keyframes skipRotateFwd {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(40deg); }
  100% { transform: rotate(0deg); }
}

/* Loading spinner */
.video-loading {
  position: absolute; inset: 0; z-index: 4;
  display: none; align-items: center; justify-content: center;
}
.video-loading.show { display: flex; }
.spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Custom Player Controls */
.player-controls {
  position: absolute; bottom: 0; left: 0; right: 0;
  z-index: 10;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  padding: 40px 16px 12px;
  transition: opacity 0.3s;
  opacity: 0;
}
@media (hover: hover) {
  .video-wrapper:hover .player-controls { opacity: 1; }
}
.player-controls.show { opacity: 1; }

.progress-container {
  position: relative; height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px; cursor: pointer;
  margin-bottom: 10px;
  transition: height 0.15s;
}
.progress-container:hover { height: 6px; }
.progress-buffer {
  position: absolute; top:0; left:0; height: 100%;
  background: rgba(255,255,255,0.2);
  border-radius: 2px; pointer-events: none;
}
.progress-filled {
  position: absolute; top:0; left:0; height: 100%;
  background: var(--accent);
  border-radius: 2px; pointer-events: none;
}
.progress-handle {
  position: absolute; top: 50%;
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s;
  pointer-events: none;
}
.progress-container:hover .progress-handle { transform: translate(-50%, -50%) scale(1); }

.controls-row {
  display: flex; align-items: center; gap: 12px;
}
.ctrl-btn {
  background: none; border: none;
  color: white; cursor: pointer;
  padding: 4px; display: flex; align-items: center; justify-content: center;
  opacity: 0.85; transition: opacity var(--transition);
}
.ctrl-btn:hover { opacity: 1; }
.ctrl-btn svg { width: 22px; height: 22px; }

.volume-group {
  display: flex; align-items: center; gap: 4px;
}
.volume-slider {
  width: 0; overflow: hidden;
  transition: width 0.2s;
  -webkit-appearance: none;
  height: 4px; background: rgba(255,255,255,0.3);
  border-radius: 2px; outline: none;
}
.volume-group:hover .volume-slider { width: 80px; }
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  background: white; border-radius: 50%;
  cursor: pointer;
}

.time-display {
  font-size: 12px; color: rgba(255,255,255,0.7);
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.controls-spacer { flex: 1; }

.speed-selector {
  position: relative;
}
.speed-menu {
  position: absolute; bottom: 36px; right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 6px 0; display: none;
  min-width: 100px;
}
.speed-menu.show { display: block; }
.speed-option {
  display: block; width: 100%;
  padding: 8px 16px;
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 13px; cursor: pointer;
  text-align: left;
}
.speed-option:hover { background: rgba(255,255,255,0.06); color: white; }
.speed-option.active { color: var(--accent); }

/* Auto-play Next Episode Toggle */
.auto-next-btn {
  position: relative;
  transition: all var(--transition);
}
.auto-next-btn svg {
  width: 18px !important;
  height: 18px !important;
}
.auto-next-btn.active {
  color: var(--accent) !important;
  opacity: 1 !important;
}
.auto-next-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

/* Movie Selector Bar */
.movie-bar {
  flex-shrink: 0;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--glass-border);
  display: flex; align-items: center; gap: 12px;
}
.movie-bar-label {
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  white-space: nowrap;
}
.movie-list-scroll {
  display: flex; gap: 8px; overflow-x: auto;
  scrollbar-width: none; flex: 1;
}
.movie-list-scroll::-webkit-scrollbar { display:none; }
.movie-chip {
  padding: 6px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 12px; color: var(--text-secondary);
  white-space: nowrap; cursor: pointer;
  transition: all var(--transition);
}
.movie-chip:hover { background: rgba(139,92,246,0.15); border-color: rgba(139,92,246,0.3); color: white; }
.movie-chip.active {
  background: rgba(139,92,246,0.2);
  border-color: var(--accent);
  color: var(--accent);
}

/* Folder group labels in movie bar */
.movie-bar-folder-label {
  font-size: 12px; font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  padding: 6px 10px;
  background: rgba(139,92,246,0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(139,92,246,0.2);
}
.movie-bar-separator {
  color: var(--glass-border);
  font-size: 14px;
  padding: 0 2px;
  user-select: none;
}

/* ===== CHAT PANEL ===== */
.chat-panel {
  width: 340px; flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--bg-secondary);
  border-left: 1px solid var(--glass-border);
  min-height: 0;
  overflow: hidden;
}
.chat-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.chat-header-left {
  display: flex; flex-direction: column; gap: 2px;
}
.chat-header h3 { font-size: 15px; font-weight: 600; }
.chat-subtitle {
  font-size: 11px;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.25s ease;
  height: 0;
  overflow: hidden;
}
.chat-subtitle.show {
  opacity: 1;
  height: auto;
}
.chat-toggle-btn {
  display: none;
  background: none; border: none;
  color: var(--text-secondary); cursor: pointer;
  font-size: 18px;
}

.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
  min-height: 0;
  overscroll-behavior: contain;
}

.chat-msg {
  max-width: 85%;
  animation: msgIn 0.25s ease;
}
@keyframes msgIn {
  from { opacity:0; transform: translateY(8px); }
  to { opacity:1; transform: translateY(0); }
}
.chat-msg.self { align-self: flex-end; }
.chat-msg.other { align-self: flex-start; }

.chat-msg .bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px; line-height: 1.4;
  word-break: break-word;
}
.chat-msg.self .bubble {
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-msg.other .bubble {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
.chat-msg .msg-meta {
  font-size: 11px; color: var(--text-muted);
  margin-top: 4px; padding: 0 4px;
  display: flex; align-items: center; gap: 4px;
}
.chat-msg.self .msg-meta { justify-content: flex-end; }

/* ===== Message Ticks (WhatsApp-style) ===== */
.msg-tick {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  vertical-align: middle;
  line-height: 1;
}
.msg-tick svg {
  width: 16px;
  height: 11px;
}
.tick-sent {
  color: rgba(255,255,255,0.45);
}
.tick-delivered {
  color: rgba(255,255,255,0.55);
}
.tick-read {
  color: #53bdeb;
}
/* Tick change animation */
.tick-animate {
  animation: tickPop 0.4s ease;
}
@keyframes tickPop {
  0% { transform: scale(0.5); opacity: 0.3; }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== Typing Indicator Bar (above input) ===== */
.typing-indicator-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-top: 1px solid rgba(255,255,255,0.04);
  background: rgba(139,92,246,0.05);
  animation: fadeIn 0.2s ease;
  flex-shrink: 0;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.typing-name {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}
.typing-dots {
  display: flex;
  align-items: center;
  gap: 3px;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.5;
  animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.chat-msg.system {
  align-self: center; max-width: 90%;
}
.chat-msg.system .bubble {
  background: rgba(139,92,246,0.1);
  color: var(--text-muted);
  font-size: 12px; text-align: center;
  border-radius: var(--radius-sm);
}

.chat-input-area {
  padding: 12px;
  border-top: 1px solid var(--glass-border);
  display: flex; gap: 8px;
  flex-shrink: 0;
}
.chat-input {
  flex: 1; padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-family: inherit; font-size: 14px;
  outline: none; transition: border var(--transition);
}
.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--text-muted); }
.chat-send-btn {
  width: 40px; height: 40px;
  background: var(--accent-gradient);
  border: none; border-radius: 50%;
  color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--transition);
  flex-shrink: 0;
}
.chat-send-btn:hover { transform: scale(1.08); }
.chat-send-btn svg { width: 18px; height: 18px; }

/* Emoji Picker */
.emoji-btn {
  background: none; border: none;
  font-size: 20px; cursor: pointer;
  padding: 4px; opacity: 0.6;
  transition: opacity var(--transition);
}
.emoji-btn:hover { opacity: 1; }
.emoji-picker {
  position: absolute; bottom: 60px; left: 12px; right: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px; display: none;
  flex-wrap: wrap; gap: 4px;
}
.emoji-picker.show { display: flex; }
.emoji-pick {
  background: none; border: none;
  font-size: 22px; cursor: pointer;
  padding: 4px; border-radius: 4px;
  transition: background 0.15s;
}
.emoji-pick:hover { background: rgba(255,255,255,0.1); }

/* No movie selected */
.no-movie {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-muted); gap: 12px;
  z-index: 3;
}
.no-movie svg { width: 64px; height: 64px; opacity: 0.3; }
.no-movie p { font-size: 15px; }

/* Mobile chat toggle */
.mobile-chat-btn {
  display: none;
  position: fixed; bottom: 20px; right: 20px;
  width: 56px; height: 56px;
  background: var(--accent-gradient);
  border: none; border-radius: 50%;
  color: white; font-size: 24px;
  cursor: pointer; z-index: 100;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.unread-dot {
  position: absolute; top: -2px; right: -2px;
  width: 14px; height: 14px;
  background: var(--error); border-radius: 50%;
  border: 2px solid var(--bg-primary);
  display: none;
}

/* Toast notification */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px);
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  padding: 12px 24px; border-radius: var(--radius-md);
  font-size: 14px; z-index: 1000;
  transition: transform 0.3s ease;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== REPLY BUBBLE STYLES ===== */
.reply-preview {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(139,92,246,0.08);
  border-top: 1px solid rgba(139,92,246,0.2);
  border-left: 3px solid var(--accent);
  animation: fadeIn 0.2s ease;
}
.reply-preview.show { display: flex; }
.reply-preview-content {
  flex: 1; min-width: 0;
}
.reply-preview-name {
  font-size: 11px; font-weight: 600; color: var(--accent);
  margin-bottom: 2px;
}
.reply-preview-text {
  font-size: 12px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reply-preview-close {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 18px; padding: 2px 6px;
  transition: color var(--transition);
  flex-shrink: 0;
}
.reply-preview-close:hover { color: var(--text-primary); }

/* Reply quote inside message bubble */
.reply-quote {
  background: rgba(0,0,0,0.15);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 6px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.reply-quote:hover { background: rgba(0,0,0,0.25); }
.chat-msg.other .reply-quote {
  background: rgba(255,255,255,0.06);
  border-left-color: rgba(139,92,246,0.6);
}
.chat-msg.other .reply-quote:hover { background: rgba(255,255,255,0.1); }
.reply-quote-name {
  font-size: 11px; font-weight: 600; color: var(--accent);
  margin-bottom: 2px;
}
.reply-quote-text {
  font-size: 12px; color: rgba(255,255,255,0.65);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 200px;
}
.chat-msg.other .reply-quote-text { color: var(--text-muted); }

/* Reply action button on messages */
.msg-reply-btn {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 14px; cursor: pointer;
  padding: 2px 4px;
  opacity: 0;
  transition: all 0.2s;
}
.chat-msg:hover .msg-reply-btn { opacity: 1; }
.msg-reply-btn:hover { color: var(--accent); }

/* Reply highlight animation */
@keyframes replyHighlight {
  0% { background: rgba(139,92,246,0.25); }
  100% { background: transparent; }
}
.msg-highlight {
  animation: replyHighlight 1.5s ease;
  border-radius: var(--radius-sm);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .landing-card { padding: 32px 24px; }

  /* ===== YOUTUBE-STYLE MOBILE LAYOUT ===== */
  /* Use position:fixed to prevent keyboard from pushing content */
  .room-container {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .room-header {
    padding: 8px 12px;
    flex-shrink: 0;
  }
  .room-header .room-info { gap: 8px; }
  .room-header .room-code-badge { padding: 4px 10px; font-size: 12px; }
  .room-header .movie-title { font-size: 12px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .room-main {
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
  }

  /* Video sticks to top, never shrinks or scrolls */
  .video-section {
    flex: none;
    flex-shrink: 0;
    width: 100%;
    position: relative;
    z-index: 10;
    overflow: hidden;
  }

  .video-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    flex: none;
    flex-shrink: 0;
  }

  /* Movie bar compact */
  .movie-bar {
    padding: 6px 10px;
    gap: 8px;
    flex-shrink: 0;
  }
  .movie-bar-label { font-size: 11px; }
  .movie-chip { font-size: 11px; padding: 4px 10px; }
  .movie-bar-folder-label { font-size: 11px; padding: 4px 8px; }

  /* Chat below video - always visible, fills remaining space */
  .chat-panel {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    flex: 1;
    display: flex !important;
    flex-direction: column;
    transform: none !important;
    z-index: 1;
    border-left: none;
    border-top: 1px solid var(--glass-border);
    min-height: 0;
    overflow: hidden;
  }

  .chat-header {
    padding: 8px 12px;
    flex-shrink: 0;
  }
  .chat-header h3 { font-size: 14px; }

  /* Hide the close button and mobile chat toggle (chat is always visible) */
  .chat-toggle-btn { display: none !important; }
  .mobile-chat-btn { display: none !important; }

  .chat-messages {
    flex: 1;
    padding: 10px;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .chat-msg .bubble {
    padding: 8px 12px;
    font-size: 13px;
  }

  /* Typing bar, reply preview, input area - never shrink */
  .typing-indicator-bar { flex-shrink: 0; }
  .reply-preview { flex-shrink: 0; }

  .chat-input-area {
    padding: 8px 10px;
    gap: 6px;
    flex-shrink: 0;
  }
  .chat-input {
    padding: 8px 12px;
    font-size: 13px;
  }
  .chat-send-btn {
    width: 36px; height: 36px;
  }
  .chat-send-btn svg { width: 16px; height: 16px; }

  .emoji-btn { font-size: 18px; }
  .emoji-picker { bottom: 52px; }

  .big-play-btn {
    width: 56px; height: 56px;
  }
  .big-play-btn svg {
    width: 24px; height: 24px;
  }

  /* Hide volume on mobile (use device volume) */
  .volume-group { display: none; }

  /* Compact controls */
  .player-controls { padding: 24px 10px 8px; }
  .controls-row { gap: 8px; }
  .ctrl-btn svg { width: 18px; height: 18px; }
  .time-display { font-size: 10px; }

  /* Reply preview compact */
  .reply-preview { padding: 8px 10px; }

  /* Reply button always visible on mobile (no hover) */
  .chat-msg .msg-reply-btn { opacity: 0.6; }

  /* Speed menu above controls on mobile */
  .speed-menu { bottom: 30px; }

  /* No-movie placeholder compact */
  .no-movie svg { width: 40px; height: 40px; }
  .no-movie p { font-size: 12px; }
}

/* Very small screens */
@media (max-width: 380px) {
  .room-header .movie-title { display: none; }
  .chat-msg .bubble { font-size: 12px; padding: 6px 10px; }
  .reply-quote-text { max-width: 140px; }
}
