/* ========================================
   楽曲（Issue #331 A案：帯見出し＋白カード）
======================================== */

.oshi-song-main{
    width:100%;
    max-width:1348px;
    margin:0;
    padding:6px 16px 40px;
    box-sizing:border-box;
}

@media(min-width:768px){
    .oshi-song-main{
        padding:6px 30px 48px;
    }
}

/* ---------- 検索 ---------- */

.oshi-song-search-wrapper{
    width:100%;
    max-width:none;
    margin:0 0 8px;
    padding:0;
}

.oshi-song-search-wrapper .search-toggle-icon{
    display:inline-flex;
    color:var(--theme-brand);
}

.oshi-song-search-wrapper .search-area{
    margin:12px 0 0;
    padding:20px 24px;
    border:1px solid var(--theme-border-soft);
    border-radius:18px;
    background:#fff;
    box-shadow:0 6px 18px rgba(61,44,46,.06);
}

.oshi-song-search-wrapper .search-form input[type="text"]{
    width:100%;
    height:48px;
    padding:0 16px;
    box-sizing:border-box;
    border:1px solid var(--theme-border);
    border-radius:12px;
    color:var(--theme-text);
    font-size:16px;
}

.oshi-song-search-wrapper .search-bottom{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-top:12px;
}

.oshi-song-search-wrapper .search-bottom select{
    height:48px;
    padding:0 12px;
    border:1px solid var(--theme-border);
    border-radius:12px;
    background:#fff;
    color:var(--theme-text);
    font-size:14px;
}

.oshi-song-search-wrapper .search-bottom button[type="submit"]{
    height:48px;
    padding:0 28px;
    border:none;
    border-radius:999px;
    background:linear-gradient(135deg,var(--theme-btn-from),var(--theme-primary));
    color:#fff;
    font-size:15px;
    font-weight:bold;
    cursor:pointer;
}

/* ---------- アルバム・曲リスト ---------- */

.oshi-song-album{
    margin-bottom:36px;
}

.oshi-song-album-name{
    display:flex;
    align-items:center;
    gap:10px;
    margin:0 0 14px;
    color:var(--theme-heading);
    font-size:19px;
    font-weight:bold;
    line-height:1.4;
}

.oshi-song-album-name::before{
    content:"";
    flex:none;
    width:5px;
    height:22px;
    border-radius:3px;
    background:linear-gradient(180deg,var(--theme-btn-from),var(--theme-primary));
}

.oshi-song-album-count{
    color:var(--theme-text-muted);
    font-size:13px;
    font-weight:normal;
}

.oshi-song-items{
    padding:4px 24px;
    border:1px solid var(--theme-border-soft);
    border-radius:18px;
    background:#fff;
    box-shadow:0 6px 18px rgba(61,44,46,.06);
}

.oshi-song-item{
    display:flex;
    align-items:center;
    gap:16px;
    padding:14px 0;
    border-bottom:1px solid var(--theme-border-soft);
}

.oshi-song-item:last-child{
    border-bottom:none;
}

.oshi-song-order{
    flex:none;
    width:28px;
    color:var(--theme-text-muted);
    font-size:14px;
    text-align:center;
}

.oshi-song-content{
    flex:1;
    min-width:0;
}

.oshi-song-name{
    margin:0;
    color:var(--theme-text);
    font-size:16px;
    font-weight:600;
    line-height:1.5;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.oshi-song-release{
    margin:2px 0 0;
    color:var(--theme-text-muted);
    font-size:12.5px;
}

.oshi-song-favorite-btn{
    flex:none;
    width:44px;
    height:44px;
    padding:0;
    border:1px solid var(--theme-border-soft);
    border-radius:50%;
    background:#fff;
    color:#b6c9d4;
    font-size:19px;
    line-height:1;
    cursor:pointer;
}

.oshi-song-favorite-btn.is-favorite{
    border-color:#f8dfae;
    background:#fffaf0;
    color:#f5a623;
}

.oshi-song-top-btn{
    flex:none;
    height:36px;
    padding:0 14px;
    border:1px solid var(--theme-border);
    border-radius:999px;
    background:#fff;
    color:var(--theme-text-sub);
    font-size:12.5px;
    font-weight:bold;
    cursor:pointer;
}

.oshi-song-top-btn.is-selected{
    border:none;
    background:linear-gradient(135deg,var(--theme-btn-from),var(--theme-primary));
    color:#fff;
}

.oshi-song-top-btn:disabled{
    opacity:.45;
    cursor:default;
}

.oshi-song-detail-btn{
    flex:none;
    height:36px;
    padding:0 16px;
    border:none;
    border-radius:999px;
    background:var(--theme-blush);
    color:var(--theme-brand);
    font-size:13px;
    font-weight:bold;
    cursor:pointer;
}

.oshi-empty{
    padding:28px 24px;
    border:1px solid var(--theme-border-soft);
    border-radius:18px;
    background:#fff;
    box-shadow:0 6px 18px rgba(61,44,46,.06);
    color:var(--theme-text-sub);
    font-size:14.5px;
    text-align:center;
}

@media(max-width:767px){
    .oshi-song-search-wrapper .search-area{
        padding:16px;
    }

    .oshi-song-items{
        padding:4px 16px;
    }

    .oshi-song-item{
        gap:8px;
        padding:12px 0;
    }

    .oshi-song-order{
        width:18px;
        font-size:13px;
    }

    .oshi-song-name{
        font-size:15.5px;
    }

    .oshi-song-release{
        font-size:12px;
    }

    .oshi-song-favorite-btn{
        width:40px;
        height:40px;
        font-size:17px;
    }

    .oshi-song-top-btn{
        height:34px;
        padding:0 10px;
        font-size:11.5px;
    }

    .oshi-song-detail-btn{
        height:34px;
        padding:0 12px;
        font-size:12px;
    }
}

/* ----------------------------------------
   楽曲詳細サイドパネル（広い画面のみ）
---------------------------------------- */

.oshi-song-side{
    display:none;
}

@media(min-width:1400px){
    .oshi-song-body{
        display:flex;
        gap:24px;
        align-items:flex-start;
    }

    .oshi-song-list{
        flex:1;
        min-width:0;
    }

    .oshi-song-side{
        display:block;
        position:sticky;
        top:16px;
        width:360px;
        flex:none;
    }
}

.oshi-song-side-empty,
.oshi-song-side-detail{
    padding:24px;
    border:1px solid var(--theme-border-soft);
    border-radius:18px;
    background:#fff;
    box-shadow:0 6px 18px rgba(61,44,46,.06);
}

.oshi-song-side-detail{
    position:relative;
}

.oshi-song-side-detail[hidden]{
    display:none;
}

.oshi-song-side-empty p{
    margin:0;
    color:var(--theme-text-muted);
    font-size:14px;
    line-height:1.7;
    text-align:center;
}

.oshi-song-side-title{
    margin:0 40px 6px 0;
    color:var(--theme-heading);
    font-size:20px;
    line-height:1.5;
}

.oshi-song-side-close{
    position:absolute;
    top:12px;
    right:12px;
    width:34px;
    height:34px;
    padding:0;
    border:0;
    border-radius:50%;
    background:var(--theme-tint);
    color:var(--theme-text-sub);
    font-size:22px;
    line-height:1;
    cursor:pointer;
}

.oshi-song-item.is-detail-open{
    background:var(--theme-tint);
    border-radius:12px;
}


/* ----------------------------------------
   楽曲詳細モーダル
---------------------------------------- */

.oshi-song-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.oshi-song-modal.active {
    display: flex;
}

.oshi-song-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(30, 50, 70, 0.45);
}

.oshi-song-modal-content {
    position: relative;
    width: calc(100% - 40px);
    max-width: 580px;
    max-height: calc(100vh - 80px);
    max-height: calc(100dvh - 80px);
    margin: auto;
    padding: 28px 28px 24px;
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--theme-border-soft);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(30, 60, 90, 0.18);
}

.oshi-song-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--theme-tint);
    color: var(--theme-text-sub);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.oshi-song-modal-title {
    margin: 0 40px 10px 0;
    color: var(--theme-heading);
    font-size: 22px;
    line-height: 1.5;
}

.oshi-song-modal-info {
    margin-top: 18px;
}

.oshi-song-modal-row {
    display: flex;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--theme-border-soft);
}

.oshi-song-modal-row:last-child {
    border-bottom: none;
}

.oshi-song-modal-row span {
    flex: 0 0 76px;
    color: var(--theme-text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.oshi-song-modal-row strong {
    flex: 1;
    min-width: 0;
    color: var(--theme-text);
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.6;
    word-break: break-word;
}

.oshi-song-modal-itunes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.oshi-song-modal-itunes[hidden] {
    display: none;
}

.oshi-song-modal-artwork {
    width: 180px;
    height: 180px;
    flex: 0 0 auto;
    border-radius: 10px;
    object-fit: cover;
    background: var(--theme-tint);
}

.oshi-song-modal-preview {
    width: 100%;
    min-width: 0;
    text-align: center;
}

.oshi-song-modal-preview audio {
    width: 100%;
}

.oshi-song-modal-courtesy {
    margin: 6px 0 8px;
    color: var(--theme-text-muted);
    font-size: 11px;
}

.oshi-song-modal-itunes-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 5px 12px;
    border-radius: 8px;
    background: #f2f2f2;
}

@media (max-width: 480px) {
    .oshi-song-modal-itunes {
        gap: 10px;
    }

    .oshi-song-modal-artwork {
        width: 150px;
        height: 150px;
    }
}

/* 配信サービスリンク（統一レイアウト） */

.oshi-song-modal-links {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
}

.oshi-song-modal-links .oshi-song-modal-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: 160px;
    min-height: 44px;
    padding: 5px 8px;
    box-sizing: border-box;
    border-radius: 9px;
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    text-decoration: none;
}

.oshi-song-modal-links .oshi-song-modal-link.youtube {
    background: #fff2f3;
}

.oshi-song-modal-links .oshi-song-modal-link.apple-music {
    background: #f3f3f5;
}

.oshi-song-modal-links .oshi-song-modal-link.spotify {
    background: #eaf8ef;
}

.oshi-song-modal-link.youtube-logo-link {
    background: #fff;
}

.youtube-brand-logo {
    display: block;
    width: 100%;
    max-width: 86px;
    height: auto;
    max-height: 28px;
    object-fit: contain;
}

.oshi-song-modal-links .oshi-song-modal-link.apple-music .music-service-icon,
.oshi-song-modal-links .oshi-song-modal-link.spotify .music-service-icon {
    width: 100%;
    max-width: 106px;
    max-height: 31px;
    object-fit: contain;
}

.oshi-song-modal-links .oshi-song-modal-link.spotify .music-service-icon {
    max-width: 102px;
}

@media (max-width: 767px) {
    .oshi-song-modal-content {
        padding: 24px 18px 20px;
    }

    .oshi-song-modal-links {
        gap: 6px;
    }

    .oshi-song-modal-links .oshi-song-modal-link {
        max-width: none;
        min-height: 40px;
        padding: 5px 4px;
    }

    .oshi-song-modal-links .youtube-brand-logo {
        max-width: 62px;
        max-height: 20px;
    }

    .oshi-song-modal-links .oshi-song-modal-link.apple-music .music-service-icon,
    .oshi-song-modal-links .oshi-song-modal-link.spotify .music-service-icon {
        max-width: 82px;
        max-height: 25px;
    }
}

.oshi-song-modal-links:empty{
    display:none;
}

.oshi-song-share-button{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    width:100%;
    min-height:44px;
    margin-top:16px;
    padding:0 20px;
    border:none;
    border-radius:999px;
    background:#000;
    color:#fff;
    font-size:14px;
    font-weight:bold;
    cursor:pointer;
    font-family:inherit;
}

.oshi-song-share-button .x-brand-logo{
    width:15px;
    height:15px;
    display:block;
}

/* Issue #387 スマホで曲名が見切れる問題の修正
   曲名を1行目いっぱいに表示し、ボタン類は2行目へ回す */
@media(max-width:767px){
    .oshi-song-item{
        flex-wrap:wrap;
        row-gap:8px;
    }

    .oshi-song-content{
        flex:1 1 calc(100% - 26px);
        min-width:0;
    }

    .oshi-song-name{
        overflow:visible;
        text-overflow:clip;
        white-space:normal;
        overflow-wrap:anywhere;
    }

    .oshi-song-favorite-btn{
        margin-left:auto;
    }
}
