/* ============================================================================
   Home Video Playlists — Góc Video Bài Giảng Cờ Vua (Trang Chủ)
   Hiển thị 2 Playlist YouTube (Mới nhất hiển thị trước), hỗ trợ xem trực tiếp
   ngay tại góc trang chủ, phóng to rạp chiếu (Theater Mode) hoặc mở YouTube.
   ============================================================================ */

#hvp-root {
    font-family: 'Be Vietnam Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-sizing: border-box;
    z-index: 10850;
}

#hvp-root *,
#hvp-root *::before,
#hvp-root *::after {
    box-sizing: border-box;
}

#hvp-root.hvp-hidden {
    display: none !important;
}

/* ── Backdrop when in Expanded Theater Mode ── */
.hvp-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 26, 22, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10840;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.hvp-backdrop.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* ── Minimized Floating Pill (Bottom-Right) ── */
.hvp-mini-pill {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 10850;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 9px 15px 9px 11px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fffaf0 0%, #f4ebd9 100%);
    color: #263e35;
    border: 1.5px solid #c9b38c;
    box-shadow: 0 8px 24px rgba(21, 59, 53, 0.28), inset 0 1px 0 #ffffff;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hvp-mini-pill:hover {
    transform: translateY(-2px);
    border-color: #ad8545;
    box-shadow: 0 12px 28px rgba(21, 59, 53, 0.36), 0 0 0 2px rgba(255, 232, 167, 0.55);
}

.hvp-mini-pill-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
}

.hvp-mini-pill-badge {
    background: #2f5e48;
    color: #fff9e8;
    font-size: 10.5px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
}

#hvp-root.is-pill .hvp-mini-pill {
    display: inline-flex;
}

#hvp-root.is-pill .hvp-panel {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(16px) scale(0.96);
}

/* ── Main Panel Container (Docked Card vs Expanded Theater) ── */
.hvp-panel {
    position: fixed;
    z-index: 10850;
    background: #fffcf5;
    color: #243830;
    border: 1.5px solid #d5c4a1;
    box-shadow: 0 16px 42px rgba(18, 43, 36, 0.32), inset 0 1px 0 #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.18s ease;
}

/* Mode A: Compact Docked Card on Bottom-Right of Home Page (Always >= 200x200px player viewport for YouTube View Policy) */
.hvp-panel.hvp-panel--card {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    width: min(396px, calc(100vw - 16px));
    max-height: min(550px, calc(100dvh - 76px));
    border-radius: 18px;
}

.hvp-panel.hvp-panel--card.has-active-video {
    max-height: min(630px, calc(100dvh - 48px));
}

/* Mode C: Sleek Floating Mini-Player on Bottom-Right (Hides playlist list, keeps 362x205px >= 200x200px YouTube Player visible so Views & Watch Time count 100%) */
.hvp-panel.hvp-panel--mini {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    width: min(362px, calc(100vw - 16px));
    max-height: calc(100dvh - 32px);
    border-radius: 16px;
    border-color: #b89b67;
    box-shadow: 0 18px 46px rgba(10, 28, 22, 0.48), inset 0 1px 0 #ffffff;
}

.hvp-panel.hvp-panel--mini .hvp-header {
    padding: 6px 10px;
}

.hvp-panel.hvp-panel--mini .hvp-subtitle,
.hvp-panel.hvp-panel--mini .hvp-sort-pill,
.hvp-panel.hvp-panel--mini .hvp-browser,
.hvp-panel.hvp-panel--mini .hvp-now-sub,
.hvp-panel.hvp-panel--mini .hvp-play-guide.is-playing {
    display: none !important;
}

.hvp-panel.hvp-panel--mini .hvp-watch-banner {
    padding: 5px 10px;
    gap: 3px;
}

.hvp-panel.hvp-panel--mini .hvp-stage {
    display: flex;
    border-bottom: none;
}

.hvp-panel.hvp-panel--mini .hvp-player-box {
    min-width: 200px;
    min-height: 205px;
    aspect-ratio: 16 / 9;
}

.hvp-panel.hvp-panel--mini .hvp-stage-meta {
    padding: 7px 10px;
    gap: 5px;
}

.hvp-panel.hvp-panel--mini .hvp-now-title {
    font-size: 11.5px;
    -webkit-line-clamp: 1;
}

/* Mode B: Fullscreen Theater Mode covering 100% of the Chess App viewport */
.hvp-panel.hvp-panel--theater {
    inset: 0;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    transform: none;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    z-index: 11200;
}

.hvp-panel--theater .hvp-header {
    padding: 6px 14px;
}

.hvp-panel--theater .hvp-subtitle,
.hvp-panel--theater .hvp-sort-pill {
    display: none;
}

/* ── Panel Header ── */
.hvp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(180deg, #f8f1e0 0%, #efe4cc 100%);
    border-bottom: 1px solid #dfd1b4;
    flex-shrink: 0;
}

.hvp-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.hvp-brand-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.hvp-brand-text {
    min-width: 0;
}

.hvp-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hvp-title {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    color: #233b32;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hvp-sort-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1.5px 6px;
    border-radius: 999px;
    background: #e1efe6;
    color: #1f5c3f;
    border: 1px solid #b8d8c5;
    font-size: 9.5px;
    font-weight: 800;
    white-space: nowrap;
}

.hvp-subtitle {
    font-size: 10.5px;
    color: #627264;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.hvp-header-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.hvp-hdr-btn {
    height: 28px;
    padding: 0 9px;
    border-radius: 8px;
    border: 1px solid #d5c5a7;
    background: #fffdf7;
    color: #324b3f;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
    white-space: nowrap;
}

.hvp-hdr-btn:hover {
    background: #fff3d1;
    border-color: #b58d47;
    color: #1e3329;
}

.hvp-hdr-btn--primary {
    background: #2f5e48;
    color: #fff9ec;
    border-color: #244b38;
}

.hvp-hdr-btn--primary:hover {
    background: #234937;
    border-color: #1a382a;
    color: #ffffff;
}

.hvp-hdr-btn--icon {
    width: 28px;
    padding: 0;
    font-size: 13px;
}

/* ── Panel Body Layout ── */
.hvp-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.hvp-panel--theater .hvp-body {
    flex-direction: row;
}

/* ── Video Stage (Embedded Player + Transport Bar) ── */
.hvp-stage {
    display: none;
    flex-direction: column;
    background: #101b17;
    color: #f4f6f5;
    border-bottom: 1px solid #d8c8ab;
    flex-shrink: 0;
    scroll-behavior: smooth;
}

.hvp-stage::-webkit-scrollbar {
    width: 8px;
}

.hvp-stage::-webkit-scrollbar-track {
    background: rgba(10, 22, 18, 0.7);
}

.hvp-stage::-webkit-scrollbar-thumb {
    background: rgba(52, 211, 153, 0.45);
    border-radius: 999px;
}

.hvp-stage::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 211, 153, 0.75);
}

/* Show stage when playing in card mode OR always in theater mode */
.hvp-panel.has-active-video .hvp-stage,
.hvp-panel--theater .hvp-stage {
    display: flex;
}

.hvp-panel--card.has-comments-open .hvp-stage,
.hvp-panel--mini.has-comments-open .hvp-stage {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.hvp-panel--card.has-comments-open .hvp-browser {
    display: none;
}

.hvp-panel--theater .hvp-stage {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    border-bottom: none;
    border-right: 1px solid #dfd1b4;
    justify-content: flex-start;
}

.hvp-player-box {
    position: relative;
    width: 100%;
    min-width: 200px;
    min-height: 210px;
    aspect-ratio: 16 / 9;
    background: #070d0b;
    overflow: hidden;
    flex-shrink: 0;
}

.hvp-panel--theater .hvp-player-box {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: auto;
    height: calc(100dvh - 132px);
    min-height: 460px;
}

.hvp-panel--theater.has-comments-open .hvp-player-box {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: auto;
    height: calc(100dvh - 210px);
    min-height: 380px;
}

.hvp-player-box iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 200px;
    min-height: 205px;
    border: 0;
}

.hvp-play-guide {
    padding: 5px 12px;
    font-size: 10.5px;
    font-weight: 800;
    color: #fde68a;
    background: rgba(180, 83, 9, 0.35);
    border-top: 1px solid rgba(251, 191, 36, 0.28);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-shrink: 0;
}

.hvp-play-guide.is-verified-playing {
    display: none !important;
}

.hvp-play-guide.is-playing {
    color: #a7f3d0;
    background: rgba(5, 150, 105, 0.32);
    border-top-color: rgba(52, 211, 153, 0.3);
}

.hvp-play-guide.is-warning {
    color: #fecaca;
    background: rgba(185, 28, 28, 0.48);
    border-top-color: rgba(248, 113, 113, 0.45);
}

.hvp-unmute-inline-btn {
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #f59e0b;
    background: #fef3c7;
    color: #92400e;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.14s ease;
}

.hvp-unmute-inline-btn:hover {
    background: #fde68a;
    border-color: #d97706;
    transform: scale(1.03);
}

.hvp-player-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    background: radial-gradient(circle at center, #1d352c 0%, #0c1713 100%);
    color: #e6efe9;
}

.hvp-stage-meta {
    padding: 8px 12px 14px;
    background: #162620;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.hvp-panel--theater .hvp-stage-meta {
    padding: 10px 16px 20px;
}

.hvp-stage-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.hvp-stage-title-col {
    flex: 1 1 260px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hvp-now-title {
    font-size: 12.5px;
    font-weight: 800;
    color: #fff9eb;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hvp-panel--theater .hvp-now-title {
    font-size: 14px;
}

.hvp-now-sub {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 10.5px;
    color: #a9c1b6;
}

.hvp-stage-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

.hvp-stage-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.hvp-stage-btn {
    height: 30px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f3;
    font-size: 11.5px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.hvp-stage-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
}

.hvp-stage-btn--yt {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #f87171;
    color: #ffffff;
}

.hvp-stage-btn--yt:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    border-color: #fca5a5;
}

.hvp-stage-btn--gold {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.5);
    color: #fde68a;
}

.hvp-stage-btn--gold:hover {
    background: rgba(245, 158, 11, 0.32);
}

/* ── Playlist Browser (Tabs + Filter + Video List + Footer) ── */
.hvp-browser {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
    background: #fffcf5;
}

.hvp-panel--theater .hvp-browser {
    flex: 0 0 308px;
    width: 308px;
    max-width: 308px;
}

/* 2 Playlist Switcher Tabs */
.hvp-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 7px 8px;
    background: #f5ecda;
    border-bottom: 1px solid #e2d4b7;
    flex-shrink: 0;
}

.hvp-tab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1.5px solid #dccbb0;
    background: #fffaf0;
    color: #42594c;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.16s ease;
    text-align: left;
    min-width: 0;
}

.hvp-tab:hover {
    border-color: #b99352;
    background: #fff5de;
}

.hvp-tab.is-active {
    background: linear-gradient(135deg, #2d5c46 0%, #204534 100%);
    color: #fff9eb;
    border-color: #1c3d2e;
    box-shadow: 0 3px 10px rgba(32, 69, 52, 0.25);
}

.hvp-tab-label {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hvp-tab-count {
    font-size: 10px;
    font-weight: 800;
    padding: 1.5px 6px;
    border-radius: 999px;
    background: rgba(45, 92, 70, 0.12);
    color: #2d5c46;
    flex-shrink: 0;
}

.hvp-tab.is-active .hvp-tab-count {
    background: rgba(255, 249, 235, 0.2);
    color: #fde68a;
}

/* Playlist Info & Search Bar */
.hvp-playlist-bar {
    display: none;
}

.hvp-playlist-bar-desc {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.hvp-playlist-yt-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #b91c1c;
    font-weight: 800;
    font-size: 11px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.hvp-playlist-yt-link:hover {
    text-decoration: underline;
}

.hvp-search-row {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #f8efe0;
    border-bottom: 1px solid #e6d8be;
    flex-shrink: 0;
}

.hvp-panel--theater .hvp-search-row {
    display: flex;
}

.hvp-search-input {
    flex: 1;
    min-width: 0;
    height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #d4c3a3;
    background: #ffffff;
    color: #233b32;
    font-size: 11.5px;
    outline: none;
}

.hvp-search-input:focus {
    border-color: #2d5c46;
    box-shadow: 0 0 0 2px rgba(45, 92, 70, 0.15);
}

.hvp-filter-pills {
    display: none;
    align-items: center;
    gap: 4px;
}

.hvp-filter-pill {
    height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid #d4c3a3;
    background: #fffaf0;
    color: #4c6355;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
}

.hvp-filter-pill.is-active {
    background: #2d5c46;
    color: #fff;
    border-color: #2d5c46;
}

/* ── Scrollable Video List (Newest First) ── */
.hvp-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 9px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hvp-list::-webkit-scrollbar {
    width: 6px;
}

.hvp-list::-webkit-scrollbar-thumb {
    background: #d2c09e;
    border-radius: 999px;
}

.hvp-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 8px;
    border-radius: 12px;
    border: 1px solid #eadec7;
    background: #ffffff;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
    cursor: pointer;
}

.hvp-item:hover {
    background: #fff6e0;
    border-color: #c8a86b;
}

.hvp-item.is-playing {
    background: #e9f5ee;
    border-color: #2d6a4f;
    box-shadow: 0 2px 8px rgba(45, 106, 79, 0.12);
}

.hvp-thumb-wrap {
    position: relative;
    width: 96px;
    height: 54px;
    border-radius: 8px;
    overflow: hidden;
    background: #1b2a24;
    flex-shrink: 0;
}

.hvp-panel--theater .hvp-thumb-wrap {
    width: 90px;
    height: 51px;
}

.hvp-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hvp-thumb-play {
    position: absolute;
    inset: 0;
    background: rgba(12, 24, 19, 0.35);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.hvp-item:hover .hvp-thumb-play,
.hvp-item.is-playing .hvp-thumb-play {
    opacity: 1;
}

.hvp-item.is-playing .hvp-thumb-play {
    background: rgba(29, 92, 63, 0.68);
    font-size: 13px;
    font-weight: 800;
}

.hvp-dur-badge {
    position: absolute;
    right: 4px;
    bottom: 4px;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1.3;
}

.hvp-new-badge {
    position: absolute;
    left: 4px;
    top: 4px;
    padding: 1px 5px;
    border-radius: 4px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.hvp-short-badge {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 4px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 9px;
    font-weight: 800;
    margin-right: 4px;
}

.hvp-item-info {
    flex: 1;
    min-width: 0;
}

.hvp-item-title {
    font-size: 11.8px;
    font-weight: 700;
    color: #21372e;
    line-height: 1.32;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hvp-item.is-playing .hvp-item-title {
    color: #164e35;
    font-weight: 800;
}

.hvp-item-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 3px;
    font-size: 10px;
    color: #6b7d70;
}

.hvp-item-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.hvp-item-yt {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #e5d5b8;
    background: #fff9ed;
    color: #b91c1c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.14s ease;
}

.hvp-item-yt:hover {
    background: #fee2e2;
    border-color: #f87171;
    transform: scale(1.06);
}

/* ── Panel Footer (hidden to avoid duplicate buttons with header) ── */
.hvp-footer {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 11px;
    background: #f5ecda;
    border-top: 1px solid #e1d3b5;
    flex-shrink: 0;
}

.hvp-footer-btn {
    flex: 1;
    height: 32px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid #2d5c46;
    background: linear-gradient(135deg, #2d5c46, #204534);
    color: #fff9eb;
    font-size: 11.5px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: filter 0.15s ease;
}

.hvp-footer-btn:hover {
    filter: brightness(1.08);
}

.hvp-footer-btn--yt {
    flex: 0 0 auto;
    background: #fffdf8;
    color: #b91c1c;
    border-color: #deb8b8;
}

.hvp-footer-btn--yt:hover {
    background: #fef2f2;
    border-color: #f87171;
}

/* ── Responsive Adjustments for Mobile / Tablet ── */
@media (max-width: 860px) {
    .hvp-panel.hvp-panel--theater {
        inset: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-width: 100vw;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .hvp-panel--theater .hvp-body {
        flex-direction: column;
    }

    .hvp-panel--theater .hvp-stage {
        flex: 0 0 auto;
        border-right: none;
        border-bottom: 1px solid #dfd1b4;
    }

    .hvp-panel--theater.has-comments-open .hvp-stage {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }

    .hvp-panel--theater.has-comments-open .hvp-browser {
        display: none;
    }

    .hvp-panel--theater .hvp-player-box,
    .hvp-panel--theater.has-comments-open .hvp-player-box {
        height: auto;
        aspect-ratio: 16 / 9;
        min-height: 210px;
        flex: none;
    }

    .hvp-panel--theater .hvp-browser {
        width: 100%;
        max-width: none;
        flex: 1;
    }
}

@media (max-width: 600px) {
    .hvp-panel.hvp-panel--card {
        right: 10px;
        left: 10px;
        bottom: 12px;
        width: auto;
        max-height: min(460px, calc(100dvh - 76px));
    }

    .hvp-mini-pill {
        right: 12px;
        bottom: 16px;
        padding: 8px 12px 8px 9px;
        font-size: 11.5px;
    }

    .hvp-sort-pill {
        display: none;
    }
}

/* ── Weekly Progressive YouTube Watch Milestone Banner (10p -> 10h) ── */
.hvp-watch-banner {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 7px 12px;
    background: linear-gradient(90deg, #fff7e6 0%, #fef3c7 100%);
    border-bottom: 1px solid #e6d3a3;
    flex-shrink: 0;
}

.hvp-watch-banner.is-met {
    background: linear-gradient(90deg, #ecfdf5 0%, #d1fae5 100%);
    border-bottom-color: #86efac;
}

.hvp-watch-banner.is-warning {
    background: linear-gradient(90deg, #fef2f2 0%, #fee2e2 100%);
    border-bottom-color: #fca5a5;
}

.hvp-watch-banner.is-warning .hvp-watch-row {
    color: #991b1b;
}

.hvp-watch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    color: #78350f;
}

.hvp-watch-banner.is-met .hvp-watch-row {
    color: #065f46;
}

.hvp-watch-label {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hvp-watch-right {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.hvp-watch-time {
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10.2px;
    font-weight: 900;
    background: rgba(217, 119, 6, 0.16);
    color: #92400e;
    flex-shrink: 0;
}

.hvp-watch-banner.is-met .hvp-watch-time {
    background: rgba(16, 185, 129, 0.2);
    color: #047857;
}

.hvp-watch-tiers-btn {
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(180, 83, 9, 0.35);
    background: #fffbeb;
    color: #92400e;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.hvp-watch-tiers-btn:hover {
    background: #fde68a;
    border-color: #b45309;
}

.hvp-watch-banner.is-met .hvp-watch-tiers-btn {
    border-color: rgba(5, 150, 105, 0.35);
    background: #ecfdf5;
    color: #065f46;
}

.hvp-watch-track {
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: rgba(180, 83, 9, 0.16);
    overflow: hidden;
}

.hvp-watch-banner.is-met .hvp-watch-track {
    background: rgba(5, 150, 105, 0.18);
}

.hvp-watch-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #f59e0b, #ea580c);
    transition: width 0.35s ease;
}

.hvp-watch-banner.is-met .hvp-watch-fill {
    background: linear-gradient(90deg, #10b981, #059669);
}

.hvp-milestones-drawer {
    display: none;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px dashed rgba(180, 83, 9, 0.28);
    max-height: 185px;
    overflow-y: auto;
}

.hvp-milestones-drawer.is-open {
    display: flex;
}

.hvp-milestones-note {
    font-size: 9.8px;
    font-weight: 700;
    color: #92400e;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 2px;
}

.hvp-watch-banner.is-met .hvp-milestones-note {
    color: #065f46;
}

.hvp-milestone-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(217, 119, 6, 0.22);
    font-size: 10.2px;
    color: #451a03;
}

.hvp-milestone-item.is-claimed {
    background: rgba(209, 250, 229, 0.85);
    border-color: rgba(16, 185, 129, 0.4);
    color: #064e3b;
}

.hvp-milestone-item.is-next {
    background: #fffbeb;
    border-color: #f59e0b;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25);
    font-weight: 800;
}

.hvp-milestone-item.is-jackpot {
    background: linear-gradient(90deg, rgba(254, 243, 199, 0.95), rgba(253, 230, 138, 0.9));
    border-color: #d97706;
}

.hvp-milestone-left {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 800;
    white-space: nowrap;
}

.hvp-milestone-right {
    text-align: right;
    font-weight: 700;
}


/* ==========================================================================
   YouTube Comment Verification Drawer (Copy Signature -> Open YT -> Verify)
   ========================================================================== */

.hvp-stage-btn--comment {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.38));
    border-color: rgba(52, 211, 153, 0.45);
    color: #ecfdf5;
}

.hvp-stage-btn--comment:hover,
.hvp-stage-btn--comment.is-active {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: #6ee7b7;
    color: #ffffff;
}

.hvp-cmt-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 16px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
}

.hvp-comments-panel {
    display: none;
    flex: 0 0 100%;
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(11, 24, 19, 0.88);
    border: 1px solid rgba(52, 211, 153, 0.28);
    color: #e6efe9;
    flex-direction: column;
    gap: 8px;
}

.hvp-comments-panel.is-open {
    display: flex;
}

.hvp-cmt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.hvp-cmt-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 800;
    color: #ecfdf5;
}

.hvp-cmt-policy-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(52, 211, 153, 0.35);
    color: #a7f3d0;
}

.hvp-cmt-close-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 5px;
}

.hvp-cmt-close-btn:hover {
    color: #ffffff;
}

.hvp-cmt-form,
.hvp-cmt-step-box {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 9px 11px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.hvp-cmt-step-box--pending {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(251, 191, 36, 0.45);
}

.hvp-cmt-step-box--verified {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(52, 211, 153, 0.45);
}

.hvp-cmt-step-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: #fef3c7;
}

.hvp-cmt-step-badge {
    font-size: 9.5px;
    font-weight: 900;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 999px;
    background: #f59e0b;
    color: #451a03;
}

.hvp-cmt-input {
    width: 100%;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.07);
    color: #fff9eb;
    font-family: inherit;
    font-size: 11.5px;
    line-height: 1.4;
    resize: vertical;
}

.hvp-cmt-input:focus {
    outline: none;
    border-color: #34d399;
    background: rgba(255, 255, 255, 0.11);
}

.hvp-cmt-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.hvp-cmt-hint {
    font-size: 10.5px;
    color: #a7f3d0;
    line-height: 1.35;
    flex: 1 1 220px;
}

.hvp-cmt-form-btns {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hvp-cmt-submit-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #f59e0b;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.12s ease;
}

.hvp-cmt-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #fbbf24, #b45309);
}

.hvp-cmt-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hvp-cmt-copy-preview {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hvp-cmt-copy-label {
    font-size: 10.5px;
    color: #fde68a;
}

.hvp-cmt-copy-box {
    padding: 7px 10px;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px dashed rgba(251, 191, 36, 0.55);
    color: #fffbeb;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.4;
    word-break: break-word;
}

.hvp-cmt-copy-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.hvp-cmt-secondary-btn {
    padding: 4px 9px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
    color: #f3f4f6;
    font-size: 10.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.hvp-cmt-secondary-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.hvp-cmt-verify-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 2px;
}

.hvp-cmt-verify-btn {
    width: 100%;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid #34d399;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    transition: transform 0.12s ease, opacity 0.15s ease;
}

.hvp-cmt-verify-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #059669, #047857);
}

.hvp-cmt-verify-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.hvp-cmt-verified-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11.5px;
    color: #a7f3d0;
}

.hvp-cmt-yt-link {
    font-size: 10.5px;
    font-weight: 800;
    color: #fef08a;
    text-decoration: none;
}

.hvp-cmt-yt-link:hover {
    text-decoration: underline;
}

.hvp-cmt-verified-meta {
    font-size: 10.5px;
    color: #d1fae5;
}

.hvp-cmt-sig-pill {
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fef3c7;
    font-weight: 800;
}

.hvp-cmt-verified-quote {
    font-size: 11.5px;
    font-style: italic;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.22);
    padding: 5px 8px;
    border-radius: 6px;
}

.hvp-cmt-error {
    padding: 6px 9px;
    border-radius: 7px;
    background: rgba(185, 28, 28, 0.38);
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: #fecaca;
    font-size: 11px;
    font-weight: 700;
}

.hvp-cmt-feedback {
    padding: 6px 9px;
    border-radius: 7px;
    background: rgba(5, 150, 105, 0.32);
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: #d1fae5;
    font-size: 11px;
    font-weight: 700;
}

.hvp-cmt-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 155px;
    overflow-y: auto;
    padding-right: 2px;
}

.hvp-cmt-empty {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    padding: 8px 4px;
}

.hvp-cmt-item {
    padding: 6px 9px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hvp-cmt-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.hvp-cmt-author {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: #fef3c7;
}

.hvp-cmt-badge {
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    text-decoration: none;
}

.hvp-cmt-badge--synced {
    background: rgba(16, 185, 129, 0.22);
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: #6ee7b7;
}

.hvp-cmt-del-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 11px;
    opacity: 0.7;
    padding: 0 3px;
}

.hvp-cmt-del-btn:hover {
    opacity: 1;
}

.hvp-cmt-body {
    font-size: 11.5px;
    color: #f3f4f6;
    line-height: 1.38;
    word-break: break-word;
}
