:root {
  --ink: #080808;
  --ink-soft: #111214;
  --paper: #f2eee5;
  --paper-muted: #cfc7ba;
  --steel: #aab3bd;
  --blood: #a3151a;
  --amber: #c89247;
  --choice-red: #e52b46;
  --choice-red-dark: #5d0715;
  --choice-blue: #2374ff;
  --choice-blue-dark: #071c59;
  --reader-width: 690px;
  --serif: "YuMincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", "BIZ UDPMincho",
    "Noto Serif JP", serif;
  --sans: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  margin: 0;
  min-width: 0;
  color: var(--paper);
  background:
    radial-gradient(circle at 50% -5%, rgba(142, 102, 52, 0.13), transparent 27rem),
    linear-gradient(180deg, #11100e 0, #080808 36rem);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.reading-progress__bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--choice-red), var(--choice-blue));
  box-shadow: 0 0 12px rgba(35, 116, 255, 0.5);
}

.reader-toolbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(58px + env(safe-area-inset-top));
  padding: calc(7px + env(safe-area-inset-top)) clamp(14px, 4vw, 36px) 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 8, 8, 0.82);
  backdrop-filter: blur(18px);
  transition:
    transform 320ms ease,
    opacity 320ms ease;
}

body.focus-mode .reader-toolbar {
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}

.reader-toolbar__brand {
  display: flex;
  align-items: center;
  min-height: 44px;
  min-width: 0;
  color: var(--paper);
  text-decoration: none;
}

.reader-toolbar__mark,
.reader-toolbar__back {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  margin-right: 10px;
  border: 1px solid rgba(239, 193, 132, 0.46);
  color: #efc184;
  font-size: 14px;
}

.reader-toolbar__back img {
  width: 17px;
  height: 17px;
  filter: invert(1);
}

.reader-toolbar__back {
  width: 42px;
  height: 42px;
  margin-right: 8px;
}

.reader-toolbar__title {
  overflow: hidden;
  max-width: min(45vw, 410px);
  color: rgba(242, 238, 229, 0.78);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.reader-toolbar__episode {
  color: var(--paper-muted);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.text-button {
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: var(--paper-muted);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.text-button:hover,
.text-button:focus-visible {
  border-color: rgba(239, 193, 132, 0.68);
  color: #fff;
  outline: none;
}

.choice-status {
  position: relative;
  display: grid;
  min-width: 66px;
  min-height: 38px;
  overflow: hidden;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: linear-gradient(115deg, var(--choice-red) 0 48%, var(--choice-blue) 52% 100%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.choice-status::after {
  position: absolute;
  inset: -15% 49% -15% auto;
  width: 2px;
  background: #fff;
  content: "";
  transform: rotate(25deg);
}

.choice-status span {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 5px #000;
}

.choice-status[data-choice="red"] {
  background: var(--choice-red);
}

.choice-status[data-choice="blue"] {
  background: var(--choice-blue);
}

.choice-status[data-choice="red"]::after,
.choice-status[data-choice="blue"]::after {
  display: none;
}

.choice-status:hover,
.choice-status:focus-visible {
  border-color: #fff;
  outline: 2px solid rgba(255, 255, 255, 0.25);
  outline-offset: 2px;
}

.episode-cover {
  position: relative;
  display: grid;
  min-height: 100svh;
  align-content: center;
  overflow: hidden;
  padding: calc(100px + env(safe-area-inset-top)) clamp(24px, 8vw, 120px)
    calc(64px + env(safe-area-inset-bottom));
  isolation: isolate;
}

.episode-cover::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 8, 8, 0.98), rgba(8, 8, 8, 0.57)),
    url("assets/panels/ep01-key-02.png") 74% 50% / cover no-repeat;
  filter: saturate(0.5) contrast(1.05);
  content: "";
}

.episode-cover::after {
  position: absolute;
  z-index: -1;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(transparent, var(--ink));
  content: "";
}

.episode-cover__noise {
  position: absolute;
  z-index: 0;
  inset: 0;
  opacity: 0.28;
  background-image: repeating-linear-gradient(
    105deg,
    transparent 0,
    transparent 3px,
    rgba(255, 255, 255, 0.018) 4px
  );
  pointer-events: none;
}

.episode-cover__kicker {
  position: relative;
  margin: 0 0 48px;
  color: #efc184;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.32em;
}

.episode-cover__composition {
  position: relative;
  display: grid;
  grid-template-columns: auto 1px minmax(0, 1fr);
  gap: clamp(20px, 5vw, 56px);
  align-items: end;
  max-width: 850px;
}

.episode-cover__series {
  margin: 0;
  font-size: clamp(13px, 1.6vw, 18px);
  letter-spacing: 0.14em;
  line-height: 2;
  writing-mode: vertical-rl;
}

.episode-cover__rule {
  height: 100%;
  min-height: 180px;
  background: linear-gradient(transparent, rgba(239, 193, 132, 0.7), transparent);
}

.episode-cover__number {
  margin: 0 0 10px;
  color: var(--paper-muted);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.2em;
}

.episode-cover h1 {
  max-width: 9em;
  margin: 0;
  font-size: clamp(40px, 8vw, 92px);
  font-weight: 500;
  letter-spacing: -0.08em;
  line-height: 1.05;
  text-shadow: 0 20px 45px rgba(0, 0, 0, 0.7);
}

.episode-cover__meta {
  margin: 20px 0 0;
  color: var(--paper-muted);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.episode-cover__hook {
  position: relative;
  margin: 72px 0 0;
  color: rgba(242, 238, 229, 0.82);
  font-size: clamp(15px, 2vw, 20px);
  letter-spacing: 0.04em;
  line-height: 2;
}

.episode-cover__start {
  position: relative;
  justify-self: start;
  margin-top: 34px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(239, 193, 132, 0.5);
  color: #efc184;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.webtoon-reader {
  width: min(100%, var(--reader-width));
  margin: 0 auto;
  background: #0b0b0b;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.7);
}

.scene-break {
  display: grid;
  min-height: 42svh;
  place-items: center;
  padding: 90px 30px;
  color: rgba(242, 238, 229, 0.38);
  text-align: center;
}

.scene-break__inner {
  display: grid;
  gap: 18px;
  justify-items: center;
}

.scene-break__line {
  width: 1px;
  height: 72px;
  background: linear-gradient(transparent, rgba(239, 193, 132, 0.55), transparent);
}

.scene-break p {
  margin: 0;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.26em;
}

.panel {
  position: relative;
  display: grid;
  min-height: 64svh;
  overflow: hidden;
  isolation: isolate;
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 700ms ease,
    transform 850ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.panel.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.panel::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.18;
  background-image: repeating-linear-gradient(
    115deg,
    transparent 0,
    transparent 4px,
    rgba(255, 255, 255, 0.025) 5px
  );
  content: "";
  pointer-events: none;
}

.panel__stage {
  display: grid;
  align-content: center;
  min-height: inherit;
  padding: clamp(52px, 10vw, 96px) clamp(26px, 7vw, 64px);
}

.panel__number {
  position: absolute;
  z-index: 4;
  top: 22px;
  left: 22px;
  color: rgba(255, 255, 255, 0.2);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.panel__eyebrow {
  margin: 0 0 24px;
  color: var(--amber);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.panel__narration {
  width: min(100%, 30em);
  margin: 0 auto;
  color: rgba(242, 238, 229, 0.88);
  font-size: clamp(16px, 4vw, 24px);
  letter-spacing: 0.06em;
  line-height: 2;
  text-align: center;
}

.panel__narration + .panel__narration {
  margin-top: 16px;
}

.panel__sfx {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--sans);
  font-size: clamp(58px, 19vw, 126px);
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 0.9;
  text-align: center;
  text-shadow:
    4px 4px 0 rgba(163, 21, 26, 0.7),
    0 20px 60px rgba(0, 0, 0, 0.8);
  transform: rotate(-5deg);
}

.panel__object-label {
  margin: 0 0 28px;
  color: rgba(239, 193, 132, 0.8);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-align: center;
}

.dialogue-stack {
  display: grid;
  width: min(100%, 470px);
  margin-inline: auto;
  gap: 18px;
}

.dialogue {
  position: relative;
  justify-self: start;
  max-width: 88%;
  padding: 15px 18px 16px;
  border: 1px solid rgba(8, 8, 8, 0.1);
  border-radius: 24px 24px 24px 5px;
  background: rgba(250, 248, 242, 0.96);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
  color: #111;
  font-family: var(--sans);
  font-size: clamp(14px, 3.8vw, 18px);
  font-weight: 600;
  line-height: 1.65;
}

.dialogue:nth-child(even) {
  justify-self: end;
  border-radius: 24px 24px 5px;
}

.dialogue__speaker {
  display: block;
  margin-bottom: 5px;
  color: #8d1217;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.panel--art {
  display: block;
  min-height: auto;
  background: #000;
}

.panel--art figure {
  position: relative;
  margin: 0;
}

.panel--art img {
  display: block;
  width: 100%;
  height: auto;
}

.panel--art .panel__dialogue-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(20px, 5vw, 42px);
  pointer-events: none;
}

.panel--art .dialogue-stack {
  width: min(82%, 430px);
  margin-inline: 0 auto;
}

.panel--art.is-even .dialogue-stack {
  margin-inline: auto 0;
}

.panel--art .panel__narration {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font-size: clamp(13px, 3.5vw, 17px);
  line-height: 1.8;
  backdrop-filter: blur(6px);
}

.panel--art .panel__sfx {
  align-self: center;
  font-size: clamp(42px, 12vw, 82px);
}

.panel--establishing,
.panel--transition {
  min-height: 76svh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    #111;
}

.panel--document {
  background: #cfc5b2;
  color: #181713;
}

.document {
  width: min(100%, 460px);
  margin: 0 auto 42px;
  padding: 44px 34px;
  border: 1px solid rgba(0, 0, 0, 0.24);
  background:
    linear-gradient(rgba(0, 0, 0, 0.025) 1px, transparent 1px) 0 0 / 100% 24px,
    #ebe4d6;
  box-shadow: 18px 22px 0 rgba(0, 0, 0, 0.12);
  color: #171713;
  transform: rotate(-1.5deg);
}

.document__title {
  margin: 0 0 28px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.document__body {
  margin: 0;
  font-size: clamp(23px, 7vw, 42px);
  line-height: 1.6;
  white-space: pre-line;
}

.panel--message {
  background:
    radial-gradient(circle at 50% 44%, rgba(63, 77, 91, 0.55), transparent 24rem),
    #0b0e12;
}

.message {
  width: min(92%, 410px);
  margin: 0 auto 42px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(30, 35, 42, 0.9);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.44);
  font-family: var(--sans);
}

.message__from {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.message__body {
  margin: 0;
  color: #fff;
  font-size: clamp(18px, 5vw, 25px);
  font-weight: 600;
  line-height: 1.75;
  white-space: pre-line;
}

.panel--breath,
.panel--long-gap,
.panel--silent {
  min-height: 94svh;
}

.panel--warm,
.panel[data-tone="warm"],
.panel[data-tone="warm-shadow"] {
  background:
    radial-gradient(circle at 50% 30%, rgba(151, 94, 41, 0.35), transparent 25rem),
    #16110d;
}

.panel[data-tone="daylight"] {
  background:
    radial-gradient(circle at 70% 10%, rgba(248, 208, 137, 0.17), transparent 22rem),
    #17191a;
}

.panel[data-tone="rain"],
.panel[data-tone="car-night"] {
  background:
    linear-gradient(115deg, transparent 44%, rgba(128, 168, 200, 0.07) 45%, transparent 46%)
      0 0 / 16px 34px,
    radial-gradient(circle at 50% 30%, rgba(39, 74, 101, 0.4), transparent 27rem),
    #071019;
}

.panel[data-tone="danger"] {
  background:
    radial-gradient(circle at 50% 35%, rgba(116, 8, 13, 0.42), transparent 24rem),
    #0b090a;
}

.panel[data-tone="hospital"] {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 72px 100%,
    #11181d;
}

.panel[data-tone="paper"] {
  background: #cfc5b2;
}

.panel[data-tone="black"] {
  background: #030303;
}

.panel--gunshot {
  min-height: 100svh;
  background: #000;
}

.panel--gunshot .panel__stage::after {
  position: absolute;
  z-index: -1;
  inset: 50% auto auto 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 32px 15px rgba(255, 255, 255, 0.5);
  content: "";
}

.panel--episode-end {
  min-height: 120svh;
  background:
    radial-gradient(circle at 50% 15%, rgba(163, 21, 26, 0.28), transparent 25rem),
    #020202;
}

.panel__end-copy {
  margin: 80px 0 0;
  color: #fff;
  font-size: clamp(34px, 9vw, 66px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.35;
  text-align: center;
}

.story-choice {
  position: relative;
  display: grid;
  min-height: 100svh;
  align-content: center;
  overflow: hidden;
  padding: 76px 0 0;
  background: #050505;
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 600ms ease,
    transform 720ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

html.choice-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

body.choice-locked {
  position: fixed;
  right: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.story-choice:not(.is-resolved)::after {
  position: absolute;
  z-index: 8;
  inset: 0;
  background: #fff;
  opacity: 0;
  content: "";
  pointer-events: none;
}

.story-choice.is-visible,
.story-choice.is-resolved {
  opacity: 1;
  transform: translateY(0);
}

.story-choice.is-resolved > .story-choice__intro {
  display: none;
}

.story-choice__intro {
  position: relative;
  z-index: 5;
  padding: 0 24px 28px;
  opacity: 0;
  text-align: center;
  transform: translateY(16px);
}

.story-choice__intro > p:first-child {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.52);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.24em;
}

.story-choice__intro h2 {
  margin: 0;
  font-size: clamp(25px, 7vw, 46px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.35;
}

.story-choice__intro > p:last-child {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.7;
}

.story-choice__arena {
  position: relative;
  min-height: clamp(520px, 72svh, 720px);
  overflow: hidden;
  background: #000;
}

.choice-option {
  position: absolute;
  inset-block: 0;
  width: 58%;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: #111;
  cursor: pointer;
  isolation: isolate;
  pointer-events: none;
  text-align: left;
  will-change: transform, opacity;
  -webkit-tap-highlight-color: transparent;
}

.choice-option--red {
  left: 0;
  z-index: 2;
  clip-path: polygon(0 0, 100% 0, 77% 100%, 0 100%);
  transform: translateX(-105%);
}

.choice-option--blue {
  right: 0;
  z-index: 1;
  clip-path: polygon(23% 0, 100% 0, 100% 100%, 0 100%);
  transform: translateX(105%);
}

.choice-option img {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.7) contrast(1.08);
  transition:
    filter 250ms ease,
    transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.choice-option--red img {
  object-position: 45% center;
}

.choice-option--blue img {
  object-position: 60% center;
}

.choice-option::before,
.choice-option::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  transition: opacity 240ms ease;
}

.choice-option--red::before {
  background: linear-gradient(180deg, rgba(103, 4, 20, 0.25), rgba(229, 43, 70, 0.82));
  mix-blend-mode: multiply;
}

.choice-option--blue::before {
  background: linear-gradient(180deg, rgba(4, 19, 78, 0.22), rgba(35, 116, 255, 0.82));
  mix-blend-mode: multiply;
}

.choice-option::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 25%, rgba(0, 0, 0, 0.88) 100%);
}

.choice-option__marker {
  position: absolute;
  top: 24px;
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.choice-option--red .choice-option__marker {
  left: 20px;
}

.choice-option--blue .choice-option__marker {
  right: 20px;
}

.choice-option__copy {
  position: absolute;
  z-index: 3;
  bottom: max(42px, env(safe-area-inset-bottom));
  display: grid;
  max-width: 76%;
  color: #fff;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.72);
}

.choice-option--red .choice-option__copy {
  left: 20px;
}

.choice-option--blue .choice-option__copy {
  right: 20px;
  justify-items: end;
  text-align: right;
}

.choice-option__action {
  width: fit-content;
  margin-bottom: 7px;
  padding: 5px 8px;
  border: 1px solid currentColor;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.choice-option__copy strong {
  font-size: clamp(21px, 6vw, 38px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.choice-option__prompt {
  margin-top: 10px;
  font-family: var(--sans);
  font-size: clamp(10px, 2.8vw, 13px);
  font-weight: 600;
  line-height: 1.6;
}

.story-choice__slash {
  position: absolute;
  z-index: 4;
  top: -8%;
  left: 50%;
  width: 4px;
  height: 116%;
  background: #fff;
  box-shadow:
    -5px 0 18px rgba(229, 43, 70, 0.75),
    5px 0 18px rgba(35, 116, 255, 0.75);
  opacity: 0;
  pointer-events: none;
  transform: rotate(9deg) scaleY(0.08);
  transform-origin: center;
}

.story-choice.is-entering .choice-option--red {
  animation: choiceRedArrives 660ms cubic-bezier(0.16, 1, 0.3, 1) 80ms both;
}

.story-choice.is-entering .choice-option--blue {
  animation: choiceBlueArrives 660ms cubic-bezier(0.16, 1, 0.3, 1) 80ms both;
}

.story-choice.is-entering .story-choice__slash {
  animation: choiceSlashStrikes 440ms cubic-bezier(0.22, 1, 0.36, 1) 510ms both;
}

.story-choice.is-entering .story-choice__intro {
  animation: choicePromptArrives 460ms cubic-bezier(0.16, 1, 0.3, 1) 400ms both;
}

.story-choice.is-ready .choice-option {
  pointer-events: auto;
}

.story-choice.is-ready .choice-option__action {
  animation: choiceActionPulse 1.5s ease-in-out infinite;
}

.story-choice.is-committing .choice-option {
  animation: none !important;
  pointer-events: none;
  transition:
    opacity 360ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.story-choice.is-committing[data-choice="red"] .choice-option--red,
.story-choice.is-committing[data-choice="blue"] .choice-option--blue {
  opacity: 1;
  transform: scale(1.07);
}

.story-choice.is-committing[data-choice="red"] .choice-option--blue {
  opacity: 0;
  transform: translateX(110%);
}

.story-choice.is-committing[data-choice="blue"] .choice-option--red {
  opacity: 0;
  transform: translateX(-110%);
}

.story-choice.is-committing::after {
  animation: choiceFlash 430ms ease-out both;
}

@keyframes choiceRedArrives {
  0% {
    opacity: 0;
    transform: translateX(-105%);
  }
  70% {
    opacity: 1;
    transform: translateX(-1.5%);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes choiceBlueArrives {
  0% {
    opacity: 0;
    transform: translateX(105%);
  }
  70% {
    opacity: 1;
    transform: translateX(1.5%);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes choiceSlashStrikes {
  0% {
    opacity: 0;
    transform: rotate(9deg) scaleY(0.05);
  }
  38% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: rotate(9deg) scaleY(1);
  }
}

@keyframes choicePromptArrives {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes choiceActionPulse {
  0%,
  100% {
    background: rgba(0, 0, 0, 0.12);
    transform: scale(1);
  }
  50% {
    background: rgba(255, 255, 255, 0.16);
    transform: scale(1.035);
  }
}

@keyframes choiceFlash {
  0%,
  100% {
    opacity: 0;
  }
  38% {
    opacity: 0.44;
  }
}

.story-choice__slash span {
  position: absolute;
  top: 48%;
  left: 50%;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #050505;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.7);
  color: #fff;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  transform: translate(-50%, -50%) rotate(-9deg);
}

.choice-option:hover img,
.choice-option:focus-visible img {
  filter: saturate(1.05) contrast(1.08);
  transform: scale(1.035);
}

.choice-option:focus-visible {
  outline: 4px solid #fff;
  outline-offset: -7px;
}

.story-choice__result {
  min-height: 100svh;
  scroll-margin-top: 58px;
}

.branch-result {
  --route-color: var(--choice-red);
  --route-dark: var(--choice-red-dark);
  display: grid;
  min-height: 100svh;
  align-content: start;
  background:
    radial-gradient(circle at 50% 18%, color-mix(in srgb, var(--route-color) 28%, transparent), transparent 24rem),
    #050505;
}

.branch-result--blue {
  --route-color: var(--choice-blue);
  --route-dark: var(--choice-blue-dark);
}

.branch-result__header {
  padding: 72px 28px 34px;
  border-top: 7px solid var(--route-color);
  text-align: center;
}

.branch-result__kicker {
  margin: 0 0 14px;
  color: var(--route-color);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.branch-result__header h2 {
  margin: 0 auto;
  max-width: 13em;
  font-size: clamp(26px, 7vw, 44px);
  font-weight: 600;
  line-height: 1.45;
}

.branch-result__art {
  position: relative;
  height: clamp(260px, 48svh, 440px);
  margin: 0;
  overflow: hidden;
}

.branch-result__art::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, #050505);
  content: "";
}

.branch-result__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.72) contrast(1.1);
}

.branch-result__story {
  display: grid;
  gap: 22px;
  padding: 0 24px 44px;
}

.branch-result__dialogue {
  width: min(88%, 440px);
  margin: 0;
  padding: 15px 17px;
  border-radius: 22px 22px 22px 4px;
  background: #f8f5ee;
  color: #101010;
  font-family: var(--sans);
  font-size: clamp(14px, 3.8vw, 18px);
  font-weight: 700;
  line-height: 1.65;
}

.branch-result__dialogue:nth-child(even) {
  justify-self: end;
  border-radius: 22px 22px 4px;
}

.branch-result__dialogue span {
  display: block;
  margin-bottom: 4px;
  color: var(--route-color);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.branch-result__narration {
  margin: 20px auto 0;
  max-width: 31em;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(16px, 4vw, 21px);
  line-height: 2;
  text-align: center;
}

.branch-result__cost {
  display: grid;
  gap: 12px;
  margin: 0 20px;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--route-color) 65%, white);
  border-left: 7px solid var(--route-color);
  background: color-mix(in srgb, var(--route-dark) 64%, #080808);
  font-family: var(--sans);
}

.branch-result__cost strong {
  font-size: 15px;
  line-height: 1.7;
}

.branch-result__cost span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.branch-result__actions {
  display: grid;
  gap: 12px;
  padding: 34px 20px calc(72px + env(safe-area-inset-bottom));
}

.branch-result__actions button {
  min-height: 54px;
  padding: 13px 18px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 800;
}

.branch-result__continue {
  border: 1px solid var(--route-color);
  background: var(--route-color);
  color: #fff;
}

.branch-result__retry {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
}

.branch-result__actions button:hover,
.branch-result__actions button:focus-visible {
  border-color: #fff;
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.episode-finish {
  display: grid;
  min-height: 100svh;
  place-items: center;
  align-content: center;
  padding: 100px 24px;
  background:
    radial-gradient(circle at 50% 20%, rgba(163, 21, 26, 0.22), transparent 28rem),
    #080808;
  text-align: center;
}

.episode-finish__label {
  margin: 0 0 20px;
  color: var(--amber);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
}

.episode-finish h2 {
  margin: 0;
  font-size: clamp(32px, 8vw, 64px);
  font-weight: 500;
}

.episode-finish__next {
  margin-top: 72px;
  padding: 28px 0;
  border-block: 1px solid rgba(255, 255, 255, 0.12);
}

.episode-finish__next p {
  margin: 0 0 8px;
  color: var(--paper-muted);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.episode-finish__next strong {
  font-size: clamp(17px, 4vw, 22px);
  font-weight: 500;
}

.restart-button {
  margin-top: 48px;
  padding: 15px 24px;
  border: 1px solid rgba(239, 193, 132, 0.5);
  background: transparent;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.next-episode-button {
  margin-top: 48px;
  padding: 15px 24px;
  border: 1px solid #efc184;
  background: #efc184;
  color: #111;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.next-episode-button + .restart-button {
  margin-top: 16px;
}

.restart-button:hover,
.restart-button:focus-visible {
  background: #efc184;
  color: #111;
  outline: none;
}

.episode-finish__note {
  max-width: 34em;
  margin: 30px auto 0;
  color: rgba(242, 238, 229, 0.45);
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.8;
}

.to-top {
  position: fixed;
  z-index: 80;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(8, 8, 8, 0.7);
  opacity: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.1em;
  backdrop-filter: blur(12px);
  transition: opacity 220ms ease;
  pointer-events: none;
}

.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.noscript {
  padding: 80px 24px;
  text-align: center;
}

@media (max-width: 640px) {
  .reader-toolbar__title {
    display: none;
  }

  .reader-toolbar__episode {
    display: none;
  }

  .reader-toolbar__actions {
    gap: 8px;
  }

  .choice-status {
    min-width: 62px;
  }

  .text-button {
    padding-inline: 8px;
    font-size: 10px;
  }

  .episode-cover {
    padding-inline: 24px;
  }

  .episode-cover__composition {
    gap: 18px;
  }

  .episode-cover__series {
    font-size: 11px;
  }

  .panel--art .panel__dialogue-layer {
    position: relative;
    gap: 22px;
    padding: 24px 18px 38px;
    background: #090909;
  }

  .panel--art .dialogue-stack {
    width: 100%;
  }

  .panel--art .panel__narration {
    width: 100%;
    background: transparent;
  }

  .story-choice {
    padding-top: 66px;
  }

  .story-choice__arena {
    min-height: 66svh;
  }

  .choice-option {
    width: 62%;
  }

  .choice-option--red {
    clip-path: polygon(0 0, 100% 0, 68% 100%, 0 100%);
  }

  .choice-option--blue {
    clip-path: polygon(32% 0, 100% 0, 100% 100%, 0 100%);
  }

  .choice-option__copy {
    max-width: 68%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .panel {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .story-choice {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .choice-option img {
    transition: none;
  }

  .story-choice.is-entering .story-choice__intro,
  .story-choice.is-entering .choice-option,
  .story-choice.is-entering .story-choice__slash,
  .story-choice.is-ready .choice-option__action,
  .story-choice.is-committing::after {
    animation: none;
  }

  .story-choice.is-entering .story-choice__intro,
  .story-choice.is-entering .choice-option,
  .story-choice.is-entering .story-choice__slash {
    opacity: 1;
    transform: none;
  }

  .story-choice.is-entering .story-choice__slash {
    transform: rotate(9deg);
  }
}
