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

:root {
  --primary: #667eea;
  --primary-dark: #5a6fd6;
  --secondary: #764ba2;
  --success: #4CAF50;
  --danger: #f44336;
  --bg-dark: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-input: #252540;
  --text: #ffffff;
  --text-muted: #8888aa;
  --border: #3a3a5c;
  --hamed-blue: #4a9eff;
  --lucia-pink: #ff6b9d;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Profile Picker Screen */
.profile-picker {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
  padding: 40px 20px;
}

.profile-title {
  font-size: 3.5rem;
  font-weight: 400;
  color: white;
  margin-bottom: 60px;
  text-align: center;
}

.profile-grid {
  display: flex;
  gap: 80px;
  justify-content: center;
  flex-wrap: wrap;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.profile-card:hover {
  transform: scale(1.05);
}

.profile-card:hover .profile-avatar {
  border-color: white;
}

.profile-avatar {
  width: 160px;
  height: 160px;
  border-radius: 12px;
  border: 4px solid transparent;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease;
  padding: 10px;
}

.profile-avatar.hamed {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
}

.profile-avatar.lucia {
  background: linear-gradient(135deg, #5a2d4a 0%, #8b4570 100%);
}

.profile-avatar .penguin {
  width: 100%;
  height: 100%;
}

.profile-name {
  margin-top: 16px;
  font-size: 1.4rem;
  color: #aaa;
  transition: color 0.2s ease;
}

.profile-card:hover .profile-name {
  color: white;
}

/* Landing Screen */
.landing-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 80px 20px;
  text-align: center;
}

.logo {
  margin-bottom: 48px;
}

.logo-icon {
  font-size: 72px;
  display: block;
  margin-bottom: 16px;
}

.logo h1 {
  font-size: 48px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.logo p {
  color: var(--text-muted);
  font-size: 18px;
}

.form-section {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.input-group {
  margin-bottom: 24px;
  text-align: left;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 14px;
}

.input-group input {
  width: 100%;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 16px;
  transition: border-color 0.2s;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-large {
  width: 100%;
  padding: 18px;
  font-size: 18px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-icon-only {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

.divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 14px;
}

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

.divider span {
  padding: 0 16px;
}

/* Active Parties List */
.active-parties {
  margin-top: 8px;
}

.party-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.party-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-input);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.party-item:hover {
  background: var(--border);
  transform: translateX(4px);
}

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

.party-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.party-item-name {
  font-weight: 600;
}

.party-item-status {
  font-size: 12px;
  color: var(--success);
}

.party-item-arrow {
  color: var(--text-muted);
  font-size: 20px;
}

.error-message {
  margin-top: 20px;
  padding: 12px 16px;
  background: rgba(244, 67, 54, 0.2);
  border: 1px solid var(--danger);
  border-radius: 8px;
  color: #ff6b6b;
  font-size: 14px;
}

/* Party Screen - 2 User Layout */
.party-layout-2user {
  display: grid;
  grid-template-columns: 1fr 320px;
  height: 100vh;
}

.main-content {
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
}

.party-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.party-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 18px;
}

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

.btn-share {
  background: var(--primary);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.btn-share:hover {
  background: var(--primary-dark);
  transform: scale(1.02);
}

.btn-share.copied {
  background: var(--success);
}

.btn-photo {
  background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-photo:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

/* Photo flash effect */
.photo-flash {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  z-index: 99999;
  animation: flash 0.5s ease-out forwards;
  pointer-events: none;
}

@keyframes flash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* Photo countdown */
.photo-countdown {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 150px;
  font-weight: bold;
  color: white;
  text-shadow: 0 0 40px rgba(255, 107, 157, 0.8), 0 0 80px rgba(255, 107, 157, 0.5);
  z-index: 99998;
  animation: countdown-pop 1s ease-out forwards;
  pointer-events: none;
}

@keyframes countdown-pop {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* Browser-style URL Bar */
.browser-url-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 20px 0;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.browser-url-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.url-bar-icon {
  font-size: 14px;
  opacity: 0.7;
}

.url-bar-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.url-bar-input::placeholder {
  color: var(--text-muted);
}

.url-bar-go {
  background: var(--primary);
  border: none;
  color: white;
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.url-bar-go:hover {
  background: var(--primary-dark);
}

/* Movie Search Results Dropdown */
.browser-url-bar {
  position: relative;
}

.search-results,
.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid var(--border);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--bg-input);
}

.search-result-poster {
  width: 45px;
  height: 68px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-input);
}

.search-result-poster.no-poster {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-year {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.search-result-rating {
  font-size: 12px;
  color: #ffd700;
  margin-top: 4px;
}

.search-loading {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
}

.search-no-results {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
}

.search-section-header {
  padding: 10px 12px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}

.search-result-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.search-result-badge.pluto {
  background: linear-gradient(135deg, #00d4aa, #00a885);
  color: white;
}

.search-result-badge.youtube {
  background: #ff0000;
  color: white;
}

.logo-small {
  font-size: 24px;
}

.party-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-badge {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--bg-input);
}

.status-badge.online {
  color: var(--success);
}

.partner-badge {
  font-size: 13px;
  color: var(--text-muted);
}

.partner-badge.joined {
  color: var(--success);
  font-weight: 600;
}

/* Video Wrapper */
.video-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
  min-height: 0;
}

.video-container {
  flex: 1;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  min-height: 400px;
}

.theater-mode-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 20px;
  cursor: pointer;
  z-index: 100;
  transition: background 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theater-mode-btn:hover {
  background: rgba(102, 126, 234, 0.8);
  transform: scale(1.1);
}

/* Theater chat input - hidden by default */
.theater-chat-input {
  display: none;
}

/* Theater Mode - Immersive View */
.theater-mode {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 10000 !important;
  background: #000 !important;
  display: block !important;
}

.theater-mode .main-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.theater-mode .party-header {
  display: none;
}

.theater-mode .browser-url-bar {
  display: none;
}

.theater-mode .video-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0;
}

.theater-mode .video-container {
  border-radius: 0;
  min-height: 100%;
  height: 100%;
}

/* Sidebar becomes floating overlay in theater mode */
.theater-mode .sidebar-2user {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 300px;
  height: auto;
  max-height: 400px;
  background: rgba(26, 26, 46, 0.9);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.theater-mode .video-call-panel {
  flex: none;
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.theater-mode .video-tiles {
  flex-direction: row;
  gap: 8px;
}

.theater-mode .video-tile-wrapper {
  flex: 1;
}

.theater-mode .emoji-bar {
  display: none;
}

.theater-mode .gif-picker {
  display: none !important;
}

/* Theater mode - simplified sidebar with just videos + chat input */
.theater-mode .sidebar-2user {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: auto;
  height: auto;
  max-height: none;
  background: transparent;
  border-radius: 0;
  border: none;
  backdrop-filter: none;
  box-shadow: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.theater-mode .video-call-panel {
  flex: none;
  padding: 0;
  border-bottom: none;
  background: transparent;
}

.theater-mode .video-tiles {
  flex-direction: row;
  gap: 12px;
}

.theater-mode .video-tile-wrapper {
  flex: none;
}

.theater-mode .video-tile {
  width: 160px;
  height: 120px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.theater-mode .video-tile-footer,
.theater-mode .video-label {
  display: none;
}

.theater-mode .chat-panel {
  display: none;
}

/* Floating chat input in theater mode */
.theater-mode .theater-chat-input {
  display: flex;
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 30px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.theater-mode .theater-chat-input:hover,
.theater-mode .video-container:hover ~ .theater-chat-input,
.theater-mode:hover .theater-chat-input {
  opacity: 1;
  pointer-events: auto;
}

/* Show chat input when mouse is near bottom of screen in theater mode */
.theater-mode::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  pointer-events: none;
  z-index: 99;
}

.theater-mode:has(.theater-chat-input:hover) .theater-chat-input,
.theater-mode .theater-chat-input:focus-within {
  opacity: 1;
  pointer-events: auto;
}

.theater-mode .theater-chat-input input {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  font-size: 14px;
  outline: none;
}

.theater-mode .theater-chat-input input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.theater-mode .theater-chat-input button {
  background: var(--primary);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
}

.theater-mode .theater-mode-btn {
  bottom: 80px;
  left: auto;
  right: 20px;
  background: rgba(244, 67, 54, 0.9);
  width: 50px;
  height: 50px;
  font-size: 24px;
}

.theater-mode .theater-mode-btn:hover {
  background: rgba(244, 67, 54, 1);
}

#youtube-container {
  width: 100%;
  height: 100%;
  position: relative;
}

#youtube-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.hls-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
  overflow-y: auto;
  padding: 20px;
}

.placeholder-content {
  text-align: center;
  color: var(--text-muted);
  width: 100%;
  max-width: 800px;
}

.embed-hint {
  font-size: 12px;
  margin-top: 8px;
  opacity: 0.7;
}

.embed-hint strong {
  color: var(--primary);
}

.placeholder-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.5;
}

.placeholder-content p {
  font-size: 18px;
  margin-bottom: 24px;
}

/* Video Suggestions */
.video-suggestions {
  margin-top: 16px;
  position: relative;
  z-index: 10;
}

.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.video-card {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  pointer-events: auto;
  position: relative;
  z-index: 20;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.video-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  pointer-events: none;
}

.video-card-title {
  padding: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

@media (max-width: 900px) {
  .suggestion-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.video-url-bar {
  display: flex;
  gap: 12px;
}

.url-input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 15px;
}

.url-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Sidebar - 2 User */
.sidebar-2user {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  height: 100vh;
  overflow: hidden;
}

.participants-panel {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.participants-panel .panel-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.participants-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.participant-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: var(--bg-input);
  border-radius: 4px;
  font-size: 13px;
}

.participant-name {
  color: var(--text);
}

.btn-kick {
  background: var(--danger);
  color: white;
  border: none;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-kick:hover {
  background: #c0392b;
}

.video-call-panel {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.video-tiles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.video-tile-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.video-tile {
  width: 100%;
  flex: 1;
  min-height: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #252540 100%);
  border-radius: 10px;
  overflow: hidden;
}

.video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 12px;
}

.video-tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.video-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
  margin-top: 6px;
}

.video-tile-footer .video-label {
  margin-top: 0;
}

.call-controls-mini {
  display: flex;
  gap: 4px;
}

.btn-control-mini {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-control-mini:hover {
  background: var(--border);
}

.btn-control-mini.active {
  background: var(--success);
}

/* Chat Panel */
.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  max-height: 50%;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  min-height: 0;
  scroll-behavior: smooth;
}

.chat-message {
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: 12px;
}

.chat-message .username {
  font-weight: 600;
  color: var(--primary);
  font-size: 12px;
  display: block;
  margin-bottom: 4px;
}

.chat-message .text {
  color: var(--text);
  font-size: 14px;
  word-break: break-word;
}

/* Emoji Bar */
.emoji-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.emoji-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--bg-input);
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.emoji-btn:hover {
  transform: scale(1.2);
  background: var(--border);
}

.emoji-btn:active {
  transform: scale(0.9);
}

/* GIF Picker */
.gif-picker {
  border-bottom: 1px solid var(--border);
  background: var(--bg-input);
  max-height: 250px;
  display: flex;
  flex-direction: column;
}

.gif-picker.hidden {
  display: none;
}

.gif-search {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.gif-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-dark);
  color: var(--text);
  font-size: 13px;
}

.gif-search input:focus {
  outline: none;
  border-color: var(--primary);
}

.gif-grid {
  display: flex;
  flex-direction: row;
  gap: 8px;
  padding: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
}

.gif-item {
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  width: 120px;
  height: 90px;
  background: var(--bg-dark);
  transition: transform 0.2s, box-shadow 0.2s;
}

.gif-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.gif-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gif-powered {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  padding: 4px;
  background: var(--bg-dark);
}

.btn-gif {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-gif:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-gif.active {
  background: var(--primary);
  color: white;
}

/* Chat message with GIF */
.chat-message .gif-image {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 4px;
}

/* Emoji Animation Container */
#emoji-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

/* Fullscreen overlay for floating elements */
.fullscreen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2147483647;
  overflow: hidden;
}

.floating-emoji {
  position: absolute;
  font-size: 48px;
  animation: float-up 2s ease-out forwards;
  pointer-events: none;
}

@keyframes float-up {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateY(-150px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-300px) scale(0.8);
  }
}

.floating-chat {
  position: fixed;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 15px;
  max-width: 80%;
  text-align: center;
  animation: chat-fade 4s ease-out forwards;
  pointer-events: none;
  z-index: 100;
  backdrop-filter: blur(8px);
}

/* Fullscreen-specific styles */
.fullscreen-overlay .floating-chat {
  position: absolute;
  font-size: 18px;
  padding: 12px 24px;
}

.fullscreen-overlay .floating-emoji {
  font-size: 64px;
}

.floating-chat-user {
  font-weight: 600;
  color: var(--primary);
}

@keyframes chat-fade {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  10% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  80% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
}

@keyframes float-up {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateY(-150px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-300px) scale(0.8);
  }
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.chat-input-row input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 24px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
}

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

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* Responsive */
@media (max-width: 800px) {
  .party-layout-2user {
    grid-template-columns: 1fr;
  }
  
  .sidebar-2user {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50vh;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

/* Cloud Browser (Hyperbeam) */
.cloud-browser-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 15px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cloud-browser-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.hyperbeam-container {
  width: 100%;
  height: 100%;
  min-height: 400px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.hyperbeam-container.hidden {
  display: none;
}

.close-cloud-browser-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 0, 0, 0.8);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  z-index: 100;
  transition: background 0.2s;
}

.close-cloud-browser-btn:hover {
  background: rgba(255, 0, 0, 1);
}

.close-cloud-browser-btn.hidden {
  display: none;
}
