:root {
  color-scheme: dark;
  --ink: #080808;
  --paper: #f2efe9;
  --muted: rgba(242, 239, 233, 0.64);
  --hairline: rgba(242, 239, 233, 0.22);
  --accent: #d33b28;
  --radius: 2px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

button {
  color: inherit;
  font: inherit;
}

.experience {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: clamp(0px, 2vw, 24px);
  background:
    radial-gradient(circle at 70% 0%, #25221f 0, transparent 34%),
    #080808;
}

.stage {
  position: relative;
  width: min(100%, 1600px);
  max-height: calc(100dvh - clamp(0px, 4vw, 48px));
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.58);
  isolation: isolate;
}

.film {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

.film.is-active {
  z-index: 2;
  opacity: 1;
  pointer-events: auto;
}

.brand {
  position: absolute;
  z-index: 5;
  top: clamp(18px, 3vw, 38px);
  left: clamp(18px, 3.5vw, 52px);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(11px, 1vw, 14px);
  letter-spacing: 0.18em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease;
}

.stage.has-started .brand {
  opacity: 0.88;
}

.brand-mark {
  width: 7px;
  height: 7px;
  background: var(--accent);
  transform: rotate(45deg);
}

.chapter {
  margin-left: 8px;
  padding-left: 18px;
  border-left: 1px solid var(--hairline);
  color: var(--muted);
}

.start-screen,
.choice-overlay,
.ending {
  position: absolute;
  inset: 0;
  z-index: 10;
}

.start-screen {
  display: flex;
  align-items: flex-end;
  padding: clamp(32px, 6vw, 92px);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.94) 0%, rgba(0, 0, 0, 0.58) 43%, rgba(0, 0, 0, 0.1) 76%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.6), transparent 55%),
    #171717;
  transition: opacity 600ms ease, visibility 600ms ease;
}

.start-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.start-copy {
  max-width: 680px;
}

.overline,
.choice-kicker {
  margin: 0 0 clamp(14px, 2vw, 24px);
  color: var(--accent);
  font-size: clamp(10px, 0.9vw, 13px);
  font-weight: 650;
  letter-spacing: 0.2em;
}

h1,
h2,
p {
  text-wrap: balance;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 88px);
  font-weight: 540;
  letter-spacing: -0.055em;
  line-height: 1.06;
}

.intro {
  max-width: 32em;
  margin: clamp(18px, 2.5vw, 34px) 0 clamp(26px, 3.5vw, 48px);
  color: var(--muted);
  font-size: clamp(14px, 1.25vw, 18px);
  line-height: 1.7;
}

.start-button,
.replay-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 42px;
  padding: 0 22px;
  border: 1px solid var(--paper);
  border-radius: var(--radius);
  background: var(--paper);
  color: #111;
  cursor: pointer;
  font-size: 15px;
  font-weight: 650;
  transition: background 180ms ease, color 180ms ease, transform 120ms ease;
}

.start-button:hover,
.replay-button:hover {
  background: transparent;
  color: var(--paper);
}

.start-button:active,
.replay-button:active,
.choice:active,
.fullscreen-button:active {
  transform: translateY(1px);
}

.button-arrow {
  font-size: 20px;
}

.sound-note {
  position: absolute;
  right: clamp(22px, 4vw, 58px);
  bottom: clamp(22px, 3vw, 40px);
  margin: 0;
  color: rgba(242, 239, 233, 0.45);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.choice-overlay {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(430px, 1.1fr);
  align-items: end;
  gap: clamp(32px, 6vw, 96px);
  padding: clamp(32px, 5vw, 76px);
  background:
    linear-gradient(90deg, rgba(5, 5, 5, 0.72), rgba(5, 5, 5, 0.16) 52%, rgba(5, 5, 5, 0.38)),
    linear-gradient(0deg, rgba(5, 5, 5, 0.52), transparent 68%);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease, visibility 500ms ease;
}

.choice-overlay.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.choice-overlay.is-committed {
  background:
    linear-gradient(90deg, rgba(5, 5, 5, 0.28), rgba(5, 5, 5, 0.04) 52%, rgba(5, 5, 5, 0.12)),
    linear-gradient(0deg, rgba(5, 5, 5, 0.18), transparent 68%);
  pointer-events: none;
  transition: opacity 700ms ease, visibility 700ms ease, background 500ms ease;
}

.choice-overlay.is-committed .choice-copy {
  opacity: 0.3;
  transform: translateY(8px);
}

.choice-overlay.is-committed .choices {
  opacity: 0.34;
}

.choice-overlay.is-committed .choice:not(.is-selected) {
  opacity: 0.18;
}

.choice-overlay.is-committed .choice.is-selected {
  padding-right: 16px;
  padding-left: 18px;
  background: rgba(5, 5, 5, 0.42);
}

.choice-overlay.is-committed .choice.is-selected::before {
  transform: scaleY(1);
}

.choice-copy {
  align-self: center;
  transition: opacity 520ms ease, transform 420ms ease;
}

.choice-copy h2,
.ending h2 {
  max-width: 12em;
  margin: 0;
  font-size: clamp(30px, 4.2vw, 64px);
  font-weight: 520;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.choice-hint,
.ending > p:not(.choice-kicker) {
  max-width: 34em;
  margin: clamp(16px, 2vw, 28px) 0 0;
  color: var(--muted);
  font-size: clamp(12px, 1.05vw, 15px);
  line-height: 1.7;
}

.choices {
  border-top: 1px solid var(--hairline);
  transition: opacity 520ms ease;
}

.choice {
  position: relative;
  display: grid;
  width: 100%;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: clamp(92px, 11vw, 148px);
  padding: 18px 4px;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 200ms ease, padding 200ms ease, opacity 300ms ease;
}

.choice:disabled {
  color: inherit;
  cursor: default;
}

.choice::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  content: "";
  transform: scaleY(0);
  transition: transform 200ms ease;
}

.choice:hover,
.choice:focus-visible {
  padding-right: 16px;
  padding-left: 18px;
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.choice:hover::before,
.choice:focus-visible::before {
  transform: scaleY(1);
}

.choice-index {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.choice-title {
  font-size: clamp(17px, 1.7vw, 25px);
  font-weight: 520;
}

.choice-action {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.branch-confirmation {
  position: absolute;
  z-index: 8;
  bottom: clamp(58px, 8vw, 112px);
  left: clamp(24px, 5vw, 76px);
  display: grid;
  visibility: hidden;
  gap: 6px;
  padding: 18px 24px 18px 18px;
  border-left: 2px solid rgba(211, 59, 40, 0.78);
  background: linear-gradient(90deg, rgba(5, 5, 5, 0.32), transparent);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.branch-confirmation.is-visible {
  visibility: visible;
  opacity: 0.82;
  transform: translateY(0);
  transition: opacity 420ms ease, transform 420ms ease, visibility 420ms ease;
}

.branch-confirmation.is-fading {
  visibility: visible;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 720ms ease, transform 720ms ease, visibility 720ms ease;
}

.branch-confirmation span,
.branch-confirmation small {
  color: rgba(242, 239, 233, 0.58);
  font-size: clamp(10px, 0.85vw, 12px);
  font-weight: 500;
  letter-spacing: 0.14em;
}

.branch-confirmation strong {
  font-size: clamp(22px, 2.6vw, 38px);
  font-weight: 560;
  letter-spacing: -0.025em;
}

.ending {
  display: flex;
  visibility: hidden;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: clamp(34px, 6vw, 92px);
  background: linear-gradient(90deg, rgba(4, 4, 4, 0.94), rgba(4, 4, 4, 0.45) 72%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms ease, visibility 600ms ease;
}

.ending.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.ending .replay-button {
  margin-top: clamp(24px, 3vw, 42px);
}

.fullscreen-button {
  position: absolute;
  z-index: 30;
  top: clamp(14px, 2vw, 28px);
  right: clamp(14px, 2vw, 28px);
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.38);
  color: white;
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 21px;
}

@media (max-width: 760px), (orientation: portrait) {
  .experience {
    padding: 0;
  }

  .stage {
    width: 100%;
    max-height: none;
    min-height: 100dvh;
    aspect-ratio: auto;
  }

  .start-screen {
    align-items: flex-end;
    padding: max(32px, env(safe-area-inset-top)) 24px max(58px, env(safe-area-inset-bottom));
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.98), rgba(0, 0, 0, 0.36) 82%), #171717;
  }

  h1 {
    font-size: clamp(42px, 12vw, 66px);
  }

  .sound-note {
    display: none;
  }

  .film {
    object-fit: contain;
  }

  .choice-overlay {
    grid-template-columns: 1fr;
    align-content: end;
    gap: 26px;
    padding: 94px 22px max(54px, env(safe-area-inset-bottom));
    background: linear-gradient(0deg, rgba(3, 3, 3, 0.84), rgba(3, 3, 3, 0.12) 92%);
  }

  .choice-copy {
    align-self: auto;
  }

  .choice-copy h2 {
    font-size: clamp(30px, 8.4vw, 46px);
  }

  .choice {
    grid-template-columns: 30px 1fr;
    min-height: 76px;
  }

  .choice-action {
    display: none;
  }

  .brand {
    top: max(18px, env(safe-area-inset-top));
    left: 20px;
  }

  .chapter {
    display: none;
  }

  .ending {
    padding: 40px 24px max(64px, env(safe-area-inset-bottom));
    background: linear-gradient(0deg, rgba(3, 3, 3, 0.98), rgba(3, 3, 3, 0.4));
  }

  .branch-confirmation {
    bottom: max(76px, calc(env(safe-area-inset-bottom) + 56px));
    left: 22px;
  }

  .fullscreen-button {
    top: max(14px, env(safe-area-inset-top));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

}
