/* Custom styling for Hoon Music */

.app-authenticated #appLockOverlay {
  display: none !important;
}

/* 레트로 LCD 및 디지털 화면용 조선굴림체 (ChosunGu 로컬 폰트) */
@font-face {
  font-family: 'ChosunGu';
  src: url('/static/fonts/ChosunGu.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ChosunGu';
  src: url('/static/fonts/ChosunGu.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NanumGothicCoding';
  src: url('/static/fonts/NanumGothicCoding-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NanumGothicCoding';
  src: url('/static/fonts/NanumGothicCoding-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

html, body {
  width: 100%;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 메인 탭 뷰 컨테이너 (스크롤바 완전 숨김) */
#mainContent {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#mainContent::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body.flip-mode-active {
  overflow: hidden !important;
  padding-bottom: 0 !important;
  height: 100%;
  min-height: 100%;
  width: 100%;
  position: fixed;
  inset: 0;
}

#flipCoverWidget {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  padding: 2vh 2.5vw !important;
}

/* 갤럭시 플립 커버 화면 전용 반응형 대형 폰트 & 터치 UI */
.flip-album-carousel {
  display: flex;
  align-items: stretch;
  gap: 1.6vw;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.4vh 0.4vw 1.1vh 0.4vw;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}

.flip-album-carousel.hidden {
  display: none !important;
}

.flip-album-carousel::-webkit-scrollbar {
  height: 4px;
}

.flip-album-card {
  scroll-snap-align: start;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 1.6vw;
  width: clamp(110px, 27vw, 165px);
  padding: 1vh 1.6vw;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.92);
  border: 2px solid rgba(51, 65, 85, 0.85);
  cursor: pointer;
  transition: all 0.15s ease;
}

.flip-album-card.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.45), rgba(225, 29, 72, 0.28));
  border-color: #818cf8;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.flip-album-thumb {
  width: clamp(38px, 8.8vw, 58px);
  height: clamp(38px, 8.8vw, 58px);
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.flip-album-title {
  font-size: clamp(14px, 3.1vw, 21px);
  font-weight: 800;
  line-height: 1.2;
  color: #ffffff;
}

.flip-album-sub {
  font-size: clamp(11px, 2.3vw, 16px);
  font-weight: 600;
  line-height: 1.2;
  color: #cbd5e1;
  margin-top: 2px;
}

.flip-selected-title {
  font-size: clamp(15px, 3.3vw, 22px);
  font-weight: 800;
}

.flip-toggle-album-btn {
  font-size: clamp(13px, 2.8vw, 19px);
  font-weight: 800;
  padding: 1.2vh 2.2vw;
  border-radius: 12px;
  line-height: 1.1;
}

.flip-action-btn {
  font-size: clamp(14px, 3vw, 20px);
  font-weight: 800;
  padding: 1.2vh 2.4vw;
  border-radius: 13px;
  line-height: 1.1;
}

.flip-action-icon {
  width: clamp(16px, 3.4vw, 24px);
  height: clamp(16px, 3.4vw, 24px);
}

.flip-track-row {
  padding: 1.6vh 2.6vw;
  border-radius: 15px;
  min-height: clamp(48px, 9.5vh, 72px);
}

.flip-track-num {
  font-size: clamp(14px, 3vw, 20px);
  font-weight: 800;
  width: clamp(22px, 4.8vw, 34px);
}

.flip-track-thumb {
  width: clamp(36px, 7.8vw, 54px);
  height: clamp(36px, 7.8vw, 54px);
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.flip-track-title {
  font-size: clamp(16px, 3.6vw, 25px);
  font-weight: 800;
  line-height: 1.25;
}

.flip-track-artist {
  font-size: clamp(13px, 2.7vw, 19px);
  font-weight: 600;
  line-height: 1.2;
}

.flip-now-thumb {
  width: clamp(42px, 9vw, 64px);
  height: clamp(42px, 9vw, 64px);
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.flip-now-title {
  font-size: clamp(16px, 3.5vw, 24px);
  font-weight: 800;
  line-height: 1.2;
}

.flip-now-artist {
  font-size: clamp(13px, 2.7vw, 19px);
  font-weight: 700;
  line-height: 1.2;
}

.flip-now-time {
  font-size: clamp(12px, 2.6vw, 18px);
  font-weight: 700;
}

.flip-ctrl-btn {
  height: clamp(54px, 11.5vh, 86px);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6vh;
}

.flip-ctrl-icon {
  width: clamp(22px, 4.6vw, 32px);
  height: clamp(22px, 4.6vw, 32px);
}

.flip-ctrl-label {
  font-size: clamp(13px, 2.9vw, 20px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* 이미지 주소가 비어 있을 때 대체 글자(alt)나 깨진 아이콘이 보이지 않도록 숨김 */
img[src=""], img:not([src]) {
  visibility: hidden;
}

/* Global overflow guard to prevent unwanted scrollbar flashes */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

#fullPlayerModal {
  overflow-x: hidden !important;
  background-color: #080c14 !important;
  opacity: 1 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#modalPlayerView {
  overflow-x: hidden !important;
}

/* Vinyl Record Player Styles */
@keyframes spin-record {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.vinyl-disc {
  position: relative;
  border-radius: 50%;
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.85), 0 0 0 2px rgba(255, 255, 255, 0.1), inset 0 0 15px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spin-record 16s linear infinite;
  animation-play-state: paused;
}

.vinyl-disc.playing {
  animation-play-state: running;
}

/* Vinyl concentric grooves & subtle sheen on the full album art */
.vinyl-sheen-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 20%, rgba(255, 255, 255, 0.05) 21%, transparent 22%, transparent 40%, rgba(255, 255, 255, 0.04) 41%, transparent 42%, transparent 65%, rgba(255, 255, 255, 0.05) 66%, transparent 67%, rgba(0,0,0,0.2) 98%, rgba(0,0,0,0.5) 100%),
              conic-gradient(from 45deg, rgba(255, 255, 255, 0.12) 0deg, transparent 60deg, rgba(255, 255, 255, 0.12) 180deg, transparent 240deg, rgba(255, 255, 255, 0.12) 360deg);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
}

/* Center spindle ring & hole */
.vinyl-center-hole {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, #cbd5e1 0%, #64748b 60%, #334155 100%);
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 2px 8px rgba(0,0,0,0.6), inset 0 1px 2px rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.vinyl-center-pin {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0f172a;
  border: 1.5px solid #1e293b;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.9);
}

/* Technics Style Turntable Deck & Shorter Single-Bend J-Arm */
.tonearm-container {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 90px;
  height: 215px;
  pointer-events: none;
  z-index: 30;
}

.tonearm-base {
  position: absolute;
  top: 2px;
  left: 31px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #94a3b8 0%, #475569 55%, #0f172a 100%);
  border: 2px solid #64748b;
  box-shadow: 0 8px 18px rgba(0,0,0,0.7), inset 0 2px 4px rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tonearm-base-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.6);
}

.tonearm-pivot-joint {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f1f5f9 0%, #94a3b8 60%, #334155 100%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.tonearm-rod {
  position: absolute;
  top: 0px;
  left: 0px;
  width: 90px;
  height: 215px;
  transform-origin: 55px 26px; /* 정확한 피벗 중심축 */
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  transform: rotate(0deg); /* 대기 상태 (거치대 안착) */
}
}

/* SVG 톤암 그룹 회전은 app.js에서 transform 속성(rotate(각도 440 115))으로 직접 제어 */

/* transition 클래스가 없을 때 즉각적인 각도 변경 지원 */
.tonearm-rod.no-transition {
  transition: none !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.8);
}

/* Tab default and active states */
.nav-tab {
  color: #cbd5e1; /* 기본 은은한 화이트/슬레이트 */
}

.nav-tab i,
.nav-tab svg {
  color: #cbd5e1;
  transition: all 0.2s ease-in-out;
}

.nav-tab.active {
  color: #818cf8 !important; /* 활성화된 탭만 인디고 컬러 강조 */
}

.nav-tab.active i,
.nav-tab.active svg {
  color: #818cf8 !important;
  transform: scale(1.08);
}

#desktopNavBar {
  white-space: nowrap !important;
  flex-wrap: nowrap !important;
  max-width: calc(100vw - 220px);
}

.desktop-tab,
.desktop-tab span {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  word-break: keep-all !important;
}

.desktop-tab.active {
  background-color: #4f46e5; /* indigo-600 */
  color: #ffffff;
}

/* Line clamp */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Glassmorphism */
.glass {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 하단 플레이어 곡명 자동 스크롤 (긴 제목일 때) */
.player-title-marquee-wrapper {
  overflow: hidden;
  position: relative;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
}

.player-title-marquee {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
  transform: translateX(0);
}

.player-title-marquee.marquee-active {
  animation: title-marquee-scroll var(--marquee-duration, 8s) ease-in-out 1.2s infinite;
}

@keyframes title-marquee-scroll {
  0%, 18% {
    transform: translateX(0);
  }
  65%, 82% {
    transform: translateX(var(--marquee-dist, -60px));
  }
  95%, 100% {
    transform: translateX(0);
  }
}

/* 카드 및 목록 내 긴 텍스트 마키 스크롤 (호버 시 또는 항상 자동 스크롤) */
.track-title-marquee-wrapper {
  overflow: hidden;
  position: relative;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
}

.track-title-marquee {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
}

.track-title-marquee.marquee-active {
  animation: track-marquee-scroll var(--marquee-duration, 10s) linear 1.5s infinite;
}

@keyframes track-marquee-scroll {
  0%, 15% {
    transform: translateX(0);
  }
  70%, 85% {
    transform: translateX(var(--marquee-dist, -50px));
  }
  95%, 100% {
    transform: translateX(0);
  }
}

/* 턴테이블 일체형 깔끔한 레트로 LCD 디스플레이 패널 */
.turntable-lcd-panel {
  position: relative;
  border-radius: 10px;
  background: #000000;
  border: 1.5px solid #1c2733;
  padding: 3px;
  box-shadow: 
    0 8px 20px -4px rgba(0, 0, 0, 0.8),
    inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

.turntable-lcd-screen {
  position: relative;
  border-radius: 6px;
  background-color: #4b788a;
  background-image: 
    radial-gradient(ellipse at 50% 40%, rgba(95, 145, 165, 0.35) 0%, rgba(60, 100, 118, 0.95) 100%);
  border: 1px solid #1a2a35;
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.55),
    inset 0 -1px 2px rgba(255, 255, 255, 0.15);
  overflow: hidden;
  font-family: "Gulim", "굴림", "GulimChe", "굴림체", 'ChosunGu', Dotum, 돋움, AppleGothic, sans-serif;
  letter-spacing: 0;
  color: #000000;
}

/* 상단 글래스 하이라이트 반사광 (미세 도트 패턴 제거로 글자가 선명하고 깨끗하게 보임) */
.turntable-lcd-screen::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 38%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events-none;
  z-index: 2;
}

/* LCD 특유의 블랙 세그먼트 잉크 텍스트 (정통 하드웨어 LCD 굴림체, 획 뭉침 없는 적절한 볼드 & 약간 좁은 자간) */
.lcd-ink-text {
  position: relative;
  z-index: 3;
  color: #000000 !important;
  font-family: "GulimChe", "굴림체", "Gulim", "굴림", DotumChe, "돋움체", Dotum, 돋움, AppleGothic, sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: -0.04em !important;
  text-shadow: 0.5px 0.5px 0px rgba(0, 0, 0, 0.2);
}

.lcd-ink-subtext {
  position: relative;
  z-index: 3;
  color: #000000 !important;
  font-family: "GulimChe", "굴림체", "Gulim", "굴림", DotumChe, "돋움체", Dotum, 돋움, AppleGothic, sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
  text-shadow: 0.5px 0.5px 0px rgba(0, 0, 0, 0.15);
}

/* LCD 상단 우측 좋아요/보관함 상태 배지 (정통 굴림체, 획 뭉침 없는 선명한 굵기 & 약간 좁은 자간) */
#turntableStatusBadge {
  color: #000000 !important;
  font-family: "GulimChe", "굴림체", "Gulim", "굴림", DotumChe, "돋움체", Dotum, 돋움, AppleGothic, sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
}

#turntableStatusBadge i,
#turntableStatusBadge svg {
  color: #000000 !important;
  stroke-width: 2.2px !important;
}

/* LCD 상단 상태 헤더 및 구분선 */
.lcd-top-bar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.75);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12);
  padding-bottom: 5px;
  margin-bottom: 7px;
  color: #000000 !important;
  font-family: "Gulim", "굴림", "GulimChe", "굴림체", 'ChosunGu', Dotum, 돋움, sans-serif !important;
  letter-spacing: 0;
}

/* 노래 곡명 & 가수: LCD 전체 A-B 양쪽 거리 동일 정중앙 배치, 노출 영역은 C(오디오스펙 우측) ~ D(오른쪽 끝) */
.lcd-song-display-area {
  width: 100%;
  text-align: center;
  position: relative;
  /* C(좌측 3줄 스펙 우측 58px / 64px)부터 D(우측 끝 0px)까지만 표시 */
  clip-path: inset(0 0 0 58px);
}

@media (min-width: 640px) {
  .lcd-song-display-area {
    clip-path: inset(0 0 0 64px);
  }
}

/* 검색 필터 및 멜론 차트 3D 버튼 스타일 */
.filter-btn-3d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
  white-space: nowrap;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 2px 5px rgba(0, 0, 0, 0.45);
  transition: all 0.15s ease-out;
  cursor: pointer;
}

.filter-btn-3d:hover {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border-color: rgba(148, 163, 184, 0.5);
  color: #ffffff;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 4px 8px rgba(0, 0, 0, 0.55);
}

.filter-btn-3d:active {
  transform: scale(0.95);
  background: #0f172a;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.filter-btn-3d.active {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border: 1.5px solid #6366f1;
  color: #ffffff;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 10px rgba(99, 102, 241, 0.4),
    0 2px 5px rgba(0, 0, 0, 0.5);
}

.btn-action-3d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.72rem; /* 약 11.5px */
  border-radius: 0.625rem;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 2px 5px rgba(0, 0, 0, 0.45);
  transition: all 0.15s ease-out;
}

.btn-action-3d:hover {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border-color: rgba(148, 163, 184, 0.5);
  color: #ffffff;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 4px 8px rgba(0, 0, 0, 0.55);
}

.btn-action-3d:active {
  transform: scale(0.95);
  background: #0f172a;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.btn-action-3d i,
.btn-action-3d svg {
  color: #94a3b8;
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
  transition: color 0.15s;
}

.btn-action-3d:hover i,
.btn-action-3d:hover svg {
  color: #f1f5f9;
}
