/* Reference-inspired live surfaces. Existing OverLife media, copy and actions
   remain their owners; this file changes only presentation and card hierarchy. */

/* Discovery becomes an image-led collection. The complete edited image is
   retained by image-fit-v2.css; no source artwork is imported or recreated. */
body[data-page='discover'] #discover #liveCards.public-live-cards {
  grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));
  gap:16px;
  padding-inline:2px;
  scrollbar-width:thin;
}
body[data-page='discover'] #discover #liveCards>.public-live-card {
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  align-self:start;
  min-width:0;
  min-height:0;
  padding:0;
  gap:0;
  overflow:hidden;
  border:1px solid hsl(calc(var(--rgb-base-hue,330deg) + var(--rgb-surface-turn,0deg)) 54% 65% / .48)!important;
  border-radius:24px;
  background:linear-gradient(155deg,rgb(37 18 31 / .96),rgb(8 10 17 / .98))!important;
  box-shadow:0 8px 22px rgb(0 0 0 / .22),inset 0 1px rgb(255 222 213 / .08);
  color:#f8f9fc;
  text-align:left;
}
body[data-page='discover'] #discover #liveCards .public-live-cover {
  flex:0 0 auto;
  width:100%;
  height:auto;
  aspect-ratio:16 / 10;
  border-radius:23px 23px 0 0;
  border-bottom:1px solid rgb(243 203 211 / .14);
  background:rgb(8 8 13 / .98);
}
body[data-page='discover'] #discover #liveCards .public-live-card>.badge {
  position:absolute;
  top:12px;
  left:12px;
  max-width:calc(100% - 24px);
  padding:5px 9px;
  border:1px solid rgb(255 204 196 / .56)!important;
  border-radius:999px;
  background:rgb(35 14 23 / .94)!important;
  color:#fff1ed!important;
  font-size:10px;
  line-height:1.4;
}
body[data-page='discover'] #discover #liveCards .public-live-card>h3 {
  margin:14px 16px 6px;
  color:#fff7f4;
  font-size:clamp(17px,4.5vw,21px);
  line-height:1.24;
  letter-spacing:-.35px;
  overflow-wrap:anywhere;
}
body[data-page='discover'] #discover #liveCards .public-live-card>p {
  margin:0 16px 14px;
  color:#d7d4de;
  font-size:12px;
  line-height:1.55;
  overflow-wrap:anywhere;
}
body[data-page='discover'] #discover #liveCards .public-live-card>.btn {
  --readable-control:rgb(55 22 34 / .94);
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  margin:0 16px 16px;
  padding:10px 14px;
  border:1px solid rgb(255 172 153 / .42)!important;
  border-radius:999px;
  font-size:12px;
  line-height:1.35;
  white-space:normal;
  overflow-wrap:anywhere;
}
body[data-page='discover'] #discover #publicLiveSearch {
  border-radius:999px;
}
body[data-page='discover'] #discover #liveCards>.public-live-card:focus-visible {
  outline:2px solid #fff;
  outline-offset:3px;
}
@media(hover:hover) {
  body[data-page='discover'] #discover #liveCards>.public-live-card:hover {
    border-color:rgb(255 191 179 / .85)!important;
  }
}

/* Compact live panels share a quiet edge and deeper foreground. Their
   existing positions, overflow budgets and all media rectangles are intact. */
body :is(.room-youtube-dialog,#videoSourcesPanel,dialog.live-user-profile,dialog.live-seat-confirm) {
  --readable-panel:rgb(14 10 20 / .97);
  --readable-surface:rgb(14 10 20 / .97);
  --readable-border:rgb(237 198 209 / .36);
  border-radius:26px;
  box-shadow:0 18px 50px rgb(0 0 0 / .48),inset 0 1px rgb(255 222 213 / .08);
  scroll-padding-block:16px;
}
body :is(.room-youtube-dialog,#videoSourcesPanel) :is(h2,h3) {
  letter-spacing:-.45px;
  line-height:1.2;
}
body :is(.room-youtube-dialog,#videoSourcesPanel) :is(input,.btn) {
  min-height:44px;
  border-radius:16px;
}
body :is(.room-youtube-dialog,#videoSourcesPanel) :is(.room-youtube-close,header>button) {
  width:44px;
  min-width:44px;
  height:44px;
  min-height:44px;
  padding:0;
  border-radius:50%;
}
body #videoSourcesPanel .video-source-choices>button {
  min-height:44px;
  padding:9px 13px;
  border-radius:999px;
}
body #videoSourcesPanel .video-source-choices>button[aria-pressed='true'] {
  border-color:rgb(255 186 166 / .8)!important;
  box-shadow:inset 0 -2px rgb(255 137 104 / .65);
}
body .room-youtube-search-dialog .room-youtube-results {
  gap:12px;
}
body .room-youtube-search-dialog .room-youtube-results>.room-youtube-result {
  padding:9px;
  border-radius:18px;
  border-color:rgb(243 207 217 / .28);
  background:rgb(31 20 34 / .94);
  color:#f8f9fc;
}
body .room-youtube-search-dialog .room-youtube-result>img {
  border-radius:12px;
}
body .room-youtube-search-dialog .room-youtube-result strong {
  color:#fff7f4;
  font-size:13px;
  line-height:1.45;
}
body .room-youtube-search-dialog .room-youtube-channel {
  color:#d4ceda;
}
body #roomsPanel .room-more-menu,
body #roomsPanel .music-control-panel {
  --readable-panel:rgb(14 10 20 / .96);
  --readable-surface:rgb(14 10 20 / .96);
  --readable-border:rgb(237 198 209 / .36);
  border-radius:22px;
  box-shadow:0 12px 32px rgb(0 0 0 / .38),inset 0 1px rgb(255 222 213 / .08);
}
body #roomsPanel .room-more-menu>.btn {
  border-radius:14px;
}
body #roomsPanel .music-track-pill {
  border-radius:16px;
}
body dialog.live-user-profile .live-user-avatar {
  box-shadow:0 0 0 5px rgb(255 171 153 / .07);
}

/* Preparation borrows the reference's soft image frame without changing its
   square size, title field, visibility/seat choices or launch action. */
body.prelive-screen #studio.prelive-simple[data-prelive='true'] .prelive-cover .live-cover-thumbnail {
  border-radius:24px;
  box-shadow:0 10px 30px rgb(0 0 0 / .3),0 0 0 1px rgb(255 180 165 / .22);
}
@media(max-width:360px) {
  body[data-page='discover'] #discover #liveCards.public-live-cards {gap:12px;}
  body[data-page='discover'] #discover #liveCards .public-live-card>h3 {margin-inline:13px;}
  body[data-page='discover'] #discover #liveCards .public-live-card>p {margin-inline:13px;}
  body[data-page='discover'] #discover #liveCards .public-live-card>.btn {margin-inline:13px;}
}

/* A poster owns its full intrinsic height. One directory scroll keeps a tall
   cover from collapsing into the next card in the old fractional grid. */
body[data-page='discover'] #discover #liveCards.public-live-cards{
 grid-auto-rows:max-content;
 overflow:visible;
 align-self:start;
 min-height:0;
}
body[data-page='discover'] #discover #liveCards>.public-live-card{
 min-height:max-content;
}
body[data-page='discover'] #discover #liveCards .public-live-card>:is(h3,p,.btn){flex-shrink:0;}
body[data-page='discover'] #discover{scrollbar-width:none;}
body[data-page='discover'] #discover::-webkit-scrollbar{display:none;}
@media(min-height:501px){
 body[data-page='discover'] #discover{
  grid-template-rows:auto auto auto calc(var(--live-launch-diameter) + 28px) auto;
  align-content:start;
 }
}

/* Latest requested directory: cover-led feed fills the available screen;
   the existing red create action docks at its bottom, at70% ofv12 diameter. */
body[data-page='discover'] #discover{
 --live-launch-diameter:94.08px;
 grid-template-columns:minmax(0,1fr);
 grid-template-rows:auto auto auto minmax(0,1fr) calc(var(--live-launch-diameter) + 24px);
 align-content:stretch;
 overflow:hidden;
}
body[data-page='discover'] #discover #liveCards.public-live-cards{
 grid-column:1;grid-row:4;
 align-self:stretch;
 min-height:0;
 height:100%;
 overflow:auto;
 scrollbar-width:none;
 padding:2px 2px 14px;
 scroll-padding-block:12px 14px;
}
body[data-page='discover'] #discover #liveCards.public-live-cards::-webkit-scrollbar{display:none;}
body[data-page='discover'] #discover #createPublicLive.live-launch-control{
 grid-column:1;grid-row:5;
 align-self:end;justify-self:center;
 z-index:4;
 margin-bottom:12px;
 font-size:14.7px;
}
body[data-page='discover'] #discover #createPublicLive .live-launch-symbol{font-size:32.9px;}
body[data-page='discover'] #discover #liveCards>.public-live-card{
 min-height:clamp(280px,38dvh,390px);
 justify-content:flex-end;
 isolation:isolate;
}
body[data-page='discover'] #discover #liveCards .public-live-cover{
 position:absolute;
 inset:0;
 z-index:0;
 width:100%;height:100%;
 aspect-ratio:auto;
 object-fit:cover!important;
 border-radius:23px;
 border:0;
}
body[data-page='discover'] #discover #liveCards>.public-live-card::after{
 content:'';
 position:absolute;inset:0;
 z-index:1;pointer-events:none;
 background:linear-gradient(180deg,rgb(4 3 8 / .12) 20%,rgb(7 5 12 / .20) 43%,rgb(7 5 12 / .92) 76%,rgb(7 5 12 / .98));
}
body[data-page='discover'] #discover #liveCards .public-live-card>:is(h3,p,.btn){
 position:relative;z-index:2;
}
body[data-page='discover'] #discover #liveCards .public-live-card>.badge{z-index:3;}
@media(max-height:500px){
 body[data-page='discover'] #discover{
  overflow:auto;
  grid-template-rows:auto auto auto minmax(200px,1fr) calc(var(--live-launch-diameter) + 24px);
 }
 body[data-page='discover'] #discover #liveCards.public-live-cards{max-height:440px;}
}
