/* =========================
   Vinyl Player Skin - Gloss Wide (FULL)
   ========================= */

.bgm-vinyl {
  --vinyl-body: #5C4636;
  --vinyl-body-light: #8B7355;
  --vinyl-body-dark: #3D2D22;
  --vinyl-disc: #1a1a1a;
  --vinyl-groove: rgba(255,255,255,0.055);
  --vinyl-metal: #808080;
  --vinyl-metal-light: #C0C0C0;
  --vinyl-gold: #D4AF37;
  --vinyl-gold-light: #E4BF47;

  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  width: 280px;
  background: linear-gradient(
    180deg,
    rgb(from var(--container-bg-color) r g b / 30%) 0%,
    rgb(from var(--container-bg-color) r g b / 80%) 100%
  );
  border-radius: 12px;
  padding: 0;
  box-shadow:
    0 10px 40px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 -2px 0 rgba(0,0,0,0.2);
  z-index: 9999;
  font-family: var(--f-pre);
  transition: all var(--transition-base);
  transform: translateY(100px);
  opacity: 0;
  overflow: hidden;
}

.bgm-vinyl.show {
  transform: translateY(0);
  opacity: 1;
}

/* 최소화 */
.bgm-vinyl.minimized {
  width: 50px;
  height: 50px;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bgm-vinyl.minimized:hover { transform: scale(1.05); }
.bgm-vinyl.minimized .player-content { display: none; }
.bgm-vinyl.minimized .minimized-overlay { display: block; }

.bgm-vinyl.minimized::before {
  content: '\f8d9';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--accent-color);
}

.minimized-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  display: none;
}

/* 상단 2열 레이아웃 */
.vinyl-top-row {
  display: flex;
  padding: var(--spacing-md);
  gap: var(--spacing-sm);
  justify-content: space-between;
}

/* 좌측: 턴테이블 */
.turntable-area {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 디스크 */
.vinyl-disc {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #2a2a2a 0%, var(--vinyl-disc) 50%, #0a0a0a 100%);
  box-shadow: 0 4px 15px rgba(0,0,0,0.6);
  overflow: hidden; /* 광택 마스크 자연스럽게 */
}

/* ✅ 디스크 회전 */
.bgm-vinyl.playing .vinyl-disc {
  animation: vinyl-spin 2s linear infinite;
}
@keyframes vinyl-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ✅ 홈(그루브) */
.vinyl-grooves {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at center,
    transparent 0px,
    transparent 1px,
    var(--vinyl-groove) 1px,
    var(--vinyl-groove) 2px
  );
  z-index: 0;
}

/* ✅ 미세 노이즈(비닐 질감) */
.vinyl-disc::after{
  content:"";
  position:absolute;
  inset:8px;
  border-radius:50%;
  pointer-events:none;

  background-image: radial-gradient(rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: .18;
  mix-blend-mode: overlay;
  z-index: 1;
}

/* ✅ (중요) 기존 ::before 하이라이트는 안 씀 */
.vinyl-disc::before{ content:none !important; }

/* =========================
   ✅ 넓게 번지는 유광 반사 (빛은 화면 기준 “고정” 느낌)
   - 이 .vinyl-light는 .vinyl-disc “밖(형제)”에 있어야 예쁨
   ========================= */
/* ✅ CD 느낌 반사: 무지개(간섭광) + 유광띠 + 소프트 글로우 + 가장자리 마스크 */
.turntable-area .vinyl-light{



  position:absolute;
  width:160px;
  height:160px;
  left:50%;
  top:50%;
  transform: translate(-50%, -50%);
  border-radius:50%;
  pointer-events:none;
  overflow: hidden;
  border-radius: 50%;
  clip-path: circle(50% at 50% 50%);
  contain: paint;
  z-index: 6;                 /* ✅ 라벨 위 */
  mix-blend-mode: screen;

  /* ✅ 넓은 “빛띠” + 색이 섞이는 레이어 */
  background:
    /* (A) 컬러 리본: 넓게, 서로 겹치게 */
    linear-gradient(115deg,
      rgba(255,  0, 120, 0) 26%,
      rgba(255,  0, 120, .22) 40%,
      rgba(255,  0, 120, .16) 50%,
      rgba(255,  0, 120, 0) 66%
    ),
    linear-gradient(115deg,
      rgba(255, 200,   0, 0) 28%,
      rgba(255, 200,   0, .18) 42%,
      rgba(255, 200,   0, .12) 52%,
      rgba(255, 200,   0, 0) 68%
    ),
    linear-gradient(115deg,
      rgba( 80, 255, 160, 0) 30%,
      rgba( 80, 255, 160, .16) 44%,
      rgba( 80, 255, 160, .10) 54%,
      rgba( 80, 255, 160, 0) 70%
    ),
    linear-gradient(115deg,
      rgba( 80, 200, 255, 0) 32%,
      rgba( 80, 200, 255, .18) 46%,
      rgba( 80, 200, 255, .12) 56%,
      rgba( 80, 200, 255, 0) 72%
    ),
    linear-gradient(115deg,
      rgba(170,  80, 255, 0) 34%,
      rgba(170,  80, 255, .16) 48%,
      rgba(170,  80, 255, .10) 58%,
      rgba(170,  80, 255, 0) 74%
    ),

    /* (B) 가운데 백색 하이라이트(넓게) */
    linear-gradient(
      115deg,
      rgba(255,255,255,0) 36%,
      rgba(255,255,255,.22) 48%,
      rgba(255,255,255,.32) 50%,
      rgba(255,255,255,.22) 52%,
      rgba(255,255,255,0) 64%
    );

  /* 가장자리 소멸 */
  -webkit-mask-image: radial-gradient(circle,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 72%,
    rgba(0,0,0,0) 96%
  );
  mask-image: radial-gradient(circle,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 72%,
    rgba(0,0,0,0) 96%
  );

  opacity: .92;
  filter: blur(2.1px);
}


/* 유광 “숨결” + 아주 약한 드리프트(움직여서 더 살아있게) */
@keyframes gloss-breathe-wide{
  0%   { opacity: .42; filter: blur(1.4px); }
  50%  { opacity: .68; filter: blur(.85px); }
  100% { opacity: .42; filter: blur(1.4px); }
}

/* =========================
   라벨 / 썸네일
   ========================= */
.vinyl-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  z-index: 6;
}

.vinyl-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* 라벨: 프린트 링 + 종이 질감 */
.vinyl-label::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:50%;
  pointer-events:none;
  background:
    radial-gradient(circle,
      rgba(255,255,255,0) 0%,
      rgba(255,255,255,0) 58%,
      rgba(255,255,255,.35) 59%,
      rgba(255,255,255,.12) 62%,
      rgba(0,0,0,.22) 64%,
      rgba(0,0,0,0) 66%
    ),
    radial-gradient(circle at 30% 25%,
      rgba(255,255,255,.10) 0%,
      rgba(255,255,255,0) 55%
    );
  mix-blend-mode: overlay;
  opacity: .9;
}
.vinyl-label::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:50%;
  pointer-events:none;
  background-image:
    radial-gradient(rgba(0,0,0,.10) 1px, transparent 1px),
    radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 3px 3px, 4px 4px;
  opacity: .12;
  mix-blend-mode: multiply;
}

/* =========================
   가운데 구멍(스핀들)
   ========================= */
.vinyl-dot{
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  width:12px;
  height:12px;
  border-radius:50%;
  background: radial-gradient(circle at 35% 35%,
    rgba(255,255,255,.25) 0%,
    rgba(255,255,255,.08) 18%,
    rgba(0,0,0,.55) 45%,
    rgba(0,0,0,.95) 100%
  );
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,.12),
    inset 0 -3px 6px rgba(0,0,0,.9),
    0 1px 2px rgba(0,0,0,.6);
  z-index: 4;
}
.vinyl-dot::before{
  content:"";
  position:absolute;
  inset:-6px;
  border-radius:50%;
  background: radial-gradient(circle,
    rgba(255,255,255,.55) 0%,
    rgba(255,255,255,.12) 40%,
    rgba(0,0,0,.55) 70%,
    rgba(0,0,0,0) 72%
  );
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,.2),
    0 2px 6px rgba(0,0,0,.45);
}
.vinyl-dot::after{
  content:"";
  position:absolute;
  top:2px;
  left:3px;
  width:3px;
  height:3px;
  border-radius:50%;
  background: rgba(255,255,255,.35);
  filter: blur(.2px);
}

/* =========================
   우측 컬럼
   ========================= */
.vinyl-right-col {
  width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
}

.vinyl-side-buttons {
  display: flex;
  justify-content: center;
  gap: var(--spacing-xs);
}

.side-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: 0;
  color: var(--gray-400);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.side-btn:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
}

/* 톤암 */
.tonearm {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 60px;
  height: 80px;
  transform: rotate(-25deg);
  transform-origin: 45px 8px;
  transition: transform 0.5s ease;
  z-index: 5; /* 디스크/빛 위 */
}
.bgm-vinyl.playing .tonearm { transform: rotate(15deg); }

.tonearm-base {
  position: absolute;
  right: 8px;
  top: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--vinyl-metal-light) 0%, var(--vinyl-metal) 100%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.tonearm-arm {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 3px;
  height: 55px;
  background: linear-gradient(90deg, #A0A0A0 0%, var(--vinyl-metal-light) 50%, #A0A0A0 100%);
  border-radius: 2px;
}
.tonearm-head {
  position: absolute;
  right: 11px;
  top: 66px;
  width: 9px;
  height: 12px;
  background: linear-gradient(180deg, #909090 0%, #707070 100%);
  border-radius: 2px 2px 3px 3px;
}

/* PITCH */
.pitch-control {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.pitch-slider {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 8px;
  height: 90px;
  background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
  border-radius: 4px;
  -webkit-appearance: none;
  cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}
.pitch-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 10px;
  background: linear-gradient(180deg, var(--vinyl-metal-light) 0%, var(--vinyl-metal) 100%);
  border-radius: 3px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.speed-label {
  font-size: 7px;
  color: var(--gray-400);
  text-align: center;
  letter-spacing: 0.5px;
  margin-top: 4px;
}
.pitch-label {
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--gray-500);
  font-weight: 600;
}

/* =========================
   하단 영역
   ========================= */
.vinyl-bottom-row {
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
  background: linear-gradient(
    180deg,
    rgb(from var(--container-bg-color) r g b / 30%) 0%,
    rgb(from var(--container-bg-color) r g b / 80%) 100%
  );
}

.vinyl-track-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  background: var(--card-bg-color);
  border-radius: 4px;
}

.track-icon {
  color: var(--accent-color);
  font-size: 14px;
  flex-shrink: 0;
}
.track-text { flex: 1; min-width: 0; }

.track-title {
  color: var(--content-font-color);
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}
.track-artist {
  color: var(--secondary-color);
  font-size: 9px;
}

/* 컨트롤 */
.vinyl-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.vinyl-controls-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--spacing-sm);
}

.control-btn {
  background: transparent;
  border: none;
  color: var(--gray-500);
  font-size: 12px;
  cursor: pointer;
  padding: var(--spacing-xs);
  transition: all var(--transition-fast);
}
.control-btn:hover:not(:disabled) { color: var(--white); }
.control-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.control-btn.play-pause {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}
.control-btn.play-pause:hover {
  transform: scale(1.05);
  background: var(--btn-accent-bg);
  color: var(--btn-accent-text);
}

.control-btn.mode-btn {
  font-size: 11px;
  opacity: 0.5;
  position: relative;
}
.control-btn.mode-btn:hover { opacity: 0.8; }
.control-btn.mode-btn.active {
  opacity: 1;
  color: var(--accent-color);
}

.control-btn.list-btn { font-size: 11px; }

.repeat-one-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  font-size: 7px;
  font-weight: 700;
  color: var(--accent-color);
}

.volume-popup { display: none !important; }

/* 플레이리스트 */
.playlist-container {
  max-height: 100px;
  overflow-y: auto;
  background: rgba(0,0,0,0.4);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.playlist {
  list-style: none;
  padding: 0;
  margin: 0;
}
.playlist li {
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--gray-400);
  font-size: 11px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.turntable-area { position: relative; }

.vinyl-disc{
  position: relative;
  z-index: 1; /* 디스크는 빛보다 아래 */
}


.playlist li:last-child { border-bottom: none; }
.playlist li:hover { background: var(--btn-accent-bg); color: var(--btn-accent-text); }
.playlist li.current { background: var(--btn-primary-bg); color: var(--btn-primary-text); }

.playlist-container::-webkit-scrollbar { width: 3px; }
.playlist-container::-webkit-scrollbar-track { background: transparent; }
.playlist-container::-webkit-scrollbar-thumb { background: var(--gray-600); border-radius: 2px; }

.vinyl-disc::before { content: none !important; animation:none !important; }

@keyframes light-breathe-drift {
  0%{
    transform: translate(-50%, -50%) translateX(-2px) translateY(1px);
    opacity: .72;
    filter: blur(2.6px);
  }
  50%{
    transform: translate(-50%, -50%) translateX(3px) translateY(-1px);
    opacity: .96;
    filter: blur(1.8px);
  }
  100%{
    transform: translate(-50%, -50%) translateX(-2px) translateY(1px);
    opacity: .72;
    filter: blur(2.6px);
  }
}

.bgm-vinyl.playing .turntable-area .vinyl-light{
  animation: light-breathe-drift 4.4s ease-in-out infinite;
}

/* 스캔 1 */
.turntable-area .vinyl-light::before,
.turntable-area .vinyl-light::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:50%;
  pointer-events:none;

  /* CD 전체에 얹는 스캔 라인 */
  background:
    linear-gradient(115deg,
      rgba(255,255,255,0) 42%,
      rgba(255,255,255,.75) 50%,
      rgba(255,255,255,0) 58%
    ),
    linear-gradient(115deg,
      rgba(255,  0,120,0) 44%,
      rgba(255,  0,120,.22) 50%,
      rgba(255,  0,120,0) 56%
    ),
    linear-gradient(115deg,
      rgba( 80,200,255,0) 46%,
      rgba( 80,200,255,.18) 52%,
      rgba( 80,200,255,0) 58%
    );

  mix-blend-mode: screen;
  opacity: 0;

  /* 밖으로 안 튀게: transform 이동 대신 background 이동 */
  background-size: 220% 100%;
  background-position: 0% 50%;
}

/* 1차(강) */
.turntable-area .vinyl-light::before{
  filter: blur(1.1px);
}

/* 2차(잔상: 약 + 조금 더 퍼짐 + 채도 살짝 죽임) */
.turntable-area .vinyl-light::after{
  filter: blur(1.8px) saturate(.75);
}

/* 스캔 애니메이션 */
@keyframes scan-pass-strong{
  0%   { opacity:0;   background-position: 0% 50%; }
  6%   { opacity:1; }
  14%  { opacity:0;  background-position: 100% 50%; }
  100% { opacity:0;  background-position: 100% 50%; }
}

@keyframes scan-pass-trail{
  0%   { opacity:0;   background-position: 0% 50%; }
  6%   { opacity:.45; } /* ✅ 잔상은 최대치 낮게 */
  14%  { opacity:0;  background-position: 100% 50%; }
  100% { opacity:0;  background-position: 100% 50%; }
}

/* 적용: 2번째는 살짝 늦게 따라오게 */
.bgm-vinyl.playing .turntable-area .vinyl-light::before{
  animation: scan-pass-strong 6.8s ease-in-out infinite;
}
.bgm-vinyl.playing .turntable-area .vinyl-light::after{
  animation: scan-pass-trail 6.8s ease-in-out infinite;
  animation-delay: .35s;
}

.turntable-click{
  position: relative;
  width:160px;
  height:160px;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* 전체가 '띠용' */
@keyframes boing-3step {
  0%   { transform: scale(1); }
  30%  { transform: scale(.80); }  /* 작아졌다 */
  65%  { transform: scale(1.12); } /* 커졌다 */
  100% { transform: scale(1); }    /* 원본 */
}

.turntable-click.boing{
  animation: boing-3step 380ms cubic-bezier(.2,.9,.25,1);
  transform-origin: 50% 50%;
}

/* 클릭 시 강한 스캔 1회 */
@keyframes cd-flash-once {
  0%   { opacity: .3; filter: blur(1.4px); }
  40%  { opacity: 1;  filter: blur(.6px); }
  70%  { opacity: .8; }
  100% { opacity: .4; filter: blur(1.2px); }
}

/* 클릭 시 실행 */
.turntable-click.flash .vinyl-light{
  animation: cd-flash-once .9s ease-out;
}

@keyframes cd-flash-strong {
  0%   { opacity: .3; filter: blur(1.4px); }
  40%  { opacity: 1;  filter: blur(.5px); }
  70%  { opacity: .85; }
  100% { opacity: .45; filter: blur(1.2px); }
}
@keyframes cd-flash-weak {
  0%   { opacity: 0; }
  40%  { opacity: .6; }
  100% { opacity: .25; }
}


/* 강/약 플래시 정의 */
@keyframes cd-flash-strong {
  0%   { opacity: .3; filter: blur(1.4px); }
  40%  { opacity: 1;  filter: blur(.5px); }
  70%  { opacity: .85; }
  100% { opacity: .45; filter: blur(1.2px); }
}
@keyframes cd-flash-weak {
  0%   { opacity: 0; }
  40%  { opacity: .55; }
  100% { opacity: .25; }
}

/* ✅ 기존 애니메이션을 덮지 말고 "뒤에 추가" */
.bgm-vinyl.playing .turntable-click.flash-strong .vinyl-light{
  animation:
    light-breathe-drift 4.4s ease-in-out infinite,
    cd-flash-strong .8s ease-out 1;
}

.bgm-vinyl.playing .turntable-click.flash-weak .vinyl-light{
  animation:
    light-breathe-drift 4.4s ease-in-out infinite,
    cd-flash-weak .7s ease-out 1;
}

/* ✅ 만약 playing 아닐 때도 클릭 플래시가 보이게 하고 싶으면(옵션) */
.turntable-click.flash-strong .vinyl-light{
  animation: cd-flash-strong .8s ease-out 1;
}
.turntable-click.flash-weak .vinyl-light{
  animation: cd-flash-weak .7s ease-out 1;
}