/* Kidjutsu Comic Reader */

/* Embedded thumbnail with click-to-read */
.comic-reader-embed {
  position: relative;
  display: inline-block;
  cursor: pointer;
  background: #1a1a1a;
  overflow: hidden;
}
.comic-reader-embed img.cr-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.comic-reader-embed .cr-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-family: Verdana, Arial, sans-serif;
  font-size: 13px;
  gap: 8px;
  transition: background 0.15s;
}
.comic-reader-embed:hover .cr-play-btn {
  background: rgba(0,0,0,0.55);
}
.cr-play-btn .cr-play-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cr-play-btn .cr-play-icon::after {
  content: '';
  border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent #333;
  margin-left: 4px;
}

/* ------------------------------------------------------------------ */
/* Full-screen modal reader overlay                                     */
/* ------------------------------------------------------------------ */
.cr-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #E1E1D5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  outline: none;
}
.cr-modal.cr-fullscreen-bg {
  background: #383D44;
}

/* Page image */
.cr-modal .cr-page-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.cr-modal .cr-page-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 0.12s ease;
}
.cr-modal .cr-page-img.cr-loading {
  opacity: 0.4;
}

/* Scroll container when zoomed */
.cr-modal.cr-zoomed .cr-page-wrap {
  overflow-y: auto;
  overflow-x: hidden;
  align-items: flex-start;
  padding-top: 10px;
}
.cr-modal.cr-zoomed .cr-page-img {
  max-height: none;
}

/* Side navigation arrows */
.cr-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 80px;
  background: rgba(0,0,0,0.25);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.15s;
  padding: 0;
}
.cr-nav-arrow:hover {
  background: rgba(0,0,0,0.55);
}
.cr-nav-arrow.cr-prev { left: 8px; }
.cr-nav-arrow.cr-next { right: 8px; }
.cr-nav-arrow::after {
  content: '';
  border-style: solid;
  border-color: transparent;
  border-width: 12px;
}
.cr-nav-arrow.cr-prev::after {
  border-right-color: rgba(255,255,255,0.85);
  border-left: none;
  margin-right: 4px;
}
.cr-nav-arrow.cr-next::after {
  border-left-color: rgba(255,255,255,0.85);
  border-right: none;
  margin-left: 4px;
}
.cr-nav-arrow:disabled {
  opacity: 0.2;
  cursor: default;
}

/* Toolbar */
.cr-toolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cr-toolbar button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  background: rgba(23,28,35,0.8);
  color: #aaa;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.cr-toolbar button:hover {
  background: rgba(23,28,35,1);
  color: #fff;
}
.cr-toolbar button.cr-active {
  color: #F8C31D;
}

/* Title overlay (top-left — mirrors ComicApp.as titleField) */
.cr-title {
  position: absolute;
  top: 12px;
  left: 10px;
  z-index: 20;
  background: rgba(23,28,35,0.7);
  color: #ccc;
  font-family: Verdana, Arial, sans-serif;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  pointer-events: none;
  white-space: nowrap;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Page counter */
.cr-counter {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: rgba(23,28,35,0.7);
  color: #ccc;
  font-family: Verdana, Arial, sans-serif;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  pointer-events: none;
  white-space: nowrap;
}

/* Nav strip (thumbnail bar) */
.cr-nav-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: rgba(23,28,35,0.88);
  display: flex;
  align-items: center;
  padding: 6px 50px;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  transform: translateY(100%);
  transition: transform 0.2s ease;
  scrollbar-width: thin;
  scrollbar-color: #555 transparent;
}
.cr-nav-strip::-webkit-scrollbar { height: 4px; }
.cr-nav-strip::-webkit-scrollbar-thumb { background: #555; border-radius: 2px; }
.cr-nav-strip.cr-strip-visible {
  transform: translateY(0);
}
/* Activation zone at the bottom edge */
.cr-strip-trigger {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;
  z-index: 19;
  cursor: default;
}
.cr-nav-strip .cr-thumb {
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 2px;
  transition: border-color 0.1s;
  overflow: hidden;
  background: #333;
}
.cr-nav-strip .cr-thumb img {
  display: block;
  height: 72px;
  width: auto;
}
.cr-nav-strip .cr-thumb.cr-thumb-active {
  border-color: #F8C31D;
}
.cr-nav-strip .cr-thumb:hover {
  border-color: #fff;
}

/* Finish overlay */
.cr-finish-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(0,0,0,0.78);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-family: Verdana, Arial, sans-serif;
  color: #fff;
}
.cr-finish-overlay h2 {
  font-size: 22px;
  margin: 0;
  color: #F8C31D;
}
.cr-finish-overlay p {
  margin: 0;
  font-size: 14px;
  opacity: 0.85;
}
.cr-finish-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.cr-finish-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  background: #000;
  color: #F8C31D;
  font-family: Verdana, Arial, sans-serif;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.15s;
}
.cr-finish-actions button:hover { background: #444; }
