/*
 * Оглавление:
 *   - Reset + переменные + body
 *   - AUTH SCREENS - экраны login / signup (используют классы .setup-*)
 *   - HEADER + CONTROLS - главная панель и переключатели вида/сортировки
 *   - GRID / VIEWS - четыре режима отображения
 *   - CARD / CARD-H / CARD-C / CARD-L - стили карточек по видам
 *   - EMPTY - пустая коллекция
 *   - MODAL OVERLAY (shared) + SEARCH RESULTS - общая модалка и результаты поиска
 *   - RATING VIEW - выставление оценок звёздами
 *   - SETTINGS MODAL - настройки клуба и редактор болванок
 *   - PROFILE MODAL - модалка профиля (имя, preset/upload аватара)
 *   - WATCHLIST - список «к просмотру»
 *   - ROULETTE - рулетка + барабан + конфетти-canvas
 *   - SCROLLBAR - глобальные стили скроллбара
 *   - Media queries (max-width: 600px)
 */

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

:root {
  --bg-deep: #0f0f1a;
  --bg-card: #1e1e2e;
  --bg-card-hover: #2a2a3e;
  --gold: #f6c700;
  --gold-dark: #e8a900;
  --text: #e0e0ee;
  --text-dim: #8888a0;
  --text-muted: #6666a0;
  --border: rgba(255,255,255,0.06);
  --border-light: rgba(255,255,255,0.1);
}

body {
  background: linear-gradient(180deg, var(--bg-deep) 0%, #161625 50%, var(--bg-deep) 100%);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
}

/* ===== AUTH SCREENS (login + signup) ===== */
.setup-overlay {
  position: fixed; 
  inset: 0; background: var(--bg-deep);
  display: flex; 
  align-items: center; 
  justify-content: center; 
  z-index: 200; 
  padding: 24px;
}
.setup-box {
  position: relative;
  background: linear-gradient(160deg, #1c1c2e 0%, #252540 100%);
  border-radius: 24px;
  max-width: 520px;
  width: 100%;
  padding: 36px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.08);
}
.setup-box h3 {
  color: #c8c8d8; 
  font-size: 15px; 
  font-family: 'Playfair Display', Georgia, serif; 
  margin-bottom: 12px;
}
.setup-input {
  width: 100%; 
  padding: 10px 16px; 
  border-radius: 12px;
  border: 1px solid var(--border-light); 
  background: rgba(255,255,255,0.05);
  color: #e8e8f0; 
  font-size: 15px; 
  outline: none;
  font-family: 'DM Sans', monospace; 
  transition: border 0.2s; 
  margin-bottom: 16px;
}
.setup-input:focus { 
  border-color: rgba(246,199,0,0.4); 
}
.setup-input::placeholder { 
  color: #444460; 
}
.setup-btn {
  width: 100%; 
  padding: 14px; 
  border-radius: 12px; 
  border: none;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #1a1a1a;
  font-size: 15px; 
  font-weight: 700; 
  cursor: pointer;
  font-family: 'DM Sans', sans-serif; 
  transition: transform 0.2s;
}
.setup-btn:hover { 
  transform: translateY(-1px); 
}
.setup-btn:disabled { 
  background: #3a3a4a; 
  color: #666; 
  cursor: not-allowed; 
  transform: none;
}
.setup-error { 
  color: #ff6b6b; 
  font-size: 13px; 
  margin-top: 10px; 
  display: none;
}
.setup-testing { 
  color: var(--gold); 
  font-size: 13px; 
  margin-top: 10px; 
  display: none; 
}

/* ===== HEADER ===== */
.header {
  background: linear-gradient(180deg, rgba(246,199,0,0.06) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.header-inner { 
  max-width: 1100px; 
  margin: 0 auto; 
  padding: 36px 24px 28px; 
}
.header-row {
  display: flex; 
  align-items: flex-end; 
  justify-content: space-between; 
  flex-wrap: wrap; 
  gap: 16px;
}
.logo {
  font-size: 36px; 
  font-weight: 800; 
  font-family: 'Playfair Display', Georgia, serif;
  letter-spacing: -0.5px; 
  background: linear-gradient(135deg, var(--gold), #ffdf50);
  -webkit-background-clip: text; 
  -webkit-text-fill-color: transparent; 
  background-clip: text; 
  line-height: 1.1;
}
.header-buttons {
  display: flex; 
  gap: 8px; 
  align-items: center;
}
.btn-add {
  height: 42px;
  padding: 0px 28px; 
  border-radius: 12px; 
  border: none;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #1a1a1a; 
  font-size: 15px; 
  font-weight: 700; 
  cursor: pointer;
  font-family: 'DM Sans', sans-serif; 
  box-shadow: 0 4px 20px rgba(246,199,0,0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-add:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 6px 28px rgba(246,199,0,0.35); 
}
.btn-profile {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-profile:hover {
  border-color: rgba(246,199,0,0.4);
  transform: scale(1.05);
}
.btn-profile .avatar {
  width: 100%;
  height: 100%;
  display: block;
}

/* ===== CLUB SWITCHER (логотип + дропдаун) ===== */
.club-switch {
  position: relative;
  min-width: 0;
}
.logo-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: inherit;
  line-height: 1.1;
}
.logo-caret {
  color: var(--text-muted);
  font-size: 18px;
  transition: color 0.2s;
  line-height: 1;
}
.logo-btn:hover .logo-caret {
  color: var(--gold);
}
body.no-clubs .logo-caret { display: none; }
body.no-clubs .logo-btn { cursor: default; }
body.no-clubs .btn-add { display: none; }
body.no-clubs .btn-settings { display: none; }
.club-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  display: none;
  min-width: 280px;
  max-width: 400px;
  background: linear-gradient(160deg, #1c1c2e 0%, #252540 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  padding: 8px;
  animation: slideUp 0.15s ease-out;
}
.club-dropdown.open {
  display: block;
}
.club-dropdown-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
  max-height: 320px;
  overflow-y: auto;
}
.club-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.club-dropdown-item:hover {
  background: rgba(255,255,255,0.06);
}
.club-dropdown-item.active {
  background: rgba(246,199,0,0.08);
  color: var(--gold);
}
.club-dropdown-item-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.club-dropdown-item-check {
  color: var(--gold);
  font-size: 14px;
  flex-shrink: 0;
}
.club-dropdown-actions {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.club-dropdown-action {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.club-dropdown-action:hover {
  background: rgba(255,255,255,0.06);
  color: var(--gold);
}

/* Буквенная плашка клуба */
.club-letter-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(246,199,0,0.25), rgba(246,199,0,0.08));
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  font-family: 'Playfair Display', Georgia, serif;
  flex-shrink: 0;
}
.club-letter-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 14px;
}

/* ===== AVATAR (универсальный) ===== */
.avatar {
  display: inline-block;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  object-fit: cover;
  flex-shrink: 0;
  vertical-align: middle;
}
.avatar-sm { width: 22px; height: 22px; }
.avatar-md { width: 36px; height: 36px; }
.avatar-lg { width: 96px; height: 96px; }

.members-add {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.members-add:hover {
  color: var(--gold);
  border-color: rgba(246,199,0,0.4);
  background: rgba(246,199,0,0.08);
}

/* ===== CONTROLS ===== */
.controls { 
  margin-top: 18px; 
  display: flex; 
  gap: 8px; 
  align-items: center; 
  flex-wrap: wrap; 
}
.view-modes { 
  display: flex; 
  gap: 2px; 
}
.view-btn {
  padding: 6px 9px; 
  border-radius: 6px; 
  border: 1px solid var(--border-light);
  background: transparent; 
  color: #555577; 
  font-size: 14px; 
  cursor: pointer;
  transition: all 0.2s; 
  line-height: 1; 
  display: flex; 
  align-items: center; 
  justify-content: center;
}
.view-btn.active { 
  border-color: rgba(246,199,0,0.4); 
  background: rgba(246,199,0,0.1); 
  color: var(--gold); 
}
.view-btn:not(.active) { 
  color: #555577;
}
.view-btn:hover:not(.active) { 
  color: #8888a0; 
  background: rgba(255,255,255,0.03);
}
.controls-sep { 
  width: 1px; 
  height: 20px; 
  background: rgba(255,255,255,0.08); 
  margin: 0 4px; 
}
.sort-btn {
  padding: 6px 14px; 
  border-radius: 8px; 
  border: 1px solid var(--border-light);
  background: transparent;
  color: #7777a0; 
  font-size: 13px; 
  cursor: pointer;
  font-family: 'DM Sans', sans-serif; 
  font-weight: 500; 
  transition: all 0.2s;
}
.sort-btn.active { 
  border-color: rgba(246,199,0,0.4); 
  background: rgba(246,199,0,0.1); 
  color: var(--gold); 
}
.count { 
  color: #4a4a6a; 
  font-size: 13px; 
  margin-left: 8px; 
}

/* ===== GRID / VIEWS ===== */
.content { 
  max-width: 1100px; 
  margin: 0 auto; 
  padding: 28px 24px 60px; 
}
.grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); 
  gap: 20px; 
}
.grid.view-horizontal { 
  grid-template-columns: 1fr; 
  gap: 12px;
}
.grid.view-compact { 
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px; 
}
.grid.view-list { 
  grid-template-columns: 1fr; 
  gap: 6px; 
}

/* ===== CARD ===== */
.card {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
  border-radius: 16px; 
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
  border: 1px solid var(--border); 
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  animation: cardIn 0.4s ease-out both;
}
/* Перерисовка после обновления данных - без анимации появления (все 4 вида) */
.grid.no-anim > * {
  animation: none;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
}
.card-remove {
  position: absolute; 
  top: 8px; 
  right: 8px;
  background: rgba(0,0,0,0.7); 
  border: none; 
  color: #ff6b6b;
  font-size: 18px; 
  border-radius: 50%; 
  width: 28px; 
  height: 28px;
  cursor: pointer; 
  z-index: 2; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  backdrop-filter: blur(8px); 
  transition: background 0.2s, opacity 0.2s; 
  opacity: 0;
}
.card:hover .card-remove { 
  opacity: 1; 
}
.card-remove:hover { 
  background: rgba(255,50,50,0.5); 
}
.card-edit {
  position: absolute; 
  top: 8px; 
  left: 8px;
  background: rgba(0,0,0,0.7); 
  border: none; 
  color: #c0c0d0;
  font-size: 14px; 
  border-radius: 50%; 
  width: 28px; 
  height: 28px;
  cursor: pointer; 
  z-index: 2; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  backdrop-filter: blur(8px); 
  transition: background 0.2s, opacity 0.2s; 
  opacity: 0;
}
.card:hover .card-edit { 
  opacity: 1; 
}
.card-edit:hover { 
  background: rgba(246,199,0,0.3); 
  color: var(--gold); 
}
.card-poster { 
  width: 100%; 
  aspect-ratio: 2/3; 
  object-fit: cover; 
  display: block; 
}
.card-no-poster {
  width: 100%; 
  aspect-ratio: 2/3; 
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  display: flex; 
  align-items: center; 
  justify-content: center; 
  color: #555; 
  font-size: 48px;
}
.card-body { 
  padding: 14px 16px 16px; 
}
.card-title {
  font-size: 15px; 
  font-weight: 700; 
  color: #e8e8f0;
  line-height: 1.3; 
  font-family: 'Playfair Display', Georgia, serif;
}
.card-meta { 
  font-size: 12px; 
  color: var(--text-dim); 
  margin-top: 4px; 
}
.card-avg {
  margin-top: 10px; 
  padding: 6px 10px; 
  background: rgba(246,199,0,0.1);
  border-radius: 8px; 
  display: inline-flex; 
  align-items: center; 
  gap: 6px;
}
.card-avg-star { 
  font-size: 18px; 
  color: var(--gold); 
}
.card-avg-num { 
  font-size: 16px;
  font-weight: 700; 
  color: var(--gold); 
}
.card-world {
  margin-top: 10px; 
  padding: 6px 10px; 
  background: rgba(140,160,200,0.1);
  border-radius: 8px; 
  display: inline-flex; 
  align-items: center; 
  gap: 6px;
}
.card-world-icon { 
  font-size: 16px; 
}
.card-world-num { 
  font-size: 15px; 
  font-weight: 700; 
  color: #8898b8; 
}
.card-block.vertical .card-avg, .card-block.vertical .card-world {
  height: 36px;
}
.card-block.horizontal .card-avg, .card-block.horizontal .card-world {
  height: 36px;
  margin-top: 11px;
}
.card-block.vertical {
  display: flex;
  gap: 12px;
}
.card-block.horizontal {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.card-ratings { 
  margin-top: 12px; 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
}
.card-user { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
}
.card-user-name {
  font-size: 12px;
  color: #9999b0;
  min-width: 80px; 
  font-weight: 500; 
}
.stars { 
  display: inline-flex; 
  gap: 1px; 
  align-items: center; 
}
.stars .star-wrap {
  position: relative; 
  display: inline-block;
  width: 16px; 
  height: 16px; 
  line-height: 1;
}
.stars .star-wrap .star-bg { 
  color: #3a3a4a;
  font-size: 16px;
  position: absolute; 
  top: 0; 
  left: 0; 
}
.stars .star-wrap .star-fill {
  color: var(--gold); 
  font-size: 16px; 
  position: absolute; 
  top: 0; 
  left: 0;
  overflow: hidden; 
  width: 0; 
  white-space: nowrap;
}
.stars .star-wrap .star-fill.half { 
  width: 40%; 
}
.stars .star-wrap .star-fill.full { 
  width: 100%; 
}

/* ===== HORIZONTAL CARD ===== */
.card-h {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
  border-radius: 14px; 
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
  border: 1px solid var(--border); 
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative; 
  display: flex; 
  animation: cardIn 0.4s ease-out both;
}
.card-h:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 8px 32px rgba(0,0,0,0.4); 
}
.card-h .card-edit { 
  top: 6px; 
  left: 6px; 
  width: 24px; 
  height: 24px; 
  font-size: 12px; 
}
.card-h .card-remove { 
  top: 6px; 
  right: 6px; 
  width: 24px;
  height: 24px; 
  font-size: 15px; 
}
.card-h:hover .card-edit, .card-h:hover .card-remove { 
  opacity: 1; 
}
.grid.view-list .card-edit, .grid.view-list .card-remove {
  opacity: 1;
}
.card-h-poster { 
  width: 100px; 
  min-height: 150px; 
  object-fit: cover; 
  flex-shrink: 0; 
}
.card-h-no-poster {
  width: 100px; 
  min-height: 150px; 
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  display: flex; 
  align-items: center; 
  justify-content: center; 
  color: #555; 
  font-size: 32px; 
  flex-shrink: 0;
}
.card-h-body { 
  padding: 14px 16px; 
  flex: 1; 
  display: flex; 
  flex-direction: column; 
  justify-content: center; 
}
.card-h-top { 
  display: flex; 
  align-items: flex-start; 
  justify-content: space-between; 
  gap: 10px; }

.card-h-ratings { 
  display: flex; 
  gap: 14px; 
  flex-wrap: wrap; 
  margin-top: 8px; 
}
.card-h-user { 
  display: flex; 
  align-items: center; 
  gap: 5px; 
}
.card-h-user-name { 
  font-size: 11px; 
  color: #9999b0; 
  font-weight: 500; 
}
/* ===== COMPACT GRID CARD ===== */
.card-c {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
  border-radius: 12px; 
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  transition: transform 0.3s; 
  position: relative; 
  animation: cardIn 0.4s ease-out both;
}
.card-c:hover { 
  transform: translateY(-3px); 
}
.card-c .card-edit { 
  top: 4px; 
  left: 4px; 
  width: 22px; 
  height: 22px; 
  font-size: 11px; 
}
.card-c .card-remove { 
  top: 4px; 
  right: 4px; 
  width: 22px; 
  height: 22px; 
  font-size: 14px; 
}
.card-c:hover .card-edit, .card-c:hover .card-remove { 
  opacity: 1; 
}
.card-c-poster { 
  width: 100%;
  aspect-ratio: 2/3; 
  object-fit: cover; 
  display: block; }
.card-c-no-poster {
  width: 100%; 
  aspect-ratio: 2/3; 
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
  display: flex; 
  align-items: center; 
  justify-content: center; 
  color: #555; 
  font-size: 32px;
}
.card-c-body { 
  padding: 8px 10px 10px; 
}
.card-c-title {
  font-size: 12px; 
  font-weight: 700; 
  color: #e8e8f0; 
  line-height: 1.3;
  font-family: 'Playfair Display', Georgia, serif;
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis;
}
.card-c-avg { 
  display: inline-flex; 
  align-items: center; 
  gap: 3px; 
  margin-top: 4px; 
}
.card-c-avg span { 
  font-size: 12px; 
  color: var(--gold); 
  font-weight: 700; 
}
.card-c-world { 
  display: inline-flex; 
  align-items: center; 
  gap: 3px; 
  margin-top: 4px; 
  margin-left: 6px; 
}
.card-c-world span { 
  font-size: 12px; 
  color: #8898b8; 
  font-weight: 700; 
}

/* ===== LIST VIEW ===== */
.card-l {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
  border-radius: 10px; 
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2); 
  border: 1px solid var(--border);
  transition: background 0.2s; 
  position: relative;
  display: flex; 
  align-items: center; 
  padding: 8px 12px; 
  gap: 12px;
  animation: cardIn 0.3s ease-out both;
}
.card-l:hover { 
  background: rgba(255,255,255,0.03); 
}
.card-l .card-edit {
  position: relative; 
  top: auto; 
  left: auto; 
  opacity: 0; 
  width: 24px; 
  height: 24px; 
  font-size: 12px;
  flex-shrink: 0;
}
.card-l .card-remove {
  position: relative; 
  top: auto; 
  right: auto; 
  opacity: 0; 
  width: 24px; 
  height: 24px; 
  font-size: 15px;
  flex-shrink: 0;
}
.card-l:hover .card-edit, .card-l:hover .card-remove { 
  opacity: 1; 
}
.card-l-poster { 
  width: 36px; 
  height: 54px; 
  object-fit: cover; 
  border-radius: 5px; 
  flex-shrink: 0; 
}
.card-l-no-poster {
  width: 36px; 
  height: 54px; 
  border-radius: 5px; 
  background: #2a2a3e;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  color: #555; 
  font-size: 18px; 
  flex-shrink: 0;
}
.card-l-info { 
  flex: 1; 
  min-width: 0; 
}
.card-l-title {
  font-size: 14px; 
  font-weight: 600; 
  color: #e8e8f0;
  font-family: 'Playfair Display', Georgia, serif;
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis;
}
.card-l-meta { 
  font-size: 11px; 
  color: var(--text-dim); 
  margin-top: 2px;
}
.card-l-ratings { 
  display: flex; 
  gap: 10px; 
  flex-shrink: 0; 
  align-items: center; 
}
.card-l-user { 
  display: flex; 
  align-items: center; 
  gap: 3px; 
}
.card-l-score {
  font-size: 13px; 
  font-weight: 700; 
  color: var(--gold); 
  min-width: 14px; 
}
.card-l-avg {
  font-size: 14px; 
  font-weight: 700; 
  color: var(--gold);
  background: rgba(246,199,0,0.1); 
  padding: 3px 8px; 
  border-radius: 6px; 
  flex-shrink: 0;
}
.card-l-world {
  font-size: 14px; 
  font-weight: 700; 
  color: #8898b8;
  background: rgba(140,160,200,0.1); 
  padding: 3px 8px; 
  border-radius: 6px; 
  flex-shrink: 0;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 32px 0 8px;
}
.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: #7777a0;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.page-btn:hover:not(.active):not(.disabled) {
  background: var(--bg-card-hover);
  color: var(--text);
}
.page-btn.active {
  border-color: rgba(246,199,0,0.4);
  background: rgba(246,199,0,0.1);
  color: var(--gold);
  cursor: default;
}
.page-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ===== EMPTY ===== */
.empty { 
  text-align: center; 
  padding-top: 80px; 
  opacity: 0.7; 
}
.empty-icon { 
  font-size: 64px; 
  margin-bottom: 16px; 
}
.empty-title { 
  font-size: 20px; 
  color: #7777a0; 
  font-family: 'Playfair Display', Georgia, serif; 
}
.empty-sub {
  font-size: 14px;
  color: #555577;
  margin-top: 8px;
}
.empty:has(.empty-actions) {
  opacity: 1;
}
.empty-actions {
  max-width: 320px;
  margin: 28px auto 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.empty-btn-secondary {
  background: rgba(255,255,255,0.08);
  color: #c0c0d0;
}

/* ===== MODAL OVERLAY (shared) ===== */
.modal-overlay {
  position: fixed; 
  inset: 0; 
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(12px); 
  display: none;
  align-items: flex-start; 
  justify-content: center;
  z-index: 100; 
  padding-top: 60px; 
  overflow-y: auto;
}
.modal-overlay.open { 
  display: flex; 
  animation: fadeInFast 0.2s ease-out; 
}
@keyframes fadeInFast { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: linear-gradient(160deg, #1c1c2e 0%, #252540 100%);
  border-radius: 20px; 
  width: 90%; 
  max-width: 560px; 
  padding: 28px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6); 
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 40px; 
  animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal h2 {
  margin-bottom: 18px; 
  color: #e8e8f0;
  font-family: 'Playfair Display', Georgia, serif; 
  font-size: 22px; 
  font-weight: 700;
}
.search-input {
  width: 100%; 
  padding: 12px 16px; 
  border-radius: 12px;
  border: 1px solid var(--border-light); 
  background: rgba(255,255,255,0.05);
  color: #e8e8f0; 
  font-size: 15px; 
  outline: none;
  font-family: 'DM Sans', sans-serif; 
  transition: border 0.2s;
}
.search-input:focus { 
  border-color: rgba(246,199,0,0.4); 
}
.search-input::placeholder { 
  color: #555570; 
}
.search-loading { 
  text-align: center; 
  color: var(--text-dim); 
  margin-top: 20px; 
}
.search-results {
  margin-top: 14px;
  display: flex; 
  flex-direction: column; 
  gap: 4px;
  max-height: 420px; 
  overflow-y: auto;
}
.search-item {
  display: flex; 
  align-items: center; 
  gap: 12px; 
  padding: 8px 10px;
  border-radius: 10px; 
  cursor: pointer; 
  transition: background 0.15s;
}
.search-item:hover { 
  background: rgba(255,255,255,0.06); 
}
.search-thumb { 
  width: 40px; 
  height: 60px; 
  object-fit: cover;
  border-radius: 6px; 
  flex-shrink: 0; 
}
.search-no-thumb {
  width: 40px; 
  height: 60px; 
  border-radius: 6px; 
  background: #2a2a3e;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  color: #555; 
  font-size: 20px; 
  flex-shrink: 0;
}
.search-title { 
  color: #e0e0ee; 
  font-size: 14px; 
  font-weight: 600; 
}
.search-year {
  color: #7777a0;
  font-size: 12px;
}
.search-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* Третья строка: значки как в карточках, киноплёнка - TMDB, ★ - оценка клуба */
.search-ratings {
  display: flex;
  gap: 10px;
  font-size: 12px;
}
.search-avg {
  color: var(--gold);
  font-weight: 600;
}
.search-world {
  color: #8898b8;
}
.search-world .i {
  vertical-align: -2px;
}
/* Фильм уже в коллекции */
.search-item-in-club {
  background: rgba(246,199,0,0.04);
}
.search-badge {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  z-index: 300;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: linear-gradient(160deg, #1c1c2e 0%, #252540 100%);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  color: var(--text);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ===== RATING VIEW ===== */
.back-btn {
  background: none; 
  border: none; 
  color: var(--text-dim); 
  cursor: pointer;
  font-size: 14px; 
  margin-bottom: 12px; 
  padding: 0; 
  font-family: 'DM Sans', sans-serif;
}
.back-btn:hover { 
  color: var(--text); 
}
.selected-movie { 
  display: flex; 
  gap: 16px; 
  margin-bottom: 20px; 
}
.selected-poster { 
  width: 120px; 
  border-radius: 12px; 
  object-fit: cover; 
  flex-shrink: 0; 
}
.selected-no-poster {
  width: 120px; 
  height: 180px; 
  border-radius: 12px; 
  background: #2a2a3e;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 40px; 
  flex-shrink: 0;
}
.selected-title {
  font-size: 18px; 
  font-weight: 700; 
  font-family: 'Playfair Display', Georgia, serif; 
  color: #e8e8f0;
}
.selected-year { 
  color: var(--text-dim); 
  font-size: 13px; 
  margin-top: 4px; 
}
.selected-overview {
  color: #9999b0; 
  font-size: 12px; 
  line-height: 1.5; 
  margin-top: 8px;
  display: -webkit-box; 
  -webkit-line-clamp: 5; 
  -webkit-box-orient: vertical; 
  overflow: hidden;
}
.rating-section h4 {
  color: #c8c8d8; 
  margin-bottom: 14px; 
  font-size: 15px;
  font-family: 'Playfair Display', Georgia, serif; 
  font-weight: 600;
}
.rating-users { 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
}
.rating-user { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
}
.rating-user-name {
  color: #c0c0d0; 
  font-size: 14px; 
  min-width: 100px; 
  font-weight: 500; 
}
.rating-stars { 
  display: flex; 
  gap: 0; 
  align-items: center; 
}
.rating-star-wrap {
  position: relative; 
  display: inline-block; 
  width: 28px; 
  height: 28px; 
  cursor: pointer;
}
.rating-star-wrap .star-bg {
  font-size: 28px; 
  color: #3a3a4a; 
  position: absolute; 
  top: 0; 
  left: 0;
  transition: color 0.15s; 
  user-select: none; 
  line-height: 1;
}
.rating-star-wrap .star-fill {
  font-size: 28px; 
  color: var(--gold); 
  position: absolute; 
  top: 0; 
  left: 0;
  overflow: hidden; 
  width: 0;
  white-space: nowrap;
  transition: width 0.1s; 
  user-select: none; 
  line-height: 1;
}
.rating-star-wrap .star-fill.half { 
  width: 40%; 
}
.rating-star-wrap .star-fill.full {
  width: 100%; 
}
.rating-star-wrap .star-hit-left,
.rating-star-wrap .star-hit-right {
  position: absolute; 
  top: 0; 
  height: 100%; 
  width: 50%; 
  z-index: 1;
}
.rating-star-wrap .star-hit-left { 
  left: 0; 
}
.rating-star-wrap .star-hit-right { 
  right: 0; 
}
.rating-star-wrap:hover { 
  transform: scale(1.15); 
  transition: transform 0.15s; 
}
.rating-clear {
  font-size: 20px; 
  color: #ff6b6b; 
  cursor: pointer; 
  margin-left: 6px;
  opacity: 0; 
  transition: opacity 0.2s; 
  user-select: none; 
  line-height: 1;
  background: none; 
  border: none; 
  padding: 2px 4px;
}
.rating-clear.visible { 
  opacity: 0.6; 
}
.rating-clear.visible:hover { 
  opacity: 1; 
}
.btn-confirm {
  margin-top: 22px; 
  width: 100%; 
  padding: 13px; 
  border-radius: 12px;
  border: none; 
  font-size: 15px; 
  font-weight: 700; 
  cursor: pointer;
  font-family: 'DM Sans', sans-serif; 
  transition: all 0.2s;
}
.btn-confirm.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%); 
  color: #1a1a1a;
}
.btn-confirm.disabled { 
  background: #3a3a4a; 
  color: #666; 
  cursor: not-allowed; 
}

/* ===== SETTINGS MODAL ===== */
.settings-section { 
  margin-bottom: 24px; 
}
.settings-section h3 {
  color: #c8c8d8;
  font-size: 14px;
  font-family: 'Playfair Display', Georgia, serif;
  margin-bottom: 12px;
  font-weight: 600;
}
.settings-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.settings-section-header h3 { margin: 0; }
.settings-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 20px 0;
}
.settings-members-divider {
  border: none;
  border-top: 1px dashed rgba(255,255,255,0.08);
  margin: 12px 0;
}
.settings-access-readonly {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
}
.settings-access-readonly strong {
  color: var(--text);
  font-weight: 600;
}
.settings-access-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.settings-danger-zone {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,107,107,0.18);
}
.settings-danger-zone-title {
  color: #ff8a8a !important;
}
.user-row-real {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  margin-bottom: 4px;
}
.user-row-real .avatar { width: 36px; height: 36px; }
.user-row-name-static {
  flex: 1;
  font-size: 14px;
  color: var(--text);
}
.user-row-role {
  font-size: 12px;
  color: var(--text-dim);
  padding: 2px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-light);
  border-radius: 10px;
}
.user-row {
  display: flex; 
  align-items: center; 
  gap: 8px; 
  margin-bottom: 10px; 
  position: relative;
}
.user-row-avatar-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.user-row-avatar-btn:hover {
  border-color: rgba(246,199,0,0.4);
  background: rgba(255,255,255,0.08);
}
.user-row-avatar-btn .avatar {
  width: 100%;
  height: 100%;
}
.user-row-remove {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}
.user-row-remove:hover {
  background: rgba(255,107,107,0.15);
  color: #ff6b6b;
  border-color: rgba(255,107,107,0.3);
}
/* «Связать гостя с участником» - размер как у крестика, hover жёлтый */
.user-row-merge-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.user-row-merge-btn:hover {
  background: rgba(246,199,0,0.1);
  color: var(--text);
  border-color: rgba(246,199,0,0.4);
}
.stub-picker {
  position: absolute;
  top: 50px;
  left: 0;
  z-index: 50;
  background: linear-gradient(160deg, #1c1c2e 0%, #252540 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 6px;
  width: 320px;
  max-height: 240px;
  overflow-y: auto;
  animation: slideUp 0.15s ease-out;
}
.stub-picker-cell {
  background: rgba(255,255,255,0.04);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.stub-picker-cell:hover {
  background: rgba(255,255,255,0.07);
}
.stub-picker-cell.active {
  border-color: var(--gold);
  background: rgba(246,199,0,0.08);
}
.stub-picker-cell .avatar {
  width: 36px;
  height: 36px;
}
.user-row-name {
  flex: 1; 
  padding: 8px 12px; 
  border-radius: 8px;
  border: 1px solid var(--border-light); 
  background: rgba(255,255,255,0.05);
  color: #e8e8f0; 
  font-size: 14px; 
  outline: none;
  font-family: 'DM Sans', sans-serif;
}
.user-row-name:focus { 
  border-color: rgba(246,199,0,0.4); 
}
.btn-add-user {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px dashed rgba(255,255,255,0.15);
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
  width: 100%;
  margin-top: 4px;
}
.btn-add-user:hover {
  border-color: rgba(246,199,0,0.3);
  color: var(--gold);
}
.settings-api-btn {
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
  white-space: nowrap;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  gap: 4px;
}
.settings-api-btn.logout-btn {
  width: 100%;
  background: rgba(255, 107, 107, 0.15);
  color: #ff6b6b;
  font-size: 15px;
  padding: 13px;
}
.settings-api-btn:hover, .settings-api-btn.logout-btn:hover { 
  background: rgba(255,255,255,0.12); 
  color: var(--text); 
}
.settings-save-btn {
  width: 100%;
  padding: 0 13px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #1a1a1a;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: transform 0.2s;
  height: 42px;
}
.settings-save-btn:hover {
  transform: translateY(-1px);
}
.settings-save-btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

/* ===== PROFILE MODAL ===== */
.profile-preview-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}
.profile-preview-row #profilePreview .avatar {
  width: 96px;
  height: 96px;
}
.profile-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-user-code {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.profile-user-code-label {
  color: var(--text-muted);
}
.profile-code-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
}
.profile-code-copy:hover {
  border-color: rgba(246,199,0,0.4);
  color: var(--text);
  background: rgba(255,255,255,0.07);
}
.profile-code-copy.copied {
  border-color: rgba(74,222,128,0.4);
  color: #4ade80;
  background: rgba(74,222,128,0.08);
}
.profile-code-icon {
  font-size: 13px;
  line-height: 1;
}
.profile-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 8px;
}
.profile-preset-cell {
  background: rgba(255,255,255,0.04);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.profile-preset-cell:hover {
  background: rgba(255,255,255,0.07);
}
.profile-preset-cell.active {
  border-color: var(--gold);
  background: rgba(246,199,0,0.08);
}
.profile-preset-cell .avatar {
  width: 44px;
  height: 44px;
}
.profile-upload-btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px dashed rgba(255,255,255,0.15);
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
  width: 100%;
  text-align: center;
}
.profile-upload-btn:hover {
  border-color: rgba(246,199,0,0.3);
  color: var(--gold);
}

/* ===== WATCHLIST ===== */
.wl-empty { 
  text-align: center; 
  color: #555577; 
  font-size: 14px; 
  padding: 30px 0; }
.wl-item {
  display: flex; 
  align-items: center; 
  gap: 12px; 
  padding: 8px 10px;
  border-radius: 10px; 
  border: 1px solid var(--border); 
  margin-bottom: 6px;
  background: rgba(255,255,255,0.02); 
  transition: background 0.15s;
}
.wl-item:hover { 
  background: rgba(255,255,255,0.04); 
}
.wl-poster { 
  width: 36px; 
  height: 54px; 
  object-fit: cover; 
  border-radius: 5px; 
  flex-shrink: 0; 
}
.wl-no-poster {
  width: 36px; 
  height: 54px; 
  border-radius: 5px; 
  background: #2a2a3e;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  color: #555; 
  font-size: 18px; 
  flex-shrink: 0;
}
.wl-info { 
  flex: 1; 
  min-width: 0; 
}
.wl-title {
  font-size: 14px; 
  font-weight: 600; 
  color: #e8e8f0;
  font-family: 'Playfair Display', Georgia, serif;
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis;
}
.wl-meta { 
  font-size: 11px; 
  color: var(--text-dim); 
  margin-top: 2px; 
}
.wl-remove {
  background: none; 
  border: none; 
  color: #ff6b6b; 
  font-size: 16px;
  cursor: pointer; 
  padding: 4px 8px; 
  border-radius: 6px; 
  transition: background 0.2s;
  opacity: 0.4; 
  flex-shrink: 0;
}
.wl-remove:hover { 
  opacity: 1; 
  background: rgba(255,50,50,0.1); 
}

/* ===== ROULETTE ===== */
.roulette-setup { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  margin-bottom: 20px; 
}
.roulette-add-row { 
  display: flex; 
  gap: 8px; 
}
.roulette-add-row input { 
  flex: 1; 
}
.roulette-items { 
  display: flex; 
  flex-direction: column; 
  gap: 4px; 
  max-height: 200px; 
  overflow-y: auto; 
}
.roulette-item {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  padding: 8px 12px; 
  border-radius: 8px; 
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); 
  font-size: 14px; 
  color: #e0e0ee;
}
.roulette-item-remove {
  background: none; 
  border: none; 
  color: #ff6b6b; 
  cursor: pointer;
  font-size: 16px; 
  opacity: 0.4; 
  padding: 2px 6px; 
  border-radius: 4px;
}
.roulette-item-remove:hover { 
  opacity: 1; 
  background: rgba(255,50,50,0.1); 
}
.roulette-spin-btn {
  width: 100%; 
  padding: 14px; 
  border-radius: 12px; 
  border: none;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #1a1a1a; 
  font-size: 16px; 
  font-weight: 700; 
  cursor: pointer;
  font-family: 'DM Sans', sans-serif; 
  transition: transform 0.2s;
}
.roulette-spin-btn:hover { 
  transform: translateY(-1px); 
}
.roulette-spin-btn:disabled { 
  background: #3a3a4a; 
  color: #666; 
  cursor: not-allowed; 
  transform: none; 
}
.roulette-drum-wrap {
  position: relative; 
  height: 240px; 
  overflow: hidden; 
  border-radius: 16px;
  background: linear-gradient(145deg, #1a1a2e 0%, #222240 100%);
  border: 1px solid rgba(255,255,255,0.08); 
  margin-bottom: 20px;
}
.roulette-drum-mask {
  position: absolute; 
  inset: 0; 
  z-index: 2; 
  pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(15,15,26,1) 0%,
    rgba(15,15,26,0.7) 20%,
    transparent 38%,
    transparent 62%,
    rgba(15,15,26,0.7) 80%,
    rgba(15,15,26,1) 100%
  );
}
.roulette-drum-highlight {
  position: absolute; 
  top: 50%;
  left: 0; 
  right: 0; 
  z-index: 1;
  height: 48px; 
  transform: translateY(-50%);
  border-top: 2px solid rgba(246,199,0,0.4);
  border-bottom: 2px solid rgba(246,199,0,0.4);
  background: rgba(246,199,0,0.06);
}
.roulette-drum-track {
  position: absolute; 
  left: 0; 
  right: 0; 
  z-index: 0;
  transition: transform 0.1s linear;
}
.roulette-drum-item {
  height: 48px; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-size: 17px; 
  font-weight: 600; 
  color: #c0c0d8;
  font-family: 'Playfair Display', Georgia, serif;
  padding: 0 20px; 
  text-align: center;
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis;
}
.roulette-drum-item.winner { 
  color: var(--gold); 
}
.roulette-result {
  text-align: center; 
  padding: 16px; 
  border-radius: 12px;
  background: rgba(246,199,0,0.08); 
  border: 1px solid rgba(246,199,0,0.2);
}
.roulette-result-label { 
  font-size: 13px; 
  color: #9999b0; 
  margin-bottom: 6px; 
}
.roulette-result-title {
  font-size: 22px; 
  font-weight: 700; 
  color: var(--gold);
  font-family: 'Playfair Display', Georgia, serif;
}
.roulette-again-btn {
  margin-top: 16px; 
  width: 100%; 
  padding: 12px; 
  border-radius: 12px;
  border: 1px solid var(--border-light); 
  background: transparent;
  color: var(--text-dim); 
  font-size: 14px; 
  cursor: pointer;
  font-family: 'DM Sans', sans-serif; 
  transition: all 0.2s;
}
.roulette-again-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

/* ===== SVG ICONS ===== */
.i {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex-shrink: 0;
}
.status-icon-ok { color: #4ade80; }
.status-icon-err { color: #ff6b6b; }

/* ===== INVITATIONS (кнопка-колокольчик + бэйдж) ===== */
.btn-invitations, .btn-settings {
  position: relative;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-invitations:hover, .btn-settings:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}
/* Подсветка золотом, когда есть незакрытые заявки */
.btn-invitations.has-invitations {
  color: var(--gold);
  border-color: rgba(246,199,0,0.4);
}
/* Переключение двух SVG внутри кнопки по классу .has-invitations */
.btn-invitations .i-bell,
.btn-invitations .i-bell-exclamation {
  display: flex;
  line-height: 0;
}
.btn-invitations .i-bell-exclamation { display: none; }
.btn-invitations.has-invitations .i-bell { display: none; }
.btn-invitations.has-invitations .i-bell-exclamation { display: flex; }

.invitations-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff4d4d;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
}

/* ===== INVITATIONS MODAL (список заявок в клубы) ===== */
.invitations-loading,
.invitations-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-dim);
}
.invitations-empty-title {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 6px;
}
.invitations-empty-sub {
  font-size: 13px;
  color: var(--text-muted);
}
.invitation-card {
  position: relative;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  transition: opacity 0.2s;
}
.invitation-card-busy { opacity: 0.55; }
.invitation-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.invitation-meta { min-width: 0; }
.invitation-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.invitation-club {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}
.invitation-message {
  background: rgba(255,255,255,0.04);
  border-left: 3px solid rgba(246,199,0,0.4);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-dim);
  margin: 8px 0 10px;
  white-space: pre-wrap;
}
.invitation-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.invitation-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}
.invitation-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.invitation-btn:disabled { cursor: default; }
.invitation-btn-accept:hover {
  color: #4ade80;
  border-color: rgba(74,222,128,0.4);
}
.invitation-btn-reject:hover {
  color: #ff6b6b;
  border-color: rgba(255,107,107,0.4);
}
.invitations-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 20px 0 16px;
}
.invitation-sub { margin-top: 4px; }
.invitation-status {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
}
.invitation-status-pending {
  background: rgba(246,199,0,0.12);
  color: var(--gold);
}
.invitation-status-accepted {
  background: rgba(74,222,128,0.12);
  color: #4ade80;
}
.invitation-status-rejected {
  background: rgba(255,107,107,0.12);
  color: #ff6b6b;
}
.invitation-status-cancelled {
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
}
.invitations-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 14px;
}
.invitations-tab {
  position: relative;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.invitations-tab:hover { color: var(--text); }
.invitations-tab.active {
  color: var(--text);
  border-bottom-color: var(--gold);
}
.invitations-tab.has-unread::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(246,199,0,0.6);
}
.invitation-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  padding: 0;
  transition: all 0.15s;
}
.invitation-delete:hover {
  background: rgba(255,107,107,0.12);
  color: #ff6b6b;
  border-color: rgba(255,107,107,0.3);
}
.invitation-card.my-invitation .invitation-head { padding-right: 32px; }

/* ===== INVITE USER MODAL ===== */
.invite-result-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 0 16px;
}
.invite-result-meta { min-width: 0; }
.invite-result-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.invite-result-club {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}
.invite-message {
  resize: vertical;
  min-height: 72px;
  font-family: 'DM Sans', sans-serif;
  margin: 8px 0;
}
.invite-note {
  font-size: 14px;
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 8px 0 12px;
  line-height: 1.5;
}
.invite-note-warn {
  color: #ffb86b;
  background: rgba(255,184,107,0.06);
  border-color: rgba(255,184,107,0.25);
}
.invite-success {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(74,222,128,0.06);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 12px;
  margin: 8px 0 16px;
}
.invite-success .i {
  font-size: 28px;
  flex-shrink: 0;
}
.invite-success-text {
  font-size: 14px;
  color: var(--text);
}

/* ===== JOIN BY CODE MODAL (результат-вид) ===== */
.club-letter-avatar-md {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  font-size: 24px;
}
.join-result-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 0 16px;
}
.join-result-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Playfair Display', Georgia, serif;
}
.join-result-note {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 12px;
  line-height: 1.5;
}
.join-request-message {
  resize: vertical;
  min-height: 72px;
  font-family: 'DM Sans', sans-serif;
}
/* Назад-кнопка с SVG-стрелкой: даём ей flex, чтобы текст и иконка ровно стояли */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ===== SCROLLBAR (глобально) ===== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #3a3a4a;
  border-radius: 3px;
}

@media (max-width: 600px) {
  .logo { 
    font-size: 28px; 
  }
  .header-inner { 
    padding: 24px 16px 20px; 
  }
  .content { 
    padding: 20px 16px 40px; 
  }
  .grid { 
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
    gap: 14px; 
  }
  .modal { 
    padding: 20px; 
    width: 95%; 
  }
  .selected-poster, .selected-no-poster { 
    width: 90px; 
  }
  .setup-box {
    padding: 24px;
  }
}

/* ===== РОЛИ И ПРАВА ===== */

/* ===== Кастомный select ===== */
.cselect {
  position: relative;
  display: inline-block;
}
.cselect-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.cselect-toggle:hover {
  border-color: rgba(246,199,0,0.4);
  background: rgba(255,255,255,0.07);
}
.cselect-caret {
  font-size: 10px;
  color: var(--text-dim);
  transition: transform 0.15s;
}
.cselect.open .cselect-caret { 
  transform: rotate(180deg); 
}
.cselect-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 60;
  min-width: 100%;
  background: linear-gradient(160deg, #1c1c2e 0%, #252540 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  display: none;
  overflow: hidden;
  animation: slideUp 0.15s ease-out;
}
.cselect.open .cselect-menu { 
  display: block; 
}
.cselect-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s;
}
.cselect-option:hover { 
  background: rgba(255,255,255,0.06); 
}
.cselect-option.active {
  color: var(--gold);
  background: rgba(246,199,0,0.06);
}

/* Полноширинная версия - для модалок приглашений. */
.invite-role-block .cselect,
.invitation-role .cselect { 
  display: block; width: 100%; 
}
.invite-role-block .cselect-toggle,
.invitation-role .cselect-toggle {
  width: 100%;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 14px;
  border-radius: 8px;
}

/* Маленький бейдж «инд.» рядом с селектором роли */
.user-row-individual {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(246,199,0,0.1);
  border: 1px solid rgba(246,199,0,0.3);
  padding: 2px 6px;
  border-radius: 6px;
  cursor: help;
}

/* Кнопка-шестерёнка «настроить детально» рядом с селектором роли. */
.user-row-perms-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  transition: all 0.2s;
}
.user-row-perms-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-color: rgba(246,199,0,0.3);
}

/* Кнопка «исключить» */
.user-row-kick-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  transition: all 0.2s;
}
.user-row-kick-btn:hover {
  background: rgba(255, 107, 107, 0.12);
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.4);
}

/* Шапка модалки kick */
.kick-member-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}
.kick-member-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  color: var(--text);
}

/* Бывший участник */
.user-row-former { opacity: 0.65; }
.user-row-former .user-row-role { color: var(--text-muted); font-style: italic; }
.member-former { opacity: 0.55; }

/* Toggle-строка в настройках */
.settings-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-dim);
  user-select: none;
}
.settings-toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
  flex-shrink: 0;
}
.settings-toggle-row input[type="checkbox"]:disabled { cursor: default; opacity: 0.5; }
.settings-toggle-row input[type="checkbox"]:disabled + .settings-toggle-text { opacity: 0.5; }
.settings-toggle-text { line-height: 1.4; }

/* Список преемников в модалке transfer_ownership */
.transfer-owner-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  max-height: 320px;
  overflow-y: auto;
}
.transfer-owner-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  text-align: left;
  transition: all 0.2s;
}
.transfer-owner-card:hover {
  background: rgba(255, 255, 255, 0.06);
}
.transfer-owner-card.selected {
  background: rgba(246, 199, 0, 0.08);
  border-color: rgba(246, 199, 0, 0.4);
}
.transfer-owner-card-name {
  flex: 1;
  color: var(--text);
}
.transfer-owner-card-role {
  color: var(--text-muted);
  font-size: 13px;
}
.transfer-owner-empty {
  padding: 16px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Popup «детальная настройка прав». */
.member-perms-popup {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 50;
  width: 300px;
  background: linear-gradient(160deg, #1c1c2e 0%, #252540 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  padding: 14px;
  animation: slideUp 0.15s ease-out;
}
.member-perms-title {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
  font-weight: 600;
}
.member-perms-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.member-perms-row input[type="checkbox"] {
  accent-color: var(--gold);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}
.member-perms-label { flex: 1; }
/* Метка строки, которая отличается от дефолта роли */
.member-perms-row-overridden {
  margin-left: -10px;
  padding-left: 10px;
  border-left: 2px solid rgba(246,199,0,0.5);
  background: rgba(246,199,0,0.04);
  border-radius: 0 6px 6px 0;
}
.member-perms-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255,255,255,0.08);
}
.member-perms-reset {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.member-perms-reset:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.member-perms-done {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(246,199,0,0.4);
  background: rgba(246,199,0,0.1);
  color: var(--gold);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.member-perms-done:hover {
  background: rgba(246,199,0,0.18);
}

/* Звёзды read-only в модалке оценок */
.rating-stars-readonly { opacity: 0.55; pointer-events: none; }
.rating-user-readonly .rating-user-name { opacity: 0.75; }

/* Лейбл над селектором роли в модалках приглашений. */
.role-select-label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.invite-role-block { margin: 4px 0 8px; }
.invitation-role { margin: 6px 0 8px; }

/* Заблокированное поле названия */
#settingsTitle:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}