:root {
  --ink: #11110f;
  --paper: #e8d1a8;
  --paper-light: #f3dfba;
  --mustard: #d7a228;
  --night: #151b22;
  --page-ratio: 0.7075788062;
  --spread-ratio: 1.4151576123;
  --book-shift: -25%;
  --book-scale: .985;
}

* { box-sizing: border-box; }
html {
  background: var(--night);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-width: 0;
  color: var(--paper-light);
  background: #11161d;
  font-family: "Courier New", Courier, monospace;
  overflow-x: hidden;
  overflow-x: clip;
  user-select: none;
  overscroll-behavior-x: none;
}
button, a { font: inherit; }
button { color: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }

.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: #11161d;
  transition: opacity 260ms ease, visibility 260ms ease;
}
.loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-card {
  padding: 12px 16px 10px;
  color: #17130e;
  background: #dbc08f;
  border: 3px solid #17130e;
  box-shadow: 4px 5px 0 #090b0e;
  font-weight: 800;
  letter-spacing: .08em;
  transform: rotate(-1deg);
}

.comic-track {
  position: relative;
  width: 100%;
  min-height: 100dvh;
}

.reader-stage {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  isolation: isolate;
  touch-action: pan-y;
  background:
    linear-gradient(rgba(10, 13, 18, .16), rgba(10, 13, 18, .35)),
    url("../assets/background/alley.webp") center center / cover no-repeat;
}

.reader-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 45%, transparent 0 42%, rgba(4, 7, 10, .26) 78%, rgba(4, 7, 10, .65) 100%),
    linear-gradient(90deg, rgba(6, 8, 12, .18), transparent 18%, transparent 82%, rgba(6, 8, 12, .18));
}

.atmosphere {
  position: absolute;
  inset: -4%;
  z-index: -1;
  opacity: .16;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(102deg, transparent 0 28px, rgba(255,255,255,.22) 29px, transparent 30px 56px);
  filter: blur(.2px);
  transform: translate3d(0,0,0);
}

/*
   Critical sizing rule: width controls the scene and aspect-ratio controls height.
   Width and height are never clamped independently, so browser zoom and unusual
   viewport ratios cannot create blank bars around the comic page.
*/
.book-scene {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  position: relative;
  width: min(94vw, 128.7793427vh);
  width: min(94vw, 128.7793427dvh);
  height: auto;
  aspect-ratio: 1.4151576123 / 1;
  max-width: 1680px;
  max-height: 91vh;
  max-height: 91dvh;
  perspective: clamp(1500px, 150vw, 3000px);
  perspective-origin: 50% 44%;
  transform-style: preserve-3d;
  transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transition: transform 110ms linear, opacity 220ms ease;
  will-change: transform;
}

.book {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: translate3d(var(--book-shift), 0, 0) scale(var(--book-scale)) rotateX(1deg);
  transform-origin: 50% 50%;
  will-change: transform;
}

.book-shadow {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: -2.4%;
  height: 8%;
  z-index: -20;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  filter: blur(clamp(9px, 1.25vw, 20px));
  transform: translateZ(-40px);
  pointer-events: none;
}

.static-page,
.sheet {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
}

.static-page {
  overflow: hidden;
  background: #dfc79d;
  border: 1px solid rgba(15, 12, 8, .75);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.static-page img,
.page-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.static-left { left: 0; border-radius: 5px 1px 1px 5px; opacity: var(--inside-opacity, 0); }
.static-right { right: 0; border-radius: 1px 5px 5px 1px; }

.spine-shade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 7%;
  pointer-events: none;
}
.left-shade { right: 0; background: linear-gradient(90deg, transparent, rgba(34,24,14,.26)); }
.right-shade { left: 0; background: linear-gradient(90deg, rgba(34,24,14,.28), transparent); }

.paper-stack {
  position: absolute;
  top: .45%;
  width: 49.6%;
  height: 99.2%;
  z-index: -2;
  border: 1px solid rgba(19,15,10,.72);
  background: #cdb48b;
  box-shadow:
    0 2px 0 #b69d77,
    0 4px 0 #d8c095,
    0 6px 0 #a58e6b,
    0 8px 12px rgba(0,0,0,.33);
}
.paper-stack-left { left: .6%; border-radius: 5px 1px 1px 5px; opacity: var(--inside-opacity, 0); }
.paper-stack-right { right: .6%; border-radius: 1px 5px 5px 1px; }

.sheet {
  right: 0;
  transform-origin: 0 50%;
  transform: rotateY(var(--angle, 0deg)) translateZ(var(--lift, 0px));
  will-change: transform;
}

.sheet-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateZ(var(--bend, 0deg)) skewY(var(--page-skew, 0deg));
  transform-origin: 0 50%;
  will-change: transform;
}

.face {
  position: absolute;
  inset: 0;
  overflow: visible;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: transparent;
  border: 1px solid rgba(20,16,10,.78);
  border-left-width: 0;
  border-radius: 0 5px 5px 0;
  box-shadow: 0 6px 14px rgba(0,0,0,.18);
}
.face.back {
  transform: rotateY(180deg);
  border-left-width: 1px;
  border-right-width: 0;
  border-radius: 5px 0 0 5px;
}


/* The free edge is rendered as a second, hinged slice of the same page image.
   This creates a visible page curl instead of a completely rigid card rotation. */
.face > .page-image,
.face > .flip-shade {
  clip-path: inset(0 14% 0 0);
}

.face::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 14%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, rgba(255,246,222,.10), rgba(36,25,14,.10) 70%, rgba(7,6,5,.20)),
    var(--face-image);
  background-repeat: no-repeat;
  background-size: 100% 100%, 714.285714% 100%;
  background-position: right center, right center;
  border-right: 1px solid rgba(28,20,12,.74);
  border-radius: 0 var(--curl-radius, 5px) var(--curl-radius, 5px) 0;
  box-shadow:
    -2px 0 3px rgba(255,244,218,.10),
    4px 0 8px rgba(0,0,0,var(--curl-shadow, 0));
  transform-origin: 0 50%;
  transform:
    translate3d(var(--curl-shift, 0px), 0, var(--curl-lift, 0px))
    perspective(780px)
    rotateY(var(--curl-angle, 0deg));
  will-change: transform;
}

.face::after {
  content: "";
  position: absolute;
  top: 0;
  right: 13.2%;
  width: 7.5%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  opacity: var(--curl-crease, 0);
  background:
    linear-gradient(90deg,
      rgba(33,23,12,0),
      rgba(33,23,12,.18) 38%,
      rgba(255,247,224,.24) 58%,
      rgba(33,23,12,0));
  transform: translateX(50%) scaleX(.82);
  filter: blur(.35px);
}

.flip-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--shade, 0);
  mix-blend-mode: multiply;
  background:
    linear-gradient(90deg, rgba(25,19,12,.34), transparent 15%, transparent 70%, rgba(0,0,0,.22)),
    radial-gradient(circle at 5% 50%, rgba(41,27,13,.24), transparent 40%);
}
.face.back .flip-shade {
  background: linear-gradient(90deg, rgba(0,0,0,.28), transparent 35%, rgba(255,248,224,.12));
}
.paper-edge {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2px;
  opacity: var(--edge-opacity, .18);
  background: rgba(49,35,17,.72);
  box-shadow: -2px 0 4px rgba(255,244,217,.18);
}
.face.back .paper-edge { right: auto; left: 0; }

.cover-sheet .face { border-radius: 4px; }
.cover-face { box-shadow: 0 12px 32px rgba(0,0,0,.34); }

.cover-ui,
.final-ui {
  color: #14110d;
  background: rgba(226, 198, 143, .96);
  border: 2px solid #17120d;
  box-shadow: 3px 4px 0 rgba(10,8,6,.48);
  transform-style: flat;
  isolation: isolate;
}

.cover-ui {
  position: absolute;
  left: 7%;
  bottom: 4%;
  width: 86%;
  padding: clamp(7px, .58vw, 11px);
  transform: rotate(-.55deg);
  z-index: 8;
}
.cover-ui::before {
  content: "CASE TOKEN FILE";
  position: absolute;
  right: 8px;
  top: -16px;
  padding: 2px 6px;
  background: #d6a62b;
  border: 2px solid #17120d;
  font-size: clamp(7px, .48vw, 10px);
  font-weight: 900;
  letter-spacing: .08em;
}

.cover-project-line,
.final-project-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(25,18,12,.72);
  font-weight: 900;
  text-transform: uppercase;
}
.project-name {
  min-width: 0;
  font-size: clamp(10px, .72vw, 15px);
  letter-spacing: .025em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-ticker {
  flex: 0 0 auto;
  font-size: clamp(9px, .62vw, 13px);
}

.ca-row {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  gap: 6px;
  align-items: center;
  margin-top: 7px;
}
.ca-label {
  font-weight: 900;
  font-size: clamp(8px, .52vw, 11px);
}
.ca-value {
  display: block;
  min-width: 0;
  padding: 5px 7px 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #1d1811;
  background: rgba(248, 228, 190, .8);
  border: 1px solid rgba(26,20,13,.84);
  font-size: clamp(7px, .45vw, 9px);
  user-select: text;
}
.community-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 7px;
}

.comic-button {
  appearance: none;
  border: 2px solid #17120d;
  background: #d6a62b;
  color: #15110d;
  min-width: 0;
  min-height: 29px;
  padding: 5px 6px 4px;
  font-size: clamp(7px, .48vw, 10px);
  line-height: 1.05;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .015em;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(15,11,7,.45);
  transition: transform 90ms ease, background 90ms ease, box-shadow 90ms ease;
  pointer-events: auto;
  touch-action: manipulation;
}
.comic-button:hover {
  background: #efbf42;
  transform: translate(-1px,-1px) rotate(-.4deg);
  box-shadow: 3px 3px 0 rgba(15,11,7,.5);
}
.comic-button:active {
  transform: translate(1px,1px);
  box-shadow: 0 0 0 rgba(15,11,7,0);
}
.comic-button:focus-visible {
  outline: 3px solid #fff2c9;
  outline-offset: 2px;
}
.copy-button.is-copied { background: #f1d993; }

.inside-note {
  position: absolute;
  left: 9%;
  top: 10%;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  color: rgba(30,22,14,.55);
  border: 2px solid rgba(30,22,14,.34);
  transform: rotate(-4deg);
  font-weight: 900;
  letter-spacing: .1em;
}
.inside-note small { font-size: .7em; }

.end-stamp {
  position: absolute;
  left: 50%;
  top: 31%;
  z-index: 2;
  display: grid;
  gap: 4px;
  min-width: 44%;
  padding: 10px 12px 9px;
  color: rgba(33,24,15,.46);
  border: 3px double rgba(33,24,15,.4);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .1em;
  transform: translate(-50%,-50%) rotate(-4deg);
}
.end-stamp strong { font-size: clamp(14px, 1.05vw, 22px); }
.end-stamp span, .end-stamp small { font-size: clamp(8px, .6vw, 12px); }

.final-ui {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 6%;
  z-index: 8;
  padding: clamp(8px, .65vw, 13px);
  transform: rotate(.55deg);
}
.final-ui::before {
  content: "COMMUNITY FILE";
  position: absolute;
  left: 12px;
  top: -17px;
  padding: 2px 7px;
  background: #d6a62b;
  border: 2px solid #17120d;
  font-size: clamp(7px, .48vw, 10px);
  font-weight: 900;
  letter-spacing: .08em;
}

.case-tag {
  position: absolute;
  left: max(14px, 2.4vw);
  top: max(14px, 4.5dvh);
  z-index: 20;
  display: grid;
  gap: 2px;
  padding: 7px 10px 6px;
  color: #15110d;
  background: #d9bb82;
  border: 2px solid #17120d;
  box-shadow: 3px 4px 0 rgba(0,0,0,.38);
  transform: rotate(-3deg);
  font-weight: 900;
  letter-spacing: .08em;
  opacity: .82;
  pointer-events: none;
}
.case-tag span { font-size: clamp(8px, .62vw, 12px); }
.case-tag small { font-size: clamp(7px, .48vw, 9px); }

.comic-nav {
  position: absolute;
  right: max(14px, 2.4vw);
  top: max(14px, 4.5dvh);
  z-index: 70;
  display: grid;
  gap: 5px;
  min-width: 238px;
  padding: 7px 8px 8px;
  color: #15110d;
  background: rgba(217,187,130,.95);
  border: 2px solid #17120d;
  box-shadow: 3px 4px 0 rgba(0,0,0,.38);
  transform: rotate(1deg);
}
.comic-nav-label {
  padding-left: 2px;
  font-size: clamp(7px, .47vw, 9px);
  font-weight: 900;
  letter-spacing: .11em;
  opacity: .78;
}
.comic-nav-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}
.nav-button {
  appearance: none;
  min-height: 30px;
  padding: 5px 7px 4px;
  color: #15110d;
  background: #d6a62b;
  border: 2px solid #17120d;
  box-shadow: 2px 2px 0 rgba(15,11,7,.42);
  font-size: clamp(7px, .48vw, 9px);
  font-weight: 900;
  letter-spacing: .035em;
  cursor: pointer;
  transition: transform 90ms ease, background 90ms ease, box-shadow 90ms ease;
}
.nav-button:hover {
  background: #efbf42;
  transform: translate(-1px,-1px) rotate(-.35deg);
  box-shadow: 3px 3px 0 rgba(15,11,7,.48);
}
.nav-button:active {
  transform: translate(1px,1px);
  box-shadow: none;
}
.nav-button.is-active {
  background: #f0cb73;
  box-shadow: inset 0 0 0 1px rgba(23,18,13,.45), 2px 2px 0 rgba(15,11,7,.35);
}
.nav-button:focus-visible {
  outline: 3px solid #fff2c9;
  outline-offset: 2px;
}

.page-counter {
  position: absolute;
  right: max(14px, 2.4vw);
  bottom: max(14px, 4.5dvh);
  z-index: 30;
  min-width: 78px;
  padding: 7px 9px 6px;
  color: #15110d;
  background: #d9bb82;
  border: 2px solid #17120d;
  box-shadow: 3px 4px 0 rgba(0,0,0,.35);
  text-align: center;
  font-size: clamp(8px, .56vw, 11px);
  font-weight: 900;
  letter-spacing: .07em;
  transform: rotate(1.4deg);
  pointer-events: none;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: max(10px, 1.8dvh);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(244,224,185,.86);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-shadow: 0 2px 5px rgba(0,0,0,.7);
  transform: translateX(-50%);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}
.scroll-hint i {
  width: 13px;
  height: 20px;
  border: 1px solid rgba(244,224,185,.82);
  border-radius: 8px;
  position: relative;
}
.scroll-hint i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 4px;
  width: 2px;
  height: 5px;
  background: rgba(244,224,185,.9);
  transform: translateX(-50%);
  animation: wheel 1.25s ease-in-out infinite;
}
.scroll-hint.is-hidden { opacity: 0; transform: translate(-50%,8px); }

@keyframes wheel {
  0% { opacity: 0; transform: translate(-50%,0); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%,7px); }
}

body:not(.is-ready) .book-scene,
body:not(.is-ready) .case-tag,
body:not(.is-ready) .comic-nav,
body:not(.is-ready) .page-counter,
body:not(.is-ready) .scroll-hint { opacity: 0; }
body.is-ready .book-scene,
body.is-ready .case-tag,
body.is-ready .comic-nav,
body.is-ready .page-counter,
body.is-ready .scroll-hint { opacity: 1; }

/* Interactive controls must stay above the 3D page stack. */
.cover-sheet { pointer-events: auto; }
.cover-sheet .cover-ui,
.cover-sheet .cover-ui * { pointer-events: auto; }
.comic-sheet { pointer-events: none; }
.static-left { pointer-events: none; }
.static-right { pointer-events: auto; }
.cover-ui .comic-button,
.final-ui .comic-button {
  position: relative;
  z-index: 20;
}

/* Single-page layout is used for portrait phones/tablets and high browser zoom. */
body.single-page-mode .book-scene {
  width: min(92vw, 59.4366197vh);
  width: min(92vw, 59.4366197dvh);
  aspect-ratio: 0.7075788062 / 1;
  max-width: 760px;
  max-height: 84vh;
  max-height: 84dvh;
  perspective: clamp(1100px, 260vw, 2200px);
}
body.single-page-mode .book {
  transform: translate3d(0, 0, 0) scale(var(--book-scale)) rotateX(.65deg);
}
body.single-page-mode .static-page,
body.single-page-mode .sheet {
  width: 100%;
  left: 0;
  right: auto;
}
body.single-page-mode .sheet { transform-origin: 0 50%; }
body.single-page-mode .static-left,
body.single-page-mode .paper-stack-left { display: none; }
body.single-page-mode .static-right {
  left: 0;
  right: auto;
  border-radius: 5px;
}
body.single-page-mode .paper-stack-right {
  left: .4%;
  right: auto;
  width: 99.2%;
  border-radius: 5px;
}
body.single-page-mode .right-shade { display: none; }
body.single-page-mode .face,
body.single-page-mode .face.back {
  border-width: 1px;
  border-radius: 5px;
}
body.single-page-mode .cover-ui {
  left: 5.5%;
  width: 89%;
  bottom: 3.2%;
  padding: clamp(7px, 2.1vw, 12px);
}
body.single-page-mode .cover-project-line,
body.single-page-mode .final-project-line { gap: 6px; }
body.single-page-mode .project-name { font-size: clamp(10px, 2.75vw, 15px); }
body.single-page-mode .project-ticker { font-size: clamp(9px, 2.35vw, 13px); }
body.single-page-mode .ca-label { font-size: clamp(8px, 2.1vw, 11px); }
body.single-page-mode .ca-value {
  padding: 5px 6px 4px;
  font-size: clamp(7px, 1.85vw, 10px);
}
body.single-page-mode .comic-button {
  min-height: 34px;
  padding: 6px 5px 5px;
  font-size: clamp(7px, 2vw, 10px);
}
body.single-page-mode .cover-ui::before,
body.single-page-mode .final-ui::before {
  font-size: clamp(7px, 1.75vw, 9px);
}
body.single-page-mode .final-ui {
  left: 5.5%;
  right: 5.5%;
  bottom: 5%;
  padding: clamp(8px, 2.2vw, 13px);
}
body.single-page-mode .end-stamp {
  top: 29%;
  width: 58%;
}
body.single-page-mode .end-stamp strong { font-size: clamp(14px, 4vw, 22px); }
body.single-page-mode .end-stamp span,
body.single-page-mode .end-stamp small { font-size: clamp(8px, 2.3vw, 12px); }

@media (max-width: 560px) {
  .case-tag { display: none; }
  .comic-nav {
    left: 50%;
    right: auto;
    top: max(9px, env(safe-area-inset-top));
    width: min(94vw, 390px);
    min-width: 0;
    padding: 5px 6px 6px;
    transform: translateX(-50%) rotate(.4deg);
    opacity: .94;
  }
  .comic-nav-label { display: none; }
  .nav-button {
    min-height: 32px;
    padding: 5px 4px 4px;
    font-size: clamp(7px, 2.25vw, 9px);
  }
  .page-counter {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    min-width: 70px;
    padding: 6px 8px 5px;
    font-size: 9px;
    opacity: .78;
  }
  .scroll-hint {
    bottom: max(12px, calc(env(safe-area-inset-bottom) + 2px));
    font-size: 8px;
  }
  body.single-page-mode .book-scene {
    width: min(94vw, 58.0214621vh);
    width: min(94vw, 58.0214621dvh);
    max-height: 82vh;
    max-height: 82dvh;
  }
  body.single-page-mode .community-row { gap: 4px; }
  body.single-page-mode .ca-row { gap: 4px; }
}

@media (max-height: 520px) {
  .case-tag { top: 10px; }
  .comic-nav { top: 8px; right: 10px; }
  .page-counter { bottom: 10px; }
  .scroll-hint { display: none; }
  body:not(.single-page-mode) .book-scene {
    width: min(91vw, 124.5338699vh);
    width: min(91vw, 124.5338699dvh);
    max-height: 88vh;
    max-height: 88dvh;
  }
}

@media (min-width: 2200px) and (min-height: 1200px) {
  body:not(.single-page-mode) .book-scene {
    width: min(88vw, 125.9490275vh);
    width: min(88vw, 125.9490275dvh);
    max-height: 89vh;
    max-height: 89dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .book-scene { transition: none; }
}

/* The cover controls are a direct child of the flipping sheet. This avoids
   browser 3D hit-testing treating the whole cover face as one click surface. */
.cover-sheet > .cover-ui {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(6px) rotate(-.55deg);
  transform-origin: 50% 50%;
  pointer-events: auto;
}
body.single-page-mode .cover-sheet > .cover-ui {
  transform: translateZ(6px) rotate(-.35deg);
}

/* Keep the hint hidden after reading starts - this rule must come after the ready-state rule. */
body.is-ready .scroll-hint.is-hidden {
  opacity: 0;
  transform: translate(-50%, 8px);
}

@media (max-width: 560px) and (max-height: 520px) {
  .comic-nav {
    left: 50%;
    right: auto;
    top: max(6px, env(safe-area-inset-top));
    width: min(92vw, 360px);
    transform: translateX(-50%) rotate(.3deg);
  }
  .nav-button { min-height: 28px; }
}
