/* =========================
   RESET & BASE (index 공통)
========================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root { color-scheme: light; }

body {
  background: Whitesmoke;
  font-family: 'Gowun Batang', 'Song Myung', serif;
  color: #000;
  line-height: 1.7;
}

/* =========================
   LAYOUT (index와 동일)
========================= */
.layout { display: flex; height: 100vh; }

/* 왼쪽 네비게이션 */
.nav {
  width: 200px;
  background: #fff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: sticky;
  top: 0;
  overflow-y: auto;
}
.nav a {
  text-decoration: none;
  color: #000;
  padding: 4px 8px;
  /* ✅ 데스크톱에서 세로로 깨지는 현상 방지 */
  white-space: nowrap;
  word-break: keep-all;
  letter-spacing: normal;
}
.nav a:hover { background: #f3f3f3; }

/* 오른쪽 본문 영역 */
.main-area {
  margin-left: 200px;
  display: flex;
  flex-direction: column;
  height: auto;
  overflow: visible;
}

/* 헤더 (index와 동일) */
.header { flex: 0 0 auto; text-align: center; padding: 20px; }
.header h1 { font-size: 28px; margin-bottom: 8px; }
.header h2 { font-size: 16px; color: #444; }
.header h3 { font-size: 20px; color: #444; text-align: center; margin-top: .5em; }
.header h6 { font-size: 16px; color: #000; }

/* 본문 기본(일반 페이지 공통) */
.content {
  flex: 1 1 auto;
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.content p.no-box,
.content p.nbox { background: none; padding: 0; box-shadow: none; margin-bottom: 1em; }
.content p.nbox { word-break: break-word; }

.content ul { list-style: none; padding: 0; margin: 0; }
.content li { margin-bottom: .6em; padding-left: 0; }

video {
  display: block; width: 100%; height: auto;
  border-radius: 12px; margin: 1em 0; background: #000;
}

details {
  margin: 1em 0; border: 1px solid #ccc; border-radius: 8px;
  padding: 10px 15px; background: #fafafa;
}
summary { cursor: pointer; font-weight: 600; list-style: none; }
summary::-webkit-details-marker { display: none; }

.interview audio { display: block; margin-top: 8px; width: 100%; }
.interview img { margin-top: 10px; max-width: 100%; border-radius: 6px; }

hr {
  border: none; border-top: 1.5px solid #ccc;
  margin: 1.5em auto; width: 60%; max-width: 500px; opacity: .6;
}

.small { font-size: 10px; }

/* 다크모드 (index와 동일) */
@media (prefers-color-scheme: dark) {
  body { background: #111; }}
  

/* =========================
   MOBILE (index와 동일)
========================= */
@media (max-width: 900px) {
  .layout { flex-direction: column; height: auto; }

  .nav {
    position: static;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #ddd;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    overflow-y: visible;
  }

  .main-area { margin-left: 0; height: auto; }

  .content { max-width: 100%; padding: 16px; }
  .content p {
    background: #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,.12);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
  }
}

/* =========================================================
   OUTPUT.HTML 전용 — 갤러리(핀터레스트 느낌)
   ※ 전역(네비, h1/h2)에는 절대 영향 없음
========================================================= */
.page-output .content { max-width: none; margin: 0; padding: 20px 16px; }

/* Masonry-like Grid (끝줄 빈칸 최소화) */
.page-output .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  grid-auto-rows: 8px;
  grid-auto-flow: dense;      /* ✅ 마지막 줄까지 촘촘히 */
  gap: 12px;
  padding: 0;
}

/* 카드 */
.page-output .gallery a {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
  text-decoration: none;
  color: inherit;
  transition: transform .25s ease, box-shadow .25s ease;
}
.page-output .gallery a:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.28); }

/* 이미지 */
.page-output .gallery img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* 오버레이 텍스트(오른쪽 정렬, 기존 폰트 유지) */
.page-output .info {
  position: absolute;
  inset: auto 0 0 0;
  padding: 10px 12px 12px;
  text-align: right;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,.08));
  transition: color .3s ease, background .3s ease;
}
.page-output .info h3 { margin: 0; font-size: 1.05em; font-weight: 600; }
.page-output .info p.no-box { margin-top: 2px; font-size: .9em; opacity: .92; }

/* 밝은 이미지 → 글자/배경 반전 */
.page-output .info.light {
  color: #000;
  background: linear-gradient(to top, rgba(255,255,255,.86), rgba(255,255,255,.3));
}

/* 좁은 화면 대응 */
@media (max-width: 800px) {
  .page-output .gallery {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

/* --- 데스크톱 네비 겹침/잘림 버그 패치 (겹치는 옛 규칙 덮어쓰기) --- */
.layout { display: flex; align-items: stretch; }     /* 안전하게 스트레치 */
.nav { flex: 0 0 200px; min-width: 200px; }          /* 폭을 flex 기준으로 고정 */
.nav a { display: block; white-space: nowrap; word-break: keep-all; }
.main-area { flex: 1 1 auto; margin-left: 0 !important; } /* ← 겹침 원인 제거 */
body { background: #f5f5f5; }                        /* (시안 차이 최소화용 동일톤) */

/* =========================
   Pinterest-like enhancements for output.html
   (page-output 전용, 덮어쓰기)
========================= */

/* ── 1) 지그재그(스태거) 강화: 컬럼/카드 오프셋 */
.page-output .gallery {
  /* 이미 grid + dense + auto-fit 사용 중 */
  gap: 12px; /* 카드 사이 간격 유지 */
}

/* 카드별 살짝 다른 상단 오프셋으로 리듬감 추가 */
.page-output .gallery a { margin-top: 0; }
.page-output .gallery a:nth-child(3n) { margin-top: 6px; }
.page-output .gallery a:nth-child(5n) { margin-top: 12px; }

/* ── 2) 호버 시에만 텍스트 표시 (데스크톱/포인터 장치) */
@media (hover: hover) and (pointer: fine) {
  .page-output .info {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .28s ease, transform .28s ease, background .28s ease, color .28s ease;
    pointer-events: none; /* 텍스트가 숨길 때 클릭 방해 X */
  }
  .page-output .gallery a:hover .info,
  .page-output .gallery a:focus-visible .info {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* ── 3) 모바일/터치 환경: 항상 표시 (커서가 없으므로) */
@media (hover: none), (pointer: coarse) {
  .page-output .info {
    opacity: 1;
    transform: none;
  }
}

/* ── 4) 밝기 반전 상태에서도 자연스럽게 */
.page-output .info.light {
  /* 기존에 정의된 배경/색상 유지, 트랜지션만 보강 */
  transition: opacity .28s ease, transform .28s ease, background .28s ease, color .28s ease;
}

/* --- 카드 바닥 검은줄 방지 --- */
.page-output .gallery a {
  background: transparent;          /* 배경 검정 제거 */
}

.page-output .gallery img {
  display: block;                    /* 인라인 이미지 베이스라인 틈 제거 */
}

/* 호버 때만 바닥이 어둡게 보이도록(텍스트 가독성) */
@media (hover: hover) and (pointer: fine) {
  .page-output .gallery a:hover { background: transparent; }
}


/* JS 실패 시(= body에 no-js 남아있을 때) Masonry 폴백 */
.page-output.no-js .gallery { grid-auto-rows: auto; }
.page-output.no-js .gallery a { grid-row-end: auto; }


/* --- 카드 아래 여분 영역 제거 + 오버레이는 이미지 위로만 --- */
.page-output .gallery a{
  padding: 0;
  background: transparent;
  line-height: 0;              /* 인라인 여백 방지(안전핀) */
  overflow: hidden;
}

.page-output .gallery img{
  display: block;              /* 베이스라인 간극 제거 */
  width: 100%;
  height: auto;
  vertical-align: top;
}

/* 오버레이는 절대배치 → 레이아웃 높이에 영향 없음 */
.page-output .info{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 12px;
  text-align: right;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,.08));
  color: #fff;
  pointer-events: none;         /* 텍스트가 클릭 방해 X */
}

/* 텍스트 자체 여백 제거(밑으로 밀리지 않게) */
.page-output .info h3,
.page-output .info p.no-box{ margin: 0; }

/* 데스크톱: 호버 때만 보이기 */
@media (hover: hover) and (pointer: fine){
  .page-output .info{
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .28s ease, transform .28s ease, color .28s ease, background .28s ease;
  }
  .page-output .gallery a:hover .info,
  .page-output .gallery a:focus-visible .info{
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* 모바일/터치: 항상 표시 (커서 없음) — 높이에 영향 없음(절대배치이므로) */
@media (hover: none), (pointer: coarse){
  .page-output .info{
    opacity: 1;
    transform: none;
  }
}

/* 밝은 이미지일 때 글씨/배경 반전 유지 */
.page-output .info.light{
  color: #000;
  background: linear-gradient(to top, rgba(255,255,255,.86), rgba(255,255,255,.3));
}


/* ===== Masonry 안정화 & 여백 0 보장 (page-output만) ===== */
.page-output .gallery{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  grid-auto-rows:2px;              /* 더 촘촘한 단위 → 오차 감소 */
  grid-auto-flow:dense;            /* 끝줄 빈칸 최소화 */
  gap:12px;
  padding:0;
}

/* 카드: 레이아웃 높이에 영향 주는 요소 제거 */
.page-output .gallery a{
  position:relative;
  display:block;
  padding:0;
  margin:0;
  background:transparent;          /* 카드 배경 제거(흰/검은 줄 방지) */
  line-height:0;                   /* 인라인 틈 제거 */
  overflow:hidden;
}

/* 이미지가 카드 크기를 ‘정의’하도록 */
.page-output .gallery img{
  display:block;                   /* 베이스라인 간극 제거 */
  width:100%;
  height:auto;
  vertical-align:top;
  border-radius:8px;               /* 둥근모서리는 이미지에만 적용 */
}

/* 오버레이는 이미지 위에만, 높이에는 영향 X */
.page-output .info{
  position:absolute; left:0; right:0; bottom:0;
  padding:10px 12px;
  text-align:right;
  background:linear-gradient(to top,rgba(0,0,0,.55),rgba(0,0,0,.08));
  color:#fff;
  pointer-events:none;
  margin:0;
}
.page-output .info h3,
.page-output .info p.no-box{ margin:0 }

/* 데스크톱: 호버시에만 보이기 / 모바일: 항상 보이기 */
@media (hover:hover) and (pointer:fine){
  .page-output .info{ opacity:0; transform:translateY(6px);
    transition:opacity .25s ease, transform .25s ease, background .25s ease, color .25s ease;
  }
  .page-output .gallery a:hover .info,
  .page-output .gallery a:focus-visible .info{
    opacity:1; transform:translateY(0); pointer-events:auto;
  }
}
@media (hover:none),(pointer:coarse){
  .page-output .info{ opacity:1; transform:none }
}

/* 밝은 이미지용 반전 */
.page-output .info.light{
  color:#000;
  background:linear-gradient(to top,rgba(255,255,255,.86),rgba(255,255,255,.3));
}

/* --- 모바일 네비 강제 복구: 데스크톱 고정폭 규칙 무력화 --- */
@media (max-width: 900px) {
  .layout { flex-direction: column; height: auto; }

  .nav {
    position: static;
    /* 데스크톱용 flex-basis:200px, min-width:200px를 무력화 */
    flex: 0 0 auto !important;
    min-width: 0 !important;
    width: 100% !important;

    border-right: none;
    border-bottom: 1px solid #ddd;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    padding: 16px 12px;
    overflow-y: visible;
  }

  .nav a {
    display: inline-block;
    white-space: nowrap;       /* 세로쪼개짐 방지 */
    padding: 6px 10px;
  }

  .main-area {
    margin-left: 0 !important; /* 좌측 고정폭 여백 제거 */
  }
}


/* --- 갤러리 카드 사이즈 업 + 촘촘한 masonry --- */
.page-output .gallery{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* ← 기본 카드 폭 키움 */
  grid-auto-rows: 2px;           /* 촘촘한 단위(오차↓) */
  grid-auto-flow: dense;         /* 끝줄 빈칸 최소화 */
  gap: 16px;                      /* 핀터레스트처럼 여백도 약간 키움 */
}

/* 큰 화면일수록 더 큼직하게 */
@media (min-width: 1200px){
  .page-output .gallery{
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
  }
}
@media (min-width: 1600px){
  .page-output .gallery{
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
  }
}

/* 태블릿/모바일에서는 적절히 줄이기 */
@media (max-width: 800px){
  .page-output .gallery{
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
  }
}

/* 카드/이미지는 이미지 크기 그대로, 바닥 여백 없음 */
.page-output .gallery a{
  position: relative;
  display: block;
  padding: 0; margin: 0;
  background: transparent;
  line-height: 0;
  overflow: hidden;
}
.page-output .gallery img{
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  border-radius: 8px;
}

/* === Pinterest 사이즈 업: 열을 줄여서 카드 크게 === */
.page-output .gallery{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(320px, 1fr)); /* 데스크톱 기본 더 큼 */
  grid-auto-rows:2px;
  grid-auto-flow:dense;
  gap:18px;
}

/* 아주 넓은 화면: 더 커도 됨 */
@media (min-width:1600px){
  .page-output .gallery{
    grid-template-columns:repeat(auto-fit, minmax(360px, 1fr));
    gap:20px;
  }
}

/* 태블릿: 열을 줄여 여전히 큼직하게 */
@media (max-width:900px){
  .page-output .gallery{
    grid-template-columns:repeat(auto-fit, minmax(260px, 1fr));
    gap:16px;
  }
}

/* 작은 모바일(≈ 600px 이하): 1열 또는 큼직한 2열로 강제 */
@media (max-width:600px){
  .page-output .content{ padding:12px; } /* 가장자리 여백도 조금 줄임 */
  .page-output .gallery{
    grid-template-columns:repeat(auto-fit, minmax(320px, 1fr)); /* 504px 화면이면 1열로 크게 */
    gap:14px;
  }
}

/* --- 라벨 겹침 방지: .info는 줄간격 정상화 --- */
.page-output .info{
  line-height: 1.35;            /* 부모의 line-height:0 상속 차단 */
}

.page-output .info h3{
  margin: 0 0 4px;              /* 위아래 간격 분리 */
  display: block;
  line-height: 1.2;
}

.page-output .info p.no-box{
  margin: 0;
  display: block;
  line-height: 1.2;
}

/* ========== 데스크톱: 하단 그림자(그라데이션) 범위를 더 위까지 확대 ========== */
@media (hover:hover) and (pointer:fine){
  .page-output .gallery a{ position: relative; }

  /* 카드 하단에서 위로 '길게' 올라오는 그림자 레이어 */
  .page-output .gallery a::before{
    content:"";
    position:absolute; left:0; right:0; bottom:0;
    height:68%; /* ✅ 그림자 퍼지는 높이 (필요하면 60~80%로 조정) */
    background: linear-gradient(
      to top,
      rgba(0,0,0,.88) 0%,
      rgba(0,0,0,.60) 35%,
      rgba(0,0,0,.28) 70%,
      rgba(0,0,0,0) 100%
    );
    opacity: 0;                 /* 기본 비노출 */
    transition: opacity .25s ease;
    pointer-events: none;       /* 클릭 방해 X */
  }

  /* 호버/포커스 시 그림자 레이어만 진하게 노출 */
  .page-output .gallery a:hover::before,
  .page-output .gallery a:focus-visible::before{
    opacity: 1;                 /* ✅ 주변만 자연스럽게 어두워짐 */
  }

  /* 라벨: 흰 글씨 유지, 배경은 투명(그림자는 ::before가 담당) */
  .page-output .info{
    position:absolute; left:0; right:0; bottom:0;
    padding:12px 14px;
    text-align:right;
    color:#fff !important;
    background: linear-gradient(to top, transparent, transparent) !important;
    opacity:0; transform: translateY(6px);
    transition: opacity .22s ease, transform .22s ease;
    pointer-events:none;
    line-height:1.35;
  }
  .page-output .gallery a:hover .info,
  .page-output .gallery a:focus-visible .info{
    opacity:1; transform: translateY(0);
  }

  .page-output .info h3,
  .page-output .info p.no-box{
    margin:0; line-height:1.2;
    color:#fff !important;      /* 항상 흰색 */
    text-shadow:none !important;/* 그림자는 ::before로 처리하므로 텍스트 그림자 불필요 */
  }
}

/* ========== 모바일/터치: 사진 아래 검은 글씨(그림자/오버레이 없음) ========== */
@media (hover:none), (pointer:coarse){
  .page-output .info{
    position: static !important;
    padding: 8px 2px 0;
    text-align: right;          /* 필요 시 left로 변경 가능 */
    color: #000 !important;
    background: none !important;
    opacity: 1; transform: none;
    pointer-events: auto;
    line-height:1.35;
  }
  .page-output .info h3,
  .page-output .info p.no-box{
    margin:0; line-height:1.25;
    color:#000 !important;
    text-shadow:none !important;
  }
}

/* ================================
   모바일/터치 강제 복구 (맨 마지막에 두세요)
   - 사진 아래 검은 글씨 항상 노출
   - 데스크톱용 오버레이/불투명도 제거
   - 일부 모바일이 hover를 지원한다고 거짓 보고할 때도 width로 백업
================================ */

/* 기능쿼리: 터치/비호버 장치 */
@media (hover: none), (pointer: coarse) {
  .page-output .gallery a::before { display: none !important; }  /* 그림자 레이어 제거 */
  .page-output .gallery a { line-height: initial !important; }   /* 카드의 line-height:0 무력화 */
  .page-output .info {
    position: static !important;
    display: block !important;
    padding: 8px 2px 0 !important;
    background: none !important;
    color: #000 !important;                 /* ✅ 검은 글씨 */
    text-shadow: none !important;
    text-align: right;                      /* 필요하면 left로 */
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    line-height: 1.35 !important;
  }
  .page-output .info h3,
  .page-output .info p.no-box {
    margin: 0 !important;
    line-height: 1.25 !important;
    color: #000 !important;
  }
}

/* 폭 기반 백업: 일부 모바일 브라우저가 hover를 지원한다고 보고할 때 대비 */
@media (max-width: 900px) {
  .page-output .gallery a::before { display: none !important; }
  .page-output .gallery a { line-height: initial !important; }
  .page-output .info {
    position: static !important;
    display: block !important;
    padding: 8px 2px 0 !important;
    background: none !important;
    color: #000 !important;
    text-shadow: none !important;
    text-align: right;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    line-height: 1.35 !important;
  }
  .page-output .info h3,
  .page-output .info p.no-box {
    margin: 0 !important;
    line-height: 1.25 !important;
    color: #000 !important;
  }
}

/* --- texts.html 링크 목록 꾸미기 --- */
.content ul li a {
  font-size: 20px;         /* 글씨 크기 키우기 */
* 밑줄 제거 */
  color: #000;             /* 글자색: 검정 */
}

/* 마우스를 올렸을 때 */
.content ul li a:hover {
  color: #444;             /* 약간 어두운 회색으로 */
  text-decoration: underline; /* 호버 시만 밑줄 */
}

/* 방문한 링크 색상 유지 */
.content ul li a:visited {
  color: #000;             /* 방문 후에도 검정 유지 */
}

/* --- texts.html의 ul 가로 정렬 --- */
.content ul {
  display: flex;              /* 가로로 배치 */
  flex-wrap: nowrap;          /* 한 줄로 유지 */
  justify-content: flex-start;/* 왼쪽 정렬 */
  gap: 40px;                  /* 항목 간 간격 */
  list-style: none;
  padding: 0;
  margin: 40px 0;             /* 위아래 여백 */
}

.content ul li a {
  font-size: 18px;
  text-decoration: none;
  color: #000;
  transition: color 0.3s ease;
}

.content ul li a:hover {
  color: #444;
  text-decoration: underline;
}

.content ul li a:visited {
  color: #000;
}

/* --- 화살표 버튼 --- */
.arrow {
  font-size: 28px;
  cursor: pointer;
  display: inline-block;
  margin-left: 20px;
  transition: transform 0.2s ease;
}
.arrow:hover {
  transform: scale(1.2);
}

/* --- minguhong.fyi 스타일 (수정 버전) --- */
.slide-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;   /* ← 가운데 정렬 해제 */
  justify-content: flex-start; /* 위쪽에 배치 */
  min-height: 60vh;
  padding-left: 40px;        /* 살짝 들여쓰기 여백 */
}

/* 이어지는 문장 영역 */
.line {
  font-size: 16px;           /* ← 글씨 크기 줄이기 */
  font-family: 'Gowun Batang', 'Song Myung', serif;
  line-height: 1.8;
  text-align: left;          /* ← 왼쪽 정렬 */
  max-width: 90%;
}

/* 각 링크(단어) */
.line .word {
  color: #000;
  text-decoration: none;
  transition: color 0.3s ease;
}

.line .word:hover {
  color: #444;
  text-decoration: underline;
}

/* 화살표 버튼 */
.arrow {
  font-size: 28px;
  margin-top: 20px;           /* 위 여백 줄이기 */
  margin-left: 40px;          /* 텍스트 라인과 정렬 */
  cursor: pointer;
  transition: transform 0.2s ease;
}
.arrow:hover {
  transform: scale(1.3);
}

/* nbox 문단 — 위로 복귀 */
.content p.nbox {
  margin-top: 0;              /* 아래로 밀린 현상 제거 */
  margin-bottom: 1em;
  text-align: left;           /* 왼쪽 정렬로 통일 */
  padding-left: 40px;
}

/* --- 본문 고정 + 화살표가 문장 옆에 고정되는 버전 --- */
.slide-container {
  display: block;             /* flex 제거: 자연스러운 인라인 흐름 */
  height: 60vh;
  padding-left: 40px;
  box-sizing: border-box;
  overflow: hidden;
}

/* 텍스트 줄 */
.line {
  display: inline;            /* 줄 전체를 인라인 요소로 설정 */
  font-size: 16px;
  font-family: 'Gowun Batang', 'Song Myung', serif;
  line-height: 1.8;
  text-align: left;
  max-width: 90%;
  white-space: normal;        /* 줄바꿈은 텍스트 흐름에 맞게 */
}

/* 링크 스타일 */
.line .word {
  color: #000;
  text-decoration: none;
  transition: color 0.3s ease;
}
.line .word:hover {
  color: #444;
  text-decoration: underline;
}

/* 깜빡이는 화살표 — 텍스트와 같은 줄에 머무름 */
.cursor {
  display: inline;
  font-size: 16px;
  animation: blink 1s step-start infinite;
  cursor: pointer;
  color: #000;
  margin-left: 4px;
  transition: opacity 0.3s ease, transform 0.2s ease;
}
.cursor:hover {
  transform: scale(1.3);
}
@keyframes blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0; }
}


/* nbox 문단 */
/* 본문 박스 (index와 동일한 상단 위치) */
.slide-container {
  display: block;
  position: relative;
  width: 100%;
  height: 60vh;              /* 고정 높이 유지 */
  padding: 0 40px;           /* 상단 여백 제거, 좌우만 유지 */
  box-sizing: border-box;
  overflow: hidden;
  background: transparent;
}

/* nbox 문단: index와 같은 위치 + 가운데 정렬 */
.content p.nbox {
  margin-top: 0;             /* 상단 간격 제거 */
  margin-bottom: 1.5em;
  text-align: center;        /* 가운데 정렬 */
  padding-left: 0;
  width: 100%;
}


/* 텍스트 줄 */
.line {
  display: inline;            /* 문장 흐름 그대로 유지 */
  font-size: 20px;
  font-family: 'Gowun Batang', 'Song Myung', serif;
  line-height: 1.8;
  text-align: left;
  color: #000;
  white-space: normal;
}

/* 링크(단어) 스타일 */
.line .word {
  color: #000;
   /* ✅ 기본 밑줄 제거 */
  transition: color 0.3s ease;
}
.line .word:hover {
  color: #444;
   /* ✅ 호버 시에도 밑줄 제거 */
}

/* 깜빡이는 화살표 */
.cursor {
  display: inline;
  font-size: 20px;
  animation: blink 1s step-start infinite;
  cursor: pointer;
  color: #000;
  margin-left: 4px;
  transition: opacity 0.3s ease, transform 0.2s ease;
}
.cursor:hover {
  transform: scale(1.3);
}

@keyframes blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0; }
}

/* -----------------------------------
   texts.html 전용 스타일 네임스페이스
----------------------------------- */

/* 본문 박스 */
.texts-page .slide-container {
  display: block;
  position: relative;
  width: 100%;
  height: 60vh;
  padding: 0 40px;
  box-sizing: border-box;
  overflow: hidden;
  background: transparent;
}

/* 텍스트 줄 */
.texts-page .line {
  display: inline;
  font-size: 16px;
  font-family: 'Gowun Batang', 'Song Myung', serif;
  line-height: 1.8;
  text-align: left;
  color: #000;
  white-space: normal;
}

/* 링크 스타일 */
.texts-page .line .word {
  color: #000;
  text-decoration: none;
  transition: color 0.3s ease;
}
.texts-page .line .word:hover {
  color: #444;
  text-decoration: none;
}

/* 화살표 */
.texts-page .cursor {
  display: inline;
  font-size: 16px;
  animation: blink 1s step-start infinite;
  cursor: pointer;
  color: #000;
  margin-left: 4px;
  transition: opacity 0.3s ease, transform 0.2s ease;
}
.texts-page .cursor:hover {
  transform: scale(1.3);
}

/* 배 이모티콘 */
.texts-page .ship {
  display: inline-block;
  margin-left: 6px;
  opacity: 0;
  animation: sail 1.2s ease-in-out forwards;
  font-size: 18px;
}

/* 애니메이션 */
@keyframes blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0; }
}
@keyframes sail {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* nbox 문단 */
.texts-page .content p.nbox {
  margin-top: 0;
  margin-bottom: 1.5em;
  text-align: center;
  padding-left: 0;
  width: 100%;
}

/* 모바일용 */
@media (max-width: 768px) {
  .texts-page .cursor {
    display: none !important;
  }
  .texts-page .slide-container {
    height: auto;
    overflow: visible;
    padding-bottom: 60px;
  }
}


/* ===== index 복구 ===== */
body:not(.texts-page) {
  font-family: 'Gowun Batang', 'Song Myung', serif;
  line-height: 1.6;
  color: #000;
}

body:not(.texts-page) h1,
body:not(.texts-page) h2 {
  font-family: 'Gowun Batang', serif;
}

body:not(.texts-page) p,
body:not(.texts-page) .nbox {
  text-align: left;
  font-size: 16px;
}


/* -----------------------------------
   페이지별 링크 스타일 분리
----------------------------------- */

/* 기본값 (index, output 등) */
body:not(.texts-page) a {
  color: inherit;
  text-decoration: underline; /* index와 output의 기본 링크 표시 복원 */
}
body:not(.texts-page) a:hover {
  text-decoration: underline;
}

/* texts.html 전용 링크 설정 */
.texts-page a,
.texts-page a:visited,
.texts-page a:hover,
.texts-page a:active {
  color: #000;

  outline: none;
}

/* -----------------------------------
   기본 페이지(nav는 밑줄 없음, 본문은 유지)
----------------------------------- */

/* 모든 기본 링크는 밑줄 제거 */
body:not(.texts-page) a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

/* 네비게이션 링크 hover 시 색상 강조만 */
body:not(.texts-page) nav a:hover {
  color: #000;
  text-decoration: none;
}

/* -----------------------------------
   output.html 카드 정렬 복원 (최종)
----------------------------------- */

/* 카드 안의 모든 텍스트를 강제로 왼쪽 정렬 */
body:not(.texts-page) .card,
body:not(.texts-page) .card *,
body:not(.texts-page) .card a,
body:not(.texts-page) .card p,
body:not(.texts-page) .card h1,
body:not(.texts-page) .card h2,
body:not(.texts-page) .card h3 {
  text-align: left !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
}


/* -----------------------------------
   ✅ output.html 카드 설명 오른쪽 정렬 (최종)
----------------------------------- */
.page-output .info,
.page-output .info h3,
.page-output .info p.no-box {
  text-align: right !important;
  justify-content: flex-end !important;
  align-items: flex-end !important;
}

@media (hover: none), (pointer: coarse), (max-width: 900px) {
  .page-output .info {
    text-align: right !important;
    justify-content: flex-end !important;
    align-items: flex-end !important;
  }
}

/* ✅ 흰 박스와 영상 박스 크기 완전 일치 강제 */

.video-container {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
}

.video-container iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: 0;
  border-radius: 16px;
  display: block;
}

.lyrics-box .inner-divider {
  border: none;
  border-top: 1px solid rgba(0,0,0,0.2);
  width: 80%;
  margin: 1.5rem auto;
}

body {
  padding-top: env(safe-area-inset-top);
}

#character-nav {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  text-align: center;
  animation: walkIn 2.3s ease-out forwards;
}

#character-nav img {
  width: 160px; /* 필요에 따라 조정 */
  cursor: pointer;
  display: block;
  image-rendering: auto;
  border: none;
  background: transparent;
  transition: transform 0.2s ease;
}

#character-nav img:hover {
  transform: scale(1.03);
}

/* 오른쪽에서 총총총 걸어나오는 애니메이션 */
@keyframes walkIn {
  0% { transform: translateX(250px) scale(0.9); opacity: 0; }
  40% { transform: translateX(120px) scale(1.05); opacity: 0.8; }
  70% { transform: translateX(40px) scale(0.98); opacity: 1; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}



/* 말풍선 등장 애니메이션 */
@keyframes bubbleFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

#character-nav {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  text-align: center;
  animation: walkIn 2.3s ease-out forwards;
}

/* 캐릭터 이미지 */
#character-nav img {
  width: 90px;
  cursor: pointer;
  display: block;
  border: none;
  background: transparent;
  transition: transform 0.2s ease;
}
#character-nav img:hover {
  transform: scale(1.05);
}

/* 오른쪽에서 등장 */
@keyframes walkIn {
  0% { transform: translateX(200px) scale(0.9); opacity: 0; }
  40% { transform: translateX(120px) scale(1.05); opacity: 0.8; }
  70% { transform: translateX(40px) scale(0.98); opacity: 1; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}




/* ✅ 등장 (살짝 bounce) */
@keyframes bubbleBounce {
  0% { opacity: 0; transform: translateY(20px) scale(0.9); }
  60% { opacity: 1; transform: translateY(-6px) scale(1.05); }
  80% { transform: translateY(3px) scale(0.98); }
  100% { transform: translateY(0) scale(1); }
}

/* ✅ 퇴장 (살짝 흔들리며 내려감) */
@keyframes bubbleExit {
  0% { opacity: 1; transform: rotate(0deg) translateY(0); }
  25% { transform: rotate(3deg); }
  50% { transform: rotate(-3deg); }
  75% { transform: rotate(2deg); }
  100% { opacity: 0; transform: translateY(25px) rotate(0deg); }
}

/* ✅ 음성 재생 중 “...” 타이핑 효과 */
.typing {
  display: inline-block;
  font-size: 20px;
  letter-spacing: 3px;
  animation: typingDots 1.2s steps(4, end) infinite;
}
@keyframes typingDots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
  100% { content: ""; }
}


@keyframes bubbleReposition {
  0% { opacity: 0.6; transform: translateY(10px) rotate(-5deg); }
  100% { opacity: 1; transform: translateY(0) rotate(0); }
}

#character-nav {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  text-align: center;
  animation: walkIn 2.3s ease-out forwards;
}

/* 캐릭터 */
#character-nav img {
  width: 90px;
  cursor: pointer;
  display: block;
  border: none;
  background: transparent;
  transition: transform 0.2s ease;
}
#character-nav img:hover { transform: scale(1.05); }

/* 등장 */
@keyframes walkIn {
  0% { transform: translateX(200px) scale(0.9); opacity: 0; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}

/* ✅ 등장 */
@keyframes bubbleBounce {
  0% { opacity: 0; transform: translateY(20px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ✅ 퇴장 */
@keyframes bubbleDown {
  0% { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(0.8) translateY(25px); }
}

/* ✅ MP3 컨트롤러 */
#audio-controls {
  display: none;
  margin-top: 10px;
  text-align: center;
}

#audio-controls button {
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  margin: 0 6px;
  transition: transform 0.1s ease;
}
#audio-controls button:hover {
  transform: scale(1.2);
}

#progress-container {
  margin-top: 8px;
}
#progress-bar {
  width: 100%;
  appearance: none;
  height: 6px;
  border-radius: 4px;
  background: #ddd;
  outline: none;
}
#progress-bar::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #444;
  cursor: pointer;
}
#time-display {
  margin-top: 4px;
  font-size: 12px;
  color: #555;
}



/* ==========================
   캐릭터 & 말풍선 최종 버전
========================== */

/* 캐릭터 기본 등장 */
#character-nav {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  text-align: center;
  animation: walkIn 2s ease-out forwards;
}

#character-nav img {
  width: 90px;
  cursor: pointer;
  display: block;
  border: none;
  background: transparent;
  transition: transform 0.2s ease;
}
#character-nav img:hover {
  transform: scale(1.05);
}

/* 등장 애니메이션 (총총총 걸어 들어옴) */
@keyframes walkIn {
  0%   { transform: translateX(250px) scale(0.9); opacity: 0; }
  40%  { transform: translateX(120px) scale(1.05); opacity: 0.9; }
  70%  { transform: translateX(40px)  scale(0.98); opacity: 1; }
  100% { transform: translateX(0)     scale(1);    opacity: 1; }
}

/* ✅ 말풍선: 캐릭터보다 살짝 위 */
#speech-bubble {
  display: none;
  position: absolute;
  bottom: 295px;   /* 캐릭터 머리보다 위 */
  right: 150px;    /* 얼굴 안 가리게 약간 왼쪽 */
  background: white;
  color: black;
  padding: 14px 18px 18px;
  border-radius: 22px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  font-size: 14px;
  line-height: 1.5;
  width: 220px;
  transform-origin: bottom right;
  animation: bubbleBounce 0.4s ease;
  z-index: 10000;
}


/* 말풍선 등장 애니메이션 */
@keyframes bubbleBounce {
  0% { opacity: 0; transform: translateY(20px) scale(0.9); }
  60% { opacity: 1; transform: translateY(-6px) scale(1.05); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* 말풍선 사라짐 */
@keyframes bubbleFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(20px); }
}

/* ✅ 퇴장 애니메이션: 등장과 비슷하지만 반대로 */
@keyframes walkOut {
  0%   { transform: translateX(0) scale(1); opacity: 1; }
  30%  { transform: translateX(40px) scale(0.98); opacity: 0.9; }
  60%  { transform: translateX(120px) scale(0.92); opacity: 0.6; }
  100% { transform: translateX(250px) scale(0.85); opacity: 0; }
}
.walkOut {
  animation: walkOut 2s ease-in forwards;
}



/* 💬 데스크톱용 말풍선 위치 좁히기 */
#speech-bubble {
  right: 100px !important;   /* 기존보다 캐릭터 쪽으로 가까이 */
  bottom: 285px !important;  /* 약간 아래로 조정해 자연스럽게 */
}

/* 💬 말풍선 — 얼굴 가까이, 낮은 위치 그대로 */
#speech-bubble {
  bottom: 320px !important;
  right: 70px !important;
}

/* 💬 말풍선 위치 — 캐릭터 얼굴과 훨씬 가깝게 */
#speech-bubble {
  bottom: 295px !important;   /* 조금 더 낮게 */
  right: 60px !important;     /* 얼굴 가까이 */
}

/* 🟢 삼각형 꼬리 (↘ 방향) */
#speech-bubble::after {
  content: "";
  position: absolute !important;
  bottom: -10px !important;   /* 말풍선 아래로 살짝 */
  right: 20px !important;     /* 오른쪽 아래 대각선 방향 */
  width: 0 !important;
  height: 0 !important;

  /* 삼각형 형태 (↘ 방향) */
  border-left: 12px solid transparent !important;
  border-right: 12px solid transparent !important;
  border-top: 12px solid white !important;

  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
  z-index: 9999 !important;
}

/* 📱 모바일일 때 — 비율 조정 */
@media (max- width: 768px) {
  #speech-bubble {
    bottom: 260px !important;
    right: 45px !important;
  }

  #speech-bubble::after {
    bottom: -8px !important;
    right: 15px !important;
    border-left: 10px solid transparent !important;
    border-right: 10px solid transparent !important;
    border-top: 10px solid white !important;
  }
}


/* 이미지 모서리 둥글게, p 폭 100% 사용 */
.book-gallery {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  margin: 12px 0;
}
.book-gallery img {
  display: none;
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 0;
}
.book-gallery img.active { display: block; }

/* 페이지 표시 배지(우하단) */
.book-gallery .page-indicator {
  position: absolute;
  right: 10px;
  bottom: 36px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  line-height: 1;
}

/* 컨테이너는 그대로 두고 */
.book-gallery .scrubber{
  display:block; width:100%; margin-top:8px; position:relative; height:6px;
}

/* 슬라이더 본체 */
.book-gallery .scrubber input[type="range"]{
  -webkit-appearance:none; appearance:none;
  width:100%; height:22px;     /* 손잡이 공간 */
  background:transparent; margin:0; padding:0; position:relative;
}

/* WebKit(크롬/사파리): 트랙 끝만 둥글게 + 진행 구간은 var(--fill)로 채움 */
.book-gallery .scrubber input[type="range"]::-webkit-slider-runnable-track{
  height:6px;
  border-radius:999px;          /* ← 끝만 둥글게 */
  background:linear-gradient(
    to right,
    rgba(0,0,0,.55) 0%,
    rgba(0,0,0,.55) var(--fill,0%),
    rgba(0,0,0,.12) var(--fill,0%),
    rgba(0,0,0,.12) 100%
  );
}

/* Firefox: 트랙/진행부 모두 끝만 둥글게 */
.book-gallery .scrubber input[type="range"]::-moz-range-track{
  height:6px; background:rgba(0,0,0,.12); border-radius:999px;
}
.book-gallery .scrubber input[type="range"]::-moz-range-progress{
  height:6px; background:rgba(0,0,0,.55); border-radius:999px;
}

/* 손잡이(동그라미)는 그대로, 필요하면 크기 조절 가능 */
.book-gallery .scrubber input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none;
  width:14px; height:14px; border-radius:50%;
  background:rgba(0,0,0,.7); border:none; cursor:pointer;
  margin-top:-4px; /* 트랙 중앙 정렬 */
}
.book-gallery .scrubber input[type="range"]::-moz-range-thumb{
  width:14px; height:14px; border-radius:50%;
  background:rgba(0,0,0,.7); border:none; cursor:pointer;
}

 /* 북 갤러리 컨테이너를 블록으로, 가운데 정렬 */
.book-gallery{
  display: block;
  margin: 1.5rem auto;
  max-width: 100%;      /* 화면 넘치지 않도록 안전장치 */
}

/* 북 갤러리 안의 이미지는 컨테이너에 딱 맞게 */
.book-gallery img{
  width: 100%;
  height: auto;
  display: block;
}

/* 북갤러리 좌우 화살표 */
.book-gallery .bg-arrow{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  border: none; padding: 0;
  background: transparent;          /* 검은 박스 없이 깔끔하게 */
  color: #black;                       /* 이미지 위에서도 보이게 */
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
  font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 3;       /* 배지/이미지 위로 */
}
.book-gallery .bg-arrow.left  { left: 6px;  }
.book-gallery .bg-arrow.right { right: 6px; }

.book-gallery .bg-arrow:hover,
.book-gallery .bg-arrow:focus-visible{
  background: rgba(0,0,0,.18);       /* 호버 시만 살짝 원형 배경 */
  border-radius: 999px; outline: none;
}


/* 문단(p)을 카드처럼 보이게 */
p {
  background: #fff;          /* 흰 배경 */
  padding: 12px 16px;        /* 안쪽 여백 */
  border-radius: 10px;       /* 모서리 둥글게 */
  box-shadow: 0 2px 6px rgba(0,0,0,0.08); /* 살짝 그림자 */
  margin: 1.2em 0;           /* 문단 사이 여백 */
}

/* === 슬라이드 박스(p 박스와 동일 크기/모양) ================== */
.slideshow {
  width: 100%;               /* p 박스와 동일 */
  margin: 1.2em 0;           /* p 박스와 동일한 위아래 여백 */
  border-radius: 10px;       /* p 박스 둥근 모서리와 동일 */
  background: #fff;          /* p 박스 배경색 */
  box-shadow: 0 2px 6px rgba(0,0,0,0.08); /* p 박스 그림자 */
  position: relative;
  overflow: hidden;

  /* 슬라이드 이미지가 겹치더라도 컨테이너 높이를 유지 */
  aspect-ratio: 3 / 4;       /* 문서 세로 비율에 맞춤 (원하면 비율 바꿔도 됨) */
}

/* === 슬라이드 이미지 ================== */
.slideshow .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;       /* 문서형이면 contain으로 바꿔도 OK */
  border-radius: 10px;     /* p 박스와 동일 모서리 */
  opacity: 0;
  transition: opacity 1s ease;
}

.slideshow .slide.active {
  opacity: 1;
}

/* === 점 네비게이션 ●●●● ================== */
.slideshow .dots {
  position: absolute;
  bottom: 8px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 5;
}

.slideshow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}

.slideshow .dot.active {
  background: rgba(0,0,0,0.85);
  transform: scale(1.25);
}

.word {
  text-decoration: none;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

.word:hover {
  text-decoration: underline;
  text-decoration-thickness: 1.5px; /* (선 두께 원하면 조절) */
  text-underline-offset: 3px; /* 글자와 밑줄 간격 */
}

/* texts.html 전용 링크 밑줄 유지 버전 */
.texts-page .word {
  text-decoration: none;
  color: #000;
}

.texts-page .word:hover {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

/* 방문 후에도 밑줄 유지 */
.texts-page .word:visited {
  color: #000;
  text-decoration: none;
}

.texts-page .word:hover {
  text-decoration: underline wavy;
  text-decoration-color: rgba(0,0,0,0.65);
}


/* 🔥 texts.html 링크 hover 밑줄 강제 적용 */
.texts-page .line .word:hover {
  text-decoration: underline !important;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.book-gallery {
  position: relative;
}

.page-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: none;
  font-size: 22px;
  width: 32px;
  height: 32px;
  line-height: 30px;
  text-align: center;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  z-index: 10;
}

.page-arrow:hover {
  background: rgba(0,0,0,0.7);
}

.left-arrow { left: 6px; }
.right-arrow { right: 6px; }


.book-gallery {
  position: relative;
}

/* 기본 화살표: 거의 안 보이게 */
.page-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: none;
  font-size: 22px;
  width: 32px;
  height: 32px;
  line-height: 30px;
  text-align: center;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  z-index: 10;

  /* 🔥 핵심: 기본은 거의 안 보임 */
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* 갤러리에 마우스 올림 → 화살표 나타남 */
.book-gallery:hover .page-arrow {
  opacity: 1;
}

/* hover 시 살짝 더 진하게 */
.page-arrow:hover {
  background: rgba(0,0,0,0.7);
}

.left-arrow { left: 6px; }
.right-arrow { right: 6px; }

/* 🎭 캐릭터 퇴장 애니메이션 */
@keyframes docent-walk-out {
  0% { transform: translateX(0) scale(1); opacity: 1; }
  60% { transform: translateX(40px) scale(0.98); opacity: 0.9; }
  100% { transform: translateX(300px) scale(0.9); opacity: 0; }
}

.walkOutRight {
  animation: docent-walk-out 1.4s ease forwards;
  pointer-events: none; /* 사라지는 동안 클릭 방지 */
}

/* ====== 그만 보기 버튼 ====== */
#close-docent {
  position: absolute;
  bottom: 90px;        /* 캐릭터 허리 높이(필요 시 조절) */
  right: 10px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 13px;
  padding: 4px 7px;
  border-radius: 6px;
  cursor: pointer;
  display: none;       /* 처음에는 숨김 */
  z-index: 10001;
  transition: opacity .3s ease;
}

#close-docent.show {
  display: block;
  animation: fadeInClose .4s ease;
}

@keyframes fadeInClose {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.listen-later {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-family: 'Gowun Batang', serif;
  background: rgba(75, 63, 50, 0.55);
  color: rgba(245,235,216,0.92);
  border: 1px solid rgba(255,255,255,0.25);
  white-space: nowrap;
  cursor: pointer;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: background .25s ease, transform .25s ease;
  z-index: 10001;

  /* ✨ 등장 애니메이션 (A: 아래에서 떠오르기) */
  opacity: 0;
  animation: listenLaterPop 0.6s cubic-bezier(.31,.75,.22,1.05) forwards;
  animation-delay: 2.2s; /* 딜레이 조정 가능 */
}

.listen-later:hover {
  background: rgba(75, 63, 50, 0.75);
  transform: translateX(-50%) translateY(-1px);
}

@keyframes listenLaterPop {
  0%   { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.92); }
  70%  { opacity: 1; transform: translateX(-50%) translateY(-2px) scale(1.04); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* 퇴장 애니메이션 */
@keyframes docent-walk-out {
  0% { transform: translateX(0) scale(1); opacity: 1; }
  60% { transform: translateX(40px) scale(0.98); opacity: 0.9; }
  100% { transform: translateX(260px) scale(0.9); opacity: 0; }
}

.walkOutRight {
  animation: docent-walk-out 1.4s ease forwards;
  pointer-events: none;
}

#speech-bubble {
  animation: bubbleBounce 0.4s ease forwards;
  animation-delay: 1s; /* 캐릭터 등장 2초 이후 */
  }

/* ✅ lyrics-box도 p 박스처럼 보이게 */
.content .lyrics-box{
  background: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  margin: 1.2em 0;
}

/* lyrics-box 안쪽 요소들이 가장자리 붙지 않게 */
.content .lyrics-box p{
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin: 0;
}
