/* Larger shared-room viewing; the original video and comment thread stay in place. */
[data-club] .room-video-expand{display:block;width:max-content;max-width:calc(100% - 24px);margin:12px auto;padding:10px 18px;border-radius:24px;background:var(--panel);color:var(--ink);border:1px solid var(--line);font:600 15px/1.35 var(--sans);cursor:pointer}
[data-club] .room-video-expand:focus-visible{outline:3px solid var(--ink);outline-offset:3px}
body:is([data-page="insider-club"],[data-page="glass-lounge"],[data-page="marble-map"]) .club-post.social-post-card.is-thread-open.is-video-expanded{width:min(1240px,calc(100vw - 32px))!important;max-width:none;inset:16px 0 auto;height:calc(var(--thread-vh,100dvh) - 32px);max-height:calc(var(--thread-vh,100dvh) - 32px)}
.is-thread-open.is-video-expanded .insider-video-media{position:static;background:var(--paper)}
.is-thread-open.is-video-expanded .insider-video-media:has(.insider-youtube){position:sticky;top:0;z-index:2}
.is-thread-open.is-video-expanded .insider-youtube{position:sticky;top:0;z-index:2;width:100%;height:min(52dvh,600px,calc((100vw - 34px)*.5625));min-height:180px;aspect-ratio:auto;background:#07151c}
.is-thread-open.is-video-expanded .insider-youtube iframe{display:block;width:100%;height:100%;border:0}
.is-thread-open.is-video-expanded .room-live-player>button{height:100%;min-height:0}
.is-thread-open.is-video-expanded .insider-video-media .social-post-video{display:block;position:sticky;top:0;z-index:2;width:100%;height:auto;max-height:52dvh;margin:0;object-fit:contain;background:#07151c}
.is-video-expanded .room-video-expand{display:none!important}
.is-video-expanded .room-youtube-link{font-size:13px;padding:5px 16px;text-align:right}
@media(max-width:640px){
 body:is([data-page="insider-club"],[data-page="glass-lounge"],[data-page="marble-map"]) .club-post.social-post-card.is-thread-open.is-video-expanded{inset:var(--thread-vtop,0) 0 auto;width:100%!important;height:var(--thread-vh,100dvh);max-height:var(--thread-vh,100dvh);border-radius:0}
 .is-thread-open.is-video-expanded .insider-youtube{height:auto;aspect-ratio:16/9;min-height:0;max-height:48dvh}
 .is-thread-open.is-video-expanded .insider-youtube iframe{position:absolute;inset:0}
 .is-thread-open.is-video-expanded .room-live-player>button{min-height:0;aspect-ratio:16/9}
}
@media(max-height:540px){
 .is-thread-open.is-video-expanded .insider-youtube{height:48dvh;min-height:0;aspect-ratio:auto}
 .is-thread-open.is-video-expanded .insider-post-composer{max-height:32%}
}

/* Expanded video only: recover space without moving/recreating the player or replies. */
.is-thread-open.is-video-expanded .insider-thread-bar{grid-template-columns:auto minmax(0,1fr) 36px;gap:8px;padding:3px 10px}
.is-thread-open.is-video-expanded .insider-thread-bar h2{font-size:14px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.is-thread-open.is-video-expanded :is(.insider-thread-back,.insider-thread-close){box-sizing:border-box;min-width:36px;min-height:36px;height:36px;padding:0 8px;font-size:22px}
.is-thread-open.is-video-expanded .insider-thread-back span{font-size:12px}
.is-thread-open.is-video-expanded .insider-thread-close{padding:0}
.is-thread-open.is-video-expanded .insider-youtube{height:min(calc(56dvh + 32px),592px,calc((100vw - 34px)*.5625),calc(var(--thread-vh,100dvh) - 280px));min-height:100px;max-height:none;aspect-ratio:auto}
.is-thread-open.is-video-expanded .insider-video-media .social-post-video{max-height:min(calc(56dvh + 32px),592px,calc(var(--thread-vh,100dvh) - 280px))}
.is-thread-open.is-video-expanded .insider-video-media .room-youtube-link{font-size:12px;line-height:18px;padding:2px 12px;margin:0}
.is-thread-open.is-video-expanded .insider-thread-status:empty{display:none}
body:is([data-page="insider-club"],[data-page="glass-lounge"],[data-page="marble-map"]) .is-thread-open.is-video-expanded .club-post-actions{padding-block:0}
body:is([data-page="insider-club"],[data-page="glass-lounge"],[data-page="marble-map"]) .is-thread-open.is-video-expanded .insider-post-composer{padding:5px 10px calc(5px + env(safe-area-inset-bottom));max-height:40%}
body:is([data-page="insider-club"],[data-page="glass-lounge"],[data-page="marble-map"]) .is-thread-open.is-video-expanded .insider-comment-entry{grid-template-columns:minmax(0,1fr) 40px auto auto;align-items:center;gap:0 6px}
body:is([data-page="insider-club"],[data-page="glass-lounge"],[data-page="marble-map"]) .is-thread-open.is-video-expanded .room-comment-upload{grid-column:auto;align-self:center;justify-self:stretch;display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:42px;margin:0;border-radius:20px;white-space:nowrap}
.is-thread-open.is-video-expanded .room-comment-drafts:not(:empty){margin-top:6px}
.is-thread-open.is-video-expanded .room-comment-emoji{align-self:center}
@media(pointer:coarse){
 .is-thread-open.is-video-expanded .insider-thread-bar{grid-template-columns:auto minmax(0,1fr) 44px;padding-block:2px}
 .is-thread-open.is-video-expanded :is(.insider-thread-back,.insider-thread-close){min-width:44px;min-height:44px;height:44px}
}
@media(max-width:640px){
 .is-thread-open.is-video-expanded .insider-thread-bar{grid-template-columns:auto minmax(0,1fr) 44px;padding:2px 6px}
 .is-thread-open.is-video-expanded :is(.insider-thread-back,.insider-thread-close){min-width:44px;min-height:44px;height:44px}
 .is-thread-open.is-video-expanded .insider-thread-bar h2{font-size:13px}
 .is-thread-open.is-video-expanded .insider-youtube{height:min(calc((100vw - 2px)*.5625),calc(var(--thread-vh,100dvh) - 185px));min-height:90px}
 body:is([data-page="insider-club"],[data-page="glass-lounge"],[data-page="marble-map"]) .is-thread-open.is-video-expanded .insider-post-composer{padding-inline:6px}
 body:is([data-page="insider-club"],[data-page="glass-lounge"],[data-page="marble-map"]) .is-thread-open.is-video-expanded .insider-comment-form{gap:5px}
 body:is([data-page="insider-club"],[data-page="glass-lounge"],[data-page="marble-map"]) .is-thread-open.is-video-expanded .insider-comment-avatar{display:none}
 body:is([data-page="insider-club"],[data-page="glass-lounge"],[data-page="marble-map"]) .is-thread-open.is-video-expanded .insider-comment-entry{grid-template-columns:minmax(0,1fr) 40px auto auto;gap:0 4px}
 body:is([data-page="insider-club"],[data-page="glass-lounge"],[data-page="marble-map"]) .is-thread-open.is-video-expanded .insider-comment-entry>.primary{padding-inline:9px;min-height:44px}
 body:is([data-page="insider-club"],[data-page="glass-lounge"],[data-page="marble-map"]) .is-thread-open.is-video-expanded .room-comment-upload{min-height:44px;padding-inline:7px!important}
 .is-thread-open.is-video-expanded .room-comment-emoji button{width:40px;min-width:40px;min-height:44px}
}
@media(max-height:540px) and (min-width:641px){
 .is-thread-open.is-video-expanded .insider-youtube{height:max(90px,calc(var(--thread-vh,100dvh) - 245px));min-height:0}
}

/* One compact heading in expanded video view; keep the full post in the feed. */
.insider-thread-date{display:none}
.is-thread-open.is-video-expanded .insider-thread-bar h2{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;column-gap:10px;row-gap:1px;white-space:normal}
.is-thread-open.is-video-expanded .insider-thread-author{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.is-thread-open.is-video-expanded .insider-thread-post-label{display:none}
.is-thread-open.is-video-expanded .insider-thread-date{display:inline;font:400 12px/1.2 var(--sans);white-space:nowrap;color:var(--muted,var(--ink))}
body:is([data-page="insider-club"],[data-page="glass-lounge"],[data-page="marble-map"]) .is-thread-open.is-video-expanded .insider-post-scroll>:is(.club-post-head,.club-post-body,.club-read-more,.club-label,.room-live-status){display:none!important}
body:is([data-page="insider-club"],[data-page="glass-lounge"],[data-page="marble-map"]) .is-thread-open.is-video-expanded .club-post-actions{gap:0 4px;padding-inline:6px;margin-block:0}
.is-thread-open.is-video-expanded .club-post-actions .room-post-manage{flex-direction:row;flex-wrap:wrap}
@media(max-width:640px){.is-thread-open.is-video-expanded .insider-thread-date{font-size:11px}}

/* Move the external viewing link into the existing bar, reclaiming its own row. */
.insider-thread-youtube{display:none}
.is-thread-open.is-video-expanded .insider-thread-bar:has(.insider-thread-youtube){grid-template-columns:auto minmax(0,1fr) auto 36px}
.is-thread-open.is-video-expanded .insider-thread-youtube{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:36px;padding:0 8px;border:1px solid var(--line);border-radius:18px;background:transparent;color:var(--ink);font:600 12px/1.2 var(--sans);white-space:nowrap;text-decoration:none}
.is-thread-open.is-video-expanded .insider-thread-youtube:hover{background:var(--panel)}
.is-thread-open.is-video-expanded .insider-thread-youtube:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.is-thread-open.is-video-expanded .insider-thread-youtube .insider-youtube-label{white-space:pre}
.is-thread-open.is-video-expanded:has(.insider-thread-youtube) .insider-video-media .room-youtube-link{display:none}
@media(min-width:641px) and (pointer:fine){
 body:is([data-page="insider-club"],[data-page="glass-lounge"],[data-page="marble-map"]) .is-thread-open.is-video-expanded :is(.insider-comment,.room-comment-thread){margin-bottom:2px}
}
@media(pointer:coarse){
 .is-thread-open.is-video-expanded .insider-thread-bar:has(.insider-thread-youtube){grid-template-columns:auto minmax(0,1fr) auto 44px}
 .is-thread-open.is-video-expanded .insider-thread-youtube{min-height:44px}
}
@media(max-width:640px){
 .is-thread-open.is-video-expanded .insider-thread-bar:has(.insider-thread-youtube){grid-template-columns:44px minmax(0,1fr) auto 44px;gap:4px}
 .is-thread-open.is-video-expanded .insider-thread-back span{display:none}
 .is-thread-open.is-video-expanded .insider-thread-youtube{min-height:44px;padding-inline:7px;font-size:11px}
 .is-thread-open.is-video-expanded .insider-youtube-label{display:none}
}
@media(max-height:540px) and (min-width:641px){
 .is-thread-open.is-video-expanded .insider-youtube{height:max(90px,calc(var(--thread-vh,100dvh) - 223px))}
}
