@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

#songNameBox {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 4300;
  min-width: 210px;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  color: #fff;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(145deg, rgba(22, 20, 21, 0.94), rgba(7, 7, 8, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid rgba(225, 72, 82, 0.82);
  border-radius: 10px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

#songNameBox:hover {
  background: linear-gradient(145deg, rgba(29, 26, 27, 0.97), rgba(8, 8, 9, 0.96));
  border-color: rgba(225, 72, 82, 0.44);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

#songNameBox > div {
  min-width: 0;
}

.song-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #f7f7f8;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playing-now {
  display: block;
  margin-top: 4px;
  color: rgba(225, 72, 82, 0.92);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#songPauseBtn {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0 !important;
  color: #fff;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

#songPauseBtn:hover {
  background: rgba(225, 72, 82, 0.2);
  border-color: rgba(225, 72, 82, 0.42);
}

#songSelectModal {
  position: fixed;
  inset: 0;
  z-index: 4400;
  width: 100%;
  height: 100dvh;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 34px);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background: rgba(4, 4, 5, 0.7);
  border: 0;
  box-shadow: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-sizing: border-box;
}

#songSelectModal,
#songSelectModal * {
  box-sizing: border-box;
}

.song-select-panel {
  width: min(920px, 100%);
  height: min(640px, calc(100dvh - 48px));
  min-height: 360px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(24, 24, 26, 0.98), rgba(10, 10, 11, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.115);
  border-radius: 18px;
  box-shadow: 0 26px 82px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.song-select-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.song-select-heading {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.song-select-kicker {
  color: #e14852;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.song-select-title {
  margin: 0;
  overflow: hidden;
  color: #f7f7f8;
  font-size: clamp(18px, 2.1vw, 25px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-shadow: none;
  text-transform: none;
  white-space: nowrap;
}

.song-select-close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f3f3f4;
  font-size: 26px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.song-select-close:hover {
  color: #fff;
  background: rgba(225, 72, 82, 0.24);
  border-color: rgba(225, 72, 82, 0.42);
}

.song-select-container {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.8fr);
  overflow: hidden;
}

.song-select-list-wrap {
  min-width: 0;
  min-height: 0;
  display: grid;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.song-select-list {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(225, 72, 82, 0.65) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.song-select-list::-webkit-scrollbar {
  width: 8px;
}

.song-select-list::-webkit-scrollbar-thumb {
  background: rgba(225, 72, 82, 0.65);
  border-radius: 999px;
}

.song-select-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
}

.song-select-item {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #e8e8ea;
  font-size: 14px;
  font-weight: 560;
  line-height: 1.25;
  text-align: left;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 10px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.song-select-item:hover,
.song-select-item.active {
  color: #fff;
  background: rgba(225, 72, 82, 0.16);
  border-color: rgba(225, 72, 82, 0.42);
  text-shadow: none;
  transform: translateY(-1px);
}

.song-select-item-index {
  width: 30px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  text-align: right;
}

.song-select-item-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-select-extra {
  min-width: 0;
  min-height: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: clamp(18px, 3vw, 30px);
  text-align: center;
  background: rgba(255, 255, 255, 0.025);
}

.song-select-disc {
  width: min(168px, 42vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #f4f4f5 0 5px, #121214 6px 16px, transparent 17px),
    repeating-radial-gradient(circle, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px 9px),
    radial-gradient(circle, #29292d, #070708 68%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.75), 0 18px 44px rgba(0, 0, 0, 0.42);
  animation: diskDon 12s linear infinite;
}

.song-select-disc span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 30px;
  transform: translateY(-1px);
}

@keyframes diskDon {
  100% {
    transform: rotate(360deg);
  }
}

.song-select-description {
  max-width: 280px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.55;
}

.song-select-footer {
  padding: 12px 22px;
  background: rgba(0, 0, 0, 0.28);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.song-select-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-style: normal;
  line-height: 1.45;
}

@media (max-width: 820px) {
  #songSelectModal {
    align-items: flex-end;
    padding: 0;
  }

  .song-select-panel {
    width: 100%;
    height: min(86dvh, 720px);
    min-height: 420px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
  }

  .song-select-header {
    min-height: 66px;
    padding: 13px 16px;
  }

  .song-select-kicker {
    font-size: 9px;
    letter-spacing: 0.13em;
  }

  .song-select-title {
    font-size: 15px;
    font-weight: 650;
  }

  .song-select-container {
    grid-template-columns: minmax(0, 1fr) clamp(104px, 30vw, 150px);
    grid-template-rows: minmax(0, 1fr);
  }

  .song-select-list-wrap {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }

  .song-select-list {
    align-items: flex-start;
    gap: 7px;
    padding: 10px;
  }

  .song-select-item {
    width: min(100%, 440px);
    min-height: 40px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 520;
    border-radius: 8px;
    gap: 8px;
  }

  .song-select-item-index {
    width: 22px;
    font-size: 9px;
  }

  .song-select-extra {
    min-width: 0;
    min-height: 0;
    align-content: center;
    justify-items: center;
    gap: 10px;
    padding: 12px 10px;
    text-align: center;
    border-top: 0;
  }

  .song-select-disc {
    display: grid;
    width: min(92px, 24vw);
  }

  .song-select-description {
    max-width: 132px;
    display: -webkit-box;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
  }

  .song-select-footer {
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  }

  .song-select-note {
    font-size: 10px;
  }

  #songNameBox {
    top: max(12px, env(safe-area-inset-top));
    left: 12px;
    min-width: 0;
    min-height: 42px;
    max-width: min(280px, calc(100vw - 24px));
    gap: 9px;
    padding: 8px 10px 8px 12px;
    background: linear-gradient(145deg, rgba(18, 18, 20, 0.96), rgba(6, 6, 7, 0.94)), #09090a;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-left: 2px solid rgba(225, 72, 82, 0.76);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: none;
  }

  #songNameBox:hover {
    background: linear-gradient(145deg, rgba(22, 22, 24, 0.98), rgba(7, 7, 8, 0.96)), #09090a;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transform: none;
  }

  .song-title {
    max-width: 196px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.15;
  }

  .playing-now {
    margin-top: 3px;
    color: rgba(225, 72, 82, 0.9);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.12em;
  }

  #songPauseBtn {
    width: 30px;
    height: 30px;
    font-size: 10px;
    border-radius: 10px;
  }
}

@media (max-width: 420px) {
  .song-select-panel {
    height: min(88dvh, 720px);
    min-height: 390px;
  }

  .song-select-container {
    grid-template-columns: minmax(0, 1fr) 96px;
  }

  .song-select-title {
    font-size: 15px;
  }

  .song-select-close {
    width: 38px;
    height: 38px;
  }

  .song-select-item {
    min-height: 38px;
    padding: 7px 9px;
    font-size: 11.5px;
    grid-template-columns: minmax(0, 1fr);
  }

  .song-select-item-index {
    display: none;
  }

  .song-select-disc {
    width: 76px;
  }

  .song-select-description {
    max-width: 86px;
    font-size: 9px;
    -webkit-line-clamp: 6;
  }
}

@media (max-width: 380px) {
  #songNameBox {
    left: 9px;
    max-width: calc(100vw - 18px);
    padding: 7px 9px 7px 10px;
  }

  .song-title {
    max-width: 168px;
    font-size: 10.5px;
  }

  .playing-now {
    font-size: 7.5px;
  }

  #songPauseBtn {
    width: 28px;
    height: 28px;
  }
}

@media (max-height: 520px) {
  #songSelectModal {
    align-items: center;
    padding: 8px;
  }

  .song-select-panel {
    height: calc(100dvh - 16px);
    min-height: 0;
    border-radius: 14px;
  }

  .song-select-extra,
  .song-select-footer {
    display: none;
  }

  .song-select-container {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
  }
}
