/* =========================================================================
   Final Boss Scene Styling — 학교 중앙 시스템 제어실 & 이해의 코어 최종전
   ========================================================================= */

#final-boss-scene,
.final-boss-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #020712;
  color: #e2e8f0;
  font-family: inherit;
  overflow: hidden;
  user-select: none;
  z-index: 10;
  --fb-accent: #27d6ff;
  --fb-accent-soft: rgba(39, 214, 255, 0.16);
  --fb-accent-line: rgba(39, 214, 255, 0.36);
  --fb-panel-bg: rgba(5, 19, 39, 0.95);
  --fb-panel-bg-2: rgba(8, 28, 54, 0.94);
  --fb-text: #f5fbff;
  --fb-muted: #8ea9bd;
  --fb-danger: #ff536d;
  --fb-warning: #ffca58;
}

body.final-boss-intro-active #ui-layer {
  z-index: 13000;
}

body.final-boss-intro-active #final-boss-scene > .stage-chrome-topbar {
  display: none;
}

body.final-boss-intro-active #ui-layer > *:not(#stage-home-confirm):not(#dialogue-panel),
body.final-boss-intro-active #overlay-layer > * {
  display: none !important;
}

.fb-cinematic-wrap .fb-cinematic-top-actions {
  z-index: 12070;
}

/* =========================================================================
   1. 배경 제어실 레이어 (Central Control Room Background)
   ========================================================================= */
.fb-background-layer {
  position: absolute;
  inset: 0;
  width: 1920px;
  height: 1080px;
  background: #020712 url("../assets/images/finalBoss/final_boss_bg.jpg") no-repeat center center;
  background-size: 1920px 1080px;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

/* 1-1. 배경 깊이감 그라디언트 비네트 */
.fb-bg-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 46%, rgba(2, 7, 18, 0.22) 0%, rgba(2, 7, 18, 0.48) 55%, rgba(1, 4, 10, 0.88) 100%),
    linear-gradient(180deg, rgba(2, 6, 14, 0.5) 0%, transparent 25%, transparent 75%, rgba(2, 6, 14, 0.65) 100%);
}

/* 1-2. 미세 사이버 그리드 */
.fb-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center center;
  mask-image: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.55) 20%, rgba(0, 0, 0, 0.18) 65%, transparent 90%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.55) 20%, rgba(0, 0, 0, 0.18) 65%, transparent 90%);
}

/* 1-3. 바닥 원형 플랫폼 반사광 */
.fb-bg-floor-reflect {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 40px;
  width: 900px;
  height: 220px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255, 45, 65, 0.12) 0%, rgba(0, 229, 255, 0.06) 40%, transparent 70%);
  pointer-events: none;
  animation: fbFloorPulse 5s ease-in-out infinite alternate;
}

@keyframes fbFloorPulse {
  0% { opacity: 0.6; transform: translateX(-50%) scale(0.96); }
  100% { opacity: 0.95; transform: translateX(-50%) scale(1.04); }
}

/* 1-4. 좌우 ↔ 중앙 연결 회로선 (Section 17: 문제창 뒤 background layer에만 배치) */
.fb-bg-interconnect-circuits {
  position: absolute;
  inset: 0;
  width: 1920px;
  height: 1080px;
  pointer-events: none;
}

/* 1-5. 중앙 시스템 코어 SVG 레이어 (문제창 바로 뒤 820px) */
.fb-bg-central-core {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  width: 820px;
  height: 820px;
  pointer-events: none;
}

.fb-central-core-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.fb-core-anim-outer {
  transform-origin: 400px 400px;
  animation: fbCoreRotateSlow 90s linear infinite;
}

.fb-core-anim-mid {
  transform-origin: 400px 400px;
  animation: fbCoreRotateReverse 120s linear infinite;
}

.fb-core-anim-inner {
  transform-origin: 400px 400px;
  animation: fbCoreBreath 4.5s ease-in-out infinite alternate;
}

@keyframes fbCoreBreath {
  0% { opacity: 0.55; transform: scale(0.985); }
  100% { opacity: 0.95; transform: scale(1.015); }
}

@keyframes fbCoreRotateSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes fbCoreRotateReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

/* =========================================================================
   2. 상단 HUD (Top Header) — FINAL BOSS | 마지막 잠금 3개 | 잠금 1~3
   ========================================================================= */
.fb-core-hud {
  position: relative;
  z-index: 20;
  width: 980px;
  margin: 78px auto 0;
  min-height: 64px;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(8, 29, 52, 0.96), rgba(5, 20, 39, 0.96));
  border: 1px solid rgba(48, 203, 255, 0.34);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35), inset 0 0 16px rgba(0, 229, 255, 0.06);
}

.fb-core-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fb-core-badge {
  font-size: 16px;
  letter-spacing: 1.5px;
  font-weight: 800;
  color: #00e5ff;
  text-transform: uppercase;
  padding: 4px 12px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.4);
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
}

.fb-core-main-title {
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* 잠금 진행 표시 트랙 (Connected Progress Nodes) */
.fb-core-slots {
  display: flex;
  align-items: center;
  gap: 0;
}

.fb-core-slot {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 72px;
  padding: 5px 11px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: #94a3b8;
  cursor: default;
  user-select: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.fb-core-slot .fb-slot-icon {
  font-size: 13px;
  line-height: 1;
}

.fb-core-slot .fb-slot-name {
  font-size: 12px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.fb-core-slot.is-locked {
  border-color: rgba(99, 102, 241, 0.26);
  background: rgba(15, 23, 42, 0.72);
  color: #94a3b8;
}

.fb-core-slot.is-current {
  border-color: rgba(56, 189, 248, 0.7);
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3), inset 0 0 6px rgba(56, 189, 248, 0.08);
  animation: fb-current-pulse 2s ease-in-out infinite;
}

@keyframes fb-current-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(56, 189, 248, 0.3), inset 0 0 6px rgba(56, 189, 248, 0.08); }
  50% { box-shadow: 0 0 16px rgba(56, 189, 248, 0.45), inset 0 0 8px rgba(56, 189, 248, 0.12); }
}

.fb-core-slot.is-unlocked {
  border-color: rgba(0, 229, 255, 0.75);
  background: rgba(0, 229, 255, 0.14);
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.28);
  animation: fb-unlock-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.fb-slot-connector {
  width: 22px;
  height: 2px;
  background: rgba(71, 85, 105, 0.45);
  flex-shrink: 0;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.fb-slot-connector.is-active {
  background: #00e5ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.65);
}

@keyframes fb-unlock-pop {
  0% { transform: scale(0.95); }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* =========================================================================
   3. 좌우 장식 레이어 (Decoration Layer — Absolute & Pointer-Events: None)
   중앙 문제창을 단 1px도 밀지 않는 완전 분리 구조
   ========================================================================= */
.fb-decoration-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

/* -------------------------------------------------------------------------
   3-A. 왼쪽: 학교 홀로그램 (School Isometric Hologram)
   - 학교 이름 일체 없음
   - 6개 공간(교실, 복도, 과학실, 컴퓨터실, 체육관, 도서관) 복구 노드
   ------------------------------------------------------------------------- */
.fb-school-hologram {
  position: absolute;
  left: 74px;
  top: 48%;
  transform: translateY(-50%);
  width: 320px;
  height: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
  opacity: 0.96;
  animation: fbHoloFloat 6s ease-in-out infinite alternate;
}

@keyframes fbHoloFloat {
  0% { transform: translateY(calc(-50% - 2.5px)); opacity: 0.92; }
  100% { transform: translateY(calc(-50% + 2.5px)); opacity: 1; }
}

.fb-holo-projection-beam {
  position: absolute;
  bottom: 24px;
  width: 270px;
  height: 290px;
  background: linear-gradient(to top, rgba(0, 229, 255, 0.30) 0%, rgba(39, 214, 255, 0.08) 45%, transparent 100%);
  clip-path: polygon(30% 100%, 70% 100%, 100% 0%, 0% 0%);
  pointer-events: none;
}

.fb-holo-model {
  position: relative;
  width: 320px;
  height: 260px;
  margin-bottom: 8px;
  perspective: 720px;
  perspective-origin: 50% 42%;
}

.fb-school-3d-scene {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  filter: drop-shadow(0 0 9px rgba(0, 229, 255, 0.72));
}

.fb-school-3d-world {
  position: absolute;
  left: 30px;
  top: 38px;
  width: 260px;
  height: 180px;
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  animation: fbSchoolWorldTurn 28s linear infinite;
  will-change: transform;
}

@keyframes fbSchoolWorldTurn {
  from { transform: rotateX(58deg) rotateZ(-38deg); }
  to { transform: rotateX(58deg) rotateZ(322deg); }
}

.fb-campus-3d-deck,
.fb-3d-building {
  position: absolute;
  left: 0;
  top: 0;
  transform-style: preserve-3d;
}

.fb-campus-3d-deck {
  --w: 260px;
  --d: 180px;
  --h: 10px;
  width: var(--w);
  height: var(--d);
}

.fb-3d-building {
  width: var(--w);
  height: var(--d);
  transform: translate3d(var(--x), var(--y), 11px);
}

.fb-3d-face {
  position: absolute;
  display: block;
  box-sizing: border-box;
  border: 1px solid rgba(71, 232, 255, 0.88);
  background: rgba(3, 31, 57, 0.7);
  backface-visibility: visible;
  box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.13), 0 0 4px rgba(0, 229, 255, 0.25);
}

.fb-3d-face--top {
  left: 0;
  top: 0;
  width: var(--w);
  height: var(--d);
  transform: translateZ(var(--h));
  background:
    repeating-linear-gradient(90deg, rgba(94, 234, 255, 0.09) 0 1px, transparent 1px 10px),
    repeating-linear-gradient(0deg, rgba(94, 234, 255, 0.07) 0 1px, transparent 1px 10px),
    rgba(0, 229, 255, 0.16);
}

.fb-3d-face--front,
.fb-3d-face--back {
  width: var(--w);
  height: var(--h);
  transform-origin: 0 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(137, 240, 255, 0.42) 8px 10px),
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(73, 226, 255, 0.24) 7px 9px),
    rgba(2, 25, 51, 0.78);
}

.fb-3d-face--front {
  transform: translate3d(0, var(--d), 0) rotateX(90deg);
}

.fb-3d-face--back {
  transform: rotateX(90deg);
  background-color: rgba(2, 18, 39, 0.88);
}

.fb-3d-face--left,
.fb-3d-face--right {
  width: var(--d);
  height: var(--h);
  transform-origin: 0 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(137, 240, 255, 0.34) 8px 10px),
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(73, 226, 255, 0.2) 7px 9px),
    rgba(1, 20, 43, 0.84);
}

.fb-3d-face--left {
  transform: rotateZ(90deg) rotateX(90deg);
}

.fb-3d-face--right {
  transform: translate3d(var(--w), 0, 0) rotateZ(90deg) rotateX(90deg);
  background-color: rgba(4, 35, 65, 0.8);
}

.fb-campus-3d-deck > .fb-3d-face {
  border-color: rgba(0, 229, 255, 0.58);
  background-color: rgba(1, 20, 42, 0.8);
}

.fb-campus-grid {
  position: absolute;
  inset: 8px;
  z-index: 2;
  transform: translateZ(11px);
  border: 1px dashed rgba(72, 223, 255, 0.38);
  background:
    repeating-linear-gradient(90deg, transparent 0 19px, rgba(0, 229, 255, 0.11) 19px 20px),
    repeating-linear-gradient(0deg, transparent 0 19px, rgba(0, 229, 255, 0.09) 19px 20px);
}

.fb-school-field-3d {
  position: absolute;
  left: 65px;
  top: 55px;
  width: 130px;
  height: 92px;
  box-sizing: border-box;
  transform: translateZ(12px);
  border: 2px solid rgba(206, 252, 255, 0.88);
  background:
    repeating-linear-gradient(90deg, rgba(28, 214, 169, 0.12) 0 13px, rgba(0, 229, 255, 0.06) 13px 26px),
    rgba(2, 82, 76, 0.38);
  box-shadow: inset 0 0 16px rgba(41, 255, 206, 0.2), 0 0 8px rgba(0, 229, 255, 0.48);
  transform-style: preserve-3d;
}

.fb-school-field-3d > span {
  position: absolute;
  display: block;
  box-sizing: border-box;
  border-color: rgba(220, 253, 255, 0.84);
}

.fb-field-halfway {
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  border-left: 1px solid rgba(220, 253, 255, 0.84);
}

.fb-field-center-circle {
  left: 50%;
  top: 50%;
  width: 25px;
  height: 25px;
  border: 1px solid;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.fb-field-center-circle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #dffcff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 5px #00e5ff;
}

.fb-field-penalty {
  top: 25%;
  width: 20px;
  height: 50%;
  border: 1px solid;
}

.fb-field-penalty--left { left: -1px; }
.fb-field-penalty--right { right: -1px; }

.fb-field-goal {
  top: 38%;
  width: 6px;
  height: 24%;
  border: 1px solid;
  transform: translateZ(3px);
}

.fb-field-goal--left { left: -7px; }
.fb-field-goal--right { right: -7px; }

.fb-school-blue-roof {
  position: absolute;
  left: -2px;
  top: -2px;
  width: calc(var(--w) + 4px);
  height: calc(var(--d) + 4px);
  transform: translateZ(calc(var(--h) + 3px));
  border: 1px solid rgba(190, 248, 255, 0.92);
  background:
    linear-gradient(90deg, rgba(28, 124, 219, 0.48), rgba(0, 229, 255, 0.22) 48%, rgba(173, 244, 255, 0.5) 50%, rgba(0, 229, 255, 0.2) 52%, rgba(20, 101, 192, 0.5));
  box-shadow: 0 0 9px rgba(0, 229, 255, 0.54);
}

.fb-3d-building--clock-tower .fb-3d-face {
  border-color: rgba(188, 248, 255, 0.96);
  background-color: rgba(8, 50, 83, 0.88);
}

.fb-school-clock-roof {
  position: absolute;
  left: -4px;
  top: -4px;
  width: calc(var(--w) + 8px);
  height: calc(var(--d) + 8px);
  transform: translateZ(calc(var(--h) + 4px));
  border: 1px solid #c9f9ff;
  background: radial-gradient(circle, rgba(126, 236, 255, 0.55), rgba(21, 98, 185, 0.7));
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.74);
}

.fb-school-clock-spire {
  position: absolute;
  left: calc(50% - 3px);
  top: calc(50% - 3px);
  width: 6px;
  height: 6px;
  transform: translateZ(calc(var(--h) + 19px));
  border: 1px solid #effeff;
  border-radius: 50%;
  background: #00e5ff;
  box-shadow: 0 0 7px #fff, 0 0 16px #00e5ff;
}

.fb-school-clock-face {
  position: absolute;
  left: calc(50% - 9px);
  top: var(--d);
  width: 18px;
  height: 18px;
  transform-origin: 0 0;
  transform: translateZ(calc(var(--h) - 22px)) rotateX(90deg);
  border: 1.5px solid #edfeff;
  border-radius: 50%;
  background: rgba(2, 25, 51, 0.94);
  box-shadow: 0 0 7px #00e5ff;
}

.fb-school-clock-face i,
.fb-school-clock-face b {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 1px;
  background: #fff;
  transform-origin: 50% 100%;
}

.fb-school-clock-face i { height: 5px; transform: translate(-50%, -100%) rotate(8deg); }
.fb-school-clock-face b { height: 6px; transform: translate(-50%, -100%) rotate(126deg); }

.fb-school-tree-3d {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  transform: translate3d(var(--tree-x), var(--tree-y), 13px);
  transform-style: preserve-3d;
  animation: fbSchoolTreeGlow 3.2s ease-in-out infinite alternate;
  animation-delay: var(--tree-delay);
}

.fb-school-tree-3d i,
.fb-school-tree-3d b {
  position: absolute;
  display: block;
  width: 13px;
  height: 22px;
  transform-origin: 0 0;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  border-bottom: 1px solid rgba(190, 255, 239, 0.86);
  background: linear-gradient(to bottom, rgba(137, 255, 222, 0.8), rgba(0, 173, 155, 0.42));
  filter: drop-shadow(0 0 4px rgba(73, 255, 214, 0.8));
}

.fb-school-tree-3d i { transform: translate3d(-6px, 0, 1px) rotateX(90deg); }
.fb-school-tree-3d b { transform: translate3d(0, -6px, 1px) rotateZ(90deg) rotateX(90deg); }

.fb-school-tree-3d em {
  position: absolute;
  display: block;
  width: 2px;
  height: 8px;
  background: rgba(199, 251, 255, 0.72);
  transform: translate3d(-1px, 0, 1px) rotateX(90deg);
}

@keyframes fbSchoolTreeGlow {
  from { opacity: 0.55; }
  to { opacity: 0.96; }
}

.fb-3d-building-lines {
  position: absolute;
  inset: 5px;
  transform: translateZ(calc(var(--h) + 1px));
  border: 1px solid rgba(184, 246, 255, 0.38);
  background: radial-gradient(circle at center, rgba(0, 229, 255, 0.2), transparent 65%);
}

.fb-3d-building-label {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  transform: translate3d(-50%, -50%, calc(var(--h) + 4px));
  color: #e6fbff;
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.2px;
  white-space: nowrap;
  text-shadow: 0 0 4px #00e5ff, 0 0 8px rgba(0, 229, 255, 0.9);
}

.fb-3d-building-node {
  position: absolute;
  left: calc(50% - 4px);
  top: calc(50% - 4px);
  width: 8px;
  height: 8px;
  transform: translateZ(calc(var(--h) + 3px));
  border: 1px solid #dffcff;
  border-radius: 50%;
  background: #00e5ff;
  box-shadow: 0 0 5px #fff, 0 0 12px #00e5ff;
  animation: fbBuildingNodePulse 3.3s ease-in-out infinite;
  animation-delay: var(--pulse-delay);
}

@keyframes fbBuildingNodePulse {
  0%, 100% { opacity: 0.48; transform: translateZ(calc(var(--h) + 3px)) scale(0.72); }
  50% { opacity: 1; transform: translateZ(calc(var(--h) + 3px)) scale(1.18); }
}

.fb-campus-core-3d {
  position: absolute;
  left: 126px;
  top: 83px;
  width: 12px;
  height: 12px;
  transform: translateZ(14px);
  transform-style: preserve-3d;
}

.fb-campus-core-3d span {
  position: absolute;
  inset: 0;
  border: 1px solid #bff8ff;
  background: rgba(0, 229, 255, 0.42);
  box-shadow: 0 0 12px #00e5ff;
}

.fb-campus-core-3d span:nth-child(1) { transform: rotateX(60deg); }
.fb-campus-core-3d span:nth-child(2) { transform: rotateY(60deg); }
.fb-campus-core-3d span:nth-child(3) { transform: rotateZ(45deg); }

.fb-school-svg {
  display: none;
}

/* 학교 홀로그램 6개 노드 순차 점멸 */
.fb-holo-node {
  animation: fbNodePulse 3.6s ease-in-out infinite;
}
.fb-holo-node:nth-of-type(1) { animation-delay: 0s; }
.fb-holo-node:nth-of-type(2) { animation-delay: 0.6s; }
.fb-holo-node:nth-of-type(3) { animation-delay: 1.2s; }
.fb-holo-node:nth-of-type(4) { animation-delay: 1.8s; }
.fb-holo-node:nth-of-type(5) { animation-delay: 2.4s; }
.fb-holo-node:nth-of-type(6) { animation-delay: 3.0s; }

@keyframes fbNodePulse {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; filter: drop-shadow(0 0 8px #00e5ff); }
}

/* 노드 간 빛 이동 회로선 애니메이션 */
.fb-school-circuit-line {
  filter: drop-shadow(0 0 5px rgba(0, 229, 255, 0.7));
  animation: fbCircuitFlow 8s linear infinite;
}

@keyframes fbCircuitFlow {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -120; }
}

/* 투사광 내부 부유 입자 애니메이션 */
.fb-holo-particles circle {
  animation: fbParticleFloat 4.5s ease-in-out infinite alternate;
}
.fb-holo-particles circle:nth-child(2n) {
  animation-duration: 3.5s;
  animation-delay: 0.8s;
}
.fb-holo-particles circle:nth-child(3n) {
  animation-duration: 5s;
  animation-delay: 1.5s;
}

@keyframes fbParticleFloat {
  0% { transform: translateY(0); opacity: 0.3; }
  50% { opacity: 0.9; }
  100% { transform: translateY(-26px); opacity: 0.15; }
}

/* 홀로그램 스캔 라인 */
.fb-holo-scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.85), transparent);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.8);
  opacity: 0.75;
  animation: fbHoloScan 6s ease-in-out infinite;
}

@keyframes fbHoloScan {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 0.75; }
  90% { opacity: 0.75; }
  100% { top: 100%; opacity: 0; }
}

/* 하단 프로젝터 장치 (좌우 공통) */
.fb-holo-projector {
  position: relative;
  width: 160px;
  height: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fb-projector-disk {
  width: 154px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(15, 35, 60, 0.95), rgba(7, 18, 34, 0.95));
  border: 1px solid rgba(0, 229, 255, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), 0 0 14px rgba(0, 229, 255, 0.35);
}

.fb-projector-light {
  position: absolute;
  top: 2px;
  width: 92px;
  height: 6px;
  border-radius: 50%;
  background: #00e5ff;
  box-shadow: 0 0 18px #00e5ff, 0 0 28px rgba(0, 229, 255, 0.85);
  opacity: 0.95;
}

/* -------------------------------------------------------------------------
   3-B. 오른쪽: 중앙 시스템 복구 HUD (공간에 떠 있는 투명 홀로그램)
   - 배치 기준: '중앙 문제창 오른쪽 끝(1453px)' ↔ '화면 오른쪽 끝(1920px)' 사이 공간의 정확한 수평 중앙
   - right: 104px, width: 260px (중심 x = 1686px) -> 양쪽 여백 각각 103.5px 완벽 대칭
   - 원형 HUD 내부에 '중앙 시스템' 상단 배치, 0% 중앙 배치
   - 2중/3중 링 기계식 구조 (외곽 기계 회전 + 중간 틱 + 내부 진행률 링)
   ------------------------------------------------------------------------- */
.fb-system-recovery-hud {
  position: absolute;
  right: 104px; /* 중앙 문제창(1453px)과 화면 끝(1920px) 사이 정중앙 */
  top: 48%;
  transform: translateY(-50%);
  width: 260px;
  height: 390px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
  opacity: 0.96;
  animation: fbHoloFloat 6s ease-in-out infinite alternate-reverse;
}

.fb-system-recovery-hud .fb-right-beam {
  width: 240px;
  height: 300px;
  bottom: 24px;
}

.fb-recovery-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 8px;
}

.fb-recovery-gauge-wrap {
  position: relative;
  width: 190px;
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.fb-recovery-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

/* 외곽 링: 아주 천천히 회전하는 얇은 기계 눈금 링 */
.fb-hud-outer-ring {
  transform-origin: 100px 100px;
  animation: fbCoreRotateSlow 50s linear infinite;
}

.fb-hud-outer-track {
  fill: none;
  stroke: rgba(0, 229, 255, 0.28);
  stroke-width: 1.5;
  stroke-dasharray: 6 8;
}

.fb-hud-outer-ticks {
  fill: none;
  stroke: rgba(0, 229, 255, 0.18);
  stroke-width: 1;
  stroke-dasharray: 24 6 4 6;
}

.fb-hud-node-dot {
  fill: #00e5ff;
  filter: drop-shadow(0 0 6px #00e5ff);
  animation: fbDotBlink 2.2s infinite ease-in-out;
}

@keyframes fbDotBlink {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* 중간 링: 작은 틱 및 좌표 노드 */
.fb-ring-mid-ticks {
  fill: none;
  stroke: rgba(0, 229, 255, 0.16);
  stroke-width: 1;
  stroke-dasharray: 3 6;
}

/* 내부 링 (미완료 상태: 어두운 붉은색 베이스 링) */
.fb-ring-track {
  fill: none;
  stroke: rgba(255, 65, 85, 0.42);
  stroke-width: 8;
  filter: drop-shadow(0 0 6px rgba(255, 65, 85, 0.35));
}

/* 내부 링 (완료 상태: 청록색 게이지 채움) */
.fb-ring-fill {
  fill: none;
  stroke: #00e5ff;
  stroke-width: 8;
  stroke-linecap: round;
  /* 2 * PI * 64 ≈ 402.12 */
  stroke-dasharray: 402.12;
  stroke-dashoffset: 402.12;
  transition: stroke-dashoffset 0.85s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.75));
}

.fb-ring-inner-deco {
  fill: none;
  stroke: rgba(0, 229, 255, 0.18);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.fb-recovery-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 원 내부 상단 '중앙 시스템' 텍스트 */
.fb-recovery-sub-title {
  font-size: 13px;
  font-weight: 800;
  color: #7dd3fc;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.65);
}

.fb-recovery-pct {
  font-size: 36px;
  font-weight: 900;
  font-family: inherit;
  color: #ffffff;
  letter-spacing: -0.02em;
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.75);
  transition: all 0.3s ease;
}

.fb-recovery-status {
  font-size: 13px;
  font-weight: 700;
  color: #e0f2fe;
  letter-spacing: -0.01em;
  padding: 5px 15px;
  background: rgba(8, 28, 54, 0.88);
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.38);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.18);
}

/* 진행도 업데이트 순간의 펄스 효과 */
.fb-system-recovery-hud.is-updating .fb-recovery-pct {
  transform: scale(1.15);
  color: #00e5ff;
  text-shadow: 0 0 22px #00e5ff;
}
.fb-system-recovery-hud.is-updating .fb-ring-fill {
  filter: drop-shadow(0 0 18px rgba(0, 229, 255, 0.95));
}

/* =========================================================================
   4. 중앙 메인 컨테이너 (Center Problem Area — Absolute Vertical Balance)
   상단 HUD 아래(A)와 하단 대사창 위(B)의 가용 영역 정중앙에 완전 배치
   ========================================================================= */
#final-boss-scene .fb-main-container,
.fb-main-container {
  position: absolute;
  top: 150px;  /* 공용 Stage 6 상단 바와 Final Mission HUD 아래 */
  bottom: 172px; /* 하단 로복 대사창 상단 위 */
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* A간격과 B간격 완벽 일치 */
  z-index: 10;
  pointer-events: none;
  padding: 0;
}

#final-boss-scene .fb-main-container > *,
.fb-main-container > * {
  pointer-events: auto; /* 내부 카드 및 버튼은 정상 클릭/입력 */
}

/* =========================================================================
   5. 중앙 문제 카드 (Mission Card & Panel Design)
   ========================================================================= */
#final-boss-scene .fb-mission-card {
  position: relative;
  width: 920px;
  box-sizing: border-box;
  padding: 24px 32px 24px;
  border: 1px solid var(--fb-accent-line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(8, 27, 51, 0.98), rgba(5, 19, 38, 0.98));
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.45), 0 0 34px var(--fb-accent-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#final-boss-scene .fb-mission-card,
#final-boss-scene .fb-mission-card * {
  box-sizing: border-box;
}

#final-boss-scene.fb-mission-2 {
  --fb-accent: #ff5c77;
  --fb-accent-soft: rgba(255, 83, 109, 0.13);
  --fb-accent-line: rgba(255, 83, 109, 0.38);
}

#final-boss-scene.fb-mission-3 {
  --fb-accent: #7dd9ff;
  --fb-accent-soft: rgba(99, 205, 255, 0.14);
  --fb-accent-line: rgba(99, 205, 255, 0.38);
}

#final-boss-scene .fb-mission-card::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--fb-accent), transparent);
  opacity: 0.68;
}

#final-boss-scene .fb-mission-card::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -60px;
  top: -85px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--fb-accent-soft), transparent 68%);
  pointer-events: none;
}

/* 카드 상단 바 (여백 쾌적하게 확보) */
#final-boss-scene .fb-mission-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  gap: 20px;
  margin-bottom: 16px;
}

#final-boss-scene .fb-mission-index {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--fb-accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.09em;
}

#final-boss-scene .fb-mission-index::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fb-accent);
  box-shadow: 0 0 12px var(--fb-accent);
}

#final-boss-scene .fb-mission-heading {
  color: var(--fb-text);
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

/* 코어 수식 디스플레이 */
#final-boss-scene .fb-core-problem {
  position: relative;
  min-height: 116px;
  display: grid;
  place-items: center;
  margin: 0 0 14px;
  border: 1px solid rgba(86, 194, 235, 0.20);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 50%, var(--fb-accent-soft), transparent 58%),
    rgba(10, 24, 47, 0.72);
  overflow: hidden;
}

#final-boss-scene .fb-core-problem::before,
#final-boss-scene .fb-core-problem::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 74px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--fb-accent));
  opacity: 0.42;
}

#final-boss-scene .fb-core-problem::before {
  left: 28px;
}

#final-boss-scene .fb-core-problem::after {
  right: 28px;
  transform: rotate(180deg);
}

#final-boss-scene .fb-core-problem .fb-problem-formula {
  position: relative;
  z-index: 1;
  font-size: 34px !important;
  color: #f6fcff;
  filter: drop-shadow(0 0 8px rgba(67, 210, 255, 0.18));
}

#final-boss-scene .fb-mini-tag {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--fb-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11px;
  font-weight: 750;
}

/* 질문 문구 */
#final-boss-scene .fb-question-compact {
  margin: 0 0 14px;
  text-align: center;
  color: #f4f9fd;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

/* 해커 가짜 규칙 디스플레이 */
#final-boss-scene .fb-false-core {
  border-color: rgba(255, 86, 111, 0.28);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 71, 101, 0.10), transparent 62%),
    rgba(27, 17, 34, 0.76);
}

#final-boss-scene .fb-false-stack {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px 18px 12px;
}

#final-boss-scene .fb-false-chip {
  min-width: 140px;
  padding: 10px 14px;
  text-align: center;
  border-radius: 11px;
  border: 1px solid rgba(255, 96, 119, 0.22);
  background: rgba(55, 18, 31, 0.42);
  color: #ffe9ed;
}

#final-boss-scene .fb-false-chip:last-child {
  min-width: 210px;
}

/* 텍스트 입력창 */
#final-boss-scene .fb-mission-card .fb-textarea-wrap {
  position: relative;
  margin-top: 0;
  width: 100%;
  box-sizing: border-box;
}

#final-boss-scene .fb-mission-card .fb-textarea-box {
  position: relative;
  width: 100%;
}

#final-boss-scene .fb-mission-card .fb-textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: 104px;
  min-height: 104px;
  max-height: 140px;
  resize: none;
  padding: 15px 18px 28px;
  color: #f4f8fb;
  font-size: 16px;
  line-height: 1.5;
  border: 1px solid rgba(66, 202, 242, 0.34);
  border-radius: 13px;
  outline: none;
  background: rgba(8, 20, 40, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

#final-boss-scene .fb-mission-card .fb-textarea:focus {
  border-color: var(--fb-accent);
  box-shadow: 0 0 0 3px var(--fb-accent-soft), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#final-boss-scene .fb-mission-card .fb-textarea::placeholder {
  color: rgba(172, 193, 208, 0.48);
}

#final-boss-scene .fb-mission-card .fb-char-counter {
  position: absolute;
  right: 14px;
  bottom: 8px;
  color: rgba(157, 180, 195, 0.58);
  font-size: 11px;
  letter-spacing: 0.2px;
}

#final-boss-scene .fb-mission-card .fb-char-counter.is-valid {
  color: #38bdf8;
}

#final-boss-scene .fb-mission-card .fb-input-guide {
  margin-top: 6px;
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.4;
  text-align: left;
  padding-left: 2px;
}

#final-boss-scene .fb-mission-card .fb-input-guide:empty {
  display: none;
}

/* 버튼 행 */
#final-boss-scene .fb-mission-card .fb-btn-row {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

#final-boss-scene .fb-mission-card .fb-hint-btn {
  min-width: 130px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 750;
  color: #9cd4ed;
  background: rgba(14, 30, 52, 0.85);
  border: 1px solid rgba(86, 194, 235, 0.32);
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  backdrop-filter: blur(4px);
}

#final-boss-scene .fb-mission-card .fb-hint-btn:hover:not(:disabled) {
  background: rgba(22, 50, 84, 0.95);
  border-color: rgba(86, 194, 235, 0.62);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(32, 189, 233, 0.18);
}

#final-boss-scene .fb-mission-card .fb-hint-btn:active:not(:disabled) {
  transform: translateY(1px);
}

#final-boss-scene .fb-mission-card .fb-hint-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(160, 180, 200, 0.4);
  background: rgba(10, 20, 35, 0.5);
  transform: none;
  box-shadow: none;
}

#final-boss-scene.fb-mission-2 .fb-mission-card .fb-hint-btn {
  color: #ffb8c5;
  background: rgba(42, 18, 28, 0.85);
  border-color: rgba(255, 96, 119, 0.32);
}

#final-boss-scene.fb-mission-2 .fb-mission-card .fb-hint-btn:hover:not(:disabled) {
  background: rgba(62, 24, 40, 0.95);
  border-color: rgba(255, 96, 119, 0.6);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(255, 72, 103, 0.18);
}

#final-boss-scene .fb-mission-card .fb-primary-btn {
  min-width: 160px;
  padding: 12px 32px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 900;
  color: #02131e;
  background: linear-gradient(135deg, #20bde9, #42e6ff);
  box-shadow: 0 8px 24px rgba(0, 202, 255, 0.28);
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

#final-boss-scene .fb-mission-card .fb-primary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 202, 255, 0.4);
}

#final-boss-scene .fb-mission-card .fb-primary-btn:active:not(:disabled) {
  transform: translateY(1px);
}

#final-boss-scene .fb-mission-card .fb-primary-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  background: rgba(30, 50, 75, 0.6);
  color: rgba(160, 180, 200, 0.5);
  box-shadow: none;
  transform: none;
}

#final-boss-scene.fb-mission-2 .fb-mission-card .fb-primary-btn {
  color: #22060d;
  background: linear-gradient(135deg, #ff6b83, #ff9eaa);
  box-shadow: 0 8px 24px rgba(255, 72, 103, 0.25);
}

#final-boss-scene.fb-mission-2 .fb-mission-card .fb-primary-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  background: rgba(45, 20, 30, 0.6);
  color: rgba(200, 150, 160, 0.5);
  box-shadow: none;
  transform: none;
}

#final-boss-scene .fb-feedback-msg:empty {
  display: none;
}

/* 보충 질문 상자 */
#final-boss-scene .fb-mission-card .fb-prompted-box {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fef3c7;
}

#final-boss-scene .fb-mission-card .fb-prompted-box.hint {
  background: rgba(14, 116, 144, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #e0f2fe;
}

#final-boss-scene .fb-mission-card .fb-prompted-box.hint .fb-prompted-title {
  color: #38bdf8;
}

#final-boss-scene .fb-mission-card .fb-prompted-box.misconception {
  background: rgba(225, 29, 72, 0.14);
  border: 1px solid rgba(251, 113, 133, 0.45);
  color: #ffe4e6;
}

#final-boss-scene .fb-mission-card .fb-prompted-box.misconception .fb-prompted-title {
  color: #fb7185;
}

#final-boss-scene .fb-mission-card .fb-prompted-box.difficulty {
  background: rgba(5, 150, 105, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #d1fae5;
}

#final-boss-scene .fb-mission-card .fb-prompted-box.difficulty .fb-prompted-title {
  color: #34d399;
}

#final-boss-scene .fb-mission-card .fb-prompted-title {
  font-size: 12px;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 2px;
}

#final-boss-scene .fb-mission-card .fb-prompted-body {
  font-size: 14px;
  line-height: 1.4;
}

/* 일반 패널 모달 (최종 도전 시작, 성공 패널 등) */
.fb-panel {
  width: 100%;
  max-width: 720px;
  background: rgba(10, 25, 47, 0.96);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 18px;
  padding: 24px 32px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 30px rgba(0, 229, 255, 0.12);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fb-fade-in 0.25s ease-out;
}

/* Final Boss 시작 화면 (Intro Phase) 중앙 카드 전용 스타일 */
.fb-panel.fb-intro-panel {
  width: 740px;
  max-width: 740px;
  box-sizing: border-box;
  padding: 36px 36px 34px;
  background: rgba(8, 22, 44, 0.95);
  border: 1px solid rgba(0, 229, 255, 0.32);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), 0 0 32px rgba(0, 229, 255, 0.12);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.fb-intro-section-label {
  margin: 0 0 10px;
  color: #55dcff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.14em;
}

.fb-intro-main-title {
  font-size: 32px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.015em;
  margin: 0 0 26px;
  line-height: 1.3;
}

.fb-panel.fb-intro-panel .fb-intro-start-btn,
.fb-btn.fb-intro-start-btn {
  font-size: 17px;
  font-weight: 700;
  padding: 14px 34px;
  border-radius: 12px;
  letter-spacing: -0.01em;
}

/* Final Boss 하단 로복 대사창 가독성 최적화 */
#final-boss-scene:not(.hidden) ~ #ui-layer #dialogue-panel #dialogue-text,
#scene-root:has(#final-boss-scene) ~ #ui-layer #dialogue-text,
body:has(#final-boss-scene) #dialogue-text {
  font-size: 18.2px;
  line-height: 1.48;
}

@keyframes fb-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fb-btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  width: 100%;
}

.fb-btn {
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.fb-primary-btn {
  color: #02131e;
  background: linear-gradient(135deg, #20bde9, #42e6ff);
  box-shadow: 0 6px 20px rgba(0, 202, 255, 0.3);
}

.fb-primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 202, 255, 0.45);
}

.fb-alert-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.6);
  color: #ff4d6d;
  font-weight: 800;
  letter-spacing: 2px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 13px;
}

.fb-alert-tag.tag-success {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.6);
  color: #4ade80;
}

.fb-success-banner {
  margin-bottom: 16px;
}

.fb-success-title {
  font-size: 26px;
  font-weight: 900;
  color: #4ade80;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* =========================================================================
   최종 복구 완료 카드 (중앙 팝업) — 대사는 하단 로복 대사창이 담당
   ========================================================================= */
.fb-restored-card {
  text-align: center;
  padding: 40px 32px;
}

.fb-restored-badge {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 34px;
  background: rgba(34, 197, 94, 0.14);
  border: 2px solid rgba(34, 197, 94, 0.6);
  border-radius: 999px;
  box-shadow: 0 0 28px rgba(34, 197, 94, 0.35);
  animation: fb-restored-glow 2.2s ease-in-out infinite;
}

.fb-restored-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.25);
  color: #4ade80;
  font-size: 26px;
  font-weight: 900;
}

.fb-restored-label {
  color: #4ade80;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 3px;
  text-shadow: 0 0 18px rgba(34, 197, 94, 0.55);
}

.fb-restored-checklist {
  list-style: none;
  margin: 24px auto 30px;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.fb-restored-checklist li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 10px;
}

.fb-restored-item-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.25);
  color: #4ade80;
  font-size: 16px;
  font-weight: 900;
  flex: 0 0 auto;
}

.fb-restored-item-label {
  color: #d1fae5;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

@keyframes fb-restored-glow {
  0%, 100% { box-shadow: 0 0 22px rgba(34, 197, 94, 0.3); }
  50% { box-shadow: 0 0 40px rgba(34, 197, 94, 0.55); }
}

/* =========================================================================
   6. 글리치 및 스크린 쉐이크
   ========================================================================= */
.fb-shake {
  animation: fb-shake-anim 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes fb-shake-anim {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

.fb-glitch-overlay {
  position: absolute;
  inset: 0;
  background: rgba(244, 63, 94, 0.16);
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease;
  z-index: 50;
}

.fb-glitch-overlay.active {
  opacity: 1;
  animation: fb-glitch-flash 0.35s steps(2, start) 1;
}

@keyframes fb-glitch-flash {
  0% { opacity: 0.8; transform: translate(2px, -2px); }
  50% { opacity: 0.3; transform: translate(-2px, 2px); }
  100% { opacity: 0.9; transform: translate(0, 0); }
}

/* 모듈 차단 리스트 */
.fb-module-list {
  width: 100%;
  max-width: 420px;
  margin: 12px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fb-module-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 14px;
  font-weight: 700;
}

.fb-module-item.status-off {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fca5a5;
}

.fb-module-item.status-on {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}



/* Final 3 — video screen surface, without an extra bezel. */
/* 원래 모니터의 지도 화면을 대체하는 표시 영역 */
.fb-cinematic-monitor {
  position: absolute;
  /* 고정 논리 화면 전체를 영상의 네 경계에 투영한다. */
  left: 0;
  top: 0;
  width: 620px;
  height: 350px;
  transform-origin: 0 0;
  z-index: 12020;
  overflow: hidden;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  color: #e9fbff;

  /* 원래 학교 지도 화면을 완전히 가려 이중 영상이 생기지 않게 한다. */
  background:
    radial-gradient(circle at 50% 47%, rgba(17,82,150,.18), transparent 52%),
    linear-gradient(180deg, #071a36 0%, #07182f 52%, #06162b 100%);

  /* 투영된 화면 밖으로 콘텐츠나 발광 효과가 새지 않게 자른다. */
  clip-path: inset(0);
  box-shadow: none;
}
.fb-cinematic-monitor.is-hidden { display: none; }
.fb-cinematic-monitor::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .045;
  background-image:
    linear-gradient(rgba(94,205,255,.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94,205,255,.18) 1px, transparent 1px);
  background-size: 6.5% 10%;
  pointer-events: none;
}
.fb-cinematic-monitor::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(108deg,
      rgba(255,255,255,.035) 0%,
      transparent 26% 100%);
}
.fb-cm-label {
  position: absolute;
  top: 8%;
  width: 100%;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .04em;
}
.fb-cm-number {
  position: absolute;
  top: 31%;
  width: 100%;
  text-align: center;
  font-size: 56px;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(80,217,255,.40);
}
.fb-cm-track {
  position: absolute;
  left: 15%;
  right: 15%;
  top: 65%;
  height: 7%;
  padding: 1px;
  border: 1px solid rgba(92,210,255,.62);
  border-radius: 999px;
  background: rgba(3,11,28,.78);
}
.fb-cm-fill {
  width: 1%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg,rgba(41,191,255,.90),rgba(137,236,255,.88));
  box-shadow: 0 0 8px rgba(59,205,255,.48);
}
.fb-cm-status {
  position: absolute;
  bottom: 8%;
  width: 100%;
  text-align: center;
  color: rgba(214,245,255,.66);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .06em;
}
.fb-cinematic-monitor.is-stopped .fb-cm-fill {
  background: linear-gradient(90deg,rgba(41,191,255,.90),rgba(137,236,255,.88));
  box-shadow: 0 0 8px rgba(59,205,255,.48);
}
.fb-cinematic-monitor.is-stopped .fb-cm-status {
  color: rgba(255,210,120,.86);
  font-weight: 800;
}
.fb-cinematic-monitor.is-glitching {
  animation: fbCmGlitch .11s steps(2,end) infinite;
}
.fb-cinematic-monitor.is-glitching::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 8px,
    rgba(255,25,62,.17) 9px 11px,
    transparent 12px 18px
  );
  box-shadow: inset 8px 0 rgba(0,214,255,.16), inset -8px 0 rgba(255,0,70,.18);
  mix-blend-mode: screen;
}
@keyframes fbCmGlitch {
  0% { filter: none; }
  25% { filter: contrast(1.25); }
  50% { filter: saturate(1.6); }
  75% { filter: hue-rotate(8deg); }
  100% { filter: none; }
}
