:root {
  --box-bg: #ffffff;
  --accent-link-color: #0088cc;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f0f0f0;
  background-image: url('https://i.imgur.com/6Oem5DE.jpeg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  overscroll-behavior: none; /* Запрещает эффект "отскока" при прокрутке */
}

.loading-wrapper {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  max-width: 90%;
  background: var(--box-bg);
  border-radius: 20px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  z-index: 9999;
  box-sizing: border-box;
  /* Экран загрузки, отображаемый во время загрузки контента */
}

.loading-logo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  user-select: none;
  /* Логотип на экране загрузки */
}

.loading-title {
  font-size: 20px;
  font-weight: bold;
  /* Заголовок на экране загрузки */
}

.loading-extra {
  font-size: 14px;
  color: #555;
  /* Дополнительный текст на экране загрузки */
}

.loading-extra a {
  text-decoration: none;
  color: var(--accent-link-color);
  transition: color 0.3s ease;
  /* Стили для ссылок в .loading-extra */
}

.loading-extra a:hover {
  color: #005f99;
  /* Цвет ссылки при наведении */
}

.loading-text {
  font-size: 16px;
  color: #555;
  font-weight: bold;
  margin-top: 12px;
  transition: color 0.3s ease;
  /* Текст статуса загрузки */
}

.photo-container {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 600px;
  padding: 10px;
  overflow-y: auto;
  height: calc(100 * var(--vh));
  box-sizing: border-box;
  margin: 16px 0;
  user-select: none; /* Запрещает выделение текста и изображений */
  cursor: default; /* Указывает на отсутствие интерактивности */
  /* Контейнер для страниц PDF или текста FB2 */
}

.chapter-photo {
  display: block;
  margin: 0;
  width: 100%;
  max-width: 600px;
  user-select: none;
  pointer-events: none;
  tabindex: -1; /* Запрещает фокусировку через клавиатуру */
  /* Изображение страницы PDF */
}

.error-placeholder {
  color: red;
  font-size: 16px;
  text-align: center;
  margin: 5px;
  user-select: none; /* Запрещает выделение текста ошибки */
  /* Плейсхолдер для страниц, которые не загрузились */
}

#scroll-track {
  position: fixed;
  right: 10px;
  top: 10px;
  height: calc(100 * var(--vh) - 20px);
  width: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1000;
  /* Кастомная полоса прокрутки */
}

.thumb {
  position: absolute;
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 3px;
  top: 0;
  left: 0;
  /* Ползунок полосы прокрутки */
}

#page-indicator {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border-radius: 5px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none; /* Запрещает взаимодействие с индикатором страниц */
  user-select: none; /* Запрещает выделение текста индикатора */
  z-index: 1000;
  font-weight: 600;
  font-size: 14px;
  /* Индикатор текущей страницы */
}

#scrollable {
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  background-color: white; /* Белый фон для FB2 и PDF */
  /* Основной контейнер для прокрутки контента */
}

/* Стили для текста в FB2 */
.photo-container section,
.photo-container p,
.photo-container h2,
.photo-container h3,
.photo-container blockquote,
.photo-container .poem,
.photo-container .stanza,
.photo-container .verse,
.photo-container em {
  margin: 0 12px;
  max-width: 100%;
  line-height: 1.5;
  /* Стили для элементов текста FB2 */
}

.photo-container h2 {
  font-size: 1.5em;
  margin-bottom: 12px;
  /* Заголовки уровня 2 в FB2 */
}

.photo-container h3 {
  font-size: 1.2em;
  margin-bottom: 10px;
  /* Заголовки уровня 3 в FB2 */
}

.photo-container p {
  font-size: 1em;
  margin-bottom: 10px;
  /* Параграфы в FB2 */
}

.photo-container blockquote {
  border-left: 4px solid #ccc;
  padding-left: 10px;
  margin: 10px 0;
  /* Цитаты в FB2 */
}
