/* SHARED WITH MAIN THEME BACKGROUND */
body {
    margin: 0;
    padding: 0;
    background: #06070d;
    font-family: Arial, sans-serif;
    color: #ffffff;
    text-align: center;
}

/* PAGE TITLE */
.page-title {
    margin-top: 30px;
    font-size: 28px;
    color: #7fc2ff;
    text-shadow: 0 0 10px #2f8cff;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;

    /* ⭐ Center the whole grid when fewer than 3 items */
    justify-content: center;
}

.library-box {
    display: block;
    padding: 16px;
    background: #0f1625;
    border: 2px solid #2f8cff;
    border-radius: 6px;
    color: #7fc2ff;
    text-decoration: none;
    font-size: 16px;
    box-shadow: 0 0 12px #2f8cff55;
    transition: 0.2s;
}

.library-box:hover {
    background: #132033;
    color: #ffffff;
    box-shadow: 0 0 18px #2f8cff;
}

.song-icon {
    width: 100%;
    max-width: 140px;
    height: 140px;
    object-fit: cover;
    margin-bottom: 8px;
    border-radius: 6px;
    border: 2px solid #2f8cff;
    box-shadow: 0 0 12px #2f8cff55;
}

.song-title {
    font-size: 15px;
    color: #7fc2ff;
}

/* PLAYER PAGE */
.top-image img {
    width: 260px;
    max-width: 80%;
    margin-top: 30px;
    border-radius: 6px;
    border: 2px solid #2f8cff;
    box-shadow: 0 0 12px #2f8cff55;
}

.player-box {
    margin: 30px auto 40px auto;
    width: 80%;
    max-width: 500px;
    padding: 18px;
    border: 2px solid #2f8cff;
    box-shadow: 0 0 15px #2f8cff;
    border-radius: 6px;
    background: #0f1625;
}

.player-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: #7fc2ff;
}

audio {
    width: 100%;
}

.library-grid {
    display: grid;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ⭐ Default: 3 columns */
.library-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* ⭐ If only 2 items → 2 centered columns */
.library-grid:has(.library-box:nth-child(2)):not(:has(.library-box:nth-child(3))) {
    grid-template-columns: repeat(2, 1fr);
    justify-content: center;
}

/* ⭐ If only 1 item → 1 centered column */
.library-grid:has(.library-box:nth-child(1)):not(:has(.library-box:nth-child(2))) {
    grid-template-columns: 1fr;
    justify-content: center;
}
