/* RAVENS - Interactive Comic Reader */

:root {
  /* Draw native widgets dark - the <select> dropdown popup in the panel editor
     is rendered by the OS and would otherwise be light text on white. */
  color-scheme: dark;

  --bg: #070809;
  --bg2: #0d1014;
  --ink: #e8eaee;
  --dim: #8a929c;
  --accent: #38bdf8;
  --accent2: #f97316;
  --dim-strength: 0.68;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --cam: 900ms;
  --chrome-h: 56px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  touch-action: none;
}

body.cursor-hidden, body.cursor-hidden * { cursor: none; }

/* ---------------------------------------------------------------- viewport */

#viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 40%, #12161c 0%, #070809 62%, #030405 100%);
}

/* Rattled by explosions. Wraps the stage and the spotlight so they move as one. */
#shaker {
  position: absolute;
  inset: 0;
  will-change: transform;
}

#stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
  transform-style: preserve-3d;
}

#stage.animate { transition: transform var(--cam) var(--ease); }

.spread {
  position: absolute;
  left: 0;
  top: 0;
  transform-style: preserve-3d;
}

/* a single page inside the spread */
.leaf {
  position: absolute;
  top: 0;
  overflow: hidden;
  background: #0b0d10 no-repeat center / cover;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 30px 80px -20px rgba(0, 0, 0, 0.9);
  backface-visibility: hidden;
}

/* Absolutely positioned so the base tier and the native-width tier overlay
   each other instead of stacking, and so a re-render never drops back to the
   blurred placeholder while the big file decodes again. */
.leaf img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 420ms ease;
}

.leaf img.ready { opacity: 1; }
.leaf img.hi { z-index: 2; }

/* the printed-book gutter between two facing pages */
.gutter {
  position: absolute;
  top: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.55) 42%,
      rgba(0, 0, 0, 0.75) 50%,
      rgba(0, 0, 0, 0.55) 58%,
      rgba(0, 0, 0, 0) 100%);
  mix-blend-mode: multiply;
  z-index: 3;
}

/* ------------------------------------------------------------- page flip */

/* The conical page turn. Full-viewport, only visible while a sheet is moving. */
#flipGL {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  pointer-events: none;
  display: none;
}
#flipGL.on { display: block; }

/* Perspective lives here, inside the scaled stage, so the depth of the page
   turn stays proportional to the page as the camera zooms. */
#flipLayer {
  position: absolute;
  left: 0;
  top: 0;
  perspective: 2000px;
  perspective-origin: 50% 42%;
  transform-style: preserve-3d;
  pointer-events: none;
  z-index: 6;
}

.flipper {
  position: absolute;
  top: 0;
  left: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

/* One slice of the turning sheet. Each is nested inside the previous one and
   rotated a little further, so the chain bends into an arc.
   Deliberately no will-change here: promoting all 16 slices to their own
   compositing layers makes each one rasterise and snap to whole device pixels
   independently, and the sheet's edge comes out as a visible staircase. */
.sheet {
  position: absolute;
  top: 0;
  transform-style: preserve-3d;
}

/* The band of the page this slice shows is positioned as a background rather
   than clipped from an <img> with overflow:hidden. An overflow-hidden face
   becomes its own render surface, and render surfaces snap to whole device
   pixels - which turned the curved sheet's edge into a staircase.
   Same reason there is no backface-visibility here: reader.js hides the far
   side per slice instead. `inset` is set in JS so faces overlap their
   neighbours on all four sides. */
.sheet > .face {
  position: absolute;
  background-color: #0b0d10;
  background-repeat: no-repeat;
}

.sheet > .face.back { transform: rotateY(180deg); }

/* per-slice shading and specular, driven from the slice's angle to the viewer */
.sheet > .face > .sl-shade,
.sheet > .face > .sl-lite {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}
.sheet > .face > .sl-shade { background: #000; }
.sheet > .face > .sl-lite {
  background: #fff;
  mix-blend-mode: screen;
}

/* the free edge of the sheet, catching the light */
.sheet > .face.tip::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

/* shadow the lifting sheet throws onto the page it uncovers */
.cast {
  position: absolute;
  top: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.9;
}
.cast.to-right {
  background: linear-gradient(90deg,
    rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.22) 34%, rgba(0, 0, 0, 0) 70%);
}
.cast.to-left {
  background: linear-gradient(270deg,
    rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.22) 34%, rgba(0, 0, 0, 0) 70%);
}

/* ------------------------------------------------------------- spotlight */

/* The dim-everything-but-this-panel effect.
   Built from four solid panels around the focused rect rather than one huge
   box-shadow spread: a ~20000px shadow rect gets dropped by software
   rasterisers and is expensive on mobile GPUs. Four rects always paint. */
#spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 4;
  transition: opacity 420ms ease;
}

#spotlight.on { opacity: 1; }

#spotlight .sh {
  position: absolute;
  background: rgba(3, 5, 9, var(--dim-strength));
  transition:
    left var(--cam) var(--ease), top var(--cam) var(--ease),
    width var(--cam) var(--ease), height var(--cam) var(--ease);
}

#spotlight .ring {
  position: absolute;
  border-radius: 2px;
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.4),
    0 0 30px 4px rgba(56, 189, 248, 0.16);
  transition:
    left var(--cam) var(--ease), top var(--cam) var(--ease),
    width var(--cam) var(--ease), height var(--cam) var(--ease);
}

/* ---------------------------------------------------------------- topbar */

#topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(4, 6, 9, 0.9), rgba(4, 6, 9, 0));
  transition: opacity 340ms ease, transform 340ms ease;
}

#topbar.hidden {
  opacity: 0;
  transform: translateY(-14px);
  pointer-events: none;
}

.mode {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(10, 13, 18, 0.6);
  color: var(--dim);
  font: inherit;
  font-size: 13.5px;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
  backdrop-filter: blur(6px);
}
.mode svg { width: 19px; height: 19px; fill: currentColor; flex: 0 0 auto; }
.mode:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.3); }

.mode[aria-pressed="true"] {
  color: #eaf7ff;
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.18);
}

/* Autoplay is the one control that keeps acting after you let go of it, so it
   is marked in a different colour from the two modes - warm, not cyan. */
#modeAuto[aria-pressed="true"] {
  color: #fff6e8;
  border-color: rgba(251, 191, 36, 0.65);
  background: rgba(251, 191, 36, 0.2);
}

/* How much of this panel's time is left. Sits along the very top edge, wide
   enough to read at a glance and quiet enough to ignore. */
#autoBar {
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

#autoBar > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.5), #fbbf24);
  transform-origin: left center;
}

@media (prefers-reduced-motion: reduce) {
  #autoBar { display: none; }
}

/* ------------------------------------------------------- big page arrows */

/* Quiet by default, brighter under the pointer. Only shown while you are
   turning the pages yourself. */
.pagenav {
  position: fixed;
  top: 50%;
  z-index: 17;
  width: 62px;
  height: 116px;
  transform: translateY(-50%);
  border: 0;
  padding: 0;
  background: none;
  color: rgba(255, 255, 255, 0.26);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: color 200ms ease, opacity 300ms ease, visibility 300ms,
    transform 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
.pagenav svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.8));
}
.pagenav.left { left: 18px; }
.pagenav.right { right: 18px; }

body.pagemode .pagenav { opacity: 1; visibility: visible; }
body.pagemode .pagenav:hover { color: rgba(255, 255, 255, 0.92); }
body.pagemode .pagenav.left:hover { transform: translateY(-50%) translateX(-3px); }
body.pagemode .pagenav.right:hover { transform: translateY(-50%) translateX(3px); }
body.pagemode .pagenav:active { color: #fff; }
.pagenav[disabled] { opacity: 0.12 !important; cursor: default; }

/* ---------------------------------------------------------------- chrome */

#chrome {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--chrome-h);
  padding: 0 12px;
  background: linear-gradient(0deg, rgba(4, 6, 9, 0.92), rgba(4, 6, 9, 0));
  transition: opacity 340ms ease, transform 340ms ease;
}

#chrome.hidden {
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
}

.btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
  white-space: nowrap;
}

.btn:hover { background: rgba(255, 255, 255, 0.11); }
a.btn { text-decoration: none; }
.btn[aria-pressed="true"] {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.16);
  color: #cbeafe;
}
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn.icon { padding: 0; }

.spacer { flex: 1 1 auto; }

#counter {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--dim);
  min-width: 116px;
  text-align: center;
  user-select: none;
}
#counter b { color: var(--ink); font-weight: 600; }

#progress {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.07);
  z-index: 21;
}
#bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  transition: width 420ms var(--ease);
}

#vol {
  width: 84px;
  accent-color: var(--accent);
  background: transparent;
}

/* Invisible edge hit areas, so a click anywhere near the edge turns the page.
   The visible affordance is .pagenav; these must not add to the noise. */
.edge {
  position: fixed;
  top: 64px;
  bottom: var(--chrome-h);
  width: 11%;
  max-width: 130px;
  z-index: 15;
  cursor: pointer;
  background: none;
}
.edge.right { right: 0; }
.edge.left { left: 0; }

/* ----------------------------------------------------- last-page call to action */

#cta {
  position: fixed;
  inset: 0;
  z-index: 16;
  display: grid;
  place-items: center;
  pointer-events: none;          /* only the button itself is clickable */
  opacity: 0;
  visibility: hidden;
  transition: opacity 620ms ease, visibility 620ms;
}

#cta.on {
  opacity: 1;
  visibility: visible;
}

#ctaLink {
  display: block;
  /* the artwork is 900x560, so 108vh keeps its height near two thirds of the
     screen while the width stays the thing that makes it dominant */
  width: min(88vw, 108vh, 940px);
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform: scale(0.88);
  transition: transform 620ms cubic-bezier(0.2, 1.5, 0.4, 1);
  filter: drop-shadow(0 22px 52px rgba(0, 0, 0, 0.8));
}
#cta.on #ctaLink { transform: scale(1); }

#cta svg { display: block; width: 100%; height: auto; overflow: visible; }

/* caption plate */
.cta-bubble .plate {
  fill: #fdfdf7;
  stroke: #0a0a0c;
  stroke-width: 7;
  stroke-linejoin: round;
}

.cta-line,
.cta-sub {
  font-family: "Bangers", "Comic Sans MS Bold", "Comic Sans MS",
    "Arial Black", "Segoe UI Black", Impact, system-ui, sans-serif;
  text-anchor: middle;
  font-weight: 900;
}

.cta-line {
  font-size: 62px;
  fill: #16181d;
  letter-spacing: 0.01em;
}
.cta-line.l2 {
  fill: #d81428;
  font-size: 66px;
  paint-order: stroke fill;
  stroke: #16181d;
  stroke-width: 3;
}
.cta-sub {
  font-size: 27px;
  fill: #3b4048;
  letter-spacing: 0.045em;
}

/* the white curved arrow from the caption to the button */
.cta-hand .shaft {
  fill: none;
  stroke: #fff;
  stroke-width: 22;
  stroke-linecap: round;
  paint-order: stroke;
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.85));
}
.cta-hand .head {
  fill: #fff;
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.85));
}

.cta-arrow { fill: #fff; stroke: #12070a; stroke-width: 6; stroke-linejoin: round; }

.cta-btn,
.cta-halo { transform-origin: 150px 404px; }

.cta-btn { animation: ctaPulse 1500ms ease-in-out infinite; }
.cta-halo { animation: ctaHalo 1500ms ease-out infinite; }

@keyframes ctaPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.055); }
}

@keyframes ctaHalo {
  0%   { transform: scale(1);    opacity: 0.55; }
  100% { transform: scale(1.42); opacity: 0; }
}

#ctaLink:hover .cta-btn { animation-duration: 780ms; }
#ctaLink:active .cta-btn { transform: scale(0.94); }

/* the fly-away on the way out */
#cta.go {
  opacity: 0;
  transition: opacity 380ms ease-in;
}
#cta.go #ctaLink {
  transform: scale(2.6);
  transition: transform 420ms cubic-bezier(0.4, 0, 0.9, 0.4);
}
#cta.go .cta-btn,
#cta.go .cta-halo { animation: none; }

@media (max-width: 620px) {
  #ctaLink { width: 94vw; }
}

@media (prefers-reduced-motion: reduce) {
  .cta-btn, .cta-halo { animation: none; }
  #ctaLink { transition: none; transform: scale(1); }
}

/* ------------------------------------------------------- file:// warning */

#fileWarn {
  position: fixed;
  left: 50%;
  top: 74px;
  transform: translateX(-50%);
  z-index: 22;
  max-width: min(620px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.5);
  background: rgba(30, 22, 8, 0.96);
  color: #fde9b8;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.7);
}
#fileWarn[hidden] { display: none; }
#fileWarn strong { color: #fef3c7; font-size: 14px; }
#fileWarn code {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
}
#fileWarn button {
  align-self: flex-start;
  margin-top: 4px;
  appearance: none;
  border: 1px solid rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.14);
  color: #fde9b8;
  font: inherit;
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
}
#fileWarn button:hover { background: rgba(251, 191, 36, 0.24); }

/* ------------------------------------------------------------------ hint */

#hint {
  position: fixed;
  left: 50%;
  bottom: calc(var(--chrome-h) + 18px);
  transform: translateX(-50%);
  z-index: 19;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(8, 11, 16, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--dim);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 400ms ease;
}
#hint.on { opacity: 1; }
#hint kbd {
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 1px 5px;
  margin: 0 1px;
}

/* ----------------------------------------------------------------- start */

#start {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background:
    radial-gradient(90% 70% at 50% 45%, rgba(14, 18, 24, 0.55), rgba(3, 4, 6, 0.96));
  backdrop-filter: blur(3px);
  transition: opacity 620ms ease;
  cursor: pointer;
}
#start.gone { opacity: 0; pointer-events: none; }

.start-inner { text-align: center; padding: 24px; max-width: 560px; }
.start-inner h1 {
  margin: 0 0 6px;
  font-size: clamp(44px, 11vw, 104px);
  letter-spacing: 0.06em;
  font-weight: 800;
  line-height: 0.95;
  text-shadow: 0 0 42px rgba(56, 189, 248, 0.28);
}
.start-inner p.sub {
  margin: 0 0 30px;
  color: var(--dim);
  font-size: clamp(13px, 2.6vw, 16px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.start-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.14);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.start-note {
  margin-top: 22px;
  color: #5f6874;
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* ------------------------------------------------------------------ grid */

#grid {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: auto;
  padding: 22px 22px 90px;
  background: rgba(5, 7, 10, 0.97);
  display: none;
  touch-action: pan-y;
}
#grid.on { display: block; }
#grid h2 {
  margin: 4px 0 18px;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 600;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 14px;
}
.tile {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #0b0d10;
  aspect-ratio: 1792 / 2400;
  transition: transform 200ms var(--ease), border-color 200ms ease;
}
.tile:hover { transform: translateY(-3px); border-color: rgba(56, 189, 248, 0.6); }
.tile.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile span {
  position: absolute;
  left: 6px;
  bottom: 5px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  background: rgba(3, 5, 8, 0.82);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--ink);
}

/* ---------------------------------------------------------------- editor */

#editor {
  position: fixed;
  right: 12px;
  top: 12px;
  z-index: 45;
  width: 250px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(9, 12, 17, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: none;
  font-size: 12.5px;
}
#editor.on { display: block; }
#editor h3 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
#editor p { margin: 0 0 8px; color: var(--dim); line-height: 1.5; }
#editor select, #editor button {
  width: 100%;
  margin-bottom: 6px;
  font: inherit;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}
#editor button { cursor: pointer; }
#editor select option {
  background-color: #1b212b;
  color: var(--ink);
}

.pbox {
  position: absolute;
  border: 2px solid rgba(56, 189, 248, 0.9);
  background: rgba(56, 189, 248, 0.09);
  z-index: 8;
  cursor: move;
}
.pbox .num {
  position: absolute;
  left: -2px;
  top: -2px;
  background: var(--accent);
  color: #04121b;
  font-weight: 700;
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 3px 0 4px 0;
}
.pbox .hnd {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 13px;
  height: 13px;
  background: var(--accent);
  border-radius: 2px;
  cursor: nwse-resize;
}
.pbox.sel { border-color: var(--accent2); background: rgba(249, 115, 22, 0.12); }
.pbox.sel .num, .pbox.sel .hnd { background: var(--accent2); }

/* --------------------------------------------------------------- toast */

#toast {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  z-index: 70;
  padding: 9px 16px;
  border-radius: 8px;
  background: rgba(8, 11, 16, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.13);
  font-size: 13px;
  opacity: 0;
  transition: opacity 260ms ease;
  pointer-events: none;
}
#toast.on { opacity: 1; }

/* Narrow screens: the bar must never overflow, so the label text and the
   controls that have keyboard/gesture equivalents drop out first. */
@media (max-width: 760px) {
  #counter { min-width: 0; font-size: 12px; }
  #vol, #btnHelp, #btnEdit { display: none; }
  #btnCfg { display: none; }
  .mode span { display: none; }
  .mode { padding: 0 14px; }
  .pagenav { width: 46px; height: 86px; }
  .pagenav.left { left: 6px; }
  .pagenav.right { right: 6px; }
  #editor { display: none !important; }
  .btn { height: 32px; min-width: 32px; padding: 0 7px; font-size: 12px; }
  #chrome { gap: 4px; padding: 0 8px; }
  #btnCine .lbl { display: none; }
}

@media (max-width: 420px) {
  #btnPrev, #btnNext { display: none; }
  #counter { font-size: 11.5px; }
}

/* the home button is the first thing to go if space runs out */
@media (max-width: 380px) {
  #btnHome { display: none; }
}

/* iOS home-indicator area */
@supports (padding: env(safe-area-inset-bottom)) {
  #chrome { padding-bottom: env(safe-area-inset-bottom); height: calc(var(--chrome-h) + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  :root { --cam: 1ms; }
  #stage.animate { transition: none; }
}
