/* ============================================================
   MovieClub — Global Styles
   Dark cinema theme: deep blacks, red accent, clean typography
   ============================================================ */

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

:root {
  --bg: #0f0f0f;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222222;
  --bg-input: #111111;
  --bg-overlay: rgba(0, 0, 0, 0.7);
  --border: #2a2a2a;
  --border-focus: #e50914;
  --accent: #e50914;
  --accent-hover: #ff1a24;
  --accent-dim: rgba(229, 9, 20, 0.15);
  --text: #f0f0f0;
  --text-muted: #888888;
  --text-dim: #555555;
  --success: #2ecc71;
  --warning: #f39c12;
  --upvote: #2ecc71;
  --downvote: #e74c3c;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.4);
  --transition: 0.18s ease;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
}

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 800;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

/* ============================================================
   Layout Utilities
   ============================================================ */

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

.hidden {
  display: none !important;
}

/* ============================================================
   Navbar
   ============================================================ */

.navbar {
  background: rgba(15, 15, 15, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  display: flex;
  align-items: center;
}

.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.navbar-brand:hover {
  color: var(--text);
}

.brand-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: #3a3a3a;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-card);
  color: var(--text);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
  border-radius: 5px;
}

.btn-danger {
  background: transparent;
  color: var(--downvote);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(231, 76, 60, 0.1);
  border-color: var(--downvote);
}

/* ============================================================
   Form Elements
   ============================================================ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

input[type="text"],
input[type="search"],
input[type="number"],
textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 10px 14px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

input[type="text"]::placeholder,
input[type="search"]::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

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

/* ============================================================
   Spinner
   ============================================================ */

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   Toast Notifications
   ============================================================ */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.88rem;
  padding: 10px 16px;
  box-shadow: var(--shadow);
  animation: toastIn 0.2s ease;
  max-width: 320px;
  line-height: 1.4;
}

.toast.success {
  border-color: var(--success);
  color: var(--success);
}

.toast.error {
  border-color: var(--downvote);
  color: var(--downvote);
}

.toast.info {
  border-color: var(--border);
  color: var(--text-muted);
}

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

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

/* ============================================================
   Page Loader
   ============================================================ */

#page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transition: opacity 0.3s ease;
}

#page-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-logo {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.loader-logo span {
  color: var(--accent);
}

.loader-bar {
  width: 200px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  animation: loaderFill 1.6s ease-in-out infinite;
}

@keyframes loaderFill {
  0%   { width: 0%; margin-left: 0; }
  50%  { width: 60%; margin-left: 20%; }
  100% { width: 0%; margin-left: 100%; }
}

/* ============================================================
   Hero (index page)
   ============================================================ */

.hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 72px 20px 48px;
  text-align: center;
}

.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  line-height: 1.1;
}

.hero h1 span {
  color: var(--accent);
}

.hero > p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 48px;
  line-height: 1.7;
}

.landing-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 680px;
  margin: 0 auto;
}

@media (max-width: 560px) {
  .landing-cards {
    grid-template-columns: 1fr;
  }
}

.landing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: left;
  transition: border-color var(--transition);
}

.landing-card:hover {
  border-color: #3a3a3a;
}

.landing-card-icon {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.landing-card h2 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.landing-card > p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ============================================================
   Join Modal / Overlay
   ============================================================ */

#join-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#join-overlay.hidden {
  display: none !important;
}

.join-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

@media (max-width: 480px) {
  .join-modal {
    padding: 24px 18px;
    border-radius: var(--radius-sm);
  }
}

.join-modal h2 {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.join-modal .subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* ============================================================
   Club Header
   ============================================================ */

.club-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}

.club-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.club-name {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-right: auto;
}

.join-code-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
}

.join-code-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.join-code-value {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text);
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: var(--font);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}

.copy-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}

/* ============================================================
   Club Layout
   ============================================================ */

.club-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 768px) {
  .club-layout {
    grid-template-columns: 1fr;
    padding: 16px 12px;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .club-header {
    padding: 12px 0;
  }
  .club-header-inner {
    padding: 0 12px;
    gap: 8px;
  }
  .club-name {
    font-size: 1.1rem;
    width: 100%;
    margin-right: 0;
  }
  .join-code-badge {
    padding: 5px 10px;
  }
  .join-code-label {
    display: none;
  }
}

.club-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.club-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.sidebar-section h3 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ============================================================
   Search Section
   ============================================================ */

.search-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.search-section h3 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.search-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  pointer-events: none;
  z-index: 1;
}

#movie-search {
  padding-left: 36px;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: min(380px, 50vh);
  overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow);
  display: none;
}

.search-results.open {
  display: block;
}

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

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

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

.search-result-poster {
  width: 36px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.search-result-poster-placeholder {
  width: 36px;
  height: 54px;
  background: var(--bg);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

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

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

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

.search-loading,
.search-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ============================================================
   Movies Section
   ============================================================ */

.movies-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

@media (max-width: 480px) {
  .movies-section {
    padding: 14px 12px;
  }
  .movies-section h3 {
    flex-wrap: wrap;
  }
  #spin-wheel-btn {
    margin-left: 0;
    width: 100%;
    margin-top: 8px;
  }
}

.movies-section h3 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.count-badge {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 1px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.club-limits-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  margin-bottom: 12px;
}

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

.movies-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* ============================================================
   Movie Card
   ============================================================ */

.movie-card {
  display: flex;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.movie-card:hover {
  border-color: #3a3a3a;
  box-shadow: var(--shadow-card);
}

.movie-card-poster {
  width: 60px;
  flex-shrink: 0;
}

.movie-card-poster img {
  width: 60px;
  height: 90px;
  object-fit: cover;
  display: block;
}

.movie-card-poster-placeholder {
  width: 60px;
  height: 90px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.movie-card-body {
  flex: 1;
  min-width: 0;
  padding: 10px 12px 10px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.movie-card-top {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.movie-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.movie-card-overview {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-card-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ============================================================
   Vote Controls
   ============================================================ */

.vote-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.vote-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 3px 7px;
  line-height: 1;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  font-family: var(--font);
}

.vote-btn:hover:not(:disabled) {
  border-color: var(--text-muted);
  color: var(--text);
}

.vote-btn.active-up {
  background: rgba(46, 204, 113, 0.15);
  border-color: var(--upvote);
  color: var(--upvote);
}

.vote-btn.active-down {
  background: rgba(231, 76, 60, 0.15);
  border-color: var(--downvote);
  color: var(--downvote);
}

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

.vote-score {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
  color: var(--text-muted);
}

.vote-score.positive {
  color: var(--upvote);
}

.vote-score.negative {
  color: var(--downvote);
}

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

.watched-badge {
  font-size: 0.72rem;
  color: var(--success);
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.25);
  border-radius: 99px;
  padding: 2px 8px;
}

.watched-toggle-btn {
  font-size: 0.72rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
}

.watched-toggle-btn.active {
  background: rgba(46, 204, 113, 0.12);
  border-color: rgba(46, 204, 113, 0.4);
  color: var(--success);
}

.watched-toggle-btn:hover:not(:disabled) {
  border-color: rgba(46, 204, 113, 0.4);
  color: var(--success);
}

/* ============================================================
   Members List
   ============================================================ */

.member-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.member-avatar.is-you {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

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

.member-name {
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.you-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 99px;
  padding: 1px 6px;
}

.member-lb {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 1px;
}

.lb-sync-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-family: var(--font);
  cursor: pointer;
  padding: 3px 7px;
  transition: color var(--transition), border-color var(--transition);
}

.lb-sync-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--text-muted);
}

.lb-sync-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   Admin Modal
   ============================================================ */

#admin-modal {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#admin-modal.hidden {
  display: none !important;
}

.admin-modal-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

@media (max-width: 520px) {
  .admin-modal-inner {
    padding: 20px 16px;
    border-radius: var(--radius-sm);
  }
}

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

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

.genre-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.genre-check:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.genre-check input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}

/* ============================================================
   Wheel Modal
   ============================================================ */

#wheel-modal {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

#wheel-modal.hidden {
  display: none !important;
}

.wheel-modal-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px 28px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow);
  position: relative;
  text-align: center;
}

@media (max-width: 520px) {
  .wheel-modal-inner {
    padding: 20px 12px 16px;
  }
  #wheel-canvas {
    max-width: 100%;
    height: auto;
  }
}

.wheel-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
  font-family: var(--font);
}

.wheel-modal-close:hover {
  color: var(--text);
  background: var(--bg-card-hover);
}

.wheel-modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.wheel-modal-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.wheel-wrap {
  position: relative;
  display: inline-block;
}

#wheel-canvas {
  display: block;
  max-width: 100%;
  border-radius: 50%;
}

.wheel-pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.6rem;
  color: var(--accent);
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
  pointer-events: none;
}

#wheel-winner {
  margin-top: 20px;
}

#wheel-winner.hidden {
  display: none;
}

.wheel-winner-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: winnerReveal 0.4s ease;
}

@keyframes winnerReveal {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.wheel-winner-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.wheel-winner-poster {
  width: 80px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: var(--shadow-card);
}

.wheel-winner-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.wheel-winner-year {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ============================================================
   Live indicator dot (SSE connection status)
   ============================================================ */

/* ============================================================
   Now Showing
   ============================================================ */

.now-showing-card {
  display: flex;
  gap: 12px;
  align-items: center;
}

.now-showing-poster {
  width: 54px;
  height: 80px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.now-showing-poster-placeholder {
  width: 54px;
  height: 80px;
  background: var(--bg);
  border-radius: 5px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 1.4rem;
}

.now-showing-info {
  min-width: 0;
  flex: 1;
}

.now-showing-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-showing-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.now-showing-date {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ============================================================
   Live Indicator
   ============================================================ */

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.live-dot.live {
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4);
  animation: livePulse 2s infinite;
}

.live-dot.polling {
  background: var(--text-dim);
}

@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4); }
  70%  { box-shadow: 0 0 0 8px rgba(46, 204, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

/* ============================================================
   Miscellaneous utilities
   ============================================================ */

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

.mt-4 {
  margin-top: 4px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ============================================================
   Past Winners
   ============================================================ */

.past-winner-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.past-winner-item:last-child {
  border-bottom: none;
}

.past-winner-poster {
  width: 36px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.past-winner-poster-placeholder {
  width: 36px;
  height: 54px;
  background: var(--bg);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 1rem;
}

.past-winner-info {
  min-width: 0;
  flex: 1;
}

.past-winner-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.past-winner-date {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.collapsible-heading {
  user-select: none;
}

.collapsible-heading:hover .collapse-arrow {
  color: var(--accent);
}

.collapse-arrow {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-left: 6px;
  transition: color var(--transition);
}

/* ============================================================
   Movie Night
   ============================================================ */

.movie-night-card {
  background: var(--accent-dim);
  border: 1px solid rgba(229, 9, 20, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.movie-night-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.movie-night-countdown {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.movie-night-tonight {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--accent);
  text-align: center;
  padding: 8px 0;
  letter-spacing: 0.02em;
}

/* ============================================================
   Activity Feed
   ============================================================ */

.activity-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

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

.activity-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
  width: 20px;
  text-align: center;
}

.activity-body {
  min-width: 0;
  flex: 1;
}

.activity-text {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text);
}

.activity-text em {
  font-style: normal;
  color: var(--text);
  font-weight: 600;
}

.activity-time {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ============================================================
   Pending Requests & Waiting Room
   ============================================================ */

.pending-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 999px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1;
}

.pending-request-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.pending-request-item:last-child {
  border-bottom: none;
}

.pending-request-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pending-request-name {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pending-request-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-approve {
  background: rgba(46, 204, 113, 0.15);
  color: var(--success);
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.btn-approve:hover {
  background: rgba(46, 204, 113, 0.25);
}

#waiting-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  backdrop-filter: blur(4px);
}

#waiting-overlay .join-modal {
  text-align: center;
}

/* ============================================================
   Movie Night Schedule (admin form + updated card)
   ============================================================ */

.movie-night-schedule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 480px) {
  .movie-night-schedule-grid { grid-template-columns: 1fr; }
}

.movie-night-repeat {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-bottom: 4px;
}

.movie-night-paused {
  opacity: 0.6;
  border-style: dashed;
}

.movie-night-tonight {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--accent);
  margin-top: 4px;
}

/* ============================================================
   Member Profile Page
   ============================================================ */

.profile-layout {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-name {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 6px;
}

.profile-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.profile-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 680px) {
  .profile-body { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .profile-layout {
    padding: 20px 12px 40px;
  }
  .profile-header {
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 20px;
  }
  .profile-avatar {
    width: 56px;
    height: 56px;
    font-size: 1.2rem;
    flex-shrink: 0;
  }
  .profile-name {
    font-size: 1.25rem;
  }
}

.profile-col {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.profile-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.profile-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.profile-section-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.profile-empty {
  font-size: 0.82rem;
  color: var(--text-dim);
  text-align: center;
  padding: 16px 0;
}

/* Watched list entries */
.watched-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.watched-entry:last-child { border-bottom: none; }

.watched-entry-title {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
}

.watched-entry-meta {
  font-size: 0.7rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.watched-remove-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
  flex-shrink: 0;
  transition: color var(--transition);
}

.watched-remove-btn:hover { color: var(--accent); }

/* Profile movie rows (suggestions + upvoted) */
.profile-movie-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.profile-movie-row:last-child { border-bottom: none; }

.profile-movie-poster {
  width: 32px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.profile-movie-poster-placeholder {
  width: 32px;
  height: 48px;
  background: var(--bg);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.profile-movie-info { flex: 1; min-width: 0; }

.profile-movie-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-movie-year {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Member sidebar links */
.member-avatar-link {
  text-decoration: none;
  flex-shrink: 0;
}

.member-name-link {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}

.member-name-link:hover { color: var(--accent); }

/* ============================================================
   Auth page
   ============================================================ */

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.auth-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
}

.auth-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.auth-tab:hover:not(.active) {
  color: var(--text);
}

/* ============================================================
   Navbar auth controls
   ============================================================ */

.navbar-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.navbar-account-name {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 420px) {
  .navbar-inner {
    padding: 0 12px;
    gap: 8px;
  }
  .navbar-account-name {
    display: none;
  }
}

/* ============================================================
   Upgrade banner
   ============================================================ */

.upgrade-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.upgrade-banner-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 200px;
}

.upgrade-banner-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.upgrade-banner-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.upgrade-banner-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.upgrade-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ============================================================
   Dashboard (logged-in home page)
   ============================================================ */

#dashboard {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 20px 60px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.dashboard-clubs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
}

.dashboard-club-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}

.dashboard-club-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.dashboard-club-pending {
  opacity: 0.6;
  cursor: default;
}

.dashboard-club-pending:hover {
  border-color: var(--border);
  background: var(--bg-card);
}

.dashboard-club-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-dim);
  border: 1px solid rgba(229,9,20,0.2);
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dashboard-club-info {
  flex: 1;
  min-width: 0;
}

.dashboard-club-name {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-club-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.dashboard-club-arrow {
  color: var(--text-dim);
  font-size: 1rem;
  flex-shrink: 0;
}

.dashboard-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.dashboard-join-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ============================================================
   Club Suggestions
   ============================================================ */

.cs-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

@media (max-width: 480px) {
  .cs-add-row {
    flex-wrap: wrap;
  }
  .cs-add-row .cs-type-select {
    width: 100%;
  }
  .cs-add-row .cs-input {
    flex: 1;
    min-width: 0;
  }
}

.cs-type-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.82rem;
  padding: 6px 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.cs-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  padding: 6px 10px;
  min-width: 0;
}

.cs-input:focus {
  outline: none;
  border-color: var(--accent);
}

.cs-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: opacity 0.2s;
}

.cs-item.cs-done {
  opacity: 0.45;
}

.cs-item.cs-dismissed {
  display: none;
}

.cs-type-pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 99px;
  padding: 2px 8px;
  flex-shrink: 0;
  margin-top: 2px;
}

.cs-type-movie  { background: rgba(99,102,241,0.15); color: #818cf8; }
.cs-type-theme  { background: rgba(245,158,11,0.15); color: #fbbf24; }
.cs-type-other  { background: rgba(107,114,128,0.15); color: #9ca3af; }

.cs-body-wrap {
  flex: 1;
  min-width: 0;
}

.cs-body-text {
  font-size: 0.88rem;
  color: var(--text);
  word-break: break-word;
}

.cs-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 3px;
}

.cs-status-done {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--success);
  margin-left: 6px;
  text-transform: uppercase;
}

.cs-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cs-upvote-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 3px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.cs-upvote-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cs-upvote-btn.active {
  background: rgba(99,102,241,0.12);
  border-color: var(--accent);
  color: var(--accent);
}

.cs-delete-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  border-radius: 4px;
}

.cs-delete-btn:hover { color: var(--danger, #f87171); }

.cs-admin-actions {
  display: flex;
  gap: 4px;
}

.cs-empty {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============================================================
   Lucide icons
   ============================================================ */

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 1em;
  height: 1em;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

.icon-sm  { width: 14px; height: 14px; }
.icon-md  { width: 18px; height: 18px; }
.icon-lg  { width: 24px; height: 24px; }
.icon-xl  { width: 32px; height: 32px; }
.icon-2xl { width: 48px; height: 48px; }
