/* CES Live (MGCS-348): who is live, and one stream with its chat. */
.live-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--mu-space-md); }
.live-card {
    display: block; padding: var(--mu-space-md); border-radius: 12px; text-decoration: none; color: inherit;
    background: var(--mu-bg-card, #1b1f3b); border: 1px solid var(--mu-border, rgba(255,255,255,0.08));
}
.live-card:hover, .live-card:focus-visible { border-color: var(--mu-primary, #19f5aa); }
.live-card h2 { font-size: 1rem; margin: 0.5rem 0 0.25rem; overflow-wrap: anywhere; }
.live-card p { margin: 0; }

.live-badge {
    display: inline-block; padding: 0.1rem 0.5rem; border-radius: 6px; font-size: 0.75rem; font-weight: 800;
    letter-spacing: 0.04em; background: #e8443a; color: #fff;
}

/* The watch page. THE STREAM IS THE SIZE OF A CES VIDEO POST (MGCS-351): the view page's
   column is 1000 wide and its player 16:9 at most 560 tall, so the stage here is 1000 x 562
   and never larger outside full screen. Chat sits beside it on a wide screen and under it on a
   narrow one. The overlay canvas is the same 1000 x 562, scaled with the stage. */
.live-watch {
    display: grid; grid-template-columns: minmax(0, 1000px) minmax(260px, 340px); gap: var(--mu-space-md);
    justify-content: center; align-items: start;
    padding: var(--mu-space-lg) var(--mu-space-md); box-sizing: border-box;
}
.live-main { min-width: 0; display: flex; flex-direction: column; gap: var(--mu-space-sm); }
.live-stage {
    position: relative; background: #000; overflow: hidden; width: 100%; aspect-ratio: 1000 / 562;
    border: 1px solid var(--mu-border-color, rgba(255,255,255,0.08)); border-radius: var(--mu-border-radius-lg, 12px);
}
/* What the streamer drew over the stream. Positions are in canvas units; live.js scales the
   whole canvas to the stage. Nothing in it takes a click: the controls are underneath. */
.live-overlay {
    position: absolute; left: 0; top: 0; width: 1000px; height: 562px; z-index: 1;
    transform-origin: 0 0; pointer-events: none; overflow: hidden;
}
/* An element the overlay's script listens to (the runtime marks it with a pointer cursor) takes
   clicks; everything else lets them through to the video. */
.live-overlay .lo-el[style*="cursor: pointer"] { pointer-events: auto; }
.live-overlay .lo-el { position: absolute; overflow: hidden; box-sizing: border-box; }
.live-overlay .lo-text { word-wrap: break-word; overflow-wrap: break-word; }
.live-overlay .lo-text a { color: rgb(14, 177, 217); text-decoration: none; }
.live-overlay .lo-image img { width: 100%; height: 100%; display: block; }
.live-overlay .lo-button { display: flex; align-items: center; justify-content: center; border-radius: var(--mu-border-radius-sm, 6px); font-family: var(--mu-font-family); }
.live-stage video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.live-cover {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
    padding: var(--mu-space-md); background: rgba(8, 10, 28, 0.92); color: #fff;
}
.live-cover p { margin: 0; max-width: 32rem; }
/* The player's own controls (MGCS-350). Shown while the pointer is moving over the stage,
   while paused, and whenever something in them has keyboard focus. */
.live-stage { outline: none; }
.live-stage:focus-visible { box-shadow: 0 0 0 2px var(--mu-primary, #19f5aa); }
.live-stage[data-idle="1"] { cursor: none; }
.live-controls {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    display: flex; align-items: center; gap: 0.35rem;
    padding: 2.25rem 0.75rem 0.6rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
    transition: opacity 0.2s;
}
.live-stage[data-idle="1"] .live-controls:not(:focus-within) { opacity: 0; pointer-events: none; }
.live-controls-space { flex: 1 1 auto; }
.live-ctl {
    flex: none; width: 2.4rem; height: 2.4rem; border: 0; border-radius: 8px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; color: #fff; font-size: 1.05rem;
}
.live-ctl:hover { background: rgba(255, 255, 255, 0.16); }
/* The quality button carries words (Auto · HD), not an icon (MGCS-358). */
.live-ctl.live-quality { width: auto; padding: 0 0.55rem; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.live-ctl:focus-visible, .live-edge:focus-visible, .live-volume:focus-visible, .live-bigplay:focus-visible, .live-unmute:focus-visible {
    outline: 2px solid var(--mu-primary, #19f5aa); outline-offset: 2px;
}

.live-volume {
    flex: 0 1 5.5rem; min-width: 3rem; height: 1.5rem; margin: 0 0.35rem 0 0; cursor: pointer;
    -webkit-appearance: none; appearance: none; background: transparent;
    --live-vol: 100%;
}
.live-volume::-webkit-slider-runnable-track {
    height: 4px; border-radius: 2px;
    background: linear-gradient(to right, #fff var(--live-vol), rgba(255, 255, 255, 0.3) var(--live-vol));
}
.live-volume::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.3); }
.live-volume::-moz-range-progress { height: 4px; border-radius: 2px; background: #fff; }
.live-volume::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 12px; height: 12px; margin-top: -4px;
    border-radius: 50%; background: #fff; border: 0;
}
.live-volume::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }

/* "LIVE" while at the newest moment; a way back to it once paused or fallen behind. */
.live-edge {
    flex: none; display: inline-flex; align-items: center; gap: 0.4rem; height: 1.9rem; padding: 0 0.6rem;
    border: 0; border-radius: 6px; background: transparent; color: #fff; cursor: default;
    font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em;
}
.live-edge-dot { width: 8px; height: 8px; border-radius: 50%; background: #e8443a; }
.live-edge[data-live="0"] { cursor: pointer; background: rgba(255, 255, 255, 0.16); letter-spacing: 0; font-weight: 700; }
.live-edge[data-live="0"] .live-edge-dot { background: #9a9abf; }
.live-edge[data-live="0"]:hover { background: rgba(255, 255, 255, 0.28); }

.live-bigplay {
    position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 4.5rem; height: 4.5rem; border: 0; border-radius: 50%; cursor: pointer;
    background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 1.6rem; padding-left: 0.3rem;
}
.live-bigplay:hover { background: rgba(0, 0, 0, 0.78); }
.live-unmute {
    position: absolute; z-index: 2; left: 0.75rem; top: 0.75rem; border: 0; border-radius: 8px; cursor: pointer;
    padding: 0.45rem 0.7rem; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 0.9rem; font-weight: 700;
}
.live-unmute:hover { background: rgba(0, 0, 0, 0.88); }
.live-cover { z-index: 3; }
.live-stage:fullscreen { border-radius: 0; border: 0; aspect-ratio: auto; }
.live-stage:fullscreen video { max-height: none; }
@media (max-width: 520px) {
    .live-volume { display: none; }      /* a phone has volume buttons */
    /* Room for full screen: "SD", not "Auto · SD" (the button's label still says Auto). */
    .live-quality-auto { display: none !important; }
    .live-ctl.live-quality { padding: 0 0.4rem; }
    .live-controls { padding-left: 0.4rem; padding-right: 0.4rem; }
}
@media (prefers-reduced-motion: reduce) { .live-controls { transition: none; } }

.live-info { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--mu-space-md); flex: none; }
.live-info h1 { font-size: 1.15rem; margin: 0 0 0.15rem; overflow-wrap: anywhere; }

.live-chat {
    display: flex; flex-direction: column; min-height: 0; border-radius: 12px; overflow: hidden;
    /* As tall as the column beside it: it fills the row without being what sizes it. */
    align-self: stretch; height: 0; min-height: 100%;
    background: var(--mu-bg-card, #1b1f3b); border: 1px solid var(--mu-border, rgba(255,255,255,0.08));
}
.live-chat-head { padding: 0.6rem 0.8rem; font-weight: 700; border-bottom: 1px solid var(--mu-border, rgba(255,255,255,0.08)); flex: none; }
.live-chat-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0.5rem 0.8rem; overflow-wrap: anywhere; }
.live-msg { margin: 0 0 0.35rem; line-height: 1.35; }
.live-msg b { color: var(--mu-primary, #19f5aa); font-weight: 700; }
.live-msg[data-owner="1"] b { color: #f5c519; }
.live-msg-tools { display: inline-flex; gap: 0.15rem; margin-left: 0.35rem; }
.live-msg-tools button {
    border: 0; background: none; color: var(--mu-text-muted, #9a9abf); cursor: pointer; padding: 0 0.2rem; font-size: 0.8rem;
}
.live-msg-tools button:hover, .live-msg-tools button:focus-visible { color: #e8443a; }
.live-chat-system { color: var(--mu-text-muted, #9a9abf); font-size: 0.85rem; margin: 0 0 0.35rem; }
.live-chat-note { margin: 0; padding: 0.35rem 0.8rem; font-size: 0.85rem; color: #f5c519; flex: none; }
.live-chat-form { display: flex; gap: 0.5rem; padding: 0.6rem 0.8rem; border-top: 1px solid var(--mu-border, rgba(255,255,255,0.08)); flex: none; }
.live-chat-form .mu-input { flex: 1 1 auto; min-width: 0; margin: 0; }

/* Beside the stream only when both fit at full size next to the site menu; otherwise the
   stream keeps its size and chat goes underneath. */
@media (max-width: 1659px) {
    .live-watch { grid-template-columns: minmax(0, 1000px); padding: var(--mu-space-sm); }
    .live-chat { height: 420px; min-height: 0; }
}
@media (max-width: 700px) {
    .live-info { flex-wrap: wrap; }
    .live-info h1 { font-size: 1rem; }
}

/* Go live */
.golive-box { padding: var(--mu-space-md); border-radius: 12px; background: var(--mu-bg-card, #1b1f3b); border: 1px solid var(--mu-border, rgba(255,255,255,0.08)); }
.golive-row { display: flex; gap: 0.5rem; align-items: center; }
.golive-row .mu-input { flex: 1 1 auto; min-width: 0; margin: 0; font-family: ui-monospace, Consolas, monospace; }
.golive-steps { padding-left: 1.2rem; margin: 0; }
.golive-steps li { margin-bottom: 0.35rem; }
