@media (max-width: 600px) {
    .wrap form {
        display: block;
        margin-bottom: 20px;
    }
    .wrap form input[type="text"],
    .wrap form textarea,
    .wrap form input[type="file"],
    .wrap form button {
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 10px;
    }
    /* audio 要素だけは幅を自動に */
    .wrap form audio {
        width: auto;
    }
    /* テーブルのレスポンシブ化 */
    .wrap table {
        width: 100%;
        overflow-x: auto;
        display: block;
    }
}

table th:first-child,
table td:first-child {
    width: 30px; /* お好みの幅に調整してください */
    white-space: nowrap; /* 必要に応じてテキストの折り返しを防止 */
}





/* カード全体のレイアウト */
.bgm-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

/* 各カード */
.bgm-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 16px;
    transition: box-shadow 0.3s ease;
}

.bgm-card:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* タイトル */
.bgm-track-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
}

/* コメント・時間・ジャンルタグ */
.bgm-info {
    margin-bottom: 12px;
}

.bgm-comments, .bgm-duration {
    font-size: 0.9em;
    color: #555;
}

.bgm-download-count {
    font-size: 0.9em;
    color: #555;
    margin-top: 4px;
}

.bgm-genres {
    margin-top: 8px;
}

.bgm-genre-tag {
    display: inline-block;
    margin-right: 6px;
    margin-top: 4px;
    padding: 3px 8px;
    background-color: #eef;
    border-radius: 8px;
    font-size: 0.85em;
    text-decoration: none;
    color: #333;
}

/* メディアプレイヤー部 */
.bgm-media {
    margin-top: auto;
}

.bgm-media audio {
    width: 100%;
    margin-top: 10px;
}

.bgm-youtube {
    margin-top: 10px;
    width: 100%;
    aspect-ratio: 16 / 9;
}

/* 利用規約＆ボタン */
.bgm-terms {
    margin-top: 12px;
    font-size: 0.85em;
}

.bgm-download {
    margin-top: 8px;
    width: 100%;
    padding: 8px;
    border: none;
    background-color: #3498db;
    color: white;
    font-size: 1em;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.bgm-download.disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.bgm-download:not(.disabled):hover {
    background-color: #217dbb;
}




.bgm-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
}

.bgm-pagination-button {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #3498db;
    border-radius: 6px;
    background-color: white;
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.2s, color 0.2s;
}

.bgm-pagination-button:hover {
    background-color: #3498db;
    color: white;
}

.bgm-pagination-button.active {
    background-color: #3498db;
    color: white;
    border: 1px solid #3498db;
    cursor: default;
}
