/* The adopted 41 layout. The story divider is tied to scroll position. */
:root {
  --page-edge: clamp(26px, 5.2vw, 82px);
  --section-space: clamp(52px, 5.3vw, 88px);
  --reading-gap: clamp(25px, 4.4vw, 72px);
  --button-gap: 12px;
}

.wrap { padding: var(--section-space) var(--page-edge); }
main::after { opacity: .12; }
.story::before { display: none; }
.story-layout {
  max-width: 1536px;
  grid-template-columns: minmax(0,.91fr) minmax(0,1.09fr);
  gap: var(--reading-gap);
  align-items: start;
}
.title-window {
  position: relative;
  grid-column: 1 / -1;
  aspect-ratio: 27 / 10;
  overflow: hidden;
  background: #211b20;
}
.title-window img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.world-red { clip-path: inset(0 calc(100% - var(--world-split, 50%)) 0 0); }
.world-divider {
  position: absolute; inset-block: 0; left: var(--world-split, 50%);
  width: 2px; transform: translateX(-50%); background: #fffbef;
  box-shadow: 0 0 7px 2px #ffe7ecbf, -5px 0 18px 4px #ff899478, 4px 0 15px #eff6ff85;
}
.story .cut-title { line-height: .93; }
.story-prose { min-width: 0; padding-top: 5px; }
.story-prose .chapter { margin-bottom: clamp(20px, 2vw, 32px); }
.story-prose blockquote { margin-bottom: 20px; text-wrap: balance; }
.story-media { min-width: 0; }
.branch-lead { border: 0; padding: 0; margin: 0 0 clamp(15px, 1.6vw, 24px); }
.branch-lead h2 { max-width: 28em; font-size: clamp(1.2rem,1.5vw,1.55rem); line-height: 1.45; }
.branch-lead .body-copy p + p { margin-top: .25em; }
.story-media .memory { border: 0; padding: 0; background: transparent; }
.feature-film { min-height: 56px; margin-top: 14px; border-bottom: 1px solid #65525b; }
.feature-film .play { background: #eadde0; }

.cast-art::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg,#231d22aa,#17141ae6 66%), url("design/street-duo.webp") center 60% / cover;
  mask-image: linear-gradient(0deg,transparent,#000 7% 93%,transparent);
}
.cast-caption { padding: 13px 19px; border-color: #b07780; }
.cast-caption p, .panel-copy { line-height: 1.8; }
.command-layout { display: block; }
.panels, .system-panel > * { min-width: 0; }
.system-menu { margin-bottom: 16px; }
.panel-copy .body-copy { text-wrap: pretty; }

/* Equal visible gaps, including the active marker. Both angled faces occupy the same footprint in every state. */
.choice-tabs {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  align-items: stretch;
  padding: 0 5px;
  gap: var(--button-gap);
  margin: 0;
}
.memory .choice-tabs { margin-bottom: 12px; }
.choice-tabs button {
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 7px 10px;
  font: 700 clamp(.9rem,1.12vw,1.08rem)/1.35 var(--jp);
  text-align: center;
  text-wrap: balance;
  border: 0;
  color: #e9e6e9;
  background: transparent;
}
.choice-tabs button::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  transform: skewX(-9.1deg);
  background: #26252b;
  box-shadow: inset 0 -1px #56464e;
}
.choice-tabs button[aria-selected="true"] { color: var(--ink); }
.choice-tabs button[aria-selected="true"]::before {
  inset: 0;
  box-shadow: none;
  background: linear-gradient(90deg,var(--select) 0 5px,var(--ink) 5px 8px,var(--pale) 8px);
}
.choice-tabs button::after { content: none; display: none; }
.choice-tabs button:focus-visible { outline: 2px solid #ffb6be; outline-offset: 2px; }
@media (hover:hover) {
  .choice-tabs button:not([aria-selected="true"]):hover { color: white; }
  .choice-tabs button:not([aria-selected="true"]):hover::before { background: #40353d; }
}
@media (forced-colors:active) {
  .choice-tabs button { border: 1px solid ButtonText; }
  .choice-tabs button[aria-selected="true"] { border-bottom: 4px solid Highlight; }
}

.branch-margin {
  position: absolute; bottom: 10px; right: 0; width: min(29%,360px); height: 30px;
  color: #90767c; opacity: .64; pointer-events: none;
}
.branch-margin::before, .branch-margin i, .branch-margin i::after {
  content: ""; position: absolute; height: 1px; background: currentColor;
}
.branch-margin::before { inset: 50% 0 auto; }
.branch-margin::after {
  content: ""; position: absolute; left: 24%; top: calc(50% - 1.5px);
  width: 4px; height: 4px; background: #ae636c; transform: rotate(45deg);
}
.branch-margin i { left: calc(24% + 12px); top: 3px; width: 42%; color: #ae636c; }
.branch-margin i::after { right: 100%; top: 0; width: 17px; transform: rotate(-45deg); transform-origin: right center; }
.branch-margin i:nth-child(2) { left: calc(59% + 12px); top: 27px; width: 30%; color: #90767c; }
.branch-margin i:nth-child(2)::after { transform: rotate(45deg); }
#system > .branch-margin { left: 0; right: auto; transform: scaleX(-1); }
#product > .branch-margin { bottom: auto; top: 9px; }

.gallery-grid { gap: clamp(10px,1vw,18px); }
.product-inner { grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(24px,7vw,104px); border-top: 1px solid #473940; }
.product-logo { margin-bottom: clamp(18px,1.9vw,30px); }
.product .wishlist-badge { display: block; position: static; transform: none; max-width: 100%; }
.product .wishlist-badge:focus-visible { outline-offset: 4px; }

@media (min-width:901px) {
  .story .cut-title { font-size: clamp(4.3rem,7.5vw,7.8rem); }
  .system-menu { display: flex; align-items: center; justify-content: space-between; gap: 5%; margin-bottom: 29px; }
  .system-menu .chapter { margin: 0; }
  .system-menu .choice-tabs { flex: 1; max-width: 690px; }
  .system-panel { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(0,1fr); gap: 4%; align-items: center; }
  .panel-copy { margin: 0; }
  .cast-list button { --mark-width: 7px; }
}
@media (min-width:701px) and (max-width:900px) {
  .story-layout { grid-template-columns: 1fr; }
  .story-prose .body-copy { max-width: 58ch; }
}
@media (max-width:700px) {
  :root { --page-edge: clamp(18px,5.2vw,30px); --section-space: 38px; --reading-gap: 28px; --button-gap: 10px; }
  .story-layout, .product-inner { grid-template-columns: 1fr; }
  .story-prose { padding: 0; }
  .feature-film { margin-top: 10px; }
  .choice-tabs button { padding: 7px 6px; }
  .product-inner { gap: 24px; }
  .product-inner > div:first-child { padding-bottom: 0; }
  .product .product-logo, .product .wishlist-badge { margin-inline: auto; }
  .product .wishlist-badge { width: min(74vw,310px); }
  .branch-margin { bottom: 2px; width: 34%; opacity: .52; }
  .gallery-grid { margin-inline: calc(-1 * var(--page-edge)); padding-inline: var(--page-edge); }
}
@media (max-height:500px) and (orientation:landscape) {
  .product .wishlist-badge { width: min(25vw,285px); }
}

html:lang(ko), .language-picker [lang="ko"] { --jp: "Apple SD Gothic Neo","Malgun Gothic","Noto Sans KR",sans-serif; }
html:lang(zh-Hans), .language-picker [lang="zh-Hans"] { --jp: "PingFang SC","Microsoft YaHei","Noto Sans SC",sans-serif; }
html:lang(zh-Hant), .language-picker [lang="zh-Hant"] { --jp: "PingFang TC","Microsoft JhengHei","Noto Sans TC",sans-serif; }

.utility { z-index: 2; }
.utility .language-picker { position: relative; display: block; padding: 0; clip-path: none; background: transparent; }
.language-picker summary {
  list-style: none; cursor: pointer; min-height: 44px; padding: 0 14px;
  display: flex; align-items: center; gap: 12px; background: var(--stock); color: var(--ink);
  clip-path: var(--notch);
}
.language-picker summary::-webkit-details-marker { display: none; }
.language-picker summary::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.language-picker[open] summary::after { transform: translateY(2px) rotate(225deg); }
.language-picker summary:focus-visible { outline-offset: -4px; outline-color: var(--red); }
.language-picker nav {
  position: absolute; top: calc(100% + 4px); right: 0; min-width: 148px; max-height: calc(100svh - 65px);
  overflow: auto; padding: 4px; background: #19191f; border: 1px solid #55515b;
  box-shadow: 0 6px 20px #0008;
}
.language-picker nav a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; font: 700 .94rem/1.35 var(--jp); }
.language-picker nav [aria-current] { color: var(--ink); background: var(--pale); border-left: 4px solid var(--red); padding-left: 8px; }
.localized-badge { container-type: inline-size; color: white; }
.steam-wordmark {
  display: block; width: 100%; aspect-ratio: 822/132;
  background: url("design/steam-en.webp") center top / 100% auto no-repeat;
}
.steam-details {
  display: flex; align-items: center; justify-content: space-between; gap: .3em;
  min-height: 10.7cqw; padding: 1cqw 1.5cqw 1cqw 3cqw; background: #394a24;
  font: 600 3.4cqw/1.3 var(--jp); color: #d6e7b6;
}
.steam-details strong { padding: 1.6cqw 2.2cqw; border-radius: 2px; background: #688b2e; color: #fff; }

/* TipsPopup.Open applies RnSkin.RailTitle; the frame supplies the rail, not a separate title plate. */
#viewer {
  --frame-edge: clamp(17px,3.3vw,40px);
  --frame-cut: polygon(9px 0,calc(100% - 24px) 0,100% 24px,100% calc(100% - 5px),calc(100% - 5px) 100%,12px 100%,0 calc(100% - 12px),0 9px);
  --media-height: calc(96dvh - 195px);
  width: min(1120px,95vw); max-height: 96dvh; padding: 0; border: 0;
  background: transparent; color: #fff; overflow: auto;
  filter: drop-shadow(3px 5px 14px #000a);
}
#viewer::backdrop { background: rgb(46 46 46 / 59%); backdrop-filter: blur(2px); }
.viewer-shell {
  position: relative; isolation: isolate; padding: 0 var(--frame-edge) 18px;
  clip-path: var(--frame-cut); background: #34343c;
}
.viewer-shell::before {
  content: ""; position: absolute; z-index: -1; inset: 1px; pointer-events: none;
  clip-path: var(--frame-cut); background: #101011;
}
.viewer-bar {
  position: relative; gap: 16px; min-height: 0; margin: 0 0 12px; padding: 17px 0 12px;
  border: 0; border-bottom: 1px solid #2a2d34;
}
.viewer-heading { min-width: 0; }
.viewer-heading::before {
  content: ""; position: absolute; top: 17px; bottom: 15px; left: calc(1px - var(--frame-edge));
  width: clamp(3px,.42vw,6px); background: var(--red);
}
.viewer-category {
  display: block; margin-bottom: 3px; color: #9298a2;
  font: 800 clamp(.68rem,1vw,.88rem)/1.1 var(--display); letter-spacing: .09em;
}
#viewer-title {
  margin: 0; font: 700 clamp(1.15rem,2.2vw,1.85rem)/1.3 var(--jp);
  overflow-wrap: anywhere; text-wrap: balance;
}
.viewer-bar .viewer-close {
  flex: none; align-self: center; min-width: 44px; min-height: 44px; padding: 0;
  border: 0; background: transparent; color: #fff; clip-path: none; font: 400 32px/1 Arial,sans-serif;
}
.viewer-bar .viewer-close:is(:hover,:focus-visible) { color: white; background: #34343c; }
.viewer-bar .viewer-close:focus-visible { outline: 2px solid #ddd; outline-offset: -4px; }
#viewer-content { background: #101011; box-shadow: 0 0 0 1px #34343c; }
#viewer-content :is(img,video) { display: block; margin: auto; width: 100%; max-height: var(--media-height); object-fit: contain; }
#viewer-content video { aspect-ratio: 16/9; }
.viewer-nav {
  position: relative; isolation: isolate; margin: 12px calc(-1 * var(--frame-edge)) -8px;
  display: flex; justify-content: center; gap: clamp(14px,6vw,104px); padding: 2px 0;
  background: #232229;
}
.viewer-nav::before {
  content: ""; position: absolute; z-index: -1; inset: 0 max(7%,calc(50% - 230px));
  transform: skewX(-31deg); background: #34343e; border-inline: 4px solid #101014;
}
.viewer-nav button {
  position: relative; isolation: isolate; width: 48px; height: 44px; min-height: 44px; padding: 0 0 3px;
  clip-path: none; background: transparent; color: #faf8fa; border: 0;
  font: 500 29px/1 Arial,sans-serif;
}
.viewer-nav button::before {
  content: ""; position: absolute; z-index: -1; inset: 5px;
  border: 1px solid #72717a; background: #47464f;
  clip-path: polygon(0 0,calc(100% - 6px) 0,100% 6px,100% 100%,6px 100%,0 calc(100% - 6px));
}
.viewer-nav button:disabled { opacity: .15; cursor: default; }
.viewer-nav button:enabled:hover::before { background: #60616e; }
.viewer-nav button:enabled:focus-visible::before { background: var(--select); }
.viewer-nav button:enabled:active::before { background: #c8343a; }
.viewer-nav button:is(:hover,:focus-visible) { color: white; background: transparent; }
.viewer-nav button:disabled:hover { color: white; }
.page-count { min-width: 4em; text-align: center; font: 800 1.16rem/1 var(--display); font-variant-numeric: tabular-nums; }
body:has(#viewer[open]) { overflow: hidden; }
@media (prefers-reduced-motion:no-preference) {
  html:not(.still) #viewer[open] .viewer-shell { animation: tips-in .22s cubic-bezier(.22,1,.36,1) both; }
  @keyframes tips-in { from { opacity: .25; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
}
@media (max-width:580px) {
  .viewer-bar { gap: 8px; padding-block: 13px 9px; margin-bottom: 9px; }
  .viewer-heading::before { top: 13px; bottom: 11px; }
  .viewer-nav { margin-bottom: 0; }
}
@media (max-height:500px) and (orientation:landscape) {
  .language-picker nav { max-height: calc(100svh - 70px); }
  #viewer { --frame-edge: 12px; --media-height: calc(96dvh - 142px); }
  .viewer-bar { min-height: 44px; padding-block: 6px; margin-bottom: 6px; }
  .viewer-heading::before { top: 7px; bottom: 8px; }
  #viewer-title { font-size: 1.1rem; }
  .viewer-nav { margin-block: 5px -4px; }
}
