* { box-sizing: border-box; }

body {
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    background: #121214;
    color: #e8e8ea;
    margin: 0;
    padding: 0;
}

.wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px 100px;
}

h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 600; margin: 0; }
p.sub { color: #9a9aa2; font-size: 14px; margin: 4px 0 24px; }

a { color: #e8536b; }

.card {
    background: #1c1c20;
    border: 1px solid #2c2c31;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}

label { display: block; font-size: 13px; color: #9a9aa2; margin-bottom: 6px; }

input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    background: #121214;
    border: 1px solid #34343a;
    border-radius: 8px;
    color: #e8e8ea;
    font-size: 15px;
}

.btn-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

button, .btn {
    appearance: none;
    border: 1px solid #34343a;
    background: #232327;
    color: #e8e8ea;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

button:hover, .btn:hover { background: #2c2c31; }

button.primary {
    background: #e8536b;
    border-color: #e8536b;
    color: #fff;
}
button.primary:hover { background: #d43f57; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

.counter {
    background: #2a1c1f;
    color: #f0879a;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

details { border-bottom: 1px solid #2c2c31; }
details:last-child { border-bottom: none; }

summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
}
summary::-webkit-details-marker { display: none; }
summary .meta { font-weight: 400; color: #9a9aa2; font-size: 13px; }
summary .chevron { transition: transform 0.15s; color: #9a9aa2; }
details[open] summary .chevron { transform: rotate(180deg); }

.song-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px 8px 22px;
    border-top: 1px solid #2c2c31;
}
.song-row .num { font-size: 12px; color: #6c6c74; width: 18px; }
.song-row .title { font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-row .title.playing { color: #e8536b; font-weight: 500; }

.play-btn {
    width: 30px; height: 30px; padding: 0; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.play-btn.playing { background: #2a1c1f; border-color: #e8536b; color: #e8536b; }

/* Sticky player panel pinned to the top of the viewport */
.sticky-player {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #1c1c20;
    border-bottom: 1px solid #2c2c31;
    padding: 10px 16px 12px;
}

.video-panel {
    max-width: 360px;
    margin: 0 auto 8px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}
.video-panel #yt-player { width: 100%; height: 100%; }

.now-info-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    font-size: 13px;
    margin-bottom: 4px;
}
.now-info-row .now-title {
    color: #9a9aa2; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1;
}
.now-info-row .now-title.active { color: #e8e8ea; }
.now-info-row .time-label { color: #6c6c74; font-variant-numeric: tabular-nums; flex-shrink: 0; }

.progress-track { height: 3px; background: #2c2c31; border-radius: 2px; overflow: hidden; margin-bottom: 10px; }
.progress-fill { height: 100%; width: 0%; background: #e8536b; }

.controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.controls-row .spacer { flex: 1; }

button.cp-btn.active {
    background: #e8536b;
    border-color: #e8536b;
    color: #fff;
}

.album-art {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 6px;
    margin: 4px 4px 8px 22px;
    background: #121214;
}

.rank-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; background: #1c1c20; border: 1px solid #2c2c31;
    border-radius: 8px; margin-bottom: 8px; cursor: grab;
}
.rank-item.sortable-ghost { opacity: 0.3; }
.rank-item .rank-num {
    width: 26px; height: 26px; border-radius: 50%; background: #2a1c1f; color: #f0879a;
    display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.rank-item .drag-handle { color: #6c6c74; flex-shrink: 0; }
.rank-item .title { flex: 1; font-size: 14px; }

.results-table { width: 100%; border-collapse: collapse; }
.results-table th, .results-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #2c2c31; font-size: 14px; }
.results-table th { color: #9a9aa2; font-weight: 500; font-size: 12px; text-transform: uppercase; }
.results-table .rank-col { width: 36px; color: #6c6c74; }
.results-table .pts-col { text-align: right; color: #f0879a; font-weight: 600; }
