/* ============================================================
   KOMA — liseuse et zone de dépôt
   ============================================================ */

/* ---------- Zone de dépôt ---------- */
.dropzone { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; background: rgba(6, 6, 11, 0.8); backdrop-filter: blur(10px); animation: fade 0.2s; }
.dropzone-inner {
  display: grid; justify-items: center; gap: 10px; width: min(560px, 100%); padding: 70px 30px; border-radius: 26px;
  border: 2px dashed var(--accent); background: var(--accent-soft); text-align: center;
}
.dropzone-inner .ico { width: 40px; height: 40px; color: var(--accent); }
.dropzone-inner strong { font: 700 22px/1.2 var(--display); }
.dropzone-inner span { color: var(--muted); }

/* ---------- Liseuse ---------- */
.reader { position: fixed; inset: 0; z-index: 90; background: var(--reader-bg, #0a0a0f); color: var(--text); animation: fade 0.25s; }
.reader.light { --reader-bg: #f3f1ec; }
.reader.black { --reader-bg: #000; }
.r-top, .r-bottom {
  position: absolute; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  transition: opacity 0.35s, transform 0.35s var(--ease);
}
.r-top { top: 0; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0)); padding-bottom: 30px; }
.r-bottom { bottom: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0)); padding-top: 30px; flex-wrap: wrap; }
.reader.ui-hidden .r-top { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.reader.ui-hidden .r-bottom { opacity: 0; transform: translateY(12px); pointer-events: none; }
.reader.ui-hidden { cursor: none; }
.r-title { min-width: 0; flex: 1; }
.r-title strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.r-title span { font-size: 12px; color: rgba(255, 255, 255, 0.6); }
.r-tools { display: flex; align-items: center; gap: 4px; }
.r-tools .icon-btn { color: rgba(255, 255, 255, 0.75); }
.r-tools .icon-btn:hover, .r-tools .icon-btn.on { color: #fff; background: rgba(255, 255, 255, 0.12); }
.r-tools .sep { width: 1px; height: 22px; background: rgba(255, 255, 255, 0.15); margin: 0 4px; }
.r-select { height: 34px; padding: 0 8px; border-radius: 9px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12); color: #fff; font-size: 12.5px; outline: none; }
.r-select option { background: #15151f; }

.r-scrub { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 200px; color: rgba(255, 255, 255, 0.75); font-size: 12px; font-variant-numeric: tabular-nums; }
.r-scrub input[type=range] { flex: 1; accent-color: var(--accent); height: 4px; cursor: pointer; }
.r-dir-rtl .r-scrub input[type=range] { direction: rtl; }
.r-next { margin-left: auto; }

.r-stage { position: absolute; inset: 0; overflow: hidden; }
.r-stage.vertical { overflow-y: auto; overscroll-behavior: contain; scroll-behavior: auto; }
.r-strip { display: flex; flex-direction: column; align-items: center; padding: 70px 0 110px; }
.r-strip img, .r-strip .ph { display: block; width: min(var(--vw, 820px), 100%); height: auto; user-select: none; -webkit-user-drag: none; }
.r-strip.gap img { margin-bottom: 8px; }
.r-strip .ph { aspect-ratio: 0.7; background: rgba(255, 255, 255, 0.03); }
.r-strip .r-end { width: min(var(--vw, 820px), 100%); }

.r-pages { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 0; }
.r-pages img { display: block; user-select: none; -webkit-user-drag: none; transition: opacity 0.2s; box-shadow: 0 0 60px rgba(0, 0, 0, 0.5); }
.r-pages.fit-height img { max-height: 100vh; max-width: 100vw; object-fit: contain; }
.r-pages.double.fit-height img { max-width: 50vw; }
.r-pages.fit-width { overflow-y: auto; align-items: flex-start; }
.r-pages.fit-width img { width: min(100vw, 1100px); height: auto; }
.r-pages.double.fit-width img { width: min(50vw, 800px); }
.r-pages.original { overflow: auto; align-items: flex-start; justify-content: flex-start; }
.r-pages.original > .r-pair { margin: auto; display: flex; }
.r-pair { display: flex; align-items: center; justify-content: center; transform-origin: center center; }
.r-pages.rtl .r-pair { flex-direction: row-reverse; }

.r-zone { position: absolute; top: 0; bottom: 0; z-index: 2; width: 30%; }
.r-zone.left { left: 0; cursor: w-resize; }
.r-zone.right { right: 0; cursor: e-resize; }
.r-zone.mid { left: 30%; right: 30%; }
.reader.ui-hidden .r-zone { cursor: none; }

.r-end {
  display: grid; justify-items: center; gap: 12px; padding: 50px 20px; text-align: center; color: rgba(255, 255, 255, 0.8);
}
.reader.light .r-end, .reader.light .r-hint { color: #333; }
.r-end h3 { margin: 0; font: 700 18px/1.2 var(--display); }
.r-end-card { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(10px); animation: fade 0.3s; }

.r-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 12px 18px; border-radius: 12px; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 13px; pointer-events: none; animation: hintOut 1.4s forwards; z-index: 4; }
.r-loading { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, 0.6); }

.r-thumbs {
  position: absolute; left: 0; right: 0; bottom: 78px; z-index: 3; display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px;
  background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(10px); scrollbar-width: thin; animation: fade 0.2s;
}
.r-thumbs button { flex: none; width: 64px; border-radius: 6px; overflow: hidden; opacity: 0.55; outline: 2px solid transparent; transition: all 0.15s; position: relative; }
.r-thumbs button.cur { opacity: 1; outline-color: var(--accent); }
.r-thumbs button:hover { opacity: 1; }
.r-thumbs img { width: 64px; height: 92px; object-fit: cover; display: block; background: #111; }
.r-thumbs b { position: absolute; bottom: 2px; right: 4px; font-size: 10px; text-shadow: 0 1px 3px #000; }
.reader.ui-hidden .r-thumbs { display: none; }

@keyframes hintOut { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }

@media (max-width: 900px) {
  .r-tools .hide-sm { display: none; }
  .r-scrub { order: 3; flex-basis: 100%; }
}
