/*
 * Copyright (C) 2025 Иван "VDM" Kalininskiy <https://t.me/VanDamM>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

/* ——— ШРИФТЫ ——— */
@font-face {
  font-family: "RobotronElite";
  src: url("../fonts/robotronfontelit.woff") format("woff");
  font-display: swap;
}

@font-face {
  font-family: "RobotronPica";
  src: url("../fonts/robotronfontpica.woff") format("woff");
  font-display: swap;
}

@font-face {
  font-family: "RobotronSper";
  src: url("../fonts/robotronfontsper.woff") format("woff");
  font-display: swap;
}

:root {
  --font-main: "RobotronElite", monospace;
  --font-title: "RobotronPica", monospace;
  --font-alter: "RobotronSper", monospace;
  --font-mono: "RobotronPica", monospace;
  --font-standard: "Courier New", monospace;
}

/* ——— ОБЩИЙ ФОН СТРАНИЦЫ ——— */
body {
  background: url("../images/bg.jpg") #8b9cb0;
  margin: 0;
  padding: 20px 0 270px 0;
  text-align: center;
  font-family: var(--font-main);
  color: #1a1a1a;
}

/* Стандартный шрифт */
body.standard-font {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .header-text-block {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .section-title {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .nav-menu {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .games-table,
body.standard-font .software-table,
body.standard-font .demoscene-table {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .genre-filter {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .platform-filter {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .search-filter {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font #reset-search {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font #reset-filters {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font #genre-select {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font #platform-select {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .font-label {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .search-filter label {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font #search-input {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font #search-input::placeholder {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .alphabet-label {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .alpha-btn {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .alphabet-filter {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .results-count {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .game-modal-content {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .modal-close {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .game-modal-close {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .game-title {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .game-main {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .game-meta {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .game-meta strong {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .game-description {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .game-files {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font .game-files h4 {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font #docs-content {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font #docs-content h1,
body.standard-font #docs-content h2,
body.standard-font #docs-content h3,
body.standard-font #docs-content h4,
body.standard-font #docs-content h5,
body.standard-font #docs-content h6 {
  font-family: var(--font-standard);
  font-weight: bold;
}

body.standard-font #back-to-main {
  font-family: var(--font-standard);
  font-weight: bold;
}

/* ——— ОСНОВНОЙ КОНТЕЙНЕР ——— */
.page-container {
  width: 966px;
  margin: 0 auto 0;
  background: url("../images/sheetback.jpg") #ede8d9;
  padding: 0 0 0 0;
  position: relative;
}

/* ——— ШАПКА (MASTHEAD) ——— */
.header {
  width: 100%;
  height: 210px;
  background: url("../images/masthead.jpg") no-repeat top center;
  position: relative;
}

.header .font-toggle {
  position: absolute;
  top: 30px;
  right: 30px;
  margin: 0;
  font-size: 11px;
}

.header-text-block {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-title);
  font-size: 16px;
  line-height: 1.2;
  color: #1a1a1a;
  background: transparent;
  padding: 10px 15px;
  text-align: center;
  white-space: pre;
  z-index: 10;
}

/* ——— НАВИГАЦИОННОЕ МЕНЮ ——— */
.nav-menu {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 0px 0;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nav-menu a {
  color: #222;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.nav-menu a:hover {
  border-bottom: 1px solid #000;
}

.nav-menu a.nav-item-active {
  font-weight: 600;
  border-bottom: 1px solid #000;
  color: #000;
}

/* ——— ПЕРЕКЛЮЧАТЕЛЬ ШРИФТОВ ——— */
.font-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: var(--font-main);
}

.font-label {
  color: #222;
  user-select: none;
}

.font-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.font-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #000;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* ——— ОСНОВНОЙ КОНТЕНТ ——— */
.content-wrapper {
  display: flex;
  gap: 30px;
  padding: 20px;
}

/* ——— ЛЕВАЯ КОЛОНКА ——— */
.main-content {
  flex: 2;
  padding: 0 20px 0 40px;
}

.article-title {
  font-size: 36px;
  font-weight: bold;
  margin: 20px 0 10px;
  line-height: 1.2;
}

.article-author {
  font-size: 12px;
  color: #555;
  margin: 0 0 15px;
}

.article-chapter-title {
  font-size: 16px;
  line-height: 1.6;
  font-weight: bold;
  margin: 25px 10px 10px;
  text-align: justify;
}

.article-text {
  font-size: 14px;
  line-height: 1.6;
  text-align: justify;
}

/* ——— ПРАВАЯ КОЛОНКА ——— */
.sidebar {
  flex: 1;
  padding: 15px;
  border-left: 1px solid #888;
}

.sidebar-header {
  background: #000;
  color: #fff;
  text-align: center;
  padding: 6px 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 28px;
  text-align: center;
  margin: 25px 0 15px;
  color: #8b4513;
  font-family: var(--font-title);
  text-transform: uppercase;
  position: relative;
}

.section-title::before,
.section-title::after {
  content: "—";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.section-title::before {
  left: 0;
}

.section-title::after {
  right: 0;
}

.featured-item {
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid #ccc;
  background: #fdfcf9;
}

.featured-item-title {
  font-weight: bold;
  margin: 15px 0 5px;
}

/* ——— ФУТЕР ——— */
.footer-block {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #888;
  font-size: 14px;
  color: #555;
  line-height: 1.5;
}

.footer-block ol {
  margin: 10px 0;
  padding-left: 20px;
}

.footer-block li {
  margin-bottom: 8px;
}

.page-copyright {
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid #888;
  font-size: 12px;
  text-align: center;
  color: #777;
}

.page-footer img {
  max-width: 100%;
  height: auto;
}

/* ——— Миниатюры в sidebar и статьях ——— */
.article-image,
.featured-image-thumb {
  display: block;
  margin: 15px auto;
  cursor: zoom-in;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid #aaa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.featured-image-thumb {
  width: 100%;
  max-width: 200px;
  height: auto;
}

.article-image {
  width: 100%;
  max-width: 100%;
  height: auto;
}

.article-image:hover,
.featured-image-thumb:hover {
  transform: scale(1.01);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.image-caption {
  font-size: 12px;
  color: #555;
  margin: 5px 0 15px;
  text-align: center;
  font-style: italic;
  line-height: 1.4;
}

/* ——— Модальное окно увеличения ——— */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
}

.modal-content {
  position: relative;
  max-width: 95%;
  max-height: 90%;
  background: #fff;
  padding: 15px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
  animation: zoomIn 0.3s forwards;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal img {
  max-width: 100%;
  max-height: 80vh;
  display: block;
  margin: 0 auto;
  border: 1px solid #888;
}

.modal-caption {
  font-size: 16px;
  color: #555;
  margin: 10px 0 5px;
  text-align: center;
  line-height: 1.4;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 24px;
  color: #aaa;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-mono);
}

.modal-close:hover {
  color: #fff;
}

/* ——— ТАБЛИЦА ИГР ——— */
.games-table-container {
  display: none;
  padding: 20px;
  margin-top: 20px;
}

.software-table-container {
  display: none;
  padding: 20px;
  margin-top: 20px;
}

.demoscene-table-container {
  display: none;
  padding: 20px;
  margin-top: 20px;
}

.games-table,
.software-table,
.demoscene-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-main);
  font-size: 12px;
  line-height: 1.2;
  color: #1a1a1a;
  background: #f5f0e6;
  /* цвет бумаги */
}

.games-table th,
.software-table th,
.demoscene-table th {
  background: #000;
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid #333;
}

.games-table .game-title-cell,
.software-table .game-title-cell,
.demoscene-table .game-title-cell {
  max-width: 300px;
  text-align: left;
}

.games-table .screenshot-cell,
.software-table .screenshot-cell,
.demoscene-table .screenshot-cell {
  width: 80px;
  text-align: center;
  padding: 5px;
}

.games-table .screenshot-cell .game-screenshot,
.software-table .screenshot-cell .game-screenshot,
.demoscene-table .screenshot-cell .game-screenshot {
  height: 50px;
  width: auto;
  max-width: 70px;
  border: 1px solid #ccc;
  border-radius: 3px;
  object-fit: contain;
}

.games-table .screenshot-cell .no-screenshot,
.software-table .screenshot-cell .no-screenshot,
.demoscene-table .screenshot-cell .no-screenshot {
  color: #999;
  font-size: 14px;
  line-height: 50px;
}

.games-table td,
.software-table td,
.demoscene-table td {
  padding: 8px 12px;
  border: 1px solid #ccc;
  background: #fdfcf9;
  /* светлая строка */
}

/* Чередование: нечётные — светлые, чётные — чуть темнее */
.games-table tr:nth-child(even) td,
.software-table tr:nth-child(even) td,
.demoscene-table tr:nth-child(even) td {
  background: #f8f6f2;
}

.games-table tr:hover td,
.software-table tr:hover td,
.demoscene-table tr:hover td {
  background: #f0ede5;
  transition: background 0.2s;
}

/* ——— Селектор платформ ——— */
.platform-filter {
  display: flex;
  justify-content: center;
  margin: 15px 0;
  gap: 10px;
  align-items: center;
  font-family: var(--font-main);
  font-size: 14px;
}

.platform-filter label {
  margin-right: 8px;
}

.platform-filter select {
  font-family: var(--font-main);
  font-size: 14px;
  padding: 4px 8px;
  border: 1px solid #888;
  background: #fff;
  cursor: pointer;
}

.platform-filter button {
  font-family: var(--font-main);
  font-size: 14px;
  padding: 4px 10px;
  border: 1px solid #888;
  background: #f5f0e6;
  color: #1a1a1a;
  cursor: pointer;
  margin-left: 10px;
}

.platform-filter button:hover {
  background: #e8e3d5;
}

.games-table-container .has-sources-label,
.demoscene-table-container .has-sources-label {
  margin-left: 12px;
  margin-right: 0;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.games-table-container .has-sources-label input,
.demoscene-table-container .has-sources-label input {
  margin: 0 6px 0 0;
  align-self: center;
  vertical-align: middle;
}

.platform-filter {
  display: flex;
  justify-content: center;
  margin: 15px 0;
  gap: 10px;
  align-items: center;
  font-family: var(--font-main);
  font-size: 14px;
}

.platform-filter label {
  margin-right: 8px;
}

.platform-filter select {
  font-family: var(--font-main);
  font-size: 14px;
  padding: 4px 8px;
  border: 1px solid #888;
  background: #fff;
  cursor: pointer;
}

/* ——— Селектор жанров ——— */
.genre-filter {
  display: flex;
  justify-content: center;
  margin: 15px 0;
  gap: 10px;
  align-items: center;
  font-family: var(--font-main);
  font-size: 14px;
}

.genre-filter label {
  margin-right: 8px;
}

.genre-filter select {
  font-family: var(--font-main);
  font-size: 14px;
  padding: 4px 8px;
  border: 1px solid #888;
  background: #fff;
  cursor: pointer;
}

.genre-filter button {
  font-family: var(--font-main);
  font-size: 14px;
  padding: 4px 10px;
  border: 1px solid #888;
  background: #f5f0e6;
  color: #1a1a1a;
  cursor: pointer;
  margin-left: 10px;
}

.genre-filter button:hover {
  background: #e8e3d5;
}

/* ——— Интерактивные заголовки таблицы ——— */
.games-table th,
.software-table th,
.demoscene-table th {
  cursor: pointer;
  user-select: none;
  position: relative;
}

.games-table th:hover,
.software-table th:hover,
.demoscene-table th:hover {
  background: #333;
}

.games-table th::after,
.software-table th::after,
.demoscene-table th::after {
  content: " ⇵";
  font-size: 10px;
  opacity: 0.6;
}

.games-table th.sort-asc::after,
.software-table th.sort-asc::after,
.demoscene-table th.sort-asc::after {
  content: " ↑";
  opacity: 1;
}

.games-table th.sort-desc::after,
.software-table th.sort-desc::after,
.demoscene-table th.sort-desc::after {
  content: " ↓";
  opacity: 1;
}

.results-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #777;
  text-align: left;
  margin: 5px 0 15px;
  padding-left: 2px;
}

/* ——— Страница документации ——— */
#docs-page {
  display: none;
  padding: 20px 20px 40px;
  background: url("../images/sheetback.jpg") #ede8d9;
}

#docs-content {
  max-width: 860px;
  margin: 0 auto;
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.2;
  color: #1a1a1a;
}

#docs-content h1,
#docs-content h2,
#docs-content h3,
#docs-content h4,
#docs-content h5,
#docs-content h6 {
  font-family: var(--font-title);
  font-weight: bold;
  margin: 25px 0 15px;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 1px;
  scroll-margin-top: 80px;
}

#docs-content h2 {
  font-size: 28px;
}

#docs-content h3 {
  font-size: 24px;
}

#docs-content ul,
#docs-content ol {
  margin: 10px 0 15px 30px;
  line-height: 1.2;
  padding-left: 15px;
}

#docs-content li {
  margin-bottom: 8px;
}

#docs-content p {
  margin: 12px 0;
  text-align: justify;
}

#docs-content a {
  color: #0066cc;
  text-decoration: underline;
}

#docs-content a:hover {
  color: #cc0000;
}

#docs-content strong {
  font-weight: bold;
  color: #000;
}

/* ——— МОДАЛЬНОЕ ОКНО ИГРЫ ——— */
.game-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.game-modal-content {
    position: relative;
    width: 90vw;
    max-width: 800px;
    height: 90vw;
    max-height: 800px;
    background: url('../images/gamecard.jpg') center/cover no-repeat;
    border: 3px solid #333;
    box-shadow: 0 0 30px rgba(0,0,0,0.7);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    /* Убираем отступы сверху/снизу, чтобы текст попадал между линиями */
    /* padding-top: 15px;
    padding-bottom: 15px; */
}

.game-title {
    font-family: var(--font-title);
    font-size: 24px;
    color: #666;
    margin-top: 114px;
    margin-left: 20px;
}

.game-main {
    display: flex;
    flex: 1;
    gap: 20px;
    color: #666;
    font-family: var(--font-main);
    font-size: 14px;
    margin-left: 15px;
}

.game-screenshots {
    flex: 0 0 400px; /* фиксированная ширина для скриншотов */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.screenshots-viewer {
    position: relative;
    width: 100%;
    height: 300px;
    background: rgba(0,0,0,0.2);
    border: 1px solid #666;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
    margin-bottom: 0px;
}

.screenshot-current {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    font-weight: bold;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 5;
}
.screenshots-viewer:hover .nav-btn {
    opacity: 1;
}
.nav-btn.prev { left: 5px; }
.nav-btn.next { right: 5px; }

.screenshots-counter {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.game-meta {
    flex: 1;
    color: #333;
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.6;
    margin-top: 30px;
    margin-left: 0px;
    /* white-space: pre-line; */
}
.game-meta div {
    margin-bottom: 5px;
    text-align: left;
}
.game-meta strong {
    color: #333;
    font-weight: normal;
    letter-spacing: 1px;
}
.game-modal .author-page-link {
    margin-left: 8px;
    font-size: 13px;
    color: #0066cc;
}
.game-modal .author-page-link:hover {
    text-decoration: underline;
}

.game-description {
    flex: 1;
    color: #333;
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.4;
    text-align: justify;
    margin-top: 10px;
    margin-bottom: 10px;
    margin-left: 15px;
    margin-right: 5px;
    overflow-y: auto;
    max-height: 200px;
    padding-right: 10px;
}

.game-files {
    color: #666;
    font-family: var(--font-main);
    font-size: 14px;
}
.game-files h4 {
    margin: 0 0 5px;
    color: #666;
    font-size: 14px;
}
.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}
.file-list li {
    margin-bottom: 0px;
}
.file-list a {
    color: #666;
    text-decoration: underline;
    font-size: 14px;
}
.file-list a:hover { color: #999; }

.game-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 32px;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-mono);
    z-index: 10;
}
.game-modal-close:hover { color: #ffcc00; }

.game-title-comment-btn {
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 24px;
    color: #666;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    z-index: 10;
}
.game-title-comment-btn:hover { color: #ffcc00; }

.game-header {
    text-align: center;
    margin-bottom: 5px;
    padding-left: 45px;
    padding-right: 45px;
}

/* Выбор одного значения при клике по ячейке с перечислением (Авторы, Издатель, Жанр) */
.filter-choice-popover {
    position: fixed;
    z-index: 3000;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 6px 0;
    min-width: 120px;
    max-width: 320px;
    max-height: 240px;
    overflow-y: auto;
}
.filter-choice-option {
    display: block;
    width: 100%;
    padding: 6px 12px;
    text-align: left;
    border: none;
    background: none;
    font-family: var(--font-main);
    font-size: 14px;
    cursor: pointer;
    color: #333;
}
.filter-choice-option:hover {
    background: #eee;
    color: #0066cc;
}

/* Заголовок модального окна — кликабельная кнопка «Поделиться» */
.game-modal .game-title {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}
.game-modal .game-title:hover {
    color: #0066cc;
    text-decoration: underline;
}
.game-modal .game-title:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}
.game-title-share-icon {
    opacity: 0.35;
    font-size: 0.9em;
}
.game-modal .game-title:hover .game-title-share-icon {
    opacity: 1;
}

/* ——— АЛФАВИТНЫЕ ФИЛЬТРЫ ——— */
.alphabet-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 12px;
    justify-content: center;
}
.alphabet-label {
    font-family: var(--font-main);
    font-size: 12px;
    color: #555;
    margin-right: 8px;
    align-self: center;
}
.alpha-btn {
    font-family: var(--font-main);
    font-size: 12px;
    padding: 2px 6px;
    border: 1px solid #888;
    background: #f5f0e6;
    color: #1a1a1a;
    cursor: pointer;
}
.alpha-btn:hover {
    background: #e8e3d5;
}
.alpha-btn.active {
    background: #FFFF00;
    font-weight: bold;
}

/* ——— ПОИСК ——— */
.search-filter {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}
.search-filter label {
    font-family: var(--font-main);
    font-size: 14px;
}
#search-input {
    font-family: var(--font-main);
    font-size: 14px;
    padding: 4px 8px;
    border: 1px solid #888;
    width: 200px;
}
#reset-search {
    font-family: var(--font-main);
    font-size: 14px;
    padding: 4px 10px;
    border: 1px solid #888;
    background: #f5f0e6;
    cursor: pointer;
}
#reset-search:hover {
    background: #e8e3d5;
}

/* Блок активных фильтров: чипы с кнопкой × для выборочного сброса */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    min-height: 0;
}
.active-filters:empty,
.active-filters[style*="display: none"] {
    margin-bottom: 0;
}
.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #f0ebe0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: var(--font-main);
    font-size: 13px;
    color: #333;
}
.active-filter-text {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.active-filter-remove {
    padding: 0 4px;
    margin: 0;
    margin-left: 2px;
    border: none;
    background: none;
    font-size: 16px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    border-radius: 2px;
}
.active-filter-remove:hover {
    color: #c00;
    background: rgba(0,0,0,0.06);
}

/* ——— УВЕЛИЧЕННЫЕ СКРИНШОТЫ ——— */
.screenshot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.screenshot-overlay.active {
    opacity: 1;
}
.screenshot-overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(2px);
}
.screenshot-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 90vh;
}
.screenshot-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    z-index: 10003;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.screenshot-nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}
.screenshot-nav-btn.prev {
    left: -70px;
}
.screenshot-nav-btn.next {
    right: -70px;
}
.screenshot-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.screenshot-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
    z-index: 10003;
}
.screenshot-enlarged {
    height: 512px;
    max-width: 90vw;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: relative;
    z-index: 10002;
    cursor: pointer;
    opacity: 0;
}
.screenshot-overlay.active .screenshot-enlarged {
    transform: scale(1);
    opacity: 1;
}

/* Кнопка запуска в эмуляторе */
.emulator-launch-btn {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #cc0000 0%, #990000 100%);
    color: white;
    border: 1px solid #660000;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    vertical-align: middle;
}

.emulator-launch-btn:hover {
    background: linear-gradient(135deg, #dd0000 0%, #aa0000 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.emulator-launch-btn:active {
    background: linear-gradient(135deg, #aa0000 0%, #770000 100%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transform: translateY(0);
}

/* Стили для списка файлов в модальном окне */
.file-list li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    padding: 2px;
}

.file-list li a {
    flex: 0 1 auto;
    min-width: 0;
}

/* Кнопка "кассеты" для ZIP-аудио */
.zip-audio-btn {
  display: inline-block;
  margin-left: 16px;
  width: 50px;
  height: 26px;
  background: transparent url("../content/cassette.png") center center / contain no-repeat;
  border: none;
  border-radius: 0;
  cursor: pointer;
  text-indent: -9999px; /* скрываем текст, оставляя его для доступности */
  overflow: hidden;
  vertical-align: middle;
}

.zip-audio-btn:hover {
  filter: brightness(1.1);
}

.audio-modal .audio-title {
  margin-top: 10px;
  font-family: var(--font-title);
  font-size: 24px;
  color: #666;
  margin-top: 114px;
  margin-left: 20px;
}

.audio-modal .audio-list {
  margin-top: 38px;
  max-height: 550px;
  overflow-y: auto;
  padding-left: 25px;
  padding-right: 15px;
}

.audio-modal .audio-item {
  margin-bottom: 12px;
  text-align: left;
}

.audio-modal .audio-label {
  font-family: var(--font-mono);
  font-size: 12px;
  margin-bottom: 2px;
}

.audio-modal .audio-loading,
.audio-modal .audio-empty,
.audio-modal .audio-error {
  font-size: 13px;
  text-align: center;
  margin-top: 15px;
}

.comments-modal .comments-modal-title {
  margin-top: 114px;
  margin-left: 20px;
  font-family: var(--font-title);
  font-size: 24px;
  color: #666;
}

.comments-modal .comments-container {
  margin-top: 10px;
  max-height: 850px;
  overflow-y: auto;
}

.comments-modal .comments-container .giscus-frame {
  width: 100%;
  min-height: 200px;
}

.comments-modal .comments-setup-hint {
  font-size: 14px;
  color: #666;
  padding: 15px;
}

.comments-modal .comments-setup-hint code {
  background: rgba(0,0,0,0.06);
  padding: 2px 6px;
}

.comments-modal .comments-setup-hint a {
  color: #0066cc;
}

.comments-modal .comments-loading,
.comments-modal .comments-error {
  font-size: 14px;
  color: #666;
  padding: 15px;
}

/* Анимации для уведомлений */
@keyframes slideDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 0);
        opacity: 1;
    }
    to {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
}
