/* =========================================================
   回声房间 · Echo Chamber
   移动端优先 / 无外部依赖 / 暗色循环房间
   ========================================================= */

:root {
  --bg: #0B0806;
  --bg-2: #17100B;
  --ink: #F7EEE5;
  --ink-soft: #DCCABB;
  --ink-dim: #B7A392;
  --muted: #8E7A69;
  --line: rgba(255, 170, 112, 0.14);
  --line-strong: rgba(255, 170, 112, 0.30);
  --orange: #FF8A3D;
  --orange-light: #FFB066;
  --orange-deep: #E4611A;
  --teal: #7FC9BE;
  --danger: #E0755A;
  --card: rgba(30, 22, 17, 0.74);
  --card-solid: #1B130E;
  --radius: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.modal-open { overflow: hidden; }

button {
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 2px solid rgba(255, 176, 112, 0.8);
  outline-offset: 3px;
}

.is-hidden { display: none !important; }

/* ---------- 氛围层 ---------- */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #0B0806;
}

.room-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.8s ease, filter 0.8s ease;
}

.art-halo {
  transform-box: fill-box;
  transform-origin: center;
  animation: haloBreathe 8s ease-in-out infinite;
}

.ripple {
  transform-box: fill-box;
  transform-origin: center;
  animation: echoRipple 7s ease-out infinite;
}
.ripple.r2 { animation-delay: 1.1s; }
.ripple.r3 { animation-delay: 2.2s; }

.dust {
  transform-box: fill-box;
  transform-origin: center;
  animation: dustFloat 9s ease-in-out infinite alternate;
}
.dust.d2 { animation-delay: -2s; animation-duration: 11s; }
.dust.d3 { animation-delay: -4s; animation-duration: 13s; }
.dust.d4 { animation-delay: -1s; animation-duration: 10s; }
.dust.d5 { animation-delay: -6s; animation-duration: 14s; }
.dust.d6 { animation-delay: -3s; animation-duration: 12s; }
.dust.d7 { animation-delay: -7s; animation-duration: 15s; }
.dust.d8 { animation-delay: -5s; animation-duration: 10s; }

.atmo-glow {
  position: absolute;
  left: 50%;
  top: 44%;
  width: min(86vw, 420px);
  height: min(86vw, 420px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 61, 0.20) 0%, rgba(255, 138, 61, 0.07) 42%, rgba(255, 138, 61, 0) 70%);
  transform: translate(-50%, -50%);
  filter: blur(6px);
  animation: lightFlicker 6.5s ease-in-out infinite;
}

.atmo-grain {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0, rgba(255, 255, 255, 0.012) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: overlay;
}

.atmo-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 3, 2, 0.82) 0%, rgba(4, 3, 2, 0.12) 24%, rgba(4, 3, 2, 0) 44%, rgba(4, 3, 2, 0.28) 74%, rgba(4, 3, 2, 0.88) 100%),
    radial-gradient(120% 80% at 50% 48%, rgba(0, 0, 0, 0) 34%, rgba(0, 0, 0, 0.5) 100%);
}

body.is-playing .room-art { opacity: 0.62; filter: saturate(0.9) brightness(0.86); }
body.is-playing .atmo-glow { opacity: 0.7; }
body.is-won .atmo-glow {
  background: radial-gradient(circle, rgba(255, 196, 138, 0.42) 0%, rgba(255, 138, 61, 0.16) 45%, rgba(255, 138, 61, 0) 72%);
}

/* ---------- 页面骨架 ---------- */

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
}

.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

.screen.is-active {
  display: flex;
  animation: screenIn 0.55s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.screen--intro,
.screen--win {
  align-items: stretch;
  justify-content: center;
}

.screen--play {
  flex-direction: column;
}

.intro-shell,
.play-shell,
.win-shell {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* ---------- 封面 ---------- */

.intro-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: calc(var(--safe-top) + 26px) 20px calc(var(--safe-bottom) + 20px);
}

.intro-head {
  text-align: center;
  padding-top: 6px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 0 11px;
  border: 1px solid rgba(255, 170, 112, 0.18);
  border-radius: 999px;
  background: rgba(22, 15, 11, 0.5);
  color: #C9A98E;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.eyebrow__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 10px rgba(255, 138, 61, 0.9);
  animation: dotPulse 2.8s ease-in-out infinite;
}

.game-title {
  margin: 18px 0 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
}

.game-title__cn {
  display: block;
  font-size: clamp(42px, 12vw, 56px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0.12em;
  text-indent: 0.12em;
  color: #FFF3E7;
  text-shadow:
    0 0 38px rgba(255, 138, 61, 0.42),
    0 0 12px rgba(255, 138, 61, 0.20),
    0 2px 0 rgba(0, 0, 0, 0.35);
}

.game-title__en {
  display: block;
  margin-top: 11px;
  color: rgba(255, 176, 112, 0.66);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.52em;
  text-indent: 0.52em;
}

.premise {
  margin: 16px auto 0;
  max-width: 330px;
  color: #C8B5A4;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 14px;
  line-height: 1.92;
  letter-spacing: 0.01em;
}

.premise em {
  color: #FFBD86;
  font-style: normal;
  text-shadow: 0 0 18px rgba(255, 138, 61, 0.32);
}

/* 房间档案 */
.concept-card {
  position: relative;
  padding: 14px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(155deg, rgba(50, 35, 25, 0.82), rgba(20, 15, 11, 0.88));
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 226, 200, 0.07);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.concept-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(130% 70% at 50% -10%, rgba(255, 138, 61, 0.12), transparent 55%);
}

.concept-head {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 9px;
  border-bottom: 1px dashed rgba(255, 170, 112, 0.15);
  color: #9B8069;
  font-size: 10px;
  letter-spacing: 0.18em;
}

.concept-progress {
  color: #B78B67;
  letter-spacing: 0.05em;
  font-size: 10.5px;
  white-space: nowrap;
}

.concept-progress b {
  color: var(--orange-light);
  font-size: 13px;
  font-weight: 700;
}

.concept-list {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.concept-list li {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.concept-list li:last-child { border-bottom: 0; }

.concept-ico {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 170, 112, 0.16);
  border-radius: 10px;
  background: rgba(255, 138, 61, 0.085);
  color: #FFAC6B;
}

.concept-ico .mp-icon { width: 18px; height: 18px; }

.concept-txt {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.concept-txt b {
  color: #EDDACB;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.concept-txt small {
  color: #A08A77;
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

.code-pips {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 7px;
  padding-top: 11px;
}

.code-pips span {
  width: 34px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.09);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.code-pips span.is-filled {
  background: linear-gradient(90deg, #FFB066, #FF7C2C);
  box-shadow: 0 0 12px rgba(255, 138, 61, 0.5);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  transition: transform 0.14s ease, filter 0.18s ease, box-shadow 0.18s ease;
  user-select: none;
  -webkit-user-select: none;
}

.btn--primary {
  color: #2A1407;
  background: linear-gradient(180deg, #FFA65F 0%, #FF8A3D 48%, #EF641A 100%);
  box-shadow:
    0 14px 34px rgba(255, 118, 38, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    inset 0 -2px 0 rgba(130, 45, 0, 0.28);
}

.btn--primary:active {
  transform: translateY(1px) scale(0.986);
  filter: brightness(0.96);
}

.btn--primary .mp-icon { width: 19px; height: 19px; }

.btn--hero {
  width: 100%;
  min-height: 56px;
  font-size: 16px;
  border-radius: 18px;
}

.btn--wide { width: 100%; }

.btn-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 9px;
  color: #A28B78;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  border-radius: 10px;
  transition: color 0.18s ease, background 0.18s ease;
}

.btn-text:active { color: #FFC293; background: rgba(255, 138, 61, 0.07); }
.btn-text .mp-icon { width: 15px; height: 15px; }
.btn-text--sm { min-height: 30px; padding: 0 4px; font-size: 11px; }

.intro-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.intro-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 38px;
}

.footnote {
  margin: 0;
  padding-bottom: 2px;
  color: #8A7565;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.22em;
}

/* ---------- 游戏页 ---------- */

.play-shell {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 13px;
  padding: calc(var(--safe-top) + 14px) 16px 16px;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 0;
}

.hud-loop,
.hud-hearts {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
}

.hud-kicker {
  color: #A08874;
  font-size: 9.5px;
  letter-spacing: 0.16em;
}

.loop-segments {
  display: inline-flex;
  gap: 4px;
}

.loop-segments i {
  display: block;
  width: 20px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.loop-segments i.is-done {
  background: rgba(255, 138, 61, 0.5);
}

.loop-segments i.is-current {
  background: linear-gradient(90deg, #FFB066, #FF7C2C);
  box-shadow: 0 0 9px rgba(255, 138, 61, 0.55);
  animation: segmentPulse 2.4s ease-in-out infinite;
}

.hud-count {
  color: #B79A82;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.hud-hearts .heart {
  width: 16px;
  height: 16px;
  color: #FF9A4F;
  filter: drop-shadow(0 0 5px rgba(255, 128, 40, 0.45));
  transition: color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.hud-hearts .heart.is-off {
  color: #57463B;
  opacity: 0.55;
  filter: none;
  transform: scale(0.92);
}

.loop-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 1px 2px 0;
}

.loop-heading h2 {
  margin: 0;
  color: #F6E5D6;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-shadow: 0 0 26px rgba(255, 138, 61, 0.16);
}

.loop-heading p {
  margin: 0;
  color: #A48469;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.rule-card {
  padding: 11px 14px 10px;
  border: 1px solid rgba(255, 170, 112, 0.16);
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(255, 138, 61, 0.075), rgba(255, 255, 255, 0.018));
}

.rule-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rule-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #C9A98D;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.rule-label .mp-icon { width: 13px; height: 13px; color: #E89B60; }

.rule-tag {
  padding: 3px 8px;
  border: 1px solid rgba(255, 138, 61, 0.34);
  border-radius: 999px;
  background: rgba(255, 138, 61, 0.12);
  color: #FFB77E;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.rule-text {
  margin: 7px 0 0;
  color: #D4BFAE;
  font-size: 12px;
  line-height: 1.65;
  letter-spacing: 0.01em;
}

.rule-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 8px 0 0;
  padding-top: 7px;
  border-top: 1px dashed rgba(255, 170, 112, 0.12);
  color: #7FA69F;
  font-size: 10px;
  line-height: 1.4;
}

.rule-note .mp-icon { width: 12px; height: 12px; flex: 0 0 auto; }

.anchor-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px;
  border: 1px solid rgba(255, 170, 112, 0.27);
  border-radius: 16px;
  background:
    linear-gradient(140deg, rgba(255, 154, 85, 0.16), rgba(255, 138, 61, 0.035) 72%),
    rgba(25, 18, 13, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 226, 200, 0.06);
}

.anchor-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.anchor-kicker {
  color: #B88F70;
  font-size: 9.5px;
  letter-spacing: 0.13em;
}

.anchor-left b {
  color: #FFD5B1;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-shadow: 0 0 16px rgba(255, 138, 61, 0.26);
}

.anchor-note {
  color: #A08067;
  text-align: right;
  font-size: 9.5px;
  line-height: 1.5;
  letter-spacing: 0.06em;
}

.clue-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 1px;
}

.section-title span {
  color: #E2CFBF;
  font-size: 12.5px;
  letter-spacing: 0.08em;
}

.section-title em {
  color: #95806D;
  font-size: 9.5px;
  font-style: normal;
  letter-spacing: 0.02em;
  text-align: right;
}

.clue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clue {
  position: relative;
  display: flex;
  width: 100%;
  align-items: stretch;
  gap: 10px;
  padding: 12px 12px 11px 13px;
  overflow: hidden;
  border: 1px solid rgba(255, 192, 145, 0.11);
  border-radius: 15px;
  background:
    linear-gradient(158deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.014)),
    rgba(25, 18, 14, 0.76);
  box-shadow: 0 9px 18px rgba(0, 0, 0, 0.18);
  text-align: left;
  transition: transform 0.12s ease, border-color 0.2s ease, background 0.2s ease;
  animation: clueIn 0.46s cubic-bezier(0.2, 0.75, 0.25, 1) both;
  animation-delay: calc(var(--i, 0) * 62ms);
}

.clue::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(100% 130% at 0% 50%, rgba(255, 138, 61, 0.055), transparent 55%);
}

.clue:active { transform: scale(0.988); }

.clue-index {
  flex: 0 0 16px;
  padding-top: 4px;
  color: #6F5C4D;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.clue-body {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.clue-quote {
  color: #F1E2D4;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 15.5px;
  line-height: 1.6;
  letter-spacing: 0.015em;
  word-break: break-word;
}

.clue-meta {
  color: #97806D;
  font-size: 9.5px;
  letter-spacing: 0.1em;
}

.clue-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  align-self: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  border: 1px dashed rgba(255, 180, 120, 0.26);
  border-radius: 50%;
  color: transparent;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.clue[data-mark="1"] {
  border-color: rgba(255, 138, 61, 0.48);
  background:
    linear-gradient(158deg, rgba(255, 138, 61, 0.13), rgba(255, 255, 255, 0.018)),
    rgba(30, 20, 14, 0.8);
}
.clue[data-mark="1"] .clue-mark {
  border-style: solid;
  border-color: transparent;
  background: linear-gradient(180deg, #FFA65F, #F47A28);
  color: #2A1407;
  box-shadow: 0 0 14px rgba(255, 138, 61, 0.35);
}

.clue[data-mark="2"] {
  border-color: rgba(180, 160, 145, 0.26);
  background:
    linear-gradient(158deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    rgba(23, 18, 15, 0.82);
}
.clue[data-mark="2"] .clue-mark {
  border-style: solid;
  border-color: rgba(180, 160, 145, 0.38);
  background: #4A3D33;
  color: #EADCCE;
}

.clue[data-mark="3"] {
  border-color: rgba(127, 201, 190, 0.36);
  background:
    linear-gradient(158deg, rgba(127, 201, 190, 0.09), rgba(255, 255, 255, 0.012)),
    rgba(21, 20, 17, 0.8);
}
.clue[data-mark="3"] .clue-mark {
  border-style: solid;
  border-color: rgba(127, 201, 190, 0.5);
  background: rgba(127, 201, 190, 0.16);
  color: #9BDCD2;
  font-size: 8px;
}

/* 回声声纹：双影 + 左侧冷光 */
.clue--echo::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 2px;
  opacity: 0;
  background: linear-gradient(180deg, rgba(127, 201, 190, 0.65), rgba(127, 201, 190, 0.08));
  transition: opacity 0.2s ease;
}

.clue--echo[data-mark="3"]::before { opacity: 1; }

.clue--echo .clue-quote {
  color: #CFC0B3;
  text-shadow: 1.5px 0 rgba(127, 201, 190, 0.15), -1.5px 0 rgba(255, 138, 61, 0.10);
}

.clue--echo .clue-meta { color: #748E88; }

.play-bottom-space { height: 6px; }

/* 底部操作条 */
.action-dock {
  position: sticky;
  bottom: 0;
  z-index: 6;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px calc(var(--safe-bottom) + 11px);
  background: linear-gradient(180deg, rgba(11, 8, 6, 0) 0%, rgba(11, 8, 6, 0.86) 26%, #0B0806 66%, #0B0806 100%);
}

.action-dock .btn--primary {
  min-height: 49px;
  font-size: 14.5px;
}

.dock-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  padding-top: 2px;
  color: #8E7866;
  font-size: 9.5px;
  letter-spacing: 0.02em;
  text-align: center;
}

.dock-dot { color: #544438; }

/* ---------- 通关 ---------- */

.screen--win { align-items: center; }

.win-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--safe-top) + 34px) 20px calc(var(--safe-bottom) + 24px);
  text-align: center;
}

.win-seal {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 179, 121, 0.38);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 200, 155, 0.3), rgba(255, 138, 61, 0.12));
  color: #FFC08B;
  box-shadow: 0 0 40px rgba(255, 138, 61, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.win-seal .mp-icon { width: 28px; height: 28px; }

.win-eyebrow {
  margin: 4px 0 0;
  color: #B58F70;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
}

.win-title {
  margin: 0;
  color: #FFF0E1;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: clamp(42px, 13vw, 54px);
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  text-shadow: 0 0 44px rgba(255, 138, 61, 0.48);
}

.win-story {
  margin: 0;
  color: #D2BEAC;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 14px;
  line-height: 1.95;
}

.win-codes {
  display: flex;
  width: 100%;
  max-width: 360px;
  gap: 8px;
  margin: 8px 0 2px;
}

.win-code {
  flex: 1;
  padding: 11px 5px 10px;
  border: 1px solid rgba(255, 170, 112, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(160deg, rgba(255, 138, 61, 0.12), rgba(255, 255, 255, 0.02)),
    rgba(24, 17, 12, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 226, 200, 0.07);
}

.win-code small {
  display: block;
  color: #8C715C;
  font-size: 8.5px;
  letter-spacing: 0.16em;
}

.win-code b {
  display: block;
  margin-top: 3px;
  color: #FFD3AE;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
}

.win-epilogue {
  margin: 2px 0 0;
  color: #A58C78;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 12.5px;
  line-height: 1.85;
}

.win-actions {
  display: flex;
  width: 100%;
  max-width: 360px;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.win-foot {
  margin: 6px 0 0;
  color: #655345;
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

/* ---------- 弹层 ---------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.26s ease, visibility 0.26s ease;
}

.sheet.is-open {
  visibility: visible;
  opacity: 1;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 4, 3, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 94vh;
  max-height: 94dvh;
  overflow-y: auto;
  padding: 12px 20px calc(var(--safe-bottom) + 20px);
  border: 1px solid rgba(255, 170, 112, 0.18);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  background:
    radial-gradient(120% 50% at 50% 0%, rgba(255, 138, 61, 0.10), transparent 60%),
    linear-gradient(180deg, #241911 0%, #140E0A 68%, #110C09 100%);
  box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.66), inset 0 1px 0 rgba(255, 226, 200, 0.08);
  transform: translateY(26px);
  transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
  overscroll-behavior: contain;
}

.sheet.is-open .sheet-panel { transform: translateY(0); }

.sheet-grip {
  width: 38px;
  height: 4px;
  margin: 0 auto 15px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.16);
}

.sheet-title {
  margin: 2px 0 0;
  color: #F7E7D7;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
}

.sheet-sub {
  margin: 7px 0 0;
  color: #947C69;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: center;
}

.sheet-sub--block { margin: 10px auto 20px; max-width: 280px; line-height: 1.7; }

.sheet-close { display: flex; margin: 4px auto 0; }

/* 密码弹层 */
.sheet-panel--code { padding-bottom: calc(var(--safe-bottom) + 16px); }

.code-slots {
  display: flex;
  justify-content: center;
  gap: 11px;
  margin: 18px 0 17px;
}

.code-slot {
  display: grid;
  place-items: center;
  width: 64px;
  height: 74px;
  border: 1px solid rgba(255, 170, 112, 0.22);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.26);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.36);
  color: #FFD8B8;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 35px;
  font-weight: 700;
  line-height: 1;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.code-slot.is-filled {
  border-color: rgba(255, 138, 61, 0.58);
  background: rgba(255, 138, 61, 0.08);
  text-shadow: 0 0 20px rgba(255, 138, 61, 0.5);
}

.code-slots.is-shaking { animation: slotShake 0.42s ease; }

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 13px;
}

.key {
  display: grid;
  place-items: center;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.042);
  color: #F1E2D4;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.12s ease, transform 0.12s ease;
}

.key:active {
  background: rgba(255, 138, 61, 0.18);
  transform: scale(0.965);
}

.key--util { color: #AD9481; font-size: 12px; }
.key--util .mp-icon { width: 20px; height: 20px; }

/* 获得密码 */
.sheet-panel--result {
  padding-top: 26px;
  text-align: center;
}

.result-seal {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border: 1px solid rgba(255, 176, 112, 0.42);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 210, 168, 0.32), rgba(255, 138, 61, 0.1));
  color: #FFC28C;
  box-shadow: 0 0 34px rgba(255, 138, 61, 0.3);
}

.result-seal .mp-icon { width: 25px; height: 25px; }

.result-kicker {
  margin: 0;
  color: #A8866B;
  font-size: 10px;
  letter-spacing: 0.2em;
}

.result-title {
  margin: 7px 0 0;
  color: #F8E8D8;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 24px;
  letter-spacing: 0.08em;
}

.result-code {
  margin: 11px 0 2px;
  color: #FFCEA4;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 43px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-shadow: 0 0 34px rgba(255, 138, 61, 0.5);
}

.result-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 7px auto 12px;
  max-width: 230px;
  color: rgba(255, 170, 112, 0.55);
}

.result-divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 170, 112, 0.28), transparent);
}

.result-divider .mp-icon { width: 12px; height: 12px; }

.result-story {
  margin: 0 auto 20px;
  max-width: 300px;
  color: #C8B4A2;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 13px;
  line-height: 1.85;
}

.result-foot {
  margin: 9px 0 0;
  color: #6E5A4A;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-align: center;
}

/* 失败 */
.sheet-panel--fail { padding-top: 28px; text-align: center; }

.fail-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin: 0 auto 12px;
  border: 1px solid rgba(224, 117, 90, 0.32);
  border-radius: 50%;
  background: rgba(224, 117, 90, 0.1);
  color: #E08A73;
}

.fail-icon .mp-icon { width: 24px; height: 24px; }

/* 玩法说明 */
.sheet-panel--how { padding-bottom: calc(var(--safe-bottom) + 18px); }

.how-list {
  margin: 16px 0 18px;
  padding: 0;
  list-style: none;
  counter-reset: how;
}

.how-list li {
  position: relative;
  padding: 0 0 13px 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 12px;
  counter-increment: how;
}

.how-list li:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 2px; }

.how-list li::before {
  content: counter(how, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  color: #D98F58;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.how-list b {
  display: block;
  color: #E9D7C7;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.how-list span {
  display: block;
  margin-top: 4px;
  color: #9D8775;
  font-size: 11.5px;
  line-height: 1.65;
}

/* ---------- 提示 / 转场 ---------- */

.toast {
  position: fixed;
  top: calc(var(--safe-top) + 14px);
  left: 50%;
  z-index: 200;
  max-width: calc(100vw - 40px);
  padding: 10px 16px;
  border: 1px solid rgba(255, 170, 112, 0.22);
  border-radius: 999px;
  background: rgba(30, 21, 15, 0.94);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
  color: #E9D6C5;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  border-color: rgba(224, 117, 90, 0.36);
  color: #F0B8A8;
}

.loop-flash {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 5, 4, 0.62);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.loop-flash.is-show {
  opacity: 1;
  visibility: visible;
}

.loop-flash span {
  color: #FFDDC1;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 28px;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  text-shadow: 0 0 36px rgba(255, 138, 61, 0.5);
  transform: translateY(8px);
  transition: transform 0.45s ease;
}

.loop-flash.is-show span { transform: translateY(0); }

/* ---------- 动画 ---------- */

@keyframes screenIn {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes clueIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes haloBreathe {
  0%, 100% { opacity: 0.78; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.07); }
}

@keyframes lightFlicker {
  0%, 100% { opacity: 0.72; }
  38% { opacity: 0.92; }
  46% { opacity: 0.68; }
  58% { opacity: 1; }
}

@keyframes echoRipple {
  0% { opacity: 0; transform: scale(0.78); }
  22% { opacity: 0.9; }
  100% { opacity: 0; transform: scale(1.32); }
}

@keyframes dustFloat {
  from { transform: translate3d(0, 4px, 0); }
  to { transform: translate3d(7px, -12px, 0); }
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.55; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.35); }
}

@keyframes segmentPulse {
  0%, 100% { opacity: 0.78; }
  50% { opacity: 1; }
}

@keyframes slotShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

@keyframes heartLost {
  0% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.92); opacity: 0.55; }
}

.heart.is-just-lost { animation: heartLost 0.5s ease both; }

/* ---------- 短屏适配 ---------- */

@media (max-height: 740px) {
  .intro-shell { gap: 13px; padding-top: calc(var(--safe-top) + 18px); }
  .game-title { margin-top: 12px; }
  .game-title__cn { font-size: 42px; }
  .premise { margin-top: 10px; font-size: 13px; line-height: 1.78; }
  .concept-list li { padding: 7px 2px; }
  .concept-txt small { font-size: 10.5px; }
  .play-shell { gap: 10px; }
  .clue { padding-top: 10px; padding-bottom: 9px; }
  .clue-quote { font-size: 15px; }
}

@media (max-width: 350px) {
  .intro-shell { padding-left: 16px; padding-right: 16px; }
  .play-shell { padding-left: 12px; padding-right: 12px; }
  .action-dock { padding-left: 12px; padding-right: 12px; }
  .clue { gap: 8px; padding-left: 11px; padding-right: 10px; }
  .clue-quote { font-size: 14.5px; }
  .section-title em { display: none; }
  .code-slot { width: 56px; height: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* 超短屏：保证入口按钮在首屏内完整可见 */
@media (max-height: 640px) {
  .intro-shell {
    gap: 10px;
    padding-top: calc(var(--safe-top) + 14px);
    padding-bottom: calc(var(--safe-bottom) + 12px);
  }
  .game-title { margin-top: 9px; }
  .game-title__cn { font-size: 37px; }
  .game-title__en { margin-top: 7px; }
  .premise {
    margin-top: 9px;
    font-size: 12.5px;
    line-height: 1.7;
  }
  .concept-card { padding: 10px 14px; }
  .concept-head { padding-bottom: 6px; }
  .concept-list li { padding: 6px 2px; }
  .concept-ico { width: 28px; height: 28px; }
  .concept-ico .mp-icon { width: 16px; height: 16px; }
  .concept-txt small { display: none; }
  .code-pips { padding-top: 7px; }
  .intro-actions { gap: 2px; }
  .btn--hero { min-height: 50px; }
  .intro-links { min-height: 32px; }
  .footnote { display: none; }
}
