



.view--cinema {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: calc(var(--topbar-h) + var(--safe-top) + 8px) calc(var(--safe-right) + 14px)
    calc(var(--safe-bottom) + 10px) calc(var(--safe-left) + 14px);
  overflow: clip;
}


.grain {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}


.leak {
  position: absolute;
  top: -40%;
  left: -35%;
  z-index: 3;
  width: 160%;
  height: 190%;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    102deg,
    transparent 34%,
    rgb(255 237 186 / 30%) 46%,
    rgb(255 255 236 / 46%) 51%,
    rgb(255 211 106 / 26%) 57%,
    transparent 68%
  );
  filter: blur(22px);
  transform: rotate(-8deg);
}

.leak.is-firing {
  animation: leak-sweep var(--leak-dur, 2000ms) var(--ease-soft) forwards;
}

@keyframes leak-sweep {
  0% {
    opacity: 0;
    transform: translateX(-12%) rotate(-8deg);
  }
  22% {
    opacity: 1;
  }
  58% {
    opacity: 0.35;
  }
  100% {
    opacity: 0;
    transform: translateX(14%) rotate(-8deg);
  }
}

.cinema-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: var(--page-max);
  min-height: 0;
}

.boot-line {
  color: var(--ink-faint);
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 0.12em;
}



.cover-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 0;
  animation: cover-in 700ms var(--ease-soft) both;
}

.cover-screen[hidden] {
  display: none;
}

.cover-screen.is-leaving {
  animation: cover-out 380ms var(--ease-soft) forwards;
}

@keyframes cover-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes cover-out {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.cover-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(9px, 2.1vh, 16px);
  width: 100%;
  min-height: 0;
}

.cover-kicker {
  color: var(--plum-soft);
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.cover-photo-frame {
  position: relative;
  flex: 0 1 auto;
  height: min(52dvh, calc((100vw - 32px) / 0.75));
  aspect-ratio: 3 / 4;
  max-width: calc(100vw - 32px);
  padding: 7px;
  border: var(--pixel-line) solid var(--plum);
  border-radius: 6px;
  background: var(--card);
  box-shadow: var(--pixel-shadow-lg);
  overflow: hidden;
}

.cover-photo-frame img {
  width: 100%;
  height: 100%;
  border-radius: 2px;
  object-fit: contain; 
}

.cover-title {
  color: var(--plum);
  font-family: var(--font-display);
  font-size: clamp(26px, 8vw, 34px);
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-align: center;
}

.cover-tagline {
  color: var(--plum-soft);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.6;
}

.cover-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--plum-soft);
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.cover-meta .dot {
  width: 4px;
  height: 4px;
  background: var(--strawberry);
}

.cover-actions {
  display: grid;
  gap: 8px;
  justify-items: center;
  margin-top: 2px;
}

.cover-hint {
  color: var(--ink-faint);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}



.book-stage {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 560px;
  min-height: 0;
  animation: book-in 480ms var(--ease-soft) both;
}

.book-stage[hidden] {
  display: none;
}

@keyframes book-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.book-rig {
  display: grid;
  flex: 1 1 auto;
  place-items: center;
  width: 100%;
  min-height: 0;
  perspective: 1500px;
}

.book-sizer {
  width: var(--book-w, 340px);
  max-width: 100%;
}

.book {
  position: relative;
  isolation: isolate;
  filter: drop-shadow(0 16px 20px rgb(73 59 81 / 22%));
}



.book-page {
  position: relative;
  overflow: hidden;
  background: linear-gradient(178deg, var(--paper) 0%, #fdf3df 100%);
  color: var(--plum);
}

.book-page::after {
  position: absolute;
  inset: 0;
  z-index: 4;
  border: var(--pixel-line) solid var(--plum);
  content: "";
  pointer-events: none;
}


.book-page.--left::before,
.book-page.--right::before {
  position: absolute;
  inset-block: 0;
  z-index: 5;
  width: clamp(12px, 4%, 24px);
  content: "";
  pointer-events: none;
}

.book-page.--left::before {
  right: 0;
  background: linear-gradient(to left, rgb(73 59 81 / 16%), transparent);
}

.book-page.--right::before {
  left: 0;
  background: linear-gradient(to right, rgb(73 59 81 / 16%), transparent);
}

.page-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(8px, 2.6%, 14px);
  gap: 8px;
}



.scene-head {
  display: grid;
  flex: 0 0 auto;
  gap: 2px;
}

.scene-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--strawberry);
  font-family: var(--font-pixel);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.scene-title {
  color: var(--plum);
  font-size: clamp(18px, 5.4%, 24px);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.photo-area {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 0;
}


.photo-plate {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 5px;
  border: var(--pixel-line) solid var(--plum);
  border-radius: 5px;
  background: var(--card);
  box-shadow: var(--pixel-shadow-sm);
  overflow: hidden;
}

.photo-plate img {
  width: 100%;
  height: 100%;
  object-fit: contain; 
}

.photo-caption {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.photo-caption .caption-text {
  color: var(--plum-soft);
  font-size: 13px;
  line-height: 1.5;
}

.scene-lines {
  display: grid;
  gap: 3px;
  color: var(--plum-soft);
  font-size: 15px;
  line-height: 1.65;
}

.scene-foot {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.page-number {
  color: var(--ink-faint);
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 0.1em;
}



.pair {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.photo-slot {
  position: relative;
  display: flex;
  flex: 1 1 50%;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
}

.photo-slot .photo-plate img {
  opacity: 0;
  transform: scale(1.012);
  transition: opacity var(--dur-crossfade) var(--ease-soft), transform 6000ms linear;
}

.book-page.is-live .photo-slot--day .photo-plate img {
  opacity: 1;
  transform: scale(1.04);
}

.book-page.is-live .photo-slot--night .photo-plate img {
  opacity: 1;
  transform: scale(1.04);
  transition-delay: 260ms, 260ms;
}

.photo-slot .slot-chip {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 2px solid var(--plum);
  border-radius: 4px;
  font-family: var(--font-pixel);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.slot-chip--day {
  background: var(--sun);
  color: var(--plum);
}

.slot-chip--night {
  background: var(--lavender);
  color: var(--plum);
}

.pair::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 42%, rgb(207 203 230 / 46%) 62%, rgb(73 59 81 / 28%));
  content: "";
  opacity: 0;
  pointer-events: none;
}

.book-page.is-live .pair::after {
  animation: dusk 1400ms var(--ease-soft) both;
}

@keyframes dusk {
  from {
    opacity: 0;
  }
  60% {
    opacity: 1;
  }
  to {
    opacity: 0.55;
  }
}



.scene-invite {
  justify-content: center;
  gap: clamp(10px, 2.4vh, 16px);
}

.scene-invite .scene-title {
  font-size: clamp(21px, 6.2%, 27px);
}

.invite-actions {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-top: 4px;
}

.invite-actions .btn {
  min-height: 48px;
  padding: 0 20px;
  font-size: 15px;
}

.invite-note {
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 0.02em;
}



.book-controls {
  display: grid;
  grid-template-columns: var(--tap) minmax(0, 1fr) var(--tap);
  align-items: center;
  gap: 10px;
  width: min(100%, 380px);
  margin: 0 auto;
}

.ctl {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 2.5px solid var(--plum);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--plum);
  color: var(--plum);
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.ctl:active:not(:disabled) {
  box-shadow: none;
  transform: translate(2px, 2px);
}

.ctl:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
}

.book-status {
  display: grid;
  gap: 3px;
  justify-items: center;
}

.book-status span {
  color: var(--plum);
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.book-status small {
  color: var(--ink-faint);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.progress-dots {
  display: flex;
  gap: 6px;
}

.progress-dots i {
  width: 9px;
  height: 9px;
  border: 2px solid var(--plum);
  border-radius: 2px;
  background: transparent;
}

.progress-dots i.is-done {
  background: var(--strawberry);
}

.progress-dots i.is-current {
  background: var(--sun);
}

.skip-intro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  align-self: center;
  min-height: var(--tap);
  padding: 0 16px;
  border: 2px dashed rgb(73 59 81 / 38%);
  border-radius: 999px;
  background: transparent;
  color: var(--plum-soft);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.skip-intro::after {
  width: 5px;
  height: 5px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

.skip-intro:hover {
  color: var(--plum);
  border-color: var(--plum);
}

.skip-intro[hidden] {
  display: none;
}



@media (min-width: 720px) and (min-height: 560px) {
  .book-stage {
    max-width: min(94vw, 920px);
  }
}



@media (max-height: 700px) {
  .cover-inner {
    gap: 8px;
  }

  .cover-photo-frame {
    height: min(46dvh, calc((100vw - 32px) / 0.75));
  }

  .cover-title {
    font-size: clamp(22px, 6.6vw, 28px);
  }

  .cover-actions .cover-hint {
    display: none;
  }

  .page-inner {
    padding: 8px;
  }
}



@media (prefers-reduced-motion: reduce) {
  .cover-screen,
  .book-stage {
    animation: none;
  }

  .cover-screen.is-leaving {
    animation: none;
    opacity: 0;
  }

  .leak {
    display: none;
  }

  .photo-slot .photo-plate img,
  .book-page.is-live .photo-slot--day .photo-plate img,
  .book-page.is-live .photo-slot--night .photo-plate img {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .book-page.is-live .pair::after {
    animation: none;
    opacity: 0.4;
  }

  .ctl,
  .skip-intro {
    transition: none;
  }
}
