/* ==========================================================================
   1. Root Variables & Reset
   ========================================================================== */
:root {
  color-scheme: light;
  --ink: #253044;
  --muted: #657187;
  --accent: #526d65;
  --line: #e4e7e9;
  --paper: #f8faf8;
}

* {
  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 #526d65;
  outline-offset: 2px;
}


/* ==========================================================================
   2. Main Layout & Container
   ========================================================================== */
.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 body {
  background: #fff;
}

.embedded .shell {
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.main {
  padding: 22px;
}


/* ==========================================================================
   3. Hero Banner Section
   ========================================================================== */
.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;
}


/* ==========================================================================
   4. Current Playing Card (Now Playing)
   ========================================================================== */
.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;
}

.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;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #465953;
  font-weight: 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;
}

.song h2 {
  margin: 3px 0;
  font-size: clamp(18px, 2.4vw, 25px);
  overflow-wrap: anywhere;
}

.song p {
  margin: 0;
  color: var(--muted);
}


/* ==========================================================================
   5. Player Controls & Timeline
   ========================================================================== */
.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: #edf3ef;
  color: #3c554d;
  border-color: #b7c9c0;
}

.controls .primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  min-width: 65px;
  font-size: 21px;
}

.controls .primary:hover {
  background: #3c554d;
  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. Track List & Lyrics Section
   ========================================================================== */
.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);
}

.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: 99px;
  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;
}

.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: #e6efea;
}

.list button:hover,
.list button[aria-current=true] {
  background: #e6efea;
}

.list button[aria-current=true] {
  font-weight: 700;
  color: #465953;
}

.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: #465953;
}

.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;
  position: absolute;
  inset: 18px 14px 18px 28px;
}


/* ==========================================================================
   7. Layout Variants (Content-Below / Classic Album)
   ========================================================================== */
.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;
}

.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;
}

.classic-album .now {
  min-height: 116px;
}

.classic-album .song h2 {
  font-size: clamp(19px, 2.5vw, 26px);
}


/* ==========================================================================
   8. Credits, Dialog & Utility
   ========================================================================== */
.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;
}

.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;
}


/* ==========================================================================
   9. Media Queries (Responsive Design)
   ========================================================================== */
@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;
  }
}


/* ==========================================================================
   10. Collection Player & Album Grid
   ========================================================================== */
.collection-player .hero {
  margin: 22px 22px 0;
  background: #fff;
  min-height: 0;
  border-radius: 12px;
  overflow: hidden;
}

.collection-player .hero img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
  background: #fff;
}

.collection-player .now {
  min-height: 124px;
}

.collection-player .panes {
  grid-template-columns: 1fr;
}

.collection-player .lyrics {
  min-height: 220px;
  padding: 16px 20px;
}

.collection-player .lyrics iframe {
  inset: 16px 20px;
  width: calc(100% - 40px);
  height: calc(100% - 32px);
}

.collection-panel {
  margin-top: 22px;
}

.collection-panel > header {
  gap: 12px;
  flex-wrap: wrap;
}

.collection-panel > header p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.collection-panel button.jump {
  border: 1px solid #cdd8d1;
  background: white;
  border-radius: 7px;
  padding: 5px 10px;
  color: #465953;
  font-size: 12px;
}

.album-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
}

.album-entry {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.album-entry.active {
  border-color: #789584;
  box-shadow: inset 4px 0 #465953;
  background: #f1f5f2;
}

.album-choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  padding: 13px 15px;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.album-choice:hover {
  background: #edf3ef;
}

.album-choice img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  flex: none;
  background: #f4f1eb;
  border-radius: 6px;
}

.album-choice strong {
  display: block;
  font-size: 14px;
  line-height: 1.5;
}

.album-choice small {
  display: block;
  margin: 4px 0;
  color: #465953;
}

.album-choice .teaser {
  display: block;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 6px;
}

.album-entry details {
  padding: 0 15px 12px;
}

.album-entry summary {
  font-size: 12px;
  color: #465953;
  cursor: pointer;
}

.album-entry details p {
  white-space: pre-line;
  font-size: 13px;
  line-height: 1.8;
  margin: 10px 0 0;
}

.group-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 16px 16px;
}

.group-buttons button {
  padding: 8px 12px;
  background: white;
  color: #465953;
  border: 1px solid #cdd8d1;
  border-radius: 8px;
  font-size: 13px;
}

.group-buttons button[aria-pressed=true] {
  background: #465953;
  color: white;
  border-color: #465953;
}

.biography {
  margin-top: 22px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.biography summary {
  font-size: 15px;
  font-weight: 700;
  color: #465953;
  cursor: pointer;
}

.bio-content {
  margin-top: 16px;
  line-height: 1.85;
  font-size: 14px;
}

.bio-content img {
  width: 160px;
  max-width: 40%;
  height: auto;
  float: left;
  margin: 0 18px 12px 0;
  border-radius: 8px;
}

.bio-content:after {
  content: "";
  display: block;
  clear: both;
}

.bio-content p {
  margin: 0 0 14px;
}

@media (max-width: 700px) {
  .collection-player .hero {
    margin: 16px 16px 0;
  }

  .collection-player .hero img {
    height: auto;
  }

  .album-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .collection-player .lyrics {
    min-height: 300px;
    padding: 12px;
  }

  .collection-player .lyrics iframe {
    inset: 12px;
    width: calc(100% - 24px);
    height: calc(100% - 24px);
  }

  .collection-player .now {
    min-height: 110px;
  }

  .group-buttons {
    gap: 6px;
  }

  .group-buttons button {
    padding: 8px;
    font-size: 12px;
  }

  .collection-panel > header p {
    width: 100%;
  }
}


/* ==========================================================================
   11. Lyrics Height Customization & Overview Panel
   ========================================================================== */
/* 해설창 높이 설정 */
.collection-player .lyrics {
  min-height: 360px;
}

#show-overview {
  border: 1px solid #cdd8d1;
  background: white;
  border-radius: 7px;
  padding: 5px 10px;
  color: #465953;
  font-size: 12px;
}

#show-overview[aria-pressed=true] {
  background: #edf3ef;
}

[hidden] {
  display: none !important;
}

.overview-panel {
  margin: 0;
}

.overview-panel header {
  gap: 10px;
  flex-wrap: wrap;
}
/*첫 화면 높이 조정하는 곳*/
.overview-body {
  height: 500px;
  padding: 16px 20px;
}

.overview-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #f8faf8;
}

@media (max-width: 700px) {
  .overview-body {
    height: 480px;
    padding: 12px;
  }
}
/*연주곡 해설 부분 높이*/
.collection-player .lyrics {
  height: 210px;
  min-height: 210px;
  flex: none;
}