@charset "utf-8";

/* === 기존 스타일 유지 === */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 20px;
    color: #333;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.tier-group {
    background: white;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.2s;
}

.tier-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.tier-header {
    padding: 15px 25px;
    color: white;
    font-size: 1.2em;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* === 수정됨: Grid 및 Song Item (말줄임표 기능 복구) === */
.song-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    padding: 20px;
}

.song-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #eee;
    
    /* [수정] 말줄임표(...) 처리를 위한 속성 */
    white-space: nowrap;        /* 줄바꿈 금지 */
    overflow: hidden;           /* 넘치는 텍스트 숨김 */
    text-overflow: ellipsis;    /* 넘치면 ... 표시 */
    display: block;             /* flex 대신 block 사용 (말줄임표 안정성) */
}

.song-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* === 검색창 스타일 === */
.search-container {
    text-align: center;
    margin-bottom: 40px;
}

.search-box {
    padding: 15px 25px;
    width: 100%;
    max-width: 500px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s;
}

.search-box:focus {
    outline: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* === 색상 클래스 === */
.bg-s-plus { background: linear-gradient(135deg, #ff4d4d, #ff7675); }
.bg-s { background: linear-gradient(135deg, #ff9f43, #feb15e); }
.bg-a-plus { background: linear-gradient(135deg, #feca57, #ffdd59); color: #333; text-shadow: none; }
.bg-a { background: linear-gradient(135deg, #ff9ff3, #f368e0); }
.bg-b-plus { background: linear-gradient(135deg, #54a0ff, #2e86de); }
.bg-b { background: linear-gradient(135deg, #00d2d3, #01a3a4); }
.bg-c { background: linear-gradient(135deg, #1dd1a1, #10ac84); }
.bg-d { background: linear-gradient(135deg, #c8d6e5, #8395a7); color: #333; text-shadow: none;}
.bg-e { background: linear-gradient(135deg, #8395a7, #576574); }
.bg-f { background: linear-gradient(135deg, #576574, #222f3e); }
.bg-level12 { background: linear-gradient(135deg, #2c3e50, #4ca1af); color: white; }
/* === 네비게이션 & 버튼 === */
.nav-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.nav-link {
    text-decoration: none;
    color: #555;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 12px 30px;
    border-radius: 30px;
    background: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0,0,0,0.1);
}

.nav-link.active {
    background: #2c3e50;
    color: white;
}

.controls {
    text-align: center;
    margin-bottom: 30px;
}

.gauge-btn {
    padding: 10px 25px;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    border-radius: 20px;
    margin: 0 5px;
    font-weight: bold;
    transition: all 0.2s;
    background: white;
    color: #555;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.gauge-btn.active-mode {
    background-color: #3498db;
    color: white;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.4);
}

/* === 난이도 텍스트 색상 === */
.leggendaria { color: #d63031; font-weight: bold; }
.another { color: #333; }
.suffix { font-size: 0.8em; color: #888; margin-left: 4px; font-weight: normal; }

/* === [신규] 상세 정보 모달(Modal) 스타일 === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); /* 배경 조금 더 어둡게 */
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    position: relative;
    transform: translateY(0);
    animation: slideUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28); /* 탄성 애니메이션 */
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 모달 내부 요소 */
.modal-category {
    display: inline-block;
    background: #eee;
    color: #666;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #222;
    margin-bottom: 5px;
    line-height: 1.3;
    word-break: keep-all;
}

.modal-artist {
    font-size: 1rem;
    color: #777;
    margin-bottom: 25px;
    font-weight: 500;
}

/* 정보 그리드 */
.modal-grid {
    display: grid;
    gap: 12px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.modal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 8px;
}
.modal-row:last-child { border-bottom: none; padding-bottom: 0; }

.modal-row .label {
    font-size: 0.9rem;
    color: #888;
    font-weight: 600;
}

.modal-row .value {
    font-size: 1rem;
    color: #333;
    font-weight: bold;
}

.modal-close {
    width: 100%;
    padding: 12px;
    margin: 15px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.modal-close:hover {
    background: #34495e;
    transform: scale(1.02);
}
.modal-close:active {
    transform: scale(0.98);
}

/* =========================================
   [추가됨] 반응형(모바일) 미디어 쿼리
   ========================================= */
@media (max-width: 768px) {
    /* 1. 기본 레이아웃 조정 */
    body {
        padding: 10px; /* 좌우 여백 축소 */
    }
    
    .container {
        width: 100%;
        padding: 0;
    }

    h1 {
        font-size: 1.8em; /* 제목 크기 축소 */
        margin-bottom: 20px;
    }

    /* 2. 네비게이션바 & 버튼 */
    .nav-bar {
        gap: 10px;
    }
    
    .nav-link {
        padding: 10px 20px;
        font-size: 1rem;
    }

    .controls {
        margin-bottom: 20px;
    }
    
    .gauge-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    /* 3. 검색창 */
    .search-box {
        width: 90%; /* 모바일에서 조금 더 꽉 차게 */
        font-size: 14px;
        padding: 12px 20px;
    }

    /* 4. 그리드 시스템 (핵심) */
    .song-grid {
        /* 작은 화면에서 2열이 유지되도록 최소 너비를 줄임 (180px -> 130px) */
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 8px;
        padding: 10px;
    }
    
    .song-item {
        font-size: 12px; /* 폰트 조금 작게 */
        padding: 10px 5px;
    }

    /* 5. 티어 그룹 헤더 */
    .tier-header {
        padding: 10px 15px;
        font-size: 1rem;
    }

    /* 6. 모달 팝업 */
    .modal-content {
        width: 85%;
        padding: 20px;
    }

    .modal-title {
        font-size: 1.3rem;
    }

    .modal-grid {
        padding: 10px;
        gap: 8px;
    }

    .modal-row .label, 
    .modal-row .value {
        font-size: 0.9rem;
    }
}