/* ==========================================
   1. 기본 변수 및 글로벌 스타일
   ========================================== */
:root {
  color-scheme: light;
  --ink: #253044;
  --muted: #657187;
  --accent: #a93b41;
  --line: #e4e7e9;
  --paper: #fffaf5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f4f0eb;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Malgun Gothic", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid #a93b41;
  outline-offset: 2px;
}

/* ==========================================
   2. 레이아웃 프레임 (Shell)
   ========================================== */
.shell {
  max-width: 1060px;
  margin: 24px auto;
  background: white;
  border: 1px solid #e8e0d8;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 40px #30251c12;
}

/* 아이프레임(Embedded) 환경 스타일 */
.embedded body {
  background: #fff;
}

.embedded .shell {
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* ==========================================
   3. 상단 헤더 / 배너 (Hero)
   ========================================== */
.hero {
  position: relative;
  background: #465953;
  min-height: 170px;
}

.hero img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}

.hero h1 {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 30px 25px 16px;
  color: white;
  font-family: Georgia, "Malgun Gothic", serif;
  font-size: clamp(22px, 3vw, 33px);
  background: linear-gradient(transparent, #465953f2);
}

.hero small {
  font: 500 13px system-ui, sans-serif;
  display: block;
  letter-spacing: 0.15em;
}

/* 클래식 앨범용 헤더 예외 처리 */
.classic-album .hero {
  min-height: 0;
  height: 200px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.classic-album .hero img {
  width: min(100%, 884px);
  height: auto;
  max-height: 200px;
  object-fit: contain;
}

.classic-album .hero h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  background: none;
}

/* ==========================================
   4. 현재 재생 정보 카드 (Now Playing)
   ========================================== */
.main {
  padding: 22px;
}

.now {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 18px 22px;
  background: linear-gradient(110deg, #edf3ef, #f9fbf9);
  border: 1px solid #dce7df;
  border-left: 5px solid #465953;
  border-radius: 15px;
}

.classic-album .now {
  min-height: 116px;
}

.art {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  background: #eee;
  display: block;
}

.art-button {
  border: 0;
  background: transparent;
  padding: 0;
  flex: none;
  border-radius: 12px;
}

.art-button:hover {
  filter: brightness(0.94);
}

.song {
  min-width: 0;
}

.song h2 {
  margin: 3px 0;
  font-size: clamp(18px,2.4vw,25px);
  overflow-wrap: anywhere;
}
/*제목 줄 폰트 크기*/
.classic-album .song {
  flex: 1;
  min-width: 0;
}

.classic-album .song h2 {
  font-size: clamp(16px, 2.4vw, 20px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}/*여기까지 두 번 바꿔야 함*/

.song p {
  margin: 0;
  color: var(--muted);
}

/*TRACK 01 / 10 부분 폰트 수정 */
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #465953;
  font-weight: 900; /*원래 700 */
}

/* 재생 중 표시 배지 */
.playing-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e0ebe3;
  color: #355048;
  font-size: 12px;
  font-weight: 700;
}

.playing-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #688d76;
}

.playing-badge.is-playing::before {
  background: #2d9a5b;
  box-shadow: 0 0 0 3px #2d9a5b25;
}

/* 크레딧 정보 */
.credits {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 12px;
  margin: 9px 0 0;
  font-size: 13px;
  color: #43594f;
}

.credits[hidden] {
  display: none;
}

.credits dt {
  font-weight: 700;
}

.credits dd {
  margin: 0;
}

/* ==========================================
   5. 재생 컨트롤러 및 슬라이더 (Controls)
   ========================================== */
/* 타임라인 바 */
.timeline {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 9px;
  align-items: center;
  margin: 19px 0 8px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.timeline span:last-child {
  text-align: right;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

/* 컨트롤 버튼들 */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
}

.controls button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  min-width: 44px;
  min-height: 44px;
  color: var(--ink);
}

.controls button:hover,
.controls button[aria-pressed="true"] {
  background: #f8e8e5;
  color: #842930;
  border-color: #d9a9a4;
}

/* 메인 재생 버튼 */
.controls .primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  min-width: 65px;
  font-size: 21px;
}

.controls .primary:hover {
  background: #842930;
  color: white;
}

/* 볼륨 조절 */
.volume {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 10px;
  color: var(--muted);
  font-size: 13px;
}

.volume input {
  width: 86px;
}

/* 상태 메시지 */
.status {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  min-height: 22px;
  margin: 8px 0 0;
}

/* ==========================================
   6. 2열 메인 패널 (트랙리스트 & 가사)
   ========================================== */
.panes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 22px;
  align-items: stretch;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--paper);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.panel h3 {
  margin: 0;
  font-size: 16px;
}

.panel header span {
  font-size: 12px;
  color: var(--muted);
}

/* 선택 액션 버튼 */
.selection-actions {
  display: flex;
  gap: 5px;
}

.selection-actions button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 3px 7px;
  font-size: 12px;
  color: var(--muted);
}

.selection-actions button:hover {
  background: #f5e8df;
}

/* 트랙 리스트 */
.list {
  list-style: none;
  padding: 5px;
  margin: 0;
}

.list button {
  display: grid;
  grid-template-columns: 23px 1fr;
  gap: 6px;
  text-align: left;
  align-items: center;
  width: 100%;
  padding: 5px 9px;
  min-height: 31px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
}

.track-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.track-check {
  width: 16px;
  height: 16px;
  margin: 0 0 0 9px;
  accent-color: var(--accent);
  flex: none;
  cursor: pointer;
}

.list .track-row button {
  flex: 1;
  min-width: 0;
  padding-left: 3px;
}

.list button:hover,
.list button[aria-current="true"] {
  background: #f5e8df;
}

.list button[aria-current="true"] {
  font-weight: 700;
  color: #8e3037;
}

.num {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.list .track-text {
  font-size: 13px;
  line-height: 1.3;
}

.list .track-artist {
  color: var(--muted);
  font-weight: 400;
}

.list button[aria-current="true"] .track-artist {
  color: #8e3037;
}

/* 가사 및 외부 창 (Lyrics / iframe) */
.lyrics {
  flex: 1;
  min-height: 0;
  padding: 18px 14px 18px 28px;
  background: white;
  position: relative;
}

.lyrics iframe {
  display: block;
  width: calc(100% - 42px);
  height: calc(100% - 36px);
  border: 0;
  overflow: hidden;
  position: absolute;
  inset: 18px 14px 18px 28px;
}

/* 하단 배치 모드 옵션 (.content-below) */
.content-below .panes {
  grid-template-columns: 1fr;
}

.content-below .lyrics {
  min-height: 652px;
  padding: 18px 24px;
}

.content-below .lyrics iframe {
  inset: 18px 24px;
  width: calc(100% - 48px);
  height: calc(100% - 36px);
}

.content-below .art {
  object-fit: contain;
  background: #f1f3f1;
}

/* ==========================================
   7. 팝업 모달 & 기타 기타 요소
   ========================================== */
.image-dialog {
  border: 0;
  border-radius: 15px;
  padding: 12px;
  background: white;
  max-width: calc(100vw - 30px);
  max-height: calc(100vh - 30px);
  box-shadow: 0 20px 60px #0006;
}

.image-dialog::backdrop {
  background: #161616bc;
}

.image-dialog img {
  display: block;
  max-width: min(900px, calc(100vw - 54px));
  max-height: calc(100vh - 110px);
  object-fit: contain;
}

.dialog-close {
  display: block;
  margin: 0 0 8px auto;
  border: 0;
  background: #f1ebe6;
  border-radius: 7px;
  padding: 6px 12px;
}

.empty {
  padding: 20px;
  color: var(--muted);
}

.note {
  font-size: 12px;
  color: var(--muted);
  margin: 16px 0 0;
}

/* ==========================================
   8. 반응형 및 모션 애니메이션
   ========================================== */
@media (max-width: 700px) {
  .shell {
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .main {
    padding: 16px;
  }

  .now {
    padding: 12px;
    gap: 12px;
  }

  .panes {
    grid-template-columns: 1fr;
  }

  .lyrics {
    min-height: 480px;
    padding: 14px 8px 14px 18px;
  }

  .lyrics iframe {
    inset: 14px 8px 14px 18px;
    width: calc(100% - 26px);
    height: calc(100% - 28px);
  }

  .content-below .lyrics {
    min-height: 652px;
    padding: 14px;
  }

  .content-below .lyrics iframe {
    inset: 14px;
    width: calc(100% - 28px);
    height: calc(100% - 28px);
  }

  .volume {
    width: 100%;
    justify-content: center;
    margin: 4px 0;
  }

  .hero {
    min-height: 150px;
  }

  .hero img {
    height: 150px;
  }

  .classic-album .hero {
    min-height: 0;
    height: auto;
  }

  .classic-album .hero img {
    height: auto;
  }

  .hero h1 {
    padding: 25px 16px 13px;
  }

  .art {
    width: 110px;
    height: 110px;
  }
}

/* 모션 감수성 설정 지원 */
@media (prefers-reduced-motion: no-preference) {
  button {
    transition: background 0.15s, color 0.15s;
  }
}

/* 소제목 설정 변경*/


#count {
  font-weight: 800;
}

#artist {
  color: #3498db;
  font-weight: 700;
}