/* /top10 hub — rails that lead into watching. Markup: includes/top10-hub.php. */

.t10hub { display: flex; flex-direction: column; gap: 28px; color: var(--color-text-primary, #e5e7eb); }

.t10hub__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.t10hub__head h1 { margin: 0; font-size: 2rem; font-weight: 800; color: #fff; letter-spacing: -0.01em; }
.t10hub__head p { margin: 4px 0 0; color: var(--color-text-secondary, #9ca3af); }

/* Buttons */
.t10hub__btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid transparent; font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s; white-space: nowrap; }
.t10hub__btn--primary { background: var(--color-accent-orange, #f97316); color: #fff; }
.t10hub__btn--primary:hover { background: var(--color-accent-orange-hover, #fb923c); color: #fff; }
.t10hub__btn--ghost { background: transparent; color: var(--color-text-primary, #e5e7eb); border-color: var(--color-border-secondary, rgba(255,255,255,0.2)); }
.t10hub__btn--ghost:hover { border-color: var(--color-accent-orange-hover, #fb923c); color: #fff; }
.t10hub__btn--icon { width: 36px; height: 36px; padding: 0; justify-content: center; background: rgba(255,255,255,0.06); color: var(--color-text-secondary, #9ca3af); font-size: 1.3rem; line-height: 1; }
.t10hub__btn--icon:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* Create form */
.t10hub__create { background: var(--color-bg-primary, #1f2937); border: 1px solid var(--color-border-primary, rgba(255,255,255,0.1)); border-radius: 14px; padding: 16px; }
.t10hub__create-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.t10hub__create-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--color-text-secondary, #9ca3af); flex: 1 1 200px; }
.t10hub__create-form input, .t10hub__create-form select { padding: 9px 12px; border-radius: 8px; border: 1px solid var(--color-border-secondary, rgba(255,255,255,0.2)); background: var(--color-bg-secondary, #374151); color: #fff; font: inherit; }

/* Stage */
.t10hub__stage { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; background: var(--color-bg-primary, #1f2937); border: 1px solid var(--color-border-primary, rgba(255,255,255,0.1)); border-radius: 18px; padding: 16px; box-shadow: 0 18px 50px rgba(0,0,0,0.35); animation: t10hub-rise 0.25s ease-out; }
.t10hub__stage[hidden] { display: none; }
@keyframes t10hub-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.t10hub__stage-player { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.t10hub__stage-frame, .t10hub__stage-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Games panel: sized by the player (height 0 + min-height 100%), list scrolls inside. */
.t10hub__stage-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; height: 0; min-height: 100%; }
.t10hub__stage-games-head { display: flex; align-items: center; gap: 10px; }
.t10hub__stage-games-h { margin: 0; font-size: 1rem; color: #fff; flex: 1; }
.t10hub__stage-games-count { font-size: 0.8rem; color: var(--color-text-secondary, #9ca3af); font-variant-numeric: tabular-nums; }
.t10hub__stage-games-hint { margin: 0; font-size: 0.8rem; color: var(--color-text-secondary, #9ca3af); }
.t10hub__stage-games-hint[hidden] { display: none; }
.t10hub__stage-games { list-style: none; margin: 0; padding: 0 4px 0 0; display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.t10hub__stage-game { border-radius: 10px; background: var(--color-bg-secondary, #374151); }
.t10hub__stage-game--loading { padding: 10px 12px; color: var(--color-text-secondary, #9ca3af); font-size: 0.85rem; background: none; }
.t10hub__stage-game-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; background: none; color: #fff; font: inherit; text-align: left; cursor: default; border-radius: 10px; }
button.t10hub__stage-game-btn { cursor: pointer; }
button.t10hub__stage-game-btn:hover, button.t10hub__stage-game-btn:focus-visible { background: rgba(251,146,60,0.14); outline: none; }
.t10hub__stage-game-rank { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--color-accent-orange-hover, #fb923c); color: #111; font-weight: 800; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.t10hub__stage-game-art { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,0.06); }
.t10hub__stage-game-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t10hub__stage-game-name { flex: 1; min-width: 0; font-size: 0.9rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.t10hub__stage-game.is-locked { display: flex; align-items: center; gap: 10px; padding: 10px 8px; background: transparent; border: 1px dashed var(--color-border-secondary, rgba(255,255,255,0.18)); }
.t10hub__stage-game.is-locked .t10hub__stage-game-rank { opacity: 0.55; }
.t10hub__stage-game-lock { font-size: 0.8rem; color: var(--color-text-secondary, #9ca3af); }
.t10hub__stage-game.is-new { animation: t10hub-reveal 0.6s ease-out; }
@keyframes t10hub-reveal { from { opacity: 0; transform: translateX(10px); box-shadow: 0 0 0 2px var(--color-accent-orange-hover, #fb923c); } to { opacity: 1; transform: none; box-shadow: 0 0 0 0 transparent; } }
.t10hub__stage-page { font-size: 0.8rem; color: var(--color-text-secondary, #9ca3af); text-decoration: none; }
.t10hub__stage-page:hover { color: #fff; text-decoration: underline; }
.t10hub__stage-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; align-items: center; }
.t10hub__stage-add { display: flex; flex-direction: column; gap: 8px; width: 100%; margin: 0; }
.t10hub__stage-add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.t10hub__stage-add select, .t10hub__stage-new input { flex: 1 1 140px; min-width: 0; padding: 8px 10px; border-radius: 999px; border: 1px solid var(--color-border-secondary, rgba(255,255,255,0.2)); background: var(--color-bg-secondary, #374151); color: #fff; font: inherit; font-size: 0.85rem; }
.t10hub__stage-new { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,0.04); }
.t10hub__stage-new[hidden] { display: none; }
.t10hub__stage-new-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Rails */
.t10hub__rail { position: relative; }
.t10hub__rail-head { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.t10hub__rail-head h2 { margin: 0; font-size: 1.3rem; font-weight: 700; color: #fff; }
.t10hub__rail-sub { margin: 0; flex-basis: 100%; order: 3; color: var(--color-text-secondary, #9ca3af); font-size: 0.875rem; }
.t10hub__arrows { display: flex; gap: 6px; margin-left: auto; }
.t10hub__arrow { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--color-border-secondary, rgba(255,255,255,0.2)); background: var(--color-bg-primary, #1f2937); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background 0.15s, opacity 0.15s; }
.t10hub__arrow:hover:not(:disabled) { background: var(--color-bg-secondary, #374151); }
.t10hub__arrow:disabled { opacity: 0.3; cursor: default; }

.t10hub__search { position: relative; display: flex; align-items: center; flex: 0 1 260px; }
.t10hub__search i { position: absolute; left: 12px; color: var(--color-text-tertiary, #6b7280); font-size: 0.8rem; pointer-events: none; }
.t10hub__search input { width: 100%; padding: 7px 12px 7px 32px; border-radius: 999px; border: 1px solid var(--color-border-secondary, rgba(255,255,255,0.2)); background: var(--color-bg-primary, #1f2937); color: #fff; font: inherit; font-size: 0.875rem; }
.t10hub__search input:focus { outline: none; border-color: var(--color-accent-orange-hover, #fb923c); }
.t10hub__search.is-loading::after { content: ''; position: absolute; right: 10px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.2); border-top-color: var(--color-accent-orange-hover, #fb923c); animation: t10hub-spin 0.7s linear infinite; }
@keyframes t10hub-spin { to { transform: rotate(360deg); } }

/* Slider: transform-driven, no scrollbar */
.t10hub__viewport { overflow: hidden; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; padding: 6px 0 10px; margin: -6px 0 -10px; }
.t10hub__viewport.is-dragging { cursor: grabbing; }
.t10hub__viewport.is-dragging a, .t10hub__viewport.is-dragging button { pointer-events: none; }
.t10hub__track { display: flex; gap: 16px; will-change: transform; }
.t10hub__track > * { flex: 0 0 auto; }
.t10hub__empty { color: var(--color-text-secondary, #9ca3af); padding: 24px 0; margin: 0; }

/* Video card */
.t10hub__video { width: 280px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; transition: transform 0.25s ease, opacity 0.25s ease; }
.t10hub__video-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #111827; box-shadow: 0 6px 18px rgba(0,0,0,0.35); }
.t10hub__video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; -webkit-user-drag: none; }
.t10hub__video:hover .t10hub__video-thumb img, .t10hub__video:focus-visible .t10hub__video-thumb img { transform: scale(1.05); }
.t10hub__video-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; background: linear-gradient(to top, rgba(0,0,0,0.45), rgba(0,0,0,0.05)); }
.t10hub__video-play i { width: 52px; height: 52px; border-radius: 50%; background: var(--color-accent-orange, #f97316); color: #fff; display: inline-flex; align-items: center; justify-content: center; padding-left: 4px; box-shadow: 0 6px 18px rgba(249,115,22,0.45); }
.t10hub__video:hover .t10hub__video-play, .t10hub__video:focus-visible .t10hub__video-play, .t10hub__video.is-playing .t10hub__video-play { opacity: 1; }
.t10hub__video.is-playing .t10hub__video-thumb { outline: 2px solid var(--color-accent-orange, #f97316); outline-offset: 2px; }
.t10hub__video-duration { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,0.8); color: #fff; font-size: 0.72rem; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.t10hub__video-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,0.25); }
.t10hub__video-progress span { display: block; height: 100%; background: var(--color-accent-orange, #f97316); }
.t10hub__video-title { font-weight: 600; font-size: 0.95rem; line-height: 1.3; color: #fff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.t10hub__video-meta { display: flex; flex-direction: column; gap: 2px; font-size: 0.8rem; color: var(--color-text-secondary, #9ca3af); min-width: 0; }
.t10hub__video-channel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* My Compilations card */
.t10hub__comp { width: 220px; min-height: 120px; display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px; text-decoration: none; color: inherit; background: linear-gradient(145deg, var(--color-bg-secondary, #374151), var(--color-bg-primary, #1f2937)); border: 1px solid var(--color-border-primary, rgba(255,255,255,0.1)); transition: transform 0.2s, border-color 0.2s; }
.t10hub__comp:hover { transform: translateY(-3px); border-color: var(--color-accent-orange-hover, #fb923c); }
.t10hub__comp-icon { color: var(--color-accent-orange-hover, #fb923c); font-size: 1.1rem; }
.t10hub__comp-name { font-weight: 700; color: #fff; line-height: 1.3; }
.t10hub__comp-meta { margin-top: auto; font-size: 0.8rem; color: var(--color-text-secondary, #9ca3af); }

/* Community Rankings card */
.t10hub__rank { width: 240px; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; border: 1px solid var(--color-border-primary, rgba(255,255,255,0.1)); background: var(--color-bg-primary, #1f2937); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform 0.2s, border-color 0.2s; }
.t10hub__rank:hover, .t10hub__rank[aria-expanded="true"] { transform: translateY(-3px); border-color: var(--color-accent-orange-hover, #fb923c); }
.t10hub__rank-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: 10px; overflow: hidden; }
.t10hub__rank-art-cell { aspect-ratio: 1; background: #111827; display: block; overflow: hidden; }
.t10hub__rank-art-cell img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }
.t10hub__art-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; background: #111827; }
.t10hub__rank-title { font-weight: 700; color: #fff; line-height: 1.3; }
.t10hub__rank-meta { font-size: 0.8rem; color: var(--color-text-secondary, #9ca3af); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.t10hub__rank-panel { margin-top: 16px; background: var(--color-bg-primary, #1f2937); border: 1px solid var(--color-border-primary, rgba(255,255,255,0.1)); border-radius: 16px; padding: 16px; animation: t10hub-rise 0.2s ease-out; }
.t10hub__rank-panel[hidden] { display: none; }
.t10hub__rank-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.t10hub__rank-panel-head h3 { margin: 0; font-size: 1.1rem; color: #fff; }
.t10hub__rank-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; }
.t10hub__rank-game { width: 100%; display: grid; grid-template-columns: 28px 44px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background 0.15s; }
.t10hub__rank-game:hover { background: rgba(255,255,255,0.06); }
.t10hub__rank-pos { grid-row: 1 / 3; font-weight: 800; font-size: 1.1rem; color: var(--color-accent-orange-hover, #fb923c); text-align: center; }
.t10hub__rank-game-art { grid-row: 1 / 3; width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: #111827; display: block; }
.t10hub__rank-game-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t10hub__rank-game-name { font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t10hub__rank-game-meta { font-size: 0.75rem; color: var(--color-text-secondary, #9ca3af); }
.t10hub__rank-hint { margin: 0 0 10px; font-size: 0.85rem; color: var(--color-text-secondary, #9ca3af); }
.t10hub__rank-hint i { color: var(--color-accent-orange-hover, #fb923c); margin-right: 4px; }
.t10hub__rank-game.is-locked { cursor: default; }
.t10hub__rank-game.is-locked:hover { background: transparent; }
.t10hub__rank-game.is-locked .t10hub__rank-pos { color: var(--color-text-secondary, #9ca3af); }
.t10hub__rank-game.is-locked .t10hub__rank-game-art { background: linear-gradient(135deg, #374151, #111827); filter: blur(2px); }
.t10hub__rank-blur { display: inline-block; height: 0.9em; max-width: 100%; vertical-align: middle; border-radius: 4px; background: rgba(255,255,255,0.28); filter: blur(4px); }
.t10hub__rank-game.is-locked .t10hub__rank-game-meta i { margin-right: 4px; }
.t10hub__rank-game.is-new { animation: t10hub-reveal 0.6s ease-out; }

.t10hub__rank-sources-h { margin: 16px 0 8px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-secondary, #9ca3af); }
.t10hub__rank-sources-head { display: flex; align-items: center; gap: 12px; margin: 16px 0 8px; }
.t10hub__rank-sources-head .t10hub__rank-sources-h { margin: 0; }
.t10hub__rank-sources { gap: 12px; }
.t10hub__source { flex: 0 0 200px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; }
.t10hub__source-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #111827; }
.t10hub__source-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t10hub__source-done { position: absolute; left: 6px; top: 6px; background: rgba(22,163,74,0.92); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.t10hub__source-done[hidden] { display: none; }
.t10hub__source-thumb::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow 0.15s; pointer-events: none; }
.t10hub__source:hover .t10hub__source-thumb::after, .t10hub__source:focus-visible .t10hub__source-thumb::after, .t10hub__source.is-playing .t10hub__source-thumb::after { box-shadow: inset 0 0 0 3px var(--color-accent-orange, #f97316); }
.t10hub__source-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.t10hub__source-title { font-size: 0.8rem; font-weight: 600; color: #fff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.t10hub__source-channel { font-size: 0.75rem; color: var(--color-text-secondary, #9ca3af); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 860px) {
    .t10hub__stage { grid-template-columns: 1fr; }
    .t10hub__stage-info { height: auto; min-height: 0; }
    .t10hub__stage-games { max-height: 280px; }
}
@media (max-width: 560px) {
    .t10hub { gap: 22px; }
    .t10hub__head h1 { font-size: 1.6rem; }
    .t10hub__search { flex: 1 1 100%; order: 4; }
    .t10hub__video { width: 76vw; max-width: 280px; }
    .t10hub__stage { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .t10hub__stage, .t10hub__rank-panel, .t10hub__stage-game.is-new, .t10hub__rank-game.is-new { animation: none; }
    .t10hub__video, .t10hub__video-thumb img, .t10hub__comp, .t10hub__rank { transition: none; }
}
