/* ========== РЕАКЦИИ ========== */
.reaction-particle { position: fixed; pointer-events: none; z-index: 10000; font-size: 24px; animation: flyReaction 1s ease-out forwards; }
@keyframes flyReaction { 0% { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 1; } 100% { transform: translate(var(--x), var(--y)) scale(var(--s)) rotate(var(--r)); opacity: 0; } }
.reactions-container { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 10px; padding: 8px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.reactions-add-btn { width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,0.05); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; transition: all 0.2s; border: 1px solid var(--border); }
.reactions-add-btn:hover { background: rgba(0,0,0,0.1); transform: scale(1.05); }
.reactions-list { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.reaction-item { display: inline-flex; align-items: center; background: var(--bg-card); padding: 3px 8px; border-radius: 20px; font-size: 20px; cursor: pointer; transition: all 0.2s; border: 1px solid var(--border); }
.reaction-item:hover { background: var(--bg-card-hover); transform: scale(1.03); }
.reaction-item.active { background: #ffd966; border-color: #ffaa00; }
.reaction-count { margin-left: 4px; font-size: 12px; font-weight: bold; }
.reactions-eye { cursor: pointer; width: 28px; height: 28px; transition: transform 0.2s; }
.reactions-eye:hover { transform: scale(1.1); }

.reactions-modal, .reactions-users-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 10050; overflow-y: auto; }
.reactions-modal-content, .reactions-users-modal-content { position: relative; background: var(--bg-card); margin: 10% auto; padding: 15px; border-radius: 12px; max-width: 350px; width: 90%; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.reactions-modal-header, .reactions-users-modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 15px; }
.reactions-modal-title, .reactions-users-modal-title { font-size: 18px; margin: 0; color: var(--text); }
.reactions-modal-close, .reactions-users-modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text); }
.reactions-emoji-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; text-align: center; }
.reaction-emoji { font-size: 26px; cursor: pointer; padding: 5px; border-radius: 8px; transition: 0.2s; }
.reaction-emoji:hover { background: rgba(0,0,0,0.05); transform: scale(1.2); }
.reaction-emoji.active { background: #ffd966; }
.reactions-users-list { max-height: 400px; overflow-y: auto; }
.reaction-user { display: flex; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.reaction-user-avatar { width: 35px; height: 35px; border-radius: 50%; margin-right: 12px; object-fit: cover; }
.reaction-user-nick { font-weight: bold; flex: 1; font-size: 14px; color: var(--text); }
.reaction-user-emoji { font-size: 20px; }
.loading-reactions, .no-reactions { text-align: center; padding: 20px; color: var(--text-muted); }

/* ========== ШРИФТЫ ========== */
@font-face { font-family: 'OldTown'; src: url('/fonts/OldTown.ttf'); }
@font-face { font-family: 'FoxcroftNF'; src: url('/fonts/FoxcroftNF.otf'); }
@font-face { font-family: 'Kereru'; src: url('/fonts/Kereru.ttf'); }
@font-face { font-family: 'zubilo'; src: url('/fonts/zubilo-black.otf'); }
@font-face { font-family: 'UraBumBum'; src: url('/fonts/UraBumBumSP.otf'); }
@font-face { font-family: 'CarloMelow'; src: url('/fonts/Carlo-Melow.ttf'); }
@font-face { font-family: 'Warmovie'; src: url('/fonts/ST-Warmovie-noncommercial.ttf'); }
@font-face { font-family: 'Mr_Lonely'; src: url('/fonts/Mr_Lonely.otf'); }
@font-face { font-family: 'Rupster'; src: url('/fonts/Rupster.ttf'); }
@font-face { font-family: 'Plantype'; src: url('/fonts/Plantype.otf'); }
@font-face { font-family: 'Trafit'; src: url('/fonts/Trafit.ttf'); }
@font-face { font-family: 'Pelmeshka'; src: url('/fonts/Pelmeshka.ttf'); }
@font-face { font-family: 'Wornas'; src: url('/fonts/WornasPersonalUse.otf'); }
@font-face { font-family: 'Belissimo'; src: url('/fonts/Belissimo-script.ttf'); }
@font-face { font-family: 'Romanesque'; src: url('/fonts/Romanesque.ttf'); }

/* ========== ЦВЕТА ========== */
:root {
  --bg-overlay: rgba(240, 249, 255, 0.95);
  --bg-card: #ffffff;
  --bg-card-hover: #f0f9ff;
  --border: #bae6fd;
  --border-hover: #7dd3fc;

  --text: #0c1a2e;
  --text-dim: #475569;
  --text-dark: #0f172a;
  --text-muted: #64748b;

  --amor-blue: #0284c7;
  --amor-blue-light: #38bdf8;
  --amor-blue-dark: #0369a1;
  --amor-sky: #0ea5e9;
  --amor-deep: #082f49;
  --amor-bright: #7dd3fc;
  --amor-gold: #f59e0b;
  --amor-azure: #3b82f6;

  --neon-blue: #3b82f6;
  --neon-sky: #38bdf8;
  --neon-deep: #1d4ed8;
  --neon-light: #bfdbfe;
  --neon-navy: #1e3a8a;

  --sidebar-bg: #ffffff;
  --sidebar-text: #475569;
  --sidebar-active: #0284c7;

  --shadow-sm: 0 2px 8px rgba(2, 132, 199, 0.08);
  --shadow-md: 0 4px 20px rgba(2, 132, 199, 0.12);
  --shadow-lg: 0 8px 32px rgba(2, 132, 199, 0.2);
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.4);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-main: 'Inter', 'Roboto', -apple-system, sans-serif;
  --font-display: 'Warmovie', 'Orbitron', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --old-comment-bg: #FCE9E9;
  --old-comment-border: #E26565;
  --old-comment-text: #7B6363;
}

/* ========== DARK MODE ========== */
body.dark-mode {
  --bg-overlay: rgba(10, 22, 40, 0.96);
  --bg-card: #162236;
  --bg-card-hover: #1e2f47;
  --border: rgba(56, 189, 248, 0.2);
  --border-hover: rgba(56, 189, 248, 0.5);
  
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-dark: #ffffff;
  --text-muted: #64748b;
  
  --amor-blue: #38bdf8;
  --amor-blue-light: #7dd3fc;
  --amor-blue-dark: #0ea5e9;
  --amor-bright: #a78bfa;
  
  --sidebar-bg: #0f1e35;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #38bdf8;
}

body.dark-mode::before { background: linear-gradient(135deg, rgba(10,22,40,0.98) 0%, rgba(15,30,53,0.95) 50%, rgba(22,34,54,0.9) 100%); }
body.dark-mode .post-message-area { color: var(--text); }

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body.body-forum { font-family: var(--font-main); color: var(--text); background: #e0f2fe fixed center/cover no-repeat; min-height: 100vh; line-height: 1.6; overflow-x: hidden; }
body.body-forum::before { content: ''; position: fixed; inset: 0; background: linear-gradient(135deg, rgba(224, 242, 254, 0.95) 0%, rgba(240, 249, 255, 0.9) 50%, rgba(255, 255, 255, 0.85) 100%); z-index: -1; pointer-events: none; }
a { color: var(--amor-blue-dark); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--amor-blue); }

/* ========== LAYOUT ========== */
.forum-container { display: flex; min-height: 100vh; max-width: 1600px; margin: 0 auto; }

/* Светлый сайдбар с белым фоном */
.sidebar { position: fixed; top: 0; left: 0; width: 260px; height: 100vh; background: var(--sidebar-bg); border-right: 1px solid var(--border); padding: 24px 0; display: flex; flex-direction: column; z-index: 1000; overflow-y: auto; transition: transform 0.3s ease; box-shadow: 2px 0 15px rgba(0,0,0,0.03); }
.sidebar-close-btn { display: none; position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: none; border-radius: 50%; background: rgba(0,0,0,0.05); color: var(--text-dark); font-size: 1rem; cursor: pointer; align-items: center; justify-content: center; z-index: 101; }
.sidebar-logo { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--amor-blue); text-align: center; padding: 0 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 10px; }
.sidebar-logo i { font-size: 1.5rem; color: var(--amor-blue-light); }

/* ========== ПРОФИЛЬ В САЙДБАРЕ ========== */
.sidebar-user-area { padding: 16px; }
.sidebar-user-card { 
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%); 
  border-radius: var(--radius-lg); 
  padding: 16px; 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.25); 
  position: relative;
  overflow: hidden;
}
.sidebar-user-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
  pointer-events: none;
}
.sidebar-avatar-wrap { 
  width: 50px; 
  height: 50px; 
  border-radius: 50%; 
  border: 3px solid #fff; 
  overflow: hidden; 
  flex-shrink: 0; 
  background: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.sidebar-avatar { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-info { display: flex; flex-direction: column; z-index: 1; }
.sidebar-user-status { 
  font-size: 10px; 
  color: rgba(255,255,255,0.9); 
  text-transform: uppercase; 
  font-weight: 600; 
  letter-spacing: 0.5px; 
  margin-bottom: 2px; 
}
.sidebar-user-nick { 
  font-size: 1.1rem; 
  color: #fff; 
  font-weight: 700; 
  text-shadow: 0 2px 4px rgba(0,0,0,0.2); 
}
.sidebar-guest { 
  background: rgba(2, 132, 199, 0.1); 
  color: var(--amor-blue-dark); 
  padding: 16px; 
  text-align: center; 
  border-radius: var(--radius-lg); 
  font-size: 0.9rem; 
  font-weight: 600;
}

/* Меню навигации */
.sidebar-nav { padding: 20px 16px; display: flex; flex-direction: column; gap: 6px; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-md); color: var(--sidebar-text); font-size: 0.95rem; font-weight: 600; transition: all 0.2s ease; position: relative; border: 1px solid transparent; }
.sidebar-nav a i { width: 20px; text-align: center; font-size: 1.1rem; color: var(--amor-blue); transition: color 0.2s; }
.sidebar-nav a:hover { background: #f0f9ff; color: var(--amor-blue); }
.sidebar-nav a.active { background: linear-gradient(135deg, #e0f2fe, #bae6fd); color: var(--amor-blue-dark); border-color: #bae6fd; box-shadow: 0 2px 10px rgba(2, 132, 199, 0.1); }

/* Бейдж новых тем в меню */
.sidebar-badge { 
  position: absolute; 
  right: 16px; 
  background: #ef4444; 
  color: #fff; 
  font-size: 0.75rem; 
  font-weight: bold; 
  padding: 2px 8px; 
  border-radius: 12px; 
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

/* Актуальные темы */
.sidebar-recent { padding: 0 16px 16px; }
.sidebar-recent-header { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.recent-list { display: flex; flex-direction: column; gap: 4px; }
.recent-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; font-size: 0.85rem; color: var(--text); border-radius: var(--radius-sm); text-decoration: none; line-height: 1.3; transition: background 0.2s; }
.recent-item:hover { background: #f0f9ff; color: var(--amor-blue); }
.recent-item i { margin-top: 3px; font-size: 0.7rem; color: var(--amor-blue-light); }

/* Закладки */
.sidebar-bookmarks { padding: 0 16px 16px; }
.sidebar-bookmarks-header { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.bookmarks-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; padding-right: 4px; }
.bookmarks-list::-webkit-scrollbar { width: 4px; }
.bookmarks-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.bookmark-item { display: flex; align-items: center; padding: 8px 12px; font-size: 0.85rem; color: var(--text); border-radius: var(--radius-sm); transition: background 0.2s; text-decoration: none; }
.bookmark-item:hover { background: #f0f9ff; color: var(--amor-blue); }

.sidebar-stats { margin-top: auto; padding: 20px 16px; border-top: 1px solid var(--border); }
.sidebar-stats > div { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; margin-bottom: 8px; background: #f8fafc; border-radius: var(--radius-md); font-size: 0.85rem; border: 1px solid var(--border); }
.sidebar-stats span { color: var(--text-muted); font-weight: 500; }
.sidebar-stats b { color: var(--amor-blue); font-size: 1rem; }

.main-content { flex: 1; margin-left: 260px; padding: 24px 32px; min-height: 100vh; min-width: 0; }
.sidebar-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(2, 132, 199, 0.4); backdrop-filter: blur(4px); z-index: 999; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.sidebar-overlay.active { opacity: 1; visibility: visible; }

/* ========== TOP BAR ========== */
.top-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; padding: 16px 24px; background: var(--bg-card); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.sidebar-toggle { display: none; width: 40px; height: 40px; border: none; border-radius: var(--radius-md); background: linear-gradient(135deg, var(--amor-blue), var(--amor-blue-light)); color: #fff; font-size: 1.1rem; cursor: pointer; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(2, 132, 199, 0.2); }
.theme-toggle-btn { width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 50%; background: var(--bg-card); color: var(--text); font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.theme-toggle-btn:hover { background: #f0f9ff; color: var(--amor-blue); border-color: var(--amor-blue-light); }
.top-bar h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; background: linear-gradient(135deg, #0284c7 0%, #8b5cf6 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.top-bar h2 i { color: var(--amor-blue); -webkit-text-fill-color: var(--amor-blue); }

/* Zoom */
.zoom-control { display: flex; align-items: center; gap: 8px; background: var(--bg-card); border: 1px solid var(--border); padding: 6px 12px; border-radius: 20px; box-shadow: var(--shadow-sm); }
.zoom-control i { color: var(--text-muted); font-size: 12px; }
.zoom-control input[type=range] { -webkit-appearance: none; width: 80px; background: transparent; }
.zoom-control input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 14px; width: 14px; border-radius: 50%; background: var(--amor-blue); cursor: pointer; margin-top: -4px; }
.zoom-control input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 6px; cursor: pointer; background: #e2e8f0; border-radius: 3px; }

/* Auth */
.auth-area { min-width: 0; }
.auth-area form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.auth-input { padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); color: var(--text); font-size: 0.85rem; font-family: var(--font-main); outline: none; transition: all 0.2s; min-width: 120px; }
.auth-input:focus { border-color: var(--amor-blue); box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15); }
.auth-btn { padding: 8px 18px; border: none; border-radius: var(--radius-md); background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%); color: #fff; font-size: 0.85rem; font-weight: 600; font-family: var(--font-main); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s; box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3); }
.auth-btn:hover { box-shadow: 0 6px 16px rgba(2, 132, 199, 0.4); transform: translateY(-1px); }
.reg-link { padding: 8px 14px; border: 2px solid var(--amor-blue-light); border-radius: var(--radius-md); color: var(--amor-blue-dark); font-size: 0.85rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s; background: #f0f9ff; }
.reg-link:hover { background: var(--amor-blue-light); color: #fff; }
.welcome-text { color: var(--amor-blue-dark); font-weight: 600; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.logout-btn { padding: 6px 14px; border-radius: var(--radius-md); background: rgba(239, 68, 68, 0.1); color: #ef4444; font-size: 0.8rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s; border: 1px solid transparent; }
.logout-btn:hover { background: #ef4444; color: #fff; }

/* Sections */
.section-block { margin-bottom: 28px; }
.section-header { font-family: var(--font-display); font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 0 4px; text-transform: uppercase; letter-spacing: 1px; background: linear-gradient(135deg, #0284c7 0%, #8b5cf6 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.section-header i { color: var(--amor-blue); -webkit-text-fill-color: var(--amor-blue); font-size: 1.1rem; }
.forum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

/* Forum Card */
.forum-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; transition: all 0.3s ease; position: relative; overflow: hidden; min-width: 0; box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.forum-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, #38bdf8, #8b5cf6); opacity: 0; transition: opacity 0.3s; }
.forum-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--amor-blue-light); }
.forum-card:hover::before { opacity: 1; }
.forum-card-wide { grid-column: 1 / -1; max-width: 100%; }
.forum-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.forum-icon { width: 44px; height: 44px; border-radius: var(--radius-md); background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.2rem; box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3); flex-shrink: 0; }
.forum-stats-badge { font-size: 0.75rem; font-weight: 600; color: var(--amor-blue-dark); background: #e0f2fe; padding: 4px 12px; border-radius: 20px; white-space: nowrap; }
.forum-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; word-break: break-word; display: flex; align-items: center; flex-wrap: wrap; }
.forum-title a { color: var(--text-dark); }
.forum-title a:hover { color: var(--amor-blue); }
.forum-desc { font-size: 0.85rem; color: var(--text-dim); line-height: 1.5; word-break: break-word; }
.forum-desc i { color: var(--amor-blue-light); font-style: normal; }
.forum-topic-list { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.forum-topic-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 0.85rem; border-bottom: 1px solid rgba(2, 132, 199, 0.05); min-width: 0; }
.forum-topic-item:last-child { border-bottom: none; }
.forum-topic-item .topic-icon { width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0; background-size: contain !important; }
.forum-topic-item a { color: var(--text); font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.forum-topic-item a:hover { color: var(--amor-blue); }
.forum-topic-meta { display: flex; gap: 12px; color: var(--text-muted); font-size: 0.75rem; flex-shrink: 0; }
.forum-topic-meta i { margin-right: 3px; color: var(--amor-blue-light); }

/* Topic List */
.topic-list { display: flex; flex-direction: column; gap: 12px; }
.topic-card { display: flex; align-items: center; gap: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 22px; transition: all 0.3s ease; min-width: 0; position: relative; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.topic-card:hover { transform: translateX(4px); box-shadow: var(--shadow-md); border-color: var(--amor-blue-light); }
.topic-icon { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; transition: all 0.3s; }
.topic-icon.old { background: #f1f5f9; color: var(--text-muted); }
.topic-icon.pinned { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #fff; box-shadow: 0 0 12px rgba(245, 158, 11, 0.3); }
.topic-icon.closed { background: #e2e8f0; color: #94a3b8; }
.topic-icon.moved { background: linear-gradient(135deg, #8b5cf6, #a78bfa); color: #fff; }
.topic-icon.new { background: linear-gradient(135deg, #22c55e, #4ade80); color: #fff; box-shadow: 0 0 12px rgba(34, 197, 94, 0.3); }
.topic-info { flex: 1; min-width: 0; }
.topic-title { font-size: 1rem; font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; word-break: break-word; padding-right: 30px; }
.topic-title a { color: var(--text-dark); }
.topic-title a:hover { color: var(--amor-blue); }
.topic-title span { color: var(--amor-gold); font-size: 0.85rem; }
.topic-meta { display: flex; gap: 16px; color: var(--text-muted); font-size: 0.8rem; flex-wrap: wrap; }
.topic-meta i { margin-right: 4px; color: var(--amor-blue-light); }
.topic-stats { text-align: center; flex-shrink: 0; min-width: 60px; }
.topic-stats .count { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--amor-blue); }
.topic-stats .label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* Меню модератора (шестерёнка) */
.topic-mod-menu { position: absolute; top: 12px; right: 12px; z-index: 20; }
.topic-mod-btn { background: #f8fafc; border: 1px solid var(--border); border-radius: 50%; width: 30px; height: 30px; color: var(--text-muted); font-size: 0.9rem; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.topic-mod-btn:hover, .topic-mod-menu.open .topic-mod-btn { color: #fff; background: var(--amor-blue); border-color: var(--amor-blue); }
.topic-mod-menu.open .topic-mod-btn { transform: rotate(90deg); }
.topic-mod-dropdown { display: none; position: absolute; right: 0; top: 100%; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); min-width: 180px; padding: 6px 0; z-index: 21; }
.topic-mod-menu.open .topic-mod-dropdown { display: block; animation: fadeIn 0.2s ease; }
.topic-mod-dropdown a { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: var(--text); font-size: 0.85rem; font-weight: 500; text-decoration: none; transition: background 0.2s; text-align: left; }
.topic-mod-dropdown a:hover { background: #f0f9ff; color: var(--amor-blue); }
.topic-mod-dropdown a i { width: 16px; text-align: center; }

/* NEW и HOT */
.badge-new { display: inline-block; padding: 3px 8px; background: linear-gradient(135deg, #22c55e, #15803d); color: #fff; font-size: 0.65rem; font-weight: 700; border-radius: 10px; letter-spacing: 0.5px; margin-right: 6px; vertical-align: middle; box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4); text-transform: uppercase; }
.topic-card.hot { background: linear-gradient(135deg, rgba(255, 102, 0, 0.05), rgba(255, 152, 0, 0.02)), var(--bg-card); border-color: rgba(255, 102, 0, 0.3); box-shadow: 0 4px 16px rgba(255, 102, 0, 0.1); }
.topic-card.hot::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius-lg); border: 1.5px solid rgba(255, 102, 0, 0.4); pointer-events: none; animation: hotGlow 2.5s ease-in-out infinite; }
@keyframes hotGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 102, 0, 0.2); } 50% { box-shadow: 0 0 0 6px rgba(255, 102, 0, 0); } }
.hot-topic { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, #ff6600, #ff9800); color: #fff; font-size: 11px; margin-right: 6px; vertical-align: middle; box-shadow: 0 2px 6px rgba(255, 102, 0, 0.5); animation: hotPulse 1.8s ease-in-out infinite; }
@keyframes hotPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* Breadcrumbs */
.breadcrumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; padding: 12px 20px; background: var(--bg-card); border-radius: var(--radius-lg); border: 1px solid var(--border); font-size: 0.9rem; box-shadow: var(--shadow-sm); }
.crumb { display: flex; align-items: center; gap: 6px; color: var(--text-dim); font-weight: 500; transition: color 0.2s; }
.crumb:hover { color: var(--amor-blue); }
.crumb-active { color: var(--amor-blue-dark); font-weight: 700; }
.crumb-sep { color: var(--text-muted); font-size: 0.7rem; }
.crumb-pages { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.crumb-pages a, .crumb-pages b { padding: 4px 12px; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 600; }
.crumb-pages a { background: #f0f9ff; color: var(--amor-blue-dark); transition: all 0.2s; border: 1px solid var(--border); }
.crumb-pages a:hover { background: var(--amor-blue); color: #fff; border-color: var(--amor-blue); }
.crumb-pages b { background: linear-gradient(135deg, #0284c7, #38bdf8); color: #fff; border: 1px solid transparent; }

/* Posts */
.post-block { display: flex; gap: 20px; margin-bottom: 24px; animation: fadeInUp 0.4s ease forwards; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* Карточка автора (ПК) */
.author-card { width: 220px; flex-shrink: 0; height: 100%; text-align: center; padding: 20px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); position: relative; overflow: visible; box-shadow: var(--shadow-sm); }
.author-info-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
.author-icons { display: flex; gap: 8px; justify-content: center; width: 100%; }
.author-icon-btn { width: 30px; height: 30px; border-radius: 50%; background: #f0f9ff; color: var(--amor-blue); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem; transition: 0.2s; }
.author-icon-btn:hover { background: var(--amor-blue); color: #fff; border-color: var(--amor-blue); transform: scale(1.1); box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3); }

/* Аватар */
.author-avatar-wrap { position: relative; width: 120px; height: 120px; margin: 0 auto 16px; }
.author-avatar-wrap img.userAvatar { width: 120px; height: 120px; object-fit: cover; border-radius: 14px; border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.1); position: relative; z-index: 1; transition: transform 0.3s; display: block; }
.author-avatar-wrap:hover img.userAvatar { transform: scale(1.05); }
.avatar-glow { position: absolute; inset: 0; border-radius: 14px; opacity: 0.5; filter: blur(10px); transition: all 0.3s; }
.glow-moderator { background: linear-gradient(135deg, #ff6600, #ff9800); }

/* Данные автора */
.author-name { font-weight: 700; font-size: 1rem; margin-bottom: 2px; word-wrap: break-word; max-width: 100%; padding: 0 4px; }
.author-name a { color: var(--text-dark); }
.author-name a:hover { color: var(--amor-blue); }

/* Статус и Ранг (без рамок) */
.author-status { display: block; margin-bottom: 4px; color: var(--amor-blue-dark); font-size: 0.65rem; font-weight: 700; text-transform: uppercase; max-width: 100%; word-break: break-word; }
.author-real-name { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 2px; word-break: break-word; max-width: 100%; }
.author-real-name b { color: var(--text); }
.author-gender { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 6px; }
.author-gender b { color: var(--text-dim); }
.status-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; margin-bottom: 10px; flex-wrap: wrap; justify-content: center; }
.author-rank { margin-bottom: 6px; max-width: 100%; display: flex; justify-content: center; }
.author-stats { font-size: 0.8rem; color: var(--text-dim); font-weight: 600; }
.author-ip { font-size: 0.68rem; color: #d55e5e; margin: 4px 0; font-family: var(--font-mono); word-break: break-all; max-width: 100%; }

.rank-badge { display: flex; flex-direction: column; align-items: center; font-size: 0.7rem; font-weight: 600; max-width: 100%; line-height: 1.2; text-align: center; word-break: break-word; background: transparent !important; border: none !important; padding: 0 !important; }
.rank-text { font-weight: 700; margin-bottom: 2px; }
.rank-img { height: 14px; width: auto; display: inline-block; }

/* Пост */
.post-bubble { flex: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: all 0.3s; min-width: 0; box-shadow: var(--shadow-sm); }
.post-bubble:hover { box-shadow: var(--shadow-md); border-color: var(--border-hover); }
.post-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; background: #f8fafc; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 8px; }
.post-number { font-family: var(--font-display); font-size: 0.85rem; font-weight: 700; color: var(--amor-blue); }
.post-date { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.post-message-area { padding: 20px; font-size: 0.95rem; line-height: 1.7; word-wrap: break-word; overflow-wrap: break-word; color: var(--text); text-align: left; }
.post-message-area img { max-width: 100%; border-radius: var(--radius-md); margin: 8px 0; height: auto; }
.post-message-area a { color: var(--amor-blue); text-decoration: underline; font-weight: 600; }
.post-message-area a:hover { color: var(--amor-blue-dark); }
.post-message-area iframe { width: 100%; max-width: 640px; border-radius: var(--radius-md); margin: 12px 0; }
.post-message-area audio { width: 100%; max-width: 400px; margin: 8px 0; }
.post-message-area .signature { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--text-dim); }
.post-message-area .signature hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }

/* Цитаты и Код */
.bb-quote { background-color: #f1f5f9; border-left: 4px solid var(--amor-blue-light); margin: 6px 0; padding: 12px; border-radius: var(--radius-sm); color: var(--text-dim); }
.bb-code { background-color: #1e293b; border: 1px solid #334155; margin: 6px 0; padding: 12px; border-radius: var(--radius-sm); color: #e2e8f0; font-family: var(--font-mono); overflow-x: auto; }
body.dark-mode .bb-quote { background-color: rgba(56, 189, 248, 0.1); border-left-color: var(--amor-blue); color: #e2e8f0; }
body.dark-mode .bb-code { background-color: rgba(0,0,0,0.4); border-color: rgba(255,255,255,0.1); }

.post-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--border); background: #f8fafc; }
.action-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--radius-sm); background: #fff; color: var(--amor-blue-dark); border: 1px solid var(--border); font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.action-btn:hover { background: var(--amor-blue); color: #fff; border-color: var(--amor-blue); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3); }

/* Сетка картинок (строго 3 в ряд на мобилке) */
.post-message-area > .post-img {
  display: inline-block;
  width: calc(33.333% - 8px) !important;
  margin: 4px;
  vertical-align: top;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.04);
}
.post-message-area > .post-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform 0.25s ease;
  border-radius: var(--radius-md);
}
.post-message-area > .post-img img:hover { transform: scale(1.03); }

/* Десктопный вид картинок (большие) */
@media (min-width: 769px) {
  .post-message-area > .post-img {
    width: auto !important;
    max-width: 400px;
    height: auto;
    max-height: 400px;
    aspect-ratio: auto;
  }
  .post-message-area > .post-img img {
    width: auto;
    height: auto;
    max-width: 400px;
    max-height: 400px;
    object-fit: contain;
  }
}

/* Reply Form */
.reply-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin: 24px 0; box-shadow: var(--shadow-md); }
.message-box { width: 100%; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #f8fafc; color: var(--text); font-size: 0.95rem; font-family: var(--font-main); line-height: 1.6; resize: vertical; outline: none; transition: all 0.2s; min-width: 0; }
.message-box:focus { border-color: var(--amor-blue); box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15); background: #fff; }

/* Превью */
.bb-preview { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; min-height: 100px; font-size: 0.95rem; color: var(--text); line-height: 1.7; word-wrap: break-word; margin-top: 12px; }
body.dark-mode .bb-preview { background: rgba(0,0,0,0.2); }

/* BB Toolbar */
.bb-toolbar-new { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; background: #f0f9ff; border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 12px; }
.tb-btn { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; color: var(--amor-blue-dark); font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.tb-btn:hover { background: var(--amor-blue); color: #fff; border-color: var(--amor-blue); box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3); }
.tb-sep { width: 1px; height: 24px; background: var(--border); margin: 6px 4px; align-self: center; flex-shrink: 0; }
.tb-dropdown-wrap { position: relative; }
.tb-dropdown { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 8px; min-width: 200px; max-height: 300px; overflow-y: auto; }
.color-dropdown { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; min-width: 240px; }
.color-swatch { width: 32px; height: 32px; border: 2px solid rgba(255,255,255,0.3); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; }
.color-swatch:hover { transform: scale(1.15); border-color: #fff; box-shadow: 0 0 10px currentColor; }
.font-dropdown { min-width: 260px; }
.font-swatch { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 8px 12px; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--text); font-size: 0.9rem; cursor: pointer; transition: all 0.2s; text-align: left; }
.font-swatch:hover { background: #f0f9ff; color: var(--amor-blue); }
.size-dropdown { min-width: 160px; }
.size-swatch { width: 100%; padding: 8px 12px; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--text); cursor: pointer; transition: all 0.2s; text-align: left; }
.size-swatch:hover { background: #f0f9ff; color: var(--amor-blue); }

/* Music Player & Comment */
.music-player { margin: 12px 0; padding: 12px 18px; background: #f0f9ff; border-radius: 60px; border-left: 4px solid var(--amor-blue); display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.music-player audio { width: 70%; min-width: 200px; max-width: 400px; height: 36px; border-radius: 30px; vertical-align: middle; }
.p_comment { max-width: 819px; margin: 20px auto; background: var(--old-comment-bg); border-left: 7px solid var(--old-comment-border); padding: 12px 20px; color: var(--old-comment-text); border-radius: var(--radius-md); }
.p_comment hr { border: none; border-bottom: 1px solid var(--old-comment-border); opacity: 0.3; padding: 10px 0 0; margin: 0 0 10px; }

/* Scroll Nav */
.scroll-nav { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.scroll-nav button { width: 44px; height: 44px; border: none; border-radius: 50%; background: linear-gradient(135deg, #0284c7, #38bdf8); color: #fff; font-size: 1.1rem; cursor: pointer; box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4); transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.scroll-nav button:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(2, 132, 199, 0.6); }

/* Stats */
.stats-online { margin-top: 20px; padding: 16px 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); font-size: 0.85rem; color: var(--text-dim); word-break: break-word; box-shadow: var(--shadow-sm); }
.stats-online a { color: var(--amor-blue); margin: 0 2px; font-weight: 600; }
.stats-online a:hover { text-decoration: underline; }

select.auth-input { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230284c7' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; max-width: 100%; font-weight: 600; color: var(--amor-blue-dark); }

/* Lightbox */
.img-lightbox { display: none; position: fixed; inset: 0; z-index: 100000; background: rgba(0,0,0,0.92); align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; backdrop-filter: blur(4px); }
.img-lightbox.active { display: flex; animation: lbFade 0.2s ease; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
.img-lightbox img { max-width: 95vw; max-height: 90vh; object-fit: contain; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); cursor: default; background: #111; }
.img-lightbox-close { position: absolute; top: 16px; right: 20px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,0.15); color: #fff; font-size: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; }
.img-lightbox-close:hover { background: rgba(255,255,255,0.3); }

/* Context Menu & Toast */
.global-context-menu { display: none; position: fixed; z-index: 99999; background: var(--bg-card); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 48px rgba(0,0,0,0.2); min-width: 200px; max-width: 320px; padding: 6px 0; font-family: var(--font-main); font-size: 0.9rem; color: var(--text); overflow-y: auto; max-height: calc(100vh - 40px); }
.global-context-menu .global-menu-item { padding: 10px 20px; cursor: pointer; display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; white-space: nowrap; user-select: none; border: none; background: transparent; width: 100%; text-align: left; }
.global-context-menu .global-menu-item:hover { background: #f0f9ff; color: var(--amor-blue); }
.global-toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: rgba(2, 132, 199, 0.9); backdrop-filter: blur(4px); color: #fff; padding: 12px 28px; border-radius: 30px; font-size: 0.95rem; font-weight: 600; z-index: 999999; box-shadow: 0 4px 20px rgba(2, 132, 199, 0.4); white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; }

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.forum-card, .topic-card, .post-block { animation: fadeIn 0.4s ease forwards; }

@media (max-width: 1024px) {
  .forum-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .main-content { padding: 16px !important; margin-left: 0 !important; }
  .sidebar-toggle { display: flex !important; }
  .sidebar-close-btn { display: flex !important; }
  .sidebar { transform: translateX(-100%); width: 280px; box-shadow: none; }
  .sidebar.active { transform: translateX(0); box-shadow: 10px 0 30px rgba(0,0,0,0.1); }
  
  .top-bar { padding: 12px 16px; gap: 10px; }
  .top-bar h2 { font-size: 1.1rem; order: 3; width: 100%; }
  .theme-toggle-btn { order: 2; margin-left: auto; }
  .zoom-control { order: 2; }
  .auth-area { order: 4; width: 100%; }
  .auth-area form { flex-direction: column; width: 100%; }
  .auth-input, .auth-btn, .reg-link { width: 100%; box-sizing: border-box; justify-content: center; }
  
  .topic-card { flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
  .topic-stats { width: 100%; display: flex; justify-content: flex-start; gap: 10px; margin-top: 5px; border-top: 1px solid var(--border); padding-top: 8px; }
  .topic-stats .count { font-size: 1.1rem; }
  
  .bb-toolbar-new { justify-content: center; padding: 8px; gap: 4px; }
  .tb-btn { width: 34px; height: 34px; font-size: 0.85rem; }
}

@media (max-width: 767px) {
  .forum-grid { grid-template-columns: 1fr; }
  .music-player { border-radius: var(--radius-md); }
  .music-player audio { width: 100%; }
  
  .post-block { flex-direction: column !important; gap: 10px !important; }
  .author-card { width: 100% !important; max-width: 100% !important; flex-direction: row !important; flex-wrap: nowrap !important; align-items: flex-start !important; text-align: left !important; padding: 12px !important; gap: 12px !important; }
  .author-avatar-wrap { width: 70px !important; height: 70px !important; margin: 0 !important; flex-shrink: 0 !important; }
  .author-avatar-wrap img.userAvatar { width: 70px !important; height: 70px !important; border-width: 2px !important; }
  .author-info-wrap { align-items: flex-start !important; text-align: left !important; flex: 1 !important; }
  .author-icons { justify-content: flex-start !important; }
  .post-bubble { width: 100% !important; }
  .author-ip, .author-status, .rank-badge { font-size: 0.7rem !important; padding: 2px 0 !important; }
  .rank-img { height: 12px !important; }
  
  /* Скрываем зум на очень маленьких экранах, чтобы не ломалось */
  .zoom-control { display: none; }
}

@media (max-width: 480px) {
  .main-content { padding: 12px !important; }
  .author-avatar-wrap { width: 60px !important; height: 60px !important; }
  .author-avatar-wrap img.userAvatar { width: 60px !important; height: 60px !important; }
  .post-actions { flex-direction: column; align-items: stretch; }
  .action-btn { justify-content: center; padding: 8px !important; }
  .top-bar h2 i { display: none; }
  .color-dropdown { grid-template-columns: repeat(4, 1fr); min-width: 180px; }
  .color-swatch { width: 28px; height: 28px; }
  .scroll-nav { bottom: 16px; right: 16px; }
  .scroll-nav button { width: 40px; height: 40px; }
  .p_comment { font-size: 0.85rem; padding: 10px 14px; }
}

@media (max-width: 360px) {
  .main-content { padding: 8px !important; }
  .sidebar { width: 260px; }
  .post-message-area { padding: 12px; font-size: 0.85rem; }
  .action-btn { padding: 4px 8px; font-size: 0.7rem; }
  .scroll-nav { bottom: 12px; right: 12px; }
  .scroll-nav button { width: 36px; height: 36px; }
}