:root {
  --ink: #393249;
  --ink-soft: #6d647b;
  --paper: #f6e9dc;
  --paper-bright: #fff7ec;
  --coral: #d97c6e;
  --coral-deep: #b65d58;
  --gold: #c79a4b;
  --gold-bright: #f0c97a;
  --teal: #5f9690;
  --plum: #5e5379;
  --line: rgba(74, 61, 82, 0.16);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #e9d9d4;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

#app {
  position: fixed;
  inset: 0;
  overflow: clip;
  isolation: isolate;
  background:
    radial-gradient(circle at 69% 24%, rgba(255, 249, 222, 0.92) 0%, rgba(255, 242, 213, 0.4) 20%, transparent 48%),
    radial-gradient(circle at 18% 18%, rgba(255, 241, 229, 0.86) 0%, transparent 38%),
    linear-gradient(162deg, #f7eadb 0%, #f4ded8 34%, #e7d5df 58%, #c9cbe4 81%, #b7c3df 100%);
}

#app::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 247, 202, 0.5), transparent 28%),
    linear-gradient(180deg, rgba(255, 247, 235, 0.24), transparent 32%, rgba(106, 103, 153, 0.08));
  mix-blend-mode: screen;
}

#app[data-level="echo"] {
  background:
    radial-gradient(circle at 74% 22%, rgba(255, 247, 221, 0.9) 0%, rgba(255, 235, 214, 0.4) 19%, transparent 46%),
    radial-gradient(circle at 12% 12%, rgba(255, 236, 230, 0.82) 0%, transparent 36%),
    linear-gradient(160deg, #f6e7da 0%, #f0d9da 32%, #e5d3e0 55%, #cfcce6 78%, #bcc7e1 100%);
}

#app[data-level="stairway"] {
  background:
    radial-gradient(circle at 76% 18%, rgba(255, 241, 204, 0.82) 0%, rgba(255, 226, 190, 0.34) 18%, transparent 45%),
    radial-gradient(circle at 15% 10%, rgba(247, 226, 233, 0.7) 0%, transparent 34%),
    linear-gradient(158deg, #f2e4d8 0%, #e8d5dd 28%, #d4cce0 52%, #b8b6d6 74%, #989fc5 100%);
}

#app[data-level="stairway"] .sky-glow {
  background: radial-gradient(circle, rgba(255, 242, 205, 0.72) 0%, rgba(255, 218, 184, 0.18) 35%, transparent 70%);
}

#scene {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}

.sky-glow {
  position: absolute;
  z-index: 1;
  top: -18vh;
  right: 4vw;
  width: min(58vw, 62rem);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 248, 213, 0.75) 0%, rgba(255, 230, 192, 0.22) 35%, transparent 70%);
  filter: blur(12px);
  animation: sky-breathe 15s ease-in-out infinite alternate;
}

.grain {
  position: absolute;
  inset: -30%;
  z-index: 20;
  opacity: 0.055;
  pointer-events: none;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
  background-size: 230px 230px;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 19;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 44%, transparent 44%, rgba(83, 68, 100, 0.12) 100%),
    linear-gradient(180deg, rgba(80, 65, 91, 0.08), transparent 13%, transparent 82%, rgba(76, 66, 91, 0.12));
}

.cursor-glow {
  position: fixed;
  z-index: 6;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 238, 180, 0.8), rgba(255, 213, 154, 0.18) 42%, transparent 72%);
  box-shadow: 0 0 22px rgba(255, 218, 148, 0.32);
  transition: opacity 0.3s ease, width 0.2s ease, height 0.2s ease, margin 0.2s ease;
  mix-blend-mode: screen;
}

.cursor-glow.is-on {
  opacity: 1;
}

.cursor-glow.is-hover {
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
}

/* ---------- HUD ---------- */

.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.hud {
  position: absolute;
  z-index: 12;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: max(26px, env(safe-area-inset-top)) clamp(22px, 4vw, 58px) 0;
  pointer-events: none;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chapter-display {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 7px 8px 7px 0;
  filter: drop-shadow(0 1px 12px rgba(255, 248, 235, 0.6));
}

.chapter-glyph {
  position: relative;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(92, 77, 96, 0.28);
  border-radius: 50%;
  transform: rotate(45deg);
}

.chapter-glyph::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(199, 154, 75, 0.7);
  border-radius: 50%;
}

.chapter-glyph span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  margin: -2px;
  border-radius: 50%;
  background: var(--gold);
}

.chapter-glyph span:nth-child(1) {
  transform: translate(0, -11px);
}

.chapter-glyph span:nth-child(2) {
  transform: translate(9px, 5px);
}

.chapter-glyph span:nth-child(3) {
  transform: translate(-9px, 5px);
}

.chapter-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chapter-kicker {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.32em;
  line-height: 1;
}

.chapter-name {
  font-family: var(--serif);
  font-size: clamp(17px, 1.45vw, 21px);
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.2;
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  pointer-events: auto;
}

.level-dots {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(73, 61, 82, 0.1);
  border-radius: 99px;
  background: rgba(255, 248, 238, 0.34);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.level-dots i {
  position: relative;
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: rgba(80, 67, 92, 0.24);
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.5s ease;
}

.level-dots i.is-active {
  width: 20px;
  background: var(--coral);
}

.level-dots i.is-done {
  background: var(--gold);
}

.toolbar {
  display: flex;
  gap: 7px;
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(73, 61, 82, 0.13);
  border-radius: 50%;
  background: rgba(255, 248, 238, 0.46);
  color: rgba(57, 50, 73, 0.78);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.icon-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 250, 242, 0.86);
  border-color: rgba(199, 154, 75, 0.4);
}

.icon-btn:active {
  transform: translateY(0) scale(0.94);
}

.icon-btn .icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn .icon-sound path:first-child,
.icon-btn .icon-muted path:first-child {
  fill: currentColor;
  stroke: none;
}

.icon-muted {
  display: none;
}

.icon-btn.is-muted .icon-sound {
  display: none;
}

.icon-btn.is-muted .icon-muted {
  display: block;
}

.objective-card {
  position: absolute;
  z-index: 12;
  left: clamp(22px, 4vw, 58px);
  bottom: max(32px, calc(env(safe-area-inset-bottom) + 22px));
  width: min(330px, calc(100vw - 44px));
  padding: 20px 22px 17px;
  border: 1px solid rgba(79, 63, 87, 0.12);
  border-radius: 3px 18px 3px 18px;
  background:
    linear-gradient(120deg, rgba(255, 249, 239, 0.84), rgba(255, 242, 231, 0.6));
  box-shadow: 0 16px 45px -22px rgba(64, 48, 74, 0.45), inset 0 1px rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.objective-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 22px;
  width: 42px;
  height: 1px;
  background: var(--gold);
}

.objective-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--coral-deep);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.objective-eyebrow i {
  display: inline-block;
  width: 5px;
  height: 5px;
  transform: rotate(45deg);
  background: var(--gold);
}

.objective-card p {
  margin: 8px 0 11px;
  color: #4a4158;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: 0.04em;
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.text-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s ease;
}

.text-btn:hover {
  color: var(--coral-deep);
  border-color: rgba(182, 93, 88, 0.34);
}

.text-btn:hover svg {
  transform: translateX(3px);
}

.control-tip {
  position: absolute;
  z-index: 12;
  right: clamp(22px, 4vw, 58px);
  bottom: max(38px, calc(env(safe-area-inset-bottom) + 28px));
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(59, 51, 72, 0.65);
  font-size: 11px;
  letter-spacing: 0.08em;
  filter: drop-shadow(0 1px 10px rgba(255, 248, 235, 0.9));
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.tip-orbit {
  position: relative;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(199, 154, 75, 0.5);
  border-radius: 50%;
  animation: orbit-spin 9s linear infinite;
}

.tip-orbit::before,
.tip-orbit::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: rgba(199, 154, 75, 0.62);
}

.tip-orbit::before {
  width: 1px;
  height: 100%;
  transform: translate(-50%, -50%) rotate(45deg);
}

.tip-orbit::after {
  width: 100%;
  height: 1px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.tip-orbit i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 9px rgba(240, 201, 122, 0.8);
}

.toast {
  position: absolute;
  z-index: 30;
  top: 18%;
  left: 50%;
  padding: 9px 18px;
  border: 1px solid rgba(255, 244, 222, 0.55);
  border-radius: 99px;
  background: rgba(57, 50, 73, 0.78);
  color: #fff7e8;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  backdrop-filter: blur(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  white-space: nowrap;
}

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

/* ---------- Start screen ---------- */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  transition: opacity 0.9s ease, visibility 0.9s;
}

.start-screen {
  display: flex;
  align-items: center;
  padding: 6vh clamp(28px, 9vw, 150px);
  background:
    linear-gradient(90deg, rgba(248, 235, 224, 0.94) 0%, rgba(248, 235, 224, 0.72) 34%, rgba(247, 234, 226, 0.12) 67%, transparent 100%);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}

.start-screen::before {
  content: "";
  position: absolute;
  left: clamp(28px, 9vw, 150px);
  top: 9vh;
  bottom: 9vh;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(199, 154, 75, 0.25) 18%, rgba(199, 154, 75, 0.25) 82%, transparent);
}

.start-inner {
  position: relative;
  width: min(600px, 58vw);
  padding-left: clamp(20px, 4vw, 52px);
  animation: start-reveal 1.4s 0.2s both cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-mark {
  width: 58px;
  height: 58px;
  margin-bottom: 27px;
  color: var(--gold);
  animation: slow-turn 26s linear infinite;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 0.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.start-kicker {
  margin: 0 0 13px;
  color: var(--coral-deep);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.34em;
}

.game-title {
  display: flex;
  margin: 0;
  color: #3b344e;
  font-family: var(--serif);
  font-size: clamp(62px, 8.2vw, 126px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0.04em;
  text-shadow: 0 12px 38px rgba(85, 64, 91, 0.12);
}

.game-title span {
  display: inline-block;
  animation: title-char 1.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.game-title span:nth-child(1) { animation-delay: 0.35s; }
.game-title span:nth-child(2) { animation-delay: 0.44s; }
.game-title span:nth-child(3) { animation-delay: 0.53s; }
.game-title span:nth-child(4) { animation-delay: 0.62s; }

.title-en {
  margin: 15px 0 0 4px;
  color: rgba(73, 63, 88, 0.5);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.54em;
}

.start-lead {
  margin: clamp(28px, 4.2vh, 46px) 0 0;
  color: #5a5067;
  font-family: var(--serif);
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.9;
  letter-spacing: 0.1em;
}

.mobile-break {
  display: none;
}

.primary-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  min-width: 178px;
  height: 54px;
  padding: 0 25px;
  overflow: hidden;
  border: 1px solid rgba(169, 121, 63, 0.55);
  border-radius: 2px 16px 2px 16px;
  background:
    linear-gradient(120deg, rgba(255, 248, 234, 0.94), rgba(248, 226, 202, 0.88));
  box-shadow: 0 14px 34px -18px rgba(91, 63, 52, 0.55), inset 0 1px rgba(255, 255, 255, 0.8);
  color: #574459;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.primary-btn::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(199, 154, 75, 0.18);
  border-radius: 1px 12px 1px 12px;
  pointer-events: none;
}

.primary-btn:hover {
  transform: translateY(-3px);
  border-color: rgba(169, 121, 63, 0.9);
  box-shadow: 0 22px 38px -18px rgba(91, 63, 52, 0.55), inset 0 1px rgba(255, 255, 255, 0.9);
}

.primary-btn:active {
  transform: translateY(-1px) scale(0.985);
}

.primary-btn .btn-label {
  position: relative;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
}

.primary-btn svg {
  position: relative;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s ease;
}

.primary-btn:hover svg {
  transform: translateX(4px);
}

.btn-halo {
  position: absolute;
  top: 50%;
  left: -30%;
  width: 36%;
  height: 220%;
  transform: translateY(-50%) rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: btn-shine 5.5s 2.8s ease-in-out infinite;
}

.start-btn {
  margin-top: clamp(28px, 4.5vh, 50px);
  min-width: 206px;
}

.start-meta {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 24px;
  color: rgba(74, 63, 86, 0.55);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.start-meta i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(199, 154, 75, 0.7);
}

.start-side {
  position: absolute;
  right: clamp(24px, 4vw, 64px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  writing-mode: vertical-rl;
  color: rgba(62, 53, 75, 0.38);
  font-size: 9px;
  letter-spacing: 0.36em;
}

.start-side::after {
  content: "";
  width: 1px;
  height: 90px;
  background: linear-gradient(180deg, rgba(199, 154, 75, 0.5), transparent);
}

.start-footer {
  position: absolute;
  left: clamp(28px, 9vw, 150px);
  right: clamp(24px, 4vw, 64px);
  bottom: max(24px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(69, 58, 81, 0.4);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.footer-ornament {
  color: var(--gold);
  font-size: 10px;
}

/* ---------- Chapter intro ---------- */

.chapter-intro {
  position: absolute;
  z-index: 14;
  top: 50%;
  left: 50%;
  width: min(560px, 84vw);
  transform: translate(-50%, -48%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.7s ease, visibility 0.7s, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 4px 22px rgba(255, 247, 235, 0.9));
}

.chapter-intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 150%;
  height: 250%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 249, 239, 0.7) 0%, rgba(255, 247, 236, 0.3) 38%, transparent 70%);
  filter: blur(18px);
}

.chapter-intro.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%);
}

.intro-rule {
  width: 74px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(199, 154, 75, 0.9), transparent);
}

.chapter-intro p {
  margin: 13px 0;
  color: var(--coral-deep);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
}

.chapter-intro h2 {
  margin: 1px 0 2px;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 400;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: #3d3650;
}

#introPoem {
  color: rgba(70, 59, 82, 0.66);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-indent: 0.12em;
  margin: 15px 0;
}

/* ---------- Complete screen ---------- */

.complete-screen {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 247, 227, 0.9) 0%, rgba(244, 224, 216, 0.78) 33%, rgba(113, 100, 137, 0.32) 100%);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.complete-card {
  position: relative;
  width: min(560px, 92vw);
  padding: clamp(42px, 6vh, 64px) clamp(30px, 5vw, 64px) 38px;
  border: 1px solid rgba(90, 72, 92, 0.16);
  border-radius: 3px 32px 3px 32px;
  background:
    linear-gradient(145deg, rgba(255, 251, 242, 0.94), rgba(252, 237, 225, 0.88));
  box-shadow: 0 40px 100px -34px rgba(64, 46, 71, 0.55), inset 0 1px rgba(255, 255, 255, 0.9);
  text-align: center;
}

.complete-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(199, 154, 75, 0.2);
  border-radius: 2px 25px 2px 25px;
  pointer-events: none;
}

.complete-seal {
  width: 62px;
  height: 62px;
  margin: 0 auto 21px;
  color: var(--gold);
  animation: seal-float 5s ease-in-out infinite;
}

.complete-seal svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 0.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.complete-kicker {
  margin: 0 0 10px;
  color: var(--coral-deep);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.34em;
}

.complete-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 400;
  letter-spacing: 0.15em;
  text-indent: 0.15em;
  color: #3c3450;
}

.complete-card > p:last-of-type {
  max-width: 340px;
  margin: 14px auto 0;
  color: rgba(69, 57, 81, 0.68);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: 0.06em;
}

.complete-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3vw, 30px);
  margin: 27px 0 29px;
  padding: 18px 0;
  border-top: 1px solid rgba(88, 72, 95, 0.1);
  border-bottom: 1px solid rgba(88, 72, 95, 0.1);
}

.complete-stats div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.complete-stats span {
  font-family: var(--serif);
  font-size: 24px;
  color: #4a3f59;
}

.complete-stats small {
  color: rgba(80, 67, 94, 0.48);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.complete-stats i {
  width: 1px;
  height: 28px;
  background: rgba(88, 72, 95, 0.12);
}

.complete-card .primary-btn {
  min-width: 196px;
}

.replay-btn {
  display: flex;
  width: max-content;
  margin: 18px auto 0;
}

/* ---------- Modal ---------- */

.modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 22px;
  transition: opacity 0.45s ease, visibility 0.45s;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(58, 49, 72, 0.34);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.modal-card {
  position: relative;
  width: min(740px, 94vw);
  max-height: 90vh;
  overflow: auto;
  padding: clamp(34px, 5vw, 54px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 3px 30px 3px 30px;
  background: linear-gradient(145deg, #fffaf1, #f7e7dc);
  box-shadow: 0 40px 100px -25px rgba(45, 33, 57, 0.6);
  animation: modal-in 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(80, 65, 90, 0.18);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}

.modal-close:hover {
  background: rgba(199, 154, 75, 0.1);
  transform: rotate(90deg);
}

.modal-close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.modal-eyebrow {
  color: var(--coral-deep);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3em;
}

.modal-card h2 {
  margin: 8px 0 30px;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 400;
  letter-spacing: 0.16em;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.help-grid article {
  padding: 20px 16px;
  border-top: 1px solid rgba(199, 154, 75, 0.3);
  background: rgba(255, 252, 246, 0.42);
}

.help-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 15px;
  color: var(--gold);
}

.help-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.help-grid h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.help-grid p {
  margin: 0;
  color: rgba(72, 60, 83, 0.68);
  font-size: 12px;
  line-height: 1.8;
}

.help-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 20px;
  margin-top: 28px;
  padding-top: 19px;
  border-top: 1px solid rgba(88, 72, 95, 0.11);
  color: rgba(72, 60, 83, 0.56);
  font-size: 10px;
}

.help-shortcuts span {
  display: flex;
  align-items: center;
  gap: 6px;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid rgba(88, 72, 95, 0.18);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.55);
  color: rgba(72, 60, 83, 0.68);
  font-family: var(--sans);
  font-size: 9px;
}

/* ---------- Loading / fader ---------- */

.loading {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 23px;
  background:
    radial-gradient(circle at 50% 44%, #fbf0e2, #eedcd8 55%, #d9d3e2);
  transition: opacity 1.1s ease, visibility 1.1s;
}

.loading.is-gone {
  opacity: 0;
  visibility: hidden;
}

.loading-sigil {
  position: relative;
  width: 54px;
  height: 54px;
  animation: slow-turn 9s linear infinite;
}

.loading-sigil span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(199, 154, 75, 0.7);
  border-radius: 50%;
}

.loading-sigil span:nth-child(2) {
  inset: 9px;
  border-color: rgba(94, 83, 121, 0.36);
}

.loading-sigil span:nth-child(3) {
  inset: 21px;
  background: var(--gold);
  border: 0;
  box-shadow: 0 0 18px rgba(240, 201, 122, 0.6);
}

.loading p {
  margin: 0;
  color: rgba(71, 59, 84, 0.58);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
}

.fader {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: #f5e6da;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.75s ease, visibility 0.75s;
}

.fader.is-active {
  opacity: 1;
  visibility: visible;
}

/* ---------- Keyframes ---------- */

@keyframes sky-breathe {
  from { transform: scale(0.96) translate3d(0, 0, 0); opacity: 0.78; }
  to { transform: scale(1.06) translate3d(-2%, 2%, 0); opacity: 1; }
}

@keyframes slow-turn {
  to { transform: rotate(360deg); }
}

@keyframes orbit-spin {
  to { transform: rotate(360deg); }
}

@keyframes start-reveal {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes title-char {
  from { opacity: 0; filter: blur(8px); transform: translateY(22px); }
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

@keyframes btn-shine {
  0%, 62% { left: -36%; opacity: 0; }
  68% { opacity: 0.7; }
  84%, 100% { left: 118%; opacity: 0; }
}

@keyframes seal-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(4deg); }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .start-inner {
    width: min(620px, 72vw);
  }

  .game-title {
    font-size: clamp(58px, 10vw, 96px);
  }

  .level-dots {
    display: none;
  }

  .control-tip {
    display: none;
  }
}

@media (max-width: 680px) {
  .start-screen {
    align-items: flex-end;
    padding: 0 24px 80px;
    background:
      linear-gradient(0deg, rgba(248, 235, 224, 0.97) 0%, rgba(248, 235, 224, 0.76) 38%, rgba(248, 235, 224, 0.04) 78%, transparent 100%);
  }

  .start-screen::before {
    display: none;
  }

  .start-inner {
    width: 100%;
    padding-left: 0;
    padding-bottom: 6px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    margin-bottom: 18px;
  }

  .start-kicker {
    font-size: 8px;
    letter-spacing: 0.22em;
  }

  .game-title {
    font-size: clamp(50px, 17vw, 78px);
  }

  .title-en {
    font-size: 8px;
    letter-spacing: 0.4em;
  }

  .start-lead {
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.8;
  }

  .mobile-break {
    display: block;
  }

  .start-btn {
    width: 100%;
    margin-top: 24px;
  }

  .start-meta {
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
    font-size: 9px;
  }

  .start-side,
  .start-footer {
    display: none;
  }

  .hud {
    padding: max(16px, env(safe-area-inset-top)) 16px 0;
  }

  .chapter-glyph {
    width: 30px;
    height: 30px;
  }

  .chapter-glyph span:nth-child(1) { transform: translate(0, -8px); }
  .chapter-glyph span:nth-child(2) { transform: translate(7px, 4px); }
  .chapter-glyph span:nth-child(3) { transform: translate(-7px, 4px); }

  .chapter-kicker {
    font-size: 8px;
  }

  .chapter-name {
    font-size: 15px;
  }

  .toolbar {
    gap: 5px;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

  .objective-card {
    left: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    width: calc(100vw - 32px);
    padding: 15px 17px 13px;
    border-radius: 2px 14px 2px 14px;
  }

  .objective-card p {
    margin: 6px 0 8px;
    font-size: 13px;
    line-height: 1.55;
  }

  .objective-eyebrow {
    font-size: 9px;
  }

  .text-btn {
    font-size: 10px;
  }

  .toast {
    top: 15%;
    font-size: 12px;
    max-width: calc(100vw - 32px);
    white-space: normal;
    text-align: center;
  }

  .complete-card {
    padding: 36px 24px 30px;
  }

  .complete-stats {
    gap: 14px;
  }

  .complete-stats span {
    font-size: 20px;
  }

  .help-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .help-grid article {
    display: grid;
    grid-template-columns: 46px 1fr;
    column-gap: 13px;
    padding: 14px;
  }

  .help-icon {
    grid-row: span 2;
    width: 38px;
    height: 38px;
    margin: 0;
  }

  .help-grid h3 {
    font-size: 15px;
  }

  .help-grid p {
    font-size: 11px;
  }

  .chapter-intro h2 {
    font-size: 36px;
  }

  #introPoem {
    font-size: 12px;
  }
}

@media (max-height: 680px) and (max-width: 680px) {
  .brand-mark { display: none; }
  .game-title { font-size: 48px; }
  .start-lead { margin-top: 13px; }
  .start-kicker { margin-bottom: 8px; }
  .title-en { margin-top: 9px; }
  .start-btn { margin-top: 17px; height: 48px; }
  .start-meta { display: none; }
}

@media (max-height: 560px) and (min-width: 681px) {
  .hud {
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .start-screen {
    align-items: center;
    padding: 3vh 7vw;
    background:
      linear-gradient(90deg, rgba(248, 235, 224, 0.94) 0%, rgba(248, 235, 224, 0.7) 40%, rgba(248, 235, 224, 0.08) 78%, transparent 100%);
  }

  .start-screen::before {
    top: 5vh;
    bottom: 5vh;
  }

  .start-inner {
    width: min(520px, 56vw);
    padding-left: 30px;
  }

  .brand-mark {
    display: none;
  }

  .start-kicker {
    margin-bottom: 8px;
    font-size: 8px;
  }

  .game-title {
    font-size: clamp(46px, 6.2vw, 58px);
  }

  .title-en {
    margin-top: 8px;
    font-size: 8px;
  }

  .start-lead {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.65;
  }

  .start-btn {
    height: 44px;
    min-width: 178px;
    margin-top: 16px;
  }

  .start-btn .btn-label {
    font-size: 14px;
  }

  .start-meta,
  .start-footer,
  .start-side {
    display: none;
  }

  .chapter-glyph {
    width: 30px;
    height: 30px;
  }

  .chapter-kicker {
    font-size: 8px;
  }

  .chapter-name {
    font-size: 15px;
  }

  .objective-card {
    left: clamp(16px, 4vw, 34px);
    bottom: max(12px, env(safe-area-inset-bottom));
    width: 300px;
    padding: 11px 14px 10px;
  }

  .objective-eyebrow {
    font-size: 8px;
  }

  .objective-card p {
    margin: 4px 0 6px;
    font-size: 11px;
    line-height: 1.45;
  }

  .objective-card .text-btn {
    font-size: 9px;
  }

  .chapter-intro h2 {
    font-size: 34px;
  }

  #introPoem {
    margin: 8px 0;
    font-size: 11px;
  }
}

@media (hover: none) {
  .cursor-glow {
    display: none;
  }
}

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