body.is-reader {
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

body.is-reader .site-footer {
  display: none;
}

body.is-reader .site-header {
  display: none;
}

body.is-reader .main-public {
  padding: 0;
  max-width: none;
  min-height: 100vh;
}

body.is-reader .reader-premium {
  min-height: 100vh;
  padding: 0;
  background:
    radial-gradient(900px 520px at 15% -5%, rgba(228, 199, 107, 0.10), transparent 52%),
    radial-gradient(700px 500px at 100% 0%, rgba(120, 80, 40, 0.18), transparent 48%),
    linear-gradient(180deg, #070605 0%, #0b0908 100%);
}

body.is-reader .reader-premium__shell {
  width: 100%;
  margin: 0 auto;
  position: relative;
}

@media (hover: hover) and (pointer: fine) and (min-width: 1025px) {
  body.is-reader .site-header {
    display: block;
  }

  body.is-reader .main-public {
    min-height: calc(100vh - 72px);
  }

  body.is-reader .reader-premium {
    min-height: calc(100vh - 72px);
    padding: 18px;
  }

  body.is-reader .reader-premium__shell:not(.is-fullscreen) {
    width: min(1320px, 100%);
  }
}

body.is-reader .reader-premium__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

body.is-reader .reader-premium__title {
  min-width: 0;
}

body.is-reader .reader-premium__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-dim);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

body.is-reader .reader-premium__eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-mid), transparent);
}

body.is-reader .reader-premium__title h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.02em;
  background: linear-gradient(118deg, #fffef8 0%, var(--gold) 42%, #a67c1a 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.is-reader .reader-premium__meta {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

body.is-reader .reader-premium__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.8rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  text-decoration: none;
  transition: transform 0.2s var(--ease-out), border-color 0.2s, background 0.2s, color 0.2s;
}

body.is-reader .reader-premium__back:hover {
  transform: translateY(-1px);
  background: rgba(228, 199, 107, 0.06);
  border-color: var(--border-strong);
  color: var(--gold);
  text-decoration: none;
}

body.is-reader .reader-premium__frame {
  position: relative;
  border-radius: 28px;
  border: 1px solid rgba(228, 199, 107, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01)),
    rgba(15, 12, 10, 0.72);
  box-shadow: 0 32px 120px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  overflow: hidden;
  min-height: min(900px, calc(100vh - 150px));
}

body.is-reader .reader-premium__toolbar {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: min(1080px, calc(100% - 28px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 22px;
  border: 1px solid rgba(228, 199, 107, 0.16);
  background: rgba(13, 10, 9, 0.62);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  transition: transform 0.35s var(--ease-out), opacity 0.35s var(--ease-out);
}

body.is-reader .reader-premium__toolbar.is-hidden {
  opacity: 0;
  transform: translate(-50%, -12px);
  pointer-events: none;
}

body.is-reader .reader-premium__cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body.is-reader .reader-premium__cluster--grow {
  flex: 1;
  min-width: 0;
}

body.is-reader .reader-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(228, 199, 107, 0.15);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), border-color 0.2s, background 0.2s, color 0.2s;
}

body.is-reader .reader-btn:hover {
  transform: translateY(-1px);
  background: rgba(228, 199, 107, 0.08);
  border-color: rgba(228, 199, 107, 0.28);
  color: var(--gold);
}

body.is-reader .reader-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

body.is-reader .reader-btn--wide {
  width: auto;
  min-width: 48px;
  padding: 0 14px;
}

body.is-reader .reader-page-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(228, 199, 107, 0.14);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

body.is-reader .reader-progress {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  gap: 12px;
}

body.is-reader .reader-progress--bottom {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 7;
  width: min(520px, calc(100% - 120px));
  flex: none;
  padding: 0.75rem 0.95rem;
  border-radius: 999px;
  background: rgba(13, 10, 9, 0.48);
  border: 1px solid rgba(228, 199, 107, 0.10);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
}

body.is-reader .reader-progress__bar {
  position: relative;
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

body.is-reader .reader-progress__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f0dc98 0%, var(--gold-mid) 55%, #8a6a1a 100%);
  box-shadow: 0 0 28px rgba(228, 199, 107, 0.32);
  transition: width 0.28s ease;
}

body.is-reader .reader-progress__text {
  min-width: 52px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: right;
}

body.is-reader .reader-premium__stage {
  position: relative;
  min-height: min(900px, calc(100vh - 150px));
  padding: 72px 26px 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

body.is-reader .reader-canvas-wrap {
  position: relative;
  width: min(100%, 900px);
  min-height: 540px;
  padding: clamp(18px, 2vw, 26px);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01)),
    rgba(11, 9, 8, 0.46);
  border: 1px solid rgba(228, 199, 107, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 26px 80px rgba(0, 0, 0, 0.52);
}

body.is-reader .reader-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, rgba(15, 12, 10, 0.82), rgba(7, 6, 5, 0.88));
  z-index: 5;
  transition: opacity 0.25s ease;
}

body.is-reader .reader-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

body.is-reader .reader-loading__ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3px solid rgba(228, 199, 107, 0.16);
  border-top-color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
  animation: reader-premium-spin 1s linear infinite;
}

@keyframes reader-premium-spin {
  to { transform: rotate(360deg); }
}

body.is-reader .reader-canvas-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 500px;
}

body.is-reader .reader-canvas {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  border-radius: 22px;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(228, 199, 107, 0.10);
  background: #ffffff;
}

body.is-reader .reader-canvas.is-turning {
  animation: reader-canvas-turn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes reader-canvas-turn {
  0% { opacity: 0.68; transform: translateX(20px) scale(0.992); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

body.is-reader .reader-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 8;
  width: 58px;
  height: 96px;
  border-radius: 20px;
  border: 1px solid rgba(228, 199, 107, 0.12);
  background: rgba(13, 10, 9, 0.56);
  color: var(--text);
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), border-color 0.2s, background 0.2s, color 0.2s, opacity 0.2s;
}

body.is-reader .reader-nav:hover {
  background: rgba(228, 199, 107, 0.08);
  border-color: rgba(228, 199, 107, 0.28);
  color: var(--gold);
}

body.is-reader .reader-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

body.is-reader .reader-nav--prev {
  left: 26px;
}

body.is-reader .reader-nav--next {
  right: 26px;
}

@media (max-width: 1100px) {
  body.is-reader .reader-premium__toolbar {
    width: calc(100% - 24px);
    gap: 8px;
    padding: 11px 12px;
  }

  body.is-reader .reader-premium__cluster--grow {
    min-width: 220px;
  }

  body.is-reader .reader-canvas-wrap {
    width: min(100%, 820px);
  }
}

body.is-reader .reader-premium__hint {
  position: absolute;
  left: 50%;
  bottom: 72px;
  transform: translateX(-50%);
  z-index: 4;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(13, 10, 9, 0.48);
  border: 1px solid rgba(228, 199, 107, 0.10);
  color: rgba(246, 241, 232, 0.58);
  font-size: 0.78rem;
}

body.is-reader .reader-premium__toast {
  position: absolute;
  left: 50%;
  bottom: 132px;
  transform: translateX(-50%);
  z-index: 12;
  display: none;
  width: min(540px, calc(100% - 28px));
}

body.is-reader .reader-premium__toast.is-visible {
  display: block;
  animation: reader-toast-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes reader-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

body.is-reader .reader-toast-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 20px;
  border: 1px solid rgba(228, 199, 107, 0.16);
  background: rgba(13, 10, 9, 0.76);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px) saturate(1.28);
  -webkit-backdrop-filter: blur(18px) saturate(1.28);
}

body.is-reader .reader-toast-card__title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

body.is-reader .reader-toast-card__text {
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  flex: 1;
}

body.is-reader .reader-toast-card__btn,
body.is-reader .reader-toast-card__close {
  border: 1px solid rgba(228, 199, 107, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
}

body.is-reader .reader-toast-card__btn {
  padding: 0.72rem 1rem;
  font-weight: 700;
}

body.is-reader .reader-toast-card__close {
  width: 38px;
  height: 38px;
  font-size: 1.2rem;
}

body.is-reader .reader-premium__error {
  margin-top: 14px;
  text-align: center;
  color: var(--danger);
  font-weight: 600;
}

body.is-reader .reader-premium__shell.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100%;
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #070605 0%, #0b0908 100%);
}

body.is-reader .reader-premium__shell.is-fullscreen .reader-premium__top {
  display: none;
}

body.is-reader .reader-premium__shell.is-fullscreen .reader-premium__frame {
  min-height: 100vh;
  height: 100vh;
  border-radius: 0;
  border: 0;
}

body.is-reader .reader-premium__shell.is-fullscreen .reader-premium__stage {
  min-height: 100vh;
  height: 100vh;
  padding-top: 74px;
  padding-bottom: 28px;
}

body.is-reader .reader-premium__shell.is-fullscreen .reader-canvas-wrap {
  width: min(100%, 980px);
  min-height: calc(100vh - 140px);
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.is-reader .reader-premium__shell.is-fullscreen .reader-canvas {
  max-height: calc(100vh - 150px);
}

body.is-reader .reader-premium__shell.is-fullscreen .reader-premium__toolbar {
  top: 18px;
}

@media (max-width: 900px) {
  body.is-reader .reader-premium {
    padding: 0;
  }

  body.is-reader .reader-premium__top {
    flex-direction: column;
    align-items: flex-start;
  }

  body.is-reader .reader-premium__toolbar {
    width: calc(100% - 18px);
    gap: 8px;
    flex-wrap: wrap;
    justify-content: space-between;
    top: 10px;
  }

  body.is-reader .reader-progress {
    width: 100%;
    order: 3;
  }

  body.is-reader .reader-premium__cluster {
    flex-wrap: wrap;
  }

  body.is-reader .reader-premium__cluster--grow {
    width: 100%;
    order: 4;
  }

  body.is-reader .reader-page-badge {
    min-width: 132px;
    justify-content: center;
  }

  body.is-reader .reader-premium__stage {
    padding: 116px 10px 24px;
  }

  body.is-reader .reader-nav {
    width: 48px;
    height: 74px;
  }

  body.is-reader .reader-nav--prev {
    left: 12px;
  }

  body.is-reader .reader-nav--next {
    right: 12px;
  }

  body.is-reader .reader-progress--bottom {
    width: min(460px, calc(100% - 88px));
    bottom: 16px;
  }
}

@media (max-width: 640px) {
  body.is-reader #reader-fullscreen-btn {
    display: none;
  }

  body.is-reader .reader-premium {
    min-height: 100dvh;
    padding: 0;
  }

  body.is-reader .reader-premium__frame {
    min-height: calc(100dvh - 96px);
    border-radius: 22px;
  }

  body.is-reader .reader-premium__title h1 {
    font-size: 1.8rem;
  }

  body.is-reader .reader-premium__meta {
    font-size: 0.88rem;
  }

  body.is-reader .reader-premium__toolbar {
    padding: 10px;
    border-radius: 18px;
    width: calc(100% - 12px);
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 6px;
    overflow: hidden;
  }

  body.is-reader .reader-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    flex: 0 0 auto;
  }

  body.is-reader .reader-btn--wide {
    min-width: 48px;
    padding: 0 10px;
    font-size: 0.8rem;
  }

  body.is-reader .reader-premium__cluster {
    width: auto;
    justify-content: flex-start;
    gap: 6px;
  }

  body.is-reader .reader-premium__cluster--grow {
    flex: 1;
    width: auto;
    min-width: 0;
    order: initial;
  }

  body.is-reader .reader-page-badge {
    width: auto;
    min-width: 0;
    max-width: 100%;
    justify-content: center;
    padding: 0.55rem 0.75rem;
    font-size: 0.72rem;
    line-height: 1;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.is-reader .reader-premium__toolbar .reader-progress {
    display: none;
  }

  body.is-reader .reader-progress--bottom {
    display: flex;
  }

  body.is-reader .reader-premium__stage {
    padding: 102px 8px 16px;
  }

  body.is-reader .reader-canvas-wrap {
    min-height: auto;
    padding: 10px;
    border-radius: 20px;
    width: 100%;
  }

  body.is-reader .reader-canvas-frame {
    min-height: auto;
  }

  body.is-reader .reader-canvas {
    width: 100%;
    border-radius: 16px;
  }

  body.is-reader .reader-nav {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: 44px;
    height: 72px;
    border-radius: 16px;
    background: rgba(13, 10, 9, 0.28);
    border-color: rgba(228, 199, 107, 0.08);
    box-shadow: none;
  }

  body.is-reader .reader-nav--prev {
    left: 8px;
  }

  body.is-reader .reader-nav--next {
    right: 8px;
  }

  body.is-reader .reader-premium__hint {
    bottom: 62px;
    font-size: 0.72rem;
  }

  body.is-reader .reader-premium__hint {
    font-size: 0;
    line-height: 0;
    max-width: calc(100% - 16px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.is-reader .reader-premium__hint::before {
    content: attr(data-book-title);
    display: block;
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--text);
  }

  body.is-reader .reader-premium__toast {
    bottom: 104px;
  }

  body.is-reader .reader-progress--bottom {
    width: calc(100% - 16px);
    bottom: 10px;
    padding: 0.65rem 0.8rem;
  }

  body.is-reader .reader-toast-card {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  body.is-reader .reader-toast-card__text {
    width: 100%;
    flex: none;
  }
}

@media (max-width: 480px) {
  body.is-reader .reader-premium__top {
    gap: 10px;
    margin-bottom: 10px;
  }

  body.is-reader .reader-premium__back {
    width: 100%;
    justify-content: center;
  }

  body.is-reader .reader-premium__toolbar {
    gap: 4px;
    padding: 8px 6px;
  }

  body.is-reader .reader-premium__cluster {
    width: auto;
    justify-content: flex-start;
  }

  body.is-reader .reader-btn {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  body.is-reader .reader-btn--wide {
    min-width: 42px;
    padding: 0 8px;
    font-size: 0.76rem;
  }

  body.is-reader .reader-page-badge {
    padding: 0.5rem 0.55rem;
    font-size: 0.66rem;
  }

  body.is-reader .reader-premium__stage {
    padding: 98px 6px 14px;
  }

  body.is-reader .reader-nav {
    width: 40px;
    height: 64px;
  }

  body.is-reader .reader-premium__hint {
    width: calc(100% - 16px);
    text-align: center;
    bottom: 58px;
  }

  body.is-reader .reader-premium__toast {
    width: calc(100% - 16px);
    bottom: 96px;
  }

  body.is-reader .reader-progress--bottom {
    width: calc(100% - 12px);
    bottom: 8px;
  }
}

@media (orientation: portrait) {
  body.is-reader #reader-fullscreen-btn {
    display: none;
  }
}

@media (orientation: landscape) and (max-width: 900px) {
  body.is-reader .reader-premium__stage {
    padding-top: 92px;
  }

  body.is-reader .reader-nav {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: 42px;
    height: 64px;
  }

  body.is-reader .reader-premium__hint {
    display: none;
  }

  body.is-reader .reader-progress--bottom {
    width: min(420px, calc(100% - 100px));
  }
}
