:root {
  color-scheme: dark;
  --ink: #0d0710;
  --ivory: #fff0d5;
  --muted: #c0acba;
  --paper: #20121f;
  --line: #885f774f;
  --red: #fb5370;
  --rose: #f4b7b7;
  --green: #a6e2cc;
  --display: Georgia, "Songti SC", "SimSun", serif;
  --sans: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  background: var(--ink);
  color: var(--ivory);
  font: 1rem var(--sans);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
button, summary { color: inherit; font: inherit; cursor: pointer; }
button { border: 0; padding: 0; background: none; }
button:disabled { cursor: default; color: #9b8493; opacity: .55; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ivory); outline-offset: 3px; }

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: #0c0611 73% 40% / cover no-repeat;
}
.backdrop video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 73% 40%;
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #0c070fec 0%, #120713a3 52%, #160e1944 100%),
    linear-gradient(0deg, #0c070ff5, #0c070f71 72%, #130b1593);
}
.app-frame {
  --page-gap: clamp(8px, 1.55vh, 16px);
  height: 100svh;
  max-width: 1780px;
  margin: 0 auto;
  padding: clamp(15px, 3vh, 33px) clamp(19px, 3.5vw, 60px) 11px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: var(--page-gap);
}
.shell, .heroine-shell, .role-guide-shell {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: var(--page-gap);
}

.intro, .chapter-heading {
  display: flex;
  min-width: 0;
  align-items: center;
}
.intro { justify-content: space-between; gap: 16px; }
.guide-access, .top-actions { display: flex; flex: none; align-items: center; gap: clamp(8px, 1vw, 14px); }
.entry-link {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #c07d9994;
  color: #ffe2e6;
  background: #2c172bcc;
  font-size: .86rem;
  line-height: 1.22;
  font-weight: 680;
}
.entry-link:hover { background: #5a2944; border-color: #eb9db3; }
.chapter-heading { gap: clamp(15px, 2.4vw, 41px); }
.brand {
  flex: none;
  display: flex;
  flex-direction: column;
  padding-right: clamp(14px, 2.3vw, 40px);
  border-right: 1px solid #b782986b;
}
.brand-mark { font: bold italic clamp(21px, 2.05vw, 39px)/1 var(--display); letter-spacing: -.1em; }
.brand-mark strong { margin-left: 3px; color: #ff4762; font-size: 1.3em; }
.brand-name { margin-top: 4px; color: var(--muted); font: 600 clamp(10px, .9vw, 15px)/1 var(--sans); }
.title { min-width: 0; }
.context { color: var(--rose); font-size: clamp(12px, 1.1vw, 15px); margin-bottom: 4px; font-weight: 650; }
.title h1 {
  font: italic 900 clamp(43px, 5.25vw, 96px)/.99 var(--display);
  letter-spacing: -.045em;
  -webkit-text-stroke: .018em;
  text-shadow: 0 7px 40px #110510;
}
html[lang=en] .title h1 { font-size: clamp(34px, 4.5vw, 78px); }
.dream-teaser {
  width: clamp(176px, 23vw, 325px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  text-align: left;
  min-height: clamp(64px, 10vh, 102px);
  padding: 10px 15px;
  background: #30203b;
  border-left: 2px solid #d675b3;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}
.dream-teaser img, .dream-teaser::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.dream-teaser img { object-fit: cover; object-position: 55% 43%; }
.dream-teaser::after { content: ""; background: linear-gradient(90deg, #120a1bf0, #1a0b2a60 62%, #13071e47); }
.dream-teaser > span:first-of-type { display: grid; gap: 3px; text-shadow: 0 2px 6px #0b0510; }
.dream-teaser strong { font: italic bold clamp(20px, 2.25vw, 34px)/1 var(--display); }
.dream-teaser > span span { font-size: .79rem; color: #ffe2f7; font-weight: 600; }
.dream-teaser:focus-visible { outline-offset: -4px; }
.teaser-play {
  flex: none;
  display: grid;
  place-items: center;
  width: 35px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #e7bbdcb8;
  background: #26112dab;
  font-size: .78rem;
}
.dream-teaser:hover .teaser-play { background: #632953; }

.phases {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  min-width: 0;
  border-block: 1px solid #ba8d9d6f;
  background: #150c16dd;
}
.phase {
  min-width: 0;
  position: relative;
  min-height: 42px;
  padding: 6px 12px;
  border-bottom: 2px solid transparent;
  font-size: clamp(.77rem, 1.06vw, .97rem);
  font-weight: 650;
  line-height: 1.2;
  color: var(--muted);
}
.phase:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 1;
  right: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-top: 1px solid #b28aab94;
  border-right: 1px solid #b28aab94;
  transform: translate(50%, -50%) rotate(45deg);
}
.phase:hover, .phase[aria-current=step] { color: var(--ivory); background: #43172a; }
.phase[aria-current=step] { border-bottom-color: var(--red); background: linear-gradient(90deg, #732236, #351729); }
.mobile-panes { display: none; }

.heroine-backdrop {
  position: fixed;
  z-index: -1;
  inset: 0 0 4svh 30vw;
  background: #0c0611 center / cover no-repeat;
  background-position: 75% 40%;
  pointer-events: none;
  mask-image: linear-gradient(90deg, transparent, #0005 12%, #000 32%);
}
.heroine-backdrop video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 75% 40%;
}
.heroine-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #0b0610bf 0%, #0b06105c 25%, transparent 61%),
    linear-gradient(0deg, #0d0710 0%, #0d0710f2 10%, #0d071095 27%, #0d071029 47%, #0d071018 73%, #0d07103d 100%);
}
.heroine-shell {
  --hero-red: #fc4562;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(10px, 1.8svh, 21px);
}
.heroine-masthead {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.heroine-mark {
  display: grid;
  gap: 4px;
  justify-content: start;
  width: fit-content;
  padding: 3px 2px 0;
  transform: rotate(-4deg);
  font: 900 italic clamp(26px, 2.7vw, 40px)/.87 var(--display);
  letter-spacing: -.10em;
}
.heroine-mark strong { color: var(--hero-red); font-size: 1.26em; margin-left: 4px; }
.heroine-mark small { color: var(--ivory); font: 800 .33em/1.18 var(--display); letter-spacing: .035em; text-align: right; }
.heroine-stage {
  width: min(74%, 1024px);
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(14px, 2.6svh, 28px);
  padding-top: clamp(10px, 3.7svh, 36px);
}
.heroine-hero { min-width: 0; padding: 0 2px; }
.heroine-lockup {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 9px clamp(21px, 3vw, 48px);
}
.heroine-hero h1 {
  position: relative;
  isolation: isolate;
  width: fit-content;
  max-width: 100%;
  padding-right: .08em;
  font: 900 italic clamp(41px, 4.28vw, 74px)/.99 Georgia, "KaiTi", "Songti SC", serif;
  letter-spacing: -.059em;
  color: #fff0cd;
  text-shadow: 0 .06em .34em #0c0411da;
}
.heroine-hero h1::after {
  content: "";
  z-index: -1;
  position: absolute;
  left: 82%;
  bottom: .07em;
  width: clamp(35px, 4.2vw, 72px);
  height: 4px;
  background: linear-gradient(90deg, #ba1533, #ff2c46 48%, #ff314f25 100%);
  clip-path: polygon(0 78%, 100% 0, 73% 64%, 7% 100%);
  transform: rotate(-8deg);
  transform-origin: left center;
}
html[lang=en] .heroine-shell:not([data-current-role=victoria]) .heroine-hero h1 { font-size: clamp(35px, 3.8vw, 61px); }
.heroine-actions { display: flex; min-width: 0; align-items: center; }
.heroine-primary, .heroine-guide-link { position: relative; color: #fff1d6; font: 710 .86rem/1.2 var(--sans); }
.heroine-primary {
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  min-height: 35px;
  text-align: left;
  padding: 6px 15px 6px 11px;
  text-shadow: 0 1px 3px #500514;
}
.heroine-primary::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  clip-path: polygon(7px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
  background: linear-gradient(117deg, #bf1535, #86132e 92%);
}
.heroine-primary:hover::before { background: linear-gradient(117deg, #ef3853, #be2045 82%); }
.heroine-primary span:first-child { font-size: .8em; }
.heroine-guide-link {
  min-height: 34px;
  margin-top: 2px;
  padding: 5px 2px;
  color: #f0d9cf;
  text-shadow: 0 2px 6px #100510;
  border-bottom: 1px solid #d4a9ad81;
}
.heroine-guide-link:hover { border-color: #ff9aaf; color: #fff0d5; }
.top-actions .heroine-guide-link { margin-top: 0; }
.heroine-mobile-tabs { display: none; }
.heroine-content {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #79495f transparent;
  display: grid;
  align-content: start;
  gap: clamp(16px, 2.75svh, 28px);
  padding: 4px 2px 7px;
}
.heroine-section { --reel-accent: #f34361; min-width: 0; }
.heroine-dreams { --reel-accent: #c895f1; }
.story-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; }
.story-heading h2 { flex: 1; min-width: 0; }
.story-heading > h2 { margin-bottom: 0; }
.story-groups { display: flex; flex: none; gap: 3px; }
.story-groups button {
  min-height: 25px;
  padding: 3px 10px;
  border-bottom: 1px solid #966b818c;
  background: #231424c2;
  color: #e6cbd3;
  font-size: .75rem;
  font-weight: 650;
}
.story-groups button:hover, .story-groups [aria-pressed=true] {
  border-color: var(--reel-accent);
  background: #63233dcc;
  color: #fff0d5;
}
.heroine-section h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  color: #fae5c5;
  font: 850 italic clamp(18px, 1.75vw, 26px)/1.1 var(--display);
}
.heroine-section h2::before {
  content: "";
  width: 4px;
  height: 12px;
  margin-left: 2px;
  background: var(--reel-accent);
  transform: skewX(-25deg);
}
.heroine-section h2::after {
  content: "";
  flex: 1;
  height: 1px;
  margin-left: 5px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--reel-accent) 70%, transparent), transparent 92%);
}
.heroine-section-name {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  white-space: nowrap;
  clip-path: inset(50%);
}
.heroine-reel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(7px, 1.05vw, 15px); }
.heroine-reel .clip-card {
  position: relative;
  isolation: isolate;
  display: block;
  border: 0;
  height: auto;
  background: transparent;
}
.heroine-reel .clip-art {
  aspect-ratio: 16 / 9;
  max-height: 19svh;
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 0 100%);
}
.heroine-reel .clip-art img { object-position: 50% 48%; }
.heroine-reel .clip-art::after { background: linear-gradient(0deg, #140a19f9 2%, #140a19a3 23%, transparent 59%); }
.heroine-reel .clip-card::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--reel-accent), #ffcad32a 100%);
}
.heroine-reel .clip-card:hover::after { background: var(--reel-accent); }
.heroine-reel .clip-play {
  top: 7px;
  right: 7px;
  bottom: auto;
  width: clamp(22px, 2.13vw, 31px);
  border-color: #f8ecc688;
  background: #200e1cb5;
  color: #fff0d7;
}
.heroine-reel .clip-card:hover .clip-play { border-color: #ffe5d0; background: #8f2047; }
.heroine-reel .clip-label { position: absolute; bottom: 2px; left: 0; z-index: 2; padding: 6px 7px; }
.heroine-reel .clip-name { color: #fff2d7; text-shadow: 0 1px 4px #170510; }
.heroine-reel .clip-runtime { color: #f0d6cc; }

.heroine-aside {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(10px, 1.95vw, 29px);
  padding: 10px 2px 1px;
  border-top: 1px solid #bb8da850;
}
.cast-label {
  color: #e6c4d1;
  font: 690 clamp(.7rem, .88vw, .86rem)/1.2 var(--sans);
  letter-spacing: .065em;
}
.heroine-cast {
  --cast-columns: 10;
  display: grid;
  grid-template-columns: repeat(var(--cast-columns), minmax(0, 1fr));
  gap: clamp(4px, .8vw, 11px);
  align-content: start;
  min-width: 0;
  padding: 2px;
}
.heroine-chip {
  isolation: isolate;
  position: relative;
  display: grid;
  justify-items: center;
  min-width: 0;
  gap: 3px;
  padding: 4px 2px 5px;
  color: #dfc7d3;
  font: 680 clamp(.67rem, .88vw, .86rem)/1.14 var(--sans);
  text-align: center;
}
.heroine-chip img {
  display: block;
  width: min(100%, 70px);
  height: clamp(32px, 3.25vw, 48px);
  object-fit: cover;
  object-position: center 41%;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%);
  background: #251724;
}
.heroine-chip-name { align-content: center; min-height: 19px; overflow-wrap: anywhere; }
.heroine-chip:not([aria-pressed=true]):not(:hover) img { filter: brightness(.8) saturate(.83); }
.heroine-chip:hover { color: #fff0d3; background: #60274041; }
.heroine-chip[aria-pressed=true] { color: #fff0cf; }
.heroine-chip[aria-pressed=true]::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
  background: linear-gradient(110deg, #67203d9e, #5b1b3435);
  border-bottom: 2px solid var(--hero-red);
}
.heroine-chip:focus-visible { outline-offset: -1px; }
body[data-view=heroines] footer { border-top-color: #a5849861; }

.workspace { min-height: 0; min-width: 0; display: grid; grid-template-columns: minmax(365px, 0.86fr) minmax(0, 1.23fr); gap: clamp(10px, 1.25vw, 22px); }
.stage, .screen { min-height: 0; min-width: 0; display: grid; border: 1px solid var(--line); }
.stage {
  grid-template-rows: minmax(0, 1fr) auto;
  background: linear-gradient(145deg, #1a101af8, #170f1af2);
  border-left: 2px solid #b72d51;
}
.screen {
  grid-template-rows: auto minmax(0, 1fr);
  background: linear-gradient(145deg, #221421fa, #100b16f5);
  border-top-color: #c981a298;
}
.stage-body, .screen-body {
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #79495f #211321;
}
.stage-body { padding: clamp(12px, 1.45vw, 22px); }
.stage-body h2, .screen-toolbar h2 {
  font: bold clamp(23px, 2.3vw, 36px)/1.08 var(--display);
  letter-spacing: -.025em;
}
.stage-body h2 { margin-bottom: 7px; }
.stage-intro, .note, .node { color: var(--muted); line-height: 1.45; }
.stage-intro { margin-bottom: 13px; font-size: .87rem; }
.note { margin-top: 7px; font-size: .86rem; }
.stage-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 39px;
  padding: 5px clamp(12px, 1.45vw, 22px);
  border-top: 1px solid var(--line);
}
.stage-actions #next-stage { margin-left: auto; }
.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 27px;
  font-size: .86rem;
  line-height: 1.24;
  font-weight: 630;
}
.link:hover:not(:disabled) { color: var(--rose); text-decoration: underline; text-underline-offset: 4px; }

.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  text-align: left;
  padding: 7px 10px;
  border: 1px solid #93677d68;
  background: #2b1929;
}
.choice:hover { border-color: #e798afac; background: #392039; }
.choice[aria-pressed=true] {
  border-color: var(--red);
  box-shadow: inset 3px 0 var(--red);
  background: linear-gradient(115deg, #602038, #3b182e);
}
.choice-title { font-weight: 730; font-size: clamp(.87rem, 1.07vw, 1.02rem); overflow-wrap: anywhere; }
.choice-detail { color: #f1c8bf; font-size: .76rem; font-weight: 600; }

.route-fork {
  --branch: #a86a8a;
  position: relative;
  margin: 0 min(1.1vw, 15px);
  padding-block: 20px 19px;
}
.route-fork::before, .route-fork::after {
  position: absolute;
  left: 50%;
  width: 1px;
  height: 9px;
  background: var(--branch);
  content: "";
}
.route-fork::before { top: 0; }
.route-fork::after { bottom: 0; }
.route-split { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.route-split::before, .route-split::after {
  content: "";
  position: absolute;
  left: 25%;
  right: 25%;
  height: 11px;
  border: 1px solid var(--branch);
  pointer-events: none;
}
.route-split::before { top: -11px; border-bottom: 0; border-radius: 4px 4px 0 0; }
.route-split::after { bottom: -11px; border-top: 0; border-radius: 0 0 4px 4px; }
.route-outcome {
  --node-accent: var(--green);
  --node-line: #6eab9975;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 9px 10px;
  min-width: 0;
  min-height: 112px;
  position: relative;
  z-index: 1;
  border: 1px solid var(--node-line);
  background: linear-gradient(153deg, #263730, #231820 66%);
  text-align: left;
}
.route-outcome[data-outcome=fail] {
  --node-accent: #ffc3bb;
  --node-line: #d5848c7d;
  background: linear-gradient(153deg, #48252e, #281723 66%);
}
.route-outcome:is(:hover, [aria-pressed=true]) { border-color: var(--node-accent); }
.route-outcome[aria-pressed=true] { box-shadow: inset 0 2px var(--node-accent); }
.route-outcome-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 3px 6px; width: 100%; line-height: 1.1; }
.route-outcome-head strong { color: var(--node-accent); font-size: .97rem; }
.route-outcome-head span { color: #e8d0d4; font: 600 .72rem/1.15 var(--sans); }
.route-outcome-copy { color: #f9e9dc; font-size: .8rem; line-height: 1.5; }
.route-effect { margin-top: auto; color: var(--node-accent); font-size: .74rem; font-weight: 700; }
.route-junction {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  min-height: 34px;
  padding: 5px 12px;
  background: #322034;
  border: 1px solid #94718cba;
  font-size: .84rem;
  font-weight: 670;
}
.route-junction:hover { background: #52314c; border-color: #dbabc9; }
.outcome + .route-junction { margin: 13px auto 0; }
.preparation {
  margin-top: 13px;
  padding: 8px 10px;
  border-left: 2px solid #d58a6a;
  background: #382329;
  color: #ebd4c9;
  font-size: .82rem;
  line-height: 1.45;
}
.preparation .charm-link { margin-top: 1px; color: #ffceae; }
.route-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px 12px; align-items: start; margin-top: 8px; }
.play-shortcut { color: #f5c9de; margin-top: 3px; }
.route-tools .node { margin-top: 8px; }
.node { font-size: .76rem; margin-top: 8px; }
.node p { margin-top: 4px; overflow-wrap: anywhere; }
.node summary::before { content: "›"; color: var(--rose); font-weight: bold; margin-right: 6px; }
.node[open] summary::before { content: "⌄"; }
.outcome { margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--line); }
.outcome-summary { color: #fff0db; font-size: .94rem; line-height: 1.48; }
.effects { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0; }
.effect { padding: 3px 7px; color: #ffe4bd; border: 1px solid #bb735398; background: #3a1e23; font-size: .8rem; }
.effect.loss { background: #441628; border-color: #a9445e; }

.screen-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 7px clamp(10px, 1vw, 16px);
  border-bottom: 1px solid var(--line);
}
.screen-toolbar h2 { font-size: clamp(19px, 1.6vw, 28px); }
.segmented, .outcome-switch { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.segmented button, .outcome-switch button, .mobile-panes button {
  min-height: 31px;
  padding: 4px 10px;
  font: 630 .8rem/1.15 var(--sans);
  border: 1px solid #94718c71;
  color: var(--muted);
  background: #271826;
}
.segmented button:hover, .outcome-switch button:hover, .mobile-panes button:hover { color: var(--ivory); border-color: #be88a3; }
.segmented [aria-pressed=true], .outcome-switch [aria-pressed=true], .mobile-panes [aria-pressed=true] {
  color: var(--ivory);
  border-color: #d68aa3b3;
  background: #58223a;
}
.screen-body { padding: clamp(8px, 1vw, 15px); }
.context-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.05fr) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.side-deck { display: grid; grid-template-rows: repeat(2, auto); gap: 8px; }
.side-deck .clip-art { aspect-ratio: 1.93; }
.clip-deck { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.clip-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0;
  background: #2a1929;
  border: 1px solid #926c8665;
}
.clip-card:hover { border-color: #e49bb2; background: #3d2035; }
.clip-feature { width: 100%; border-top-color: #d092a5c5; }
.clip-art {
  display: block;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #140c18;
}
.clip-feature .clip-art { flex: 1; min-height: 160px; aspect-ratio: auto; }
.clip-feature .clip-art img { position: absolute; inset: 0; }
.clip-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; }
.clip-art::after {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 0;
  background: linear-gradient(170deg, #10061162, transparent 37%, transparent 72%, #14091943);
}
.clip-kind {
  position: absolute;
  z-index: 1;
  top: 5px;
  left: 5px;
  max-width: calc(100% - 10px);
  padding: 3px 5px;
  background: #1b101ce5;
  border-left: 2px solid #da9d83;
  color: #fde6d5;
  font: 620 clamp(.58rem, .77vw, .74rem)/1.14 var(--sans);
}
.kind-dream, .kind-cast { border-left-color: #d29dea; }
.kind-highlight { border-left-color: var(--red); }
.clip-feature .clip-kind { top: 10px; left: 10px; padding: 4px 7px; }
.clip-play {
  position: absolute;
  z-index: 1;
  bottom: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  width: clamp(23px, 2.25vw, 34px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #f6dbd8cd;
  background: #221223d9;
  color: #ffefe1;
  font-size: .69rem;
}
.clip-feature .clip-play { bottom: 13px; right: 13px; width: clamp(38px, 5vw, 58px); font-size: 1.12rem; }
.clip-card:hover .clip-play { background: #9a274d; }
.clip-label { display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 5px; padding: 7px; }
.clip-name { font-size: clamp(.71rem, .93vw, .94rem); line-height: 1.3; overflow-wrap: anywhere; }
.clip-runtime { flex: none; color: #debbc9; font-size: clamp(.67rem, .82vw, .85rem); font-variant-numeric: tabular-nums; }
.clip-feature .clip-label { padding: 8px 11px; }
.clip-feature .clip-name { font-size: clamp(.94rem, 1.33vw, 1.3rem); }
.story-library-link { margin-bottom: 9px; color: #ffd5de; }
.collection-grid h3 { padding: 8px 0 6px; color: #f5d5ca; font-size: .91rem; }
.collection-grid h3:not(:first-child) { margin-top: 11px; border-top: 1px solid var(--line); }
.collection-grid .clip-deck { gap: 8px; }

.charm-link { color: #ffcdb6; text-decoration: underline; text-underline-offset: 3px; }
.charm-switch { margin-bottom: 10px; }
.charm-targets { margin-bottom: 8px; }
.charm-total { display: flex; flex-wrap: wrap; gap: 5px 15px; align-items: baseline; padding: 7px 0; border-block: 1px solid var(--line); }
.charm-total strong { font-size: 1.07em; }
.charm-total span, .charm-source { color: var(--muted); font-size: .79rem; }
.charm-gains { display: flex; flex-wrap: wrap; gap: 5px; padding: 0; margin: 10px 0; list-style: none; }
.charm-gains li { padding: 3px 6px; background: #321d2d; border: 1px solid var(--line); font-size: .8rem; }
.charm-steps, .charm-stock { padding-left: 1.5em; margin: 8px 0; font-size: .85rem; line-height: 1.45; }
.charm-steps li { margin: 6px 0; }
.charm-tray { border-left: 2px solid var(--red); padding-left: 8px; }
.charm-place { color: var(--muted); border-bottom: 1px solid var(--line); }
.charm-place summary { color: var(--ivory); font-weight: 700; padding: 9px 0; }
.charm-place summary::before { content: "＋"; color: var(--red); margin-right: 6px; }
.charm-place[open] summary::before { content: "−"; }
.charm-place p { margin: 0 0 9px; line-height: 1.45; font-size: .88rem; }
.charm-gear-list { list-style: none; padding: 0; margin: 8px 0; }
.charm-gear-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 3px 7px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .87rem; }
.charm-gear-list span, .charm-gear-list p { color: var(--muted); font-size: .79rem; }
.charm-gear-list p { grid-column: 1 / -1; }
.charm-stock { columns: 2; column-gap: 20px; }
.charm-stock li { break-inside: avoid; margin-bottom: 5px; }
.stage-body > .charm-link { margin: 5px 0; }

footer { min-width: 0; display: flex; justify-content: flex-end; align-items: center; border-top: 1px solid #b986a070; color: #f0d0d9; }
.language { position: relative; z-index: 5; }
.language-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 9px;
  border: 1px solid #a0799270;
  background: #241526db;
  color: #f4d9df;
  font: 650 .8rem/1.2 var(--sans);
  white-space: nowrap;
}
.language-trigger:hover, .language[open] .language-trigger { border-color: #d690b1; background: #47223c; }
.language-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: max-content;
  min-width: 135px;
  padding: 4px;
  background: #2b182b;
  border: 1px solid #a6748f;
}
.language-options button { width: 100%; display: block; text-align: left; padding: 7px 8px; }
.language-options [aria-pressed=true], .language-options button:hover { background: #672646; }
.role-guide-title {
  width: fit-content;
  margin: clamp(12px, 2.4svh, 25px) 0 4px;
  font: 900 italic clamp(30px, 4vw, 65px)/1.03 var(--display);
  letter-spacing: -.045em;
  text-shadow: 0 2px 20px #100613;
}
.role-guide-content {
  display: grid;
  grid-template-columns: minmax(180px, 245px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(14px, 2vw, 30px);
  min-height: 0;
  width: min(100%, 1095px);
}
.role-route-steps, .role-route-detail {
  max-height: 100%;
  min-width: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #79495f transparent;
}
.role-route-steps {
  display: grid;
  gap: 5px;
  padding: 2px 4px 5px 13px;
}
.role-step {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 51px;
  padding: 7px 9px 7px 12px;
  border-left: 1px solid #a2769082;
  background: #231726df;
  color: #ffe8ce;
  text-align: left;
}
.role-step::before {
  position: absolute;
  top: calc(50% - 3px);
  left: -4px;
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: #b8869a;
  content: "";
}
.role-step[aria-current=step] { border-color: #ff5474; background: linear-gradient(90deg, #822744, #321c30); }
.role-step[aria-current=step]::before { background: #ff7590; box-shadow: 0 0 8px #ff507eaa; }
.role-step:hover { background-color: #462639; }
.role-step strong { font-size: .92rem; }
.role-step span { color: #e3c4ce; font-size: .72rem; }
.role-route-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(12px, 2vw, 24px);
  border: 1px solid #a77a9377;
  border-top: 2px solid #e56683;
  padding: clamp(13px, 2.1vw, 29px);
  background: linear-gradient(155deg, #261827f5, #170f1ce8);
}
.role-route-detail:has(.clip-card) { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.role-route-copy h2 { margin: 3px 0 14px; font: 800 clamp(22px, 2.5vw, 39px)/1.15 var(--display); }
.role-route-time { color: #ffb8c5; font-size: .82rem; font-weight: 680; }
.role-route-copy dl { margin: 0; }
.role-route-copy dt { margin-top: 10px; color: #f3bbc6; font-size: .76rem; font-weight: 700; }
.role-route-copy dd { margin: 2px 0 0; color: #f6e3d9; font-size: .92rem; line-height: 1.55; }
.role-route-detail .clip-card { align-self: center; }
.role-route-detail .clip-art { aspect-ratio: 16 / 9; }
.pause-icon { flex: none; width: 9px; height: 11px; border-inline: 2px solid currentColor; }
.is-paused .pause-icon { width: 0; height: 0; border: 0; border-block: 5px solid transparent; border-left: 8px solid currentColor; }

dialog {
  width: min(1050px, calc(100% - 22px));
  max-height: calc(100% - 20px);
  padding: clamp(11px, 1.6vw, 21px);
  color: var(--ivory);
  background: #1c111f;
  border: 1px solid #a66e8a;
  border-top: 3px solid var(--red);
}
dialog::backdrop { background: #0a050ceb; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 11px; margin-bottom: 9px; }
.dialog-head h2 { font: bold clamp(20px, 2.7vw, 33px)/1.14 var(--display); }
.clip-kicker, .media-note { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.clip-kicker { margin-bottom: 4px; color: #efb4c7; }
.close { flex: none; height: 36px; width: 36px; border: 1px solid #885f77; font: 26px/1 var(--sans); }
.close:hover { background: #782b4a; }
#player { background: #08050b; }
#player video { width: 100%; max-height: 68svh; aspect-ratio: 16 / 9; display: block; object-fit: contain; }
#player video::cue { color: #fff4e4; background-color: #160a18ce; }
.media-note:empty { display: none; }
#clip-status { margin-top: 5px; }
.player-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
#caption-toggle { padding: 3px 8px; background: #372036; border: 1px solid #885f777f; }
#caption-toggle[aria-pressed=true] { color: #ffcfdd; border-color: #b47794; }
.player-queue { display: flex; align-items: center; gap: 8px; margin-left: auto; }
#queue-position { color: var(--muted); font-size: .76rem; font-variant-numeric: tabular-nums; }

@media (max-height: 765px) {
  .app-frame { --page-gap: 9px; padding-top: 13px; }
  .title h1 { font-size: clamp(39px, 4.55vw, 76px); }
  .phase { min-height: 36px; }
  .side-deck .clip-art { aspect-ratio: 2.14; }
  .clip-deck .clip-art { aspect-ratio: 1.94; }
  .stage-body { padding-block: 13px; }
}
@media (max-height: 765px) and (min-width: 771px) {
  .heroine-stage { padding-top: clamp(8px, 2svh, 18px); }
  .heroine-reel .clip-art { max-height: 18svh; }
}
@media (max-width: 770px) {
  .app-frame { --page-gap: 7px; padding: 12px 10px 7px; }
  .shell { grid-template-rows: auto auto auto minmax(0, 1fr); }
  .brand { display: none; }
  .intro { gap: 8px; }
  .chapter-heading { min-height: 57px; }
  .context { font-size: .7rem; }
  .title h1 { font-size: clamp(32px, 8.55vw, 55px); }
  html[lang=en] .title h1 { font-size: clamp(23px, 6.5vw, 48px); }
  .dream-teaser { width: clamp(108px, 34vw, 195px); min-height: 55px; gap: 4px; padding: 6px 7px; }
  .dream-teaser strong { font-size: 17px; }
  .dream-teaser > span span { font-size: .64rem; }
  .teaser-play { width: 22px; font-size: .55rem; }
  .phases { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .phase { min-height: 32px; }
  .phase:nth-child(3)::after { display: none; }
  .mobile-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .workspace { grid-template-columns: 1fr; gap: 0; }
  .workspace[data-mobile-pane=route] #screen-panel, .workspace[data-mobile-pane=clips] #route-panel { display: none; }
  .stage-body { padding: 12px; }
  .stage-intro { font-size: .8rem; }
  .route-outcome { padding-inline: 8px; }
  .clip-deck { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .context-grid { display: block; }
  .side-deck { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; gap: 6px; margin-top: 6px; }
  .clip-feature .clip-art { flex: none; aspect-ratio: 16 / 9; min-height: 0; max-height: 38svh; }
  .clip-art img { object-position: center; }
  .entry-link { font-size: .72rem; padding: 5px 7px; }
  .heroine-backdrop {
    inset: clamp(140px, 25svh, 250px) 0 13svh 12vw;
    background-position: 75% 34%;
    mask-image: linear-gradient(90deg, transparent, #000a 15%, #000 39%);
  }
  .heroine-backdrop video { object-position: 75% 34%; }
  .heroine-backdrop::after {
    background: linear-gradient(90deg, #100716b5, #11091823 92%),
      linear-gradient(0deg, #0d0710 1%, #0d0710f3 17%, #0d07104d 48%, #0d071037 71%, #0d0710 100%);
  }
  .heroine-shell { gap: 11px; }
  .heroine-aside { grid-template-columns: 1fr; gap: 3px; padding-top: 5px; }
  .heroine-masthead { align-items: center; gap: 12px; padding-left: 3px; }
  .heroine-mark { font-size: 25px; }
  .heroine-mark small { display: none; }
  .cast-label { font-size: .68rem; letter-spacing: .06em; }
  .heroine-cast {
    --cast-columns: 5;
    gap: 3px 4px;
    padding: 1px 1px 2px;
  }
  .heroine-chip { font-size: clamp(.59rem, 2.65vw, .73rem); gap: 2px; padding: 2px 1px 3px; }
  .heroine-chip img { height: clamp(24px, 8vw, 36px); width: min(100%, 59px); }
  .heroine-chip-name { min-height: 15px; }
  .heroine-stage { width: 100%; gap: 8px; padding-top: 2px; }
  .heroine-stage:has(.heroine-mobile-tabs:not([hidden])) { grid-template-rows: auto auto minmax(0, 1fr); }
  .heroine-hero { padding: 5px 2px 3px; }
  .heroine-lockup { gap: 4px 13px; }
  .heroine-hero h1 { font-size: clamp(30px, 10.2vw, 57px); }
  html[lang=en] .heroine-shell:not([data-current-role=victoria]) .heroine-hero h1 { font-size: clamp(27px, 8vw, 48px); }
  .heroine-hero h1::after { width: clamp(29px, 8vw, 67px); height: 3px; }
  .heroine-actions { gap: 4px 9px; }
  .heroine-primary { min-height: 31px; padding: 5px 11px 5px 8px; font-size: .76rem; }
  .heroine-guide-link { min-height: 30px; font-size: .72rem; margin: 0; }
  .language-trigger { min-height: 30px; padding-inline: 6px; font-size: .73rem; }
  .heroine-mobile-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .heroine-mobile-tabs button {
    min-height: 32px;
    padding: 4px 8px;
    border-bottom: 1px solid #b58b9e6b;
    color: #dcbfce;
    background: #261421ad;
    font-size: .8rem;
    font-weight: 640;
  }
  .heroine-mobile-tabs [aria-pressed=true] { color: var(--ivory); border-color: #ff6a86; background: linear-gradient(90deg, #7e233c, #3c1835); }
  .heroine-mobile-tabs [data-genre=dream][aria-pressed=true] { border-color: #d4a2ff; background: linear-gradient(90deg, #57365f, #2d1c41); }
  .heroine-content { gap: 0; }
  .heroine-content[data-genre=story] .heroine-dreams, .heroine-content[data-genre=dream] .heroine-story { display: none; }
  .heroine-section h2 { position: absolute; overflow: hidden; width: 1px; height: 1px; clip-path: inset(50%); }
  .story-heading { justify-content: flex-end; margin-bottom: 5px; }
  .story-heading:has(.story-groups[hidden]) { margin-bottom: 0; }
  .story-groups { max-width: 100%; flex-wrap: wrap; justify-content: flex-end; }
  .story-groups button { min-height: 28px; padding-inline: 6px; }
  .heroine-reel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heroine-reel .clip-art { max-height: none; }
  .heroine-reel .clip-label { padding: 4px 5px; }
  .role-guide-title { margin-top: 8px; }
  .role-guide-content { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 7px; }
  .role-route-steps { display: flex; padding: 4px 3px; overscroll-behavior-inline: contain; }
  .role-step { flex: 0 0 clamp(118px, 44vw, 165px); }
  .role-route-detail { align-content: start; }
  .role-route-detail:has(.clip-card) { grid-template-columns: minmax(0, 1fr); }
  .role-route-detail .clip-card { width: min(100%, 310px); }
}
@media (min-width: 550px) and (max-width: 770px) {
  .heroine-reel { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 505px) {
  .guide-access .dream-teaser { display: none; }
}
@media (max-width: 370px) {
  .charm-stock { columns: 1; }
  .charm-gear-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .charm-gear-list span:last-of-type { grid-column: 2; }
}
@media (prefers-reduced-motion: no-preference) {
  .clip-art img { transition: transform .22s ease; }
  .clip-card:hover img { transform: scale(1.025); }
}

.context-grid:has(> .clip-feature:only-child) { grid-template-columns: minmax(0, 1fr); }
