/* ================================================================
   @FONT-FACE — HOME VIDEO
   ================================================================ */
@font-face {
  font-family: 'Home Video';
  src: url('../fonts/homevideo-regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Home Video';
  src: url('../fonts/homevideo-bold.otf') format('opentype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Color Emoji';
  src: url('../fonts/NotoColorEmoji-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ================================================================
   LOST VAULT — Единый CSS с системой тем
   Объединённый: style2.css (темы) + style.css (база) + auth.css (компоненты)
   ================================================================ */

/* ================================================================
   CSS CUSTOM PROPERTIES — СИСТЕМА ТЕМ
   ================================================================ */

:root {
  /* === ТЁМНАЯ ТЕМА (по умолчанию) === */
  --font-base: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Home Video', 'Inter', sans-serif;
  --font-heading-black: 'Home Video', 'Inter', sans-serif;
  --font-mono: 'Home Video', monospace;

  --bg-body: #0a0a0a;
  --bg-header: rgba(10,10,10,0.85);
  --bg-card: rgba(255,255,255,0.02);
  --bg-card-hover: rgba(255,255,255,0.05);
  --bg-elevated: rgba(255,255,255,0.03);
  --bg-hover: rgba(255,255,255,0.06);
  --bg-input: rgba(255,255,255,0.03);
  --bg-input-focus: rgba(255,255,255,0.05);
  --bg-modal: rgba(16,16,16,0.96);
  --bg-login-modal: rgba(16,16,16,0.98);
  --bg-profile: rgba(16,16,16,0.98);
  --bg-skeleton: rgba(255,255,255,0.02);
  --bg-skeleton-gradient: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  --bg-skeleton-bar: rgba(255,255,255,0.04);
  --bg-skeleton-bar-meta: rgba(255,255,255,0.03);
  --bg-badge: rgba(255,255,255,0.06);
  --bg-badge-active: rgba(229,9,20,0.25);
  --bg-status-watched: rgba(76,175,80,0.2);
  --bg-status-unwatched: rgba(244,67,54,0.15);
  --bg-notice: rgba(255,193,7,0.06);
  --bg-readonly: rgba(255,193,7,0.06);
  --bg-footer: rgba(10,10,10,0.85);

  --text-primary: #fff;
  --text-secondary: rgba(255,255,255,0.7);
  --text-tertiary: rgba(255,255,255,0.68);
  --text-muted: rgba(255,255,255,0.58);
  --text-dim: rgba(255,255,255,0.50);
  --text-faint: rgba(255,255,255,0.45);
  --text-placeholder: rgba(255,255,255,0.5);
  --text-error: #f44336;
  --text-success: #4caf50;
  --text-warning: #ffc107;

  --primary: #e50914;
  --primary-hover: #b20710;
  --primary-soft: rgba(229,9,20,0.12);
  --primary-soft-hover: rgba(229,9,20,0.25);

  --border-subtle: rgba(255,255,255,0.04);
  --border-light: rgba(255,255,255,0.06);
  --border-medium: rgba(255,255,255,0.08);
  --border-input: rgba(255,255,255,0.06);
  --border-input-focus: rgba(229,9,20,0.4);
  --border-card: rgba(255,255,255,0.03);
  --border-card-hover: rgba(255,255,255,0.06);
  --border-status-watched: rgba(76,175,80,0.1);
  --border-status-unwatched: rgba(244,67,54,0.1);
  --border-notice: rgba(255,193,7,0.1);
  --border-readonly: rgba(255,193,7,0.1);
  --border-modal: rgba(255,255,255,0.05);

  --shadow-card-hover: 0 20px 60px rgba(0,0,0,0.5);
  --shadow-search-focus: 0 20px 60px rgba(0,0,0,0.5);
  --shadow-modal: none;

  --scrollbar-track: rgba(229,9,20,0.04);
  --scrollbar-track-border: rgba(229,9,20,0.06);
  --scrollbar-thumb: rgba(229,9,20,0.25);
  --scrollbar-thumb-hover: rgba(229,9,20,0.6);
  --scrollbar-thumb-active: rgba(229,9,20,0.8);

  --role-admin-bg: rgba(229,9,20,0.2);
  --role-admin-text: #e50914;
  --role-moderator-bg: rgba(255,193,7,0.15);
  --role-moderator-text: #ffc107;
  --role-user-bg: rgba(76,175,80,0.15);
  --role-user-text: #4caf50;

  --icon-filter: none;
  --logo-filter: brightness(0) invert(1);

  --ambient-glow: radial-gradient(ellipse at 15% 0%, rgba(229,9,20,0.06) 0%, transparent 45%),
                  radial-gradient(ellipse at 85% 100%, rgba(0,150,255,0.04) 0%, transparent 45%);
  --glow-heading: 0 0 28px rgba(229,9,20,0.28), 0 0 56px rgba(229,9,20,0.08);
  --glow-input: 0 0 0 3px rgba(229,9,20,0.12), 0 12px 32px rgba(0,0,0,0.35);
  --selection-bg: rgba(229,9,20,0.6);
  --selection-text: #ffffff;
  --tip-bg: #161616;
  --tip-border: #3a3a3a;
  --tip-text: #f0f0f0;
  --tip-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 12px rgba(229,9,20,0.06);
}

/* === СВЕТЛАЯ ТЕМА === */
[data-theme="light"] {
  --bg-body: #f5f5f7;
  --bg-header: rgba(245,245,247,0.95);
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-elevated: #ffffff;
  --bg-hover: #eff4ff;
  --bg-input: #f5f7fb;
  --bg-input-focus: #ffffff;
  --bg-modal: #ffffff;
  --bg-login-modal: #ffffff;
  --bg-profile: #ffffff;
  --bg-skeleton: #f0f4ff;
  --bg-skeleton-gradient: linear-gradient(135deg, #eff4ff, #f7f9ff);
  --bg-skeleton-bar: #e7efff;
  --bg-skeleton-bar-meta: #d8e2f8;
  --bg-badge: #f3f7ff;
  --bg-badge-active: rgba(23,112,255,0.12);
  --bg-status-watched: rgba(0, 166, 255, 0.12);
  --bg-status-unwatched: rgba(255, 181, 38, 0.12);
  --bg-notice: rgba(255, 181, 38, 0.10);
  --bg-readonly: rgba(255, 181, 38, 0.08);
  --bg-footer: rgba(245,245,247,0.95);

  --text-primary: #0b0d11;
  --text-secondary: rgba(11,13,17,0.75);
  --text-tertiary: rgba(11,13,17,0.67);
  --text-muted: rgba(11,13,17,0.60);
  --text-dim: rgba(11,13,17,0.60);
  --text-faint: rgba(11,13,17,0.60);
  --text-placeholder: rgba(11,13,17,0.55);
  --text-error: #e63757;
  --text-success: #00a854;
  --text-warning: #ffb526;

  --primary: #000000;
  --primary-hover: #333333;
  --primary-soft: rgba(0,0,0,0.10);
  --primary-soft-hover: rgba(0,0,0,0.18);

  --border-subtle: rgba(49,55,74,0.06);
  --border-light: rgba(49,55,74,0.10);
  --border-medium: rgba(49,55,74,0.15);
  --border-input: rgba(49,55,74,0.12);
  --border-input-focus: rgba(56,116,255,0.5);
  --border-card: rgba(49,55,74,0.06);
  --border-card-hover: rgba(49,55,74,0.12);
  --border-status-watched: rgba(0,210,122,0.15);
  --border-status-unwatched: rgba(230,55,87,0.12);
  --border-notice: rgba(255,204,0,0.15);
  --border-readonly: rgba(255,204,0,0.12);
  --border-modal: rgba(49,55,74,0.08);

  --shadow-card-hover: 0 8px 24px rgba(49,55,74,0.08);
  --shadow-search-focus: 0 8px 24px rgba(49,55,74,0.06);
  --shadow-modal: 0 20px 60px rgba(49,55,74,0.12);

  --scrollbar-track: rgba(49,55,74,0.03);
  --scrollbar-track-border: rgba(49,55,74,0.05);
  --scrollbar-thumb: rgba(49,55,74,0.20);
  --scrollbar-thumb-hover: rgba(49,55,74,0.40);
  --scrollbar-thumb-active: rgba(49,55,74,0.60);

  --role-admin-bg: rgba(230,55,87,0.10);
  --role-admin-text: #e63757;
  --role-moderator-bg: rgba(56,116,255,0.10);
  --role-moderator-text: #3874ff;
  --role-user-bg: rgba(0,210,122,0.10);
  --role-user-text: #00a854;

  --icon-filter: brightness(0) saturate(100%);
  --logo-filter: none;

  --ambient-glow: radial-gradient(ellipse at 15% 0%, rgba(56,116,255,0.04) 0%, transparent 45%),
                  radial-gradient(ellipse at 85% 100%, rgba(230,55,87,0.03) 0%, transparent 45%);
  --glow-heading: 0 0 18px rgba(56,116,255,0.10), 0 0 36px rgba(56,116,255,0.04);
  --glow-input: 0 0 0 3px rgba(56,116,255,0.10), 0 8px 24px rgba(49,55,74,0.06);
  --selection-bg: rgba(56,116,255,0.22);
  --selection-text: #0b0d11;
  --tip-bg: #ffffff;
  --tip-border: #d5d9e2;
  --tip-text: #0b0d11;
  --tip-shadow: 0 8px 24px rgba(49,55,74,0.14);
}

/* ================================================================
   БАЗОВЫЙ СБРОС И ТЕМА
   ================================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  font-family: var(--font-base);
  background: var(--bg-body);
  background-image: var(--ambient-glow);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading-black);
  color: var(--text-primary);
  margin: 0;
}

h1 { font-size: 64px; line-height: 1.1; }
h2 { font-size: 40px; line-height: 1.2; }

h1, h2 { text-shadow: var(--glow-heading); }

p, label, input, select, textarea, a, span, div {
  font-family: var(--font-base);
}

button, .btn, [class*="btn"], [class*="tab"], [class*="submit"], [class*="action"], [class*="close"], [class*="toggle"], [class*="clear"] {
  font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-weight: normal;
}

p { font-size: 14px; line-height: 1.6; }

.parallax-bg {
  position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
  background: radial-gradient(ellipse at 15% 40%, rgba(229,9,20,0.07) 0%, transparent 55%),
              radial-gradient(ellipse at 85% 70%, rgba(0,150,255,0.05) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 20%, rgba(229,9,20,0.04) 0%, transparent 40%),
              var(--bg-body);
  z-index: -2;
  animation: pulse 25s ease-in-out infinite alternate;
  transition: all 0.3s ease;
}

@keyframes pulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ================================================================
   ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ
   ================================================================ */
#themeToggle {
    background: rgba(229, 9, 20, 0.12);
    border-color: rgba(229, 9, 20, 0.25);
    color: #e50914;
}
#themeToggle:hover {
    background: rgba(229, 9, 20, 0.25);
}
.theme-icon-light { display: none; }

[data-theme="light"] .theme-icon-dark { display: none; }

[data-theme="light"] .theme-icon-light { display: inline; }

/* ================================================================
   ШАПКА
   ================================================================ */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 72px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}

.logo-img {
  height: 100%; width: auto; display: block;
  filter: var(--logo-filter);
  transition: filter 0.3s ease;
}

.stats {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--text-muted);
  flex-shrink: 0; transition: opacity 0.4s ease; z-index: 2;
}

.stats span { display: flex; align-items: center; gap: 4px; }
.stats .num { color: var(--text-primary); font-weight: bold; font-size: 13px; }
.stats .watched .num { color: var(--text-success); }
.stats .unwatched .num { color: var(--text-error); }

.center-wrapper {
  display: flex; align-items: center; justify-content: center;
  flex: 1 1 auto; min-width: 0; position: relative; gap: 16px;
  transition: all 0.6s cubic-bezier(0.22,1,0.36,1);
}

.logo-center {
  flex-shrink: 1; height: 42px;
  transition: all 0.5s cubic-bezier(0.22,1,0.36,1);
  overflow: hidden; display: flex; align-items: center; min-width: 0;
}

/* ================================================================
   АУТЕНТИФИКАЦИЯ
   ================================================================ */
.auth-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.auth-btn {
    background: var(--primary-soft);
    border: 1px solid var(--primary-soft-hover);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    white-space: nowrap;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.auth-btn:hover {
    background: var(--primary-soft-hover);
    transform: scale(1.02);
}

.auth-btn.logout {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    color: var(--text-dim);
}

.auth-btn.logout:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 32px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.nav-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
    transform: scale(1.02);
}

.nav-btn.active {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.lang-dropdown {
    position: relative;
}

.lang-dropdown-toggle {
    gap: 6px;
}

.lang-toggle-label {
    color: var(--text-muted);
}

.lang-toggle-current {
    font-weight: 600;
}

.lang-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 170px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.35);
    z-index: 1000;
    display: none;
    box-sizing: border-box;
}

.lang-dropdown.open .lang-menu {
    display: block;
}

.lang-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
}

.lang-item:hover {
    background: var(--bg-hover);
}

.lang-item.active {
    color: var(--primary);
}

.lang-item-check {
    font-size: 12px;
}

.site-footer {
    width: 100%;
    background: var(--bg-header);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border-subtle);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-hosting {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
}

.footer-hosting:hover {
    color: var(--text-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.user-info .role-badge {
    color: var(--role-user-text);
    font-size: 12px;
    font-weight: bold;
}

.user-info .role-badge.moderator {
    color: var(--role-moderator-text);
}

.user-info .role-badge.admin {
    color: var(--role-admin-text);
}

/* ================================================================
   МОДАЛКА ЛОГИНА
   ================================================================ */
.login-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: opacity, backdrop-filter;
}

.login-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.login-modal {
    background: var(--bg-login-modal);
    border: 1px solid var(--border-light);
    border-radius: 5px;
    padding: 32px;
    width: 90%;
    max-width: 380px;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.login-modal-overlay.active .login-modal {
    transform: translateY(0) scale(1);
}

.login-modal h2 {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 24px;
    text-align: center;
    color: var(--text-primary);
}

.login-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: 5px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin-bottom: 12px;
    outline: none;
    transition: all 0.3s ease;
}

.login-input:focus {
    border-color: var(--border-input-focus);
    background: var(--bg-input-focus);
}

.login-input::placeholder {
    color: var(--text-placeholder);
}

.password-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 12px;
}
.password-wrapper .login-input {
    padding-right: 40px;
    margin-bottom: 0;
}
.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.password-toggle:hover {
    opacity: 0.8;
}
.password-toggle img {
    width: 20px;
    height: 20px;
    display: block;
    filter: var(--icon-filter, none);
}
.password-toggle.active img {
    opacity: 0.35;
}

.login-submit {
    width: 100%;
    background: var(--primary);
    border: none;
    border-radius: 5px;
    padding: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin-top: 8px;
}

.login-submit:hover {
    background: var(--primary-hover);
    transform: scale(1.01);
}

.login-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.login-error {
    color: var(--text-error);
    font-size: 12px;
    margin-top: 8px;
    text-align: center;
    min-height: 18px;
}

.login-hint {
    color: var(--text-faint);
    font-size: 11px;
    margin-top: 16px;
    text-align: center;
}

.login-hint a {
    color: var(--text-secondary);
    text-decoration: underline;
    cursor: pointer;
}

/* ================================================================
   КАПЧА В МОДАЛКЕ ЛОГИНА
   ================================================================ */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.captcha-img {
    border-radius: 4px;
    height: 50px;
    flex-shrink: 0;
    display: block;
    border: 1px solid var(--border-subtle);
}

.captcha-refresh {
    background: var(--bg-elevated);
    border: 2px solid var(--border-light);
    color: var(--text-tertiary);
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1;
    padding: 0;
}

.captcha-refresh:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
    transform: scale(1.1);
}

.captcha-refresh:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.captcha-placeholder {
    flex: 1;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px dashed var(--border-light);
    border-radius: 4px;
    color: var(--text-faint);
    font-size: 12px;
    cursor: default;
    user-select: none;
}

.emoji-captcha {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.emoji-captcha-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    text-align: center;
    user-select: none;
}

.emoji-row {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
    width: 100%;
}

.emoji-grid {
    display: flex;
    gap: 4px;
}

.emoji-btn {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-elevated);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: 'Noto Color Emoji', 'Segoe UI Emoji', 'Apple Color Emoji', 'EmojiOne Color', sans-serif;
    line-height: 1;
    padding: 0;
    user-select: none;
    position: relative;
}

.emoji-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
    transform: scale(1.1);
}

.emoji-btn .emoji-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 18px;
    height: 18px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: normal;
    font-family: 'Home Video', sans-serif;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    transition: all 0.2s ease;
    z-index: 1;
}

.emoji-btn .emoji-badge.done {
    background: var(--text-success);
    box-shadow: 0 2px 6px rgba(0,200,0,0.4);
}

.emoji-btn.clicked {
    border-color: var(--text-success);
    background: rgba(0, 200, 0, 0.1);
    cursor: default;
    transform: scale(0.95);
    opacity: 0.6;
}

.honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    padding: 0;
    margin: 0;
    border: none;
    font-size: 0;
}

.login-hint a:hover {
    color: var(--text-secondary);
}

@supports not (backdrop-filter: blur(20px)) {
    .login-modal-overlay {
        background: rgba(0, 0, 0, 0.95);
    }
}

/* ================================================================
   READ-ONLY ИНДИКАТОР
   ================================================================ */
.read-only-notice {
    background: var(--bg-readonly);
    border: 1px solid var(--border-readonly);
    border-radius: 5px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--text-tertiary);
    display: none;
    align-items: center;
    gap: 8px;
}

.read-only-notice.visible {
    display: flex;
}

.read-only-notice .icon {
    font-size: 16px;
}

/* ================================================================
   ЗАПРЕТ КНОПКИ В МОДАЛКЕ
   ================================================================ */
.modal-btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.modal-btn-primary.no-permission {
    background: var(--bg-elevated) !important;
    color: var(--text-dim) !important;
    border: 1px solid var(--border-subtle);
}

#modalToggleStatus.toggle-watch {
    background: var(--role-user-text);
    color: #fff;
    border: none;
}
#modalToggleStatus.toggle-unwatch {
    background: var(--primary);
    color: #fff;
    border: none;
}
#modalToggleStatus:hover {
    filter: brightness(1.15);
    transform: scale(1.02);
}
#modalToggleStatus:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}
#modalToggleStatus.no-permission {
    background: var(--bg-elevated) !important;
    color: var(--text-dim) !important;
    border: 1px solid var(--border-subtle);
}

/* ================================================================
   ОСНОВНЫЕ СТИЛИ
   ================================================================ */
.container { width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px 32px 100px; flex: 1; }

/* ================================================================
   РАЗДЕЛЫ (ВКЛАДКИ)
   ================================================================ */
.sections-bar {
  display: flex; gap: 4px; margin-bottom: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
}

.section-tab {
  background: transparent; border: none;
  padding: 10px 20px; border-radius: 5px;
  color: var(--text-tertiary);
  font-size: 14px; font-weight: normal;
  cursor: pointer; transition: all 0.3s ease;
  font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; position: relative;
  display: flex; align-items: center; gap: 8px;
}


.section-tab.active {
  color: var(--text-primary);
  background: var(--primary-soft);
}

.section-tab .badge {
  font-family: 'Home Video';
  font-weight: bold;
  font-size: 14px;
  color: inherit;
  transition: all 0.3s ease;
}

/* ================================================================
   ПОДФИЛЬТРЫ
   ================================================================ */
.subfilters {
  display: flex; gap: 6px; margin-bottom: 20px;
  flex-wrap: wrap; align-items: center;
}

.subfilters-label {
  font-size: 12px; color: var(--text-dim);
  margin-right: 8px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.filter-btn {
  background: transparent; border: none;
  padding: 6px 18px; border-radius: 5px;
  color: var(--text-tertiary);
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.3s ease;
  font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.filter-btn.active {
  color: var(--text-primary);
  background: var(--primary-soft);
}

.filter-btn .badge {
  font-family: 'Home Video';
  font-weight: bold;
  font-size: 13px; margin-left: 6px;
  color: inherit;
}

.results-info {
  font-size: 13px; color: var(--text-dim);
  margin-bottom: 20px;
}

.results-info strong {
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ================================================================
   СЕТКА ФИЛЬМОВ
   ================================================================ */
.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.movie-card {
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  contain: layout style paint;
}

.movie-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

.movie-card .card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 5px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
}

.movie-card:hover .card-inner {
  background: var(--bg-card-hover);
  border-color: var(--border-card-hover);
}

.movie-card .poster {
  width: 100%; aspect-ratio: 2/3;
  background: linear-gradient(135deg, rgba(229,9,20,0.03), rgba(0,0,0,0.2));
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.movie-card .poster .placeholder {
  font-size: 48px;
  color: var(--text-faint);
  background: linear-gradient(135deg, rgba(229,9,20,0.03), rgba(0,0,0,0.2));
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.movie-card .poster .poster-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.movie-card .poster-controls {
  position: absolute; bottom: 6px; left: 6px; right: 6px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
  background: rgba(0,0,0,0.7);
  border-radius: 4px;
  padding: 2px 6px;
}
.movie-card .poster-controls > * { pointer-events: auto; }
.movie-card .poster-rating {
  position: absolute; top: 6px; right: 6px;
  z-index: 2;
  pointer-events: none;
  background: rgba(0,0,0,0.7);
  border-radius: 4px;
  padding: 2px 6px;
  display: flex;
  align-items: center;
}
.movie-card .poster-rating .rating-stars {
  padding: 0;
}
.movie-card .status-badge {
  font-size: 12px; font-weight: normal;
  line-height: 1.3;
  color: var(--text-primary);
  font-family: 'Home Video', sans-serif;
}

.status-badge.watched {
  color: var(--text-success);
}

.status-badge.unwatched {
  color: var(--text-error);
}

.status-badge.partial {
  color: var(--text-warning);
}

[data-theme="light"] .status-badge.partial {
  color: var(--primary);
}

.movie-card.border-tier-bronze .card-inner { border-color: #cd7f32; }
.movie-card.border-tier-silver .card-inner { border-color: #c0c0c0; }
.movie-card.border-tier-gold .card-inner { border-color: #ffd700; }
.movie-card.border-tier-platinum .card-inner { border-color: #e5e4e2; }

.movie-card.watched {
  contain: none;
}

.movie-card.holo {
  perspective: 1000px;
  contain: layout style;
}

.movie-card.holo .card-inner {
  transform-style: preserve-3d;
  transform: rotateY(var(--rotate-y, 0deg)) rotateX(var(--rotate-x, 0deg));
  transition: all 0.4s cubic-bezier(0.25,0.46,0.45,0.94), transform 0.1s ease-out;
  will-change: transform;
}

.movie-card.holo .card-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 219, 112, 0.3) 40%,
    rgba(9, 255, 219, 0.2) 45%,
    rgba(255, 115, 115, 0.2) 50%,
    transparent 55%
  );
  background-size: 200% 200%;
  background-position: var(--bg-x, 50%) var(--bg-y, 50%);
  mix-blend-mode: color-dodge;
  pointer-events: none;
}

.movie-card.holo.watched .card-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: url('https://assets.codepen.io/13471/sparkles.gif');
  background-size: 160%;
  mix-blend-mode: overlay;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.movie-card.holo.watched:hover .card-inner::before {
  opacity: 0.25;
}

.movie-card .info {
  padding: 14px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.movie-card .title {
  font-size: 15px; font-weight: bold;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  color: var(--text-primary);
}

.movie-card .meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text-dim);
  margin-top: 4px; flex-wrap: wrap;
}

.movie-card .meta .year { color: var(--text-tertiary); }
.movie-card .meta .dot {
  width: 2px; height: 2px; border-radius: 50%;
  background: var(--text-faint);
}
.movie-card .meta .franchise {
  color: var(--text-dim);
  font-size: 11px;
}
.movie-card .footer .suggester {
  font-size: 10px;
  color: var(--text-dim);
  margin-right: auto;
}

.movie-card .footer {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
}

.movie-card .source-tag {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  background: var(--bg-elevated);
  padding: 2px 10px;
  border-radius: 5px;
}

.franchise-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.franchise-progress-track {
  flex: 1;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}
.franchise-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.franchise-progress-fill.watched { background: var(--text-success); }
.franchise-progress-fill.partial { background: var(--text-warning); }
.franchise-progress-fill.unwatched { background: var(--text-error); }

.vote-stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}
.vote-stars .star-icon { display: block; transition: fill 0.3s ease; }
.vote-stars .vote-count { font-size: 12px; font-weight: normal; transition: color 0.3s ease; }
.vote-stars.vote-bronze .star-icon { fill: #cd7f32; }
.vote-stars.vote-bronze .vote-count { color: #cd7f32; }
.vote-stars.vote-silver .star-icon { fill: #c0c0c0; }
.vote-stars.vote-silver .vote-count { color: #c0c0c0; }
.vote-stars.vote-gold .star-icon { fill: #ffd700; }
.vote-stars.vote-gold .vote-count { color: #ffd700; }
.vote-stars.vote-platinum .star-icon { fill: #e5e4e2; }
.vote-stars.vote-platinum .vote-count { color: #e5e4e2; }
.vote-stars.voted .star-icon { filter: drop-shadow(0 0 4px currentColor); }

/* ================================================================
   РЕЙТИНГ (1–10)
   ================================================================ */
.rating-stars {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 4px 12px 0;
  user-select: none;
  --star-fill: #ffd700;
  --star-empty: #555;
  --star-rated: #ffaa00;
}
.rating-star {
  display: inline-block;
  width: 24px;
  height: 24px;
  color: var(--star-empty);
  position: relative;
}
.rating-star .star-icon {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}
.rating-star.full { color: var(--star-fill); }
.rating-star.half { color: var(--star-fill); }
.rating-star.rated .star-icon {
  filter: drop-shadow(0 0 3px var(--star-rated));
}
.rating-num {
  font-size: 14px;
  color: var(--text-dim);
  margin-right: 4px;
  min-width: 24px;
}

/* ================================================================
   МОДАЛЬНЫЙ РЕЙТИНГ (голосование 1–10)
   ================================================================ */
.modal-rating-stars {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 2px;
  padding: 8px 0;
  --star-fill: #ffd700;
  --star-empty: #555;
  --star-active: #ffaa00;
}
.modal-star {
  display: inline-block;
  width: 16px;
  height: 16px;
  color: var(--star-empty);
  cursor: pointer;
  transition: color 0.15s;
}
.modal-star .star-icon {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
  transition: fill 0.15s;
}
.modal-star.active { color: var(--star-fill); }
.modal-star.active .star-icon { filter: drop-shadow(0 0 3px var(--star-active)); }
.modal-star:hover,
.modal-star.hover { color: var(--star-fill); }
.modal-rating-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-left: 8px;
  min-width: 30px;
}
.modal-rating-user {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 4px;
}

/* ================================================================
   МОДАЛКА
   ================================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(0.92);
  max-width: 650px; width: 94%;
  max-height: 92vh;
  background: var(--bg-modal);
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  border-radius: 5px;
  z-index: 1001;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
  border: 1px solid var(--border-modal);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  box-shadow: var(--shadow-modal);
}

.modal.active {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%,-50%) scale(1);
}

.modal-poster {
  position: relative;
  flex-shrink: 0;
  width: 220px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-poster-placeholder {
  display: none;
  font-size: 48px;
  color: var(--text-faint);
  opacity: 0.4;
}

.modal-poster.no-poster .modal-poster-img {
  display: none;
}

.modal-poster.no-poster .modal-poster-placeholder {
  display: block;
}

.modal-content {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
  padding: 32px 32px 32px;
}

.modal-title {
  font-size: 26px; font-weight: bold;
  margin-bottom: 2px;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.modal-year {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.modal-status {
  display: inline-block;
  padding: 3px 14px; border-radius: 5px;
  font-size: 11px; font-weight: bold;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.modal-status.watched {
  background: var(--bg-status-watched);
  color: var(--text-success);
}

.modal-status.unwatched {
  background: var(--bg-status-unwatched);
  color: var(--text-error);
}

.modal-description {
  font-size: 14px; line-height: 1.7;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

.modal-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
  font-size: 13px;
}

.modal-details .label {
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.modal-details .value {
  color: var(--text-secondary);
}

.modal-actions {
  display: flex; gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.modal-btn {
  padding: 10px 22px; border-radius: 5px;
  border: none;
  font-size: 13px; font-weight: normal;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex;
  align-items: center; gap: 8px;
}

.modal-btn-primary {
  background: var(--primary);
  color: #fff;
}

.modal-btn-primary:hover {
  background: var(--primary-hover);
  transform: scale(1.02);
}

/* ================================================================
   ПУСТЫЕ СОСТОЯНИЯ
   ================================================================ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-faint);
}

.empty-state .icon { font-size: 56px; margin-bottom: 12px; }
.empty-state h3 {
  font-size: 18px; font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.empty-state p {
  font-size: 13px;
  color: var(--text-faint);
}
.empty-state .sub {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 8px;
}

.notice {
  background: var(--bg-notice);
  border: 1px solid var(--border-notice);
  border-radius: 5px;
  padding: 12px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}

.notice .icon { font-size: 20px; }
.notice a { color: var(--text-warning); text-decoration: none; }
.notice a:hover { text-decoration: underline; }
.notice .btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  padding: 4px 12px;
  color: var(--text-tertiary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  margin-left: auto;
}
.notice .btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ================================================================
   ПОЛЕ ПОИСКА
   ================================================================ */
.search-wrapper {
  display: flex; align-items: center;
  background: var(--bg-input);
  border-radius: 5px;
  padding: 5px 10px 5px 12px;
  border: 1px solid var(--border-subtle);
  transition: all 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
  flex: 0 1 auto;
  max-width: 220px; min-width: 140px;
  position: relative; gap: 6px; z-index: 2;
  height: 32px;
}

.search-wrapper:focus-within {
  border-color: var(--border-medium);
  background: var(--bg-input-focus);
  box-shadow: var(--shadow-search-focus);
}

.search-icon {
  color: var(--text-dim);
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.search-wrapper:focus-within .search-icon {
  color: var(--text-tertiary);
}

.search-input {
  background: transparent; border: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  width: 100%;
  font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-width: 40px;
  height: 100%;
}

.search-input::placeholder {
  color: var(--text-placeholder);
  font-weight: 400;
  transition: opacity 0.3s ease;
}

.search-wrapper:focus-within .search-input::placeholder {
  opacity: 0.6;
}

.search-clear {
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 2px 2px 4px;
  display: none;
  transition: color 0.3s;
  flex-shrink: 0;
}

.search-clear.visible { display: block; }
.search-clear:hover { color: var(--text-primary); }

.search-global-label {
  display: flex; align-items: center; gap: 3px;
  cursor: pointer; white-space: nowrap;
  color: var(--text-dim); font-size: 11px;
  user-select: none; flex-shrink: 0;
}
.search-global-label input { cursor: pointer; accent-color: var(--text-error); width: 12px; height: 12px; margin: 0; }
.search-global-label:has(input:checked) .search-global-text { color: var(--text-primary); }

/* ================================================================
   SCROLLBAR
   ================================================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 5px;
  border: 1px solid var(--scrollbar-track-border);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: all 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  box-shadow: 0 0 8px rgba(229,9,20,0.3);
}
::-webkit-scrollbar-thumb:active {
  background: var(--scrollbar-thumb-active);
}
::-webkit-scrollbar-corner { background: transparent; }

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 5px;
}
.modal-content::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 5px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  box-shadow: 0 0 6px rgba(229,9,20,0.2);
}

/* ================================================================
   ЗВЁЗДЫ НА ФОНЕ
   ================================================================ */
.stars {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

.star {
  position: absolute;
  background: var(--text-primary);
  border-radius: 50%;
  animation: twinkle ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.15; }
  100% { opacity: 0.6; }
}

/* ================================================================
   СТРАНИЦА ПРОФИЛЯ
   ================================================================ */
.profile-page {
    display: none;
    width: 100%;
    max-width: 1440px;
    margin: 24px auto 100px;
    padding: 0 20px;
    animation: fadeIn 0.4s ease;
}

.profile-page.active {
    display: block;
    flex: 1;
}

.profile-page-inner {
    background: var(--bg-profile);
    border: 1px solid var(--border-light);
    border-radius: 5px;
    padding: 32px;
}

.profile-page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.profile-page-header h1 {
    font-size: 22px;
    font-weight: bold;
    margin: 0;
    color: var(--text-primary);
}

.profile-back-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    color: var(--text-tertiary);
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-back-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.profile-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 12px;
}

.profile-tab {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.profile-tab.active {
    color: var(--text-primary);
    background: var(--primary-soft);
}

.profile-tab-content {
    display: none;
}

.profile-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.profile-section {
    margin-bottom: 16px;
}

.profile-label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 6px;
    font-weight: 500;
}

.profile-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: 5px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: normal;
    font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    outline: none;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.profile-input:focus {
    border-color: var(--border-input-focus);
    background: var(--bg-input-focus);
}

.profile-input::placeholder {
    color: var(--text-placeholder);
}

.profile-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.profile-hint {
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 4px;
}

.profile-submit {
    width: 100%;
    background: var(--primary);
    border: none;
    border-radius: 5px;
    padding: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin-top: 8px;
}

.profile-submit:hover {
    background: var(--primary-hover);
    transform: scale(1.01);
}

.profile-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.profile-error {
    color: var(--text-error);
    font-size: 12px;
    margin-top: 10px;
    text-align: center;
    min-height: 18px;
}

.profile-error:empty {
    display: none;
    margin: 0;
    min-height: 0;
}

.profile-success {
    color: var(--text-success);
    font-size: 12px;
    margin-top: 10px;
    text-align: center;
    min-height: 18px;
}

.profile-success:empty {
    display: none;
    margin: 0;
    min-height: 0;
}

/* ================================================================
   СТРАНИЦА АДМИНИСТРАТОРА
   ================================================================ */
.admin-page {
    display: none;
    width: 100%;
    max-width: 1440px;
    margin: 24px auto 100px;
    padding: 0 20px;
    animation: fadeIn 0.4s ease;
}

.admin-page.active {
    display: block;
    flex: 1;
}

.admin-page-inner {
    background: var(--bg-profile);
    border: 1px solid var(--border-light);
    border-radius: 5px;
    padding: 32px;
}

.admin-page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-page-header h1 {
    font-size: 22px;
    font-weight: bold;
    margin: 0;
    color: var(--text-primary);
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 12px;
    flex-wrap: wrap;
}

.admin-tab {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.admin-tab.active {
    color: var(--text-primary);
    background: var(--primary-soft);
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ===== ПОДВКЛАДКИ КАТАЛОГА ===== */
.catalog-subtabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.catalog-subtab {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    padding: 6px 14px;
    border-radius: 5px;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.catalog-subtab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

[data-theme="dark"] .catalog-subtab.active {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* ===== ТАБЛИЦА ДАННЫХ ===== */
.admin-table-wrapper {
    overflow-x: auto;
    border-radius: 5px;
    border: 1px solid var(--border-subtle);
    margin-bottom: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th {
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-family: 'Home Video', sans-serif;
    font-size: 11px;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.admin-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    vertical-align: middle;
}
.admin-table td:last-child {
    white-space: nowrap;
}

.admin-table tr:hover td {
    background: var(--bg-hover);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

/* ===== СТАТУСЫ В ТАБЛИЦЕ ===== */
.status-online {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-success);
    font-size: 12px;
    font-weight: 500;
}

.status-online::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-success);
    animation: pulseDot 2s ease-in-out infinite;
}

.status-offline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 500;
}

.status-offline::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-dim);
}

.status-blocked {
    color: var(--text-error);
    font-weight: bold;
}

.status-active {
    color: var(--text-success);
    font-weight: bold;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ===== РОЛИ В ТАБЛИЦЕ ===== */
.role-tag {
    font-weight: normal;
    margin-right: 4px;
}

.role-tag.admin {
    color: var(--role-admin-text);
}

.role-tag.moderator {
    color: var(--role-moderator-text);
}

.role-tag.user {
    color: var(--role-user-text);
}

/* ===== КНОПКИ ДЕЙСТВИЙ ===== */
.admin-action-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: 5px;
    padding: 4px 10px;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin-right: 4px;
    margin-bottom: 4px;
}

.admin-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.admin-action-btn.danger {
    background: var(--bg-status-unwatched);
    border-color: var(--border-status-unwatched);
    color: var(--text-error);
}

.admin-action-btn.danger:hover {
    background: rgba(230, 55, 87, 0.2);
}

.admin-action-btn.primary {
    background: var(--primary-soft);
    border-color: var(--primary-soft-hover);
    color: var(--primary);
}

.admin-action-btn.primary:hover {
    background: var(--primary-soft-hover);
}

/* ===== ФИЛЬТР ПОЛЬЗОВАТЕЛЕЙ ===== */
.user-filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.user-filter-label {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 500;
}

.user-filter-btn {
    background: transparent;
    border: none;
    padding: 4px 12px;
    border-radius: 5px;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.user-filter-btn:hover {
    color: var(--text-tertiary);
    background: var(--bg-elevated);
}

.user-filter-btn.active {
    color: var(--text-primary);
    background: var(--primary-soft);
}

.journal-filter-btn {
    background: transparent;
    border: none;
    padding: 4px 12px;
    border-radius: 5px;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.journal-filter-btn:hover {
    color: var(--text-tertiary);
    background: var(--bg-elevated);
}

.journal-filter-btn.active {
    color: var(--text-primary);
    background: var(--primary-soft);
}

/* ===== ФОРМА ДОБАВЛЕНИЯ ===== */
.admin-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--bg-elevated);
    border-radius: 5px;
    border: 1px solid var(--border-subtle);
}

.admin-form-title {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 4px;
    grid-column: 1 / -1;
}

.admin-form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-form-row.full-width {
    grid-column: 1 / -1;
}

.admin-form-row.full-width:has(> .profile-error:empty):has(> .profile-success:empty):has(> [id$="Progress"]:empty) {
    display: none;
}

.admin-form-label {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 500;
}

.admin-form-input {
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: 5px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    line-height: normal;
    font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    outline: none;
    transition: all 0.3s ease;
}

.admin-form-input:focus {
    border-color: var(--border-input-focus);
    background: var(--bg-input-focus);
}

.admin-form-input::placeholder {
    color: var(--text-placeholder);
}

.admin-form-select {
    background: var(--bg-input) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E") no-repeat right 10px center;
    border: 1px solid var(--border-input);
    border-radius: 5px;
    padding: 8px 28px 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    line-height: normal;
    font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: all 0.3s ease;
}

.admin-form-select:focus {
    border-color: var(--border-input-focus);
}

.admin-form-select option {
    background: var(--bg-modal);
    color: var(--text-primary);
    padding: 4px 8px;
}

.admin-form-select option:hover,
.admin-form-select option:checked {
    background: var(--bg-hover);
    color: var(--text-primary);
}

select.profile-input option {
    background: var(--bg-modal);
    color: var(--text-primary);
    padding: 4px 8px;
}

select.profile-input option:hover,
select.profile-input option:checked {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.admin-form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

.admin-form-checkbox input[type="checkbox"],
.admin-form-checkbox input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.admin-form-textarea {
    resize: vertical;
    min-height: 60px;
    line-height: 1.5;
    font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== БАННЕР ===== */
.site-banner {
    width: 100%;
    background: var(--primary-soft);
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.site-banner-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.site-banner-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
    text-align: center;
}

.site-banner-close {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
    font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.site-banner-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* ===== БАННЕР ИМПЕРСОНАЦИИ ===== */
.impersonation-banner {
    width: 100%;
    background: rgba(255, 193, 7, 0.12);
    border-bottom: 1px solid rgba(255, 193, 7, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-warning);
    z-index: 1000;
    position: relative;
}

/* ===== МОДАЛКА РЕДАКТИРОВАНИЯ ===== */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.admin-modal {
    background: var(--bg-login-modal);
    border: 1px solid var(--border-light);
    border-radius: 5px;
    padding: 28px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.admin-modal-overlay.active .admin-modal {
    transform: translateY(0) scale(1);
}

.admin-modal h3 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.admin-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: var(--bg-elevated);
    border: none;
    color: var(--text-dim);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Home Video', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.admin-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* ================================================================
   ДАШБОРД АДМИНИСТРАТОРА
   ================================================================ */
.dashboard-grid {
    animation: fadeIn 0.3s ease;
}

.dashboard-loading,
.dashboard-error {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
    font-size: 14px;
}

.dashboard-error {
    color: var(--text-error);
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 5px;
    padding: 20px 16px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-accent, var(--primary));
    opacity: 0.6;
}

.stat-card:hover {
    border-color: var(--card-accent, var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
    line-height: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Детальная статистика */
.dashboard-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.dashboard-panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 5px;
    padding: 20px;
}

.dashboard-panel-title {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-primary);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.dashboard-role-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-role-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.dashboard-role-count {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 15px;
}

.dashboard-user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dashboard-user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
}

.dashboard-user-row:last-child {
    border-bottom: none;
}

.dashboard-user-name {
    color: var(--text-primary);
    font-weight: 500;
}

.dashboard-user-date {
    color: var(--text-tertiary);
    font-size: 12px;
}

.dashboard-empty {
    color: var(--text-dim);
    font-size: 13px;
    padding: 12px 0;
    text-align: center;
}

/* ================================================================
   СКЕЛЕТОН-ЗАГРУЗКА
   ================================================================ */
.skeleton-card {
    background: var(--bg-skeleton);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

.skeleton-poster {
    width: 100%;
    aspect-ratio: 2/3;
    background: var(--bg-skeleton-gradient);
}

.skeleton-info {
    padding: 14px 18px 18px;
    flex: 1;
}

.skeleton-title {
    height: 18px;
    background: var(--bg-skeleton-bar);
    border-radius: 5px;
    margin-bottom: 8px;
    width: 80%;
}

.skeleton-meta {
    height: 12px;
    background: var(--bg-skeleton-bar-meta);
    border-radius: 5px;
    width: 50%;
}

@keyframes skeletonPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ================================================================
   АДАПТИВНОСТЬ
   ================================================================ */
@media (max-width: 900px) {
  .header { padding: 6px 14px; gap: 8px; flex-wrap: wrap; }
  .logo-center { height: 34px; }
  .search-wrapper { max-width: 160px; min-width: 110px; padding: 4px 8px 4px 10px; height: 30px; }
  .search-input { font-size: 12px; }
  .stats { font-size: 11px; gap: 8px; }
  .stats .num { font-size: 12px; }
  .section-tab { padding: 8px 14px; font-size: 13px; }
  .section-tab .badge { display: none; }
  .user-info .username { display: none; }
  .auth-btn { padding: 5px 10px; font-size: 11px; height: 30px; }
  .nav-btn { padding: 5px 8px; height: 30px; }
}

@media (max-width: 700px) {
  .header { padding: 4px 10px; gap: 6px; }
  .logo-center { height: 28px; }
  .search-wrapper { max-width: 120px; min-width: 80px; padding: 3px 6px 3px 8px; height: 28px; }
  .search-input { font-size: 11px; min-width: 20px; }
  .search-icon { font-size: 12px; }
  .stats { font-size: 10px; gap: 4px; }
  .stats .num { font-size: 11px; }
  .stats span:not(.watched):not(.unwatched) { display: none; }
  .section-tab { padding: 6px 10px; font-size: 12px; border-radius: 5px; }
  .subfilters-label { display: none; }

}

@media (max-width: 480px) {
  .header { padding: 4px 8px; }
  .logo-center { height: 22px; }
  .search-wrapper { max-width: 90px; min-width: 55px; padding: 2px 4px 2px 6px; height: 26px; }
  .search-input { font-size: 10px; min-width: 15px; }
  .search-icon { font-size: 10px; }
  .stats span:not(.watched):not(.unwatched) { display: none; }
  .container { padding: 16px 12px 80px; }
  .auth-panel { gap: 6px; }
  .user-info .role-badge { display: none; }
  .site-footer { flex-wrap: wrap; justify-content: center; padding: 10px 12px; gap: 8px; }
  .footer-left { order: 1; }
  .footer-hosting { order: 2; }
  .footer-copyright { order: 3; width: 100%; text-align: center; }
}

@media (max-width: 1024px) {
  .movies-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
  .container { padding: 18px 20px 60px; }
}

@media (max-width: 768px) {
  .movies-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 14px; }
  .filter-btn { padding: 5px 12px; font-size: 12px; }
  .filter-btn .badge { display: none; }
  .modal { width: 96%; max-height: 96vh; border-radius: 5px; }
  .modal-content { padding: 20px 18px 22px; }
  .modal-title { font-size: 20px; }
  .modal-details { grid-template-columns: 1fr; gap: 4px; }
  .modal-actions { flex-direction: column; }
  .modal-actions .modal-btn { justify-content: center; }
  .notice { font-size: 12px; padding: 10px 16px; }
  .profile-page { margin: 16px auto 80px; padding: 0 12px; }
  .profile-page-inner { padding: 20px; border-radius: 5px; }
  .profile-page-header h1 { font-size: 18px; }
  .profile-back-btn { padding: 6px 12px; font-size: 12px; }
  .admin-page { margin: 16px auto 80px; padding: 0 12px; }
  .admin-page-inner { padding: 20px; border-radius: 5px; }
  .admin-page-header h1 { font-size: 18px; }
  .admin-table th,
  .admin-table td { padding: 8px 10px; font-size: 12px; }
  .admin-action-btn { padding: 3px 8px; font-size: 10px; }
  .admin-form { grid-template-columns: 1fr; }
  #tabTools > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  .movies-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 10px; }
  .movie-card .info { padding: 10px 12px 14px; }
  .movie-card .title { font-size: 13px; }
  .movie-card .status-badge { font-size: 13px; }
  .container { padding: 12px 10px 80px; }
  .sections-bar { padding-bottom: 12px; margin-bottom: 12px; }
  .subfilters { margin-bottom: 14px; }
  .admin-tabs { gap: 4px; }
  .admin-tab { padding: 6px 10px; font-size: 11px; }
  .admin-table-wrapper { border-radius: 5px; }
  .status-online,
  .status-offline { font-size: 10px; }
}

/* ===== СТРАНИЦА КОМПАНИИ ===== */
.company-page { margin: 24px auto 80px; }
.company-page-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  margin-bottom: 24px;
}
.company-page-title { font-size: 22px; font-weight: 600; }
.company-page-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.company-page-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.company-page-manage { margin-top: 8px; align-self: flex-end; }
.role-tag.curator { color: var(--role-admin-text, #ffd700); }
.role-tag.member { color: var(--text-secondary); }
.company-rating {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 3;
  background: rgba(0, 0, 0, 0.55);
  color: #ffd700;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
}
.company-toggle-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 6px 10px;
  font-size: 12px;
  border: 0;
  border-radius: 6px;
  background: var(--primary, #2ed573);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.3s;
}
.company-toggle-btn:hover { opacity: 0.85; }
.company-toggle-btn:disabled { opacity: 0.6; cursor: wait; }
.movie-card.watched .company-toggle-btn { background: var(--text-error, #ff5b5b); }

/* ===== Предложка компании ===== */

.company-suggest-modal {
  flex-direction: column;
  max-width: 560px;
  padding: 24px;
  gap: 16px;
}
.company-suggest-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.company-suggest-modal .modal-title {
  font-size: 18px;
  margin: 0;
}
.modal-close {
  background: none;
  border: 0;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }
.company-suggest-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.suggest-type-toggle {
  display: flex;
  gap: 6px;
}
.suggest-type-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--border-modal);
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
}
.suggest-type-btn:hover { color: var(--text-primary); }
.suggest-type-btn.active {
  background: var(--primary-soft, rgba(46, 213, 115, 0.15));
  border-color: var(--primary);
  color: var(--primary);
}
.modal-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  background: var(--bg-input, rgba(255,255,255,0.06));
  border: 1px solid var(--border-modal);
  border-radius: 6px;
  color: var(--text-primary);
  outline: none;
}
.modal-input:focus { border-color: var(--primary); }
.suggest-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
}
.suggest-result-empty {
  padding: 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}
.suggest-result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--bg-card);
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}
.suggest-result-item:hover,
.suggest-result-item.selected { border-color: var(--primary); }
.suggest-result-title { font-size: 14px; color: var(--text-primary); }
.suggest-result-meta { font-size: 12px; color: var(--text-dim); }
.modal-hint { font-size: 12px; color: var(--text-dim); }
.company-suggest-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
}
.modal-btn {
  padding: 9px 22px;
  font-size: 13px;
  border: 0;
  border-radius: 6px;
  background: var(--primary, #2ed573);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.3s;
}
.modal-btn:hover { opacity: 0.85; }
.modal-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Карточки предложок */
.suggestion-card { display: contents; }
.suggestion-card .card-inner {
  position: relative;
  background: var(--bg-card);
  border-radius: 5px;
  border: 1px solid var(--border-card);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.suggestion-card .poster {
  position: relative;
  aspect-ratio: 2/3;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.suggestion-card .info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.suggestion-card .title { font-size: 14px; color: var(--text-primary); }
.suggestion-card .year { color: var(--text-dim); font-size: 12px; }
.suggestion-card .footer { color: var(--text-dim); font-size: 12px; }
.suggestion-card .status-badge { align-self: flex-start; }
.suggestion-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.suggestion-actions .company-toggle-btn { margin-top: 0; }
.suggestion-actions .suggestion-reject-btn { background: var(--text-error, #ff5b5b); }
.suggestion-card .status-badge.approved { background: rgba(46, 213, 115, 0.15); color: var(--text-success, #2ed573); }
.suggestion-card .status-badge.rejected { background: rgba(255, 91, 91, 0.15); color: var(--text-error, #ff5b5b); }
.suggestion-card .status-badge.pending { background: rgba(255, 165, 0, 0.15); color: #ffa500; }

/* ================================================================
   DESIGN POLISH — свечение акцента
   ================================================================ */
::selection { background: var(--selection-bg); color: var(--selection-text); }

.status-online::before { box-shadow: 0 0 8px currentColor; }

.search-wrapper:focus-within {
  border-color: var(--border-input-focus);
  box-shadow: var(--glow-input);
}

.login-input:focus,
.profile-input:focus,
.admin-form-input:focus,
.admin-form-select:focus,
.modal-input:focus {
  box-shadow: var(--glow-input);
}

/* ===== TOOLTIPS (data-tip) — пузырь ::before + стрелка ::after ===== */
[data-tip] {
  position: relative;
}

[data-tip]::before {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  background: var(--tip-bg);
  color: var(--tip-text);
  font-family: var(--font-base);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--tip-border);
  box-shadow: var(--tip-shadow);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 9999;
}

[data-tip]::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%) translateY(4px);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--tip-border);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 10000;
}

[data-tip]:hover::before,
[data-tip]:focus::before,
[data-tip]:hover::after,
[data-tip]:focus::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- позиции --- */
[data-tip][data-pos="bottom"]::before {
  top: calc(100% + 10px);
  bottom: auto;
  transform: translateX(-50%) translateY(-4px);
}
[data-tip][data-pos="bottom"]::after {
  top: calc(100% + 4px);
  bottom: auto;
  border-top: none;
  border-bottom: 6px solid var(--tip-border);
  transform: translateX(-50%) translateY(-4px);
}
[data-tip][data-pos="bottom"]:hover::before,
[data-tip][data-pos="bottom"]:focus::before,
[data-tip][data-pos="bottom"]:hover::after,
[data-tip][data-pos="bottom"]:focus::after {
  transform: translateX(-50%) translateY(0);
}

[data-tip][data-pos="left"]::before {
  left: auto;
  right: calc(100% + 10px);
  bottom: 50%;
  transform: translateY(50%) translateX(4px);
}
[data-tip][data-pos="left"]::after {
  left: auto;
  right: calc(100% + 4px);
  bottom: 50%;
  transform: translateY(50%) translateX(4px);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: none;
  border-left: 6px solid var(--tip-border);
}
[data-tip][data-pos="left"]:hover::before,
[data-tip][data-pos="left"]:focus::before,
[data-tip][data-pos="left"]:hover::after,
[data-tip][data-pos="left"]:focus::after {
  transform: translateY(50%) translateX(0);
}

[data-tip][data-pos="right"]::before {
  left: calc(100% + 10px);
  bottom: 50%;
  transform: translateY(50%) translateX(-4px);
}
[data-tip][data-pos="right"]::after {
  left: calc(100% + 4px);
  bottom: 50%;
  transform: translateY(50%) translateX(-4px);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: none;
  border-right: 6px solid var(--tip-border);
}
[data-tip][data-pos="right"]:hover::before,
[data-tip][data-pos="right"]:focus::before,
[data-tip][data-pos="right"]:hover::after,
[data-tip][data-pos="right"]:focus::after {
  transform: translateY(50%) translateX(0);
}

/* --- варианты --- */
[data-tip][data-variant="accent"]::before {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 500;
}
[data-tip][data-variant="accent"]::after { border-top-color: var(--primary); }
[data-tip][data-variant="accent"][data-pos="bottom"]::after { border-top-color: transparent; border-bottom-color: var(--primary); }
[data-tip][data-variant="accent"][data-pos="left"]::after { border-top-color: transparent; border-left-color: var(--primary); }
[data-tip][data-variant="accent"][data-pos="right"]::after { border-top-color: transparent; border-right-color: var(--primary); }

[data-tip][data-variant="danger"]::before {
  background: var(--text-error);
  color: #fff;
  border-color: var(--text-error);
}
[data-tip][data-variant="danger"]::after { border-top-color: var(--text-error); }
[data-tip][data-variant="danger"][data-pos="bottom"]::after { border-top-color: transparent; border-bottom-color: var(--text-error); }
[data-tip][data-variant="danger"][data-pos="left"]::after { border-top-color: transparent; border-left-color: var(--text-error); }
[data-tip][data-variant="danger"][data-pos="right"]::after { border-top-color: transparent; border-right-color: var(--text-error); }

/* --- длинный текст переносится --- */
[data-tip][data-tip-multiline]::before {
  white-space: normal;
  max-width: 260px;
  text-align: left;
  line-height: 1.5;
}

/* ================================================================
   REDUCED MOTION
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  .parallax-bg { animation: none; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

