/* style.css */
:root {
  --bg-gradient-start: #0b0d14;
  --bg-gradient-end: #1a1e2a;
  --glass-bg: rgba(22, 26, 36, 0.75);
  --glass-border: rgba(230, 180, 80, 0.15);
  --accent-gold: #e6b450;
  --accent-gold-dim: rgba(230, 180, 80, 0.5);
  --text-primary: #e2e8ff;
  --text-secondary: #a0a8c0;
  --text-muted: #7a82a0;
  --code-bg: #1e1e2e;
  --success: #7ec699;
  --danger: #ff6b6b;
  --border-radius: 24px;
  --border-radius-sm: 12px;
  --border-radius-lg: 40px;
  --transition: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-gradient-start);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

.gradient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 30% 30%, rgba(230, 180, 80, 0.03) 0%, transparent 50%),
              radial-gradient(circle at 70% 70%, rgba(126, 198, 153, 0.03) 0%, transparent 50%);
  z-index: -1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* ===== ХЕДЕР ===== */
.header {
  padding: 24px 32px;
  margin-bottom: 32px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.site-title {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.title-accent {
  font-weight: 300;
  background: linear-gradient(135deg, var(--accent-gold) 0%, #ffd700 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.site-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.mod-login-btn {
  background: rgba(230, 180, 80, 0.1);
  border: 1px solid rgba(230, 180, 80, 0.3);
  border-radius: var(--border-radius-lg);
  padding: 8px 20px;
  color: var(--accent-gold);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.mod-login-btn:hover {
  background: rgba(230, 180, 80, 0.2);
  border-color: var(--accent-gold);
  transform: translateY(-1px);
}

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
}

.modal-content {
  width: 90%;
  max-width: 400px;
  padding: 32px;
  position: relative;
  animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.close {
  position: absolute;
  right: 24px;
  top: 16px;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.close:hover {
  color: var(--accent-gold);
}

.auth-tabs {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(230, 180, 80, 0.2);
  padding-bottom: 16px;
}

.auth-tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 500;
  padding: 8px 0;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.auth-tab:hover {
  color: var(--accent-gold);
}

.auth-tab.active {
  color: var(--accent-gold);
}

.auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: -17px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-gold);
}

.auth-tab-content {
  display: none;
}

.auth-tab-content.active {
  display: block;
}

.mod-login-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mod-input {
  background: rgba(16, 20, 30, 0.6);
  border: 1px solid rgba(230, 180, 80, 0.2);
  border-radius: var(--border-radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.mod-input:focus {
  border-color: var(--accent-gold);
  background: rgba(16, 20, 30, 0.8);
}

.mod-submit-btn {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #d4a259 100%);
  border: none;
  border-radius: var(--border-radius-lg);
  padding: 12px;
  color: #1a1e2a;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.mod-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(230, 180, 80, 0.3);
}

/* ===== СЕКЦИИ ===== */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.thread-creation-section,
.threads-section {
  padding: 28px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.header-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-gold) 0%, transparent 100%);
  margin-left: 20px;
}

.thread-creation-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.thread-title-input {
  background: rgba(16, 20, 30, 0.6);
  border: 1px solid rgba(230, 180, 80, 0.2);
  border-radius: var(--border-radius-sm);
  padding: 14px 18px;
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  transition: var(--transition);
}

.thread-title-input:focus {
  border-color: var(--accent-gold);
  background: rgba(16, 20, 30, 0.8);
}

/* ===== MARKDOWN ===== */
.markdown-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(230, 180, 80, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(230, 180, 80, 0.15);
}

.markdown-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-gold);
  font-size: 13px;
  font-weight: 500;
}

.markdown-hint {
  color: var(--text-secondary);
  font-size: 12px;
}

.editor-container {
  display: flex;
  gap: 12px;
  position: relative;
}

.thread-content-input {
  width: 100%;
  min-height: 180px;
  padding: 16px;
  background: rgba(16, 20, 30, 0.6);
  border: 1px solid rgba(230, 180, 80, 0.2);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: var(--transition);
}

.thread-content-input:focus {
  border-color: var(--accent-gold);
  background: rgba(16, 20, 30, 0.8);
}

.markdown-preview {
  display: none;
  width: 100%;
  min-height: 180px;
  padding: 16px;
  background: rgba(20, 24, 36, 0.6);
  border: 1px solid rgba(230, 180, 80, 0.2);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  overflow-y: auto;
}

.markdown-preview.active {
  display: block;
}

.thread-content-input.preview-mode {
  display: none;
}

.preview-toggle.active {
  background: rgba(230, 180, 80, 0.2);
  color: var(--accent-gold);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  background: rgba(16, 20, 30, 0.4);
  border-radius: 10px;
  align-items: center;
}

.toolbar-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
}

.toolbar-btn:hover {
  background: rgba(230, 180, 80, 0.1);
  color: var(--accent-gold);
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: rgba(230, 180, 80, 0.2);
  margin: 0 8px;
}

.code-language-select {
  background: rgba(16, 20, 30, 0.8);
  border: 1px solid rgba(230, 180, 80, 0.2);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
  cursor: pointer;
}

.code-language-select:hover {
  border-color: var(--accent-gold);
}

/* ===== ЗАГРУЗКА ИЗОБРАЖЕНИЙ ===== */
.image-upload-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.image-upload-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(230, 180, 80, 0.08);
  border: 1px dashed rgba(230, 180, 80, 0.3);
  border-radius: 10px;
  color: var(--accent-gold);
  font-size: 14px;
  cursor: pointer;
  width: fit-content;
  transition: var(--transition);
}

.image-upload-label:hover {
  background: rgba(230, 180, 80, 0.15);
  border-color: var(--accent-gold);
}

.image-upload-input {
  display: none;
}

.image-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.image-preview img {
  max-width: 150px;
  max-height: 150px;
  border-radius: 8px;
  border: 1px solid rgba(230, 180, 80, 0.3);
}

.image-upload-hint {
  color: var(--text-muted);
  font-size: 12px;
}

/* ===== ФУТЕР СОЗДАНИЯ ТРЕДА ===== */
.creation-footer {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

.create-thread-button {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #d4a259 100%);
  border: none;
  border-radius: var(--border-radius-lg);
  padding: 12px 28px;
  color: #1a1e2a;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.create-thread-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(230, 180, 80, 0.4);
}

.anonymous-mode-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-lg);
  padding: 12px 20px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.anonymous-mode-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.auth-required-hint {
  padding: 12px 16px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: var(--border-radius-sm);
  color: var(--danger);
  font-size: 14px;
}

.auth-required-hint a {
  color: var(--accent-gold);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-gold);
}

/* ===== ТРЕДЫ ===== */
.threads-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.threads-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-secondary);
  gap: 16px;
}

.loader {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(230, 180, 80, 0.1);
  border-top: 3px solid var(--accent-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.empty-threads {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-secondary);
  gap: 16px;
  text-align: center;
}

.empty-threads .ganesha-blessing {
  font-size: 48px;
}

.thread-card {
  background: rgba(16, 20, 30, 0.4);
  border: 1px solid rgba(230, 180, 80, 0.1);
  border-radius: 16px;
  padding: 24px;
  transition: var(--transition);
}

.thread-card:hover {
  border-color: rgba(230, 180, 80, 0.3);
  background: rgba(16, 20, 30, 0.5);
}

.ganesha-thread {
  border-left: 3px solid var(--accent-gold);
}

.thread-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.thread-title-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.thread-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-gold);
}

.author-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.role-admin {
  background: rgba(230, 180, 80, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(230, 180, 80, 0.3);
}

.role-moderator {
  background: rgba(126, 198, 153, 0.15);
  color: var(--success);
  border: 1px solid rgba(126, 198, 153, 0.3);
}

.role-user {
  background: rgba(160, 168, 192, 0.1);
  color: var(--text-secondary);
  border: 1px solid rgba(160, 168, 192, 0.2);
}

.role-label {
  font-size: 10px;
  opacity: 0.8;
}

.thread-meta {
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}

.thread-content {
  margin: 16px 0;
  line-height: 1.6;
}

.thread-image-container,
.reply-image-container {
  margin: 16px 0;
  max-width: 300px;
}

.thread-image,
.reply-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: 12px;
  border: 1px solid rgba(230, 180, 80, 0.2);
  cursor: pointer;
  transition: var(--transition);
}

.thread-image:hover,
.reply-image:hover {
  border-color: var(--accent-gold);
  transform: scale(1.02);
}

.thread-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(230, 180, 80, 0.1);
}

.thread-reply-btn {
  background: none;
  border: none;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 20px;
  transition: var(--transition);
}

.thread-reply-btn:hover {
  background: rgba(230, 180, 80, 0.1);
}

.thread-stats-wrapper {
  display: flex;
  gap: 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.thread-stats {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ganesha-stats {
  color: var(--accent-gold);
}

/* ===== ОТВЕТЫ ===== */
.replies-section {
  margin-top: 24px;
}

.replies-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.reply-item {
  background: rgba(16, 20, 30, 0.3);
  border: 1px solid rgba(230, 180, 80, 0.05);
  border-radius: 12px;
  padding: 16px;
  margin-left: 20px;
}

.ganesha-reply {
  border-left: 2px solid var(--accent-gold);
}

.reply-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.reply-author {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
}

.reply-date {
  color: var(--text-muted);
  font-size: 11px;
}

.reply-text {
  font-size: 14px;
  line-height: 1.6;
}

.reply-form-container {
  margin-top: 16px;
  padding: 16px;
  background: rgba(16, 20, 30, 0.5);
  border-radius: 12px;
}

.reply-textarea {
  width: 100%;
  padding: 12px;
  background: rgba(16, 20, 30, 0.6);
  border: 1px solid rgba(230, 180, 80, 0.2);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  resize: vertical;
  outline: none;
}

.reply-textarea:focus {
  border-color: var(--accent-gold);
}

.reply-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.reply-image-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(230, 180, 80, 0.08);
  border: 1px dashed rgba(230, 180, 80, 0.3);
  border-radius: 6px;
  color: var(--accent-gold);
  font-size: 13px;
  cursor: pointer;
}

.reply-submit-btn {
  background: var(--accent-gold);
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  color: #1a1e2a;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
}

.reply-cancel-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}

.reply-image-preview {
  margin-top: 12px;
}

.reply-image-preview img {
  max-width: 100px;
  max-height: 100px;
  border-radius: 6px;
}

/* ===== ГАНЕША ===== */
.ganesh-chat-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold) 0%, #d4a259 100%);
  border: none;
  box-shadow: 0 4px 20px rgba(230, 180, 80, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 1000;
  color: #1a1e2a;
  font-size: 28px;
}

.ganesh-chat-toggle:hover {
  transform: scale(1.05);
}

.ganesh-tooltip {
  position: absolute;
  right: 70px;
  background: rgba(26, 30, 42, 0.9);
  color: var(--accent-gold);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(230, 180, 80, 0.3);
}

.ganesh-chat-toggle:hover .ganesh-tooltip {
  opacity: 1;
}

.ganesh-chat {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 420px;
  height: 550px;
  background: rgba(30, 34, 46, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(230, 180, 80, 0.3);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  z-index: 999;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

.ganesh-chat.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.ganesh-chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(230, 180, 80, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ganesh-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ganesh-icon-small {
  font-size: 20px;
}

.ganesh-name {
  color: var(--accent-gold);
  font-weight: 600;
}

.ganesh-badge {
  background: rgba(230, 180, 80, 0.15);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  color: var(--accent-gold);
  border: 1px solid rgba(230, 180, 80, 0.3);
}

.ganesh-status {
  font-size: 12px;
  color: var(--success);
}

.ganesh-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
}

.ganesh-close-btn:hover {
  color: var(--accent-gold);
}

.ganesh-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ganesh-message {
  display: flex;
  gap: 12px;
  max-width: 100%;
}

.ganesh-message-bot {
  align-self: flex-start;
}

.ganesh-message-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ganesh-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(230, 180, 80, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1px solid rgba(230, 180, 80, 0.3);
  flex-shrink: 0;
}

.ganesh-message-content {
  background: rgba(20, 24, 36, 0.6);
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(230, 180, 80, 0.15);
  max-width: calc(100% - 50px);
}

.ganesh-message-user .ganesh-message-content {
  background: rgba(230, 180, 80, 0.1);
}

.ganesh-message-sender {
  font-size: 12px;
  color: var(--accent-gold);
  margin-bottom: 4px;
  font-weight: 500;
}

.ganesh-chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid rgba(230, 180, 80, 0.2);
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.ganesh-user-input {
  flex: 1;
  background: rgba(16, 20, 30, 0.6);
  border: 1px solid rgba(230, 180, 80, 0.2);
  border-radius: 20px;
  padding: 10px 16px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  resize: none;
  max-height: 100px;
  outline: none;
  transition: var(--transition);
}

.ganesh-user-input:focus {
  border-color: var(--accent-gold);
  background: rgba(16, 20, 30, 0.8);
}

.ganesh-send-btn {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #d4a259 100%);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  flex-shrink: 0;
  transition: var(--transition);
}

.ganesh-send-btn:hover {
  transform: scale(1.05);
}

.ganesh-footer {
  padding: 8px 20px;
  border-top: 1px solid rgba(230, 180, 80, 0.1);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ===== MARKDOWN BODY ===== */
.markdown-body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  color: var(--accent-gold);
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  font-weight: 600;
}

.markdown-body h1 { font-size: 1.8rem; }
.markdown-body h2 { font-size: 1.5rem; }
.markdown-body h3 { font-size: 1.25rem; }

.markdown-body p {
  margin-bottom: 1em;
}

.markdown-body code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #b392f0;
}

.markdown-body pre {
  background: rgba(0, 0, 0, 0.4);
  padding: 16px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 1em 0;
}

.markdown-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.markdown-body blockquote {
  border-left: 3px solid var(--accent-gold);
  margin: 1em 0;
  padding: 0.5em 1em;
  background: rgba(230, 180, 80, 0.05);
  color: var(--text-secondary);
}

.markdown-body a {
  color: var(--success);
  text-decoration: none;
  border-bottom: 1px dashed rgba(126, 198, 153, 0.3);
  transition: var(--transition);
}

.markdown-body a:hover {
  border-bottom-color: var(--success);
}

.markdown-body ul,
.markdown-body ol {
  margin: 0.5em 0 1em 1.5em;
}

.markdown-body li {
  margin-bottom: 0.25em;
}

.markdown-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid rgba(230, 180, 80, 0.2);
  padding: 8px 12px;
  text-align: left;
}

.markdown-body th {
  background: rgba(230, 180, 80, 0.1);
  color: var(--accent-gold);
}

/* ===== КОД БЛОКИ ===== */
.code-block-wrapper {
  margin: 1em 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(230, 180, 80, 0.2);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(230, 180, 80, 0.2);
}

.code-language-label {
  color: var(--accent-gold);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}

.copy-code-btn {
  background: none;
  border: 1px solid rgba(230, 180, 80, 0.3);
  border-radius: 4px;
  padding: 4px 8px;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition);
}

.copy-code-btn:hover {
  background: rgba(230, 180, 80, 0.1);
  color: var(--accent-gold);
}

/* ===== СОСТОЯНИЯ ОШИБОК ===== */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 16px;
}

.error-icon {
  font-size: 48px;
}

.error-state h3 {
  color: var(--danger);
  font-size: 1.25rem;
}

.retry-btn {
  background: var(--accent-gold);
  border: none;
  border-radius: var(--border-radius-lg);
  padding: 12px 24px;
  color: #1a1e2a;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 16px;
}

.retry-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(230, 180, 80, 0.4);
}

.ganesha-message {
  color: var(--accent-gold);
  font-size: 14px;
  margin-top: 16px;
  padding: 12px 24px;
  background: rgba(230, 180, 80, 0.1);
  border-radius: var(--border-radius-lg);
  border: 1px solid rgba(230, 180, 80, 0.3);
}

/* ===== АНИМАЦИИ ===== */
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.loading-pulse {
  animation: pulse 1.5s infinite;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }
  
  .site-title {
    font-size: 2rem;
  }
  
  .markdown-hint {
    display: none;
  }
  
  .thread-header {
    flex-direction: column;
    gap: 8px;
  }
  
  .thread-title-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .creation-footer {
    flex-direction: column;
  }
  
  .create-thread-button,
  .anonymous-mode-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .ganesh-chat {
    width: calc(100% - 40px);
    right: 20px;
    left: 20px;
    height: 60vh;
  }
  
  .editor-toolbar {
    justify-content: center;
  }
  
  .toolbar-divider {
    display: none;
  }
  
  .thread-creation-section,
  .threads-section {
    padding: 20px;
  }
  
  .reply-actions {
    flex-direction: column;
  }
  
  .reply-image-label {
    width: 100%;
    justify-content: center;
  }
}

/* ===== СКРОЛЛБАР ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(16, 20, 30, 0.6);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(230, 180, 80, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(230, 180, 80, 0.5);
}

/* ===== НАВИГАЦИЯ ПО БОРДАМ ===== */
.boards-nav {
  margin-bottom: 32px;
  padding: 16px 24px;
}

.boards-container {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.board-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(16, 20, 30, 0.4);
  border: 1px solid rgba(230, 180, 80, 0.2);
  border-radius: 40px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
}

.board-link:hover {
  background: rgba(230, 180, 80, 0.1);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  transform: translateY(-2px);
}

.board-link.active {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #d4a259 100%);
  border-color: var(--accent-gold);
  color: #1a1e2a;
}

.board-link.active .board-icon,
.board-link.active .board-name,
.board-link.active .board-desc {
  color: #1a1e2a;
}

.board-icon {
  font-size: 18px;
}

.board-name {
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.board-desc {
  font-size: 13px;
  opacity: 0.9;
}

.board-badge {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(255, 107, 107, 0.3);
  margin-left: 4px;
}

.board-link.active .board-badge {
  background: rgba(26, 30, 42, 0.3);
  color: #1a1e2a;
  border-color: rgba(26, 30, 42, 0.3);
}

/* Стили для заблокированной доски */
.board-link.private-restricted .board-icon {
  color: #ff6b6b;
}

.private-owner-hint {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: rgba(230, 180, 80, 0.15);
  border-radius: 12px;
  font-size: 11px;
  color: var(--accent-gold);
  border: 1px solid rgba(230, 180, 80, 0.3);
}

/* Подсказка о владельце доски */
.board-owner-info {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(230, 180, 80, 0.08);
  border-radius: 8px;
  border-left: 2px solid var(--accent-gold);
  font-size: 12px;
  color: var(--text-secondary);
}

.board-owner-info strong {
  color: var(--accent-gold);
}