/* ============================================================
   仙谕之词 · 引擎样式
   设计语言：墨黑 × 黄铜金 × 羊皮米 · 电影黑边 · 胶片颗粒
   ============================================================ */

:root {
  --ink: #0b0a08;
  --ink-soft: #14110c;
  --paper: #e8dcc3;
  --paper-dim: #c9bda6;
  --gold: #c9a35c;
  --gold-bright: #ecd398;
  --gold-dim: rgba(201, 163, 92, 0.55);
  --seal-red: #7d2a2a;
  --mist: #5e6f77;
  --su-color: #a8d8cf;
  --lin-color: #d9b36c;
  --narr-color: #9a968c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  background: #000;
  overflow: hidden;
  font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  -webkit-user-select: none; user-select: none;
}

/* ---------- 舞台：1280×720 设计分辨率，等比缩放居中 ---------- */
#viewport { width: 100%; height: 100%; position: relative; }
#stage {
  position: absolute;
  width: 1280px; height: 720px;
  left: 50%; top: 50%;
  transform-origin: center center;
  background: var(--ink);
  outline: none;
  cursor: default;
}
#stage.pulse { animation: stagePulse 0.45s ease-out; }
@keyframes stagePulse {
  0%   { filter: brightness(1) blur(0); }
  30%  { filter: brightness(1.5) blur(2px) saturate(1.3); }
  100% { filter: brightness(1) blur(0); }
}

/* ---------- 背景层 ---------- */
.bg-layer {
  position: absolute; inset: 0;
  z-index: 0;
  background-size: cover; background-position: center;
  opacity: 0;
  transition: opacity 1.1s ease;
}
.bg-layer.on { opacity: 1; }
.bg-layer video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- 立绘层 ---------- */
#sprite-layer { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.sprite {
  position: absolute;
  bottom: 0;
  height: 92%;
  width: auto;
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.22,.8,.3,1), filter 0.45s ease;
  transform: translateX(-50%) translateY(14px);
  will-change: transform, opacity;
}
.sprite.pos-left  { left: 24%; }
.sprite.pos-right { left: 76%; }
.sprite.pos-mid   { left: 50%; }
.sprite.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.sprite.speaking { filter: brightness(1.06) drop-shadow(0 0 22px rgba(236, 211, 152, 0.14)); }
.sprite.dimmed   { filter: brightness(0.52) saturate(0.7); }
.sprite.breath { animation: spriteBreath 4.6s ease-in-out infinite; }
@keyframes spriteBreath {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(1); }
  50%      { transform: translateX(-50%) translateY(-5px) scale(1.006); }
}

/* ---------- 漂浮词交互层 ---------- */
#interact-layer { position: absolute; inset: 0; z-index: 15; }
.float-word {
  position: absolute;
  font-family: 'Cinzel', 'Noto Serif SC', serif;
  font-size: 34px;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  text-shadow: 0 0 14px rgba(236, 211, 152, 0.9), 0 0 44px rgba(201, 163, 92, 0.55);
  cursor: pointer;
  padding: 10px 16px;
  transition: transform 0.25s ease, text-shadow 0.25s ease;
  animation: wordFloat 3.4s ease-in-out infinite;
}
.float-word:hover {
  transform: scale(1.12);
  text-shadow: 0 0 20px rgba(236, 211, 152, 1), 0 0 70px rgba(201, 163, 92, 0.8);
}
@keyframes wordFloat {
  0%, 100% { margin-top: 0; }
  50%      { margin-top: -12px; }
}
.float-word.absorbing {
  animation: absorbWord 0.85s cubic-bezier(.5,0,.9,.4) forwards !important;
  pointer-events: none;
}
@keyframes absorbWord {
  0%   { opacity: 1; filter: blur(0); }
  55%  { opacity: 1; filter: blur(1px) brightness(1.8); }
  100% { transform: translate(var(--ax), var(--ay)) scale(0.15) rotate(8deg); opacity: 0; filter: blur(4px); }
}
#grab-hint {
  position: absolute;
  bottom: 9%;
  width: 100%;
  text-align: center;
  color: var(--paper-dim);
  font-size: 17px;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  opacity: 0;
  animation: hintBreath 2.2s ease-in-out infinite;
}
@keyframes hintBreath { 0%,100% { opacity: 0.35; } 50% { opacity: 0.9; } }

/* ---------- 全屏视频 CG ---------- */
#video-cg {
  position: absolute; inset: 0;
  z-index: 20;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}
#video-cg.on { opacity: 1; pointer-events: auto; cursor: pointer; }
#video-cg video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- 黑幕层 ---------- */
#black-veil {
  position: absolute; inset: 0;
  z-index: 50;
  background: #020202;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
}
#black-veil.on { opacity: 1; pointer-events: auto; cursor: pointer; }
#black-veil-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  padding: 0 140px;
}
.veil-line {
  color: var(--paper);
  text-align: center;
  max-width: 100%;
  margin: 10px 0;
  min-height: 1em;
}
.veil-line.major {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.9;
  text-shadow: 0 0 18px rgba(232, 220, 195, 0.35);
}
.veil-line.minor {
  font-size: 18px;
  color: var(--paper-dim);
  letter-spacing: 0.22em;
}

/* ---------- 对话层 ---------- */
#dialogue-box {
  position: absolute;
  left: 50%; bottom: 26px;
  transform: translateX(-50%) translateY(12px);
  width: 1080px;
  min-height: 148px;
  z-index: 30;
  padding: 20px 34px 26px;
  background: linear-gradient(to top, rgba(8,7,5,0.94) 55%, rgba(14,12,9,0.82));
  border: 1px solid rgba(201, 163, 92, 0.28);
  border-top: 1px solid var(--gold-dim);
  box-shadow: 0 -14px 50px rgba(0,0,0,0.55), inset 0 1px 0 rgba(236,211,152,0.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
#dialogue-box.on { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; cursor: pointer; }

#speaker-chip {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
  opacity: 0; transition: opacity 0.3s ease;
}
#speaker-chip.on { opacity: 1; }
#speaker-seal {
  width: 10px; height: 10px;
  background: var(--seal-red);
  box-shadow: 0 0 8px rgba(125, 42, 42, 0.8);
  transform: rotate(45deg);
}
#speaker-name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.3em;
}
#dialogue-text {
  font-size: 23px;
  line-height: 1.85;
  color: var(--paper);
  letter-spacing: 0.06em;
  min-height: 66px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
#dialogue-text .cursor {
  display: inline-block;
  width: 3px; height: 1em;
  background: var(--gold);
  margin-left: 2px;
  vertical-align: -0.12em;
  animation: caretBlink 0.9s steps(2) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }
#next-hint {
  position: absolute;
  right: 26px; bottom: 14px;
  color: var(--gold);
  font-size: 15px;
  opacity: 0;
  animation: hintFloat 1.6s ease-in-out infinite;
}
#next-hint.on { opacity: 0.85; }
@keyframes hintFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

/* ---------- 挑战层 ---------- */
#challenge-layer {
  position: absolute; inset: 0;
  z-index: 40;
  background: radial-gradient(ellipse at 50% 42%, rgba(10,9,6,0.62) 0%, rgba(4,3,2,0.9) 78%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  padding-bottom: 58px;
}
#challenge-layer.on { opacity: 1; pointer-events: auto; }

#tablet-wrap {
  position: relative;
  width: 1080px;
  transform: translateY(40px);
  opacity: 0;
  transition: transform 1.2s cubic-bezier(.2,.75,.25,1), opacity 1.2s ease;
}
#challenge-layer.on #tablet-wrap { transform: translateY(0); opacity: 1; }

#tablet-head {
  display: flex; align-items: baseline; justify-content: center; gap: 18px;
  margin-bottom: 14px;
}
#tablet-title {
  font-size: 21px;
  color: var(--gold-bright);
  letter-spacing: 0.42em; text-indent: 0.42em;
  font-weight: 600;
}
#tablet-sub {
  font-size: 14px;
  color: var(--paper-dim);
  letter-spacing: 0.28em;
}
#rune-dots { display: flex; gap: 12px; justify-content: center; margin-bottom: 18px; }
.rune-dot {
  width: 11px; height: 11px;
  transform: rotate(45deg);
  border: 1px solid var(--gold-dim);
  transition: all 0.5s ease;
}
.rune-dot.lit { background: var(--gold); box-shadow: 0 0 12px rgba(201,163,92,0.9); border-color: var(--gold-bright); }

#quiz-word-row {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-bottom: 24px;
}
#quiz-word {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 58px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--gold-bright);
  text-shadow: 0 0 24px rgba(236,211,152,0.55), 0 0 70px rgba(201,163,92,0.3);
  animation: runeBreath 3.8s ease-in-out infinite;
}
@keyframes runeBreath {
  0%,100% { text-shadow: 0 0 24px rgba(236,211,152,0.55), 0 0 70px rgba(201,163,92,0.3); }
  50%     { text-shadow: 0 0 34px rgba(236,211,152,0.85), 0 0 100px rgba(201,163,92,0.5); }
}
#quiz-pronounce {
  border: 1px solid var(--gold-dim);
  background: rgba(201,163,92,0.1);
  color: var(--gold-bright);
  width: 38px; height: 38px;
  border-radius: 50%;
  font-size: 17px;
  cursor: pointer;
  transition: all 0.25s ease;
}
#quiz-pronounce:hover { background: rgba(201,163,92,0.3); transform: scale(1.08); }

#quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 760px;
  margin: 0 auto 26px;
}
.quiz-tile {
  padding: 17px 22px;
  font-size: 21px;
  letter-spacing: 0.12em;
  color: var(--paper);
  font-family: inherit;
  background: linear-gradient(135deg, rgba(23,20,14,0.94), rgba(12,10,7,0.94));
  border: 1px solid rgba(201,163,92,0.35);
  cursor: pointer;
  position: relative;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, opacity 0.3s ease;
}
.quiz-tile::before, .quiz-tile::after {
  content: '';
  position: absolute;
  width: 7px; height: 7px;
  border: 1px solid var(--gold-dim);
}
.quiz-tile::before { left: 6px; top: 6px; border-right: none; border-bottom: none; }
.quiz-tile::after  { right: 6px; bottom: 6px; border-left: none; border-top: none; }
.quiz-tile:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: var(--gold-bright);
  box-shadow: 0 6px 26px rgba(201,163,92,0.22), inset 0 0 22px rgba(201,163,92,0.07);
}
.quiz-tile:disabled { cursor: default; opacity: 0.45; }
.quiz-tile.correct {
  background: linear-gradient(135deg, rgba(201,163,92,0.4), rgba(236,211,152,0.22));
  border-color: var(--gold-bright);
  color: #fff8e8;
  box-shadow: 0 0 40px rgba(236,211,152,0.45);
  opacity: 1 !important;
}
.quiz-tile.wrong {
  animation: tileWrong 0.5s ease;
  border-color: rgba(125,42,42,0.9);
  color: #b98a8a;
  background: linear-gradient(135deg, rgba(60,14,14,0.6), rgba(24,8,8,0.6));
  opacity: 0.5 !important;
}
@keyframes tileWrong {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(4px); }
}
#challenge-veil-note {
  font-size: 14px;
  color: var(--paper-dim);
  letter-spacing: 0.3em;
  padding-bottom: 6px;
}
#quiz-skip {
  display: block;
  margin: 0 auto;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.24em;
  color: #6f6a5e;
  background: transparent;
  border: 1px solid rgba(201, 163, 92, 0.25);
  padding: 6px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}
#quiz-skip:hover { color: var(--gold-bright); border-color: var(--gold-dim); }

/* 碑刻揭晓 */
/* ---------- 剧情配图（台词时的全屏插图） ---------- */
#still-layer {
  position: absolute; inset: 0;
  z-index: 1;
  background-size: cover; background-position: center;
  opacity: 0;
  transition: opacity 0.85s ease;
  pointer-events: none;
}
#still-layer::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.55) 100%);
}
#still-layer.on { opacity: 1; }

/* ---------- 言灵花圃 · 心意之择 ---------- */
#flower-wrap {
  position: relative;
  width: 1080px;
  height: 540px;
  margin-bottom: 40px;
}
#flower-head { text-align: center; margin-bottom: 6px; }
#flower-title { font-size: 21px; color: var(--gold-bright); letter-spacing: 0.42em; text-indent: 0.42em; font-weight: 600; }
#flower-instruction {
  font-size: 17px;
  color: var(--gold-bright);
  letter-spacing: 0.24em;
  margin-top: 8px;
  text-shadow: 0 0 14px rgba(236, 211, 152, 0.55), 0 2px 6px rgba(0, 0, 0, 0.8);
}
#flower-buds { display: flex; gap: 16px; justify-content: center; margin: 12px 0 4px; }
.flower-bud {
  font-size: 20px;
  color: rgba(201, 163, 92, 0.4);
  text-shadow: none;
  transform: scale(0.9) rotate(-8deg);
  transition: all 0.6s cubic-bezier(.2,.8,.3,1);
}
.flower-bud.lit { color: var(--gold-bright); text-shadow: 0 0 16px rgba(236,211,152,0.9); transform: scale(1.25) rotate(0deg); }
.flower-bud.bloom { transform: scale(1.45) rotate(8deg); text-shadow: 0 0 30px rgba(236,211,152,1); }
#flower-field { position: relative; width: 100%; height: 330px; overflow: hidden; }
.word-petal {
  position: absolute;
  font-family: 'Cinzel', 'Noto Serif SC', serif;
  font-size: 24px;
  letter-spacing: 0.12em;
  color: var(--paper);
  background: rgba(18, 15, 10, 0.72);
  border: 1px solid rgba(201, 163, 92, 0.4);
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  animation: wordFloat 3.8s ease-in-out infinite;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.word-petal:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.06);
  border-color: var(--gold-bright);
  box-shadow: 0 6px 26px rgba(201, 163, 92, 0.25);
}
.word-petal.to-bud {
  animation: petalToBud 0.85s cubic-bezier(.45,0,.9,.4) forwards !important;
  pointer-events: none;
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}
@keyframes petalToBud {
  0%   { opacity: 1; transform: scale(1); }
  60%  { transform: scale(0.7) translate(calc(var(--bx) * 0.55), calc(var(--by) * 0.55)) rotate(12deg); opacity: 1; filter: brightness(1.6); }
  100% { transform: scale(0.25) translate(var(--bx), var(--by)) rotate(20deg); opacity: 0; filter: brightness(2); }
}
.word-petal.moth {
  animation: mothAway 1.3s ease-out forwards !important;
  pointer-events: none;
  color: #6b665c;
  border-color: rgba(90, 85, 75, 0.4);
  filter: grayscale(1);
}
.word-petal.pick {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  box-shadow: 0 0 30px rgba(236, 211, 152, 0.55), inset 0 0 18px rgba(236, 211, 152, 0.2);
  animation: pickPop 0.28s ease;
}
@keyframes pickPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.16); }
  100% { transform: scale(1); }
}
.word-petal.shake { animation: tileWrong 0.45s ease !important; }
.spark-gold, .spark-moth {
  position: absolute;
  pointer-events: none;
  z-index: 5;
}
.spark-gold { color: var(--gold-bright); font-size: 17px; text-shadow: 0 0 10px rgba(236, 211, 152, 0.95); }
.spark-moth { color: #7d786d; font-size: 14px; filter: grayscale(1); opacity: 0.9; }
.flower-bud.ripple::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border: 1px solid var(--gold-bright);
  border-radius: 50%;
  animation: budRipple 0.8s ease-out forwards;
}
.flower-bud { position: relative; }
@keyframes budRipple {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(3.4); opacity: 0; }
}
@keyframes mothAway {
  0%   { opacity: 0.9; filter: grayscale(0.6); }
  50%  { transform: translateY(-26px) translateX(14px) rotate(-6deg); opacity: 0.5; filter: grayscale(1) blur(1px); }
  100% { transform: translateY(-60px) translateX(-10px) rotate(4deg); opacity: 0; filter: grayscale(1) blur(2px); }
}
#flower-note { text-align: center; font-size: 14px; color: var(--paper-dim); letter-spacing: 0.26em; margin-top: 4px; }
#flower-wrap #quiz-skip { display: block; margin: 6px auto 0; }

/* ---------- 墨晕转场 ---------- */
#ink-veil { will-change: background, opacity; }

/* ---------- 灵识烙印 ---------- */
#cg-moment {
  position: absolute; inset: 0;
  z-index: 45;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
#cg-moment.on { opacity: 1; }
#cg-moment .cg-frame {
  position: absolute; inset: 18px;
  border: 1px solid rgba(236, 211, 152, 0.75);
  box-shadow: inset 0 0 0 1px rgba(201, 163, 92, 0.3), inset 0 0 90px rgba(201, 163, 92, 0.12);
  background: radial-gradient(ellipse at center, transparent 58%, rgba(58, 40, 10, 0.35) 100%);
  backdrop-filter: sepia(0.22) saturate(1.15) brightness(1.06);
}
#cg-moment .cg-frame::before, #cg-moment .cg-frame::after {
  content: '❀';
  position: absolute;
  color: var(--gold-bright);
  font-size: 18px;
  opacity: 0.85;
}
#cg-moment .cg-frame::before { left: 14px; top: 10px; }
#cg-moment .cg-frame::after { right: 14px; bottom: 6px; }
#cg-moment .cg-seal {
  position: absolute;
  right: 44px; bottom: 40px;
  width: 58px; height: 58px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 900;
  color: #f3e2c8;
  background: var(--seal-red);
  box-shadow: 0 0 22px rgba(125, 42, 42, 0.7);
  transform: rotate(-6deg) scale(2.2);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(.3,1.4,.5,1), opacity 0.3s ease;
}
#cg-moment.on .cg-seal { transform: rotate(-6deg) scale(1); opacity: 1; transition-delay: 0.9s; }
#cg-moment .cg-caption {
  position: absolute;
  left: 0; right: 0; bottom: 52px;
  text-align: center;
  font-size: 15px;
  color: var(--gold-bright);
  letter-spacing: 0.5em; text-indent: 0.5em;
}

/* ---------- 活字阁 · 拼字 ---------- */
#spell-wrap {
  position: relative;
  width: 900px;
  margin-bottom: 60px;
  text-align: center;
}
#spell-head { margin-bottom: 8px; }
#spell-title { font-size: 20px; color: var(--gold-bright); letter-spacing: 0.4em; text-indent: 0.4em; font-weight: 600; }
#spell-dots { margin: 10px 0 4px; display: flex; gap: 12px; justify-content: center; }
.spell-dot {
  width: 11px; height: 11px;
  transform: rotate(45deg);
  border: 1px solid var(--gold-dim);
  transition: all 0.5s ease;
}
.spell-dot.lit { background: var(--gold); box-shadow: 0 0 12px rgba(201,163,92,0.9); border-color: var(--gold-bright); }
#spell-clue {
  font-size: 30px;
  color: var(--paper);
  letter-spacing: 0.2em;
  margin: 18px 0 26px;
  text-shadow: 0 0 18px rgba(232,220,195,0.3);
}
#spell-clue #spell-meaning { color: var(--gold-bright); }
#spell-slots { display: flex; gap: 10px; justify-content: center; margin-bottom: 26px; }
.spell-slot {
  width: 52px; height: 60px;
  border: 1px solid var(--gold-dim);
  background: rgba(10,8,6,0.7);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700;
  color: var(--gold-bright);
  cursor: pointer;
  transition: all 0.2s ease;
}
.spell-slot:not(:empty):hover { border-color: var(--paper-dim); }
#spell-slots.stamped .spell-slot {
  background: linear-gradient(160deg, rgba(201,163,92,0.5), rgba(236,211,152,0.2));
  border-color: var(--gold-bright);
  box-shadow: 0 0 24px rgba(236,211,152,0.5);
  animation: stampIn 0.45s cubic-bezier(.3,1.5,.5,1);
}
@keyframes stampIn {
  0% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
#spell-slots.spell-wrong .spell-slot {
  border-color: rgba(125,42,42,0.9);
  color: #b98a8a;
  background: rgba(40,10,10,0.6);
  animation: tileWrong 0.5s ease;
}
#spell-tray { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.spell-tile {
  width: 52px; height: 60px;
  font-family: inherit;
  font-size: 26px; font-weight: 700;
  color: var(--paper);
  background: linear-gradient(135deg, rgba(23,20,14,0.95), rgba(12,10,7,0.95));
  border: 1px solid rgba(201,163,92,0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}
.spell-tile:hover:not(:disabled) {
  transform: translateY(-4px);
  border-color: var(--gold-bright);
  box-shadow: 0 6px 22px rgba(201,163,92,0.25);
}
#spell-note { margin-top: 16px; font-size: 13px; color: var(--paper-dim); letter-spacing: 0.24em; }

/* ---------- 竞语台 · 咒文三连 ---------- */
#cast-wrap {
  position: relative;
  width: 760px;
  margin-bottom: 60px;
  text-align: center;
}
#cast-head { margin-bottom: 8px; }
#cast-title { font-size: 22px; color: var(--gold-bright); letter-spacing: 0.5em; text-indent: 0.5em; font-weight: 600; }
#cast-sub { font-size: 14px; color: var(--paper-dim); letter-spacing: 0.3em; margin-top: 4px; }
#cast-dots { display: flex; gap: 12px; justify-content: center; margin: 12px 0 18px; }
#cast-word {
  font-size: 84px;
  font-weight: 900;
  color: var(--gold-bright);
  font-family: 'Cinzel', Georgia, serif;
  letter-spacing: 0.1em;
  text-shadow: 0 0 40px rgba(236,211,152,0.5);
  margin-bottom: 26px;
  min-height: 1.2em;
}
#cast-options { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.cast-tile { font-family: 'Cinzel', Georgia, serif; letter-spacing: 0.08em; font-size: 20px; }
#cast-note { font-size: 13px; color: var(--paper-dim); letter-spacing: 0.26em; }
#cast-wrap.shake { animation: tileWrong 0.5s ease; }

#cutin-layer {
  position: absolute; inset: 0;
  z-index: 3;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  background: #000;
}
#cutin-layer.flash { animation: cutinFlash 0.3s ease; }
#cutin-layer.on { opacity: 1; }
@keyframes cutinFlash {
  0% { filter: brightness(3); }
  100% { filter: brightness(1); }
}
#cutin-layer .cutin-card {
  position: relative;
  width: 100%; height: 100%;
  background-image: url(../assets/web/cg/cutin_bg.webp?v=a73aadc0e814);
  background-size: cover; background-position: center;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transform: translateX(110%) skewX(-6deg);
}
#cutin-layer .cutin-card.slide { transition: transform 0.4s cubic-bezier(.2,.9,.3,1); transform: translateX(0) skewX(-6deg); }
#cutin-layer .cutin-card.impact { animation: cutinImpact 0.45s cubic-bezier(.3,1.3,.5,1); transform: translateX(0) skewX(0deg); }
@keyframes cutinImpact {
  0% { transform: translateX(0) skewX(-6deg) scale(1.15); filter: brightness(1.8); }
  100% { transform: translateX(0) skewX(0deg) scale(1); filter: brightness(1); }
}
#cutin-layer .cutin-card::before {
  content: '';
  position: absolute; inset: 16px;
  border: 1px solid rgba(236,211,152,0.65);
}
#cutin-layer .cutin-word {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 88px;
  font-weight: 900;
  color: #fff6df;
  letter-spacing: 0.08em;
  text-shadow: 0 0 40px rgba(236,211,152,0.9), 0 4px 12px rgba(0,0,0,0.8);
}
#cutin-layer .cutin-zh {
  margin-top: 14px;
  font-size: 26px;
  color: var(--gold-bright);
  letter-spacing: 0.6em; text-indent: 0.6em;
}

/* ---------- 测力碑数字 ---------- */
#stele-layer {
  position: absolute; inset: 0;
  z-index: 3;
  background-size: cover; background-position: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  display: flex; align-items: center; justify-content: center;
  background-color: #050403;
}
#stele-layer.on { opacity: 1; }
#stele-layer::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 30%, rgba(0,0,0,0.78) 100%);
}
#stele-layer .stele-num {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 150px;
  font-weight: 900;
  color: var(--gold-bright);
  text-shadow: 0 0 60px rgba(236,211,152,0.8), 0 0 140px rgba(201,163,92,0.5);
}
#stele-layer .stele-num.max {
  text-shadow: 0 0 90px rgba(236,211,152,1), 0 0 200px rgba(201,163,92,0.8);
  animation: stampIn 0.4s cubic-bezier(.3,1.5,.5,1);
}

#tablet-reveal {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 700px 420px at 50% 46%, rgba(24,19,11,0.97), rgba(3,3,2,0.995) 75%),
    #030302;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.1s ease;
  z-index: 5;
}
#tablet-reveal.on { opacity: 1; pointer-events: auto; }
.reveal-kicker {
  font-size: 15px;
  color: var(--paper-dim);
  letter-spacing: 0.6em; text-indent: 0.6em;
  margin-bottom: 26px;
}
.reveal-text {
  font-size: 72px;
  font-weight: 900;
  letter-spacing: 0.22em;
  color: var(--gold-bright);
  text-shadow: 0 0 30px rgba(236,211,152,0.6), 0 0 90px rgba(201,163,92,0.35);
  display: flex;
}
.reveal-text span {
  opacity: 0;
  transform: translateY(18px) scale(1.25);
  animation: carveIn 0.8s cubic-bezier(.2,.8,.3,1) forwards;
}
@keyframes carveIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.reveal-sub {
  margin-top: 30px;
  font-size: 17px;
  color: var(--paper-dim);
  letter-spacing: 0.3em;
  opacity: 0;
  animation: fadeIn 1.4s ease 1.6s forwards;
}

/* ---------- 后期层 ---------- */
#grain-canvas, #dust-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
#grain-canvas { z-index: 60; opacity: 0.5; mix-blend-mode: overlay; }
#dust-canvas  { z-index: 61; }
#vignette {
  position: absolute; inset: 0;
  z-index: 62;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
    transparent 46%, rgba(0,0,0,0.32) 84%, rgba(0,0,0,0.62) 100%);
}
.letterbox {
  position: absolute; left: 0; right: 0;
  height: 46px;
  background: #000;
  z-index: 70;
  pointer-events: none;
}
#letterbox-top    { top: 0; box-shadow: 0 1px 0 rgba(201,163,92,0.22); }
#letterbox-bottom { bottom: 0; box-shadow: 0 -1px 0 rgba(201,163,92,0.22); }

/* ---------- 音乐角标 ---------- */
#sys-corner { position: fixed; right: clamp(20px, 3.6vw, 58px); top: clamp(20px, 5vh, 42px); z-index: 100; }
#btn-mute {
  position: relative; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  color: var(--gold-bright); background: rgba(13,12,8,0.35);
  border: 1px solid rgba(201,163,92,0.35); cursor: pointer;
  transition: background .25s, border-color .25s, color .25s;
}
#btn-mute:hover { background: rgba(201,163,92,.14); border-color: var(--gold); }
.music-disc { width: 35px; height: 35px; animation: musicSpin 9s linear infinite; animation-play-state: paused; }
.music-disc circle { stroke: currentColor; stroke-width: .65; opacity: .5; }
.music-disc path { stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; }
.music-disc ellipse { fill: currentColor; }
#btn-mute.is-playing .music-disc { animation-play-state: running; }
#btn-mute.muted { color: #a19989; }
.music-slash { position: absolute; width: 28px; height: 1.5px; background: currentColor; transform: rotate(-45deg) scaleX(0); box-shadow: 0 0 0 2px #17150f; transition: transform .2s; }
#btn-mute.muted .music-slash { transform: rotate(-45deg) scaleX(1); }
@keyframes musicSpin { to { transform: rotate(360deg); } }
button:focus-visible { outline: 1px solid var(--gold-bright); outline-offset: 6px; }

/* ---------- 首页：电影片头 ---------- */
#start-screen {
  position: fixed; inset: 0; z-index: 90; overflow: hidden;
  background: #030302; isolation: isolate;
  transition: opacity 1.2s ease;
}
#start-screen.off { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity 1.2s ease, visibility 0s 1.2s; }
.start-edition { position: absolute; left: clamp(20px, 3.75vw, 60px); top: clamp(33px, 6.8vh, 55px); z-index: 2; color: #c1b39a; font-size: 11px; letter-spacing: .28em; }
.start-edition span { padding: 0 13px; color: #8b7854; }
.start-content {
  /* One proportional unit for type, controls and spacing; height also limits
     the composition on ultrawide displays. 1280 × 720 is the design baseline. */
  --home-unit: min(0.078125vw, 0.138888889dvh);
  position: absolute; z-index: 2; top: 48.5%; left: 0; right: 0; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.start-glyph {
  position: relative; display: grid; place-items: center;
  width: calc(48 * var(--home-unit)); height: calc(54 * var(--home-unit)); margin-bottom: calc(24 * var(--home-unit));
  color: var(--gold-bright); font-size: calc(32 * var(--home-unit)); font-weight: 600;
  border: 1px solid rgba(201,163,92,.55);
  background: rgba(10,9,6,.18); text-shadow: 0 0 18px rgba(201,163,92,.3);
}
.start-glyph::after { content: ''; position: absolute; inset: 3px; border: 1px solid rgba(201,163,92,.19); }
.start-kicker { color: #d1bd91; font-size: calc(14 * var(--home-unit)); letter-spacing: .36em; margin-bottom: calc(20 * var(--home-unit)); }
.start-kicker span { margin: 0 calc(12 * var(--home-unit)); color: #8b7854; }
.start-title {
  font-size: calc(82 * var(--home-unit)); font-weight: 900; line-height: 1.3;
  letter-spacing: .24em; text-indent: .24em; color: #f0e5cf;
  text-shadow: 0 3px 36px #0009; margin-bottom: calc(24 * var(--home-unit));
}
.start-divider { width: calc(84 * var(--home-unit)); height: 1px; background: linear-gradient(90deg,transparent,#baa070,transparent); margin-bottom: calc(24 * var(--home-unit)); }
.start-line { font-size: calc(18 * var(--home-unit)); line-height: 2.15; letter-spacing: .22em; color: #d0c5af; margin-bottom: calc(34 * var(--home-unit)); text-shadow: 0 2px 12px #000; }
#btn-start {
  position: relative; display: flex; align-items: center; justify-content: center; gap: calc(30 * var(--home-unit));
  min-width: calc(224 * var(--home-unit)); height: calc(64 * var(--home-unit)); padding: 0 calc(34 * var(--home-unit));
  font: calc(24 * var(--home-unit)) 'Noto Serif SC',serif; letter-spacing: .28em;
  color: #f0dfb4; background: rgba(20,17,10,.62);
  border: 1px solid #b69a63; cursor: pointer;
  transition: background .3s, box-shadow .3s, transform .3s;
}
#btn-start::after { content: ''; position: absolute; inset: 4px; border: 1px solid rgba(201,163,92,.22); pointer-events: none; }
.start-arrow { color: #b9a274; font-size: calc(24 * var(--home-unit)); letter-spacing: 0; transition: transform .3s; }
#btn-start:hover { background: rgba(118,88,35,.32); box-shadow: 0 0 34px #c9a35c20; transform: translateY(-2px); }
#btn-start:hover .start-arrow { transform: translateX(5px); }
#btn-start:disabled { opacity: .5; cursor: wait; }
#btn-chapters { margin-top: calc(18 * var(--home-unit)); padding: calc(8 * var(--home-unit)) calc(12 * var(--home-unit)); font: calc(14 * var(--home-unit)) 'Noto Serif SC',serif; letter-spacing: .22em; color: #b6aa91; background: none; border: none; cursor: pointer; transition: color .2s; }
#btn-chapters span { margin-left: calc(12 * var(--home-unit)); color: #a88d59; }
#btn-chapters:hover { color: #f0dfb4; }
.start-footer { position: absolute; z-index: 2; left: 0; right: 0; bottom: 37px; display: flex; align-items: center; justify-content: center; gap: 17px; color: #998e78; font-size: 11px; letter-spacing: .18em; }
.footer-rule { width: 20px; height: 1px; background: #8c7c5559; }
#load-status { position: absolute; z-index: 2; left: 0; right: 0; bottom: 15px; text-align: center; color: #b5a787; font-size: 10px; letter-spacing: .16em; }

/* Native dialog: closed by default, keyboard focus stays inside while open. */
#chapter-dialog {
  position: fixed; inset: 0; margin: auto; width: min(720px, calc(100vw - 40px));
  max-height: calc(100dvh - 56px); overflow-y: auto; padding: 35px 36px 24px;
  background: linear-gradient(145deg,rgba(31,28,20,.98),rgba(11,11,8,.98));
  border: 1px solid #8c764951; color: var(--paper); box-shadow: 0 24px 100px #0009;
}
#chapter-dialog::backdrop { background: rgba(3,4,3,.72); backdrop-filter: blur(9px); }
.chapter-heading-row { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 24px; border-bottom: 1px solid #b89b592b; }
.chapter-eyebrow { font-size: 10px; letter-spacing: .25em; color: #ad976b; margin-bottom: 10px; }
#chapter-heading { font-size: 27px; font-weight: 500; letter-spacing: .16em; }
#btn-close-chapters { width: 32px; height: 32px; color: #b5a787; font: 27px serif; border: none; background: none; cursor: pointer; }
#btn-close-chapters:hover { color: #f0dfb4; }
#jump-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 22px; padding: 12px 0; }
.jump-btn { display: flex; align-items: center; gap: 14px; text-align: left; min-height: 58px; padding: 10px 3px; font: 13px 'Noto Serif SC',serif; letter-spacing: .07em; color: #c5baa3; border: none; border-bottom: 1px solid #b89b591f; background: none; cursor: pointer; transition: color .2s, background .2s; }
.jump-btn:hover { color: #f0dfb4; background: #c9a35c09; }
.chapter-number { font: 11px 'Cinzel',serif; letter-spacing: .1em; color: #8e7b56; }
.chapter-arrow { margin-left: auto; color: #8e7b56; }
.chapter-footnote { margin-top: 12px; color: #8c826d; font-size: 11px; letter-spacing: .16em; }
@media (max-height: 620px) {
  .start-footer { bottom: 20px; }
}
@media (max-width: 560px) {
  .start-content { --home-unit: min(.8px, .2vw, .13dvh); }
  .start-edition { font-size: 10px; letter-spacing: .12em; }
  .start-edition span { padding: 0 6px; }
  .start-footer { font-size: 10px; gap: 10px; letter-spacing: .08em; }
  .start-line { letter-spacing: .12em; }
  #chapter-dialog { padding: 24px 20px 18px; }
  #jump-row { grid-template-columns: 1fr; }
  .jump-btn { min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .music-disc { animation-duration: 24s; }
  #btn-start { transition: none; }
}

/* ---------- 黑场卡（暗场剧照） ---------- */
#stillcard {
  position: absolute; inset: 0;
  z-index: 35;
  background-size: cover; background-position: center;
  opacity: 0;
  transition: opacity 1s ease;
  cursor: pointer;
  pointer-events: none;
}
#stillcard.on { opacity: 1; pointer-events: auto; }
#stillcard::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.42) 0%, rgba(0,0,0,0.55) 55%, rgba(0,0,0,0.9) 100%);
}
#stillcard .stillcard-lines {
  position: absolute; inset: 0;
  z-index: 2;
  display: flex; flex-direction: column;
  justify-content: flex-end; align-items: center;
  padding: 0 130px 110px;
}
#stillcard .veil-line.minor { color: #8f9a97; font-size: 16px; }
#stillcard-hint {
  position: absolute;
  right: 34px; bottom: 56px;
  z-index: 2;
  color: var(--gold);
  font-size: 15px;
  opacity: 0.8;
  animation: hintFloat 1.6s ease-in-out infinite;
}
#load-status {
  margin-top: 16px;
  font-size: 13px;
  color: var(--gold-dim);
  letter-spacing: 0.2em;
  min-height: 1.2em;
}

/* ---------- 结束卡 ---------- */
#slice-end {
  position: absolute; inset: 0;
  z-index: 85;
  background: #030302;
  display: none;
  flex-direction: column;
  align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 1.6s ease;
}
#slice-end.on { display: flex; opacity: 1; }
.slice-end-title { font-size: 40px; letter-spacing: 0.5em; text-indent: 0.5em; color: var(--paper); font-weight: 600; }
.slice-end-sub { margin-top: 22px; font-size: 15px; color: var(--paper-dim); letter-spacing: 0.28em; }
.slice-end-note { margin-top: 46px; font-size: 13px; color: #6f6a5e; letter-spacing: 0.2em; line-height: 2; text-align: center; }
#btn-restart {
  margin-top: 40px;
  font-family: inherit;
  font-size: 17px;
  letter-spacing: 0.4em; text-indent: 0.4em;
  color: var(--gold-bright);
  background: transparent;
  border: 1px solid var(--gold-dim);
  padding: 11px 36px;
  cursor: pointer;
  transition: all 0.3s ease;
}
#btn-restart:hover { background: rgba(201,163,92,0.14); }

/* ---------- 通用 ---------- */
@keyframes fadeIn { to { opacity: 1; } }
.fade-out { opacity: 0 !important; transition: opacity 0.6s ease; }

/* ---------- S14 封印配对（60s 限时，雾蚀侵蚀） ---------- */
#seal-wrap {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 40px;
  background: radial-gradient(ellipse at 50% 40%, rgba(6,4,3,0.55), rgba(3,2,2,0.88));
}
#seal-title { font-size: 34px; letter-spacing: 0.5em; text-indent: 0.5em; color: var(--gold-bright); }
#seal-sub { font-size: 14px; color: var(--paper-dim); letter-spacing: 0.2em; margin-top: 6px; }
#seal-status { display: flex; align-items: center; gap: 18px; width: min(760px, 86%); }
#seal-timer {
  flex: 1; height: 8px; overflow: hidden;
  background: rgba(0,0,0,0.6); border: 1px solid rgba(201,163,92,0.3);
}
#seal-timer-bar {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--seal-red), var(--gold));
}
#seal-count { font-size: 15px; color: var(--gold); letter-spacing: 0.12em; white-space: nowrap; }
#seal-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 10px; width: min(860px, 92%);
}
.seal-tile {
  padding: 13px 10px;
  font-size: 15px; letter-spacing: 0.05em; line-height: 1.35;
  color: var(--paper); font-family: inherit;
  background: linear-gradient(135deg, rgba(23,20,14,0.94), rgba(12,10,7,0.94));
  border: 1px solid rgba(201,163,92,0.3);
  cursor: pointer; position: relative;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.seal-tile.en { font-family: 'Cinzel', Georgia, serif; color: var(--gold-bright); }
.seal-tile:hover { border-color: var(--gold); }
.seal-tile.picked {
  border-color: var(--gold-bright);
  box-shadow: 0 0 14px rgba(236,211,152,0.35), inset 0 0 10px rgba(236,211,152,0.12);
  transform: translateY(-2px);
}
.seal-tile.sealed {
  border-color: var(--gold);
  color: var(--gold);
  background: linear-gradient(135deg, rgba(46,36,18,0.9), rgba(24,18,9,0.9));
  box-shadow: 0 0 18px rgba(201,163,92,0.4);
  pointer-events: none;
  animation: sealPulse 0.5s ease;
}
.seal-tile.sealed::after {
  content: '封'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: rgba(236,211,152,0.85); letter-spacing: 0;
  animation: sealStamp 0.45s cubic-bezier(.3,1.4,.5,1);
  background: rgba(10,7,4,0.82);
}
.seal-tile.miss { animation: sealMiss 0.4s ease; border-color: var(--seal-red); }
@keyframes sealPulse { 0% { box-shadow: 0 0 0 rgba(201,163,92,0); } 60% { box-shadow: 0 0 26px rgba(201,163,92,0.8); } }
@keyframes sealStamp { 0% { transform: scale(2.2); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes sealMiss { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
#seal-taunt {
  min-height: 22px; font-size: 15px; color: #b08a9a;
  letter-spacing: 0.1em; opacity: 0; transition: opacity 0.5s ease;
  text-shadow: 0 0 8px rgba(0,0,0,0.8);
}
#seal-taunt.on { opacity: 1; }
#seal-mist {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  transition: opacity 1.2s ease;
  background:
    radial-gradient(ellipse 70% 55% at 8% 0%, rgba(88,70,96,0.5), transparent 70%),
    radial-gradient(ellipse 65% 50% at 95% 100%, rgba(88,70,96,0.5), transparent 70%),
    radial-gradient(ellipse 50% 40% at 0% 90%, rgba(60,48,70,0.55), transparent 75%);
}

/* ---------- S16 ED 词库手账翻页（纯 DOM） ---------- */
#edbook {
  position: absolute; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px;
  background: radial-gradient(ellipse at 50% 45%, rgba(20,15,9,0.88), rgba(6,4,3,0.97));
  animation: fadeIn 1s ease forwards; opacity: 0;
}
#edbook-book {
  width: min(520px, 62%); aspect-ratio: 3 / 4; position: relative;
  background: linear-gradient(160deg, #2a2318, #17120b 70%);
  border: 1px solid rgba(201,163,92,0.4);
  box-shadow: 0 24px 60px rgba(0,0,0,0.7), inset 0 0 40px rgba(0,0,0,0.5);
  overflow: hidden;
}
#edbook-page {
  position: absolute; inset: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
}
#edbook-word {
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(30px, 5vw, 46px); letter-spacing: 0.1em;
  color: var(--gold-bright); text-align: center;
  text-shadow: 0 0 18px rgba(201,163,92,0.35);
  min-height: 1.3em;
}
#edbook-word.show { animation: edWordIn 0.4s ease; }
@keyframes edWordIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
#edbook-sprout {
  font-size: 26px; color: var(--gold);
  text-shadow: 0 0 12px rgba(201,163,92,0.5);
  transition: transform 0.5s ease, opacity 0.5s ease;
}
#edbook-no { font-size: 13px; color: var(--paper-dim); letter-spacing: 0.25em; }
#edbook-flipper {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, rgba(232,220,195,0.14), rgba(232,220,195,0.02) 60%);
}
#edbook-caption { font-size: 14px; color: var(--paper-dim); letter-spacing: 0.3em; }

/* ---------- 首页动态背景 ---------- */
#start-video-stack {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden;
}
.start-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.72) saturate(0.92);
  opacity: 1;
}
.start-veil {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(3,3,2,0.42) 0%, rgba(3,3,2,0.18) 30%, rgba(3,3,2,0.32) 64%, rgba(3,3,2,0.86) 100%),
    radial-gradient(ellipse 120% 90% at 50% 44%, transparent 42%, rgba(3,3,2,0.62) 100%);
  pointer-events: none;
}

/* Network loading stays above the retained scene; never uncover unfinished media. */
#media-loading { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: rgba(3,4,3,.88); color: #d1c3a6; font-size: 15px; letter-spacing: .14em; }
#media-loading[hidden], #media-loading button[hidden] { display: none; }
#media-loading button { color: var(--gold-bright); border: 1px solid var(--gold-dim); padding: 12px 26px; background: #211c11; font: inherit; cursor: pointer; }

#load-status button { font: inherit; color: #c7b792; background: #14110ccc; border: 1px solid #8c764951; padding: 6px 12px; cursor: pointer; }
