/* Base */
:root {
  --bg: #0e0e11;
  --fg: #f5f5f7;
  --line: rgba(255, 255, 255, .12);
  --panel: rgba(255, 255, 255, .06);
  --panel2: rgba(255, 255, 255, .03);
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  padding-top: var(--stickybar-h, 0px);
  line-height: 1.6;
  scroll-behavior: smooth;
}

/* Utilities & Animations */
@keyframes pulse {
  0% {
    opacity: 0.6;
  }

  50% {
    opacity: 0.4;
  }

  100% {
    opacity: 0.6;
  }
}

.skeleton-pulse {
  animation: pulse 1.5s infinite ease-in-out;
}

/* Hero */
.hero {
  text-align: center;
  padding: 56px 16px;
  background: radial-gradient(circle at top, #2b2f77, #0e0e11 70%);
}

.hero h1 {
  font-size: 2.2rem;
  margin: 0 0 8px;
  font-weight: 700;
}

.hero p {
  font-size: 1rem;
  opacity: .85;
  margin: 0;
}

/* Sticky bar (always visible album nav + search) */
.stickybar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(14, 14, 17, .96), rgba(14, 14, 17, .86));
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
}

.sns-links {
  display: flex;
  gap: 8px;
  margin-right: 10px;
  /* 검색창과의 간격 */
}

/* SNS 버튼 스타일 (기존 버튼들과 통일감 있게) */
.sns-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 8px;
  /* 약간 둥근 사각형 */
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sns-btn:hover {
  background: rgba(255, 255, 255, .15);
  border-color: rgba(255, 255, 255, .4);
}

/* 모바일 대응 (화면 좁을 때 숨기거나 줄이기) */
@media (max-width: 600px) {
  /* display: none; 을 지우거나, 아래처럼 덮어쓰세요 */

  .sns-links {
    display: flex;
    /* 보이게 변경 */
    margin-left: auto;
    /* 오른쪽으로 밀어넣기 */
    gap: 4px;
    /* 간격을 조금 좁힘 */
  }

  /* 모바일에서는 버튼 글씨가 너무 크면 텍스트를 줄이거나 패딩을 줄임 */
  .sns-btn {
    padding: 6px 8px;
    font-size: 11px;
  }
}

.album-nav {
  flex: 1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: thin;
}

.album-nav::-webkit-scrollbar {
  height: 6px
}

.album-nav a {
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  /* Touchable area increased */
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
  background: rgba(255, 255, 255, .03);
  transition: background .15s ease;
}

.album-nav a:hover {
  background: rgba(255, 255, 255, .08);
}

.album-nav a.active {
  border-color: rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .12);
}

.search-wrap {
  flex: 0 0 auto
}

#search {
  width: min(420px, 42vw);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: #15151c;
  color: #fff;
  font-size: 14px;
}

@media (max-width: 600px) {
  #search {
    font-size: 16px;
  }

  /* Prevent iOS zoom */
}

#search:focus {
  outline: none;
  border-color: rgba(255, 255, 255, .35);
}

/* Search Highlights */
mark {
  background: rgba(255, 215, 0, 0.25);
  color: #fff;
  border-radius: 4px;
  padding: 0 2px;
}

/* Buttons */
.iconbtn {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  transition: background .15s ease;
}

.iconbtn:hover {
  background: rgba(255, 255, 255, .10);
}

.iconbtn-close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

/* Drawer */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 1100;
}

.backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 12px;
  left: 12px;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: rgba(14, 14, 17, .96);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
  transform: translateY(-6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 1200;
}

.drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 6px;
}

.drawer-title {
  font-weight: 700;
  font-size: 14px;
  margin: 0;
}

.drawer-sub {
  opacity: .7;
  font-size: 12px;
  padding: 0 14px 10px;
  margin: 0;
}

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 14px 14px;
}

.drawer-links a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .03);
  color: #fff;
  text-decoration: none;
  line-height: 1.25;
  transition: background .15s ease;
}

.drawer-links a:hover {
  background: rgba(255, 255, 255, .08);
}

.drawer-links a.active {
  border-color: rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .12);
}

/* Album sections */
.album {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 16px 40px;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.album-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}

.cover {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .03);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cover:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}

.info-col h2 {
  font-size: 1.5rem;
  margin: 0 0 10px;
  font-weight: 600;
}

.meta {
  font-size: 13px;
  opacity: .75;
  margin-bottom: 12px;
  line-height: 1.5;
}

.meta div {
  margin-bottom: 4px;
}

.album-concept {
  margin: 12px 0 16px;
}

.album-concept .ko {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 500;
  color: #e1e1e6;
  /* 밝은 회색 (가독성 UP) */
  line-height: 1.5;
}

.album-concept .en {
  margin: 0;
  font-size: 13px;
  color: #a1a1aa;
  /* 조금 더 어두운 회색 (보조 설명 느낌) */
  font-style: italic;
  /* 영문은 이탤릭체로 감성 더하기 */
  line-height: 1.4;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

/* Tracklist - 2줄 구조 */
.tracklist {
  margin-top: 16px;
}

.track {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, .14);
  font-size: 14px;
  position: relative;
}

.track-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 500;
}

.track-main .no {
  opacity: .6;
  font-size: 13px;
  min-width: 28px;
}

.track-main .title {
  flex: 1;
}

.track-main .subtitle {
  opacity: .75;
  font-weight: 400;
}

.track-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 36px;
  font-size: 12px;
}

.track-sub .isrc {
  font-family: monospace;
  opacity: .65;
  margin-right: 4px;
}

.track-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: background .15s ease, transform .08s ease;
}

.tbtn:hover {
  background: rgba(255, 255, 255, .10);
}

.tbtn:active {
  transform: translateY(1px);
}

.tbtn-secondary {
  background: rgba(255, 255, 255, .02);
  border-color: rgba(255, 255, 255, .10);
}

/* 키보드 탭과 마우스 클릭 모두 적용 */
.tbtn:focus,
.sns-btn:focus {
  /* 1. 흰색 테두리: 검은색 배경과 훌륭한 대비 제공 */
  outline: 2px solid #ffffff;
  /* 2. 외곽선과 버튼 사이의 간격을 두어 시인성 향상 */
  outline-offset: 3px;
  /* 3. (선택) 시각적으로 더 강조하고 싶다면 부드러운 그림자 추가 */
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
  /* 4. 부드러운 전환 효과 (선택 사항) */
  transition: outline-color 0.2s ease, box-shadow 0.2s ease;
}

.track.playing {
  background: rgba(255, 255, 255, .06);
  border-radius: 12px;
  padding-left: 10px;
  padding-right: 10px;
  position: relative;
}

.track.playing::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .85);
}

.album-player,
.track-player {
  padding: 10px 0 16px;
  border-bottom: 1px dashed rgba(255, 255, 255, .18);
}

.player-inner {
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 14px;
  padding: 10px;
}

.player-inner iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
}

.player-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.album.playing h2 {
  text-decoration: underline;
  text-underline-offset: 6px;
}

.back-top {
  margin-top: 16px;
  font-size: 13px;
  opacity: .7;
}

.back-top a {
  color: #fff;
  text-decoration: none;
}

.back-top a:hover {
  text-decoration: underline;
}

/* Floating Back To Top Button */
.btn-back-to-top {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom) + 24px);
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.3s ease;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-back-to-top:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Footer */
footer {
  text-align: center;
  padding: 32px 16px;
  font-size: 12px;
  opacity: .6;
}

footer p {
  margin: 0;
}

/* Responsive */
@media (max-width: 820px) {
  .album-grid {
    grid-template-columns: 1fr;
  }

  #search {
    width: min(520px, 44vw);
  }
}

@media (max-width: 520px) {
  .stickybar {
    flex-wrap: wrap;
  }

  .album-nav {
    order: 3;
    flex-basis: 100%;
  }

  .search-wrap {
    width: 100%;
  }

  #search {
    width: 100%;
  }

  .track-sub {
    padding-left: 0;
  }

  .track-main .no {
    min-width: 24px;
  }
}