/* 음악 탭, 하단 플레이어, 비주얼로 보기. 시안 v2 수치. 줄 맞춤은 상단 메뉴와 같은 폭(--wrap)이다. */
:root {
  --music-player-height: 76px;
  --music-accent: var(--accent, #16d0f0);
  --music-accent-d: var(--accent-d, #0084a8);
  --music-sunken: #dfe5e8;
}

/* 휴대폰 메뉴는 7칸 */
@media (max-width: 700px) {
  .gnb-nav {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }
  .gnb-tab-btn {
    font-size: 11px;
  }
  html[lang="ja"] .gnb-tab-btn,
  html[lang="ja"] .gnb-tab-btn .tab-text,
  html[lang="en"] .gnb-tab-btn,
  html[lang="en"] .gnb-tab-btn .tab-text {
    font-size: 10px;
    letter-spacing: -0.04em;
  }
}

/* 음악 화면 */
.shell-view-music {
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--paper);
}
.shell-view-music.stage-open {
  overflow: hidden;
}
.shell-view-music.stage-open > .music-page,
.shell-view-music.stage-open > .footer-unified {
  display: none;
}

.music-wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.music-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  height: 46px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.music-tab {
  display: flex;
  align-items: baseline;
  gap: 6px;
  height: 37px;
  margin-right: 32px;
  margin-bottom: -1px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-3);
  text-decoration: none;
  white-space: nowrap;
}
.music-tab em {
  font-style: normal;
  font-size: 13px;
  font-weight: 500;
}
.music-tab.on {
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--music-accent);
}
.music-tab.on em {
  color: var(--ink-2);
}
.music-ainote {
  margin-left: auto;
  display: flex;
  align-items: center;
  height: 37px;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}

.music-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 24px;
  padding: 12px 0 24px;
}
.music-empty {
  grid-column: 1 / -1;
  padding: 48px 0;
  text-align: center;
  font-size: 14px;
  color: var(--ink-3);
}

.song {
  min-width: 0;
  margin: 0;
}
.song-hit {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.song-cv {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  background: var(--music-sunken);
}
.song-cv img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.music-noart {
  position: absolute;
  left: 9px;
  bottom: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}
.song-ai {
  position: absolute;
  left: 5px;
  top: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 17px;
  border-radius: 2px;
  background: rgba(11, 18, 21, 0.82);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.song-t {
  margin: 8px 0 0;
  height: 20px;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.song-m {
  margin: 0;
  height: 18px;
  overflow: hidden;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-3);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.song.now .song-cv::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  box-shadow: inset 0 0 0 3px var(--music-accent);
}
.song-pz {
  display: none;
}
.song-pz svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.song.now .song-pz {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: var(--music-accent);
  color: var(--ink);
}
.song.now .song-m {
  color: var(--music-accent-d);
  font-weight: 600;
}

/* 하단 플레이어: 포털 틀 안의 한 줄이라 본문이 그만큼 줄어든다 */
.music-player {
  flex: none;
  position: relative;
  z-index: 800;
  height: var(--music-player-height);
  background: var(--paper);
  border-top: 1px solid var(--ink);
  color: var(--ink);
  line-height: 1.4;
  word-break: keep-all;
}
.music-player * {
  box-sizing: border-box;
}
.music-player svg {
  display: block;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.music-player button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
body.koxlo-game-tab .music-player {
  display: none;
}

.mp-pin {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: 16px;
  align-items: center;
  height: 75px;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}
.mp-now {
  grid-column: 1 / 3;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.mp-cv {
  flex: none;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--music-sunken);
}
.mp-cv img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mp-tx {
  flex: 1;
  min-width: 0;
}
.mp-t {
  height: 21px;
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  line-height: 21px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.mp-a {
  height: 17px;
  margin-top: 2px;
  overflow: hidden;
  font-size: 12px;
  line-height: 17px;
  color: var(--ink-3);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.mp-q {
  flex: none;
  display: flex;
  gap: 2px;
}
.music-player .mp-q-b {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 36px;
  border-radius: 4px;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 14px;
}
.mp-q-b b {
  font-weight: 700;
}
.mp-q-b i {
  font-style: normal;
  font-size: 10px;
  line-height: 12px;
  font-variant-numeric: tabular-nums;
}
.music-player .mp-q-b.on {
  background: var(--tint, #e7fafe);
  color: var(--ink);
}

.mp-ctl {
  grid-column: 3 / 4;
  display: flex;
  align-items: center;
  gap: 6px;
}
.music-player .mp-ic {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 42px;
  color: var(--ink-2);
}
.music-player .mp-ic.on {
  color: var(--music-accent-d);
}
.mp-ic.on::after {
  content: '';
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 5px;
  height: 2px;
  background: var(--music-accent);
}
.music-player .mp-rd {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 4px;
  background: var(--music-accent);
  color: var(--ink);
}

/* 4번째 칸부터: 시각화, 재생 위치, 음량, 비주얼로 보기 */
.mp-viz {
  grid-column: 4 / 5;
  grid-row: 1;
  display: flex;
  gap: 4px;
  width: 144px;
  height: 52px;
}
.mp-canvas {
  display: block;
  width: 118px;
  height: 52px;
  flex: none;
  cursor: pointer;
}
.mp-modes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 22px;
  flex: none;
}
.music-player .mp-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 24px;
  border-radius: 2px;
  color: var(--ink-3);
}
.music-player .mp-mode.on {
  background: var(--tint, #e7fafe);
  color: var(--ink);
}
.mp-seek {
  grid-column: 4 / 7;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-left: 160px;
  margin-right: 241px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.mp-seek span {
  flex: none;
  width: 34px;
}
.mp-seek span:last-child {
  text-align: right;
}
.mp-bar {
  position: relative;
  flex: 1;
  height: 4px;
  background: var(--line);
  cursor: pointer;
  touch-action: none;
}
.mp-bar::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  bottom: -10px;
}
.mp-bar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--music-accent);
  pointer-events: none;
}
.mp-bar b {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 12px;
  background: var(--ink);
  pointer-events: none;
}
.mp-vol {
  grid-column: 4 / 7;
  grid-row: 1;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-right: 138px;
  color: var(--ink-2);
}
.mp-vol .mp-bar {
  flex: none;
  width: 64px;
}
.music-player .mp-vzb {
  grid-column: 4 / 7;
  grid-row: 1;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 122px;
  height: 42px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}
.music-player .mp-vzb.act {
  background: var(--tint, #e7fafe);
  border-color: var(--music-accent-d);
}
.mp-vzb span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 비주얼로 보기 */
.music-stage {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.music-stage[hidden] {
  display: none;
}
.ms-head-wrap {
  flex: none;
}
.ms-head {
  position: relative;
  display: flex;
  align-items: center;
  height: 56px;
}
.ms-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  width: 290px;
  height: 38px;
  margin-right: 20px;
  padding: 0 8px 0 4px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.ms-pick img {
  display: block;
  flex: none;
  width: 48px;
  height: 30px;
  object-fit: cover;
}
.ms-pick span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ms-pick svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ms-presets {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 16px;
  min-width: 0;
  margin-right: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ms-presets::-webkit-scrollbar {
  display: none;
}
.ms-presets .pb-preset {
  flex: none;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.ms-presets .pb-preset.active {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--music-accent);
}
.ms-picker {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(var(--ms-picker-columns, 10), minmax(0, 1fr));
  gap: 10px 8px;
  padding: 12px;
  overflow-y: auto;
  border: 1px solid var(--line-2);
  background: var(--paper);
}
.ms-picker[hidden] {
  display: none;
}
.ms-tile {
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.ms-tile img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--line);
}
.ms-tile.on img {
  outline: 2px solid var(--music-accent);
  outline-offset: -2px;
}
.ms-tile b,
.ms-tile i {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ms-tile b {
  margin-top: 5px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
}
.ms-tile i {
  color: var(--ink-3);
  font-size: 12px;
  line-height: 16px;
  font-style: normal;
}
.ms-stage-wrap {
  flex: 1;
  min-height: 0;
  padding-bottom: 12px;
}
.ms-back {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  width: 170px;
  height: 38px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.ms-back svg,
.ms-full svg {
  display: block;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ms-full {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.ms-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 4px;
  background: #000;
}
.ms-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.ms-cap {
  position: absolute;
  left: 28px;
  top: 22px;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}
.ms-stage:fullscreen .ms-cap {
  display: none;
}
.ms-cap small {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
.ms-cap h2 {
  margin: 2px 0 0;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
}

@media (max-width: 1100px) {
  .music-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .mp-q-b i {
    display: none;
  }
  .music-player .mp-q-b {
    width: 40px;
  }
}

/* 플레이어를 한 줄에 다 넣을 수 없는 폭: 곡, 시각화 띠, 조작의 세 줄 */
@media (max-width: 960px) {
  :root {
    --music-player-height: 142px;
  }
  .mp-pin {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-rows: 60px 28px 52px;
    column-gap: 10px;
    height: 141px;
    padding: 0 16px;
  }
  .mp-now {
    display: contents;
  }
  .mp-cv {
    grid-column: 1;
    grid-row: 1;
    width: 44px;
    height: 44px;
    align-self: center;
  }
  .mp-tx {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }
  .music-player .mp-vzb {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    width: 112px;
    height: 38px;
    font-size: 12px;
  }
  .mp-viz {
    grid-column: 1 / 3;
    grid-row: 2;
    width: 100%;
    height: 28px;
    align-items: center;
    gap: 6px;
  }
  .mp-canvas {
    flex: 1;
    width: 0;
    min-width: 0;
    height: 24px;
  }
  .mp-modes {
    flex-direction: row;
    width: auto;
  }
  .music-player .mp-mode {
    display: none;
    width: 26px;
  }
  .music-player .mp-mode.on {
    display: flex;
  }
  .mp-q {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
    align-self: center;
  }
  .music-player .mp-q-b {
    width: 40px;
    height: 24px;
  }
  .mp-ctl {
    grid-column: 1 / 4;
    grid-row: 3;
    gap: 2px;
    margin-left: -8px;
  }
  .music-player .mp-rd {
    width: 40px;
    height: 40px;
  }
  .mp-seek {
    grid-column: 1 / 4;
    grid-row: 3;
    margin-left: 150px;
    margin-right: 0;
    gap: 6px;
    font-size: 11px;
  }
  .mp-seek span {
    width: 30px;
  }
  .mp-vol {
    display: none;
  }
  .ms-back span,
  .ms-full span {
    display: none;
  }
  .ms-back {
    width: 28px;
  }
}

@media (max-width: 700px) {
  .music-wrap {
    padding: 0 16px;
  }
  .music-tabs {
    height: 44px;
    justify-content: space-between;
  }
  .music-tab {
    margin-right: 0;
    font-size: 15px;
    flex: none;
  }
  .music-tab em,
  .music-ainote {
    display: none;
  }
  .music-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 10px;
    row-gap: 8px;
    padding-top: 8px;
  }
  .song-t {
    margin-top: 6px;
    height: 36px;
    font-size: 13px;
    line-height: 18px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .song-m {
    height: 16px;
    font-size: 12px;
    line-height: 16px;
  }
  .ms-head {
    flex-wrap: wrap;
    height: 88px;
    align-content: center;
    gap: 2px 8px;
  }
  .ms-pick {
    flex: 1;
    width: auto;
    min-width: 0;
    margin: 0;
  }
  .ms-presets {
    order: 5;
    flex: none;
    width: 100%;
    height: 34px;
    margin: 0;
    gap: 14px;
  }
  .ms-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .ms-tile b {
    display: -webkit-box;
    height: 36px;
    white-space: normal;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .ms-cap {
    left: 14px;
    top: 12px;
  }
  .ms-cap h2 {
    font-size: 20px;
  }
}

.card-floating-badges .song-ai {
  position: static;
}

@media (max-width: 700px) {
  html[lang="ja"] .mp-vzb {
    font-size: 12px;
  }
}
