/* TeleLive — stream watch page only (loaded from stream.php) */



/* /live: never leave player/info/chat invisible if skeleton JS is slow or HLS never fires */
body.page-stream.tl-stream-page-ready .tl-sk-mount--stream-player .tl-sk-real,
body.page-stream.tl-stream-page-ready .tl-sk-mount--stream-mob-info .tl-sk-real,
body.page-stream.tl-stream-page-ready .tl-sk-mount--stream-chat .tl-sk-real {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: relative !important;
}


body.page-stream.tl-stream-page-ready .tl-sk-mount--stream-player .tl-sk-layer,
body.page-stream.tl-stream-page-ready .tl-sk-mount--stream-mob-info .tl-sk-layer,
body.page-stream.tl-stream-page-ready .tl-sk-mount--stream-chat .tl-sk-layer {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: none !important;
}



/* Stream watch page (/username/live) — skeleton overlays real content (no double height) */
.tl-sk-mount--stream-player {
    position: relative;
    width: 100%;
    min-height: 0;
}


.tl-sk-mount--stream-player:not(.is-loaded) {
    aspect-ratio: 16 / 9;
    max-height: min(72vh, 720px);
}


.tl-sk-mount--stream-player .tl-sk-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}


.tl-sk-mount--stream-player.is-loaded .tl-sk-layer {
    display: none !important;
}


.tl-sk-mount--stream-player .tl-sk-stream-player,
.tl-sk-mount--stream-player .tl-sk-stream-player__box {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    aspect-ratio: unset;
}


.tl-sk-mount--stream-chat {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-self: start;
}


.tl-sk-mount--stream-chat .tl-sk-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}


.tl-sk-mount--stream-chat.is-loaded .tl-sk-layer {
    display: none !important;
}


.tl-sk-mount--stream-chat .tl-sk-real.chat-panel {
    flex: 1;
    min-height: 0;
    width: 100%;
}



/* Stream grids: same overlay pattern — skeleton cards must not stretch to full mount height */
.tl-sk-mount--streams:not(.is-loaded) .tl-sk-real {
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    visibility: hidden;
    pointer-events: none;
}


.tl-sk-mount--streams:not(.is-loaded) .tl-sk-layer {
    position: relative;
    inset: auto;
}


.tl-sk-mount--streams.is-loaded .tl-sk-real {
    position: relative;
}


.tl-sk-mount--streams .tl-sk-layer .streams-grid {
    align-content: start;
}


.tl-sk-mount--streams .stream-card--skeleton {
    height: auto;
    align-self: start;
}



/* Stream watch: skeleton overlay (player, mob-info-bar, chat) */
.tl-sk-mount--stream-player:not(.is-loaded) .tl-sk-real,
.tl-sk-mount--stream-mob-info:not(.is-loaded) .tl-sk-real,
.tl-sk-mount--stream-chat:not(.is-loaded) .tl-sk-real {
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    visibility: hidden;
    pointer-events: none;
}


.tl-sk-mount--stream-player:not(.is-loaded) .tl-sk-layer,
.tl-sk-mount--stream-mob-info:not(.is-loaded) .tl-sk-layer,
.tl-sk-mount--stream-chat:not(.is-loaded) .tl-sk-layer {
    position: relative;
    inset: auto;
}


.tl-sk-mount--stream-player.is-loaded .tl-sk-real,
.tl-sk-mount--stream-mob-info.is-loaded .tl-sk-real,
.tl-sk-mount--stream-chat.is-loaded .tl-sk-real {
    position: relative;
}


.tl-sk-mount--stream-player:not(.is-loaded) {
    width: 100%;
}


.tl-sk-mount--stream-mob-info {
    width: 100%;
    flex-shrink: 0;
}



/* Stream page watch UI — card .stream-info lives in style.css (home/browse grids) */
.stream-page {
    width: 100%;
    max-width: 100%;
    margin: 12px 0 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    column-gap: 14px;
    align-items: start;
    box-sizing: border-box;
}



/* Stream page: tl-left-sidebar visible — removed hide rule */
body.page-stream .tl-page-content {
    padding-inline-start: 0;
}



/* Left column: player stacked above info/tab bar */
.stream-left-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 10px;
}



.stream-main {
    min-width: 0;
}



/* Info/tab bar card (desktop) */
.stream-page .mobile-tab-bar {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-elev-1);
}



.player-wrapper {
    aspect-ratio: 16 / 9;
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    /* Fallback height for browsers that don't support aspect-ratio */
    min-height: 0;
}



.player-live-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    border-radius: 999px;
    padding: 4px 10px;
    background: rgba(244, 63, 94, 0.92);
    font-weight: 800;
    font-size: 12px;
    color: #fff;
    pointer-events: none;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 0;
}


.player-top-right-stack .player-mob-tray {
    pointer-events: auto;
}


.player-live-duration {
    display: inline-block;
    margin-inline-start: 7px;
    font-size: .78em;
    font-weight: 600;
    letter-spacing: .04em;
    font-variant-numeric: tabular-nums;
    opacity: .88;
    min-width: 3.6em;
    text-align: end;
    transition: opacity .25s ease, max-width .3s ease, margin .3s ease;
    white-space: nowrap;
    vertical-align: middle;
}


/* Hide only the running timer when pointer is idle (LIVE + dot stay put — no layout jump) */
.player-wrapper:not(.player-live-awake) .player-live-duration {
    opacity: 0;
    max-width: 0;
    min-width: 0;
    margin-inline-start: 0;
    overflow: hidden;
    padding: 0;
}


#streamPageWrap:fullscreen .stream-left-col,
#streamPageWrap:-webkit-full-screen .stream-left-col {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}


#streamPageWrap:fullscreen .stream-main,
#streamPageWrap:-webkit-full-screen .stream-main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}


#streamPageWrap:fullscreen .player-wrapper,
#streamPageWrap:-webkit-full-screen .player-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    height: 100% !important;
}


#streamPageWrap:fullscreen .mobile-tab-bar,
#streamPageWrap:-webkit-full-screen .mobile-tab-bar,
#streamPageWrap:fullscreen .stream-info-bar,
#streamPageWrap:-webkit-full-screen .stream-info-bar {
    display: none !important;
}


#streamPageWrap:fullscreen.tl-mobfs-chat-on .chat-panel,
#streamPageWrap:-webkit-full-screen.tl-mobfs-chat-on .chat-panel {
    transform: translateX(0);
}


/* Fullscreen slide-in chat: hide heavy chrome so typing is easier */
#streamPageWrap:fullscreen.tl-mobfs-chat-on .chat-panel .chat-header,
#streamPageWrap:-webkit-full-screen.tl-mobfs-chat-on .chat-panel .chat-header,
#streamPageWrap:fullscreen.tl-mobfs-chat-on .chat-panel .chat-events-panel,
#streamPageWrap:-webkit-full-screen.tl-mobfs-chat-on .chat-panel .chat-events-panel {
    display: none !important;
}


/* Mobile / tablet: viewer + fullscreen chat control on the player (top-right) */
.player-mob-tray {
    display: none;
    position: relative;
    top: auto;
    inset-inline-end: auto;
    z-index: 55;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}


#streamPageWrap:fullscreen .player-mob-tray .tl-mobfs-chat-btn,
#streamPageWrap:-webkit-full-screen .player-mob-tray .tl-mobfs-chat-btn {
    display: inline-flex;
}


.player-mob-viewer {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e8e8f0;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}


.player-mob-viewer i {
    font-size: 0.72rem;
    opacity: 0.9;
}


.tl-mobfs-chat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: rgba(30, 86, 245, 0.92);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, background 0.15s ease;
}


.tl-mobfs-chat-btn:active {
    transform: scale(0.96);
}


.tl-mobfs-chat-btn i {
    font-size: 1.05rem;
}


#streamPageWrap:fullscreen .tl-mobfs-chat-btn[aria-expanded="true"],
#streamPageWrap:-webkit-full-screen .tl-mobfs-chat-btn[aria-expanded="true"] {
    background: rgba(20, 60, 180, 0.95);
}


html.tl-mobfs-fullscreen-page,
html.tl-mobfs-fullscreen-page body {
    overflow: hidden !important;
}


.player-wrapper:hover .player-controls-bar,
.player-wrapper:focus-within .player-controls-bar {
    opacity: 1;
}


/* Fullscreen: hide controls + cursor when mouse idle (JS adds controls-active on mousemove) */
.player-wrapper:-webkit-full-screen .player-controls-bar,
.player-wrapper:fullscreen .player-controls-bar {
    opacity: 0;
    transition: opacity 0.3s;
}


.player-wrapper:-webkit-full-screen.controls-active .player-controls-bar,
.player-wrapper:fullscreen.controls-active .player-controls-bar {
    opacity: 1;
}


.player-wrapper:-webkit-full-screen {
    cursor: none;
}


.player-wrapper:fullscreen {
    cursor: none;
}


.player-wrapper:-webkit-full-screen.controls-active,
.player-wrapper:fullscreen.controls-active {
    cursor: default;
}


.player-ctrl-btn {
    border: none;
    background: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.15s;
    display: flex;
    align-items: center;
}


.player-ctrl-btn:hover {
    background: rgba(255,255,255,0.15);
}


.create-clip-btn {
    color: #f472b6;
}


.create-clip-btn:hover {
    color: #fbcfe8;
    background: rgba(236, 72, 153, .18);
}


.create-clip-btn:disabled {
    opacity: .55;
    cursor: wait;
}



/* Clip create modal (Twitch-style) */
.tl-clip-modal {
    position: fixed;
    inset: 0;
    z-index: 100060;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}


.tl-clip-modal--open {
    display: flex !important;
}


html.tl-clip-modal-open,
body.tl-clip-modal-open {
    overflow: hidden;
}


.tl-clip-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .78);
}


.tl-clip-modal__card {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    background: var(--bg-elev-2, #18181b);
    border: 1px solid var(--line, #2f2f39);
    border-radius: 14px;
    padding: 20px 20px 18px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .55);
}


.tl-clip-modal__close {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    background: none;
    border: none;
    color: var(--text-muted, #888);
    font-size: 1.05rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}


.tl-clip-modal__close:hover { color: #fff; background: rgba(255,255,255,.08); }


.tl-clip-modal__title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text, #f3f3ff);
    display: flex;
    align-items: center;
    gap: 8px;
}


.tl-clip-modal__title i { color: #f472b6; }


.tl-clip-modal__hint,
.tl-clip-modal__note {
    margin: 0 0 12px;
    font-size: .78rem;
    color: var(--text-muted, #9ca3af);
    line-height: 1.45;
}


.tl-clip-modal__label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted, #aaa);
    margin-bottom: 6px;
}


.tl-clip-modal__input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line, #333);
    background: var(--bg, #0e0e12);
    color: #fff;
    font-size: .88rem;
    margin-bottom: 14px;
    outline: none;
}


.tl-clip-modal__input:focus { border-color: #f472b6; }


.tl-clip-modal__dur-row { margin-bottom: 10px; }


.tl-clip-modal__range {
    width: 100%;
    accent-color: #f472b6;
    margin: 4px 0 6px;
}


.tl-clip-modal__dur-labels {
    display: flex;
    justify-content: space-between;
    font-size: .72rem;
    color: var(--text-muted, #888);
}


.tl-clip-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}


.tl-clip-modal__actions .btn-primary {
    background: linear-gradient(135deg, #ec4899, #f472b6);
    border: none;
}



.player-volume-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}


.player-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 70px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.3);
    outline: none;
    cursor: pointer;
}


.player-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}


.player-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
}


.player-ctrl-spacer {
    flex: 1;
}


/* ── Quality selector ── */
.player-quality-wrap {
    position: relative;
}


.player-quality-wrap .player-ctrl-btn.pq-trigger {
    gap: 4px;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .02em;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(10,10,16,.72);
}


.player-quality-menu.pq-menu {
    display: none;
    position: fixed;
    background: rgba(16,16,20,.97);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 14px;
    min-width: 220px;
    overflow: hidden;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0,0,0,.7);
    backdrop-filter: blur(8px);
}


.player-quality-menu.pq-menu.show {
    display: block;
}


body.page-stream .player-quality-menu.pq-menu.show {
    z-index: 100050 !important;
}


.pq-menu-header {
    padding: 10px 14px 8px;
    font-size: .72rem;
    font-weight: 600;
    color: rgba(255,255,255,.4);
    text-transform: uppercase;
    letter-spacing: .08em;
    border-bottom: 1px solid rgba(255,255,255,.07);
}


.player-quality-opt.pq-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    color: #ccc;
    padding: 10px 14px;
    text-align: left;
    cursor: pointer;
    font-size: .88rem;
    transition: background .12s;
    gap: 10px;
}


.player-quality-opt.pq-opt:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
}


.player-quality-opt.pq-opt.active {
    color: #fff;
    font-weight: 700;
    background: rgba(30,86,245,.2);
}


.player-quality-wrap .pq-opt {
    border-bottom: 1px solid rgba(255,255,255,.06);
}


.player-quality-wrap .pq-opt:last-child {
    border-bottom: none;
}


/* Badges */
.pq-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .6rem;
    font-weight: 800;
    letter-spacing: .04em;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    line-height: 1.4;
}


.pq-badge-hd {
    background: linear-gradient(135deg, #1e56f5, #5b8bff);
    color: #fff;
}


.pq-badge-sd {
    background: rgba(255,255,255,.15);
    color: rgba(255,255,255,.7);
}


.pq-badge-src {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    font-size: .58rem;
}



/* ── Player loading overlay ── */
.player-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(12, 14, 28, 0.82) 0%, rgba(0, 0, 0, 0.88) 70%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 4;
    gap: 14px;
    transition: opacity 0.3s;
    padding: 20px;
    text-align: center;
}

.player-loading__brand {
    position: relative;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-loading__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(30, 86, 245, 0.18);
    border-top-color: var(--brand, #1e56f5);
    border-right-color: rgba(244, 63, 94, 0.55);
    animation: spin 1.1s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.player-loading__live-badge {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.22);
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: #fecaca;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    animation: tlLiveBadgePulse 1.6s ease-in-out infinite;
}

.player-loading__live-badge i {
    font-size: 0.45rem;
    color: #f87171;
    animation: tlLiveDotBlink 1.2s ease-in-out infinite;
}

@keyframes tlLiveBadgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.25); }
    50% { box-shadow: 0 0 18px 2px rgba(248, 113, 113, 0.18); }
}

@keyframes tlLiveDotBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.player-loading__text {
    margin: 0;
    color: #e8e8f0;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    max-width: 280px;
    line-height: 1.45;
}

.player-loading__bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    height: 22px;
}

.player-loading__bars span {
    display: block;
    width: 4px;
    border-radius: 3px;
    background: linear-gradient(180deg, #60a5fa, var(--brand, #1e56f5));
    animation: tlLoadBar 1.05s ease-in-out infinite;
}

.player-loading__bars span:nth-child(1) { height: 10px; animation-delay: 0s; }
.player-loading__bars span:nth-child(2) { height: 18px; animation-delay: 0.15s; }
.player-loading__bars span:nth-child(3) { height: 12px; animation-delay: 0.3s; }

@keyframes tlLoadBar {
    0%, 100% { transform: scaleY(0.45); opacity: 0.55; }
    50% { transform: scaleY(1); opacity: 1; }
}

.player-loading .spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(30,86,245,0.25);
    border-top-color: var(--brand, #1e56f5);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}



/* ── Player retry button ── */
.player-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid rgba(30,86,245,0.5);
    background: rgba(30,86,245,0.15);
    color: #d4b8ff;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.2s;
}


.player-retry-btn:hover {
    background: rgba(30,86,245,0.3);
}



.player-error-msg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
    text-align: center;
    padding: 20px;
    z-index: 6;
}



.player-wrapper .player-placeholder {
    min-height: 100%;
}



.stream-info-bar {
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-elev-1);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}



.stream-info-right,
.stream-info-left {
    display: flex;
    align-items: center;
    gap: 12px;
}



/* Uniform height for all action buttons in stream-info-bar */
.stream-info-left .btn,
.stream-info-left .tl-btn-donate,
.stream-info-left .tl-btn-subscribe,
.stream-info-left .tl-btn-subbed,
.stream-info-left .tl-btn-giftsub,
.stream-info-left .stream-notif-btn {
    min-height: 42px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
}



/* ============================================================
   Player quality wrap
   ============================================================ */
.player-quality-wrap .pq-opt {
    transition: all .12s;
}


.player-quality-wrap .pq-opt:hover {
    background: rgba(255,255,255,.06) !important;
    color: #fff !important;
}


.tl-goal-tile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 12px 11px;
    border-radius: 12px;
    border: 1px solid var(--line, #2a2f3d);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.04) 0%, rgba(0, 0, 0, 0.18) 100%);
    min-width: 0;
}


.tl-goal-tile--follow {
    border-color: rgba(244, 63, 94, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}


.tl-goal-tile--sub {
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}


.tl-goal-tile--tele {
    border-color: rgba(249, 115, 22, 0.38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}


.tl-goal-tile__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}


.tl-goal-tile__label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted, #9a9aad);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}


.tl-goal-tile__nums {
    margin: 0;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    font-variant-numeric: tabular-nums;
}


.tl-goal-tile__cur {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--text, #f4f4f8);
    line-height: 1;
}


.tl-goal-tile__sep {
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.35);
}


.tl-goal-tile__tgt {
    font-size: 0.95rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.72);
}


.tl-goal-tile__track {
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}


.tl-goal-tile__fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.35s ease;
}


.tl-goal-tile__fill--follow {
    background: linear-gradient(90deg, #e11d48, #fb7185);
}


.tl-goal-tile__fill--sub {
    background: linear-gradient(90deg, #7c3aed, #818cf8);
}


.tl-goal-tile__fill--tele {
    background: linear-gradient(90deg, #c2410c, #f97316);
}



/* Mobile tab bar — hidden on non-stream pages, shown inside .stream-page */
body:not(.page-stream) .mobile-tab-bar { display: none; }



/* ── mob-info-bar: global rules (desktop + mobile base) ── */
.mob-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    gap: 8px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--line, #2f2f39);
}


.mob-info-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
}


.mob-info-bar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}


/* Tab navigation row */
.mob-tab-nav {
    display: flex;
    flex-direction: row;
    flex-shrink: 0;
    border-bottom: 1px solid var(--line, #2f2f39);
}


/* Info panel wrap */
.mob-info-panel-wrap { display: none; }


.stream-page[data-mob-tab="info"] .mob-info-panel-wrap {
    display: flex;
    flex-direction: column;
}


.channel-about.mob-info-panel { padding: 12px 12px 16px; }


/* Compact viewer count inside mob-info-bar actions (desktop strip) */
@media (min-width: 769px) {
    .mob-info-bar-actions .viewer-count {
        padding: 5px 9px;
        min-height: 34px;
        font-size: .78rem;
        border-radius: 999px;
        gap: 4px;
    }
}



/* Pinned / follow-only / streamer-warn bars — visibility via .is-open (not inline display) */
body.page-stream .chat-panel > #pinnedMsgBar:not(.is-open),
body.page-stream .chat-panel > #streamerWarnBar:not(.is-open),
body.page-stream .chat-panel > #followOnlyBar:not(.is-open) {
    display: none !important;
}


body.page-stream .chat-panel > #pinnedMsgBar.is-open,
body.page-stream .chat-panel > #followOnlyBar.is-open {
    display: flex !important;
    align-items: flex-start;
    flex-shrink: 0 !important;
    min-width: 0;
    max-width: 100%;
    padding-inline-end: 36px;
    box-sizing: border-box;
}

body.page-stream .chat-panel > #pinnedMsgBar.is-open #pinnedMsgText {
    min-width: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    white-space: normal;
    word-break: break-word;
}

body.page-stream .chat-panel > #pinnedMsgBar.is-open .pinned-msg-unpin,
body.page-stream .chat-panel > #pinnedMsgBar.is-open #unpinMsgBtn,
body.page-stream .chat-panel > #pinnedMsgBar.is-open #pinnedDismissBtn {
    top: 6px;
    transform: none;
}


body.page-stream .chat-panel > #streamerWarnBar.is-open {
    display: block !important;
    flex-shrink: 0 !important;
}


.mob-tab-donate {
    text-decoration: none;
    color: #f59e0b !important;
    border-bottom-color: transparent !important;
}


.mob-tab-donate i {
    color: #f59e0b;
}



/* ── Cheer / gift events: compact linear strip (avatar + tele, same on all sizes) ─── */
.chat-events-panel {
    position: relative;
    width: 100%;
    margin: 0 0 8px;
    padding: 0;
    background: linear-gradient(180deg, rgba(30,86,245,.08), rgba(0,0,0,.12));
    border: none;
    border-bottom: 1px solid rgba(255,255,255,.08);
    border-radius: 0 0 10px 10px;
    box-shadow: none;
    flex-shrink: 0;
}


.popout-chat-wrap .chat-events-panel {
    margin: 0 10px 8px;
}


.cep-cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex: 1 1 0;
    min-width: 0;
    padding: 4px 6px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .2);
    border: 1px solid rgba(255, 255, 255, .06);
    box-sizing: border-box;
}


.cep-cell--r1 {
    border-color: rgba(30, 86, 245, .28);
}


.cep-cell--empty {
    opacity: .4;
    pointer-events: none;
}


.cep-cell--gift .cep-pav {
    border-color: #a970ff;
}


.cep-cell--cheer .cep-pav {
    border-color: #1e56f5;
}



/* ──────────────────────────────────────────────────────────────
   /live PAGE — RESPONSIVE POLISH (mobile / iPad / desktop)
   Same visual language, tightened layout & breakpoints.
   ────────────────────────────────────────────────────────────── */

/* /live: full-bleed within .tl-page-content; wide screens get more video + chat space */
.stream-page {
    width: 100%;
    max-width: 100%;
    column-gap: 16px;
    box-sizing: border-box;
}


body.page-stream .tl-page-content {
    padding-inline: max(4px, env(safe-area-inset-left, 0px)) max(4px, env(safe-area-inset-right, 0px));
    box-sizing: border-box;
}


.stream-left-col { gap: 12px; }



/* Bullet-proof: never let any flex/grid child overflow horizontally */
.stream-page,
.stream-page * {
    min-width: 0;
}


/* Mob-info grid (phone only): equal cell width */
@media (max-width: 768px) {
    .stream-page .mob-info-bar-actions > .mob-info-btn,
    .stream-page .mob-info-bar-actions > .viewer-count,
    .stream-page .mob-info-bar-actions > #streamMoreWrap {
        min-width: 0;
        width: 100%;
        flex-shrink: 1 !important;
        box-sizing: border-box;
    }

    .stream-page .mob-info-bar-actions > .mob-info-btn.mob-info-btn-txt {
        min-width: 0 !important;
        width: 100% !important;
    }
}



/* /live: viewer pills match donate/sub button radius */
body.page-stream .viewer-count,
body.page-stream .player-mob-viewer,
body.page-stream .mob-info-bar-actions > .viewer-count,
body.page-stream #viewerCountWrap,
body.page-stream #viewerCountMobPlayer {
    border-radius: 10px !important;
}


.player-wrapper {
    aspect-ratio: 16 / 9;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}



/* Stream info bar — clip overflow gracefully */
.stream-info-bar {
    overflow: hidden;
}


.stream-info-bar .stream-title {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}


/* Live watch page: compact strip below the video */
.tl-stream-inline-ad-outer {
    width: 100%;
    padding: 6px 10px 10px;
}

.tl-yn-stream-outer {
    width: 100%;
    padding: 6px 10px 10px;
}


.tl-stream-inline-ad-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
}


.tl-stream-inline-ad {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: min(960px, 100%);
    text-decoration: none;
    color: inherit;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--bg-elev-2, rgba(24, 24, 30, 0.92));
    border: 1px solid var(--line, #2e2e34);
}


.tl-stream-inline-ad img {
    display: block;
    width: 120px;
    min-width: 96px;
    max-width: 36%;
    flex-shrink: 0;
    height: auto;
    min-height: 48px;
    max-height: 80px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--bg-elev-3, #25252b);
}
.tl-stream-inline-ad--static {
    cursor: default;
}


.tl-stream-inline-ad__txt {
    flex: 1;
    min-width: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}



.tl-preroll-overlay {
    position: absolute;
    inset: 0;
    z-index: 120;
    pointer-events: auto;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
}


.tl-preroll-video {
    flex: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}


.tl-preroll-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 14px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    z-index: 125;
    pointer-events: auto;
}


.tl-preroll-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    color: #111;
    background: linear-gradient(135deg, #fde68a, #fbbf24);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    max-width: min(58vw, 280px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
    z-index: 126;
}


.tl-preroll-cta:hover {
    filter: brightness(1.06);
    color: #111;
}


.tl-preroll-overlay--gone {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
    z-index: -1 !important;
}


.tl-preroll-skip {
    position: relative;
    z-index: 126;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.92);
    color: #111;
}


.tl-preroll-skip:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}



#tlPrerollOverlay .tl-preroll-placeholder-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* /live phone: force equal-width action cells (viewer / bell / more = follow / sub / donate) */
@media (max-width: 768px) {
    body.page-stream .stream-page .mob-info-bar-actions {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        align-items: stretch !important;
    }
    body.page-stream .stream-page .mob-info-bar-actions > *,
    body.page-stream .stream-page .mob-info-bar-actions .mob-info-btn,
    body.page-stream .stream-page .mob-info-bar-actions .viewer-count,
    body.page-stream .stream-page .mob-info-bar-actions #streamMoreWrap {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 44px !important;
        border-radius: 10px !important;
        flex-shrink: 1 !important;
        box-sizing: border-box !important;
    }
    body.page-stream .stream-page .mob-info-bar-actions #streamMoreWrap {
        display: flex !important;
    }
    body.page-stream .stream-page .mob-info-bar-actions #streamMoreWrap .mob-info-btn {
        width: 100% !important;
        flex: 1 1 auto !important;
    }
}

/* Streamer warn modal */
.tl-sw-modal {
    position: fixed;
    inset: 0;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.tl-sw-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
}
.tl-sw-modal__card {
    position: relative;
    width: min(520px, 96vw);
    max-height: 92vh;
    overflow-y: auto;
    padding: 22px 24px;
    border-radius: 16px;
    border: 1px solid rgba(248, 113, 113, 0.25);
    background: linear-gradient(165deg, #1f1418 0%, #141418 55%, #12121a 100%);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}
.tl-sw-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: #888;
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
}
.tl-sw-modal__head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-right: 28px;
}
.tl-sw-modal__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(185, 28, 28, 0.18);
    color: #f87171;
    flex-shrink: 0;
}
.tl-sw-modal__title {
    margin: 0 0 4px;
    font-size: 1.05rem;
    color: #fecaca;
}
.tl-sw-modal__sub {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted, #a6a6b2);
    line-height: 1.5;
}
.tl-sw-modal__section { margin-bottom: 14px; }
.tl-sw-modal__section--internal {
    padding: 12px;
    border-radius: 12px;
    border: 1px dashed rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.06);
}
.tl-sw-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #bbb;
    margin-bottom: 6px;
}
.tl-sw-select,
.tl-sw-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #3a3a44;
    background: #0e0e12;
    color: #fff;
    font-size: 0.88rem;
    resize: vertical;
}
.tl-sw-textarea--internal {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(0, 0, 0, 0.25);
}
.tl-sw-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-sw-preset {
    font-size: 0.72rem;
    padding: 6px 10px;
    line-height: 1.35;
    border-radius: 999px;
    border: 1px solid #444;
    background: rgba(255, 255, 255, 0.03);
    color: #ddd;
    cursor: pointer;
}
.tl-sw-preset.is-active,
.tl-sw-preset:hover {
    border-color: #b91c1c;
    color: #fca5a5;
    background: rgba(185, 28, 28, 0.12);
}
.tl-sw-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tl-sw-upload__input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}
.tl-sw-upload__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #444;
    background: rgba(255, 255, 255, 0.04);
    color: #eee;
    font-size: 0.82rem;
    cursor: pointer;
}
.tl-sw-upload__btn:hover { border-color: var(--brand, #1e56f5); color: #fff; }
.tl-sw-upload__name { font-size: 0.78rem; color: var(--text-muted, #a6a6b2); }
.tl-sw-upload__preview { margin-top: 8px; }
.tl-sw-upload__img {
    max-width: 100%;
    max-height: 160px;
    border-radius: 10px;
    border: 1px solid #333;
    display: block;
}
.tl-sw-msg { margin-top: 8px; font-size: 0.82rem; min-height: 1.2em; text-align: center; }
.tl-sw-modal__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 12px;
}
#streamerWarnSend { background: #b91c1c; border-color: #b91c1c; }
.streamer-warn-bar__evidence { display: block; margin-top: 8px; }
.streamer-warn-bar__evidence img {
    max-width: 100%;
    max-height: 120px;
    border-radius: 8px;
    border: 1px solid rgba(248, 113, 113, 0.35);
}
.chat-msg-streamer-warn-evidence { display: block; margin-top: 8px; }
.chat-msg-streamer-warn-evidence img {
    max-width: min(100%, 280px);
    max-height: 160px;
    border-radius: 8px;
    border: 1px solid rgba(248, 113, 113, 0.35);
}

/* Stream-banned channel: header + sidebar only, centered message */
body.page-stream-banned .tl-page-content {
    min-height: calc(100vh - var(--header-h, 64px));
    display: flex;
    align-items: center;
    justify-content: center;
}
.tl-stream-banned-page {
    width: 100%;
    max-width: 560px;
    padding: 48px 24px;
    text-align: center;
}
.tl-stream-banned-page__inner {
    padding: 36px 28px;
    border-radius: 16px;
    background: rgba(127, 29, 29, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
}
.tl-stream-banned-page__icon {
    font-size: 3rem;
    color: #f87171;
    margin-bottom: 16px;
}
.tl-stream-banned-page__msg {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #fecaca;
    line-height: 1.55;
}
.tl-stream-banned-page__reason {
    margin: 14px 0 0;
    font-size: 0.88rem;
    color: #fca5a5;
    line-height: 1.6;
}