/* 《晋阳劫：孤城弈》 styles.css
   P01/P02 CSS数值直移自 prototype-revision-p01-p02.html
   P03/P04 暂保持现有，后续重建 */

:root {
  color-scheme: dark;
  --paper: #eee2bf;
  --paper-bright: #f1dec1;
  --paper-muted: #9e8e6e;
  --paper-dim: rgba(232, 220, 196, 0.6);
  --gold: #d4a53e;
  --gold-dim: rgba(212, 165, 62, 0.6);
  --red: #ac2b17;
  --cinnabar: #a03828;
  --cinnabar-border: #c4503a;
  --cinnabar-bg: rgba(130, 40, 28, 0.85);
  --river-border: rgba(90, 130, 145, 0.6);
  --line: rgba(232, 220, 196, 0.18);
  --line-strong: rgba(232, 220, 196, 0.4);
  --ink-deep: #080706;
  --ink-panel: #13100d;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, SimSun, serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #050505;
  color: var(--paper);
  overflow-x: hidden;
  letter-spacing: 0;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  background: none;
}

#app { min-height: 100vh; }

.screen {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

/* ========== P01 首页（直移 prototype-revision-p01-p02.html） ========== */
.home {
  background: var(--ink-deep);
}

.home-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
}

.home-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(4, 6, 7, 0.98) 0%, rgba(6, 8, 9, 0.91) 25%, rgba(6, 8, 9, 0.42) 48%, rgba(6, 8, 9, 0.05) 72%),
    linear-gradient(0deg, rgba(2, 3, 3, 0.62) 0%, transparent 44%);
}

.home-content {
  position: absolute;
  z-index: 2;
  left: 96px;
  top: 71px;
  width: 670px;
}

.home-divider {
  width: 154px;
  height: 2px;
  margin-bottom: 17px;
  background: var(--red);
}

.home-kicker {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
}

.home-title {
  margin: 103px 0 20px;
  font-family: var(--serif);
  font-size: 72px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--paper-bright);
}

.home-subtitle {
  margin: 0;
  color: #d7cbb0;
  font-family: var(--serif);
  font-size: 23px;
}

.home-desc {
  margin: 46px 0 0;
  color: #b7ad98;
  font-family: var(--serif);
  font-size: 19px;
}

.home-buttons {
  display: flex;
  gap: 16px;
  margin-top: 79px;
}

/* P01 按钮：直移原型 .button / .button.primary / .button.secondary */
.btn-cinnabar {
  display: grid;
  place-items: center;
  height: 54px;
  padding: 0 28px;
  min-width: 166px;
  border: 1px solid #db7b39;
  color: #f1dec1;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  background: #8f2614;
  transition: background 200ms ease;
}
.btn-cinnabar:hover {
  background: #a03018;
}

.btn-outline {
  display: grid;
  place-items: center;
  height: 54px;
  padding: 0 28px;
  min-width: 198px;
  border: 1px solid #6f6656;
  color: #c9bea7;
  font-family: var(--serif);
  font-size: 18px;
  background: rgba(7, 8, 8, 0.55);
  transition: border-color 200ms ease, color 200ms ease;
}
.btn-outline:hover {
  border-color: var(--gold);
  color: var(--paper-bright);
}

.home-tip {
  margin-top: 28px;
  color: #8f887a;
  font-family: var(--serif);
  font-size: 14px;
}

.home-archive {
  position: absolute;
  z-index: 2;
  right: 185px;
  bottom: 48px;
  color: #958b78;
  font-family: var(--serif);
  font-size: 12px;
}

/* ========== P02 人物选择（直移 prototype-revision-p01-p02.html） ========== */
.roles-page {
  background: var(--ink-deep);
}

.roles-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
}

.roles-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(3, 4, 4, 0.79);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.roles-header {
  position: absolute;
  z-index: 2;
  left: 80px;
  top: 47px;
}

.roles-kicker {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
}

.roles-title {
  margin: 14px 0 1px;
  font-family: var(--serif);
  font-size: 43px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--paper);
}

.roles-subtitle {
  color: #afa58f;
  font-family: var(--serif);
  font-size: 17px;
}

.roles-grid {
  position: absolute;
  z-index: 2;
  left: 80px;
  top: 180px;
  display: grid;
  grid-template-columns: repeat(3, 396px);
  gap: 46px;
}

.role-card {
  position: relative;
  height: 544px;
  overflow: hidden;
  border: 1px solid #756b5c;
  background: #0b0c0c;
  cursor: pointer;
  transition: border-color 200ms ease;
}

.role-card.active {
  border: 2px solid #c43d26;
}

.role-card:hover {
  border-color: var(--gold);
}

.role-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.role-card.zhao img { object-position: 44% center; }
.role-card.qian img { object-position: 63% center; }
.role-card.sun img { object-position: 62% center; }

.role-card-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(0deg, rgba(3, 4, 4, 0.98) 0%, rgba(3, 4, 4, 0.90) 26%, rgba(3, 4, 4, 0.22) 62%, rgba(3, 4, 4, 0.03) 100%);
}

.role-card-text {
  position: absolute;
  z-index: 2;
  left: 24px;
  right: 20px;
  bottom: 22px;
  font-family: var(--serif);
  display: flex;
  flex-direction: column;
}

.role-tag {
  color: #c49a37;
  font-size: 15px;
  font-weight: 700;
}

.role-name {
  margin-top: 16px;
  font-size: 39px;
  line-height: 1.08;
  color: var(--paper);
  font-weight: 700;
}

.role-identity {
  margin-top: 11px;
  color: #c0b59e;
  font-size: 17px;
}

.role-theme {
  margin-top: 17px;
  color: #c2b69e;
  font-size: 18px;
}

.role-enter {
  margin-top: 22px;
  color: #cfc4aa;
  font-size: 15px;
}

.role-card.active .role-enter {
  color: #e5ad42;
  font-weight: 700;
}

.roles-footer {
  position: absolute;
  z-index: 2;
  left: 80px;
  bottom: 31px;
  color: #8d8678;
  font-family: var(--serif);
  font-size: 14px;
}

/* ========== P03 舞台/视频播放页（直移 prototype-revision-p03-p04.html） ========== */
.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  background: #000;
  overflow: hidden;
}

/* 顶部渐变遮罩 */
.stage::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  z-index: 2;
  background: linear-gradient(180deg, rgba(0,0,0,0.65) 0%, transparent 100%);
  pointer-events: none;
}

/* 底部抉择层渐变遮罩 */
.stage::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 340px;
  z-index: 2;
  background: linear-gradient(0deg, rgba(3,4,5,0.97) 0%, rgba(3,4,5,0.92) 40%, rgba(3,4,5,0.5) 75%, transparent 100%);
  pointer-events: none;
}

.stage-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  pointer-events: none;
}
.stage[data-role="zhao"] .stage-bg { background-position: 40% center; }
.stage[data-role="qian"] .stage-bg { background-position: 65% center; }
.stage[data-role="sun"] .stage-bg { background-position: 60% center; }
.stage-bg[hidden] { display: none; }

.stage-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  z-index: 1;
}

.stage-subtitle {
  position: absolute;
  left: 50%;
  bottom: 360px;
  transform: translateX(-50%);
  z-index: 3;
  max-width: 70%;
  padding: 10px 28px;
  background: rgba(0, 0, 0, 0.65);
  color: var(--paper-bright);
  font-family: var(--sans);
  font-size: 1.1rem;
  line-height: 1.6;
  text-align: center;
  letter-spacing: 0.04em;
  display: none;
  pointer-events: none;
}
.stage-subtitle.visible { display: block; }

.placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-size: cover;
  background-position: center;
  pointer-events: none;
}
.placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 4, 0.7);
}
.placeholder > * { position: relative; z-index: 1; }
.placeholder[hidden] { display: none; }

.placeholder-card {
  width: min(560px, 90%);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cinnabar);
  background: rgba(20, 16, 11, 0.9);
  padding: 28px 32px;
  text-align: left;
}
.placeholder-title {
  font-size: 1.6rem;
  margin: 8px 0;
  color: var(--paper-bright);
}
.placeholder-sub { font-family: var(--sans); color: var(--paper); line-height: 1.7; margin-bottom: 10px; }
.placeholder-meta { font-family: var(--sans); color: var(--gold); font-size: 0.82rem; word-break: break-all; }
.placeholder-hint { font-family: var(--sans); color: var(--paper-muted); font-size: 0.82rem; line-height: 1.7; margin-top: 8px; }

/* 顶部信息栏 */
.stage-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  pointer-events: none;
}
.stage-topbar button,
.stage-topbar .icon-btn { pointer-events: auto; }

.stage-topbar-left {
  color: var(--gold);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.stage-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.stage-act-indicator {
  color: rgba(232, 220, 196, 0.7);
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.4);
  color: var(--paper);
  font-size: 1rem;
  transition: border-color 200ms ease;
}
.icon-btn:hover { border-color: var(--line-strong); }

/* 视频控件已合并到 stage-topbar-right，重播按钮复用 .icon-btn 样式 */

.play-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(8, 6, 4, 0.5);
  pointer-events: none;
}
.play-overlay .play-btn { pointer-events: auto; }
.play-overlay[hidden] { display: none; }
.play-btn {
  padding: 14px 32px;
  border: 1px solid var(--gold);
  background: var(--cinnabar-bg);
  color: var(--paper-bright);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  font-family: var(--sans);
}

/* 底部抉择层（替代原 stage-info） */
.stage-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 3;
  padding: 0 80px 36px;
  pointer-events: none;
}
.stage-info button,
.stage-info .choice,
.stage-info .choice-role,
.stage-info .btn { pointer-events: auto; }

/* 视频播放期间隐藏 stage-meta，仅 ended 后显示 */
.stage:not([data-state="ended"]) .stage-meta { display: none; }

/* 视频播放期间隐藏顶部文字信息（保留右上角功能按钮），仅 ended 后显示 */
.stage:not([data-state="ended"]) .stage-topbar-left,
.stage:not([data-state="ended"]) .stage-act-indicator { display: none; }

/* 视频播放期间隐藏底部抉择层（避免遮挡原生进度条），仅 ended 后显示 */
.stage:not([data-state="ended"]) .stage-info { display: none; }

/* 视频播放期间隐藏底部渐变遮罩（避免视觉遮挡原生进度条），仅 ended 后显示 */
.stage:not([data-state="ended"])::after { display: none; }

/* roleSelect 节点：人物选择层居中显示在页面正中 */
.stage-info-center {
  bottom: auto;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  padding: 0 40px;
  width: 100%;
  box-sizing: border-box;
}

/* roleSelect 节点的 choice-list-3 放大并减小两侧空隙 */
.stage-info-center .choice-list-3 {
  max-width: 1400px;
  margin: 0 auto;
  gap: 16px;
}

.stage-info-center .choice-role {
  height: 420px;
}

.stage-info-top {
  margin-bottom: 0;
}

.stage-meta { /* no flex needed in overlay */ }

.node-act {
  color: var(--gold);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  margin-bottom: 14px;
}

.node-title {
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--paper-bright);
  margin-bottom: 28px;
  max-width: 900px;
}

.node-summary {
  color: var(--paper-dim);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  margin-top: 8px;
  margin-bottom: 20px;
  max-width: 900px;
}

.stage-hint {
  position: absolute;
  right: 40px;
  bottom: 12px;
  z-index: 4;
  color: var(--paper-muted);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0;
  white-space: nowrap;
  padding-top: 0;
  pointer-events: none;
}

.action-area {
  display: flex;
  flex-direction: column;
}

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  min-height: 48px;
  padding: 10px 28px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  transition: border-color 200ms ease, background 200ms ease;
}
.btn:hover { border-color: var(--line-strong); background: rgba(255,255,255,0.08); }

.btn-primary {
  background: var(--cinnabar-bg);
  border-color: var(--cinnabar-border);
  color: var(--paper-bright);
}
.btn-primary:hover { background: rgba(160, 48, 32, 0.95); }

.btn-ghost {
  background: transparent;
  color: var(--paper-muted);
  border-color: var(--line);
}
.btn-ghost:hover { color: var(--paper); }

/* A/B 选项 */
.choice-heading { display: none; }

.choice-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: 100%;
  max-width: 1280px;
}

.choice {
  position: relative;
  min-height: 88px;
  padding: 20px 28px 20px 68px;
  text-align: left;
  border: 1.5px solid var(--line-strong);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease;
}
.choice:hover {
  background: rgba(255,255,255,0.07);
}

.choice-a {
  border-color: var(--cinnabar-border);
  background: rgba(130, 40, 28, 0.22);
}
.choice-a:hover { border-color: #d65842; }
.choice-a::before {
  content: "A";
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cinnabar-border);
  font-size: 22px;
  font-weight: 700;
  font-family: var(--sans);
}

.choice-b {
  border-color: rgba(105, 155, 170, 0.7);
  background: rgba(40, 70, 80, 0.18);
}
.choice-b:hover { border-color: rgba(125, 175, 190, 0.9); }
.choice-b::before {
  content: "B";
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(130, 175, 190, 0.85);
  font-size: 22px;
  font-weight: 700;
  font-family: var(--sans);
}

.choice-label {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--paper-bright);
  line-height: 1.3;
  margin-bottom: 6px;
}

.choice-detail {
  display: block;
  color: var(--paper-dim);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
}

.choice-note { display: none; }

/* ========== 角色选择按钮（P02视觉，内联于actionArea） ========== */
.choice-list-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 1280px;
}

.choice-role {
  position: relative;
  height: 280px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #756b5c;
  background: #0b0c0c;
  background-size: cover;
  background-position: 44% center;
  cursor: pointer;
  transition: border-color 200ms ease;
  text-align: left;
}

.choice-role[data-option="zhao"] { background-position: 44% center; }
.choice-role[data-option="qian"] { background-position: 63% center; }
.choice-role[data-option="sun"] { background-position: 62% center; }

.choice-role:hover {
  border-color: var(--gold);
}

.choice-role-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(0deg, rgba(3, 4, 4, 0.98) 0%, rgba(3, 4, 4, 0.90) 26%, rgba(3, 4, 4, 0.22) 62%, rgba(3, 4, 4, 0.03) 100%);
  pointer-events: none;
}

.choice-role-text {
  position: absolute;
  z-index: 2;
  left: 24px;
  right: 20px;
  bottom: 22px;
  font-family: var(--serif);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.choice-role-relic {
  color: #c49a37;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.choice-role-name {
  color: #f0e6d0;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 4px;
  letter-spacing: 2px;
}

.choice-role-identity {
  color: #c0b59e;
  font-size: 17px;
  line-height: 1.4;
}

.choice-role-theme {
  color: #c0b59e;
  font-size: 17px;
  line-height: 1.4;
  margin-bottom: 10px;
}

.choice-role-enter {
  color: #c49a37;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
}

.role-footnote {
  text-align: center;
  color: #6b6153;
  font-size: 13px;
  margin-top: 20px;
  font-family: var(--serif);
  letter-spacing: 0.5px;
}

/* ========== P04 结局页（直移 prototype-revision-p03-p04.html） ========== */
.ending-page {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  background: var(--ink-deep);
}

.ending-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: 35% center;
  opacity: 0.22;
}

.ending-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(8,6,4,0.92) 0%, rgba(8,6,4,0.65) 50%, rgba(8,6,4,0.8) 100%);
}

.ending-left {
  position: relative;
  z-index: 2;
  flex: 0 0 60%;
  padding: 80px 48px 56px 96px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ending-kicker {
  color: var(--gold);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.16em;
  margin-bottom: 20px;
}

.ending-title {
  font-family: var(--serif);
  font-size: 56px;
  line-height: 1.12;
  font-weight: 700;
  color: var(--paper-bright);
  margin-bottom: 24px;
}

.ending-line {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.85;
  color: var(--paper);
  margin-bottom: 36px;
  max-width: 480px;
}

.ending-quote {
  position: relative;
  padding-left: 24px;
  margin-bottom: 48px;
  max-width: 480px;
}
.ending-quote::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--cinnabar-border);
}

.ending-quote-label {
  color: var(--gold);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.ending-quote-text {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.9;
  color: var(--paper);
}

.ending-buttons {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: auto;
  flex-wrap: nowrap;
}
.ending-buttons button {
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-text-link {
  color: var(--paper-muted);
  font-family: var(--sans);
  font-size: 15px;
  padding: 12px 8px;
  letter-spacing: 0.04em;
  transition: color 200ms ease;
}
.btn-text-link:hover { color: var(--paper); }

.ending-footnote {
  margin-top: 20px;
  color: var(--paper-muted);
  font-family: var(--sans);
  font-size: 13px;
}

.ending-right {
  position: relative;
  z-index: 2;
  flex: 0 0 40%;
  max-width: 420px;
  padding: 80px 80px 56px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.ending-artifact {
  width: 100%;
  aspect-ratio: 3/4;
  border: 1px solid var(--line);
  background-size: cover;
  background-position: center top;
}

.ending-record {
  border: 1px solid var(--line);
  background: rgba(20, 16, 11, 0.82);
  padding: 24px 28px 22px;
}

.ending-record-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--paper-bright);
  margin-bottom: 18px;
  letter-spacing: 0.06em;
}

.ending-record-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.ending-record-item {
  display: flex;
  gap: 16px;
  font-family: var(--sans);
  font-size: 15px;
}

.ending-record-key {
  color: var(--paper-dim);
  min-width: 56px;
}

.ending-record-val {
  color: var(--paper);
}

.ending-record-id {
  color: var(--paper-muted);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.06em;
}

/* 无障碍状态（视觉隐藏） */
.status-live {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  border: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
  .home-content { left: 28px; top: 40px; width: calc(100% - 56px); }
  .home-title { font-size: 2.6rem; margin: 60px 0 16px; }
  .home-subtitle { font-size: 1.15rem; }
  .home-desc { font-size: 1rem; margin-top: 28px; }
  .home-buttons { flex-direction: column; margin-top: 40px; }
  .btn-cinnabar, .btn-outline { min-width: unset; width: 100%; }
  .home-archive { right: 20px; bottom: 20px; }

  .roles-header { left: 20px; top: 30px; }
  .roles-title { font-size: 1.8rem; }
  .roles-grid { position: relative; left: 0; top: 0; grid-template-columns: 1fr; gap: 16px; padding: 160px 20px 60px; }
  .role-card { height: auto; aspect-ratio: 3/4; }
  .roles-footer { position: relative; left: 0; bottom: 0; padding: 0 20px 20px; }

  .stage-topbar { padding: 12px 16px; }
  .stage-info { padding: 0 20px 20px; }
  .stage-hint { right: 16px; bottom: 6px; white-space: normal; }
  .node-title { font-size: 22px; margin-bottom: 16px; }
  .choice-list { grid-template-columns: 1fr; gap: 12px; }
  .choice { min-height: 64px; padding: 14px 20px 14px 52px; }
  .choice::before { left: 16px; font-size: 18px; }
  .choice-label { font-size: 16px; }
  .choice-detail { font-size: 12px; }

  .ending-page { flex-direction: column; }
  .ending-left { padding: 40px 24px 32px; }
  .ending-right { width: 100%; max-width: none; padding: 0 24px 32px; }
  .ending-title { font-size: 36px; }
  .ending-line { font-size: 16px; }
  .ending-buttons { flex-wrap: wrap; }

  .video-controls { top: 52px; right: 16px; }
  .ctrl-btn { width: 36px; height: 36px; font-size: 0.9rem; }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .stage-info { padding: 0 24px 16px; }
  .node-title { font-size: 20px; margin-bottom: 12px; }
  .choice { min-height: 56px; padding: 10px 16px 10px 44px; }
  .choice::before { left: 12px; font-size: 16px; }
  .choice-label { font-size: 14px; margin-bottom: 2px; }
  .choice-detail { font-size: 11px; }
}
