/* 오경명리 v8.2 · ritual.css
 * 포토리얼리스틱 3D 시네마틱 5단계 명상·전략 플랫폼
 * - 관문 0: 실사 3D 티베트 고대 사원 문 (五經命理 양각 · 청동 사자 문고리 · 3D 좌우 문열림 + 금빛 흡입)
 * - 관문 1: 실사 그래비티(Gravity) 궤도 시공간 부유 + 스모크 글래스 심플 기입 (손/붓 모션 없음)
 * - 관문 2: 실사 3D 오경 성소 (한 줄 룽다 · 왼쪽 석재 벽면 3D 원근 오행 '쾅쾅' 차등 각인 · 고시인성 5 황동 싱잉볼 · 뒤편 7차크라 가부좌 포털)
 * - 관문 3: 3D 가부좌 우주 포털 워프 (7차크라 · ॐ मणि पद्मे हूँ 만다라)
 * - 관문 4: 실사 우주 내면 자아 + 심장 박동("떵, 떵, 떵") 광원 + 스모크 글래스 골든 웨이브 음성 대화 콘솔
 */

.ritual-overlay {
  position: absolute;
  inset: 0;
  z-index: 65;
  display: flex;
  flex-direction: column;
  background: #0d0f12;
  color: #efece4;
  overflow: hidden;
  overscroll-behavior: contain;
  transition: opacity .18s ease, visibility .18s ease;
}
@media (max-width: 767px) {
  .ritual-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: var(--vvh, 100%);
    top: var(--vvt, 0px);
  }
}
html.ritual-open .app-shell > header,
html.ritual-open .app-shell > main,
html.ritual-open .app-shell > nav.bottom-nav {
  display: none !important;
  pointer-events: none;
}
.ritual-overlay .hidden {
  display: none !important;
}
.ritual-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 투명 이펙트 캔버스: 실사 3D 배경 위, 인터랙션 버튼 아래에서 빛·파동·차크라·워프만 합성 */
.ritual-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 12;
}

/* 상단 1줄 슬림 고정 헤더 — 스크롤 시 글자 겹침 방지를 위한 불투명/블러 레이어 분리 */
.ritual-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 42;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(8px + var(--sat)) 12px 8px;
  background: linear-gradient(180deg, rgba(13, 15, 18, 0.72) 0%, rgba(13, 15, 18, 0.24) 72%, rgba(13, 15, 18, 0) 100%);
  pointer-events: none;
  transition: background 0.22s ease, border-color 0.22s ease;
}
.ritual-overlay.is-solid-top .ritual-top {
  background: rgba(13, 15, 18, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(232, 198, 98, 0.14);
}
.ritual-top > * { pointer-events: auto; }
.ritual-top-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ritual-brand-mini {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(13, 15, 18, 0.72);
  border: 1px solid rgba(232, 198, 98, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.ritual-mini-hj {
  font-family: "Noto Serif KR", serif;
  font-size: 13px;
  font-weight: 800;
  color: #ead7a1;
  flex: none;
}
.ritual-mini-sub {
  font-size: 12px;
  font-weight: 500;
  color: #efece4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ritual-top-acts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.ritual-ghost-btn {
  min-height: 31px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(232, 198, 98, 0.22);
  background: rgba(13, 15, 18, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #efece4;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}
.ritual-ghost-btn:active { transform: scale(.96); }
.ritual-ghost-btn.is-gold {
  border-color: rgba(238, 206, 118, 0.36);
  color: #f0dfa8;
  font-weight: 600;
}
.ritual-ghost-btn.is-muted {
  opacity: 0.56;
}

.ritual-act {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ================================================================
   관문 0: 실사 3D 티베트 고대 사원 문 (五經命理 · 청동 사자 문고리 · 3D 문열림 흡입)
================================================================ */
.gate-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #04060d;
  perspective: 1150px;
  transition: transform 1.1s cubic-bezier(.42, 0, .18, 1), opacity 0.85s ease;
}
.gate-scene.is-suction {
  transform: scale(2.85);
  opacity: 0;
}

/* 문 뒤편 찬란한 금빛 시공간 광원 */
.gate-gold-void {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, #fffdf0 0%, #fae08c 22%, #c98f22 48%, #101936 80%, #04060d 100%);
  opacity: 0.24;
  transform: scale(0.95);
  transition: opacity 0.6s ease, transform 1s ease;
  z-index: 1;
}
.gate-scene.is-opening .gate-gold-void {
  opacity: 1;
  transform: scale(1.12);
}

/* 실사 3D 이중 문짝 (정중앙 50%에서 양옆으로 3D 회전 개방) */
.gate-doors-3d {
  position: absolute;
  inset: 0;
  z-index: 3;
  transform-style: preserve-3d;
}
.gate-leaf {
  position: absolute;
  inset: 0;
  background-image: url('../assets/gate-temple.jpg?v=11.0');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transition: transform 1.05s cubic-bezier(.22, .85, .28, 1), filter 0.7s ease;
  backface-visibility: hidden;
}
.gate-leaf-l {
  clip-path: inset(0 50% 0 0);
  transform-origin: 12% 50%;
}
.gate-leaf-r {
  clip-path: inset(0 0 0 50%);
  transform-origin: 88% 50%;
}
.gate-scene.is-opening .gate-leaf-l {
  transform: rotateY(-80deg);
  filter: brightness(1.18);
}
.gate-scene.is-opening .gate-leaf-r {
  transform: rotateY(80deg);
  filter: brightness(1.18);
}

/* 문틈 수직 금빛 광선 미세 일렁임 + 개방 시 폭발 */
.gate-seam-flare {
  position: absolute;
  top: 20%;
  bottom: 13%;
  left: 50%;
  width: 10px;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 246, 200, 0), rgba(255, 232, 146, 0.92) 48%, rgba(255, 246, 200, 0.35) 100%);
  filter: blur(2px);
  opacity: 0.52;
  transition: width 0.55s ease, opacity 0.45s ease, filter 0.55s ease;
  animation: seamPulse 10s ease-in-out infinite;
}
.gate-scene.is-opening .gate-seam-flare {
  animation: none;
  width: 150px;
  opacity: 1;
  filter: blur(18px);
}
@keyframes seamPulse {
  0%, 100% { opacity: 0.38; transform: translateX(-50%) scaleX(0.88); }
  40% { opacity: 0.88; transform: translateX(-50%) scaleX(1.36); }
}

/* 청동 사자 문고리 위 넉넉한 188x188px 터치 영역 + 3~4초 주기 숨 쉬는 금빛 파동 */
.gate-knocker-hit {
  position: absolute;
  z-index: 20;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  width: 188px;
  height: 188px;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle, rgba(255, 224, 128, 0.22) 0%, rgba(244, 198, 84, 0.08) 46%, transparent 72%);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.3s ease, transform 0.16s ease;
}
.gate-knocker-hit:active {
  transform: translate(-50%, -50%) scale(0.94);
}
.gate-scene.is-opening .gate-knocker-hit,
.gate-scene.is-opening .gate-bottom-cue {
  opacity: 0;
  pointer-events: none;
}

.gate-beckon-ring {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 228, 138, 0.84);
  box-shadow: 0 0 24px rgba(248, 208, 96, 0.62), inset 0 0 18px rgba(248, 208, 96, 0.32);
  pointer-events: none;
  animation: gateBeckon 10s ease-in-out infinite;
}
.gate-beckon-ring.r2 {
  animation-delay: 5s;
}
@keyframes gateBeckon {
  0% { transform: scale(0.72); opacity: 0.38; }
  40% { transform: scale(1.22); opacity: 0.86; }
  100% { transform: scale(0.72); opacity: 0.38; }
}

.gate-bottom-cue {
  position: absolute;
  z-index: 20;
  left: 16px;
  right: 16px;
  bottom: calc(20px + var(--sab));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.gate-cta-pill {
  pointer-events: auto;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1.5px solid rgba(248, 220, 128, 0.82);
  background: rgba(8, 12, 22, 0.84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff3c4;
  font-family: "Noto Serif KR", serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.78), 0 0 22px rgba(244, 208, 96, 0.32);
  cursor: pointer;
}
.gate-cta-pill:active { transform: scale(0.97); }
.gate-sub-note {
  font-size: 11px;
  color: #d9e0ec;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.92);
}

/* ================================================================
   관문 1: 그래비티 궤도 시공간 부유(0.1Hz 10초 호흡) & 반투명 2단계 명식 기입 (60~65%)
================================================================ */
.gravity-scene-bg {
  position: absolute;
  inset: -4%;
  z-index: 1;
  background-image: url('../assets/gravity-drift.jpg?v=11.0');
  background-size: cover;
  background-position: center 8%;
  background-repeat: no-repeat;
  animation: gravityVagalBreath 10s ease-in-out infinite;
  pointer-events: none;
}
@keyframes gravityVagalBreath {
  0%, 100% { transform: scale(1.02) translate(0px, 0px); filter: brightness(0.92); }
  40% { transform: scale(1.075) translate(2px, -8px); filter: brightness(1.1); }
}
.gravity-breath-aura {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(circle at 50% 24%, rgba(234, 215, 161, 0.16) 0%, rgba(13, 15, 18, 0) 62%);
  pointer-events: none;
  animation: auraVagal10s 10s ease-in-out infinite;
}
@keyframes auraVagal10s {
  0%, 100% { opacity: 0.32; transform: scale(0.94); }
  40% { opacity: 0.92; transform: scale(1.08); }
}
.gravity-vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(180deg, rgba(13, 15, 18, 0.24) 0%, rgba(13, 15, 18, 0.12) 28%, rgba(13, 15, 18, 0.56) 62%, rgba(13, 15, 18, 0.84) 100%);
  pointer-events: none;
}

.act1-float-scroll {
  position: relative;
  z-index: 18;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: calc(164px + var(--sat)) 14px calc(28px + var(--sab));
  scroll-padding-top: calc(64px + var(--sat));
}
.float-card {
  position: relative;
  border-radius: 22px;
  padding: 18px 16px 18px;
  background: linear-gradient(170deg, rgba(13, 15, 18, 0.60) 0%, rgba(13, 15, 18, 0.65) 100%);
  border: 1px solid rgba(234, 215, 161, 0.32);
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 194, 0.18),
    0 20px 44px rgba(0, 0, 0, 0.58);
  animation: floatCardIn .55s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes floatCardIn {
  0% { opacity: 0; transform: translateY(20px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.float-head {
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(234, 215, 161, 0.15);
  margin-bottom: 14px;
}
.sp-steps {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.sp-step-dot {
  width: 24px;
  height: 4px;
  border-radius: 999px;
  background: rgba(239, 236, 228, 0.2);
  transition: background 0.25s ease, width 0.25s ease;
}
.sp-step-dot.active {
  width: 34px;
  background: #ead7a1;
}
.float-kicker {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #ead7a1;
}
.float-title {
  margin: 5px 0 0;
  font-family: "Noto Serif KR", serif;
  font-size: 19px;
  font-weight: 800;
  color: #efece4;
}
.float-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: rgba(239, 236, 228, 0.74);
  word-break: keep-all;
}

.sp-form { display: flex; flex-direction: column; gap: 14px; }
.sp-step-pane { display: flex; flex-direction: column; gap: 15px; }
.sp-field { display: flex; flex-direction: column; gap: 8px; }
.sp-row-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.sp-lbl { font-family: "Noto Serif KR", serif; font-size: 15.5px; font-weight: 700; color: #efece4; }
.sp-req { font-family: "Noto Sans KR", sans-serif; font-size: 12px; font-weight: 700; color: #ead7a1; margin-left: 5px; }
.sp-opt { font-family: "Noto Sans KR", sans-serif; font-size: 12px; font-weight: 500; color: rgba(239, 236, 228, 0.65); margin-left: 5px; }
.sp-seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(13, 15, 18, 0.72);
  border: 1px solid rgba(234, 215, 161, 0.22);
}
.sp-seg-full { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.sp-seg-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sp-seg-btn {
  min-height: 38px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(239, 236, 228, 0.72);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.sp-seg-btn.active {
  background: rgba(212, 175, 55, 0.22);
  color: #f4e6be;
  border-color: rgba(234, 215, 161, 0.56);
  font-weight: 700;
}
.sp-gender-btn {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(234, 215, 161, 0.26);
  background: rgba(13, 15, 18, 0.68);
  color: #efece4;
  font-family: "Noto Serif KR", serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.sp-gender-btn.active { background: rgba(212, 175, 55, 0.24); color: #f5e6be; border-color: #e4c158; }
.sp-input, .sp-select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(234, 215, 161, 0.28);
  background: rgba(13, 15, 18, 0.78);
  color: #efece4;
  font-size: 17px;
  padding: 0 14px;
  min-width: 0;
  height: 48px;
}
.sp-input.is-mono { font-family: "JetBrains Mono", monospace; font-size: 19px; letter-spacing: 0.14em; text-align: center; font-weight: 700; }
.sp-input:focus, .sp-select:focus { outline: none; border-color: #ead7a1; background: rgba(13, 15, 18, 0.92); }
.sp-msg { font-size: 13px; text-align: center; color: rgba(239, 236, 228, 0.7); min-height: 18px; }
.sp-msg.is-ok { color: #7cd8c0; font-weight: 600; }
.sp-msg.is-err { color: #f4a4a4; font-weight: 600; }
.sp-exact-note { font-size: 12.5px; color: rgba(239, 236, 228, 0.72); word-break: keep-all; margin: 0; }
.sp-unknown-note {
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(234, 215, 161, 0.28);
  padding: 12px;
  font-size: 14px;
  line-height: 1.58;
  color: #efece4;
  word-break: keep-all;
}

.sp-b12-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sp-b12 {
  min-height: 48px;
  border-radius: 10px;
  padding: 5px 2px;
  border: 1px solid rgba(234, 215, 161, 0.2);
  background: rgba(13, 15, 18, 0.68);
  color: #efece4;
  text-align: center;
  cursor: pointer;
}
.sp-b12.active { background: rgba(212, 175, 55, 0.24); border-color: #ebc962; color: #f6e7be; }
.sp-b12-top { font-family: "Noto Serif KR", serif; font-size: 13.5px; font-weight: 700; }
.sp-b12-time { font-family: "JetBrains Mono", monospace; font-size: 11px; opacity: 0.82; margin-top: 2px; }

.sp-zi-box {
  border-radius: 11px;
  padding: 10px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(234, 215, 161, 0.34);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.sp-zi-note { font-size: 12.5px; color: #efece4; word-break: keep-all; }
.sp-zi-row { display: flex; gap: 5px; }
.sp-zi-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 3px;
  border-radius: 8px;
  border: 1px solid rgba(234, 215, 161, 0.26);
  background: rgba(13, 15, 18, 0.82);
  color: #efece4;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}
.sp-zi-btn.active { background: rgba(212, 175, 55, 0.28); color: #f6e7be; border-color: #ead7a1; }

.sp-place-box { border-radius: 12px; border: 1px solid rgba(234, 215, 161, 0.24); background: rgba(13, 15, 18, 0.66); overflow: hidden; }
.sp-place-toggle {
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  background: none;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}
.sp-place-t1 { font-size: 13px; font-weight: 700; color: #efece4; display: block; }
.sp-place-t2 { font-size: 12px; color: rgba(239, 236, 228, 0.72); display: block; margin-top: 1px; }
.sp-place-panel { padding: 10px 12px 12px; border-top: 1px solid rgba(234, 215, 161, 0.15); display: flex; flex-direction: column; gap: 9px; }
.sp-place-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.sp-pchip {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(234, 215, 161, 0.24);
  background: rgba(13, 15, 18, 0.84);
  color: #efece4;
  cursor: pointer;
}
.sp-pchip.active { background: rgba(212, 175, 55, 0.26); color: #f6e7be; border-color: #ebc962; }

.sp-step-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sp-prev-btn {
  flex: 0 0 auto;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(234, 215, 161, 0.28);
  background: rgba(13, 15, 18, 0.76);
  color: #efece4;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.sp-prev-btn:active { transform: scale(.97); }
.sp-submit-btn {
  flex: 1 1 auto;
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  border: 1px solid rgba(242, 220, 148, 0.72);
  background: linear-gradient(90deg, #b88e28 0%, #edd488 50%, #c89d32 100%);
  color: #0d0f12;
  font-family: "Noto Serif KR", serif;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(212, 175, 55, 0.26);
}
.sp-submit-btn:active { transform: scale(.985); }

/* ================================================================
   관문 2: 9:16 클로즈업 3D 오경 성소 (어두운 천장 · 좌측 넓은 석재 벽면 · 큼직한 7차크라 포털 · 근접 5 싱잉볼)
================================================================ */
.sanctuary-scene {
  position: absolute;
  inset: 0;
  background: #03050a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.sanctuary-scene.is-shake-heavy {
  animation: wallShakeHeavy .26s cubic-bezier(.36, .07, .19, .97) both;
}
.sanctuary-scene.is-shake-light {
  animation: wallShakeLight .18s ease both;
}
@keyframes wallShakeHeavy {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5px, 2px); }
  45% { transform: translate(5px, -2px); }
  70% { transform: translate(-2px, 1px); }
}
@keyframes wallShakeLight {
  0%, 100% { transform: translate(0, 0); }
  35% { transform: translate(-2.5px, 1px); }
  70% { transform: translate(2.5px, -1px); }
}

/* 풀블리드 성소 스테이지 — 상하단 까만 여백 없이 화면 전체를 꽉 채움(cover) */
.sanctuary-stage {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #0d0f12;
  background-image: url('../assets/sanctuary-hall.jpg?v=11.0');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  overflow: hidden;
}
.sanctuary-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  pointer-events: none;
  z-index: 1;
}
/* 상단 헤더 가독성을 위한 극미세 음영만 유지 (여백 검은 띠 없음) */
.sanctuary-stage::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7%;
  pointer-events: none;
  z-index: 4;
  background: linear-gradient(180deg, rgba(3, 5, 10, 0.42) 0%, rgba(3, 5, 10, 0) 100%);
}

/* 상단 빈 공간 용신 한문 부유 연출 (예: 水 · 用神 — 고유 오행 색상으로 은은히 떠올랐다 사라짐) */
.yongshin-float {
  position: absolute;
  z-index: 24;
  top: calc(56px + var(--sat));
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 86%;
  text-align: center;
}
.yongshin-float-txt {
  display: inline-block;
  font-family: "Noto Serif KR", serif;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: var(--yf-color, #f4dc8c);
  text-shadow:
    0 2px 14px rgba(0, 0, 0, 0.94),
    0 0 22px var(--yf-glow, rgba(244, 212, 114, 0.62)),
    0 0 46px var(--yf-glow, rgba(244, 212, 114, 0.4));
  opacity: 0;
  animation: yongshinFloatRise 4.1s cubic-bezier(.22, .8, .28, 1) forwards;
}
@keyframes yongshinFloatRise {
  0% { opacity: 0; transform: translateY(16px) scale(0.92); filter: blur(3px); }
  22% { opacity: 0.96; transform: translateY(0) scale(1); filter: blur(0); }
  62% { opacity: 0.92; transform: translateY(-4px) scale(1); filter: blur(0); }
  100% { opacity: 0; transform: translateY(-20px) scale(1.03); filter: blur(2px); }
}

/* 왼쪽 석재 기둥 오행 각인 — 좌측 여백 확보 · 석재 음각/광물 블렌딩 (무음) */
.sanctuary-left-wall {
  position: absolute;
  z-index: 20;
  left: 4.5%;
  top: 26%;
  width: 16.5%;
  height: 34%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  padding: 6px 5px;
  transform: perspective(720px) rotateY(7deg);
  transform-origin: left center;
}
.wall-el-item {
  position: relative;
  border: 0;
  background: transparent;
  padding: 2px 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(2.2) translateX(-14px);
  -webkit-tap-highlight-color: transparent;
  transition: filter 0.35s ease, transform 0.25s ease;
}
.wall-el-item.is-carved {
  animation:
    wallSlamStone .44s cubic-bezier(.16, .96, .26, 1) forwards,
    wallStoneBreath 4.6s ease-in-out .55s infinite;
}
.wall-el-item.is-resonating {
  animation: wallResonate 1.8s cubic-bezier(.16, .88, .28, 1) forwards !important;
}
@keyframes wallSlamStone {
  0% { opacity: 0; transform: scale(2.25) translateX(-14px); filter: brightness(2.0); }
  58% { opacity: 0.95; transform: scale(0.92) translateX(2px); filter: brightness(1.32); }
  100% { opacity: 0.88; transform: scale(1) translateX(0); filter: brightness(0.98); }
}
@keyframes wallStoneBreath {
  0%, 100% { opacity: 0.82; filter: brightness(0.94); }
  50% { opacity: 0.94; filter: brightness(1.08); }
}
@keyframes wallResonate {
  0% { opacity: 1; transform: scale(1.16); filter: brightness(1.75) drop-shadow(0 0 14px var(--el-aura, rgba(244, 214, 128, 0.72))); }
  45% { opacity: 0.98; transform: scale(1.05); filter: brightness(1.38) drop-shadow(0 0 10px var(--el-aura, rgba(244, 214, 128, 0.52))); }
  100% { opacity: 0.88; transform: scale(1); filter: brightness(0.98); }
}
.ritual-svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.wall-el-hj {
  position: relative;
  display: inline-block;
  font-family: "Noto Serif KR", serif;
  font-weight: 900;
  line-height: 1;
  font-size: var(--el-size, 44px);
}
/* 뒷면 3D 석재 돌출·각진 측면·음각 그림자 (SVG 필터 미적용 → 흐림 없는 선명한 각진 돌출) */
.wall-el-depth {
  position: absolute;
  inset: 0;
  z-index: 1;
  color: var(--el-bevel-2, #2e2a21);
  pointer-events: none;
  text-shadow:
    -1px -1px 0 rgba(255, 250, 236, 0.42),
    1px 1px 0 var(--el-bevel-1, #4a4332),
    2px 2px 0 var(--el-bevel-2, #2e2a21),
    3px 3px 0 var(--el-bevel-3, #191815),
    4px 4.5px 0 #0a0c10,
    5px 6px 8px rgba(0, 0, 0, 0.96),
    0 0 14px var(--el-aura, rgba(216, 194, 138, 0.46));
}
/* 전면 3D 석재 조각면 (광물 고유색 그라데이션 + 미세 현무암 질감 + 각진 상단 엣지 하이라이트) */
.wall-el-face {
  position: relative;
  z-index: 2;
  display: inline-block;
  color: transparent;
  background: linear-gradient(146deg, var(--el-hi, #ffe9a8) 0%, var(--el-mid, #dfa944) 44%, var(--el-lo, #7f5818) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 0.45px rgba(255, 250, 236, 0.24);
  filter: url(#stone-carve-filter) drop-shadow(0 0 6px var(--el-aura, rgba(216, 194, 138, 0.36)));
}

/* 중앙~우측 가부좌 실루엣 전체 터치 영역 + 테두리 없는 은은한 금빛 '내면으로' */
.sanctuary-lotus-hit {
  position: absolute;
  z-index: 20;
  left: 41%;
  top: 29%;
  width: 57%;
  height: 39%;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sanctuary-lotus-hit:active .inner-entry-text { transform: scale(0.95); }
.lotus-chest-flare {
  position: absolute;
  left: 53%;
  top: 55%;
  width: 96px;
  height: 96px;
  margin-left: -48px;
  margin-top: -48px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 246, 206, 0.92) 0%, rgba(246, 212, 114, 0.45) 38%, transparent 72%);
  opacity: 0;
  transform: scale(0.55);
  pointer-events: none;
  z-index: 3;
}
.sanctuary-lotus-hit.is-chest-pulse .lotus-chest-flare {
  animation: lotusChestAwaken 1.9s cubic-bezier(.16, .88, .28, 1) forwards;
}
.sanctuary-lotus-hit.is-awakened .lotus-chest-flare {
  opacity: 0.44;
  animation: lotusChestVagal10s 10s ease-in-out infinite;
}
@keyframes lotusChestVagal10s {
  0%, 100% { opacity: 0.28; transform: scale(0.84); }
  40% { opacity: 0.72; transform: scale(1.24); }
}
.sanctuary-mantra-ring {
  position: absolute;
  left: 56%;
  top: 52%;
  width: 214px;
  height: 214px;
  margin-left: -107px;
  margin-top: -107px;
  pointer-events: none;
  opacity: 0.44;
  animation: orbitSpin 54s linear infinite;
}
/* 성소 ↔ 내면 대화 공통 은은한 7차크라 수직 광점 축 (과도한 뭉개짐 없이 정갈하게 정렬) */
.chakra-axis {
  position: absolute;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  z-index: 4;
}
.chakra-axis.is-sanctuary {
  left: 56%;
  top: 26.5%;
  height: 45.5%;
  transform: translateX(-50%);
  opacity: 0.68;
  transition: opacity 0.6s ease;
}
.sanctuary-lotus-hit.is-awakened .chakra-axis.is-sanctuary {
  opacity: 0.9;
}
.chakra-axis.is-cosmic {
  left: 50%;
  top: 18.5%;
  height: 49.5%;
  transform: translateX(-50%);
  opacity: 0.68;
  transition: opacity 0.75s ease;
}
.act4-wrap.has-chat .chakra-axis.is-cosmic {
  opacity: 0.22;
}
.chakra-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--ck-col, #ead7a1);
  box-shadow: 0 0 8px var(--ck-col, #ead7a1), 0 0 16px var(--ck-glow, rgba(234, 215, 161, 0.48));
  animation: chakraSoftPulse 10s ease-in-out infinite;
}
.chakra-dot.c7 { --ck-col: #c4a3ff; --ck-glow: rgba(168, 120, 248, 0.52); width: 5.5px; height: 5.5px; }
.chakra-dot.c6 { --ck-col: #9eb4ff; --ck-glow: rgba(114, 138, 246, 0.5); width: 5.5px; height: 5.5px; }
.chakra-dot.c5 { --ck-col: #8ad8f0; --ck-glow: rgba(86, 198, 232, 0.48); }
.chakra-dot.c4 { --ck-col: #fae6a8; --ck-glow: rgba(246, 214, 118, 0.64); width: 8px; height: 8px; }
.chakra-dot.c3 { --ck-col: #f4d27c; --ck-glow: rgba(238, 192, 82, 0.5); }
.chakra-dot.c2 { --ck-col: #f0a46e; --ck-glow: rgba(236, 146, 78, 0.48); }
.chakra-dot.c1 { --ck-col: #e57e7e; --ck-glow: rgba(224, 98, 98, 0.46); width: 6px; height: 6px; }
@keyframes chakraSoftPulse {
  0%, 100% { opacity: 0.62; transform: scale(0.92); }
  40% { opacity: 1; transform: scale(1.16); }
}
.lotus-beckon-ring {
  position: absolute;
  left: 53%;
  top: 53%;
  width: 124px;
  height: 124px;
  margin-left: -62px;
  margin-top: -62px;
  border-radius: 50%;
  border: 1.2px solid rgba(248, 222, 138, 0.48);
  box-shadow: 0 0 18px rgba(244, 210, 96, 0.24);
  pointer-events: none;
  animation: lotusBeckon 10s ease-in-out infinite;
}
.sanctuary-lotus-hit.is-awakened .lotus-beckon-ring {
  border-color: rgba(255, 234, 158, 0.82);
  box-shadow: 0 0 26px rgba(250, 216, 108, 0.52);
}
@keyframes lotusBeckon {
  0%, 100% { transform: scale(0.76); opacity: 0.32; }
  40% { transform: scale(1.26); opacity: 0.84; }
}
.inner-entry-text {
  position: relative;
  z-index: 4;
  margin-left: 6%;
  font-family: "Noto Serif KR", serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: rgba(239, 236, 228, 0.84);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.96), 0 0 12px rgba(242, 208, 114, 0.3);
  white-space: nowrap;
  animation: innerEntryBreathe 10s ease-in-out infinite;
  transition: color 0.6s ease, text-shadow 0.6s ease, transform 0.14s ease;
}
.sanctuary-lotus-hit.is-awakened .inner-entry-text {
  color: #f3e4bc;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.98), 0 0 18px rgba(252, 224, 134, 0.86), 0 0 34px rgba(244, 198, 86, 0.48);
  animation: innerEntryAwakenBreathe 10s ease-in-out infinite;
}
@keyframes innerEntryBreathe {
  0%, 100% { opacity: 0.72; transform: translateY(0); }
  40% { opacity: 0.96; transform: translateY(-2px); }
}
@keyframes innerEntryAwakenBreathe {
  0%, 100% { opacity: 0.86; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2.5px); }
}

/* 하단 5개 황동 싱잉볼 — 용신 단일 공명 의식 + 하단 조용한 안내 문구 */
.sanctuary-bowls-overlay {
  position: absolute;
  z-index: 22;
  left: 1.5%;
  right: 1.5%;
  top: 71.5%;
  bottom: calc(14px + var(--sab));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
.bowl-row {
  width: 100%;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  align-items: start;
}
.bowl-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  padding: 4px 1px 4px;
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.bowl-halo {
  position: relative;
  width: 64px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: transform 0.14s ease, box-shadow 0.28s ease, background 0.28s ease;
}
/* 용신 1개 싱잉볼만 3.6초 주기로 은은한 금빛 파동 유도 */
.bowl-yongshin-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid rgba(250, 222, 134, 0.78);
  box-shadow: 0 0 18px rgba(244, 206, 98, 0.45), inset 0 0 10px rgba(250, 224, 142, 0.2);
  pointer-events: none;
  opacity: 0;
  display: none;
}
.bowl-btn.is-yongshin .bowl-halo {
  box-shadow: 0 0 20px rgba(246, 212, 114, 0.28);
  background: radial-gradient(ellipse at center, rgba(248, 218, 128, 0.14) 0%, transparent 72%);
}
.bowl-btn.is-yongshin .bowl-yongshin-ring {
  display: block;
  animation: yongshinBeckon 10s ease-in-out infinite;
}
@keyframes yongshinBeckon {
  0%, 100% { opacity: 0.24; transform: scale(0.84); }
  40% { opacity: 0.92; transform: scale(1.36); }
}
.bowl-rim-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(252, 228, 150, 0.9);
  box-shadow: 0 0 22px rgba(244, 210, 108, 0.76);
  opacity: 0;
  transform: scale(0.84);
  pointer-events: none;
}
.bowl-btn.is-struck .bowl-halo {
  transform: scale(0.93);
  background: radial-gradient(circle, rgba(248, 220, 134, 0.34), transparent 72%);
}
.bowl-btn.is-struck .bowl-rim-ring {
  animation: bowlRipple 1.3s cubic-bezier(.16, .8, .28, 1) forwards;
}
.bowl-btn.is-holding .bowl-halo {
  transform: scale(1.06);
  background: radial-gradient(circle, rgba(248, 220, 134, 0.48), transparent 72%);
}
.bowl-btn.is-holding .bowl-rim-ring {
  opacity: 0.94;
  animation: bowlCharge 1.05s ease-in-out infinite alternate;
}
@keyframes bowlRipple {
  0% { opacity: 0.96; transform: scale(0.84); }
  100% { opacity: 0; transform: scale(1.82); }
}
@keyframes bowlCharge {
  0% { transform: scale(0.92); opacity: 0.62; }
  100% { transform: scale(1.22); opacity: 1; }
}
/* 주파수·스펙 설명 제거 → 최소한의 은은한 금빛 한자만 유지 */
.bowl-hj-sm {
  font-family: "Noto Serif KR", serif;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  color: rgba(212, 194, 152, 0.44);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.98);
  transition: color 0.35s ease, text-shadow 0.35s ease, opacity 0.35s ease;
}
.bowl-btn.is-yongshin .bowl-hj-sm {
  color: rgba(252, 232, 166, 0.94);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.98), 0 0 12px rgba(244, 210, 108, 0.56);
}
.bowl-btn.is-struck .bowl-hj-sm,
.bowl-btn.is-holding .bowl-hj-sm {
  color: #fff4ce;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.98), 0 0 14px rgba(250, 222, 134, 0.72);
}
.bowl-guide-note {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: rgba(239, 236, 228, 0.84);
  text-align: center;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.96);
  pointer-events: none;
}

/* ================================================================
   관문 3: 가부좌 우주 포털 3D 워프 (실사 성소 줌인 흡입 → 7차크라·만트라 터널)
================================================================ */
.act3-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 20px 20px calc(26px + var(--sab));
  text-align: center;
  cursor: pointer;
  background: #0d0f12;
}
.act3-dive-bg {
  position: absolute;
  inset: 0;
  background-image: url('../assets/sanctuary-hall.jpg?v=11.0');
  background-size: cover;
  background-position: center center;
  opacity: 0;
  pointer-events: none;
}
.act3-wrap.is-diving .act3-dive-bg {
  animation: portalDiveBg 1.15s cubic-bezier(.42, 0, .2, 1) forwards;
}
@keyframes portalDiveBg {
  0% { opacity: 0.95; transform: scale(1); filter: brightness(1); }
  55% { opacity: 0.65; transform: scale(2.35); filter: brightness(1.35) blur(2px); }
  100% { opacity: 0; transform: scale(4.2); filter: brightness(1.6) blur(8px); }
}
.portal-caption {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
}
.portal-mantra {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #f6df92;
  text-shadow: 0 0 20px rgba(244, 212, 102, 0.72);
}
.portal-sub {
  font-family: "Noto Serif KR", serif;
  font-size: 13px;
  color: #e6ecf8;
  letter-spacing: 0.04em;
}
.portal-skip-hint { font-size: 10.5px; color: #9eaac2; }

/* ================================================================
   관문 4: 내면 대화 공간 — 힐링 엔진 & 노안·난시 빛 번짐 방지 (#0D0F12 먹색 + #EFECE4 상아색 + 17.5px+)
================================================================ */
.act4-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding-top: calc(50px + var(--sat));
  overflow: hidden;
  background: #0d0f12;
}

/* 온화하고 차분하게 빛나는 자아의 공간 형상 — 어떤 뷰포트에서도 상하좌우 잘림·찌그러짐 없이 온전히 노출 */
.cosmic-figure-stage {
  position: absolute;
  left: 50%;
  top: calc(50% - 16px);
  width: min(356px, 88vw, calc(100vh - 180px));
  height: min(356px, 88vw, calc(100vh - 180px));
  width: min(356px, 88vw, calc(100dvh - 180px));
  height: min(356px, 88vw, calc(100dvh - 180px));
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.88;
  transition: opacity 0.75s ease;
}
.act4-wrap.has-chat .cosmic-figure-stage {
  opacity: 0.36;
}
/* 은은한 회전 원형 링 (스테이지 내부에 온전히 수납 · 잘림 없음) */
.cosmic-mantra-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 92%;
  height: 92%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  opacity: 0.38;
  transition: opacity 0.75s ease;
  animation: cosmicMantraSpin 54s linear infinite;
}
.act4-wrap.has-chat .cosmic-mantra-ring {
  opacity: 0.12;
}
@keyframes cosmicMantraSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
.cosmic-figure-img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  mix-blend-mode: screen;
  filter: brightness(1.04) contrast(1.02);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 58%, rgba(0, 0, 0, 0.78) 78%, transparent 96%);
  mask-image: radial-gradient(circle at 50% 50%, #000 58%, rgba(0, 0, 0, 0.78) 78%, transparent 96%);
  animation: cosmicHeroBreathe 10s ease-in-out infinite;
}
@keyframes cosmicHeroBreathe {
  0%, 100% { transform: scale(0.985); opacity: 0.88; }
  40% { transform: scale(1.03); opacity: 1; }
}
.cosmic-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(13, 15, 18, 0.48) 0%, rgba(13, 15, 18, 0.06) 22%, rgba(13, 15, 18, 0.14) 74%, rgba(13, 15, 18, 0.92) 100%),
    radial-gradient(ellipse 78% 60% at 50% 43%, transparent 36%, rgba(13, 15, 18, 0.62) 100%);
  pointer-events: none;
}

/* 가부좌 심장 부위 0.1Hz 호흡 코어 + 1.5~2초 의도적 침묵 숨고르기 발광 */
.cosmic-heart-flare {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 48%;
  width: 118px;
  height: 118px;
  margin-left: -59px;
  margin-top: -59px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(248, 232, 186, 0.84) 0%, rgba(234, 198, 108, 0.36) 38%, transparent 72%);
  opacity: 0.24;
  transform: scale(0.8);
  pointer-events: none;
  animation: heartVagal10s 10s ease-in-out infinite;
}
@keyframes heartVagal10s {
  0%, 100% { opacity: 0.2; transform: scale(0.78); }
  40% { opacity: 0.52; transform: scale(1.16); }
}
.act4-wrap.is-breathing-pause .cosmic-heart-flare {
  animation: heartPauseSwell 1.75s ease-in-out infinite !important;
}
@keyframes heartPauseSwell {
  0%, 100% { opacity: 0.34; transform: scale(0.92); }
  50% { opacity: 0.88; transform: scale(1.42); }
}
.cosmic-heart-flare.is-beat {
  animation: heartCoreBeat .55s cubic-bezier(.16, .92, .3, 1) both;
}
@keyframes heartCoreBeat {
  0% { opacity: 0.86; transform: scale(1.36); }
  62% { opacity: 0.42; transform: scale(0.96); }
  100% { opacity: 0.24; transform: scale(0.78); }
}

/* 본방 대화 피드 — 노안·난시 배려 17.5px+ 상아색(#EFECE4) 정갈한 타이포그래피 */
.act4-feed {
  position: relative;
  z-index: 16;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.act4-feed::-webkit-scrollbar { display: none; }

.c-msg-user {
  align-self: flex-end;
  max-width: 86%;
  padding: 10px 15px;
  border-radius: 18px 18px 4px 18px;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(234, 215, 161, 0.28);
  color: #efece4;
  font-size: 17px;
  line-height: 1.56;
  word-break: keep-all;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.c-msg-oracle {
  align-self: stretch;
  padding: 6px 6px 6px 15px;
  border-left: 2px solid rgba(234, 215, 161, 0.42);
  background: linear-gradient(90deg, rgba(13, 15, 18, 0.56) 0%, rgba(13, 15, 18, 0.14) 100%);
  border-radius: 0 12px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeBodyIn .55s ease both;
}
.c-verdict-wrap { cursor: pointer; }
.c-verdict-text {
  font-family: "Noto Serif KR", serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.56;
  letter-spacing: -0.01em;
  color: #f2e2b6;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.hb-char {
  display: inline-block;
  white-space: pre-wrap;
  animation: hbImprint .34s cubic-bezier(.16, .92, .3, 1) both;
}
@keyframes hbImprint {
  0% { opacity: 0; transform: scale(1.18) translateY(-1px); color: #f6e4a8; }
  60% { opacity: 1; transform: scale(0.99) translateY(0); color: #f2e2b6; }
  100% { opacity: 1; transform: scale(1); color: #f2e2b6; }
}
.c-oracle-body {
  font-size: 17.5px;
  line-height: 1.78;
  color: #efece4;
  white-space: pre-line;
  word-break: keep-all;
  overflow-wrap: anywhere;
  animation: fadeBodyIn .5s ease both;
}
.c-grounding-rx {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid rgba(234, 215, 161, 0.18);
  font-size: 16.5px;
  line-height: 1.66;
  color: #e4d4a6;
  word-break: keep-all;
  animation: fadeBodyIn .65s ease both;
}
@keyframes fadeBodyIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
.c-typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px 8px 15px;
  border-left: 2px solid rgba(234, 215, 161, 0.36);
  font-size: 16px;
  color: rgba(239, 236, 228, 0.8);
}
/* 무텍스트 초경량 응답 준비 표시 (뜸 들이는 문구 없음) */
.c-typing-dots {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 10px 15px;
  border-left: 2px solid rgba(234, 215, 161, 0.36);
}
.c-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ead7a1;
  opacity: 0.35;
  animation: cTypingDot 0.9s ease-in-out infinite;
}
.c-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.c-typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes cTypingDot {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 0.95; transform: translateY(-2px); }
}

/* 최하단 컴팩트 독 */
.cosmic-dock {
  position: relative;
  z-index: 22;
  flex: none;
  padding: 6px 14px calc(12px + var(--sab));
  background: linear-gradient(180deg, rgba(13, 15, 18, 0) 0%, rgba(13, 15, 18, 0.88) 26%, rgba(13, 15, 18, 0.98) 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 마이크 차단/미허용 즉시 안내 배너 */
.voice-notice-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(234, 215, 161, 0.34);
  background: rgba(22, 25, 32, 0.95);
  color: #efece4;
  font-size: 14px;
  line-height: 1.5;
  word-break: keep-all;
  animation: fadeBodyIn .24s ease both;
}
.voice-notice-txt { flex: 1 1 auto; }
.voice-notice-close {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #efece4;
  font-size: 12px;
  cursor: pointer;
}

/* 녹음 중일 때만 입력바 위에 뜨는 얇은 금빛 음파 바 (대화 텍스트 절대 가리지 않음) */
.voice-wave-bar {
  position: relative;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(234, 215, 161, 0.36);
  background: rgba(20, 23, 29, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 14px;
}
.voice-wave-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.voice-live-text {
  position: relative;
  z-index: 2;
  font-size: 13px;
  color: #f0dfa8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.95);
}

/* 은은한 금빛 불씨 3점 카운터 (상업 문구 없음 · 질문할 때마다 하나씩 어두워짐) */
.cosmic-embers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 10px;
}
.ember-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(154, 142, 114, 0.22);
  box-shadow: none;
  transition: background 0.45s ease, box-shadow 0.45s ease, transform 0.45s ease, opacity 0.45s ease;
}
.ember-dot.is-lit {
  background: #ead7a1;
  box-shadow: 0 0 8px rgba(234, 215, 161, 0.78), 0 0 14px rgba(212, 175, 55, 0.36);
  transform: scale(1.06);
}
.ember-dot.is-spent {
  background: rgba(128, 118, 98, 0.22);
  transform: scale(0.84);
  opacity: 0.55;
}
.cosmic-embers.is-unlocked .ember-dot {
  background: rgba(234, 215, 161, 0.56);
  box-shadow: 0 0 6px rgba(234, 215, 161, 0.32);
}

/* 최하단 통합 텍스트 입력바 (마이크 아이콘 버튼 내장 · 노안 배려 17px 입력) */
.cosmic-form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 15px;
  border-radius: 999px;
  background: rgba(20, 23, 29, 0.9);
  border: 1px solid rgba(234, 215, 161, 0.26);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.cosmic-form:focus-within {
  border-color: rgba(234, 215, 161, 0.62);
  background: rgba(24, 27, 34, 0.96);
}
.cosmic-form.is-locked {
  border-color: rgba(234, 215, 161, 0.44);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.12);
  cursor: pointer;
}
.cosmic-input {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  max-height: 92px;
  resize: none;
  border: 0;
  background: transparent;
  color: #efece4;
  padding: 4px 0;
  font-size: 17px;
  line-height: 1.44;
}
.cosmic-input::placeholder { color: rgba(239, 236, 228, 0.54); font-size: 15.5px; }
.cosmic-input:focus { outline: none; }

.cosmic-mic-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  flex: none;
  border: 1px solid rgba(234, 215, 161, 0.26);
  background: rgba(255, 255, 255, 0.05);
  color: #ead7a1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.12s ease;
}
.cosmic-mic-btn:active { transform: scale(.92); }
.cosmic-mic-btn.is-listening {
  border-color: rgba(251, 113, 133, 0.85);
  background: rgba(225, 29, 72, 0.82);
  color: #efece4;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.65);
}

.cosmic-send {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  flex: none;
  border: 0;
  background: linear-gradient(135deg, #c9a13c, #edd78e);
  color: #0d0f12;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(234, 215, 161, 0.34);
}
.cosmic-send:disabled { opacity: 0.42; cursor: not-allowed; }
.cosmic-send:active { transform: scale(.92); }

/* ================================================================
   흑요석 결제 바텀시트 ('깊은 문답 이어가기')
================================================================ */
.cosmic-pay-backdrop {
  position: absolute;
  inset: 0;
  z-index: 48;
  background: rgba(2, 4, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.24s ease;
}
.cosmic-pay-backdrop.is-open {
  opacity: 1;
}
.cosmic-pay-sheet {
  width: 100%;
  max-width: 440px;
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgba(236, 206, 126, 0.38);
  background: linear-gradient(180deg, rgba(16, 18, 26, 0.97) 0%, rgba(8, 10, 16, 0.99) 100%);
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.82), inset 0 1px 0 rgba(255, 240, 190, 0.2);
  padding: 10px 18px calc(20px + var(--sab));
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(.22, 1, .36, 1);
}
.cosmic-pay-backdrop.is-open .cosmic-pay-sheet {
  transform: translateY(0);
}
.cpay-handle {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: rgba(232, 204, 134, 0.32);
  margin: 0 auto 2px;
}
.cpay-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.cpay-kicker {
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(236, 206, 126, 0.76);
}
.cpay-title {
  margin: 3px 0 0;
  font-family: "Noto Serif KR", serif;
  font-size: 18px;
  font-weight: 800;
  color: #faf3df;
}
.cpay-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #bfc8d8;
  font-size: 13px;
  cursor: pointer;
}
.cpay-sub {
  margin: 0;
  font-size: 12.2px;
  line-height: 1.55;
  color: #c5cedd;
  word-break: keep-all;
}
.cpay-plans {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cpay-plan {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(232, 204, 134, 0.2);
  background: rgba(255, 255, 255, 0.03);
  color: #f4efe2;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.cpay-plan.active {
  border-color: rgba(246, 218, 132, 0.72);
  background: rgba(212, 175, 55, 0.12);
  box-shadow: inset 0 0 0 1px rgba(246, 218, 132, 0.16);
}
.cpay-plan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cpay-plan-name {
  font-family: "Noto Serif KR", serif;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff4d2;
}
.cpay-plan-price {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  color: #f4dc8c;
}
.cpay-plan-desc {
  font-size: 11.2px;
  color: #b7c1d4;
  line-height: 1.45;
  word-break: keep-all;
}
.cpay-cta {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(252, 228, 150, 0.72);
  background: linear-gradient(90deg, #b88e28 0%, #f5dd8c 50%, #c89d32 100%);
  color: #090e1a;
  font-family: "Noto Serif KR", serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.24);
}
.cpay-cta:active { transform: scale(.985); }
.cpay-note {
  margin: 0;
  font-size: 10.5px;
  color: #8f9bb0;
  text-align: center;
  word-break: keep-all;
}
.cpay-dev-row {
  margin-top: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(232, 204, 134, 0.24);
  background: rgba(255, 255, 255, 0.025);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}
.cpay-dev-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #d8d2c2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cpay-dev-tag {
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.16);
  color: #f0d788;
}
.cpay-switch-in {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.cpay-switch-ui {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(232, 204, 134, 0.26);
  transition: background 0.2s ease, border-color 0.2s ease;
  flex: none;
}
.cpay-switch-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e2dcd0;
  transition: transform 0.2s ease, background 0.2s ease;
}
.cpay-switch-in:checked + .cpay-switch-ui {
  background: rgba(212, 175, 55, 0.42);
  border-color: #f4dc8c;
}
.cpay-switch-in:checked + .cpay-switch-ui::after {
  transform: translateX(18px);
  background: #fff3c4;
}

/* 클래식 헤더 '성소' 진입 버튼 */
.top-sanctuary-btn {
  min-height: 36px;
  padding: 0 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(17, 26, 46, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.48);
  color: #f4dc8c;
  white-space: nowrap;
}

/* v15.1 상단 잔여 무료 문답 배지 & 마지막 턴 마감 카드 */
.ritual-turn-badge {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #e6d29a;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(18, 21, 28, 0.72);
  border: 1px solid rgba(212, 175, 55, 0.28);
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.cosmic-closing-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(234, 215, 161, 0.34);
  background: linear-gradient(180deg, rgba(22, 25, 33, 0.94) 0%, rgba(13, 15, 20, 0.98) 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeBodyIn .4s ease both;
}
.cosmic-closing-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.62;
  color: #efece4;
  word-break: keep-all;
}
.cosmic-closing-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  background: linear-gradient(90deg, #b88e28 0%, #edd587 50%, #c89d32 100%);
  color: #0d0f12;
  font-family: "Noto Serif KR", serif;
  font-size: 13.5px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.22);
}

/* ================================================================
   v15.2 PC 데스크톱 전 화면 통합 중앙 앱 프레임(App Shell)
   - 모바일(<768px)은 기존 레이아웃·비율·동작 100% 무손상 유지
   - PC(>=768px)에서는 대문·시공간·자아의 공간·캔버스·헤더·입력바·마감카드·시트·토스트 전체를
     중앙 var(--app-shell-width) 프레임 내부에 완전 수납
================================================================ */
@media (min-width: 768px) {
  :root {
    --app-shell-width: 450px;
  }
  html, body {
    background-color: #070709;
    background-image: radial-gradient(ellipse 68% 72% at 50% 48%, rgba(212, 175, 55, 0.055) 0%, rgba(12, 14, 20, 0.46) 48%, #070709 100%);
    overflow-x: hidden;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .ritual-overlay {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 50%;
    right: auto;
    width: var(--app-shell-width);
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    transform: translateX(-50%);
    overflow: hidden;
    border-left: 1px solid rgba(212, 175, 55, 0.14);
    border-right: 1px solid rgba(212, 175, 55, 0.14);
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.88), 0 0 26px rgba(212, 175, 55, 0.05);
  }
  #toast-box {
    width: calc(var(--app-shell-width) - 32px);
    max-width: calc(var(--app-shell-width) - 32px);
  }
  .sheet-backdrop {
    left: 50%;
    right: auto;
    width: var(--app-shell-width);
    max-width: 100%;
    transform: translateX(-50%);
  }
  .sheet-panel,
  .cosmic-pay-sheet {
    max-width: 100%;
  }
  .cosmic-figure-stage {
    width: min(356px, calc(var(--app-shell-width) * 0.86), calc(100vh - 180px));
    height: min(356px, calc(var(--app-shell-width) * 0.86), calc(100vh - 180px));
    width: min(356px, calc(var(--app-shell-width) * 0.86), calc(100dvh - 180px));
    height: min(356px, calc(var(--app-shell-width) * 0.86), calc(100dvh - 180px));
  }
}
@media (min-width: 768px) and (max-height: 820px) {
  :root {
    --app-shell-width: 410px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gate-seam-flare, .gate-beckon-ring, .gravity-scene-bg, .float-card,
  .wall-el-item.is-carved, .wall-el-item.is-resonating, .sanctuary-mantra-ring, .lotus-beckon-ring,
  .inner-entry-text, .bowl-yongshin-ring, .bowl-btn.is-struck .bowl-rim-ring, .bowl-btn.is-holding .bowl-rim-ring,
  .cosmic-figure-img, .cosmic-heart-flare.is-beat, .hb-char {
    animation: none !important;
  }
  .wall-el-item.is-carved { opacity: 0.88; transform: none; }
}
