/* 基本設定 */
:root {
    --player-height: 240px;
}

@media (max-width: 600px) {
    :root {
        --player-height: 90px;
    }
}

body {
    font-family: sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100svh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 800px;
    background: #f9f9f9;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* プレイヤー */
.player-area {
    background: #ffffff;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    z-index: 10;
    position: relative;
}

#player-wrapper {
    position: relative;
    width: 100%;
    height: var(--player-height);
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

#player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#now-playing {
    text-align: center;
    margin: 15px 0;
    position: relative;
}

#now-playing h2 {
    margin: 5px 0;
    font-size: 1.2em;
}

#now-playing p {
    margin: 5px 0;
    color: #666;
    font-size: 0.9em;
}

/* 設定ボタン */
#settings-toggle-btn {
    position: absolute;
    top: 0;
    right: 5px;
    font-size: 1.5em;
    /* ⚙ */
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

#settings-toggle-btn:hover {
    opacity: 1;
}

/* シークバー */
.custom-seekbar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.custom-seekbar-container span {
    font-size: 0.9em;
    color: #555;
}

.seekbar-track {
    flex-grow: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
}

.seekbar-progress {
    width: 0%;
    height: 100%;
    background: #007bff;
    border-radius: 4px;
}

/* ボタン */
.custom-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.custom-controls button {
    font-size: 1.5em;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    line-height: 1;
    transition: background-color 0.2s, opacity 0.2s, color 0.2s;
}

.custom-controls button:hover {
    background-color: #f0f0f0;
}

.custom-controls button#loop-btn,
.custom-controls button#shuffle-btn {
    font-size: 1.2em;
    opacity: 0.4;
    /* OFFのときは暗く */
    width: 45px;
    height: 45px;
}

.custom-controls button#loop-btn.active,
.custom-controls button#shuffle-btn.active {
    opacity: 1.0;
    color: #007bff;
}


/* フィルターパネル */
#filter-panel {
    background: #fdfdfd;
    border-bottom: 1px solid #e0e0e0;
    overflow-y: auto;
    display: none;
    padding: 15px 20px;
    box-sizing: border-box;
}

/* 表示時 */
#filter-panel.visible {
    display: block;
    flex-grow: 1;
}

#filter-panel h3 {
    margin: 0 0 10px 0;
    font-size: 1em;
}

.filter-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-controls button {
    padding: 5px 10px;
    font-size: 0.9em;
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

.filter-controls button:hover {
    background-color: #e0e0e0;
}

/* フィルター */
#artist-filter-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

#artist-filter-list label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 0.9em;
    white-space: nowrap;
}

#artist-filter-list input {
    margin-right: 8px;
}

/* プレイリスト */
.playlist-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    box-sizing: border-box;
}

/* フィルター表示時にプレイリストを隠す */
.playlist-area.hidden-by-filter {
    display: none;
}

#playlist {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.playlist-item {
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    border: 1px solid #eee;
    background: #fff;
}

.playlist-item:hover {
    background-color: #f4f4f4;
}

.playlist-item.playing {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.playlist-item .item-title {
    font-weight: bold;
    display: block;
    font-size: 1em;
}

.playlist-item .item-artists {
    font-size: 0.9em;
    opacity: 0.8;
}