/* ═════════════════════════════════════════════════════════════
   선문야사 · 광과민 방지 수묵·금분 이펙트 v2 (무점멸 · 가시성 보강)
   ═════════════════════════════════════════════════════════════ */

#fx-ambient {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

#fx-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 950;
  pointer-events: none;
}

/* ── 기존 흔들림 완화 (무점멸·저자극) ── */
.runbar.flash {
  animation: fx-calm-border 1.4s cubic-bezier(.22, 1, .36, 1) !important;
}
@keyframes fx-calm-border {
  0%   { box-shadow: 0 0 0 0 rgba(226, 196, 126, 0); }
  40%  { box-shadow: 0 0 0 5px rgba(226, 196, 126, .38); }
  100% { box-shadow: 0 0 0 0 rgba(226, 196, 126, 0); }
}

/* ── 패널·시트·모달 한지 펼침 전환 ── */
.toast {
  animation: fx-toast-in .48s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes fx-toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

#sheetRoot .sheet {
  animation: fx-sheet-in .38s cubic-bezier(.22, 1, .36, 1) both !important;
}
@keyframes fx-sheet-in {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.sect-record-modal,
.sect-oath-modal {
  animation: fx-modal-in .42s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes fx-modal-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 14px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

.sect-modal-backdrop,
.scrim {
  animation: fx-fade-in .32s ease-out both;
}
@keyframes fx-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── 낙관(落款) 날인 안착 ── */
.stamp {
  animation: fx-stamp-press .55s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes fx-stamp-press {
  from { opacity: 0; transform: rotate(-8deg) scale(1.22); }
  to   { opacity: .92; transform: rotate(-8deg) scale(1); }
}

.bt-seal.big {
  animation: fx-bt-seal .55s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes fx-bt-seal {
  from { opacity: 0; transform: rotate(-6deg) scale(1.24); }
  to   { opacity: 1; transform: rotate(-6deg) scale(1); }
}

/* ── 강조 버튼 단방향 금분 스침 (무한 반복 없음) ── */
.btn.cta {
  position: relative;
  overflow: hidden;
  transition: background .28s ease, border-color .28s ease, box-shadow .28s ease;
}
.btn.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 24%,
    rgba(255, 244, 214, .32) 50%,
    transparent 76%
  );
  transform: translateX(-125%);
  pointer-events: none;
}
.btn.cta:hover:not(:disabled)::after {
  transform: translateX(125%);
  transition: transform .85s cubic-bezier(.22, 1, .36, 1);
}

.btn,
.op,
.bact,
.sect-emblem,
.lobby-v5 .a-fac button {
  transition: background .28s ease, border-color .28s ease, box-shadow .28s ease, transform .28s ease;
}

/* ── 명패 향불·현재 경지·수확 영전 (초저속 호흡, 무점멸) ── */
.incense .stick b {
  animation: fx-ember-breath 5.2s ease-in-out infinite;
}
@keyframes fx-ember-breath {
  0%, 100% { box-shadow: 0 0 6px 2px color-mix(in srgb, var(--cta) 45%, transparent); }
  50%      { box-shadow: 0 0 12px 4px color-mix(in srgb, var(--cta) 65%, transparent); }
}

.lobby-v5 .cult .node.now i {
  animation: fx-qi-breath 6s ease-in-out infinite;
}
@keyframes fx-qi-breath {
  0%, 100% { box-shadow: 0 0 0 4px rgba(195, 171, 101, .22), 0 0 14px rgba(62, 167, 115, .32); }
  50%      { box-shadow: 0 0 0 7px rgba(195, 171, 101, .34), 0 0 22px rgba(62, 167, 115, .48); }
}

.plot.ready {
  box-shadow: inset 0 0 0 1px var(--good), 0 0 12px color-mix(in srgb, var(--good) 26%, transparent);
}

/* ── 돌파·승격 중앙 현판·낙관 배너 ── */
.fx-banner {
  position: fixed;
  left: 50%;
  top: 18%;
  transform: translate(-50%, 12px);
  z-index: 960;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 26px 15px 18px;
  background: linear-gradient(145deg, rgba(251, 248, 236, .97), rgba(238, 233, 214, .97));
  border: 1px solid #b59a60;
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 3px rgba(255, 252, 234, .85),
    inset 0 0 0 4px rgba(181, 154, 96, .4),
    0 14px 36px rgba(28, 39, 34, .22);
  color: #243831;
  opacity: 0;
  transition: opacity .75s cubic-bezier(.22, 1, .36, 1), transform .75s cubic-bezier(.22, 1, .36, 1);
}
.fx-banner.on {
  opacity: 1;
  transform: translate(-50%, 0);
}
.fx-banner .fx-b-seal {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 2px solid #a34232;
  border-radius: 3px;
  color: #a34232;
  background: rgba(163, 66, 50, .08);
  font-size: 22px;
  line-height: 1;
  transform: rotate(-6deg);
}
.fx-banner .fx-b-text {
  display: grid;
  gap: 2px;
}
.fx-banner .fx-b-sub {
  font-size: 12px;
  letter-spacing: .16em;
  color: #7a6342;
}
.fx-banner .fx-b-title {
  font-size: 22px;
  letter-spacing: .08em;
  color: #1f3931;
}

/* ── 모션 축소 환경 대응 ── */
@media (prefers-reduced-motion: reduce) {
  #fx-ambient,
  #fx-overlay {
    display: none !important;
  }
  .toast,
  #sheetRoot .sheet,
  .sect-record-modal,
  .sect-oath-modal,
  .sect-modal-backdrop,
  .scrim,
  .stamp,
  .bt-seal.big,
  .incense .stick b,
  .lobby-v5 .cult .node.now i,
  .runbar.flash {
    animation: none !important;
  }
  .btn.cta::after {
    display: none !important;
  }
}
