/* amamus34 — общий стиль (светло-зелёный, ретро) */
* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 0;
  background-color: #aae5a4;
  color: #000;
  font-family: Verdana, "Verdana", sans-serif;
  font-size: 14px;
}
a { color: #000099; text-decoration: underline; }
a:hover { color: #0000cc; }

/* Модальное окно */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.modal-content {
  background: #fff;
  padding: 25px;
  border: 3px solid #7cb576;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.modal-content h2 {
  margin-top: 0;
  color: #000;
  font-size: 1.3em;
}
.modal-content p {
  margin: 10px 0;
  line-height: 1.5;
}
.modal-content textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #7cb576;
  padding: 10px;
  font-family: Verdana, sans-serif;
  font-size: 14px;
  resize: vertical;
}
.modal-buttons {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.modal-buttons button {
  padding: 10px 20px;
  cursor: pointer;
  font-family: Verdana, sans-serif;
  font-size: 14px;
  border: 1px solid #666;
}
.modal-buttons .btn-accept {
  background: #9ad493;
  font-weight: bold;
}
.modal-buttons .btn-decline {
  background: #ddd;
}

/* Cookie баннер */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 3px solid #7cb576;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 9999;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
  flex-wrap: wrap;
}
.cookie-banner img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
}
.cookie-banner-text {
  flex: 1;
  min-width: 200px;
  font-size: 13px;
  line-height: 1.4;
}
.cookie-banner button {
  padding: 8px 20px;
  background: #9ad493;
  border: 1px solid #666;
  cursor: pointer;
  font-family: Verdana, sans-serif;
  font-weight: bold;
  flex-shrink: 0;
}
.cookie-banner button:hover {
  background: #7cb576;
}

/* Шапка */
.site-header {
  background-color: #9ad493;
  border-bottom: 1px solid #7cb576;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.site-logo {
  font-size: 1.5em;
  font-weight: bold;
  color: #000;
  text-decoration: none;
  margin-right: 15px;
}
.site-logo:hover { color: #000099; text-decoration: underline; }
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}
.nav-links a { margin-right: 4px; }
.nav-links .sep { color: #000; text-decoration: none; margin: 0 2px; }

/* Главная: центральный блок */
.home-hero {
  text-align: center;
  padding: 20px 10px 30px;
  max-width: 900px;
  margin: 0 auto;
}
.home-hero .main-image {
  max-width: 100%;
  height: auto;
  border: 2px solid #333;
  margin: 15px 0;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.home-hero .slogan {
  font-weight: bold;
  margin: 15px 0;
  color: #000;
}
.home-search {
  margin: 20px auto;
  max-width: 500px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.home-search input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 8px 10px;
  border: 1px solid #7cb576;
  font-family: Verdana, sans-serif;
  font-size: 14px;
}
.home-search button {
  padding: 8px 16px;
  background: #ddd;
  border: 1px solid #666;
  cursor: pointer;
  font-family: Verdana, sans-serif;
}
.stats-line { margin: 15px 0; color: #000; }
.footer-links {
  text-align: center;
  padding: 25px 10px;
  border-top: 1px solid #7cb576;
  margin-top: 30px;
}
.footer-links a { margin: 0 10px; }

/* Layout: сайдбар + контент */
.layout-with-sidebar {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 15px;
  gap: 20px;
}
.sidebar {
  width: 220px;
  flex-shrink: 0;
}
.sidebar h3, .sidebar h4 {
  margin: 12px 0 6px;
  font-size: 1em;
  color: #000;
}
.sidebar .search-row {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}
.sidebar .search-row input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #7cb576;
  font-size: 13px;
}
.sidebar .search-row button {
  padding: 6px 10px;
  background: #ddd;
  border: 1px solid #666;
  cursor: pointer;
  font-size: 13px;
}
.sidebar .tag-list { margin-bottom: 15px; }
.sidebar .tag-list a { display: block; margin: 2px 0; font-size: 0.9em; }
.sidebar .tag-group { margin-bottom: 8px; }
.sidebar .tag-group-title {
  font-weight: bold;
  font-size: 2em;
  line-height: 1.1;
  color: #000;
  margin: 4px 0 2px;
}
.sidebar .tag-group-list .tag-item {
  display: block;
  margin: 1px 0;
  text-decoration: none;
  font-size: 0.9em;
  line-height: 1.15;
}
.sidebar .tag-group-list .tag-item:hover { text-decoration: underline; }
.sidebar .tag-type-character { color: #178a26; }
.sidebar .tag-type-general { color: #2245d8; }
.sidebar .tag-type-artist { color: #d84d2c; }
.sidebar .tag-type-meta { color: #c7861a; }
.main-content { flex: 1; min-width: 0; }

/* Сетка постов */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.post-thumb {
  display: block;
  background: #fff;
  border: 1px solid #7cb576;
  overflow: hidden;
  aspect-ratio: 1;
}
.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Пагинация */
.pagination {
  margin-top: 25px;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.pagination a, .pagination span {
  padding: 4px 10px;
  margin: 0 2px;
}
.pagination .current { font-weight: bold; color: #000; text-decoration: none; }
.pagination .go-row { margin-left: 15px; display: inline-flex; gap: 4px; align-items: center; }
.pagination .go-row input { width: 40px; padding: 4px; text-align: center; }

/* Страница одного поста */
.post-view .image-block {
  text-align: center;
  margin-bottom: 20px;
}
.post-view .image-block img {
  max-width: 100%;
  height: auto;
  border: 1px solid #333;
}
.post-view .nav-buttons {
  margin: 10px 0;
  display: flex;
  justify-content: center;
  gap: 15px;
}
.post-view .nav-buttons button {
  padding: 8px 16px;
  background: #ddd;
  border: 1px solid #666;
  cursor: pointer;
  font-family: Verdana, sans-serif;
}
.sidebar .stat-line { margin: 4px 0; font-size: 0.9em; }
.sidebar .options-list a { display: block; margin: 2px 0; }

/* Комментарии */
.comments-section { margin-top: 30px; }
.comments-section h3 { margin-bottom: 15px; }
.comment-item {
  padding: 10px;
  border-bottom: 1px solid #7cb576;
  margin-bottom: 10px;
  font-size: 0.9em;
  overflow-wrap: break-word;
}
.comment-item.reply-item {
  margin-left: 20px;
  border-left: 2px solid #000099;
  background: rgba(0,0,153,0.05);
}
.comment-header { color: #000099; font-weight: bold; font-size: 0.85em; }
.comment-meta { color: #000; font-size: 0.75em; margin-top: 2px; }
.comment-body { margin-top: 8px; color: #000; }
.reply-btn { color: #000099; cursor: pointer; text-decoration: underline; font-size: 0.8em; margin-left: 8px; }
.add-comment-form {
  margin-top: 25px;
  padding: 15px;
  border: 1px solid #7cb576;
  background: rgba(255,255,255,0.2);
  max-width: 700px;
}
.add-comment-form label { display: block; margin: 8px 0 4px; font-weight: bold; color: #000099; }
.add-comment-form input, .add-comment-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #7cb576;
  font-family: Verdana, sans-serif;
  font-size: 14px;
  margin-bottom: 10px;
}
.add-comment-form button {
  background: #eee;
  border: 1px solid #7cb576;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: bold;
}
.reply-to-info {
  background: #eee;
  padding: 8px;
  margin-bottom: 10px;
  display: none;
  font-size: 0.9em;
  border: 1px solid #7cb576;
}

/* Формы логина/регистрации/загрузки */
.form-page {
  max-width: 500px;
  margin: 30px auto;
  padding: 20px;
  background: rgba(255,255,255,0.3);
  border: 1px solid #7cb576;
}
.form-page h1 { margin-top: 0; }
.form-page label { display: block; margin: 10px 0 4px; font-weight: bold; }
.form-page input, .form-page textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #7cb576;
  font-size: 14px;
  font-family: Verdana, sans-serif;
  margin-bottom: 8px;
}
.form-page button {
  margin-top: 15px;
  padding: 10px 24px;
  background: #ddd;
  border: 1px solid #666;
  cursor: pointer;
  font-weight: bold;
}
.form-page .error { color: #c00; margin-top: 8px; }
.success { color: #178a26; margin-top: 8px; }
.form-page .hint { font-size: 0.9em; color: #333; margin-top: 5px; }

.request-delete-btn {
  margin-top: 10px;
  padding: 10px 16px;
  background: #cf2f2f;
  border: 1px solid #8f1f1f;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
}
.request-delete-btn:hover {
  background: #b92828;
}

/* Уведомление "не залогинен" */
.login-notice {
  padding: 15px;
  border: 1px solid #7cb576;
  background: rgba(255,255,255,0.3);
  margin-bottom: 20px;
}
.login-notice a { margin-right: 15px; }

/* Адаптив */
@media (max-width: 768px) {
  .layout-with-sidebar { flex-direction: column; }
  .sidebar { width: 100%; }
  .posts-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
