/* Shared layout + utilities */
.stream-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}
.stream-section-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
}
.stream-section-title--clips,
.stream-section-title--yt {
    margin: 0 16px 8px;
}
.stream-hr { margin: 8px 0; }
.stream-link-block { margin: 10px 16px 8px; }

/* Twitch player + clips grid */
#tw-container { position: relative; padding-top: 56.25%; }
#tw-player { position: absolute; inset: 0; }
.stream-clips-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 0 16px 8px;
}
@media (max-width: 900px) { #tw-clips.stream-clips-grid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 600px) { #tw-clips.stream-clips-grid { grid-template-columns: 1fr !important; } }

/* Clip card */
.stream-clip {
    text-decoration: none;
    color: inherit;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: block;
}
.stream-clip-img { width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
.stream-clip-meta { padding: 8px 10px; }
.stream-clip-title { font-size: 14px; line-height: 1.3; max-height: 3.1em; overflow: hidden; }
.stream-clip-by { font-size: 12px; color: #666; margin-top: 6px; }

/* YouTube recordings list */
.yt-list {
    height: 70vh; /* fixed scroll area */
    overflow-y: auto;
    padding: 4px 0;
    margin: 0 8px 8px;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 6px;
    background: rgba(255,255,255,0.02);
    backdrop-filter: blur(2px);
}
/* Modern scrollbar */
.yt-list { scrollbar-width: thin; scrollbar-color: #bbb transparent; }
.yt-list::-webkit-scrollbar { width: 10px; }
.yt-list::-webkit-scrollbar-track { background: transparent; }
.yt-list::-webkit-scrollbar-thumb {
    background: rgba(180,180,180,0.6);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.video {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 8px 8px;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.15s ease;
    justify-content: space-between;
}
.video:hover { background: rgba(255,255,255,0.04); }

.yt-thumb { width: 256px; max-width: 40vw; aspect-ratio: 16 / 9; object-fit: cover; display: block; transition: box-shadow 0.2s ease, transform 0.2s ease; border-radius: 4px; }
.video a:hover .yt-thumb, .video a:focus .yt-thumb { box-shadow: 0 0 12px rgba(255, 255, 255, 0.9), 0 0 22px rgba(255, 235, 59, 0.6); transform: translateZ(0); }
.yt-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.yt-title { font-size: 1.12rem; font-weight: 700; margin: 0; line-height: 1.4; }
.yt-title a { text-decoration: none; color: inherit; }
.yt-duration { margin-top: 10px; font-size: 0.94rem; color: #444; }
.yt-date { margin-top: 4px; color: #666; font-size: 0.92rem; }

/* Tag pills */
.yt-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.yt-tag {
    display: inline-block;
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1;
    color: #333;
    background: #eee;
    border: 1px solid #ddd;
    border-radius: 999px;
    white-space: nowrap;
    cursor: pointer;
}
.yt-tag.selected { background: #e0e0e0; border-color: #cfcfcf; }

/* Sentinel spacer */
.yt-sentinel { height: 12px; }

/* Toolbar */
.yt-toolbar {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
    margin: 0 8px 8px;
}
#yt-filter {
    padding: 6px 8px;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 6px;
    background: #fff;
}
#yt-tag-filter {
    width: 220px; /* stable width to avoid wobble */
    padding: 4px 6px;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 6px;
    background: #fff;
}
#yt-sort {
    padding: 6px 10px;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    min-width: 110px;    /* stable width */
    white-space: nowrap; /* keep label on one line */
    color: #222;         /* ensure visible text */
    font-size: 14px;
    line-height: 1.2;
}

@media (max-width: 700px) { .yt-thumb { width: 44vw; } }
