* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(180deg, #f5f7fa 0%, #ffffff 100%);
    color: #1d1d1f;
    padding-bottom: 280px; /* 플레이어 공간 확보 (페이징 포함) */
    min-height: 100vh;
}

.container {
    max-width: 1091px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 50px;
}

header h1 {
    color: #1d1d1f;
    font-size: 3em;
    font-weight: 600;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #1d1d1f 0%, #4a4a4a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 필터 섹션 */
.filter-section {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 25px;	
}

.year-select {
    padding: 12px 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: #1d1d1f;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 200px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231d1d1f' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    padding-right: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.year-select:hover {
    border-color: rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.year-select:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1), 0 4px 12px rgba(0, 0, 0, 0.08);
}

.year-select option {
    padding: 10px;
    background: white;
    color: #2c3e50;
}

/* 모바일용 연도 선택 버튼 (데스크톱에서는 숨김) */
.year-select-mobile-btn {
    display: none;
}

/* 연도 선택 모바일 팝업 */
.year-select-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.year-select-overlay.active {
    display: flex;
    opacity: 1;
}

.year-select-popup {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.year-select-overlay.active .year-select-popup {
    transform: scale(1);
}

.year-select-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.year-select-header h2 {
    font-size: 1.25em;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

.year-select-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    max-height: calc(80vh - 140px);
}

.year-select-item {
    padding: 16px 24px;
    font-size: 1em;
    color: #1d1d1f;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    position: relative;
}

.year-select-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.year-select-item.selected {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
    font-weight: 600;
}

.year-select-item.selected::after {
    content: '✓';
    position: absolute;
    right: 24px;
    color: #007aff;
    font-weight: 600;
}

.year-select-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-confirm {
    width: 100%;
    padding: 14px 24px;
    border: none;
    background: #007aff;
    color: white;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.btn-confirm:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.btn-confirm:active {
    transform: translateY(0);
}

/* 모바일 스타일 */
@media (max-width: 768px) {
    .year-select {
        display: none; /* 모바일에서 기본 select 숨김 */
    }
    
    .year-select-mobile-btn {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 12px 20px;
        border: 1px solid rgba(0, 0, 0, 0.1);
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        color: #1d1d1f;
        border-radius: 12px;
        font-size: 1em;
        font-weight: 500;
        cursor: pointer;
        outline: none;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 100%;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }
    
    .year-select-mobile-btn:hover {
        border-color: rgba(0, 0, 0, 0.15);
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        transform: translateY(-1px);
    }
    
    .year-select-mobile-btn:active {
        transform: translateY(0);
    }
}

.btn-play-all,
.btn-select-mode {
    padding: 12px 24px;
    border: none;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: #1d1d1f;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.btn-play-all:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.btn-select-mode {
    background: rgba(255, 255, 255, 0.8);
}

.btn-select-mode:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.btn-select-mode.active {
    background: #007aff;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-select-mode.active:hover {
    background: #0051d5;
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
}

/* 재생 중 상태 스타일 */
.btn-play-all.playing {
    background: #34c759;
    color: white;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
}

.btn-play-all.playing:hover {
    background: #30d158;
    box-shadow: 0 6px 16px rgba(52, 199, 89, 0.4);
}

.btn-select-mode.playing {
    background: #ff9500;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3);
}

.btn-select-mode.playing:hover {
    background: #ff8800;
    box-shadow: 0 6px 16px rgba(255, 149, 0, 0.4);
}

.btn-select {
    padding: 8px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #1d1d1f;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 50px;
    white-space: nowrap;
}

.btn-select:hover {
    border-color: rgba(0, 122, 255, 0.3);
    background: rgba(255, 255, 255, 0.8);
    color: #007aff;
}

.btn-select.selected {
    background: #007aff;
    border-color: #007aff;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

/* 음악 목록 스타일 */
.music-list {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.music-item {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: grid;
    grid-template-columns: auto 80px 1fr auto auto;
    gap: 15px;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.music-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    background: rgba(255, 255, 255, 0.95);
}

.music-year {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}

.music-year-value {
    font-weight: 600;
    color: #1d1d1f;
    font-size: 1em;
}

.music-event-name {
    font-weight: 400;
    color: #86868b;
    font-size: 0.75em;
    text-align: center;
    line-height: 1.2;
}

.music-cover {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.music-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.music-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #1d1d1f;
}

.music-artist {
    color: #86868b;
    font-size: 0.9em;
    font-weight: 400;
}

.music-details {
    display: none;
}

.music-details span {
    white-space: nowrap;
}

.music-actions {
    display: flex;
    gap: 10px;
    white-space: nowrap;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.btn-lyrics {
    background: #007aff;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.btn-lyrics:hover {
    background: #0051d5;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
    transform: translateY(-1px);
}

.btn-play {
    background: #34c759;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.3);
}

.btn-play:hover {
    background: #30d158;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.4);
    transform: translateY(-1px);
}

.btn-sheet {
    background: #ff9500;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-sheet:hover {
    background: #e68300;
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.4);
    transform: translateY(-1px);
}

/* 페이징 스타일 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 10px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    color: #1d1d1f;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.page-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 122, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.page-btn.active {
    background: #007aff;
    color: white;
    border-color: #007aff;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 고정 뮤직 플레이어 */
.music-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.08), 0 -1px 4px rgba(0, 0, 0, 0.04);
    padding: 20px 25px;
    padding-top: 10px;
    z-index: 1000;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    pointer-events: auto;
}

.music-player.minimized {
    transform: translateY(calc(100% - 80px));
}

/* 모바일에서 플레이어 영역의 빈 공간은 터치 차단 */
@media (max-width: 768px) {
    .music-player {
        pointer-events: none;
    }
    
    /* 클릭 가능한 요소들은 포인터 이벤트 활성화 */
    .music-player .player-swipe-handle,
    .music-player .player-content,
    .music-player .player-left,
    .music-player .player-center,
    .music-player .player-info,
    .music-player .player-title,
    .music-player .player-artist,
    .music-player .player-visualizer-container,
    .music-player .player-controls,
    .music-player .control-btn,
    .music-player .play-pause-btn,
    .music-player .stop-btn,
    .music-player .player-seekbar-container,
    .music-player .player-seekbar,
    .music-player .player-time,
    .music-player .volume-control,
    .music-player .volume-btn,
    .music-player .volume-slider {
        pointer-events: auto;
    }
}

/* 스와이프 핸들 (모바일) */
.player-swipe-handle {
    display: none;
    width: 100%;
    height: 30px;
    position: relative;
    cursor: grab;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.player-swipe-handle:active {
    cursor: grabbing;
}

.swipe-indicator {
    width: 40px;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: background 0.2s;
}

.player-swipe-handle:active .swipe-indicator {
    background: rgba(0, 0, 0, 0.4);
}

/* 최소화 상태 스타일 */
.music-player.minimized .player-content {
    min-height: 60px;
}

.music-player.minimized .player-left {
    grid-column: 1;
}

.music-player.minimized .player-center {
    grid-column: 2;
    overflow: hidden;
}

.music-player.minimized .player-visualizer-container,
.music-player.minimized .player-seekbar-container,
.music-player.minimized .player-time,
.music-player.minimized .volume-control {
    display: none;
}

.music-player.minimized .player-controls {
    grid-column: 2;
    padding: 0;
    justify-content: flex-start;
    gap: 8px;
}

.player-content {
    max-width: 1091px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 20px;
    align-items: center;
    min-height: 180px; /* 비주얼 파형 포함하여 높이 증가 */
}

.player-controls {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    width: 100%;
    padding: 10px 0;
    order: 1; /* 기본 순서 */
}

.player-left {
    display: flex;
    align-items: center;
    position: relative;
}

.player-cover {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.player-cover:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.player-cover-empty {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.player-cover-empty svg {
    width: 100%;
    height: 100%;
}

.player-center {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    justify-content: center;
    width: 100%; /* 전체 너비 사용 */
    overflow: visible; /* 넘치는 부분도 표시 */
}

.player-visualizer-container {
    width: 100%;
    height: 60px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    overflow: hidden;
    min-height: 40px;
    max-height: 80px;
    position: relative;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.audio-visualizer {
    width: 100%;
    height: 100%;
    display: block;
    max-width: 100%;
    box-sizing: border-box;
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
}

.player-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #1d1d1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
    min-height: 1.3em;
    line-height: 1.3em;
}

.player-artist {
    color: #86868b;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
    min-height: 1.3em;
    line-height: 1.3em;
}

.player-seekbar-container {
    flex: 1;
    min-width: 0;
}

.player-seekbar {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.1);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: height 0.2s;
}

.player-seekbar:hover {
    height: 6px;
}

.player-seekbar::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, #007aff 0%, #007aff var(--progress, 0%), rgba(0, 0, 0, 0.1) var(--progress, 0%), rgba(0, 0, 0, 0.1) 100%);
    transition: height 0.2s;
}

.player-seekbar:hover::-webkit-slider-runnable-track {
    height: 6px;
}

.player-seekbar::-moz-range-track {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.1);
    transition: height 0.2s;
}

.player-seekbar:hover::-moz-range-track {
    height: 6px;
}

.player-seekbar::-moz-range-progress {
    height: 6px;
    border-radius: 10px;
    background: rgba(255,255,255,0.6);
    transition: height 0.2s;
}

.player-seekbar:hover::-moz-range-progress {
    height: 8px;
}

.player-seekbar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #007aff;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: -5px;
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.4);
    border: 2px solid white;
}

.player-seekbar::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(0, 122, 255, 0.5);
}

.player-seekbar::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #007aff;
    cursor: pointer;
    border: 2px solid white;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.4);
}

.player-seekbar::-moz-range-thumb:hover {
    background: #0051d5;
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(0, 122, 255, 0.5);
}

.player-seekbar::-ms-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
}

.player-time {
    font-size: 0.85em;
    color: #86868b;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
}

.remaining-time {
    margin-left: 5px;
}

/* player-right는 더 이상 사용하지 않음 (player-controls로 대체) */

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.05);
    color: #1d1d1f;
    flex-shrink: 0;
}

.volume-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.volume-btn svg .volume-mute {
    display: none;
}

.volume-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.volume-slider {
    width: 80px;
    height: 4px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.1);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: height 0.2s;
}

.volume-slider:hover {
    height: 6px;
}

.volume-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, #007aff 0%, #007aff var(--volume-progress, 100%), rgba(0, 0, 0, 0.1) var(--volume-progress, 100%), rgba(0, 0, 0, 0.1) 100%);
    transition: height 0.2s;
}

.volume-slider:hover::-webkit-slider-runnable-track {
    height: 6px;
}

.volume-slider::-moz-range-track {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.1);
    transition: height 0.2s;
}

.volume-slider:hover::-moz-range-track {
    height: 6px;
}

.volume-slider::-moz-range-progress {
    height: 4px;
    border-radius: 2px;
    background: #007aff;
    transition: height 0.2s;
}

.volume-slider:hover::-moz-range-progress {
    height: 6px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #007aff;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: -5px;
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.4);
    border: 2px solid white;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(0, 122, 255, 0.5);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #007aff;
    cursor: pointer;
    border: 2px solid white;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.4);
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(0, 122, 255, 0.5);
}

.volume-slider::-ms-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
}

.control-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.05);
    color: #1d1d1f;
}

.control-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.control-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.active {
    background: #007aff;
    color: white;
}

.control-btn.active:hover {
    background: #0051d5;
}

.control-btn.lyrics-btn {
    background: #af52de;
    color: white;
}

.control-btn.lyrics-btn:hover {
    background: #8e44ad;
}

    .play-pause-btn {
        width: 48px;
        height: 48px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #007aff;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.play-pause-btn svg {
    width: 24px;
    height: 24px;
}

.play-pause-btn:hover {
    background: #0051d5;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
}

.play-pause-btn:active {
    transform: scale(0.95);
}

.stop-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.05);
    color: #1d1d1f;
}

.stop-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.stop-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.play-pause-btn.playing .play-icon {
    display: none;
}

.play-pause-btn:not(.playing) .pause-icon {
    display: none;
}

/* stop-btn 스타일은 위에서 정의됨 */

/* 가사 레이어 팝업 */
.lyrics-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lyrics-overlay.active {
    display: flex;
}

.lyrics-popup {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.lyrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.lyrics-header h2 {
    color: #2c3e50;
    font-size: 1.5em;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: #1d1d1f;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 300;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.lyrics-content {
    padding: 24px;
    overflow-y: auto;
    white-space: normal;
    line-height: 1.8;
    color: #1d1d1f;
    flex: 1;
    font-size: 1.05em;
}

/* 커버 이미지 확대 모달 */
.cover-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cover-overlay.active {
    display: flex;
}

.cover-popup {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: coverModalFadeIn 0.3s ease-out;
}

@keyframes coverModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cover-popup .close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cover-popup .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* 플레이리스트 레이어 팝업 */
.playlist-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.playlist-overlay.active {
    display: flex;
}

.playlist-popup {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.playlist-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.playlist-header h2 {
    color: #1d1d1f;
    font-size: 1.5em;
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.playlist-header-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #1d1d1f;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.playlist-header-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 122, 255, 0.3);
    color: #007aff;
    transform: scale(1.05);
}

.playlist-header-btn.active {
    background: #007aff;
    border-color: #007aff;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.playlist-header-btn#playlistHeaderDeleteBtn.active {
    background: #ff3b30;
    border-color: #ff3b30;
    color: white;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
}

.playlist-header-btn#playlistHeaderDeleteBtn.active:hover {
    background: #d70015;
    border-color: #d70015;
}

.playlist-controls {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
}

.playlist-mode-btn {
    flex: 1;
    padding: 12px 24px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #1d1d1f;
    border-radius: 12px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.playlist-mode-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 122, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.playlist-mode-btn.active {
    background: #007aff;
    color: white;
    border-color: #007aff;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.playlist-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.playlist-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 1.1em;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 8px;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.playlist-item:hover {
    background: rgba(0, 0, 0, 0.03);
    transform: translateX(2px);
}

.playlist-item.active {
    background: rgba(0, 122, 255, 0.1);
    border-left: 3px solid #007aff;
}

.playlist-item-controls {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.playlist-item-move-btn {
    width: 28px;
    height: 24px;
    border: none;
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.playlist-item-move-btn:hover:not(:disabled) {
    background: rgba(52, 152, 219, 0.2);
}

.playlist-item-move-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.playlist-item-move-btn svg {
    width: 14px;
    height: 14px;
}

.playlist-item-cover {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.playlist-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-cover-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.playlist-cover-empty svg {
    width: 100%;
    height: 100%;
}

.playlist-item-info {
    flex: 1;
    min-width: 0;
}

.playlist-item-title {
    font-size: 1em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-item-artist {
    font-size: 0.9em;
    color: #7f8c8d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-item-info {
    cursor: pointer;
}

.playlist-item-delete-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    border-radius: 8px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    padding: 0;
}

.playlist-item-delete-btn:hover:not(:disabled) {
    background: #ff3b30;
    color: white;
    transform: scale(1.05);
}

.playlist-item-delete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.playlist-item-delete-btn svg {
    width: 16px;
    height: 16px;
}

/* 플레이리스트 버튼 스타일 */
.control-btn.playlist-btn {
    background: rgba(0, 0, 0, 0.05);
}

.control-btn.playlist-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* 랜덤 버튼 스타일 */
.control-btn.random-btn.active {
    background: #ff9500;
    color: white;
}

.control-btn.random-btn.active:hover {
    background: #e68300;
}

/* 반응형 디자인 */
@media (max-width: 1024px) and (min-width: 769px) {
    .player-visualizer-container {
        height: 55px;
        min-height: 50px;
        max-height: 70px;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 300px; /* 모바일 플레이어 공간 확보 (페이징 포함) */
    }
    
    .container {
        padding: 20px 15px;
    }

    header h1 {
        font-size: 2.2em;
    }

    .music-item {
        grid-template-columns: 60px 1fr;
        gap: 10px;
        grid-auto-rows: auto;
    }

    .music-year {
        grid-column: 1 / -1;
        grid-row: 2;
        align-items: flex-start;
    }

    .music-cover {
        width: 60px;
        height: 60px;
        grid-row: 1;
        grid-column: 1;
    }

    .music-info {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .music-details {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        grid-column: 1 / -1;
        grid-row: 3;
        font-size: 0.85em;
        color: #95a5a6;
    }

    .music-details span {
        white-space: nowrap;
    }

    .music-actions {
        grid-column: 1 / -1;
        grid-row: 4;
        justify-content: stretch;
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .music-actions .btn {
        flex: 1;
        min-width: 0;
        padding: 8px 10px;
        font-size: 0.8em;
        white-space: nowrap;
    }
    
    /* 버튼 내 SVG 크기 조정 */
    .music-actions .btn svg {
        width: 14px;
        height: 14px;
    }

    /* 선택 모드일 때도 4개 버튼을 한 줄에 배치 (가사, 악보, 재생, 선택) */
    .music-actions.select-mode {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .player-content {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 0 10px;
    }

    /* 모바일에서 스와이프 핸들 표시 */
    .player-swipe-handle {
        display: block;
    }
    
    .music-player {
        padding-top: 10px;
    }

    .player-left {
        display: none; /* 모바일에서 커버 이미지 숨김 */
    }

    .player-center {
        order: 1; /* 제목/가수와 비주얼 스펙트럼을 위로 */
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .player-info {
        order: 1;
        margin-bottom: 8px;
    }

    .player-visualizer-container {
        order: 2; /* 비주얼 스펙트럼을 player-info 아래 */
        margin-top: 0;
        margin-bottom: 0;
    }

    .player-seekbar-container {
        order: 2; /* seekbar를 비주얼 스펙트럼 다음에 */
        width: 100%;
        flex-basis: 100%;
        margin-top: 10px;
    }

    .player-time {
        order: 3; /* 시간 정보를 seekbar 다음에 */
        flex-basis: 100%;
        text-align: center;
        margin-top: 5px;
    }

    .player-controls {
        order: 4; /* 버튼들을 seekbar 영역 밑으로 */
        gap: 6px;
        padding: 8px 0;
        flex-wrap: nowrap;
        margin-bottom: 0;
        margin-top: 10px;
        justify-content: center;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .player-controls::-webkit-scrollbar {
        display: none;
    }
    
    .player-controls .control-btn,
    .player-controls .play-pause-btn,
    .player-controls .stop-btn {
        flex-shrink: 0;
    }

    body {
        padding-bottom: 240px; /* 모바일 플레이어 공간 확보 (버튼이 다음 줄에 있고 비주얼 파형 포함) */
    }

    .player-cover,
    .player-cover-empty {
        width: 60px;
        height: 60px;
    }

    .player-title,
    .player-artist {
        font-size: 0.9em;
    }

    .player-seekbar {
        height: 5px;
    }

    .player-seekbar::-webkit-slider-runnable-track {
        height: 5px;
    }

    .player-seekbar::-moz-range-track {
        height: 5px;
    }

    .player-seekbar::-moz-range-progress {
        height: 5px;
    }

    .player-seekbar::-webkit-slider-thumb {
        width: 12px;
        height: 12px;
        margin-top: -3.5px;
    }

    .player-seekbar::-moz-range-thumb {
        width: 12px;
        height: 12px;
    }

    .player-time {
        font-size: 0.75em;
    }

    .player-visualizer-container {
        height: 50px;
        min-height: 40px;
        max-height: 60px;
    }

    .audio-visualizer {
        height: 100%;
    }

    .volume-control {
        gap: 5px;
    }

    .volume-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9em;
    }

    .volume-slider {
        width: 60px;
        height: 5px;
    }

    .volume-slider::-webkit-slider-runnable-track {
        height: 5px;
    }

    .volume-slider::-moz-range-track {
        height: 5px;
    }

    .volume-slider::-moz-range-progress {
        height: 5px;
    }

    .volume-slider::-webkit-slider-thumb {
        width: 12px;
        height: 12px;
        margin-top: -3.5px;
    }

    .volume-slider::-moz-range-thumb {
        width: 12px;
        height: 12px;
    }

    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9em;
    }

    .play-pause-btn,
    .stop-btn {
        width: 45px;
        height: 45px;
        font-size: 1em;
    }

    .pagination {
        display: none; /* 모바일에서는 페이징 버튼 숨김 (무한 스크롤 사용) */
    }
}

@media (max-width: 480px) {
    .music-item {
        padding: 15px;
    }

    .player-content {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 0 10px;
    }

    .player-left {
        display: none;
    }

    .player-center {
        order: 1; /* 제목/가수와 비주얼 스펙트럼을 위로 */
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .player-info {
        order: 1;
        margin-bottom: 6px;
    }

    .player-visualizer-container {
        order: 2; /* 비주얼 스펙트럼을 player-info 아래 */
        margin-top: 0;
        margin-bottom: 0;
    }

    .player-seekbar-container {
        order: 2; /* seekbar를 비주얼 스펙트럼 다음에 */
        width: 100%;
        flex-basis: 100%;
        margin-top: 8px;
    }

    .player-time {
        order: 3; /* 시간 정보를 seekbar 다음에 */
        flex-basis: 100%;
        text-align: center;
        font-size: 0.7em;
        margin-top: 5px;
    }

    .player-controls {
        order: 4; /* 버튼들을 seekbar 영역 밑으로 */
        gap: 6px;
        padding: 6px 0;
        flex-wrap: wrap;
        margin-bottom: 0;
        margin-top: 8px;
        justify-content: center;
    }

    body {
        padding-bottom: 300px; /* 작은 모바일 플레이어 공간 확보 (페이징 포함) */
    }

    .player-visualizer-container {
        height: 40px;
        min-height: 35px;
        max-height: 50px;
    }

    .audio-visualizer {
        height: 100%;
    }

    .play-pause-btn,
    .stop-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9em;
    }
}
