/* ========================================
   Co-viewing — Main Stylesheet
   Dark theme, Netflix-inspired design
   ======================================== */

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #16213e;
  --bg-elevated: #1e1e32;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --text-white: #ffffff;
  --accent: #6c5ce7;
  --accent-hover: #7c6ef7;
  --accent-glow: rgba(108, 92, 231, 0.4);
  --accent2: #00cec9;
  --accent2-hover: #00e0db;
  --danger: #e74c3c;
  --success: #27ae60;
  --warning: #f39c12;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.7);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --header-h: 64px;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent2); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent2-hover); }

img { max-width: 100%; height: auto; display: block; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ===== LOADING / SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn--secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn--secondary:hover {
  background: var(--bg-card-hover);
}
.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn--ghost:hover {
  color: var(--text-white);
  background: rgba(255,255,255,0.08);
}
.btn--lg {
  padding: 14px 32px;
  font-size: 16px;
  border-radius: var(--radius);
}
.btn--sm {
  padding: 6px 12px;
  font-size: 12px;
}
.btn--danger { background: var(--danger); color: #fff; }

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background var(--transition);
}
.header__inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
}
.header__logo img { height: 36px; }
.header__search {
  flex: 1;
  max-width: 500px;
}
.header__search-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
}

/* Search box */
.search-box {
  position: relative;
}
.search-box__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}
.search-box__input {
  width: 100%;
  padding: 10px 16px 10px 44px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text-white);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: all var(--transition);
}
.search-box__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-box__input::placeholder { color: var(--text-secondary); }

/* Search results dropdown */
.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1001;
  box-shadow: var(--shadow-lg);
}
.search-results.active { display: block; }
.search-results__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.search-results__item:last-child { border-bottom: none; }
.search-results__item:hover { background: var(--bg-card-hover); }
.search-results__poster {
  width: 40px;
  height: 60px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-card);
}
.search-results__info { flex: 1; min-width: 0; }
.search-results__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-results__meta {
  font-size: 12px;
  color: var(--text-secondary);
}
.search-results__empty {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  height: 70vh;
  min-height: 400px;
  max-height: 700px;
  display: flex;
  align-items: flex-end;
  padding: 0 24px 60px;
  margin-top: var(--header-h);
  overflow: hidden;
}
.hero__backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  transition: opacity 0.8s ease;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-primary) 0%, rgba(10,10,15,0.6) 50%, rgba(10,10,15,0.3) 100%);
}
.hero__content {
  position: relative;
  z-index: 2;
  max-width: 600px;
  animation: fadeInUp 0.8s ease;
}
.hero__title {
  font-size: 48px;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.1;
  margin-bottom: 12px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.hero__desc {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero__meta {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hero__meta-badge {
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 600;
}
.hero__btn {
  text-decoration: none;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== ROW SECTIONS ===== */
.main {
  padding: 20px 0 60px;
}
.row-section {
  margin-bottom: 40px;
  padding: 0 24px;
}
.row-section__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 16px;
}
.row-section__scroll {
  position: relative;
}
.row-section__track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.row-section__track::-webkit-scrollbar { display: none; }

.row-section__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-white);
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  opacity: 0;
}
.row-section__scroll:hover .row-section__arrow { opacity: 1; }
.row-section__arrow:hover { background: var(--accent); border-color: var(--accent); }
.row-section__arrow--left { left: -8px; }
.row-section__arrow--right { right: -8px; }

/* ===== MOVIE CARD ===== */
.card {
  flex-shrink: 0;
  width: 180px;
  cursor: pointer;
  transition: transform var(--transition);
  text-decoration: none;
  color: inherit;
}
.card:hover {
  transform: scale(1.08);
  z-index: 5;
}
.card__poster-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 2/3;
  background: var(--bg-card);
  margin-bottom: 10px;
}
.card__poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--transition);
}
.card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
}
.card:hover .card__overlay { opacity: 1; }
.card__overlay-desc {
  font-size: 11px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__rating {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.75);
  color: var(--warning);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}
.card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card__year {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Card skeleton */
.card-skeleton {
  flex-shrink: 0;
  width: 180px;
}
.card-skeleton__poster {
  aspect-ratio: 2/3;
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.card-skeleton__title {
  height: 16px;
  width: 80%;
  margin-bottom: 6px;
}
.card-skeleton__year {
  height: 12px;
  width: 40%;
}

/* ===== MOVIE HERO (Detail page) ===== */
.movie-hero {
  position: relative;
  min-height: 60vh;
  padding-top: var(--header-h);
}
.movie-hero__backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
}
.movie-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--bg-primary) 30%, rgba(10,10,15,0.4) 100%),
              linear-gradient(to top, var(--bg-primary) 0%, transparent 50%);
}
.movie-hero__content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  gap: 40px;
  align-items: flex-start;
}
.movie-hero__poster {
  flex-shrink: 0;
  width: 300px;
}
.movie-hero__poster-img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.movie-hero__info {
  flex: 1;
  min-width: 0;
}
.movie-hero__title {
  font-size: 40px;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.15;
  margin-bottom: 4px;
}
.movie-hero__original {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.movie-hero__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.movie-hero__meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.movie-hero__genres {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.genre-badge {
  background: rgba(108, 92, 231, 0.2);
  color: var(--accent);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(108, 92, 231, 0.3);
}
.movie-hero__rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 700;
  color: var(--warning);
}
.movie-hero__desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 20px;
}
.movie-hero__seasons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-secondary);
}
.select {
  background: var(--bg-card);
  color: var(--text-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  cursor: pointer;
}
.select:focus { border-color: var(--accent); }

.movie-hero__balancers {
  margin-bottom: 20px;
}
.movie-hero__balancers h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-white);
  margin-bottom: 10px;
}
.balancer-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.balancer-tab {
  padding: 8px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.balancer-tab:hover {
  border-color: var(--accent);
  color: var(--text-white);
}
.balancer-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.movie-hero__preview {
  margin-bottom: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  max-width: 700px;
  background: #000;
}
.movie-hero__iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.movie-hero__watch-btn {
  margin-top: 8px;
}

/* ===== CAST ===== */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 24px;
}
.section__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 16px;
}
.cast-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
}
.cast-row::-webkit-scrollbar { display: none; }
.cast-card {
  flex-shrink: 0;
  width: 120px;
  text-align: center;
}
.cast-card__photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 8px;
  background: var(--bg-card);
}
.cast-card__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-white);
}
.cast-card__char {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ===== ROOM PAGE ===== */
.room-body {
  overflow: hidden;
  height: 100vh;
}
.room {
  display: flex;
  height: 100vh;
  background: #000;
}
.room__player {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.room__player-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: rgba(10, 10, 15, 0.95);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.room__logo img { height: 28px; }
.room__title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room__current-source {
  font-size: 11px;
  color: var(--accent2);
  background: rgba(0, 206, 201, 0.12);
  padding: 2px 10px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}
.room__player-actions {
  display: flex;
  gap: 4px;
}
.room__player-wrapper {
  flex: 1;
  position: relative;
  background: #000;
}
.room__player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 5;
  color: var(--text-secondary);
  font-size: 14px;
  pointer-events: none;
}
.room__iframe {
  width: 100%;
  height: 100%;
  border: none;
  position: relative;
  z-index: 10;
}
.room__sync-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: none;
}
.room__sync-message {
  background: rgba(0,0,0,0.85);
  padding: 16px 32px;
  border-radius: var(--radius);
  color: var(--text-white);
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeInUp 0.3s ease;
}

/* Host controls */
.room__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(10, 10, 15, 0.95);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.room__ctrl-btn {
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.room__ctrl-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.room__ctrl-btn--play {
  width: 56px;
  height: 56px;
  background: var(--accent);
  border-color: var(--accent);
}
.room__ctrl-btn--play:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 24px var(--accent-glow);
}
.room__time-display {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
}
.room__time-input {
  width: 90px;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-white);
  font-family: var(--font);
  font-size: 13px;
  text-align: center;
  outline: none;
}
.room__time-input:focus { border-color: var(--accent); }

/* Sidebar */
.room__sidebar {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
}
.room__sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.room__info-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room__viewers {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.room__invite {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.room__invite-input {
  flex: 1;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 12px;
  outline: none;
  min-width: 0;
}
.room__host-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(108, 92, 231, 0.15);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
}

/* Chat */
.room__chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.room__chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-msg {
  animation: fadeIn 0.2s ease;
}
.chat-msg--user {
  padding: 6px 0;
}
.chat-msg__name {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent2);
  margin-right: 6px;
}
.chat-msg__time {
  font-size: 10px;
  color: var(--text-secondary);
  margin-left: 6px;
}
.chat-msg__text {
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-word;
}
.chat-msg--system {
  text-align: center;
  padding: 4px 8px;
  margin: 2px 0;
}
.chat-msg--system .chat-msg__text {
  font-size: 11px;
  color: var(--text-secondary);
  font-style: italic;
  opacity: 0.7;
}
.room__chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.room__chat-field {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-white);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
}
.room__chat-field:focus { border-color: var(--accent); }
.room__chat-field::placeholder { color: var(--text-secondary); }
.room__chat-send {
  padding: 10px 14px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Chat toggle (mobile) */
.room__chat-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  z-index: 100;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.room__chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.3s ease;
}
.modal__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 8px;
}
.modal__desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.modal__input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-white);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  margin-bottom: 16px;
}
.modal__input:focus { border-color: var(--accent); }
.modal__input::placeholder { color: var(--text-secondary); }
.modal__btn { width: 100%; justify-content: center; }

/* Balancer list in modal */
.balancer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.balancer-list__item {
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}
.balancer-list__item:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}
.balancer-list__item.active {
  border-color: var(--accent);
  background: rgba(108, 92, 231, 0.15);
  color: var(--text-white);
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  color: var(--text-white);
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast--success { border-left: 3px solid var(--success); }
.toast--error { border-left: 3px solid var(--danger); }
.toast--info { border-left: 3px solid var(--accent); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateX(40px); }
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
}
.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .card { width: 160px; }
  .movie-hero__content { gap: 24px; }
  .movie-hero__poster { width: 220px; }
  .movie-hero__title { font-size: 32px; }
  .room__sidebar { width: 300px; }
}

@media (max-width: 768px) {
  .header__search { display: none; }
  .header__search.active {
    display: block;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
  }
  .header__search-toggle { display: block; }

  .hero {
    height: 50vh;
    min-height: 300px;
    padding: 0 16px 40px;
  }
  .hero__title { font-size: 32px; }
  .hero__desc { -webkit-line-clamp: 2; font-size: 14px; }

  .card { width: 140px; }
  .row-section { padding: 0 16px; }
  .row-section__arrow { display: none !important; }

  .movie-hero__content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .movie-hero__poster { width: 200px; }
  .movie-hero__genres { justify-content: center; }
  .movie-hero__meta { justify-content: center; }
  .movie-hero__title { font-size: 28px; }

  /* Room mobile */
  .room { flex-direction: column; }
  .room__sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 60vh;
    transform: translateY(100%);
    transition: transform var(--transition);
    z-index: 50;
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .room__sidebar.active {
    transform: translateY(0);
  }
  .room__chat-toggle { display: flex; }
  .room__controls { padding: 6px 8px; gap: 6px; }
  .room__ctrl-btn { width: 38px; height: 38px; }
  .room__ctrl-btn--play { width: 48px; height: 48px; }
  .room__time-display { margin-left: 4px; }
  .room__time-input { width: 72px; font-size: 12px; }
}

@media (max-width: 480px) {
  .card { width: 120px; }
  .hero__title { font-size: 26px; }
  .hero { height: 45vh; min-height: 260px; }
  .row-section__title { font-size: 18px; }
  .movie-hero__poster { width: 160px; }
  .movie-hero__title { font-size: 24px; }
}

@media (max-width: 320px) {
  .card { width: 110px; }
  .hero__title { font-size: 22px; }
  .header__inner { padding: 0 12px; }
}

@media (min-width: 1440px) {
  .card { width: 200px; }
  .hero__title { font-size: 56px; }
}
