html, body {
  margin: 0;
  padding: 0;

  /* iframe 안쪽도 스크롤 차단 */
  overflow: hidden;
  width: 100%;
  height: 100%;
}


/* 선택 사항: 로딩 스피너 */
#waveform_loader::before{
  content:"";
  width:18px;height:18px;border:2px solid rgba(255,255,255,.35);
  border-top-color:#fff;border-radius:50%;
  margin-right:8px; display:inline-block;
  animation:spin .7s linear infinite; vertical-align:middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

body { padding-bottom: 72px; }

/* 모바일 padding 확보 */
@media (max-width: 720px) {
  body { padding-bottom: 120px; }
  #bottom_player_waveform { height: 36px; }
}

#bottom_player {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 72px;
  background: #111;
  border-top: 1px solid #222;
  display: flex;
  align-items: center;
  /* justify-content: space-between; ← ❌ 이거 없애거나 override 해야 함 */
  padding: 10px 16px;
  font-family: Arial, sans-serif;
  z-index: 99;
  width: 100%;
  box-sizing: border-box;
  color:#fff;
}


/* body padding-bottom으로 스크롤 안덮게 */
body { padding-bottom: 72px; }

.bottom_player_left {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* 왼쪽 정렬 */
  gap: 12px;
  max-width:500px;
  min-width:400px;
}

#bottom_player_cover {
  width: 56px; height: 56px;
  border-radius: 4px;
  object-fit: cover;
}
.bottom_player_info { color: #fff; font-size: 13px; }

#bottom_player_title {
  font-weight: 700;
  font-size: 15px;
  color: #fff;

  display: -webkit-box;
  -webkit-line-clamp: 2;   /* 최대 2줄 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;     /* 여러 줄 허용 */
  line-height: 1.4;        /* 줄 간격 조정 */
  max-height: calc(1.4em * 2); /* 두 줄까지만 높이 제한 */
}

#bottom_player_artist { color: #aaa; font-size: 12px; margin-top: 2px; }
#bottom_player_meta { color: #bbb; font-size: 11px; margin-top: 2px; }

.bottom_player_center {
  flex: 1;
  margin: 0 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.bottom_player_time {
  color: #fff;
  font-size: 12px;
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
}
#bottom_player_waveform {
  width: 100%;
  height: 48px;
}

.bottom_player_right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.bottom_player_price {
  min-width: 72px; height: 32px; line-height: 32px;
  text-align: center;
  border-radius: 4px; border: 0;
  background: #f06a95; color: #fff;
  font-weight: 900; font-size: 13px;
  cursor: pointer;
}
.bottom_player_controls {
  display: flex; align-items: center; gap: 6px;
}
.bottom_player_controls button {
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;   /* 수직 중앙 */
  justify-content: center; /* 수평 중앙 */
  line-height: 0;        /* 글자 기준 라인 없애기 */
  color: #fff;
  font-size: 18px;
}

.bottom_player_add {
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bottom_player_add svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.bottom_player_volume_wrap {
  position: relative;
  display: flex;
  align-items: center;
}
#bottom_player_btn_volume {
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  color: #fff;
  font-size: 18px;
}

/* 볼륨 팝업 */
/* 팝업 박스 */
#bottom_player_volume_popup {
  display: none;
  position: absolute;
  bottom: 30px;   /* 버튼 바로 위 */
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  padding: 3px 6px;
  border-radius: 6px;
  z-index: 10001;
}

/* 공통 슬라이더 */
#bottom_player_volume {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 3px;
  outline: none;
  background: linear-gradient(
    to right,
    #ff0050 0%,
    #ff0050 var(--val, 100%),
    #444 var(--val, 100%),
    #444 100%
  );
}

/* WebKit (Chrome/Safari) */
#bottom_player_volume::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 3px;
}
#bottom_player_volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #ff0050;
  border-radius: 50%;
  cursor: pointer;
  margin-top: -4px; /* 트랙 중앙 맞추기 */
}

/* Firefox */
#bottom_player_volume::-moz-range-track {
  height: 4px;
  background: #444;
  border-radius: 3px;
}
#bottom_player_volume::-moz-range-progress {
  background: #ff0050;
  height: 4px;
  border-radius: 3px;
}
#bottom_player_volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #ff0050;
  border-radius: 50%;
  cursor: pointer;
}



#bottom_player_waveform.empty::before {
  content: "곡을 선택해 주세요";
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 12px;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    to right,
    #333,
    #333 2px,
    transparent 2px,
    transparent 4px
  );
}

#waveform_loader {
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  color: #fff;
  font-size: 14px;
  z-index: -1111;
}



#playlist_popup {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  background: #1a1a1a;
  color: #fff;
  overflow-y: auto;
  border-top: 1px solid #333;
  z-index: 10000;
  transform: translateY(100%);  /* 숨김 */
  transition: transform 0.3s ease-out;
}
/* 데스크탑 */
#playlist_popup.open {
  position: absolute;
  transform: translateY(-92px);
  max-height: 400px;
  bottom: 0;
}



#modal_loader {
  display: none;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 10;
}

#modal_loader::after {
  content: "";
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top: 4px solid #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* 📱 모바일 전용 */
@media (max-width: 720px) {
  #playlist_popup.open {
    transform: translateY(-197px);
    max-height: 400px;
    bottom: -150px;
  }
}

/* 모바일 전용: 최종 오버라이드 */
@media (max-width: 720px) {
  #bottom_player {
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    height: auto;
  }

  /* 첫 줄: info(left) + controls(right) */
  .bottom_player_right {
    display: flex;
    align-items: center;
  }

  .bottom_player_left {
    display: flex;
    align-items: center;
	width:100%;
  }

  .bottom_player_left {
    flex: 1;
    gap: 8px;
    min-width: 0;
  }
  .bottom_player_right {
    flex-shrink: 0;
    gap: 6px;
  }

  /* 두 번째 줄: waveform + time */
  .bottom_player_center {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  #bottom_player_waveform {
    flex: 1;
    height: 32px;
  }
  .bottom_player_time {
    flex-shrink: 0;
    font-size: 12px;
    color: #fff;
    margin-left: 8px;
    margin-bottom: 0;
  }

  /* 크기 축소 */
  #bottom_player_cover { width: 42px; height: 42px; }
  .bottom_player_controls button { width: 28px; height: 28px; font-size: 16px; }
}



@media (max-width: 720px) {
  #bottom_player {
    display: none !important;  /* PC용 강제 숨김 */
  }
  #bottom_player_mo {
    display: flex !important;  /* 모바일용 강제 표시 */
  }
}


#bottom_player, #bottom_player_mo {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #111; 
  color: #fff; 
  border-top: 1px solid #222;
  z-index: 99; 
  font-family: Arial, sans-serif;
}

/* PC/모바일 표시 전환 */
.pc-only { display: block; }
.mo-only { display: none; }

@media (max-width: 720px) {
  .pc-only { display: none; }
  .mo-only { display: block; }


.mo-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}

/* 원형 버튼 */
.play-circle {
  position: relative;
  width: 40px; height: 40px;
  border: none;
  background: transparent;
  flex-shrink: 0;
}
.play-circle .play-progress {
  width: 40px;
  height: 40px;
  transform: rotate(-90deg);
}
.ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.15);
  stroke-width: 3;
}
.ring-fg {
  fill: none;
  stroke: #ff0050;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 126 126; /* 2πr (r=20) */
  stroke-dashoffset: 126;
  transition: stroke-dashoffset .05s linear;
}
.play-circle .play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  margin-left:14px;
  margin-top:2px;
}



/* 오른쪽 컨트롤 */

.mo-right button {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
}

/* 모바일 전용 */
@media (max-width: 720px) {
  .mo-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
  }

  .mo-info {
    flex: 1;
    min-width: 0;
    margin-left: 0px;
  }
  .mo-info .title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mo-info .artist {
    font-size: 12px;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mo-right {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
  }
}


/* 모바일 볼륨 버튼 */
.mo-volume-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
#btn_volume_mo {
  background: none;
  border: none;
  cursor: pointer;
  width: 28px; height: 28px;
  color: #fff;
  font-size: 16px;
}

/* 볼륨 팝업 */
#volume_popup_mo {
  display: none;
  position: absolute;
  bottom: 28px; /* 버튼 위 */
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  padding: 3px 6px;
  border-radius: 6px;
  z-index: 10001;
}
#volume_mo {
  width: 70px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 3px;
  outline: none;
  background: linear-gradient(
    to right,
    #ff0050 0%,
    #ff0050 var(--val, 100%),
    #444 var(--val, 100%),
    #444 100%
  );
}
/* WebKit */
#volume_mo::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  background: #ff0050;
  border-radius: 50%;
  cursor: pointer;
  margin-top: -4px;
}
/* Firefox */
#volume_mo::-moz-range-thumb {
  width: 12px; height: 12px;
  background: #ff0050;
  border-radius: 50%;
  cursor: pointer;
}



/* ========================
   PC 전용 플레이어
======================== */
#bottom_player {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 72px;
  /* ✨ 네온틱 그라데이션 배경 */
  background: linear-gradient(135deg, #5a0c1a 0%, #1a1a1a 20%, #2c003e 75%, #5a0c1a 100%);
  border-top: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  padding: 10px 16px;
  font-family: Arial, sans-serif;
  z-index: 99;
  width: 100%;
  box-sizing: border-box;

  /* 블러 유리 느낌 */
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff;
}

/* 트랙 타이틀 → 그라데이션 텍스트 */
#bottom_player_title {
  font-weight: 700;
  font-size: 15px;
  background: linear-gradient(90deg, #ff8a00, #ff0050);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.4;
  max-height: calc(1.4em * 2);
  overflow: hidden;
}

/* 아티스트/메타 */
#bottom_player_artist { color: rgba(255,255,255,0.7); font-size: 12px; }
#bottom_player_meta { color: rgba(255,255,255,0.5); font-size: 11px; }

/* 컨트롤 버튼 hover 효과 */
.bottom_player_controls button {
  transition: transform 0.15s ease, color 0.15s ease;
}
.bottom_player_controls button:hover {
  transform: scale(1.2);
  color: #ff0050;
}

/* 볼륨 팝업도 유리 느낌 */
#bottom_player_volume_popup {
  background: rgba(20,20,20,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
}

/* ========================
   📱 모바일 전용 플레이어
======================== */
@media (max-width: 720px) {
  #bottom_player_mo {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 64px;
      background: linear-gradient(135deg, #5a0c1a 0%, #1a1a1a 20%, #2c003e 75%, #5a0c1a 100%);
    border-top: 1px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    padding: 6px 8px;
    z-index: 100;
    font-family: Arial, sans-serif;

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  /* 제목 → 네온 텍스트 */
  .mo-info .title {
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(90deg, #ff8a00, #ff0050);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  .mo-info .artist {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
  }

  /* 버튼 hover */
  .mo-right button,
  #btn_play_mo {
    transition: transform 0.15s ease, color 0.15s ease;
  }
  .mo-right button:hover,
  #btn_play_mo:hover {
    transform: scale(1.15);
    color: #ff0050;
  }

  /* 원형 링 → 그라데이션 */
  .ring-fg {
    stroke: url(#gradRing);
  }

/* 배경 링 */
.ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.15);
  stroke-width: 3;
}

/* 진행 링 */
.ring-fg {
  fill: none;
  stroke: #ff0050;             /* 원하는 색 */
  stroke-width: 3;
  stroke-linecap: round;

  /* ⚡ 기본값은 꽉 찬 원 */
  stroke-dasharray: 126 126;   /* 2πr = 125.6 */
  stroke-dashoffset: 126;      /* 처음엔 안 보이게 */

  transition: stroke-dashoffset .05s linear;
}

}


/* 모바일일 때 제목/아티스트는 클릭 안 되게 */
@media (max-width: 768px) {
  #title_mo, #artist_mo {
    pointer-events: none;  /* 클릭 막기 */
  }

/* 모바일 모드 버튼 영역 (반복/셔플 세로 배치) */
/* 반복/셔플 버튼 묶음 */
.mo-mode-controls {
  display: flex;
  justify-content: center;
  align-items: center;   /* 가운데 정렬 */
  margin-right: 0px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 2px 0;
}

/* 버튼 크기 줄이기 */
.mo-mode-controls .mode-btn {
  width: 15px;
  height: 15px;
  font-size: 13px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  background: transparent;
  color: #aaa;
  margin: 2px 3px;
}

/* 활성화 */
.mo-mode-controls .mode-btn.active {
  color: #FF0050;
}

}
