@charset "UTF-8";
:root {
  --text-size: 22px;
  color-scheme: dark;
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: var(--paper);
  background: var(--ink);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  border: var(--border-button-border);
  background: var(--surface-button-background);
  padding: 12px 18px;
  transition:
    background 0.2s,
    border 0.2s,
    transform 0.2s;
  text-align: left;
}
button:hover {
  background: var(--surface-button-hover-background);
  border-color: var(--border-button-hover-border-color);
}
button:active {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 5px;
}
button.primary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
  font-weight: 600;
  padding: 16px 24px;
}
button.primary:hover {
  background: var(--surface-button-primary-hover-background);
}
button.quiet {
  background: none;
  border-color: transparent;
  padding: 8px 10px;
  color: var(--salt);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2 {
  font-family: "STSong", "SimSun", "Noto Serif CJK SC", serif;
  font-weight: 400;
}
h2 {
  font-size: 36px;
  letter-spacing: 0.12em;
  margin: 12px 0 24px;
}
h3 {
  font-size: 18px;
  font-weight: 500;
}
p {
  line-height: 1.85;
}
small {
  font-size: 12px;
  line-height: 1.6;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--brass);
  text-transform: uppercase;
}
.muted {
  font-size: 13px;
  color: var(--salt);
  line-height: 1.85;
}
.title-screen,
.story-screen,
.ending-screen {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}
.backdrop {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: var(--ink);
  animation: backgroundIn 0.7s ease;
}
.backdrop > svg {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}
.scene-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--surface-scene-shade-background);
}
.title-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 34px 5vw;
  font-family: serif;
  font-size: 15px;
  letter-spacing: 0.2em;
  line-height: 1.8;
  color: var(--mist);
}
.brand-mark {
  font-size: 58px;
  color: var(--brass);
  line-height: 1;
}
.title-header small {
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 0.17em;
}
.edition {
  margin-left: auto;
  font-family: monospace;
  font-size: 10px;
  line-height: 1.9;
  letter-spacing: 0.15em;
  text-align: right;
}
.title-main {
  margin: 3vh 0 90px 9vw;
  position: relative;
  max-width: 450px;
}
.title-main h1 {
  font-size: clamp(64px, 6.5vw, 110px);
  line-height: 1.15;
  margin: 18px 0 14px;
  letter-spacing: 0.12em;
  text-shadow: var(--shadow-title-main-h1-text-shadow);
}
.title-main h1 span {
  display: block;
  margin-left: 0.55em;
}
.title-english {
  font-family: Georgia, serif;
  font-size: 13px;
  letter-spacing: 0.38em;
  color: var(--brass);
  margin: 22px 0;
}
.title-copy {
  font-family: "STSong", "SimSun", serif;
  font-size: 17px;
  line-height: 1.85;
  letter-spacing: 0.16em;
  color: var(--mist);
  margin-bottom: 26px;
}
.title-nav {
  width: 335px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.title-nav > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-color: var(--border-title-nav-button-border-color);
  background: var(--surface-title-nav-button-background);
  padding: 13px 19px;
  font-size: 14px;
  letter-spacing: 0.1em;
}
.title-nav > button.primary {
  padding: 17px 19px;
  background: var(--paper);
}
.title-nav button span {
  font-family: monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
}
.minor-nav {
  display: flex;
  gap: 24px;
  margin-top: 10px;
}
.minor-nav button {
  border: none;
  background: none;
  padding: 9px 0;
  color: var(--salt);
  font-size: 13px;
}
.title-decoration {
  position: absolute;
  right: 12%;
  top: 23%;
  width: min(31vw, 430px);
  text-align: center;
  color: var(--text-title-decoration-color);
}
.title-decoration svg {
  width: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}
.title-decoration svg text {
  font-family: Georgia, serif;
  fill: currentColor;
  stroke: none;
  font-size: 20px;
  letter-spacing: 4px;
  text-anchor: middle;
}
.title-decoration p {
  font-family: "SimSun", serif;
  font-size: 13px;
  letter-spacing: 0.3em;
  margin-top: 20px;
}
.title-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: var(--border-title-footer-border-top);
  display: flex;
  justify-content: space-between;
  padding: 22px 5vw;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--salt);
}
.story-screen {
  height: 100svh;
  min-height: 660px;
  display: flex;
  flex-direction: column;
}
.story-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 3vw;
  border-bottom: var(--border-story-header-border-bottom);
  background: var(--surface-story-header-background);
}
.story-header button {
  padding: 6px 12px;
  border: 0;
  background: transparent;
  font-size: 12px;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--brass);
  font-size: 27px !important;
}
.wordmark span {
  font-family: "SimSun", serif;
  font-size: 19px;
  letter-spacing: 0.14em;
}
.chapter-label {
  font-size: 12px;
  letter-spacing: 0.13em;
  color: var(--mist);
}
.scene-caption {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: absolute;
  top: 115px;
  left: 5vw;
  color: var(--text-scene-caption-color);
  font-size: 11px;
  letter-spacing: 0.1em;
}
.scene-caption .eyebrow {
  color: var(--text-scene-caption-eyebrow-color);
}
#scene-content {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 20px 5vw;
}
.character-stage {
  position: absolute;
  right: 12vw;
  bottom: 180px;
  width: 310px;
  animation: personIn 0.55s ease;
  pointer-events: none;
}
.portrait {
  display: block;
  width: 100%;
  height: auto;
  filter: var(--filter-portrait-filter);
}
.character-label {
  text-align: center;
  letter-spacing: 0.3em;
  font-size: 10px;
  color: var(--mist);
  margin-top: -10px;
}
.dialogue-panel {
  align-self: flex-end;
  position: relative;
  width: min(1140px, 100%);
  min-height: 225px;
  padding: 26px 38px 20px;
  background: var(--surface-dialogue-panel-background);
  border: var(--border-dialogue-panel-border);
  box-shadow: var(--shadow-dialogue-panel-box-shadow);
  cursor: pointer;
  z-index: 2;
  outline: 0;
}
.dialogue-panel:before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 75px;
  height: 3px;
  background: var(--brass);
}
.speaker-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 17px;
}
.speaker-name {
  font-family: "SimSun", serif;
  font-size: 23px;
  letter-spacing: 0.15em;
  color: var(--brass);
}
.dialogue-counter {
  font-family: monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dialogue-counter-color);
}
.dialogue-text {
  font-family: "STSong", "SimSun", serif;
  font-size: var(--text-size);
  line-height: 1.85;
  letter-spacing: 0.035em;
  min-height: 80px;
  margin: 0 0 18px;
  white-space: pre-wrap;
}
.dialogue-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-dialogue-bottom-color);
}
.advance-hint {
  color: var(--brass);
}
.story-tools {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 12px 5vw 16px;
  justify-content: center;
  background: var(--surface-story-tools-background);
}
.story-tools button {
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 7px 12px;
  background: transparent;
  border-color: transparent;
  color: var(--mist);
}
.story-tools button[aria-pressed="true"] {
  color: var(--brass);
  border-color: var(--border-story-tools-button-aria-pressed-true-border-color);
}
.key-hint {
  font-size: 10px;
  color: var(--text-key-hint-color);
  margin-left: 20px;
}
.choice-panel {
  width: min(730px, 100%);
  margin: 15px 0;
  padding: 32px;
  background: var(--surface-choice-panel-background);
  border: var(--border-choice-panel-border);
  box-shadow: var(--shadow-choice-panel-box-shadow);
  animation: personIn 0.4s ease;
}
.choice-panel h2 {
  font-size: 29px;
  line-height: 1.6;
  letter-spacing: 0.08em;
  margin-bottom: 25px;
}
.story-choice {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 19px 20px;
  margin: 10px 0;
  background: var(--surface-story-choice-background);
  border-color: var(--border-story-choice-border-color);
}
.story-choice strong {
  display: block;
  font-family: "SimSun", serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.05em;
}
.story-choice small {
  display: block;
  color: var(--salt);
  margin-top: 7px;
}
.choice-symbol {
  font-size: 25px;
  color: var(--brass);
}
.choice-arrow {
  margin-left: auto;
  font-size: 20px;
  color: var(--brass);
}
.game-shell {
  width: min(1080px, 100%);
  max-height: 100%;
  overflow: auto;
  position: relative;
  background: var(--surface-game-shell-background);
  border: var(--border-game-shell-border);
  padding: 27px 32px;
  box-shadow: var(--shadow-game-shell-box-shadow);
  z-index: 3;
  scrollbar-color: var(--color-game-shell-scrollbar-color);
}
.game-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  border-bottom: var(--border-game-heading-border-bottom);
  padding-bottom: 12px;
}
.game-heading h2 {
  font-size: 30px;
  margin: 9px 0 7px;
}
.game-heading p {
  font-size: 12px;
  color: var(--salt);
  margin: 0;
}
.tag {
  border: var(--border-tag-border);
  padding: 7px 12px;
  font-size: 11px;
  color: var(--brass);
}
.instructions {
  font-size: 13px;
  color: var(--mist);
  margin: 15px 0;
}
.instructions strong {
  color: var(--brass);
  font-weight: 500;
}
.game-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  padding-top: 12px;
  border-top: var(--border-game-footer-border-top);
}
.game-message {
  font-size: 11px;
  color: var(--salt);
}
.game-footer button {
  font-size: 11px;
}
.game-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  margin-top: 18px;
}
.game-controls span {
  font-size: 12px;
  color: var(--salt);
  max-width: 65%;
}
.game-controls button {
  font-size: 13px;
  white-space: nowrap;
  padding: 12px 20px !important;
}
.logic-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.log-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  background: var(--surface-log-card-background);
  border: var(--border-log-card-border);
  cursor: grab;
}
.log-index {
  font-family: Georgia, serif;
  font-size: 29px;
  color: var(--brass);
}
.log-card h3 {
  font-family: "SimSun", serif;
  font-size: 19px;
  margin: 0 0 6px;
  color: var(--text-log-card-h3-color);
}
.log-card p {
  font-size: 13px;
  color: var(--salt);
  margin: 0;
}
.reorder {
  margin-left: auto;
  display: flex;
  gap: 5px;
}
.reorder button {
  padding: 7px 11px;
}
.power-meter {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--mist);
  margin: 24px 0;
}
.meter-track {
  height: 8px;
  background: var(--surface-meter-track-background);
  flex: 1;
}
.meter-track i {
  display: block;
  height: 100%;
  background: var(--brass);
  transition: width 0.2s;
}
.allocation-row {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 30px 60px;
  align-items: center;
  gap: 20px;
  padding: 20px 5px;
  border-bottom: var(--border-allocation-row-border-bottom);
}
.allocation-row strong {
  font-family: "SimSun", serif;
  font-weight: 400;
  font-size: 20px;
}
.allocation-row small {
  display: block;
  color: var(--salt);
  margin-top: 5px;
}
.allocation-row output {
  font-family: Georgia, serif;
  font-size: 24px;
  color: var(--brass);
}
.power-status {
  font-size: 11px;
  color: var(--mist);
}
input[type="range"] {
  accent-color: var(--brass);
  width: 100%;
  cursor: pointer;
}
.game-result {
  text-align: center;
  padding: 30px 20px;
  max-width: 650px;
  margin: auto;
}
.result-symbol {
  font-size: 58px;
  color: var(--brass);
  margin-bottom: 15px;
}
.game-result h3 {
  font-family: "SimSun", serif;
  font-size: 30px;
  font-weight: 400;
  margin: 15px 0;
}
.game-result p {
  font-size: 15px;
  color: var(--mist);
}
.game-result .result-state {
  font-size: 12px;
  color: var(--brass);
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--surface-modal-backdrop-background);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  animation: backgroundIn 0.15s ease;
}
.modal-panel {
  position: relative;
  background: var(--surface-modal-panel-background);
  border: var(--border-modal-panel-border);
  width: min(850px, 100%);
  max-height: 88svh;
  overflow: auto;
  box-shadow: var(--shadow-modal-panel-box-shadow);
  scrollbar-color: var(--color-modal-panel-scrollbar-color);
}
.modal-content {
  padding: 40px 44px;
}
.modal-close {
  position: sticky;
  top: 12px;
  float: right;
  right: 12px;
  margin: 12px 12px -55px 0;
  z-index: 2;
  border: none;
  background: var(--surface-modal-close-background);
  color: var(--brass);
  font-size: 25px;
  padding: 4px 12px;
}
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.menu-grid button {
  padding: 20px;
  font-family: "SimSun", serif;
  font-size: 22px;
  background: var(--surface-menu-grid-button-background);
}
.menu-grid small {
  display: block;
  color: var(--salt);
  font: 10px monospace;
  letter-spacing: 0.12em;
  margin-top: 8px;
}
.save-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 24px 0;
}
.save-slot {
  padding: 20px;
  background: var(--surface-save-slot-background);
  border: var(--border-save-slot-border);
}
.save-slot:first-child {
  grid-column: 1/-1;
  background: var(--surface-save-slot-first-child-background);
}
.save-slot h3 {
  font-family: "SimSun", serif;
  font-size: 19px;
  margin: 12px 0 10px;
}
.save-slot p {
  font-size: 12px;
  color: var(--salt);
  margin-bottom: 5px;
}
.save-slot small {
  color: var(--salt);
}
.save-slot > div {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.save-slot button {
  font-size: 12px;
  padding: 8px 14px;
}
.export-row {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 14px;
}
.export-row > button,
.file-label {
  font-size: 13px;
  padding: 12px 16px;
  border: var(--border-export-row-button-border);
  background: var(--surface-export-row-button-background);
}
.file-label {
  cursor: pointer;
}
.file-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin: 28px 0;
}
.settings-list label {
  font-size: 17px;
  color: var(--mist);
}
.settings-list output {
  float: right;
  font: 12px monospace;
  color: var(--brass);
}
.settings-list input[type="range"] {
  display: block;
  margin: 16px 0 0;
}
.settings-list small {
  display: block;
  font-size: 12px;
  color: var(--salt);
  margin-top: 8px;
}
.check-setting input {
  accent-color: var(--brass);
  margin-right: 10px;
  width: 17px;
  height: 17px;
}
.history-list {
  max-height: 60svh;
  overflow: auto;
  padding-right: 12px;
}
.history-list article {
  padding: 18px 0;
  border-bottom: var(--border-history-list-article-border-bottom);
}
.history-list article > span {
  color: var(--brass);
  font-size: 14px;
}
.history-list small {
  color: var(--salt);
  margin-left: 15px;
}
.history-list p {
  font-family: "SimSun", serif;
  font-size: 18px;
  line-height: 1.85;
  margin: 10px 0 0;
}
.state-row {
  display: flex;
  gap: 15px;
  margin: 22px 0 30px;
}
.state-row span {
  padding: 13px 20px;
  background: var(--surface-state-row-span-background);
  font-size: 13px;
  color: var(--mist);
}
.state-row b {
  color: var(--brass);
  margin-left: 20px;
  font-family: Georgia, serif;
  font-size: 20px;
}
.relation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}
.relation-grid > div {
  background: var(--surface-relation-grid-div-background);
  text-align: center;
  padding: 12px;
}
.relation-grid svg {
  height: 120px;
  object-fit: contain;
}
.relation-grid strong,
.relation-grid small {
  display: block;
  margin-top: 10px;
}
.relation-grid strong {
  font-family: "SimSun", serif;
  font-size: 19px;
  font-weight: 400;
}
.relation-grid small {
  color: var(--salt);
  margin-top: 5px;
}
.clue {
  padding: 15px 18px;
  background: var(--surface-clue-background);
  border-left: 2px solid var(--brass);
  margin-bottom: 10px;
}
.clue strong {
  font-weight: 400;
  font-size: 15px;
  color: var(--brass);
}
.clue p {
  font-size: 13px;
  color: var(--salt);
  margin: 8px 0 0;
}
.credits-intro {
  font-family: "SimSun", serif;
  font-size: 23px;
  color: var(--mist);
  margin: 30px 0;
}
.credits-list {
  font-size: 14px;
}
.credits-list dt {
  color: var(--brass);
  margin-top: 23px;
  font-size: 11px;
  letter-spacing: 0.1em;
}
.credits-list dd {
  margin: 8px 0;
  color: var(--mist);
  line-height: 1.9;
}
.ending-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 30px;
}
.ending-grid article {
  padding: 20px;
  border: var(--border-ending-grid-article-border);
  background: var(--surface-ending-grid-article-background);
  opacity: 0.65;
}
.ending-grid article.unlocked {
  opacity: 1;
  border-color: var(--border-ending-grid-article-unlocked-border-color);
}
.ending-grid h3 {
  font-family: "SimSun", serif;
  font-size: 22px;
  margin: 16px 0 12px;
  font-weight: 400;
}
.ending-grid p {
  font-size: 13px;
  color: var(--salt);
  margin: 0;
}
.ending-grid article:last-child {
  grid-column: 1/-1;
}
.ending-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 25px;
}
.ending-card {
  text-align: center;
  max-width: 850px;
  padding: 65px 55px;
  border: var(--border-ending-card-border);
  background: var(--surface-ending-card-background);
  box-shadow: var(--shadow-ending-card-box-shadow);
}
.ending-card h1 {
  font-size: clamp(35px, 4vw, 64px);
  letter-spacing: 0.15em;
  margin: 30px 0;
}
.ending-card p {
  font-family: "SimSun", serif;
  font-size: 19px;
  color: var(--mist);
}
.ending-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 11px;
  color: var(--brass);
  margin: 34px 0;
}
.ending-card > div:last-child {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.ending-card button {
  font-size: 13px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translate(-50%, 15px);
  background: var(--paper);
  color: var(--ink);
  padding: 14px 24px;
  z-index: 99;
  max-width: 90vw;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: var(--shadow-toast-box-shadow);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes personIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes backgroundIn {
  from {
    opacity: 0.3;
  }
  to {
    opacity: 1;
  }
}

.reduce-motion *,
.reduce-motion *:before,
.reduce-motion *:after {
  animation: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}
@media (min-width: 1500px) {
  .title-main {
    margin-top: 6vh;
  }
  .title-nav {
    width: 380px;
  }
  .title-nav > button {
    padding: 16px 22px;
  }
  .dialogue-panel {
    min-height: 245px;
  }
  .character-stage {
    width: 360px;
    bottom: 215px;
  }
}
@media (max-height: 780px) and (min-width: 801px) {
  .title-main {
    margin-top: 0;
  }
  .title-main h1 {
    font-size: 72px;
    line-height: 1.1;
  }
  .title-copy {
    font-size: 15px;
    margin-bottom: 18px;
  }
  .title-english {
    margin: 15px 0;
  }
  .title-header {
    padding: 22px 5vw;
  }
  .title-nav > button {
    padding: 10px 16px;
  }
  .title-nav > button.primary {
    padding: 14px 16px;
  }
  .game-shell {
    padding: 18px 25px;
  }
  .game-heading h2 {
    font-size: 26px;
  }
  .game-footer {
    margin-top: 12px;
  }
  .allocation-row {
    padding: 15px 5px;
  }
}
@media (max-width: 800px) {
  .title-header {
    padding: 25px;
  }
  .edition {
    font-size: 8px;
  }
  .title-main {
    margin: 25px 25px 110px;
    max-width: 400px;
  }
  .title-main h1 {
    font-size: 76px;
  }
  .title-main h1 span {
    display: inline;
    margin-left: 0;
  }
  .title-english {
    font-size: 10px;
  }
  .title-decoration {
    right: -80px;
    top: 165px;
    width: 310px;
    opacity: 0.25;
    z-index: -1;
  }
  .title-copy {
    font-size: 16px;
  }
  .title-footer {
    padding: 20px 25px;
    font-size: 10px;
    gap: 20px;
  }
  .title-footer span:last-child {
    display: none;
  }
  .title-nav {
    width: 310px;
  }
  .story-screen {
    height: 100svh;
    min-height: 620px;
  }
  .story-header {
    padding: 15px 12px;
    gap: 10px;
  }
  .wordmark span {
    font-size: 14px;
  }
  .chapter-label {
    font-size: 10px;
  }
  .story-header button {
    font-size: 10px;
    padding: 5px;
  }
  .scene-caption {
    top: 90px;
    left: 25px;
  }
  #scene-content {
    padding: 15px 20px;
  }
  .character-stage {
    right: 5vw;
    width: 250px;
    bottom: 200px;
  }
  .dialogue-panel {
    padding: 20px 24px;
    min-height: 230px;
  }
  .dialogue-text {
    font-size: calc(var(--text-size) - 2px);
    line-height: 1.8;
  }
  .speaker-name {
    font-size: 21px;
  }
  .story-tools {
    gap: 3px;
    padding: 8px 10px 15px;
    flex-wrap: wrap;
  }
  .story-tools button {
    padding: 6px 9px;
    font-size: 10px;
  }
  .key-hint {
    display: none;
  }
  .choice-panel {
    padding: 25px;
  }
  .choice-panel h2 {
    font-size: 25px;
  }
  .story-choice {
    padding: 16px;
    gap: 10px;
  }
  .story-choice strong {
    font-size: 17px;
  }
  .story-choice small {
    font-size: 11px;
  }
  .game-shell {
    padding: 20px;
    max-height: 100%;
    overflow: auto;
  }
  .game-heading h2 {
    font-size: 26px;
  }
  .game-heading p {
    font-size: 11px;
  }
  .game-controls {
    gap: 12px;
  }
  .game-controls span {
    font-size: 11px;
    max-width: 60%;
  }
  .game-footer {
    gap: 8px;
  }
  .game-footer > div {
    display: flex;
    flex-shrink: 0;
  }
  .game-footer button {
    padding: 5px 6px;
    font-size: 10px;
  }
  .game-message {
    font-size: 10px;
  }
  .allocation-row {
    grid-template-columns: 1fr 1fr 22px;
    gap: 12px;
    padding: 16px 0;
  }
  .allocation-row strong {
    font-size: 17px;
  }
  .allocation-row small {
    font-size: 10px;
  }
  .power-status {
    display: none;
  }
  .log-card {
    padding: 12px;
    gap: 12px;
  }
  .log-card p {
    font-size: 11px;
  }
  .log-card h3 {
    font-size: 17px;
  }
  .reorder {
    gap: 2px;
  }
  .reorder button {
    padding: 5px 8px;
  }
  .modal-backdrop {
    padding: 15px;
  }
  .modal-panel {
    max-height: 92svh;
  }
  .modal-content {
    padding: 35px 25px;
  }
  .menu-grid button {
    font-size: 19px;
    padding: 16px;
  }
  .save-slot {
    padding: 16px;
  }
  .save-slot h3 {
    font-size: 17px;
    line-height: 1.5;
  }
  .state-row {
    gap: 6px;
  }
  .state-row span {
    padding: 10px;
    font-size: 11px;
  }
  .state-row b {
    margin-left: 9px;
  }
  .relation-grid {
    gap: 8px;
  }
  .ending-card {
    padding: 40px 25px;
  }
  .ending-stats {
    gap: 12px;
    font-size: 10px;
  }
}
@media (max-width: 470px) {
  .title-main h1 {
    font-size: 64px;
  }
  .story-header .wordmark span {
    display: none;
  }
  .dialogue-panel {
    padding: 18px 20px;
    min-height: 250px;
  }
  .dialogue-text {
    font-size: calc(var(--text-size) - 3px);
  }
  .character-stage {
    width: 225px;
    bottom: 220px;
  }
  .game-shell {
    padding: 16px;
  }
  .game-heading h2 {
    font-size: 24px;
  }
  .game-heading {
    padding-bottom: 8px;
  }
  .instructions {
    font-size: 11px;
    margin: 12px 0;
  }
  .game-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .game-controls span {
    max-width: 100%;
  }
  .game-controls button {
    text-align: center;
  }
  .game-footer {
    align-items: flex-start;
  }
  .game-message {
    max-width: 50%;
  }
  .log-card {
    gap: 8px;
  }
  .log-index {
    font-size: 22px;
  }
  .log-card p {
    font-size: 10px;
  }
  .reorder {
    flex-direction: column;
  }
  .save-grid,
  .ending-grid {
    grid-template-columns: 1fr;
  }
  .save-slot:first-child,
  .ending-grid article:last-child {
    grid-column: auto;
  }
  .relation-grid svg {
    height: 95px;
  }
  .story-choice {
    padding: 13px;
  }
  .story-choice strong {
    font-size: 16px;
  }
  .choice-panel {
    padding: 20px;
  }
  .choice-panel h2 {
    font-size: 22px;
  }
  .dialogue-bottom {
    font-size: 9px;
  }
  .title-header {
    padding: 20px;
  }
  .brand-mark {
    font-size: 44px;
  }
}

/* File assets use the same scene/portrait placement as vector assets. */
.backdrop > img.vn-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.character-stage > img.vn-image {
  max-height: 58vh;
  object-fit: contain;
  object-position: bottom;
}
