/* Guest Raniko tour: the supplied character art stays untouched; motion is layered around it. */
.raniko-guest-tour[hidden] { display: none !important; }
.raniko-guest-tour {
  position: fixed;
  inset: 0;
  z-index: 4800;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 32px);
  color: #f8f5ff;
  isolation: isolate;
}
.raniko-guest-tour__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 15, .77);
  backdrop-filter: blur(11px) saturate(118%);
  -webkit-backdrop-filter: blur(11px) saturate(118%);
  animation: ranikoTourBackdrop .45s ease both;
}
.raniko-guest-tour__panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, .92fr) minmax(350px, 1.08fr);
  width: min(930px, 100%);
  min-height: min(580px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid rgba(218, 151, 255, .38);
  border-radius: 26px;
  background:
    radial-gradient(circle at 18% 15%, rgba(192, 87, 255, .16), transparent 35%),
    radial-gradient(circle at 86% 82%, rgba(74, 154, 255, .12), transparent 36%),
    #111327;
  box-shadow: 0 28px 100px rgba(0, 0, 0, .62), 0 0 0 1px rgba(255, 255, 255, .04) inset;
  transform: translateY(14px) scale(.975);
  opacity: 0;
  transition: opacity .38s ease, transform .5s cubic-bezier(.2, .75, .25, 1);
}
.raniko-guest-tour.is-open .raniko-guest-tour__panel { opacity: 1; transform: translateY(0) scale(1); }
.raniko-guest-tour.is-closing .raniko-guest-tour__panel { opacity: 0; transform: translateY(12px) scale(.98); }
.raniko-guest-tour.is-suppressed { visibility: hidden; opacity: 0; pointer-events: none; }
.raniko-guest-tour__panel::after {
  content: '';
  position: absolute;
  inset: 12px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, .035);
  border-radius: 19px;
  pointer-events: none;
}
.raniko-guest-tour__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 8;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 12px;
  color: rgba(249, 245, 255, .82);
  background: rgba(9, 10, 24, .48);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}
.raniko-guest-tour__close:hover,
.raniko-guest-tour__close:focus-visible {
  color: #fff;
  border-color: rgba(231, 163, 255, .7);
  background: rgba(172, 70, 237, .28);
  transform: rotate(4deg);
}
.raniko-guest-tour__visual {
  position: relative;
  display: grid;
  place-items: end center;
  min-height: 580px;
  overflow: hidden;
  padding: 30px 18px 0;
  background:
    radial-gradient(circle at 50% 43%, rgba(199, 93, 255, .23), transparent 33%),
    linear-gradient(160deg, rgba(24, 16, 53, .82), rgba(12, 15, 36, .44));
}
.raniko-guest-tour__visual::before,
.raniko-guest-tour__visual::after {
  content: '✦';
  position: absolute;
  color: rgba(244, 191, 255, .75);
  text-shadow: 0 0 16px rgba(211, 106, 255, .92);
  animation: ranikoTourTwinkle 3.8s ease-in-out infinite;
  pointer-events: none;
}
.raniko-guest-tour__visual::before { top: 18%; left: 14%; font-size: 20px; }
.raniko-guest-tour__visual::after { top: 34%; right: 15%; font-size: 12px; animation-delay: -1.3s; }
.raniko-guest-tour__halo {
  position: absolute;
  width: 77%;
  aspect-ratio: 1;
  bottom: 2%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(207, 91, 255, .31), rgba(106, 59, 206, .11) 46%, transparent 70%);
  filter: blur(3px);
  animation: ranikoTourHalo 5.8s ease-in-out infinite;
}
.raniko-guest-tour__image {
  position: relative;
  z-index: 2;
  display: block;
  width: min(100%, 520px);
  height: min(540px, 90vh);
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .34));
  opacity: 0;
  transition: opacity .2s ease;
  animation: ranikoTourFloat 5.6s ease-in-out infinite;
  transform-origin: 50% 88%;
}
.raniko-guest-tour__image.is-ready { opacity: 1; }
.raniko-guest-tour__fx { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.tour-spark,
.tour-heart,
.tour-page-glow,
.tour-choice-glow,
.tour-rank-star {
  position: absolute;
  display: block;
  color: #f5c8ff;
  font-style: normal;
  text-shadow: 0 0 12px rgba(226, 111, 255, .98), 0 0 26px rgba(125, 76, 255, .62);
  animation: ranikoTourSpark 3.6s ease-in-out infinite;
}
.tour-spark--a { left: 15%; top: 42%; font-size: 26px; animation-delay: -.6s; }
.tour-spark--b { left: 23%; top: 24%; font-size: 15px; animation-delay: -1.7s; }
.tour-spark--c { right: 16%; top: 48%; font-size: 21px; animation-delay: -2.5s; }
.tour-heart { left: 16%; top: 56%; color: #ff92d6; font-size: 28px; animation: ranikoTourHeart 4.2s ease-in-out infinite; }
.tour-heart--soft { color: #e8a7ff; font-size: 24px; }
.tour-page-glow { left: 43%; top: 39%; color: #ffd68a; font-size: 30px; animation: ranikoTourPage 3s ease-in-out infinite; }
.tour-choice-glow { right: 26%; top: 32%; color: #ffd28c; font-size: 27px; animation-delay: -1s; }
.tour-rank-star { left: 19%; top: 19%; color: #ffe08f; font-size: 32px; animation: ranikoTourRank 4s ease-in-out infinite; }
.raniko-guest-tour__content {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 58px clamp(28px, 4.5vw, 58px) 38px clamp(26px, 4vw, 52px);
}
.raniko-guest-tour__eyebrow {
  margin-bottom: 20px;
  color: #e39bff;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .16em;
  line-height: 1.3;
  text-transform: uppercase;
  text-shadow: 0 0 16px rgba(209, 104, 255, .45);
}
.raniko-guest-tour__eyebrow span { color: #ffd58c; padding: 0 4px; }
.raniko-guest-tour__meta {
  min-height: 15px;
  margin-bottom: 10px;
  color: rgba(211, 202, 235, .65);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.raniko-guest-tour__title {
  max-width: 470px;
  margin: 0;
  color: #fff;
  font-size: clamp(28px, 3.1vw, 42px);
  font-weight: 820;
  letter-spacing: 0;
  line-height: 1.08;
  text-wrap: balance;
}
.raniko-guest-tour__body {
  max-width: 490px;
  margin: 21px 0 0;
  color: rgba(244, 240, 255, .82);
  font-size: clamp(15px, 1.45vw, 18px);
  line-height: 1.65;
  white-space: pre-line;
}
.raniko-guest-tour__progress {
  display: flex;
  gap: 7px;
  min-height: 8px;
  margin-top: 28px;
}
.raniko-guest-tour__dot {
  display: block;
  width: 28px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  transition: width .3s ease, background .3s ease, box-shadow .3s ease;
}
.raniko-guest-tour__dot.is-done { background: rgba(209, 131, 255, .64); }
.raniko-guest-tour__dot.is-current { width: 46px; background: #ed9fff; box-shadow: 0 0 13px rgba(220, 105, 255, .7); }
.raniko-guest-tour__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 32px;
}
.raniko-guest-tour__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  max-width: 100%;
  padding: 0 19px;
  border: 1px solid transparent;
  border-radius: 13px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.raniko-guest-tour__button span { margin-left: 8px; font-size: 16px; }
.raniko-guest-tour__button:hover,
.raniko-guest-tour__button:focus-visible { transform: translateY(-2px); }
.raniko-guest-tour__button--primary {
  color: #fff;
  background: linear-gradient(120deg, #793fdf, #bd52dd);
  box-shadow: 0 12px 25px rgba(143, 62, 222, .3), inset 0 1px rgba(255, 255, 255, .2);
}
.raniko-guest-tour__button--primary:hover,
.raniko-guest-tour__button--primary:focus-visible { box-shadow: 0 15px 30px rgba(159, 68, 236, .45), 0 0 0 3px rgba(216, 129, 255, .19); }
.raniko-guest-tour__button--secondary {
  color: rgba(247, 241, 255, .87);
  border-color: rgba(231, 193, 255, .25);
  background: rgba(255, 255, 255, .055);
}
.raniko-guest-tour__button--secondary:hover,
.raniko-guest-tour__button--secondary:focus-visible { border-color: rgba(231, 193, 255, .58); background: rgba(213, 141, 255, .13); }
.raniko-guest-tour button:focus-visible,
.raniko-guest-tour a:focus-visible { outline: 3px solid rgba(255, 210, 125, .85); outline-offset: 3px; }
body.raniko-tour-open { overflow: hidden; }

html[data-theme="light"] .raniko-guest-tour__backdrop { background: rgba(14, 14, 37, .56); }
html[data-theme="light"] .raniko-guest-tour__panel { background: #17162a; }

@keyframes ranikoTourBackdrop { from { opacity: 0; } to { opacity: 1; } }
@keyframes ranikoTourFloat { 0%, 100% { transform: translateY(0) rotate(-.25deg); } 50% { transform: translateY(-8px) rotate(.28deg); } }
@keyframes ranikoTourHalo { 0%, 100% { opacity: .68; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes ranikoTourTwinkle { 0%, 100% { opacity: .3; transform: scale(.84) rotate(0); } 50% { opacity: .95; transform: scale(1.15) rotate(12deg); } }
@keyframes ranikoTourSpark { 0%, 100% { opacity: .34; transform: translate3d(0, 5px, 0) scale(.75) rotate(-8deg); } 50% { opacity: 1; transform: translate3d(0, -8px, 0) scale(1.08) rotate(8deg); } }
@keyframes ranikoTourHeart { 0%, 100% { opacity: .38; transform: translateY(5px) scale(.78) rotate(-8deg); } 50% { opacity: 1; transform: translateY(-7px) scale(1.08) rotate(8deg); } }
@keyframes ranikoTourPage { 0%, 100% { opacity: .35; transform: translateY(6px) rotate(-8deg) scale(.8); } 50% { opacity: 1; transform: translateY(-8px) rotate(10deg) scale(1.12); } }
@keyframes ranikoTourRank { 0%, 100% { opacity: .45; transform: scale(.82) rotate(-10deg); } 50% { opacity: 1; transform: scale(1.13) rotate(10deg); } }

@media (max-width: 760px) {
  .raniko-guest-tour { padding: 10px; }
  .raniko-guest-tour__panel {
    grid-template-columns: 1fr;
    width: min(520px, 100%);
    max-height: calc(100vh - 20px);
    min-height: 0;
    overflow: auto;
    border-radius: 22px;
  }
  .raniko-guest-tour__visual { min-height: 270px; height: min(44vh, 360px); max-height: 360px; padding: 10px 10px 0; }
  .raniko-guest-tour__image { width: min(100%, 330px); height: 100%; object-fit: contain; object-position: center bottom; }
  .raniko-guest-tour__halo { width: 70%; bottom: -9%; }
  .raniko-guest-tour__content { padding: 20px 19px 18px; }
  .raniko-guest-tour__close { top: 10px; right: 10px; }
  .raniko-guest-tour__eyebrow { margin-bottom: 14px; font-size: 9px; }
  .raniko-guest-tour__meta { font-size: 9px; }
  .raniko-guest-tour__title { font-size: clamp(25px, 8vw, 34px); }
  .raniko-guest-tour__body { margin-top: 12px; font-size: 14px; line-height: 1.47; }
  .raniko-guest-tour__progress { margin-top: 17px; }
  .raniko-guest-tour__actions { margin-top: 18px; gap: 8px; }
  .raniko-guest-tour__button { flex: 1 1 180px; min-height: 42px; font-size: 13px; }
}
@media (max-width: 390px) {
  .raniko-guest-tour__visual { min-height: 250px; height: min(44vh, 340px); max-height: 340px; }
  .raniko-guest-tour__content { padding: 17px 15px 15px; }
  .raniko-guest-tour__title { font-size: clamp(23px, 7.4vw, 31px); }
  .raniko-guest-tour__body { font-size: 13px; }
  .raniko-guest-tour__button { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .raniko-guest-tour *,
  .raniko-guest-tour *::before,
  .raniko-guest-tour *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* RANOTEKA_MOBILE_TAXONOMY_COMPACT_V1: keep genre and tag metadata
 * scannable without turning long values into a full-page list. */
@media (max-width: 760px) {
  .book-page .book-taxonomy {
    gap: 6px !important;
    margin: 0 0 10px !important;
    padding: 8px 9px !important;
  }

  .book-page .book-taxonomy__row {
    grid-template-columns: 54px minmax(0, 1fr) !important;
    gap: 6px !important;
  }

  .book-page .book-taxonomy__label {
    padding-top: 3px !important;
    font-size: 9px !important;
    line-height: 1.1 !important;
  }

  .book-page .book-taxonomy__row .badges {
    gap: 4px 5px !important;
  }

  .book-page .book-taxonomy .taxonomy-link {
    min-height: 23px !important;
    padding: 3px 6px !important;
    border-radius: 6px !important;
    font-size: 10px !important;
    line-height: 1.15 !important;
  }
}

@media (max-width: 390px) {
  .book-page .book-taxonomy__row {
    grid-template-columns: 48px minmax(0, 1fr) !important;
    gap: 5px !important;
  }

  .book-page .book-taxonomy .taxonomy-link {
    min-height: 22px !important;
    padding: 3px 5px !important;
    font-size: 9px !important;
  }
}

/* RANOTEKA_CHAPTER_LIST_COMPACT_V1: keep the chapter index dense while
 * preserving a readable title and a clear reading action on every screen. */
.book-page .chapter-list {
  gap: 5px !important;
}

.book-page .chapter {
  min-height: 0 !important;
  padding: 7px 10px !important;
  gap: 7px 9px !important;
  border-radius: 9px !important;
}

.book-page .chapter__title strong {
  font-size: 13px !important;
  line-height: 1.2 !important;
}

.book-page .chapter__title span {
  font-size: 10px !important;
  line-height: 1.2 !important;
}

.book-page .chapter__price:empty {
  display: none !important;
}

.book-page .chapter > .btn {
  width: auto !important;
  min-width: 70px !important;
  min-height: 30px !important;
  padding: 5px 10px !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .book-page .chapter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 8px !important;
    padding: 6px 8px !important;
  }

  .book-page .chapter__title {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .book-page .chapter__title strong {
    display: -webkit-box !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    white-space: normal !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 11.5px !important;
    line-height: 1.18 !important;
  }

  .book-page .chapter__title span {
    display: block;
    margin-top: 2px;
    font-size: 9px !important;
    line-height: 1.15 !important;
  }

  .book-page .chapter__price {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    margin: 0;
    font-size: 10px !important;
  }

  .book-page .chapter > .btn {
    grid-column: 2;
    grid-row: 2;
    min-width: 62px !important;
    min-height: 28px !important;
    padding: 4px 8px !important;
    font-size: 10px !important;
  }

  .book-page .chapter--free .chapter__title {
    grid-row: 1;
  }

  .book-page .chapter--free > .btn {
    grid-row: 1;
  }
}

@media (max-width: 390px) {
  .book-page .chapter {
    gap: 3px 6px !important;
    padding: 5px 7px !important;
  }

  .book-page .chapter__title strong {
    font-size: 11px !important;
  }

  .book-page .chapter__title span {
    font-size: 8.5px !important;
  }

  .book-page .chapter > .btn {
    min-width: 59px !important;
    min-height: 27px !important;
    padding-inline: 7px !important;
    font-size: 9.5px !important;
  }
}

/* RANOTEKA_HOME_COVERS_BRIGHT_V1: the cards already have a readable title
 * below the artwork, so no dark readability veil is needed over the cover. */
.premium-book-card__cover::before,
.premium-book-card__cover::after {
  display: none !important;
  content: none !important;
  background: none !important;
  box-shadow: none !important;
  mix-blend-mode: normal !important;
  opacity: 1 !important;
}

.premium-book-card__cover img {
  opacity: 1 !important;
  filter: none !important;
}
