/* BoA Time Machine — 사이트 CSS
 * Time Machine 와이어프레임 디자인 톤 적용
 * Pretendard 900 + Bungee + Major Mono + Space Grotesk
 */

:root {
  --mustard: #E6D85F;
  --mustard-deep: #C9BD3F;
  --brown: #7A4D2B;
  --brown-deep: #5A3919;
  --cream: #FAF6E0;
  --cream-deep: #F0E8C8;
  --text: #2A1F12;
  --text-soft: #5A4F40;
  --gray: #8A8175;
  --border: #D4C8A8;
  --black: #1A1410;
  --white: #FFFFFF;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Pretendard', 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 900;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Header === */

.site-header {
  background: var(--cream);
  border-bottom: 4px solid var(--brown);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none !important;
  color: var(--brown);
}

.brand-text {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-sub {
  font-family: 'Major Mono Display', monospace;
  font-size: 11px;
  color: var(--brown);
  opacity: 0.7;
  margin-top: 2px;
}

.site-nav {
  display: flex;
  gap: 22px;
  font-weight: 700;
  font-size: 14px;
}

.site-nav a {
  color: var(--brown);
  padding: 4px 0;
}

.site-nav a:hover {
  color: var(--brown-deep);
  border-bottom: 2px solid var(--mustard);
  text-decoration: none;
}

/* === 언어 스위처 === */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 16px;
  border: 1.5px solid var(--brown);
  border-radius: 20px;
  padding: 2px;
  background: white;
}

.lang-btn {
  font-family: 'Space Grotesk', 'Pretendard', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--brown);
  background: transparent;
  border: none;
  border-radius: 14px;
  padding: 4px 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.lang-btn:hover {
  background: var(--cream-deep);
}

.lang-btn.lang-active {
  background: var(--mustard);
  color: var(--brown-deep);
}

@media (max-width: 768px) {
  .lang-switcher {
    margin-left: 10px;
    padding: 1px;
  }
  .lang-btn {
    font-size: 10px;
    padding: 3px 6px;
  }
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === 타임슬라이더 + 매체 시그니처 (사이트 정체성 핵심) === */

.timetravel-section {
  margin: 30px 0 50px;
}

.dial-wrap {
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-deep) 100%);
  border: 2px solid var(--brown);
  border-radius: 14px;
  padding: 32px 24px;
  position: relative;
}

.era-line {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.era {
  text-align: center;
  cursor: pointer;
  padding: 12px 8px;
  border-radius: 10px;
  transition: background 0.2s, transform 0.2s;
  position: relative;
}

.era:hover {
  background: rgba(230, 216, 95, 0.3);
  transform: translateY(-3px);
}

.era.era-active {
  background: var(--mustard);
  box-shadow: 0 4px 14px rgba(122, 77, 43, 0.25);
}

.era-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 8px;
  transition: transform 0.3s;
}

.era:hover .era-icon { transform: rotate(8deg) scale(1.08); }
.era.era-active .era-icon { transform: scale(1.12); }

.era-icon svg { width: 100%; height: 100%; display: block; }

.era-label {
  font-family: 'Bungee', 'Pretendard', sans-serif;
  font-size: 14px;
  color: var(--brown-deep);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
}

.era-years {
  font-family: 'Major Mono Display', monospace;
  font-size: 11px;
  color: var(--brown);
  opacity: 0.75;
  margin-top: 4px;
}

/* 슬라이더 트랙 */
.slider-track {
  position: relative;
  padding: 30px 0 10px;
}

#year-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  background: var(--brown);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

/* 시간여행 다이얼 thumb — 별 모양 (시그니처) */
#year-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 32px;
  height: 32px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><polygon points='16,2 19.5,12 30,12.5 21.5,19 24.5,29.5 16,23.5 7.5,29.5 10.5,19 2,12.5 12.5,12' fill='%23E6D85F' stroke='%235A3919' stroke-width='2' stroke-linejoin='round'/></svg>") no-repeat center / contain;
  border: none;
  border-radius: 0;
  cursor: grab;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
  transition: transform 0.15s;
}

#year-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

#year-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.1) rotate(15deg);
}

#year-slider::-moz-range-thumb {
  width: 32px;
  height: 32px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><polygon points='16,2 19.5,12 30,12.5 21.5,19 24.5,29.5 16,23.5 7.5,29.5 10.5,19 2,12.5 12.5,12' fill='%23E6D85F' stroke='%235A3919' stroke-width='2' stroke-linejoin='round'/></svg>") no-repeat center / contain;
  border: none;
  border-radius: 0;
  cursor: grab;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}

.slider-marks {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 4px;
}

.slider-mark {
  width: 1px;
  height: 6px;
  background: var(--brown);
  opacity: 0.4;
  position: relative;
}

.slider-mark.mark-major {
  height: 12px;
  opacity: 0.9;
  width: 2px;
}

.mark-label {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Major Mono Display', monospace;
  font-size: 11px;
  color: var(--brown);
}

.slider-current {
  text-align: center;
  margin-top: 28px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 14px;
}

.slider-year {
  font-family: 'Bungee', 'Pretendard', sans-serif;
  font-size: 56px;
  color: var(--brown-deep);
  letter-spacing: -0.04em;
  line-height: 1;
}

.slider-era {
  font-family: 'Major Mono Display', monospace;
  font-size: 14px;
  color: var(--brown);
  padding: 4px 10px;
  background: var(--mustard);
  border-radius: 4px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* === fallback when today is empty === */
.today-fallback {
  text-align: center;
  padding: 30px 20px;
  background: var(--cream);
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-soft);
}

.fallback-text {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.6;
}

.fallback-cta {
  display: inline-block;
  padding: 10px 18px;
  background: var(--brown);
  color: var(--cream);
  border-radius: 6px;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 13px;
}

.fallback-cta:hover { background: var(--brown-deep); }

/* === 히어로 — "영원한 BoA" 톤 (clean & warm) === */

.hero {
  background: linear-gradient(135deg, var(--cream) 0%, var(--mustard) 100%);
  border: 3px solid var(--brown);
  border-radius: 14px;
  padding: 64px 32px 56px;
  margin: 30px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.35) 0%, transparent 55%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}

.hero-since {
  font-family: 'Major Mono Display', 'Courier New', monospace;
  font-size: clamp(11px, 1.6vw, 14px);
  letter-spacing: 0.3em;
  color: var(--brown);
  margin: 0 0 16px 0;
  opacity: 0.75;
  text-indent: 0.3em;  /* 글자간격 보정으로 시각적 중앙 */
}

.hero-title {
  font-family: 'Pretendard', 'Space Grotesk', sans-serif;
  font-size: clamp(38px, 8vw, 76px);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--brown-deep);
  margin: 0 0 14px 0;
  line-height: 1;
}

.hero-tagline {
  font-family: 'Space Grotesk', 'Pretendard', sans-serif;
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 700;
  letter-spacing: 0.08em;
  /* BoA 표기 규칙: 'o'는 항상 소문자 — text-transform: uppercase 금지 */
  color: var(--brown);
  margin: 0 0 28px 0;
  opacity: 0.85;
}

.hero-wish {
  font-family: 'Pretendard', sans-serif;
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 500;
  color: var(--brown-deep);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.5;
  opacity: 0.9;
}

/* === 섹션 공통 === */

.section-header {
  margin: 50px 0 20px;
}

.section-header h1, .section-header h2 {
  color: var(--brown);
  font-size: 28px;
  margin-bottom: 4px;
}

.section-sub {
  color: var(--text-soft);
  font-size: 14px;
  margin: 0;
}

.back-link {
  display: inline-block;
  color: var(--brown);
  font-weight: 700;
  margin-bottom: 16px;
  font-size: 14px;
}

/* === 오늘의 시간여행 (anniversary 모드) === */

.anniversary-header {
  background: linear-gradient(135deg, var(--mustard) 0%, var(--cream-deep) 100%);
  border: 2px solid var(--brown);
  border-radius: 10px;
  padding: 20px 24px;
  margin: 50px 0 20px;
}

.anniversary-badge {
  display: inline-block;
  background: var(--brown);
  color: var(--mustard);
  padding: 4px 12px;
  border-radius: 4px;
  font-family: 'Major Mono Display', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.anniversary-header h2 {
  color: var(--brown-deep);
  font-size: 28px;
  margin: 0 0 6px;
}

.anniversary-note {
  font-size: 13px;
  color: var(--brown);
  font-family: 'Major Mono Display', monospace;
  margin: 6px 0 0;
  opacity: 0.85;
}

.anniv-meta {
  display: block;
  font-size: 12px;
  color: var(--text-soft);
  font-family: 'Space Grotesk', monospace;
  margin-top: 4px;
  font-weight: normal;
}

/* === 오늘의 시간여행 === */

.today-section {
  margin: 60px 0;
}

.today-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* today-card는 clip-card 와 동일 시각 스타일 사용 (구조 통일됨) */
/* 추가로 좌상단 year 배지만 노출 */

.today-year-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--brown);
  color: var(--mustard);
  font-family: 'Major Mono Display', monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  z-index: 3;  /* overlay 그라데이션 위 */
  letter-spacing: 0.04em;
  text-shadow: none;
}

.thumb-placeholder {
  background: var(--cream-deep);
  color: var(--brown);
}

.placeholder-icon {
  font-size: 48px;
  opacity: 0.5;
}

/* === 검색 + 필터 === */

.search-section {
  margin: 40px 0 20px;
}

.search-bar {
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
}

.search-bar input {
  flex: 1 1 240px;
  min-width: 200px;
  padding: 14px 20px;
  font-size: 16px;
  font-family: inherit;
  border: 2px solid var(--brown);
  border-radius: 30px;
  background: white;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--mustard-deep);
  box-shadow: 0 0 0 4px rgba(230, 216, 95, 0.3);
}

/* === 정렬 토글 버튼 === */
.sort-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 700;
  color: var(--brown-deep);
  background: white;
  border: 2px solid var(--brown);
  border-radius: 30px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.05s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.sort-toggle:hover {
  background: var(--cream-deep);
  border-color: var(--brown-deep);
}

.sort-toggle:active {
  transform: scale(0.97);
  background: var(--mustard);
}

.sort-toggle .sort-icon {
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  color: var(--brown);
  transition: transform 0.2s;
}

.sort-toggle[data-sort="activity_desc"] .sort-icon {
  /* 최신순일 때 아이콘 회전 효과는 텍스트(↓)로 대체 */
}

.sort-toggle .sort-text {
  letter-spacing: 0.02em;
}

@media (max-width: 480px) {
  .sort-toggle {
    padding: 10px 14px;
    font-size: 13px;
  }
}

.year-pills, .country-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  cursor: pointer;
  font-family: 'Major Mono Display', monospace;
  text-decoration: none !important;
}

.pill:hover {
  background: var(--cream-deep);
}

.pill-active {
  background: var(--mustard);
  border-color: var(--brown);
  color: var(--brown-deep);
  font-weight: 700;
}

/* === 클립 그리드 === */

.grid-section {
  margin: 40px 0 60px;
}

.clips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.clip-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  /* 모바일 long-press: iOS callout / 이미지 저장 메뉴 차단 → JS 시트가 처리 */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
/* 텍스트 선택은 카드 안의 텍스트 요소에서는 허용 (접근성) */
.clip-card .clip-title,
.clip-card .clip-meta,
.clip-card .clip-nick {
  -webkit-user-select: text;
  user-select: text;
}

.clip-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(122, 77, 43, 0.18);
  border-color: var(--brown);
}

.clip-link {
  display: block;
  position: relative;
  text-decoration: none !important;
  color: var(--text);
  /* 카드 안 chrome 제거 — 영상이 카드 전체를 차지 */
  /* 🎬 4:3 클리핑 컨테이너 — 애니 webp img 가 object-fit 무시해도 강제 cover (overflow hidden 으로 잘림) */
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.clip-video {
  width: 100%;
  display: block;
  background: var(--black);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* 🎬 모바일 animated webp img — clip-link(4:3) 를 정확히 채우고 cover 크롭.
   width/height 100% 로 박스를 4:3 으로 고정(intrinsic 간섭 차단) + object-fit:cover.
   (이전 min-w/h 방식은 webp 가 카드보다 크면 축소 안 하고 과확대되는 버그 → 폐기.) */
img.clip-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: auto;
  /* 🎬 포스터(정지 썸네일) 배경 — 애니 webp 로딩 전 검은화면 방지. img content 로딩되면 위를 덮음. */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* 영상 위 floating overlay — 아래쪽 그라데이션 + 한 줄 정보 */
.clip-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 10px 8px;
  background: linear-gradient(180deg,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.55) 70%,
    rgba(0,0,0,0.82) 100%);
  color: var(--white);
  pointer-events: none;  /* 영상 클릭/터치를 가리지 않음 */
}

.clip-title {
  font-weight: 700;
  font-size: 12px;
  color: var(--white);
  margin: 0 0 2px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  letter-spacing: -0.01em;
}

.clip-nick {
  font-style: italic;
  font-size: 10px;
  color: rgba(255,255,255,0.85);
  margin: 0 0 2px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.clip-meta {
  font-size: 10px;
  color: rgba(255,255,255,0.82);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.clip-meta .clip-date,
.clip-meta .clip-prog {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.clip-date {
  font-family: 'Major Mono Display', monospace;
  color: var(--mustard);
  font-size: 9px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.clip-prog {
  flex-shrink: 1;
  min-width: 0;
}

.clip-meta .flag {
  flex-shrink: 0;
  font-size: 12px;
  margin-left: auto;
}

.flag {
  font-size: 14px;
  margin-left: auto;
}

/* 🛡️ fan_upload 정책: creator_credit 노출 — about.html "닉네임으로 출처 명기" 약속 강화.
   .clip-date 와 동일 크기 (9px) + 좁은 letter-spacing + 작은 margin — 컴팩트. */
.clip-credit {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
  letter-spacing: 0;
  font-style: italic;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid-more {
  text-align: center;
  margin: 30px 0;
}

.grid-more a {
  display: inline-block;
  padding: 12px 28px;
  background: var(--brown);
  color: var(--cream);
  border-radius: 30px;
  font-weight: 700;
  text-decoration: none !important;
  transition: background 0.15s;
}

.grid-more a:hover { background: var(--brown-deep); }

/* === 무한 스크롤 sentinel === */
.scroll-sentinel {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80px;
  margin: 24px 0 60px;
  color: var(--text-soft);
  font-size: 13px;
  letter-spacing: 0.02em;
  visibility: hidden;     /* JS가 active 클래스 붙일 때만 보임 */
}

.scroll-sentinel.active {
  visibility: visible;
}

/* 🛡️ exhausted state 도 visible — 무한스크롤 끝 도달 표시 + BApal IntersectionObserver firing 보장.
   visibility:hidden 이면 getBoundingClientRect 0 → IO firing X → BApal 영원히 안 보임. */
.scroll-sentinel.exhausted {
  visibility: visible;
}

.scroll-sentinel.exhausted .sentinel-indicator {
  /* 전부 다 본 상태 */
  color: var(--gray);
}

.scroll-sentinel.exhausted .sentinel-indicator::before {
  content: '— ';
  margin-right: 4px;
}

.scroll-sentinel.exhausted .sentinel-indicator::after {
  content: ' —';
  margin-left: 4px;
}

.sentinel-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.scroll-sentinel.active:not(.exhausted) .sentinel-indicator::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--brown);
  border-radius: 50%;
  animation: sentinel-spin 0.8s linear infinite;
}

@keyframes sentinel-spin {
  to { transform: rotate(360deg); }
}

/* === 모바일 미니 슬라이더 (메인 다이얼 화면 밖 시 등장) === */
.mini-slider {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: var(--cream);
  border-top: 3px solid var(--brown);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)) 16px;
  box-shadow: 0 -8px 24px rgba(26, 20, 16, 0.18);
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
  display: block;  /* 🔧 PC + 모바일 모두 — 메인 다이얼 화면 밖 시 .visible로 표시됨 */
}

.mini-slider.visible {
  transform: translateY(0);
}

.mini-slider-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.mini-slider-year {
  font-family: 'Pretendard', sans-serif;
  font-weight: 900;
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}

.mini-slider-era {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--brown);
  text-transform: uppercase;
}

.mini-slider-input {
  width: 100%;
  height: 24px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

/* track */
.mini-slider-input::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}
.mini-slider-input::-moz-range-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}

/* thumb — 별 모양 (메인 슬라이더와 통일) */
.mini-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -12px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><polygon points='16,2 19.5,12 30,12.5 21.5,19 24.5,29.5 16,23.5 7.5,29.5 10.5,19 2,12.5 12.5,12' fill='%23E6D85F' stroke='%235A3919' stroke-width='2' stroke-linejoin='round'/></svg>") no-repeat center / contain;
  border: none;
  border-radius: 0;
  cursor: grab;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}
.mini-slider-input::-moz-range-thumb {
  width: 28px;
  height: 28px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><polygon points='16,2 19.5,12 30,12.5 21.5,19 24.5,29.5 16,23.5 7.5,29.5 10.5,19 2,12.5 12.5,12' fill='%23E6D85F' stroke='%235A3919' stroke-width='2' stroke-linejoin='round'/></svg>") no-repeat center / contain;
  border: none;
  border-radius: 0;
  cursor: grab;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}

/* 터치 디바이스에서만 활성 */
@media (pointer: coarse), (max-width: 768px) {
  .mini-slider {
    display: block;
  }
}

/* 액션 시트가 떠있을 때는 미니 슬라이더 가리기 (z-index 충돌 방지) */
body.gas-open .mini-slider {
  transform: translateY(100%);
}

/* === 클립 상세 페이지 === */

.clip-detail {
  margin: 30px 0;
}

.clip-nav {
  display: flex;
  gap: 16px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 20px;
}

.clip-nav a {
  color: var(--brown);
}

.clip-stage {
  background: var(--black);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 30px;
  display: flex;
  justify-content: center;
}

.clip-video-large {
  max-width: 100%;
  max-height: 70vh;
  display: block;
}

.clip-info {
  padding: 0 20px;
}

.clip-song {
  font-size: 36px;
  color: var(--brown);
  margin: 0 0 8px;
}

.clip-nickname {
  font-style: italic;
  font-size: 18px;
  color: var(--text);
  margin: 0 0 20px;
}

.clip-facts {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px 24px;
  max-width: 600px;
  margin-bottom: 30px;
}

.clip-facts dt {
  font-weight: 700;
  color: var(--brown);
}

.clip-facts dd {
  margin: 0;
}

.clip-facts .net {
  color: var(--gray);
  font-size: 14px;
}

.clip-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-download, .btn-share {
  display: inline-block;
  padding: 12px 24px;
  background: var(--mustard);
  border: 2px solid var(--brown);
  color: var(--brown-deep);
  border-radius: 8px;
  font-weight: 700;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.15s;
}

.btn-download:hover, .btn-share:hover {
  background: var(--mustard-deep);
}

.btn-share {
  background: white;
}

/* === Milestones (연대기) === */

.events-timeline {
  margin: 30px 0;
}

.event-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--border);
}

.event-date {
  font-family: 'Major Mono Display', monospace;
  font-size: 14px;
  color: var(--brown);
  font-weight: 700;
}

.event-body h3 {
  font-size: 17px;
  margin: 0 0 4px;
  color: var(--text);
}

.event-body p {
  margin: 4px 0;
  color: var(--text-soft);
  font-size: 14px;
}

.event-type {
  display: inline-block;
  background: var(--cream-deep);
  color: var(--brown);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
}

/* === About === */

.about-page, .song-page, .year-page, .milestones-page {
  max-width: 800px;
  margin: 40px auto;
}

.about-page h1, .about-page h2 {
  color: var(--brown);
  margin: 30px 0 10px;
}

.about-page h1 {
  font-size: 32px;
}

.about-page h2 {
  font-size: 20px;
  margin-top: 36px;
}

.about-page p, .about-page li {
  font-size: 15px;
  line-height: 1.7;
  margin: 14px 0;
}

.about-page .about-para {
  margin: 18px 0;
}

.about-page ul { padding-left: 24px; }

/* 「I wanna feedback, feedback!」 — BoA 노래 레퍼런스 시그니처 */
.about-feedback-en {
  font-family: 'Space Grotesk', 'Pretendard', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: 0.7em;
  color: var(--mustard-deep);
  letter-spacing: 0.02em;
  margin-left: 6px;
  white-space: nowrap;
}

/* 「권보아씨, BoA 해줘서 고맙습니다」 — 마지막 한 줄 강조 */
.about-thanks-final {
  margin-top: 28px !important;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-style: italic;
  font-weight: 700;
  color: var(--brown-deep);
  text-align: center;
  line-height: 1.6;
}

.year-title {
  font-family: 'Bungee', 'Pretendard', sans-serif;
  font-size: 80px;
  color: var(--brown);
  letter-spacing: -0.03em;
}

.year-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  font-family: 'Major Mono Display', monospace;
  font-size: 13px;
}

.year-nav a, .year-nav span {
  padding: 4px 10px;
  border-radius: 4px;
  background: white;
  color: var(--text);
}

.year-nav .year-active {
  background: var(--brown);
  color: var(--mustard);
}

.song-page-title {
  font-size: 36px;
  color: var(--brown);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray);
  font-size: 16px;
}

/* === Footer === */

.site-footer {
  background: var(--brown);
  color: var(--cream);
  padding: 40px 24px;
  margin-top: 80px;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  font-size: 18px;
  font-weight: 900;
  color: var(--mustard);
  margin: 0 0 6px;
}

.footer-tagline {
  font-family: 'Major Mono Display', monospace;
  font-size: 12px;
  color: var(--mustard);
  opacity: 0.8;
  margin: 0 0 20px;
}

.footer-legal {
  font-size: 12px;
  color: var(--cream);
  opacity: 0.8;
  max-width: 700px;
  margin: 0 auto 12px;
  line-height: 1.6;
}

.footer-contact {
  margin-left: 6px;
  white-space: nowrap;
}

.footer-contact a {
  color: var(--cream);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.footer-meta {
  font-size: 11px;
  color: var(--cream);
  opacity: 0.5;
  font-family: 'Major Mono Display', monospace;
}

/* === 모바일 반응형 === */

@media (max-width: 768px) {
  main { padding: 0 14px; }
  .header-inner { padding: 12px 14px; }
  .brand-text { font-size: 18px; }
  .site-nav { gap: 14px; font-size: 13px; }

  .hero {
    padding: 44px 20px 36px;
    margin: 20px 0;
  }
  .hero-tagline { margin-bottom: 20px; }

  .dial-wrap { padding: 20px 14px; }
  .era-line { gap: 6px; }
  .era { padding: 8px 4px; }
  .era-icon { width: 42px; height: 42px; margin-bottom: 4px; }
  .era-label { font-size: 10px; letter-spacing: 0.02em; }
  .era-years { font-size: 9px; }
  .slider-year { font-size: 40px; }
  .mark-label { font-size: 9px; }

  .clips-grid, .today-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

  .section-header h1, .section-header h2 { font-size: 22px; }

  .year-title { font-size: 56px; }
  .song-page-title { font-size: 26px; }
  .clip-song { font-size: 26px; }

  .clip-facts {
    grid-template-columns: 80px 1fr;
    gap: 6px 14px;
  }

  .event-row {
    grid-template-columns: 100px 1fr;
    gap: 12px;
  }
}

/* === GIF Action Sheet (모바일 long-press 저장/공유) === */

.gif-action-sheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  pointer-events: none;
}

.gif-action-sheet.open {
  display: block;
  pointer-events: auto;
}

.gas-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 20, 16, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  animation: gas-fade-in 0.2s ease-out forwards;
}

.gas-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--cream);
  border-top: 4px solid var(--brown);
  border-radius: 16px 16px 0 0;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 36px rgba(26, 20, 16, 0.25);
  transform: translateY(100%);
  animation: gas-slide-up 0.25s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
  max-width: 480px;
  margin: 0 auto;
}

.gas-title {
  font-family: 'Pretendard', sans-serif;
  font-weight: 900;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.gas-sub {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 18px;
}

.gas-btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 2px solid var(--brown);
  border-radius: 10px;
  background: var(--white);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, transform 0.05s;
}

.gas-btn:active {
  transform: scale(0.98);
  background: var(--cream-deep);
}

.gas-save {
  background: var(--mustard);
  border-color: var(--brown);
}

.gas-share {
  background: var(--white);
}

.gas-cancel {
  background: transparent;
  border-color: var(--border);
  color: var(--text-soft);
  font-weight: 500;
  margin-bottom: 0;
}

.gas-status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-soft);
  text-align: center;
  min-height: 18px;
}

body.gas-open {
  overflow: hidden;
}

@keyframes gas-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes gas-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* 데스크탑(태블릿 이상): 시트 대신 중앙 모달 */
@media (min-width: 640px) and (pointer: fine) {
  .gas-panel {
    bottom: auto;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    border-radius: 14px;
    border: 2px solid var(--brown);
    width: 360px;
    animation: gas-fade-in 0.2s ease-out forwards;
  }
}

/* === 🚀 Phase 2 BApal 섹션 — 슬라이더 마지막 연도 "현재진행형" ===
   기존 .clips-grid / .clip-card 와 동일 사이즈 (minmax 280, gap 16, aspect-ratio 4/3) */
.bapal-section {
  display: none;
  padding: 4rem 1rem 5rem;
}
.bapal-section.visible {
  display: block;
  animation: bapal-fade-in 0.6s ease-out forwards;
}
@keyframes bapal-fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bapal-section .section-header {
  text-align: center;
  margin-bottom: 2rem;
}
.bapal-section h2 {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
.bapal-section .section-sub {
  font-size: 0.95rem;
  color: var(--text-300, #666);
  margin: 0;
}
.bapal-grid {
  /* 🚀 기존 .clips-grid 와 정확히 동일 */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.bapal-card {
  /* 🚀 기존 .clip-card 와 동일 스타일 */
  display: block;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  text-decoration: none !important;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.bapal-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(122, 77, 43, 0.18);
  border-color: var(--brown);
}
.bapal-thumb-wrap {
  position: relative;
  width: 100%;
  /* 🚀 기존 .clip-video 와 동일 4:3 */
  aspect-ratio: 4 / 3;
  background: var(--black);
  overflow: hidden;
}
.bapal-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bapal-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}
.bapal-card:hover .bapal-play-icon {
  opacity: 1;
}
.bapal-meta {
  /* clip-overlay 와 동일 — 영상 위 floating overlay (gradient + 정보) */
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 10px 8px;
  background: linear-gradient(180deg,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.55) 70%,
    rgba(0,0,0,0.82) 100%);
  color: var(--white);
}
.bapal-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.2rem;
}
.bapal-date {
  font-size: 0.75rem;
  opacity: 0.85;
}
.bapal-footer {
  text-align: center;
  margin: 2rem 0 0;
}
.bapal-footer a {
  color: var(--brown, #7A4D2B);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.bapal-footer a:hover {
  text-decoration: underline;
}
@media (max-width: 640px) {
  .bapal-section { padding: 3rem 1rem 4rem; }
  .bapal-section h2 { font-size: 1.4rem; }
}
