/* ============================================================
   大唐抉择 · 玄武门  ——  水墨国风 UI
   参考风格：深蓝墨底 + 鎏金点缀 + 宣纸质感
   ============================================================ */

:root {
  --gold:        #d4af37;
  --gold-bright: #f2d57e;
  --gold-dim:    rgba(212, 175, 55, .45);
  --ink-0:       #070a14;
  --ink-1:       #0d1321;
  --ink-2:       #16213e;
  --paper:       #f0e6c8;
  --paper-dim:   #cdbf9e;
  --danger:      #c0564f;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--ink-0);
  font-family: "STKaiti", "KaiTi", "TW-Kai", "FZKai-Z03", "Noto Serif SC", "Songti SC", serif;
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
}

#app { height: 100%; }

/* ---------- 屏幕切换 ---------- */
.screen {
  display: none;
  height: 100%;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  /* 默认水墨渐变底（有场景图时会被 JS 替换为图片+暗角） */
  background:
    radial-gradient(ellipse at 50% -10%, rgba(212,175,55,.08), transparent 55%),
    radial-gradient(ellipse at top, var(--ink-2) 0%, var(--ink-1) 55%, var(--ink-0) 100%);
  background-size: cover;
  background-position: center;
  animation: screenIn .6s ease;
}
.screen.active { display: flex; }

@keyframes screenIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   标题页
   ============================================================ */
#screen-title {
  justify-content: flex-start;
  isolation: isolate;
  padding: clamp(54px, 10vh, 110px) 24px 28px;
  text-align: center;
  background: #15191e;
}
.title-backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url("../assets/gpt-image-1786935640822-1.png");
  background-size: cover;
  background-position: center 56%;
  animation: titleReveal 1.2s ease both;
}
.title-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(244,238,222,.18) 0%, rgba(244,238,222,.04) 38%, rgba(10,14,18,.12) 64%, rgba(7,10,13,.62) 100%),
    linear-gradient(90deg, rgba(8,11,14,.26), transparent 28%, transparent 72%, rgba(8,11,14,.26));
}
@keyframes titleReveal {
  from { opacity: 0; transform: scale(1.025); }
  to { opacity: 1; transform: scale(1); }
}
.title-content { position: relative; max-width: 660px; }
.title-kicker {
  display: inline-block;
  padding: 0 0 9px;
  border-bottom: 1px solid rgba(46,42,35,.45);
  color: #38342c;
  font-size: 13px;
  letter-spacing: .34em;
  text-indent: .34em;
}
.title-heading {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: 16px 0 0;
}
.game-title {
  color: #24231e;
  font-size: clamp(48px, 8vw, 76px);
  font-weight: 700;
  letter-spacing: .16em;
  line-height: 1;
  text-indent: .16em;
  text-shadow: 0 2px 0 rgba(255,255,255,.26);
}
.title-seal {
  display: flex;
  width: 58px;
  height: 58px;
  margin: 0 0 -6px 4px;
  align-items: center;
  justify-content: center;
  border: 2px solid #912d25;
  color: #8b2923;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.12;
  text-indent: .08em;
  text-shadow: 0 1px rgba(255,255,255,.18);
  box-shadow: inset 0 0 0 2px rgba(139,41,35,.18);
  transform: rotate(-5deg);
}
.game-subtitle {
  margin-top: 17px;
  color: #4b4539;
  font-size: clamp(15px, 2.5vw, 20px);
  letter-spacing: .46em;
  text-indent: .46em;
}
.game-desc {
  margin: 25px 0 0;
  color: #34322c;
  font-size: 16px;
  line-height: 1.9;
  text-shadow: 0 1px rgba(255,255,255,.24);
}
.title-start {
  position: absolute;
  z-index: 2;
  bottom: clamp(72px, 13vh, 126px);
  left: 50%;
  min-width: 150px;
  cursor: pointer;
  pointer-events: auto;
  padding: 13px 26px;
  border: 1px solid rgba(242,213,126,.8);
  border-radius: 4px;
  background: linear-gradient(160deg, #23282a, #111719 72%);
  box-shadow: 0 8px 24px rgba(0,0,0,.4), inset 0 0 0 3px rgba(212,175,55,.12);
  color: var(--gold-bright);
  font-size: 19px;
  letter-spacing: .5em;
  text-indent: .5em;
  transform: translateX(-50%);
}
.btn-gold.title-start:hover {
  transform: translateX(-50%);
  box-shadow: 0 12px 28px rgba(0,0,0,.45), inset 0 0 0 3px rgba(212,175,55,.2);
}
.btn-gold.title-start:active { transform: translateX(-50%); }
.title-footnote {
  position: absolute;
  bottom: 24px;
  font-size: 12px;
  letter-spacing: .3em;
  color: rgba(241,230,200,.7);
  text-shadow: 0 1px 3px rgba(0,0,0,.7);
}

/* ============================================================
   通用按钮
   ============================================================ */
.btn-gold {
  cursor: pointer;
  font-family: inherit;
  font-size: 20px;
  letter-spacing: .35em;
  text-indent: .35em;
  color: var(--ink-0);
  background: linear-gradient(160deg, var(--gold-bright), var(--gold) 60%, #a8842a);
  border: none;
  border-radius: 999px;
  padding: 14px 54px;
  box-shadow: 0 4px 24px rgba(212,175,55,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-gold:hover  { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(212,175,55,.5); }
.btn-gold:active { transform: translateY(0); }
.btn-gold.small  { font-size: 15px; padding: 9px 30px; }

/* ============================================================
   游戏页
   ============================================================ */
#screen-game { justify-content: flex-end; }

.hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px clamp(20px, 3vw, 48px);
  z-index: 5;
}
.hud-context { display: flex; align-items: baseline; gap: 14px; }
.hud-kicker {
  color: rgba(240,230,200,.82);
  font-size: 26px;
  letter-spacing: .2em;
}
.hud-item {
  font-size: 24px;
  letter-spacing: .18em;
  color: var(--gold);
  white-space: nowrap;
}
.hud-track {
  position: absolute;
  top: 50%; left: 50%;
  width: clamp(190px, 24vw, 360px);
  height: 8px;
  padding: 2px;
  overflow: visible;
  border: 1px solid rgba(242,213,126,.56);
  background:
    repeating-linear-gradient(90deg, rgba(242,213,126,.18) 0 1px, transparent 1px 12.5%),
    rgba(5,9,16,.48);
  box-shadow: 0 0 14px rgba(0,0,0,.25), inset 0 0 5px rgba(0,0,0,.48);
  transform: translate(-50%, -50%);
}
.hud-track span {
  display: block;
  width: 30%;
  height: 100%;
  position: relative;
  background: linear-gradient(90deg, #a7781d, var(--gold-bright));
  box-shadow: 0 0 10px rgba(242,213,126,.72);
  transition: width .38s ease;
}
.hud-track span::after {
  content: "";
  position: absolute;
  top: 50%; right: -4px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #fff0b8;
  box-shadow: 0 0 10px 3px rgba(242,213,126,.72);
  transform: translateY(-50%);
}
.hud-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-tip {
  cursor: pointer;
  font-size: 17px;
  background: rgba(7,10,20,.22);
  border: 1px solid rgba(240,230,200,.28);
  border-radius: 50%;
  width: 44px; height: 44px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-tip:hover { transform: scale(1.1); box-shadow: 0 0 18px rgba(212,175,55,.4); }

.scene-caption {
  position: absolute;
  z-index: 2;
  top: 86px;
  left: 50%;
  width: max-content;
  max-width: 72vw;
  padding: 6px 24px 8px;
  color: #f0e6c8;
  font-family: "STXingkai", "FZShuTi", "KaiTi", "STKaiti", serif;
  font-size: clamp(32px, 3vw, 46px);
  font-weight: 700;
  letter-spacing: .14em;
  text-indent: .14em;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0,0,0,.75), 0 0 16px rgba(212,175,55,.16);
  transform: translateX(-50%);
}
.scene-caption::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -2px -18px;
  background:
    linear-gradient(93deg, transparent 0 4%, rgba(7,10,20,.18) 10% 89%, transparent 96%),
    linear-gradient(180deg, transparent 20%, rgba(7,10,20,.38) 49%, transparent 80%);
  filter: blur(1px);
  opacity: .82;
}
#scene-caption[data-scene="xuanwu"] {
  padding: 10px 18px;
  border: 2px solid rgba(171,53,43,.9);
  color: #eaa38e;
  background: rgba(117,30,26,.34);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: clamp(27px, 2.2vw, 34px);
  letter-spacing: .2em;
  line-height: 1;
  text-indent: .2em;
  box-shadow: inset 0 0 0 2px rgba(130,36,30,.35), 0 2px 12px rgba(0,0,0,.28);
  text-shadow: 0 1px 3px rgba(42,8,6,.7);
}
#scene-caption[data-scene="xuanwu"]::before { display: none; }
#scene-caption[data-scene="xuanwu"]::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(221,113,91,.44);
  pointer-events: none;
}

/* ---------- 对话框 ---------- */
.dialog {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: clamp(72px, 10vh, 132px);
  z-index: 4;
  width: min(900px, 70vw);
  margin: 0;
  padding: 18px clamp(22px, 3vw, 42px) 16px;
  isolation: isolate;
  background: transparent;
  border: 0;
  border-radius: 0;
  clip-path: none;
  backdrop-filter: none;
  box-shadow: none;
  cursor: pointer;
}
.dialog::before {
  content: "";
  position: absolute;
  inset: -28px -42px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 54%, rgba(5,9,16,.50) 0%, rgba(5,9,16,.28) 55%, transparent 88%);
  filter: blur(12px);
}
/* 叙事始终居中，立绘作为左侧舞台侧景 */
#screen-game .dialog { transform: translateX(-50%); }
.speaker-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
  color: var(--gold-bright);
  font-size: 16px;
  letter-spacing: .24em;
}
.speaker-tag::before {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: .7;
}
.dialog-text {
  min-height: 2.6em;
  font-size: 22px;
  line-height: 1.9;
  letter-spacing: .03em;
  color: var(--paper);
  text-shadow: 0 2px 8px rgba(0,0,0,.78), 0 1px 1px rgba(0,0,0,.8);
}
.dialog-text::after {
  content: "▍";
  color: var(--gold);
  animation: caret 1s steps(1) infinite;
}
.dialog-text.done::after { content: ""; }
@keyframes caret { 50% { opacity: 0; } }

/* ---------- 选项 ---------- */
.choices {
  margin-top: 11px;
  border: 0;
}
.dialog.has-choices .choices {
  position: relative;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 2px solid rgba(154,52,43,.72);
}
.dialog.has-choices .choices::before {
  content: "抉择";
  position: absolute;
  top: -11px;
  left: 0;
  padding: 0 9px 0 0;
  background: transparent;
  color: #df8c72;
  font-size: 12px;
  letter-spacing: .22em;
}
.choice-btn {
  display: block;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  font-size: 20px;
  letter-spacing: .06em;
  text-align: left;
  color: var(--paper);
  background: linear-gradient(90deg, rgba(5,9,16,.42), rgba(5,9,16,.12) 78%, transparent);
  border: 0;
  border-left: 3px solid rgba(242,213,126,.74);
  border-radius: 0;
  padding: 12px 16px;
  margin: 7px 0 0;
  text-shadow: 0 1px 5px rgba(0,0,0,.7);
  transition: color .18s ease, background .18s ease, padding .18s ease, border-color .18s ease;
  animation: choiceIn .35s ease backwards;
}
.choice-btn:nth-child(2) { animation-delay: .08s; }
.choice-btn:nth-child(3) { animation-delay: .16s; }
.choice-btn:hover {
  transform: none;
  padding-left: 24px;
  background: linear-gradient(90deg, rgba(116,34,29,.60), rgba(116,34,29,.16) 78%, transparent);
  border-left-color: #e06b57;
  box-shadow: none;
  color: #fff3d2;
}
.choice-btn .prefix {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  border: 1px solid rgba(242,213,126,.82);
  color: var(--gold-bright);
  font-size: 14px;
  letter-spacing: 0;
}
.choice-btn:hover { box-shadow: inset 0 0 0 1px rgba(199,82,69,.22); }
.choice-btn:hover .prefix { background: #9a342b; border-color: #c75245; color: #fff3d2; }
@keyframes choiceIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   结局页
   ============================================================ */
#screen-ending {
  justify-content: flex-start;
  padding: clamp(46px, 7vh, 84px) 20px 48px;
  background:
    linear-gradient(90deg, rgba(5,8,13,.72), rgba(5,8,13,.1) 23%, rgba(5,8,13,.1) 77%, rgba(5,8,13,.72)),
    radial-gradient(ellipse at 50% 0%, rgba(212,175,55,.12), transparent 42%),
    linear-gradient(180deg, #111b2a 0%, #0a101b 65%, #070a14 100%);
}
.ending-dossier { width: min(800px, 100%); }
.ending-masthead { position: relative; padding: 0 0 28px; text-align: center; }
.ending-masthead::after {
  content: "";
  position: absolute; right: 10%; bottom: 0; left: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,.62), transparent);
}
.ending-kicker, .record-label {
  color: var(--paper-dim);
  font-size: 12px;
  letter-spacing: .34em;
  text-indent: .34em;
}
.score-title {
  display: inline-block;
  margin-top: 17px;
  padding: 4px 12px 3px 14px;
  border: 1px solid rgba(212,175,55,.55);
  color: var(--gold-bright);
  font-size: 14px;
  letter-spacing: .18em;
  text-indent: .18em;
}
.ending-title {
  margin-top: 17px;
  color: var(--gold-bright);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: .18em;
  line-height: 1.25;
  text-indent: .18em;
  text-shadow: 0 0 26px rgba(212,175,55,.18);
}
.ending-source { margin-top: 10px; color: var(--paper-dim); font-size: 14px; letter-spacing: .12em; }
.ending-score {
  display: flex;
  width: min(290px, 100%);
  margin: 21px auto 0;
  padding: 10px 0 8px;
  align-items: baseline;
  justify-content: center;
  gap: 16px;
  border-top: 1px solid rgba(212,175,55,.24);
  border-bottom: 1px solid rgba(212,175,55,.24);
  color: var(--paper-dim);
  font-size: 13px;
  letter-spacing: .18em;
  text-indent: .18em;
}
#score-num { color: var(--gold-bright); font-size: 28px; font-weight: 600; letter-spacing: .04em; text-shadow: 0 0 18px rgba(212,175,55,.28); }
.ending-record { padding: 30px 38px 31px; border-bottom: 1px solid rgba(212,175,55,.26); }
.ending-record .record-label { display: block; margin-bottom: 14px; color: var(--gold); }
.ending-text { color: var(--paper); font-size: 18px; line-height: 2.05; white-space: pre-wrap; text-align: left; }

.path-review { position: relative; padding: 30px 38px 25px; text-align: left; border-bottom: 1px solid rgba(212,175,55,.26); }
.section-heading { display: flex; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.section-heading .record-label { color: var(--gold); }
.path-review h3 { color: var(--gold-bright); font-size: 21px; font-weight: 500; letter-spacing: .16em; }
#path-review-list { position: relative; padding-left: 24px; }
#path-review-list::before { content: ""; position: absolute; top: 7px; bottom: 8px; left: 5px; width: 1px; background: linear-gradient(var(--gold-dim), rgba(212,175,55,.08)); }
.review-row { position: relative; display: grid; grid-template-columns: 104px 1fr; gap: 13px; padding: 0 0 17px; color: var(--paper); font-size: 16px; line-height: 1.7; }
.review-row::before { content: ""; position: absolute; top: 8px; left: -23px; width: 9px; height: 9px; border: 1px solid var(--gold); background: var(--ink-1); transform: rotate(45deg); }
.review-row:last-child { padding-bottom: 0; }
.review-badge { color: var(--paper-dim); font-size: 13px; letter-spacing: .08em; white-space: nowrap; }
.review-badge.hist { color: #aac9ad; }
.review-badge.alt { color: #db9691; }
.path-verdict { margin-top: 22px; padding: 13px 16px; border-left: 2px solid var(--gold-dim); color: var(--paper-dim); font-size: 16px; line-height: 1.85; }

.history-timeline { border-bottom: 1px solid rgba(212,175,55,.26); }
.history-timeline summary { display: flex; padding: 23px 38px; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; text-align: left; }
.history-timeline summary::-webkit-details-marker { display: none; }
.history-timeline summary small { display: block; margin-bottom: 4px; color: var(--gold); font-size: 12px; letter-spacing: .24em; }
.history-timeline summary strong { color: var(--paper); font-size: 18px; font-weight: 500; letter-spacing: .14em; }
.history-timeline summary i { width: 10px; height: 10px; margin-right: 5px; border-right: 1px solid var(--gold); border-bottom: 1px solid var(--gold); transform: rotate(45deg) translateY(-3px); transition: transform .25s ease; }
.history-timeline[open] summary i { transform: rotate(225deg) translate(-2px, -2px); }
.history-timeline ol { margin: 0 38px 28px; padding-left: 23px; text-align: left; }
.history-timeline li { padding-left: 6px; color: var(--paper-dim); font-size: 16px; line-height: 2; }
.history-timeline li::marker { color: var(--gold); }
.ending-actions { display: flex; justify-content: center; padding-top: 32px; }
#screen-ending.ending-alt .score-title { border-color: rgba(192,86,79,.72); color: #e4aaa0; }
#screen-ending.ending-alt .ending-masthead::after { background: linear-gradient(90deg, transparent, rgba(192,86,79,.72), transparent); }
#screen-ending.ending-alt .ending-title, #screen-ending.ending-alt #score-num { color: #edb7aa; text-shadow: 0 0 20px rgba(192,86,79,.18); }
#screen-ending.ending-alt .ending-score, #screen-ending.ending-alt .ending-record, #screen-ending.ending-alt .path-review, #screen-ending.ending-alt .history-timeline { border-color: rgba(192,86,79,.32); }
#screen-ending.ending-alt .record-label, #screen-ending.ending-alt .history-timeline summary small { color: #d9938c; }
#screen-ending.ending-alt #path-review-list::before { background: linear-gradient(rgba(192,86,79,.7), rgba(192,86,79,.08)); }
#screen-ending.ending-alt .review-row::before { border-color: #cf7d76; }

/* ============================================================
   弹窗 & 加载
   ============================================================ */
.modal {
  position: fixed; inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 12, .72);
  backdrop-filter: blur(3px);
}
.modal.show { display: flex; }

.modal-card {
  width: min(560px, 90%);
  background: linear-gradient(170deg, #141c33, var(--ink-1));
  border: 1px solid var(--gold-dim);
  border-radius: 16px;
  padding: 30px 32px;
  text-align: center;
  box-shadow: 0 10px 60px rgba(0,0,0,.6);
  animation: choiceIn .3s ease;
}
.modal-card h3 {
  color: var(--gold);
  letter-spacing: .3em;
  text-indent: .3em;
  margin-bottom: 18px;
}
.modal-card p { font-size: 16px; line-height: 2; text-align: left; margin-bottom: 22px; color: var(--paper); }

.loader-wrap { text-align: center; }
.ink-loader {
  width: 56px; height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--gold);
  border-right-color: var(--gold-dim);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-wrap p { letter-spacing: .3em; color: var(--paper-dim); }

/* ============================================================
   移动端适配
   ============================================================ */
@media (max-width: 600px) {
  #screen-title { padding-top: clamp(50px, 11vh, 90px); }
  .title-backdrop { background-position: 52% center; }
  .title-kicker { font-size: 11px; letter-spacing: .27em; text-indent: .27em; }
  .title-heading { margin-top: 14px; }
  .game-title { font-size: clamp(42px, 13vw, 58px); }
  .title-seal { width: 48px; height: 48px; margin-bottom: -4px; font-size: 14px; }
  .game-subtitle { margin-top: 14px; font-size: 14px; }
  .game-desc { margin-top: 21px; font-size: 14px; }
  .title-start { bottom: max(80px, 15vh); }
  .scene-caption  { top: calc(7% + 132px); font-size: 12px; }
  .dialog         { padding: 22px 18px 18px; }
  .dialog-text    { font-size: 16px; }
  .choice-btn     { font-size: 15.5px; }
}

/* ---------- 章节过场 ---------- */
#chapter-splash {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; opacity: 0;
  transition: opacity .5s ease;
}
#chapter-splash.show { opacity: 1; }
#chapter-splash .splash-inner {
  display: flex; align-items: center; gap: 22px;
}
#chapter-splash .splash-title {
  color: var(--gold); font-size: 34px; letter-spacing: 10px;
  text-shadow: 0 0 18px rgba(212, 175, 55, .55);
  animation: splashFloat 1.6s ease both;
}
#chapter-splash .splash-line {
  display: block; width: 72px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
#chapter-splash .splash-line:last-child {
  background: linear-gradient(90deg, var(--gold), transparent);
}
@keyframes splashFloat {
  0%   { transform: translateY(10px); opacity: 0; }
  25%  { transform: translateY(0);    opacity: 1; }
  75%  { transform: translateY(0);    opacity: 1; }
  100% { transform: translateY(-6px); opacity: 0; }
}
@media (max-width: 720px) {
  #chapter-splash .splash-title { font-size: 24px; letter-spacing: 6px; }
  #chapter-splash .splash-line  { width: 40px; }
}

/* ---------- 背景图层（提亮版） ---------- */
#bg-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity .55s ease;
  /* 提亮滤镜：亮度 +18%，轻微增饱和，避免原图偏暗 */
  filter: brightness(1.18) saturate(1.08);
}
#bg-scene.show { opacity: 1; }

/* 底部薄雾：只托住字幕，不切断场景 */
#screen-game::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7,10,20,.18) 0%, transparent 38%, transparent 58%, rgba(7,10,20,.52) 100%),
    linear-gradient(90deg, rgba(7,10,20,.12), transparent 36%, transparent 78%, rgba(7,10,20,.16));
}

/* ---------- 舞台左侧人物立绘 ---------- */
#portrait-wrap {
  position: absolute;
  left: clamp(12px, 3vw, 54px);
  bottom: 4.5%;
  z-index: 3;                                     /* 高于暗角、低于叙事层 */
  height: clamp(360px, 66vh, 640px);
  opacity: 0;
  transform: translateX(-28px);
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
}
#portrait-wrap.show { opacity: 1; transform: translateX(0); }
#portrait-wrap img {
  height: 100%;
  width: auto;
  filter: drop-shadow(0 12px 34px rgba(0,0,0,.55));   /* JS 会再叠加角色色辉光 */
  user-select: none;
}

@media (max-width: 900px) {
  #portrait-wrap { left: auto; right: 2px; height: 34vh; bottom: 27%; }
}
@media (max-width: 560px) {
  #portrait-wrap { display: none; }   /* 小屏交由顶部圆形头像呈现 */
}
