* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body:has(.stage) { height: 100dvh; overflow: hidden; }
body {
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #2b2d31; color: #eee;
  display: flex; flex-direction: column;
}
button, .btn {
  font: inherit; color: inherit; background: #3c3f45; border: 0; border-radius: 6px;
  padding: 6px 12px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { background: #4a4e55; }
button:disabled { opacity: .35; cursor: default; }
input { font: inherit; padding: 6px 8px; border-radius: 6px; border: 1px solid #555; background: #1e1f22; color: #eee; }

.bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #1e1f22; flex: none; }
.bar .title { font-weight: 600; margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .count { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }

.stage { flex: 1; position: relative; overflow: hidden; display: grid; place-items: center; touch-action: pan-y pinch-zoom; }
.stage.zoomed { display: block; overflow: auto; touch-action: auto; }
.stage.zoomed .spread { width: max-content; margin: 16px auto; }
.spread { display: flex; margin: 16px; box-shadow: 0 6px 30px rgba(0,0,0,.5); transition: opacity .15s; }
.spread.fading { opacity: 0; }
.page { position: relative; background: #fff; }
.page img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }

.hotspot { position: absolute; border-radius: 4px; transition: background .15s, box-shadow .15s; }
.hotspot:hover, .hotspot:focus-visible { background: rgba(0, 120, 255, .12); box-shadow: inset 0 0 0 2px rgba(0, 120, 255, .7); outline: none; }

.nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 96px; font-size: 28px; background: rgba(30,31,34,.6); z-index: 2; }
.nav.prev { left: 8px; } .nav.next { right: 8px; }
.stage.zoomed .nav { position: fixed; top: 50vh; }
@media (hover: none) { .nav, #full { display: none; } }
@media (max-width: 500px) { .bar { gap: 4px; padding: 8px; } .bar button { padding: 6px 10px; } }

.list { max-width: 640px; margin: 40px auto; padding: 0 16px; width: 100%; }
.list a { display: block; padding: 14px 16px; margin: 8px 0; background: #3c3f45; border-radius: 8px; color: #fff; text-decoration: none; }
.list a:hover { background: #4a4e55; }
