/* luna-fk08.css — FK08「いま動くべきかのお告げ」 視覚レイヤー（gate・オプトイン表示層）
 * 夜の社＋お告げ札(closed→open)。安全ルート(data-fx-safe=1)は高揚演出を抑制。
 * scope は .luna-fx-stage--fk08 / .luna-fx--fk08 配下に限定。 */

.luna-fx-stage--fk08 {
  position: fixed; inset: 0; z-index: 1; overflow: hidden;
  container-type: size; pointer-events: none; isolation: isolate; background: #04050c;
}
.luna-fx-stage--fk08 .layer { position: absolute; pointer-events: none; background-repeat: no-repeat; background-position: center; background-size: cover; }

/* 夜の社の背景 */
.luna-fx-stage--fk08 .l-bg { inset: 0; z-index: 0; }

/* お告げ札（閉）: 結果前に中央やや上に置く */
.luna-fx-stage--fk08 .l-slip-closed {
  left: 50%; top: 40%; width: min(46cqw, 300px); height: min(74cqw, 480px);
  transform: translate(-50%, -50%) scale(1); background-size: contain;
  transition: top .8s cubic-bezier(.22,.61,.36,1), transform .8s cubic-bezier(.22,.61,.36,1), opacity .6s ease;
  z-index: 24; opacity: 1;
}
/* 光（通常結果のみ・お告げの高揚演出） */
.luna-fx-stage--fk08 .l-glow-slip {
  left: 50%; top: 38%; width: min(96cqw, 620px); height: min(96cqw, 620px);
  transform: translate(-50%, -50%); background-size: contain; mix-blend-mode: screen;
  z-index: 22; opacity: 0; transition: opacity .8s ease;
}
/* お告げ札（開）: 結果で登場 */
.luna-fx-stage--fk08 .l-slip-open {
  left: 50%; top: 38%; width: min(58cqw, 380px); height: min(83cqw, 540px);
  transform: translate(-50%, -50%); background-size: contain;
  z-index: 25; opacity: 0; transition: opacity .5s ease;
}

/* ===== KF 状態 ===== */
.luna-fx-stage--fk08[data-fx-state="intro"] .l-slip-closed { top: 40%; transform: translate(-50%,-50%) scale(1); }
.luna-fx-stage--fk08[data-fx-state="quiz"] .l-slip-closed { top: 22%; transform: translate(-50%,-50%) scale(.62); }
.luna-fx-stage--fk08[data-fx-state="quiz"] .l-slip-closed { opacity: 0; }
.luna-fx-stage--fk08[data-fx-state="gathering"] .l-slip-closed { top: 38%; transform: translate(-50%,-50%) scale(.9); }
.luna-fx-stage--fk08[data-fx-state="result"] .l-slip-closed { opacity: 0; }
.luna-fx-stage--fk08[data-fx-state="result"] .l-slip-open { opacity: 0; animation: none; }
/* 通常結果のみ光を灯す（安全結果では出さない） */
.luna-fx-stage--fk08[data-fx-state="result"][data-fx-safe="0"] .l-glow-slip { opacity: .18; animation: fk08-glow-pulse 5s ease-in-out infinite; }

/* ===== 安全ルート: 高揚演出を鎮め、保護のトーンへ（祝福・光・成功演出を出さない） ===== */
.luna-fx-stage--fk08[data-fx-safe="1"] .l-bg { filter: saturate(.55) brightness(.82) hue-rotate(-12deg); }
.luna-fx-stage--fk08[data-fx-safe="1"] .l-glow-slip { opacity: 0 !important; animation: none !important; }
.luna-fx-stage--fk08[data-fx-safe="1"] .l-slip-open { opacity: 0; animation: none; }

/* ===== 既存モーダルUIを社の場に載せる（fk08のみ） ===== */
.luna-fx--fk08 .luna-diagnosis__veil { background: none; }
.luna-fx--fk08 .luna-modal, .luna-fx--fk08 .luna-imm .luna-modal { background: rgba(5,6,14,.46); backdrop-filter: blur(12px); }
.luna-fx--fk08 .luna-gather { background: transparent; }
.luna-fx--fk08 .luna-result {
  background: linear-gradient(180deg, rgba(16,14,32,.95), rgba(10,9,24,.98));
  border: 1px solid rgba(212,180,106,.36); border-radius: 20px;
  padding: clamp(20px,4vh,40px) clamp(18px,5vw,44px); backdrop-filter: blur(6px);
  box-shadow: 0 22px 64px rgba(0,0,0,.5);
}
/* 安全結果は本文パネルも保護トーン（金の高揚を抑える） */
.luna-fx--fk08 .luna-result.is-safe { border-color: rgba(143,182,168,.42); background: linear-gradient(180deg, rgba(18,30,30,.96), rgba(12,22,22,.98)); }

/* ===== keyframes（fk08接頭辞） ===== */
@keyframes fk08-slip-open { from { opacity: 0; transform: translate(-50%,-46%) scale(.9); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
@keyframes fk08-slip-open-calm { from { opacity: 0; } to { opacity: 1; } }
@keyframes fk08-glow-pulse { 0%,100% { opacity: .6; } 50% { opacity: .9; } }

/* ===== reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
  .luna-fx-stage--fk08 .l-slip-closed { transition: none !important; }
  .luna-fx-stage--fk08 .l-glow-slip, .luna-fx-stage--fk08 .l-slip-open { animation: none !important; transition: none !important; }
}

/* 設問モーダル中は背景ステージをぼかして手前のパネルを強調（2026-07-19 人間指示）。result では解除 */
.luna-fx-stage--fk08 { transition: filter .5s ease; }
.luna-fx-stage--fk08[data-fx-quizmode="1"] { filter: blur(18px) brightness(.58); }
