/* Loudlore web reader: the app's reading view for a whole book on the website.
   Generic: the page sets window.LL_BOOK (data file, audio folder, chapter names). Used by /oz. */

.ll, .ll-bar, .ll-follow {
  --ll-bg: #12142a;
  --ll-panel: #1a1d36;
  --ll-rule: #2c3054;
  --ll-ink: #f2efe6;
  --ll-muted: #a3a8c3;
  --ll-current: #2a3560;
  --ll-hover: rgba(174, 178, 203, .12);
  --ll-amber: #f2b04a;
  /* character colours: the app's dark palette */
  --sp0: #5FBDC7; --sp1: #F0C4FF; --sp2: #DD9A7D; --sp3: #ABA3E2; --sp4: #8EBB84;
  --sp5: #CAA669; --sp6: #DF959D; --sp7: #81B4D3; --sp8: #AFB26E; --sp9: #6CBFA6;
}

.ll-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 0 0 6px; }
.ll-head h2 { margin: 0; }
.ll-pick { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; justify-content: flex-end; }
.ll-pick label { font-size: 15px; color: var(--ll-muted); }
.ll-pick select {
  min-width: 0; max-width: 100%; width: 420px; font: 500 16px/1.2 var(--sans, system-ui); color: var(--ll-ink);
  background: var(--ll-panel); border: 1px solid var(--ll-rule); border-radius: 10px; padding: 10px 12px;
}
.ll-hint { margin: 0 0 18px; font-size: 15px; color: var(--ll-muted); }

.ll-legend { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0 0 4px; padding: 0; list-style: none; }
.ll-legend li { font-size: 14px; padding: 4px 9px; border-radius: 999px; background: var(--ll-hover); }
.ll-legend li span { color: var(--ll-muted); margin-left: 5px; font-variant-numeric: tabular-nums; }

.ll-chapter { margin: 26px 0 18px; }
.ll-chapter .ll-num { display: block; font: 600 14px/1.2 var(--sans, system-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ll-amber); }
.ll-chapter .ll-title { display: block; margin-top: 6px; font: 400 30px/1.2 var(--serif, Georgia, serif); color: var(--ll-ink); }

.ll-text { font: 400 20px/1.65 var(--serif, Georgia, serif); color: var(--ll-ink); max-width: 680px; padding-bottom: 40px; }
.ll-text p { margin: 0 0 22px; }
.ll-text p.ll-break { text-align: center; color: var(--ll-muted); letter-spacing: .4em; }
.ll-ln { border-radius: 5px; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background .15s; }
.ll-ln[data-t] { cursor: pointer; }
.ll-ln[data-t]:hover { background: var(--ll-hover); }
.ll-ln.ll-said { font-weight: 600; }
.ll-ln.ll-skip { color: var(--ll-muted); }
.ll-ln.ll-now { background: var(--ll-current); box-shadow: 0 0 0 4px var(--ll-current); }
.ll-loading, .ll-error { color: var(--ll-muted); font-size: 16px; }
.ll-error { color: var(--ll-amber); }

/* player bar, fixed at the bottom like in the app */
.ll-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(18, 20, 42, .94); border-top: 1px solid var(--ll-rule);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.ll-bar-in { max-width: 860px; margin: 0 auto; padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: auto auto auto 1fr; align-items: center; gap: 6px 10px; }
.ll-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: transparent; color: var(--ll-ink); display: grid; place-items: center;
}
.ll-btn:hover { background: var(--ll-hover); }
.ll-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.ll-btn svg { width: 22px; height: 22px; fill: currentColor; }
.ll-btn.ll-main { width: 52px; height: 52px; background: var(--ll-amber); color: #13152a; }
.ll-btn.ll-main:hover { filter: brightness(1.07); background: var(--ll-amber); }
.ll-btn.ll-main svg { width: 24px; height: 24px; }
.ll-info { min-width: 0; display: grid; gap: 4px; padding-left: 6px; }
.ll-now-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ll-now-title b { font-weight: 600; color: var(--ll-amber); margin-right: 6px; }
.ll-seek { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ll-muted); font-variant-numeric: tabular-nums; }
.ll-seek input { flex: 1; min-width: 60px; accent-color: var(--ll-amber); height: 24px; }
.ll-btn:focus-visible, .ll-pick select:focus-visible, .ll-seek input:focus-visible, .ll-follow:focus-visible { outline: 3px solid var(--ll-amber); outline-offset: 2px; }
.ll-follow {
  position: fixed; right: 16px; bottom: 96px; z-index: 21; border: 1px solid var(--ll-rule); cursor: pointer;
  background: var(--ll-panel); color: var(--ll-ink); font: 500 14px/1 var(--sans, system-ui); padding: 10px 14px; border-radius: 999px;
}
.ll-follow[hidden] { display: none; }
body.ll-has-bar { padding-bottom: 96px; }

@media (max-width: 720px) {
  .ll-text { font-size: 18px; }
  .ll-chapter .ll-title { font-size: 25px; }
  .ll-bar-in { padding-left: 10px; padding-right: 12px; gap: 4px 6px; grid-template-columns: auto auto auto 1fr; }
  .ll-btn { width: 40px; height: 40px; }
  .ll-btn.ll-main { width: 48px; height: 48px; }
  .ll-follow { bottom: 92px; right: 10px; }
}
@media (prefers-reduced-motion: reduce) { .ll-ln { transition: none; } }

.ll-ln[data-t]:focus-visible { outline: 2px solid var(--ll-amber); outline-offset: 2px; }
@media (max-width: 720px) { .ll-pick { justify-content: flex-start; } }
