/* ======================= FUN FACTS - Upgraded for Light/Dark Mode ======================= */

.about-funfacts {
  position: relative;
  width: 100%;
  padding-bottom: 2rem;
  min-height: 500px;
  overflow: hidden;
}

.funfacts-card-display-area,
.about-funfacts-cols {
  display: none;
}

/* ---------- Card Base Styles: Floating Ink Blot Theme ---------- */
.funfact-card {
  position: absolute;
  display: none;
  flex-direction: column;
  align-items: flex-start;
  width: 90%;
  max-width: 320px;
  min-height: 220px;
  background: var(--background-card);
  padding: 1.8rem;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.07);
  cursor: var(--cursor-grab2);
  overflow: hidden;
  will-change: transform, opacity, z-index, border-radius, filter;
  opacity: 0;
  transform-origin: center center;
  z-index: 10;
  border-radius: 12px;
  filter: blur(0px);
  transition: background 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}
body[data-theme="dark"] .funfact-card {
  box-shadow: 0 8px 30px rgba(0,0,0,0.3), 0 4px 15px rgba(0,0,0,0.2);
}

.funfact-card.is-floating {
  animation: floatAnimation 18s infinite ease-in-out;
}

.funfact-card.is-dragging {
  cursor: var(--cursor-grabbing2);
  box-shadow: 0 15px 40px rgba(0,0,0,0.2), 0 5px 15px rgba(0,0,0,0.15);
  transform: scale(1.05);
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
  animation-play-state: paused;
}
body[data-theme="dark"] .funfact-card.is-dragging {
    box-shadow: 0 15px 45px rgba(0,0,0,0.4), 0 5px 20px rgba(0,0,0,0.3);
}

.click-me-msg { display: none; }
.fact-text-content { display: block !important; }

.fact-text-content p {
  font-family: 'Pretendard', sans-serif;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary-color);
  position: relative;
  z-index: 3;
  transition: color 0.3s ease;
}

.funfact-card h3 {
  font-family: 'Pretendard', sans-serif;
  font-size: 1.13rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.3;
  color: var(--text-primary-color);
  position: relative;
  z-index: 3;
  transition: color 0.3s ease;
}

.funfact-card .ink-splash-container {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; overflow: hidden; z-index: 0; filter: url(#classicWetInk);
}

.ink-blot-drop {
  position: absolute; width: 0; height: 0; border-radius: 50%;
  background-color: rgba(30, 30, 30, 0.6);
  opacity: 0; transform: scale(0.1);
  animation: ink-blot-animation 1.0s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  pointer-events: none;
  transition: background-color 0.3s ease;
}
body[data-theme="dark"] .ink-blot-drop {
    background-color: rgba(255, 255, 255, 0.1);
}

@keyframes ink-blot-animation {
  0% { opacity: 0; transform: scale(0.1); }
  20% { opacity: 0.8; transform: scale(0.8); }
  80% { opacity: 0.6; transform: scale(1.1); }
  100% { opacity: 0; transform: scale(1.3); }
}

.confetti-particle {
  position: fixed; pointer-events: none; z-index: 10001; opacity: 1;
  will-change: transform, opacity;
  background-color: var(--text-primary-color);
  border-radius: 45% 55% 50% 50% / 50% 55% 45% 50%;
}

/* ======================= Mountain Interactive Styles ======================= */
.funfact-instruction {
  text-align: center; margin: 0; font-size: 0.9rem; font-style: italic;
  font-family: 'Pretendard', sans-serif; color: var(--text-tertiary-color);
  opacity: 0.8; max-width: 90%; transition: color 0.3s ease;
}

.funfact-spacer {
  width: 100%;
  transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  justify-content: center;
  align-items: center;
}

.mountain-interactive-container {
  position: relative; width: 100%; max-width: 1000px;
  margin: 0 auto; cursor: default; z-index: 5;
}

.mountain-background-image {
  display: block; width: 100%; height: auto;
  border-radius: 8px; user-select: none; pointer-events: none;
  filter: grayscale(30%) contrast(1.1);
}
body[data-theme="dark"] .mountain-background-image {
    filter: grayscale(50%) contrast(1) brightness(0.8);
}

.sparkle-dot {
  position: absolute; width: 18px; height: 18px;
  background-color: var(--color-yellow-base);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-yellow-light), 0 0 20px var(--color-yellow-base);
  cursor: var(--cursor-grab2);
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), background-color 0.4s ease, box-shadow 0.4s ease;
  animation: sparkleAnimation 2.2s infinite ease-in-out;
  will-change: transform, opacity, box-shadow;
  transform-origin: center center;
}
.sparkle-dot:hover { transform: scale(2) !important; }
.sparkle-dot.is-active {
  background-color: var(--text-tertiary-color);
  box-shadow: 0 0 16px var(--color-yellow-strong), 0 0 30px rgba(255, 217, 58, 0.8);
  animation: none; transform: scale(1.6); opacity: 1;
}

@keyframes sparkleAnimation {
  0%, 100% { transform: scale(1); opacity: 0.8; box-shadow: 0 0 10px var(--color-yellow-light), 0 0 20px var(--color-yellow-base); }
  50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 16px var(--color-yellow-light), 0 0 30px var(--color-yellow-strong); }
}

@keyframes floatAnimation {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-3px, 4px) rotate(-0.4deg); }
  50% { transform: translate(2px, -3px) rotate(0.3deg); }
  75% { transform: translate(3px, 2px) rotate(0.4deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.funfact-card .fact-text-content .meaning-chunk { display: inline; line-height: inherit; }

/* ======================= LOTTIE Icon Styles ======================= */
.lottie-icon-container { width: 80px; height: 80px; margin-bottom: 0.8rem; position: relative; z-index: 3; display: flex; justify-content: center; align-items: center; overflow: hidden; }
.lottie-animation { width: 70%; height: 70%; transform: scale(1.8); }
.funfact-card[data-fact-id="sensory-player"] .lottie-animation { width: 90%; height: 90%; }
.funfact-card[data-fact-id="piano-precision"] .lottie-animation,
.funfact-card[data-fact-id="holistic-experience"] .lottie-animation { width: 50%; height: 50%; }

/* ======================= FUN FACTS Card Active Layout Changes ======================= */
.funfact-card.is-active-fact { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; }
.funfact-card.blob-enter { animation: funfactBlobBorderRadiusIn 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.funfact-card.blob-exit { animation: funfactBlobBorderRadiusOut 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes funfactBlobBorderRadiusIn {
  0% { border-radius: 0% 100% 0% 100% / 0% 100% 0% 100%; }
  50% { border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%; }
  100% { border-radius: 12px; }
}
@keyframes funfactBlobBorderRadiusOut {
  0% { border-radius: 12px; filter: blur(0px); }
  50% { border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%; filter: blur(3px); }
  100% { border-radius: 50%; filter: blur(10px); }
}
.funfact-card.is-active-fact .lottie-icon-container { width: 50px; height: 50px; margin-bottom: 0; margin-right: 0.8rem; flex-shrink: 0; }
.funfact-card.is-active-fact h3 { flex-grow: 1; font-size: 1.3rem; }
.funfact-card.is-active-fact .fact-text-content { flex-basis: 100%; margin-top: 0.8rem; }


/* [모바일 수정] 768px 이하 화면 대응 */
@media (max-width: 768px) {
    .about-funfacts {
        min-height: unset; /* 최소 높이 제거 */
        display: flex; /* Flexbox로 전환 */
        flex-direction: column; /* 수직 정렬 */
        gap: 1.5rem; /* 카드 사이 간격 */
    }
    .funfact-spacer, .mountain-interactive-container {
        display: none; /* 스페이서와 산 이미지 숨김 */
    }
    .funfact-card {
        position: relative; /* static으로 변경 */
        display: flex; /* 기본적으로 보이도록 설정 */
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        /* width: 100%; */
        max-width: 100%;
        min-height: unset;
        opacity: 1;
        transform: none;
        box-shadow: 0 4px 15px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.05);
    }
    body[data-theme="dark"] .funfact-card {
        box-shadow: 0 4px 20px rgba(0,0,0,0.25), 0 2px 10px rgba(0,0,0,0.15);
    }
    .funfact-card.mobile-static-view {
        /* JS에서 추가된 클래스에 대한 스타일 */
        animation: none; /* float 애니메이션 제거 */
        cursor: default;
    }
    .funfact-card .lottie-icon-container {
        width: 50px;
        height: 50px;
        margin-bottom: 0;
        margin-right: 1rem;
        flex-shrink: 0;
    }
    .funfact-card h3 {
        flex-grow: 1;
        font-size: 1.1rem;
        margin-bottom: 0;
    }
    .funfact-card .fact-text-content {
        flex-basis: 100%;
        margin-top: 1rem;
        font-size: 0.9rem;
    }
}
