/* CourtStream — in-page player for a court's mapped YouTube stream.
   Shared by the Live Score hub and the Results hub (see CourtStream.js). */

html.cstream-locked, html.cstream-locked body { overflow: hidden; }

.cstream {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cstream.is-open { display: flex; }

.cstream-scrim {
    position: absolute;
    inset: 0;
    background: rgba(6, 12, 26, .78);
    backdrop-filter: blur(3px);
}

.cstream-box {
    position: relative;
    width: min(1040px, 100%);
    background: #0d1524;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
    overflow: hidden;
    animation: cstream-in .18s ease-out;
}

@keyframes cstream-in {
    from { opacity: 0; transform: translateY(10px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

.cstream-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.cstream-title {
    flex: 1 1 auto;
    margin: 0;
    min-width: 0;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cstream-out {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
    color: #cfe0ff;
    text-decoration: none;
    padding: 6px 11px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    white-space: nowrap;
}

.cstream-out:hover, .cstream-out:focus-visible { background: rgba(255, 255, 255, .1); color: #fff; }

.cstream-close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    line-height: 1;
    font-size: 24px;
    color: #b9c6da;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.cstream-close:hover, .cstream-close:focus-visible { background: rgba(255, 255, 255, .12); color: #fff; }

/* 16:9 stage */
.cstream-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.cstream-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

@supports not (aspect-ratio: 16 / 9) {
    .cstream-frame { height: 0; padding-bottom: 56.25%; }
}

@media (max-width: 600px) {
    .cstream { padding: 10px; }
    .cstream-box { border-radius: 12px; }
    .cstream-title { font-size: 13.5px; }
    .cstream-out { display: none; }   /* the player itself offers the YouTube link */
}
