/* Puni strip čitač + detalj scene */
.reader-page-body {
  margin: 0;
  background: #0b0b10;
  color: #eee;
  font-family: Inter, system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

#reader-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  animation: readerFadeIn 180ms ease;
}

/* Suptilna tranzicija pri prelasku na drugu scenu (fade-out → fade-in). */
.reader-leaving {
  opacity: 0;
  transition: opacity 150ms ease;
}

/* Comic loader (puni ekran): halftone pozadina + Fazonator logo u Bangers fontu. */
.reader-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.06) 2px, transparent 0) 0 0 / 13px 13px,
    radial-gradient(circle at 50% 35%, rgba(255, 107, 53, 0.18), transparent 55%),
    #0b0b10;
  opacity: 1;
  transition: opacity 180ms ease;
}

.reader-loader--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.reader-loader-inner {
  text-align: center;
  animation: readerLoaderPulse 1s ease-in-out infinite;
}

.reader-loader-logo {
  display: block;
  font-family: Bangers, cursive;
  font-size: clamp(2.4rem, 9vw, 4rem);
  letter-spacing: 2px;
  color: #ffd166;
  -webkit-text-stroke: 2px #0b0b10;
  text-shadow: 4px 4px 0 #ff6b35;
}

.reader-loader-text {
  display: block;
  margin-top: 0.75rem;
  font-family: Bangers, cursive;
  letter-spacing: 1px;
  font-size: clamp(0.9rem, 3.5vw, 1.15rem);
  color: #eee;
  opacity: 0.85;
}

@keyframes readerLoaderPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reader-loader {
    transition: none;
  }
  .reader-loader-inner {
    animation: none;
  }
}

@keyframes readerFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  #reader-app {
    animation: none;
  }
  .reader-leaving {
    transition: none;
  }
}

.reader-topbar-member .topbar-member-btn {
  padding: 8px 12px;
  font-size: 10px;
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reader-topbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  padding: 0.75rem 1rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  background: rgba(11, 11, 16, 0.95);
  border-bottom: 1px solid #2a2a3a;
  position: sticky;
  top: 0;
  z-index: 10;
}

.reader-back {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #1c1c28;
  color: #fff;
  text-decoration: none;
  font-size: 1.25rem;
}

.reader-topbar-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.reader-topbar-meta strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.95rem;
}

.reader-topbar-meta span {
  font-size: 0.75rem;
  color: #9a9ab0;
}

.reader-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.reader-counter {
  font-size: 0.8rem;
  color: #9a9ab0;
  white-space: nowrap;
}

.reader-stage {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.reader-nav {
  position: relative;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s ease;
}

.reader-nav:disabled {
  opacity: 0.25;
  cursor: default;
}

/* Strelica koja vodi na drugu scenu: suptilno istaknuta + badge oznaka. */
.reader-nav--scene {
  background: rgba(255, 77, 77, 0.18);
}

.reader-nav-tag {
  position: absolute;
  top: calc(100% + 6px);
  white-space: nowrap;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255, 77, 77, 0.92);
  padding: 2px 8px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.reader-nav-prev .reader-nav-tag {
  left: 0;
}

.reader-nav-next .reader-nav-tag {
  right: 0;
}

/* Badge se ne vidi stalno — samo na hover, focus (tastatura) ili kratak peek. */
.reader-nav--scene:hover .reader-nav-tag,
.reader-nav--scene:focus-visible .reader-nav-tag,
.reader-nav--peek .reader-nav-tag {
  opacity: 1;
  transform: translateY(0);
}

.reader-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 0;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.reader-track::-webkit-scrollbar {
  display: none;
}

.reader-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(62vh, 640px);
  padding: 0.5rem;
}

.reader-slide img {
  max-width: 100%;
  max-height: min(62vh, 640px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

/* Scena bez panela koristi isti .reader-slide kao običan panel — prikazuje se
   samo cover. Fallback (kad nema cover slike) je diskretan tekst da slide ne bude prazan. */
.reader-slide-empty {
  color: #fff;
  opacity: 0.7;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  text-align: center;
}

.reader-progress-wrap {
  height: 4px;
  background: #1c1c28;
  flex-shrink: 0;
}

.reader-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ff4d4d, #ffd24d);
  transition: width 0.25s ease;
}

.reader-hint {
  text-align: center;
  font-size: 0.8rem;
  color: #9a9ab0;
  margin: 0.75rem 1rem;
  flex-shrink: 0;
}

.reader-loading,
.reader-error {
  padding: 2rem;
  text-align: center;
}

/* --- Komentari na čitaču --- */
.reader-comments {
  flex: 0 0 auto;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
  box-sizing: border-box;
  border-top: 1px solid #2a2a3a;
  background: #101018;
}

.reader-comments h2 {
  font-family: Bangers, cursive;
  font-size: 1.75rem;
  letter-spacing: 0.04em;
  margin: 0 0 1rem;
  color: #fff;
}

.reader-comments .comment-hint {
  color: #9a9ab0;
  margin: 0.5rem 0 1rem;
  line-height: 1.45;
}

.reader-comments .comment-hint a {
  color: #ffd24d;
  font-weight: 700;
}

.reader-comments .comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.reader-comments .comment-item {
  border: 2px solid #3a3a50;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  background: #1a1a26;
  color: #eee;
}

.reader-comments .comment-meta {
  font-size: 0.78rem;
  font-weight: 700;
  color: #9a9ab0;
  margin-bottom: 0.35rem;
}

.reader-comments .comment-item p {
  margin: 0;
  line-height: 1.45;
}

.reader-comments .comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.reader-comments .comment-form textarea {
  width: 100%;
  min-height: 96px;
  box-sizing: border-box;
  border: 2px solid #4a4a62;
  border-radius: 12px;
  padding: 0.75rem;
  font: inherit;
  font-size: 1rem;
  color: #111;
  background: #fff;
  resize: vertical;
}

.reader-comments .comment-form textarea:focus {
  outline: none;
  border-color: #ffd24d;
  box-shadow: 0 0 0 2px rgba(255, 210, 77, 0.35);
}

.reader-comment-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0.85rem 1.25rem;
  border: 3px solid #0b0b10;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffd24d, #ffb347);
  color: #0b0b10;
  font-weight: 900;
  font-size: 0.95rem;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 4px 4px 0 #0b0b10;
}

.reader-comment-submit:hover {
  filter: brightness(1.05);
}

.reader-comment-submit:active {
  transform: translateY(1px);
  box-shadow: 2px 2px 0 #0b0b10;
}

.reader-comments .comment-msg {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: rgba(255, 210, 77, 0.15);
  color: #ffd24d;
  font-weight: 700;
  font-size: 0.9rem;
}

.reader-page-body .btn-favorite {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 2px solid #ffd24d;
  border-radius: 50%;
  background: #1c1c28;
  color: #ffd24d;
  font-size: 1.15rem;
  cursor: pointer;
  line-height: 1;
}

.reader-page-body .btn-favorite.is-on {
  background: #ffd24d;
  color: #0b0b10;
}

.scene-detail {
  max-width: 520px;
  margin: 0 auto;
  padding: 1.5rem;
  padding-bottom: 3rem;
}

.scene-detail-card {
  background: #14141c;
  border: 1px solid #2a2a3a;
  border-radius: 16px;
  padding: 1.25rem;
}

.scene-detail-cover {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.scene-detail-card h1 {
  margin: 0.5rem 0;
  font-size: 1.5rem;
}

.comic-card-link {
  display: block;
}

@media (min-width: 900px) {
  .reader-stage {
    max-width: 900px;
    margin: 0 auto;
  }

  .reader-comments {
    max-width: 720px;
  }
}
