/* =========================================================================
   자시(子時)의 신당 — 어드벤처/비주얼노벨 게이트 v3 스타일
   입장 애니메이션 · 잿불 파티클 · 타자기 대화창 · 아이들 카메라
   ========================================================================= */

:root {
  --g-bg: #000000;
  --g-red: #d81f2a;
  --g-red-bright: #f0323f;
  --g-red-deep: #8f141c;
  --g-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
            'Noto Sans KR', 'Apple SD Gothic Neo', system-ui, sans-serif;
  --g-serif: 'Gowun Batang', 'Noto Serif KR', serif;
}

#gateRoot {
  position: fixed; top: 0; bottom: 0; left: 0; right: 0;
  margin-inline: auto;
  width: 100%; max-width: 480px;   /* 모바일 프레임: 데스크톱에선 가운데 480 컬럼 */
  z-index: 9990;
  background: var(--g-bg);
  font-family: var(--g-sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  box-shadow: 0 0 0 100vmax #000;  /* 컬럼 바깥은 검정으로 */
}
#gateRoot.gate-closing { opacity: 0; transition: opacity 0.9s ease; pointer-events: none; }
#gateRoot.gate-sting { animation: rootShake 0.55s ease; }
@keyframes rootShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); } 40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(3px); }
}

/* ---------- 배경 (2겹 크로스페이드 + 살아있는 카메라) ---------- */
.gate-bg {
  position: absolute; inset: 0; z-index: 1;
  background-size: cover; background-position: center 18%;
  transform: scale(1.06);
  opacity: 0;
  transition: opacity 1s ease;
  will-change: transform, opacity, filter;
}
.gate-bg.on { opacity: 1; }
.gate-bg.is-blur { filter: brightness(0.5) blur(15px); transform: scale(1.16); }

/* 대화 중: 미세하게 숨쉬는 카메라 (영상 느낌) */
#gateRoot.gate-alive .gate-bg.on:not(.is-blur) {
  animation: gateKenburns 17s ease-in-out infinite;
}
@keyframes gateKenburns {
  0%, 100% { transform: scale(1.12) translateY(0); }
  50% { transform: scale(1.17) translateY(-1.1%); }
}

/* 입장 애니메이션: 어둠 속에서 신당 안으로 들어선다 */
#gateRoot.gate-entering .gate-bg.on {
  animation: gateDollyIn 2.05s cubic-bezier(0.2, 0.65, 0.25, 1) forwards;
}
@keyframes gateDollyIn {
  0% { transform: scale(1.0); filter: brightness(0.16) blur(5px); }
  55% { filter: brightness(0.5) blur(1.5px); }
  100% { transform: scale(1.12); filter: brightness(0.92) blur(0); }
}

/* 영상 레이어 (랜딩 캐릭터 · 인트로 · 의식) */
.gate-video {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; object-position: center 18%;
  opacity: 0; transition: opacity 0.7s ease; pointer-events: none;
  background: #000;
}
.gate-video.on { opacity: 1; }
.gate-video.is-blur { filter: brightness(0.5) blur(14px); }
#gateRoot.gate-entering-v .gate-video { animation: gateDollyIn 2.6s cubic-bezier(0.2, 0.65, 0.25, 1); }

/* 처음 진입: 화면 눌러 소리 켜기 안내 */
.gate-soundhint {
  position: absolute; top: 70px; left: 50%; transform: translateX(-50%);
  z-index: 20; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  background: rgba(10, 8, 10, 0.62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #eceaee; font-family: 'Pretendard Variable', Pretendard, sans-serif;
  font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap;
  pointer-events: none; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
  animation: gshFloat 1.9s ease-in-out infinite;
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.gate-soundhint svg { width: 16px; height: 16px; color: #f0323f; }
.gate-soundhint.gone { opacity: 0; transform: translateX(-50%) translateY(-8px); }
#gateRoot.gate-sound-on .gate-soundhint,
#gateRoot.gate-launch .gate-soundhint { opacity: 0 !important; pointer-events: none; }
@keyframes gshFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.92; }
  50% { transform: translateX(-50%) translateY(-3px); opacity: 1; }
}

/* 사운드 버튼 — 무채색 · 세련된 글라스 */
.gate-sound {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer; pointer-events: auto;
  transition: background .2s, border-color .2s, transform .12s, color .2s;
}
.gate-sound svg { width: 20px; height: 20px; }
.gate-sound .ic-on { display: none; }
#gateRoot.gate-sound-on .gate-sound .ic-off { display: none; }
#gateRoot.gate-sound-on .gate-sound .ic-on { display: block; }
#gateRoot.gate-sound-on .gate-sound { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.28); }
.gate-sound:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.gate-sound:active { transform: translateY(-50%) scale(0.9); }

/* 상단 로고 — 홈페이지와 동일한 폰트 */
.gate-logo { font-family: var(--g-serif) !important; font-weight: 700; letter-spacing: 0.5px; display: inline-flex; align-items: baseline; gap: 5px; }
.gate-logo-han {
  font-family: var(--g-serif); font-weight: 700; font-size: 14px; letter-spacing: 1px;
  color: var(--g-red-bright); text-shadow: 0 0 14px rgba(216, 31, 42, 0.4);
}

.gate-shade {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(85% 48% at 50% 104%, rgba(120, 10, 16, 0.42), transparent 70%),
    linear-gradient(180deg, rgba(6, 6, 8, 0.5) 0%, rgba(6, 6, 8, 0.02) 22%, rgba(6, 6, 8, 0.1) 46%, rgba(6, 6, 8, 0.72) 74%, rgba(6, 6, 8, 0.96) 100%);
}
#gateRoot.gate-ritual .gate-shade { animation: gateRitualPulse 1.6s ease-in-out infinite; }
@keyframes gateRitualPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.8; } }

.gate-embers { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.gate-veil {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: #000; opacity: 0;
}
#gateRoot.gate-entering .gate-veil { animation: gateVeil 2s ease forwards; }
@keyframes gateVeil { 0% { opacity: 1; } 55% { opacity: 0.4; } 100% { opacity: 0; } }
.gate-flash {
  position: absolute; inset: 0; z-index: 7; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 42%, rgba(216, 31, 42, 0.5), transparent 68%);
}
#gateRoot.gate-sting .gate-flash { animation: gateFlash 0.6s ease; }
@keyframes gateFlash { 0% { opacity: 0; } 14% { opacity: 0.85; } 100% { opacity: 0; } }

/* ---------- 상단 바 ---------- */
.gate-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 8;
  display: flex; align-items: center; justify-content: center;
  height: 58px; padding-top: env(safe-area-inset-top, 0px);
}
.gate-back {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  color: #fff; text-decoration: none; background: transparent; border: none; cursor: pointer;
}
.gate-back svg { width: 24px; height: 24px; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.8)); }
.gate-logo {
  font-family: var(--g-sans);
  font-size: 16px; font-weight: 900; letter-spacing: 0.5px;
  color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

/* ---------- 랜딩 하단 (입장 전) ---------- */
.gate-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 9;
  padding: 0 20px calc(env(safe-area-inset-bottom, 0px) + 22px);
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
  transition: opacity 0.55s ease;
}
#gateRoot.gate-launch .gate-bottom { opacity: 0; pointer-events: none; }
.gate-role {
  color: var(--g-red-bright);
  font-size: 12px; font-weight: 800; letter-spacing: 3px;
  text-shadow: 0 0 14px rgba(240, 50, 63, 0.5);
}
.gate-name {
  font-family: var(--g-serif);
  font-size: 42px; font-weight: 700; color: #fff;
  line-height: 1.15; letter-spacing: 1px;
  text-shadow: 0 4px 26px rgba(0, 0, 0, 0.85);
  margin: -6px 0 2px;
}
.gate-bubble {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: 999px;
  background: rgba(10, 10, 12, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #f2f2f5; font-size: 13.5px; font-weight: 600;
  animation: gateBubble 3.2s ease-in-out infinite;
}
.gate-bubble.on { animation: none; }
@keyframes gateBubble { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.gate-cta {
  position: relative;
  width: 100%; max-width: 420px; height: 76px;
  border: 1px solid var(--g-red-deep);
  background: linear-gradient(180deg, #3a0d12 0%, #200709 55%, #150506 100%);
  color: #fff; font-family: var(--g-serif);
  font-size: 21px; font-weight: 700; letter-spacing: 2px; cursor: pointer;
  box-shadow: inset 0 0 26px rgba(216, 31, 42, 0.28), 0 10px 34px rgba(0, 0, 0, 0.55), 0 0 26px rgba(216, 31, 42, 0.28);
  animation: gateCtaGlow 2.8s ease-in-out infinite;
}
.gate-cta::before { content: ''; position: absolute; inset: 5px; border: 1px solid rgba(240, 90, 100, 0.55); pointer-events: none; }
.gate-cta::after { content: ''; position: absolute; inset: 10px; border: 1px solid rgba(240, 90, 100, 0.2); pointer-events: none; }
.gate-cta:active { transform: scale(0.98); }
@keyframes gateCtaGlow {
  0%, 100% { box-shadow: inset 0 0 26px rgba(216, 31, 42, 0.28), 0 10px 34px rgba(0, 0, 0, 0.55), 0 0 22px rgba(216, 31, 42, 0.24); }
  50% { box-shadow: inset 0 0 34px rgba(216, 31, 42, 0.42), 0 10px 34px rgba(0, 0, 0, 0.55), 0 0 40px rgba(216, 31, 42, 0.45); }
}

/* =========================================================================
   스테이지 / 비주얼노벨 대화창
   ========================================================================= */
.gate-stage { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.gate-stage > * { pointer-events: auto; }

.vn { position: absolute; inset: 0; display: flex; align-items: flex-end; cursor: pointer; }
.vn-box {
  position: relative; width: 100%;
  padding: 26px 22px calc(env(safe-area-inset-bottom, 0px) + 26px);
  background: linear-gradient(180deg, transparent 0%, rgba(5, 5, 7, 0.5) 24%, rgba(5, 5, 7, 0.93) 62%);
  min-height: 210px;
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.vn-box.on { opacity: 1; transform: none; }
.vn-name {
  display: inline-block; margin-bottom: 12px; padding: 6px 16px;
  background: var(--g-red); color: #fff;
  font-family: var(--g-sans); font-weight: 800; font-size: 14px; letter-spacing: 1px;
  border-radius: 9px 9px 9px 0;
  box-shadow: 0 4px 16px rgba(216, 31, 42, 0.42);
}
.vn-text {
  font-family: var(--g-serif);
  font-size: 19px; line-height: 1.72; color: #fff;
  white-space: pre-line; word-break: keep-all;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.92);
  min-height: 58px;
}
.vn-narr .vn-text { font-style: italic; color: #eaeaee; }
.vn-next {
  position: absolute; right: 22px; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  color: var(--g-red-bright); font-size: 15px; opacity: 0;
  animation: vnBlink 1.1s steps(2, jump-none) infinite;
}
.vn-next.on { opacity: 1; }
@keyframes vnBlink { 50% { opacity: 0.15; } }

.vn-choices { margin-top: 16px; display: flex; flex-direction: column; gap: 9px; }
.vn-choice {
  width: 100%; min-height: 54px; padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(14, 14, 18, 0.62);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: #fff; font-family: var(--g-sans);
  font-size: 16px; font-weight: 700; letter-spacing: -0.01em; text-align: left;
  cursor: pointer;
  opacity: 0; transform: translateX(-8px);
  transition: opacity 0.4s ease, transform 0.4s ease, background 0.2s, border-color 0.2s;
}
.vn-choice.on { opacity: 1; transform: none; }
.vn-choice:hover { background: rgba(216, 31, 42, 0.24); border-color: var(--g-red); }
.vn-choice:active { transform: scale(0.98); }
.vn-go { text-align: center; opacity: 0; pointer-events: none; }
.vn-go.on { opacity: 1; pointer-events: auto; }

/* ---------- 입력 씬 (대화창 안) ---------- */
.vn-input .vn-text { font-family: var(--g-sans); font-style: normal; font-weight: 800; font-size: 23px; letter-spacing: -0.02em; margin-bottom: 16px; }
.gate-input-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.gate-date {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  font-family: var(--g-sans); font-size: 28px; font-weight: 700; color: #fff; letter-spacing: 0.5px;
  padding: 6px 0; border-bottom: 2px solid rgba(255, 255, 255, 0.25); border-radius: 0;
  transition: border-color 0.3s;
}
.gate-date:focus { border-bottom-color: var(--g-red-bright); }
.gate-date::placeholder { color: rgba(255, 255, 255, 0.28); }
.gate-pills { display: flex; gap: 8px; flex: none; }
.gate-pill {
  height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75); font-family: var(--g-sans);
  font-size: 14.5px; font-weight: 700; cursor: pointer;
  backdrop-filter: blur(6px); transition: all 0.2s;
}
.gate-pill.active { background: #fff; color: #111; border-color: #fff; }
.gate-pills-big { width: 100%; margin-bottom: 4px; }
.gate-pills-big .gate-pill { flex: 1; height: 60px; font-size: 17px; font-weight: 800; }
.gate-hours { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.gate-hour {
  height: 46px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(10, 10, 12, 0.5);
  backdrop-filter: blur(6px); color: rgba(255, 255, 255, 0.75);
  font-family: var(--g-sans); font-size: 12.5px; font-weight: 700; cursor: pointer; transition: all 0.18s;
}
.gate-hour.active { background: var(--g-red); color: #fff; border-color: var(--g-red-bright); box-shadow: 0 4px 16px rgba(216, 31, 42, 0.4); }

/* ---------- 의식 연출 ---------- */
.gate-scene {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0 24px calc(env(safe-area-inset-bottom, 0px) + 40px);
  display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
  opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s ease;
}
.gate-scene.on { opacity: 1; transform: none; }
.gate-bell {
  font-size: 46px; line-height: 1;
  filter: drop-shadow(0 0 18px rgba(216, 31, 42, 0.7));
  animation: gateBell 0.9s ease-in-out infinite; transform-origin: top center; margin-bottom: 4px;
}
@keyframes gateBell { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg); } }
.gate-line {
  font-family: var(--g-serif); font-size: 20px; line-height: 1.7; color: #efeff3;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9); white-space: pre-line; word-break: keep-all;
  opacity: 0; transform: translateY(12px);
}
.gate-line.on { opacity: 1; transform: none; transition: opacity 0.8s ease, transform 0.8s ease; }

/* =========================================================================
   결과 시트 — 사주 + 복채 + 후기
   ========================================================================= */
.gate-scene-full {
  top: 0; bottom: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 64px) 24px calc(env(safe-area-inset-bottom, 0px) + 30px);
  overflow-y: auto; justify-content: flex-start; -webkit-overflow-scrolling: touch;
}
.gate-result { width: 100%; max-width: 480px; text-align: left; }
.gate-result-head { text-align: center; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.gate-result-eyebrow { font-family: var(--g-serif); font-size: 20px; font-weight: 700; color: #fff; letter-spacing: 0.5px; margin-bottom: 6px; }
.gate-result-birth { font-family: var(--g-sans); font-size: 12.5px; color: rgba(255, 255, 255, 0.55); letter-spacing: 0.5px; }
.gate-loadtxt { text-align: center; padding: 60px 0; font-family: var(--g-serif); color: rgba(255, 255, 255, 0.6); font-size: 15px; animation: gateRitualPulse 1.4s ease-in-out infinite; }
.gate-read p { font-family: var(--g-sans); font-size: 14.5px; line-height: 1.85; color: #e8e8ec; letter-spacing: -0.01em; word-break: keep-all; margin-bottom: 14px; white-space: pre-line; }
.gate-lockwrap { position: relative; }
.gate-locked {
  filter: blur(7px); opacity: 0.55; max-height: 340px; overflow: hidden;
  mask-image: linear-gradient(180deg, #000 40%, transparent 95%);
  -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 95%);
  transition: filter 0.7s ease, opacity 0.7s ease; user-select: none; pointer-events: none;
}
.gate-lockwrap.gate-unlocked .gate-locked { filter: blur(0); opacity: 1; max-height: none; mask-image: none; -webkit-mask-image: none; }
.gate-paywall { position: absolute; left: 0; right: 0; top: 90px; display: flex; flex-direction: column; align-items: center; gap: 14px; transition: opacity 0.5s; }
.gate-lockwrap.gate-unlocked .gate-paywall { opacity: 0; pointer-events: none; }
.gate-unlock { height: 62px !important; font-size: 17px !important; max-width: 340px; }
.gate-review-label { margin: 26px 0 12px; font-family: var(--g-sans); font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, 0.5); text-align: center; letter-spacing: 1px; }
.gate-reviews { display: flex; flex-direction: column; gap: 10px; }
.gate-review { background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 14px; padding: 13px 15px; }
.gate-review-stars { color: #ffb43a; font-size: 11px; letter-spacing: 2px; }
.gate-review p { font-family: var(--g-sans); font-size: 13px; line-height: 1.6; color: #d6d6dc; margin: 6px 0 7px; word-break: keep-all; }
.gate-review-name { font-size: 11px; color: rgba(255, 255, 255, 0.4); }
.gate-final-cta { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 22px 0 10px; }
.gate-choice.gate-more { max-width: 420px; text-align: center; height: 58px; border-radius: 999px; }
.gate-skip { background: none; border: none; cursor: pointer; color: rgba(255, 255, 255, 0.55); font-family: var(--g-sans); font-size: 13.5px; font-weight: 600; padding: 6px 10px; text-decoration: none; }

/* =========================================================================
   웹툰식 사주 결과 (풀블리드 패널 · 말풍선 · 큰 대사 · 오행/기둥)
   ========================================================================= */
#gateRoot.gate-result-mode .gate-embers { opacity: 0.5; }
/* 결과 모드: 상단 바에 배경 넣어 겹침 방지 (뒤로가기 유지) */
#gateRoot.gate-result-mode .gate-top {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.92) 40%, transparent);
  pointer-events: none;
}
#gateRoot.gate-result-mode .gate-back,
#gateRoot.gate-result-mode .gate-sound { pointer-events: auto; }
.wt-head {
  position: relative; z-index: 1;
  padding: calc(env(safe-area-inset-top, 0px) + 70px) 20px 18px;
  text-align: center;
}
.wt-head-eyebrow { font-family: var(--g-serif); font-size: 17px; font-weight: 700; color: #fff; letter-spacing: 0.5px; }
.wt-head-birth { font-family: var(--g-sans); font-size: 12px; color: rgba(255, 255, 255, 0.5); margin-top: 4px; }
.wt-body { position: relative; }
.wt { display: block; padding-bottom: 20px; }

/* 스크롤 폴리시: 스크롤바 숨김 + 부드럽게 */
#wtScroll { scrollbar-width: none; overscroll-behavior: contain; }
#wtScroll::-webkit-scrollbar { display: none; }

/* 상단 진행률 바 */
.wt-progress {
  position: absolute; top: 0; left: 0; right: 0; z-index: 9;
  height: 3px; background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.wt-progress i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--g-red), var(--g-red-bright));
  box-shadow: 0 0 10px rgba(240, 50, 63, 0.6);
}

/* 생년월일 자동채움 힌트 */
.gate-prefill-hint { font-family: var(--g-sans); font-size: 12.5px; color: var(--g-red-bright); margin: 4px 0 12px; opacity: 0.92; }

/* 리빌 */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 0.8, 0.28, 1); }
.reveal.in { opacity: 1; transform: none; }

/* 캐릭터 패널 */
.wt-panel { position: relative; margin: 0 0 6px; }
.wt-img {
  width: 100%; aspect-ratio: 3 / 4;
  background-size: cover; background-position: center 20%;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 14%, #000 74%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 14%, #000 74%, transparent);
}
.wt-panel-tall .wt-img { aspect-ratio: 3 / 4.4; }

/* 시네마틱 와이드 씬 스트립 */
.wt-strip {
  width: 100%; aspect-ratio: 16 / 11; margin: 6px 0 10px;
  background-size: cover; background-position: center;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 16%, #000 84%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 16%, #000 84%, transparent);
}

/* 구분선 */
.wt-div {
  display: flex; align-items: center; gap: 14px;
  padding: 40px 26px 24px;
}
.wt-div::before, .wt-div::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 50, 63, 0.5), transparent);
}
.wt-div span {
  font-family: var(--g-serif); font-size: 14px; font-weight: 700;
  color: var(--g-red-bright); letter-spacing: 2px; white-space: nowrap;
  text-shadow: 0 0 14px rgba(240, 50, 63, 0.4);
}

/* 여울 나레이션 카드 */
.wt-say {
  margin: 4px 22px 18px; padding: 16px 18px 16px 20px;
  border-left: 2px solid var(--g-red);
  background: linear-gradient(90deg, rgba(216, 31, 42, 0.1), rgba(255, 255, 255, 0.015));
  border-radius: 0 14px 14px 0;
}
.wt-say-name {
  display: inline-block; margin-bottom: 7px;
  font-family: var(--g-sans); font-size: 12px; font-weight: 800;
  color: var(--g-red-bright); letter-spacing: 1px;
}
.wt-say p {
  font-family: var(--g-serif); font-size: 16.5px; line-height: 1.75;
  color: #efeff3; word-break: keep-all;
}
.wt-say em, .wt-sub em { font-style: normal; color: var(--g-red-bright); }
.wt-sub { font-family: var(--g-sans); font-size: 13.5px; color: rgba(255, 255, 255, 0.55); margin-top: 12px; line-height: 1.6; }
.wt-bubble {
  position: absolute; left: 24px; top: 20%;
  padding: 12px 18px; border-radius: 22px 22px 22px 4px;
  background: rgba(228, 228, 233, 0.92);
  color: #1a1a1e; font-family: var(--g-sans); font-size: 14.5px; font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.wt-line {
  position: absolute; left: 0; right: 0; bottom: 8%;
  text-align: center;
  font-family: var(--g-serif); font-size: 25px; font-weight: 700; line-height: 1.45;
  color: #fff; letter-spacing: 0.5px;
  text-shadow: 0 3px 20px rgba(0, 0, 0, 0.95);
}
.wt-line em { font-style: normal; color: var(--g-red-bright); text-shadow: 0 0 26px rgba(240, 50, 63, 0.7); }

/* 큰 대사 단독 */
.wt-big { font-family: var(--g-serif); font-size: 23px; font-weight: 700; line-height: 1.5; color: #fff; text-align: center; letter-spacing: 0.5px; }
.wt-big em { font-style: normal; color: var(--g-red-bright); }
.wt-solo { padding: 46px 24px; }

.wt-block { padding: 18px 22px 30px; }
.wt-block .wt-big { margin-bottom: 18px; }

/* 사주 기둥 카드 */
.wt-pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wt-pil {
  border: 1px solid; border-radius: 14px; padding: 14px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: #1a1a1e;
}
.wt-pil-l { font-family: var(--g-sans); font-size: 11px; color: rgba(255, 255, 255, 0.5); font-weight: 700; }
.wt-pil-g { font-family: var(--g-serif); font-size: 21px; font-weight: 700; color: #fff; letter-spacing: 1px; }
.wt-pil-e { font-family: var(--g-serif); font-size: 15px; font-weight: 700; }

/* 오행 저울 */
.wt-ohaeng { display: flex; flex-direction: column; gap: 9px; }
.wt-oh { display: flex; align-items: center; gap: 12px; }
.wt-oh-n { font-family: var(--g-serif); font-size: 19px; font-weight: 700; width: 22px; text-align: center; }
.wt-oh-bar { flex: 1; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.wt-oh-bar i { display: block; height: 100%; border-radius: 999px; transition: width 1s ease 0.2s; }
.wt-oh-v { font-family: var(--g-sans); font-size: 13px; color: rgba(255, 255, 255, 0.55); width: 14px; }
.wt-oh-cap { margin-top: 16px; text-align: center; font-family: var(--g-sans); font-size: 13.5px; color: rgba(255, 255, 255, 0.7); }
.wt-oh-cap b { font-weight: 800; }

/* 해석 섹션 */
.wt-sec { padding: 22px 24px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.wt-sec-t { font-family: var(--g-sans); font-size: 16px; font-weight: 800; color: #fff; margin-bottom: 10px; letter-spacing: -0.01em; }
.wt-sec-b { font-family: var(--g-sans); font-size: 14.5px; line-height: 1.85; color: #dcdce2; word-break: keep-all; }

/* 복채 잠금 */
.wt-lockwrap { position: relative; }
.wt-locked { filter: blur(9px); opacity: 0.5; max-height: 300px; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 92%); mask-image: linear-gradient(180deg, #000 30%, transparent 92%);
  transition: filter 0.8s ease, opacity 0.8s ease; pointer-events: none; user-select: none; }
.wt-lockwrap.wt-unlocked .wt-locked { filter: none; opacity: 1; max-height: none; -webkit-mask-image: none; mask-image: none; }
/* ===== 복채 잠금 CTA (크고 눈에 띄게) ===== */
.wt-paywall {
  position: absolute; left: 16px; right: 16px; top: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 30px 20px 24px;
  border-radius: 22px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(216, 31, 42, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(20, 12, 13, 0.92), rgba(8, 6, 7, 0.96));
  border: 1px solid rgba(240, 50, 63, 0.4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(216, 31, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(4px);
  transition: opacity 0.5s;
}
.wt-lockwrap.wt-unlocked .wt-paywall { opacity: 0; pointer-events: none; }

/* 봉인 도장 */
.wt-seal {
  width: 62px; height: 62px; margin-top: -50px; margin-bottom: 2px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e5443f, #a01620 70%, #6a0d14);
  border: 2px solid rgba(255, 180, 160, 0.5);
  box-shadow: 0 8px 24px rgba(216, 31, 42, 0.5), 0 0 30px rgba(240, 50, 63, 0.4);
  animation: sealPulse 2.2s ease-in-out infinite;
}
.wt-seal span { font-family: var(--g-serif); font-size: 30px; font-weight: 700; color: #fff2ee; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
@keyframes sealPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 24px rgba(216, 31, 42, 0.5), 0 0 26px rgba(240, 50, 63, 0.35); }
  50% { transform: scale(1.06); box-shadow: 0 8px 28px rgba(216, 31, 42, 0.6), 0 0 44px rgba(240, 50, 63, 0.6); }
}

.wt-paywall-badge {
  font-family: var(--g-sans); font-size: 12px; font-weight: 800; letter-spacing: 0.3px;
  color: #ffd9b0; padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 120, 40, 0.14); border: 1px solid rgba(255, 150, 60, 0.4);
  animation: badgeBlink 1.6s steps(1) infinite;
}
@keyframes badgeBlink { 50% { opacity: 0.55; } }

.wt-paywall-title {
  font-family: var(--g-serif); font-size: 25px; font-weight: 700; line-height: 1.4;
  color: #fff; text-align: center; letter-spacing: 0.5px;
}
.wt-paywall-title em { font-style: normal; color: var(--g-red-bright); text-shadow: 0 0 24px rgba(240, 50, 63, 0.7); }

.wt-bubble-static {
  position: relative; left: 0; top: 0;
  background: rgba(228, 228, 233, 0.95); color: #1a1a1e;
  font-size: 13.5px; line-height: 1.45; text-align: center;
  border-radius: 16px; padding: 12px 16px;
}

/* 대형 CTA (2줄, 강한 발광 펄스) */
.wt-unlock {
  width: 100%; max-width: 400px; height: auto !important;
  min-height: 78px; padding: 14px 20px !important;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 16px !important;
  font-size: 19px !important;
  animation: unlockPulse 1.8s ease-in-out infinite;
}
.wt-unlock-main { font-family: var(--g-serif); font-size: 20px; font-weight: 700; letter-spacing: 0.5px; white-space: nowrap; }
.wt-unlock-sub { font-family: var(--g-sans); font-size: 13.5px; font-weight: 700; letter-spacing: 0; color: rgba(255, 235, 230, 0.92); }
.wt-unlock-sub s { color: rgba(255, 210, 200, 0.6); }
.wt-unlock-sub b { color: #ffe08a; font-weight: 900; }
@keyframes unlockPulse {
  0%, 100% { transform: scale(1); box-shadow: inset 0 0 26px rgba(216, 31, 42, 0.3), 0 10px 30px rgba(216, 31, 42, 0.35), 0 0 24px rgba(240, 50, 63, 0.3); }
  50% { transform: scale(1.025); box-shadow: inset 0 0 34px rgba(216, 31, 42, 0.45), 0 14px 40px rgba(216, 31, 42, 0.5), 0 0 46px rgba(240, 50, 63, 0.55); }
}

.wt-paywall-sub { font-family: var(--g-sans); font-size: 12.5px; color: rgba(255, 255, 255, 0.55); text-align: center; }
.wt-paywall-sub em { font-style: normal; color: var(--g-red-bright); font-weight: 700; }

/* 잠긴 항목 리스트 (결제 상품 느낌) */
.wt-unlock-list { list-style: none; width: 100%; max-width: 400px; margin: 2px 0 2px; padding: 0; }
.wt-unlock-list li {
  display: flex; flex-direction: column; gap: 1px;
  padding: 11px 12px 11px 40px; position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.wt-unlock-list li::before {
  content: '🔒'; position: absolute; left: 8px; top: 12px; font-size: 15px; filter: grayscale(0.2);
}
.wt-unlock-list li.wt-li-pdf::before { content: '📄'; }
.wt-unlock-list li b { font-family: var(--g-sans); font-size: 15px; font-weight: 800; color: #fff; }
.wt-unlock-list li span { font-family: var(--g-sans); font-size: 12.5px; color: rgba(255, 255, 255, 0.55); }

/* 가격 */
.wt-price { display: flex; align-items: baseline; justify-content: center; gap: 12px; margin: 4px 0 2px; }
.wt-price-was { font-family: var(--g-sans); font-size: 14px; color: rgba(255, 255, 255, 0.5); }
.wt-price-was s { color: rgba(255, 255, 255, 0.4); }
.wt-price-now { font-family: var(--g-sans); font-size: 16px; color: #fff; font-weight: 700; }
.wt-price-now b { color: #ffe08a; font-size: 26px; font-weight: 900; letter-spacing: -0.02em; }

/* PDF / 공유 액션 바 */
.wt-actions { display: flex; gap: 10px; padding: 8px 20px 4px; }
.wt-act {
  flex: 1; display: flex; align-items: center; gap: 11px;
  padding: 14px 14px; border-radius: 16px; cursor: pointer; text-align: left;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.2s, border-color 0.2s, transform 0.12s;
}
.wt-act:hover { background: rgba(216, 31, 42, 0.14); border-color: var(--g-red-line); }
.wt-act:active { transform: scale(0.97); }
.wt-act-ico { font-size: 22px; flex: none; }
.wt-act span:last-child { display: flex; flex-direction: column; }
.wt-act b { font-family: var(--g-sans); font-size: 14.5px; font-weight: 800; color: #fff; }
.wt-act em { font-family: var(--g-sans); font-size: 11.5px; font-style: normal; color: rgba(255, 255, 255, 0.5); }

/* 토스트 */
.gate-toast {
  position: absolute; left: 50%; bottom: 90px; transform: translate(-50%, 12px);
  z-index: 20; padding: 12px 20px; border-radius: 999px; max-width: 86%;
  background: rgba(20, 14, 15, 0.94); border: 1px solid var(--g-red-line);
  color: #fff; font-family: var(--g-sans); font-size: 13.5px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); opacity: 0; transition: opacity 0.35s, transform 0.35s;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gate-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ===== 말풍선 — 크고 분위기 있게 (다크 글라스 + 크림슨 엣지) ===== */
.wt-bubble, .wt-bubble-static, .gate-bubble {
  font-family: var(--g-sans);
  color: #fff; font-weight: 700;
  background: rgba(16, 10, 12, 0.7) !important;
  border: 1px solid rgba(240, 50, 63, 0.55) !important;
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 24px rgba(216, 31, 42, 0.22) !important;
}
.wt-bubble {
  position: absolute; left: 20px; top: 16%;
  max-width: 74%;
  padding: 15px 22px; border-radius: 24px 24px 24px 7px;
  font-size: 17.5px; letter-spacing: -0.01em; line-height: 1.4;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.wt-bubble::after {
  content: ''; position: absolute; left: 16px; bottom: -9px;
  border: 9px solid transparent; border-top-color: rgba(240, 50, 63, 0.55); border-bottom: 0;
}
.gate-bubble {
  font-size: 15px !important; padding: 13px 22px !important; letter-spacing: -0.01em;
}
.wt-bubble-static {
  position: relative; left: 0; top: 0;
  font-size: 15px; line-height: 1.5; text-align: center;
  padding: 14px 18px; border-radius: 18px;
}

/* 통계 */
.wt-stats { display: flex; justify-content: center; gap: 10px; padding: 30px 20px 10px; }
.wt-stats > div { flex: 1; max-width: 120px; text-align: center; padding: 16px 6px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07); }
.wt-stats b { display: block; font-family: var(--g-sans); font-size: 20px; font-weight: 900; color: var(--g-red-bright); letter-spacing: -0.02em; }
.wt-stats span { font-family: var(--g-sans); font-size: 11px; color: rgba(255, 255, 255, 0.55); }

/* 후기 */
.wt-review-label { text-align: center; font-family: var(--g-sans); font-size: 15px; font-weight: 800; color: #fff; margin: 26px 0 14px; }
.wt-reviews { padding: 0 20px; display: flex; flex-direction: column; gap: 10px; }
.wt-review { background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 14px; padding: 14px 16px; }
.wt-review-stars { color: #ffb43a; font-size: 12px; letter-spacing: 2px; }
.wt-review p { font-family: var(--g-sans); font-size: 13.5px; line-height: 1.6; color: #dcdce2; margin: 7px 0; word-break: keep-all; }
.wt-review-name { font-family: var(--g-sans); font-size: 11.5px; color: rgba(255, 255, 255, 0.4); }

.wt-final { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 24px calc(env(safe-area-inset-bottom, 0px) + 40px); }
.wt-more { max-width: 380px; height: 58px; border-radius: 999px; text-align: center; }

/* ---------- 챗 페이지 다크 패치 + 모바일 프레임 ---------- */
body.gate-dark {
  --primary: #d81f2a; --primary-dark: #a01620;
  --primary-soft: #241012; --primary-border: #47181d; --page-bg: #000000;
  background: #000 !important;
}
/* 챗 셸도 480 컬럼 밖은 검정 (일관된 모바일 프레임) */
body.gate-dark .chat-container { box-shadow: 0 0 0 100vmax #000; }

/* =========================================================================
   챗을 어드벤처(VN) 다크 스타일로 리스킨 (gate-dark 페이지에서만)
   ========================================================================= */
body.gate-dark { background: #000 !important; }
body.gate-dark .chat-container { background: #08070a !important; }

/* 히어로 — 캐릭터 이미지 + 어둠 */
body.gate-dark .wolha-hero {
  background:
    linear-gradient(180deg, rgba(6,6,9,0.35) 0%, transparent 30%, rgba(6,6,9,0.45) 62%, rgba(8,7,10,0.98) 100%),
    var(--char-img, linear-gradient(165deg, #1a1420, #0c0a10)) !important;
  background-size: cover !important;
  background-position: center 22% !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body.gate-dark .wolha, body.gate-dark .wolha-float, body.gate-dark .orb, body.gate-dark .orb-halo,
body.gate-dark .moon-halo, body.gate-dark .eye { display: none !important; }
body.gate-dark .chat-input button {
  background: linear-gradient(135deg, #d81f2a, #a01620) !important;
  box-shadow: 0 3px 10px rgba(216, 31, 42, 0.4) !important;
}
body.gate-dark .status-dot { background: #d81f2a !important; }

body.gate-dark .chat-topbar { background: linear-gradient(180deg, rgba(0,0,0,0.8), transparent) !important; }
body.gate-dark .topbar-name, body.gate-dark .topbar-name em { color: #fff !important; }
body.gate-dark .topbar-status { color: rgba(255,255,255,0.6) !important; }
body.gate-dark .topbar-btn { background: rgba(255,255,255,0.12) !important; }
body.gate-dark .topbar-btn svg { fill: #fff !important; }

/* 메시지 영역 */
body.gate-dark .chat-messages { background: #08070a !important; }
body.gate-dark .quick-replies { background: #08070a !important; }

/* 말풍선 — VN 스타일 */
body.gate-dark .msg-bot .bubble {
  background: rgba(18, 12, 14, 0.92) !important;
  border: 1px solid rgba(240, 50, 63, 0.4) !important;
  color: #ececf0 !important;
  border-top-left-radius: 6px !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5), 0 0 16px rgba(216,31,42,0.12) !important;
  font-family: var(--g-serif);
  font-size: 15.5px !important;
}
body.gate-dark .msg-user .bubble {
  background: linear-gradient(135deg, #d81f2a, #a01620) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(216,31,42,0.4) !important;
}
body.gate-dark .msg-avatar {
  background: radial-gradient(circle at 34% 30%, #f2f2f6, #b8b8c2 42%, #4a4a52) !important;
  color: #1a1a1e !important; box-shadow: 0 0 14px rgba(240,50,63,0.3) !important;
}

/* 칩 */
body.gate-dark .chip {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(240,50,63,0.35) !important;
  color: #f0d9dc !important;
}
body.gate-dark .chip:hover { background: rgba(216,31,42,0.18) !important; }

/* 입력창 */
body.gate-dark .chat-input, body.gate-dark [class*="composer"], body.gate-dark [class*="input-bar"] {
  background: #0c0a0e !important; border-top: 1px solid rgba(255,255,255,0.08) !important;
}
body.gate-dark .chat-input input, body.gate-dark textarea {
  background: rgba(255,255,255,0.05) !important; color: #fff !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
}
body.gate-dark .chat-input input::placeholder { color: rgba(255,255,255,0.35) !important; }

/* 사주 카드 (챗 내부) */
body.gate-dark .saju-card { background: rgba(255,255,255,0.04) !important; border: 1px solid rgba(240,50,63,0.3) !important; }
body.gate-dark .saju-card-title, body.gate-dark .pillar-char { color: #fff !important; }
body.gate-dark .pillar-label { color: rgba(255,255,255,0.5) !important; }
body.gate-dark .typing-dots span { background: rgba(240,50,63,0.6) !important; }

@media (prefers-reduced-motion: reduce) {
  .gate-bg, #gateRoot.gate-entering .gate-bg.on, #gateRoot.gate-alive .gate-bg.on { animation: none !important; }
  .gate-bubble, .gate-cta, .gate-bell { animation: none !important; }
}
