/* Streaming in the consoles: the BROADCAST button / LIVE pill, the GO LIVE and LIVE sheets, Settings → Streaming,
   RECORDINGS and the admin STREAMS tab. The console's own look: glass panels, chips, display type. */

/* MARK: BROADCAST button → LIVE pill */

.broadcast-button.is-live {
  --btn-bg: linear-gradient(180deg, #ff5864, #d4162a);
  --btn-fg: #fff;
  border-color: rgba(255, 255, 255, 0.45);
  gap: 0.55rem;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 0.2rem rgba(255, 59, 74, 0.25), 0 0.6rem 1.6rem rgba(212, 22, 42, 0.35);
}
.broadcast-button.is-live.is-starting { --btn-bg: linear-gradient(180deg, #ffb73a, #e08a00); --btn-fg: #241500; }
.live-pill-dot { width: 0.6em; height: 0.6em; border-radius: 50%; background: #fff; flex: none; animation: blink 1.2s steps(2, jump-none) infinite; }
.live-pill-time { font-family: var(--mono); font-style: normal; font-weight: 700; font-size: 0.85em; letter-spacing: 0; }
.live-pill-count { padding: 0 0.35em; border-radius: 0.4em; background: rgba(0, 0, 0, 0.25); font-size: 0.8em; }
.broadcast-go .live-pill-dot { background: #fff; }

/* MARK: GO LIVE sheet */

dialog.sheet-broadcast { width: min(96vw, 78rem); max-width: min(96vw, 78rem); overflow: hidden; }
/* Head and foot stay put (GO LIVE is always in reach); the options scroll between them. */
.broadcast-sheet { display: flex; flex-direction: column; max-height: 90vh; }
.broadcast-sheet > .sheet-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.broadcast-sheet > .sheet-foot { border-top: 0.1rem solid var(--line); padding-top: 0.9rem; flex-wrap: wrap; }
.broadcast-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.6rem; align-items: start; }
.broadcast-preview-col { display: grid; gap: 0.8rem; justify-items: center; position: sticky; top: 0; }
.broadcast-preview { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #03050b; border: 0.12rem solid var(--line-strong); box-shadow: var(--shadow); }
.broadcast-preview[data-orientation="portrait"] { width: auto; height: min(60vh, 34rem); aspect-ratio: 9 / 16; }
.broadcast-preview-frame { display: block; width: 100%; height: 100%; border: 0; pointer-events: none; }
.broadcast-preview-label { position: absolute; right: 0.7rem; bottom: 0.6rem; padding: 0.15rem 0.6rem; border-radius: 0.5rem; background: rgba(0, 0, 0, 0.6); font-family: var(--display); font-style: italic; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.85rem; color: var(--muted); }
.broadcast-privacy { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.95rem; max-width: 40rem; }
.broadcast-privacy .icon { margin-top: 0.15em; color: var(--cyan); }
.broadcast-options .field { margin-bottom: 1.2rem; }
.broadcast-choices { flex-wrap: nowrap; }
.broadcast-choices .choice { flex: 1 1 0; min-width: 0; display: grid; gap: 0.05rem; align-content: start; text-align: left; padding-top: 0.45rem; padding-bottom: 0.45rem; }
.choice-label { font-weight: 800; }
.choice-help { font-family: var(--ui); font-style: normal; font-weight: 500; font-size: 0.74rem; line-height: 1.25; letter-spacing: 0; text-transform: none; opacity: 0.75; white-space: normal; }
.broadcast-player-row select { max-width: 24rem; }
.broadcast-destinations { display: grid; gap: 0.5rem; }
.broadcast-destination { display: grid; gap: 0.5rem; padding: 0.6rem 0.8rem; border-radius: var(--radius); border: 0.1rem solid var(--line); background: var(--glass-flat); }
.broadcast-destination.is-on { border-color: rgba(255, 210, 26, 0.7); }
.broadcast-destination-main { display: flex; align-items: center; gap: 0.7rem; cursor: pointer; min-width: 0; }
.broadcast-destination-main input { width: 1.2rem; height: 1.2rem; accent-color: var(--yellow); flex: none; }
.broadcast-destination-name { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.broadcast-destination-key { font-family: var(--mono); font-size: 0.85rem; }
.broadcast-session-key { display: grid; gap: 0.4rem; padding-left: 1.9rem; }
.broadcast-record { border-top: 0; padding-top: 0.2rem; }
.broadcast-hint { flex: 1 1 18rem; font-size: 0.95rem; }
.broadcast-off-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.4rem; }

/* MARK: Platforms */

.platform-badge { display: inline-flex; align-items: center; padding: 0.15rem 0.55rem; border-radius: 0.45rem; font-family: var(--display); font-style: italic; font-weight: 800; font-size: 0.9rem; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; color: #fff; background: #3b4166; }
.platform-badge.is-failed { outline: 0.15rem solid var(--red); text-decoration: line-through; }
.platform-twitch { background: #7a3cff; }
.platform-youtube { background: #e01b24; }
.platform-facebook { background: #1877f2; }
.platform-instagram { background: linear-gradient(90deg, #f58529, #dd2a7b 50%, #8134af); }
.platform-x { background: #111; border: 0.08rem solid rgba(255, 255, 255, 0.4); }
.platform-tiktok { background: #111; box-shadow: inset -0.15rem 0 0 #25f4ee, inset 0.15rem 0 0 #fe2c55; }
.platform-custom { background: #3b4166; }
.platform-dot { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; margin-right: 0.45rem; vertical-align: middle; }

/* MARK: LIVE sheet */

.sheet-live .sheet-body { display: grid; gap: 1rem; }
.live-card { display: grid; gap: 0.8rem; padding: 1rem 1.2rem; }
.live-card-head { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.live-card-head .spacer { flex: 1; }
.live-card-time { font-size: 2rem; font-variant-numeric: tabular-nums; }
.live-destinations { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.live-destinations li { display: flex; align-items: center; gap: 0.7rem; padding: 0.45rem 0.6rem; border-radius: 0.7rem; background: var(--glass-hi); }
.live-destinations .grow { flex: 1; min-width: 0; }
.live-add { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.live-add .input { flex: 1 1 14rem; }
.live-card-foot { font-size: 0.9rem; }

/* MARK: Settings → Streaming */

.destination-list { display: grid; gap: 0.6rem; }
.destination-card { display: flex; align-items: center; gap: 0.9rem; padding: 0.8rem 1rem; }
.destination-card .grow { flex: 1; min-width: 0; }
.destination-meta { font-family: var(--mono); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.destination-empty { padding: 2rem 1rem; }
.destination-note { display: flex; gap: 0.5rem; align-items: flex-start; margin: -0.3rem 0 1.1rem; padding: 0.7rem 0.9rem; border-radius: var(--radius); background: rgba(51, 230, 255, 0.08); border: 0.1rem solid rgba(51, 230, 255, 0.3); color: var(--text); }
.destination-note .icon { color: var(--cyan); margin-top: 0.15em; }
dialog.sheet-destination { width: min(94vw, 46rem); }
.destination-platforms .choice { display: inline-flex; align-items: center; }
.streaming-off { display: grid; gap: 0.4rem; }
.streaming-limits { display: grid; gap: 1rem; padding-bottom: 1rem; border-bottom: 0.1rem solid var(--line); }
.streaming-limits-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 0 1rem; }
.settings-actions { display: flex; justify-content: flex-end; }

/* MARK: Usage meter (minutes this month) */

.usage-meter { display: grid; gap: 0.5rem; padding: 1rem 1.2rem; border-radius: var(--radius-lg); background: var(--glass); border: 0.1rem solid var(--line); }
.usage-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.usage-value { font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.usage-value small { font-size: 0.5em; color: var(--muted); }
.usage-bar { height: 0.8rem; border-radius: 0.4rem; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.usage-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--blue)); }
.usage-note { color: var(--muted); }
.usage-warn { border-color: rgba(255, 176, 32, 0.7); }
.usage-warn .usage-fill { background: linear-gradient(90deg, #ffd21a, var(--amber)); }
.usage-warn .usage-note { color: var(--amber); font-weight: 700; }
.usage-over { border-color: rgba(255, 59, 74, 0.8); }
.usage-over .usage-fill { background: linear-gradient(90deg, #ff6470, var(--red)); }
.usage-over .usage-note { color: #ffb3ba; font-weight: 700; }

/* MARK: Recordings */

.recording-list { display: grid; gap: 0.6rem; max-width: 90rem; }
.recording-row { display: flex; align-items: center; gap: 0.9rem; padding: 0.8rem 1rem; }
.recording-row .grow { flex: 1; min-width: 0; }
.recording-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 0.8rem; background: rgba(255, 59, 74, 0.2); color: #ffb3ba; flex: none; }

/* MARK: Admin STREAMS */

.streams-usage { display: grid; gap: 0.5rem; max-width: 60rem; }
.streams-limits { font-size: 0.95rem; }
.streams-empty { padding: 0.6rem 0; }
.streams-row { grid-template-columns: minmax(10rem, 1.4fr) minmax(10rem, 1.4fr) minmax(8rem, 1fr) minmax(10rem, 1.4fr) 7rem 5rem 7rem; }
.org-row.streams-row:not(.org-head) { background: var(--glass); border: 0.1rem solid var(--line); }
.streams-destinations { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.streams-game-list { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr)); }
.streams-game { display: flex; align-items: center; gap: 0.7rem; padding: 0.8rem 1rem; }
.streams-game .grow { flex: 1; min-width: 0; }
.streams-ended-list { display: grid; gap: 0.4rem; max-width: 70rem; }
.streams-ended-row { display: flex; align-items: center; gap: 0.8rem; padding: 0.4rem 0; border-bottom: 0.08rem solid var(--line); }
.streams-ended-row .grow { flex: 1; min-width: 0; }

/* The admin console has eight tabs with STREAMS: a little tighter, so they stay on one line. */
.topbar-admin .tab { white-space: nowrap; }
@media (max-width: 1800px) {
  .topbar-admin .tab { padding-left: 0.7rem; padding-right: 0.7rem; font-size: 1.25rem; }
  .topbar-admin .counter-pill .pill-label { display: none; }
}
@media (max-width: 1400px) {
  .topbar-admin .tab { padding-left: 0.5rem; padding-right: 0.5rem; font-size: 1.12rem; }
}
@media (max-width: 1100px) {
  .topbar-admin .tab { padding-left: 0.38rem; padding-right: 0.38rem; font-size: 1rem; }
}

@media (max-width: 900px) {
  .broadcast-layout { grid-template-columns: 1fr; }
  .broadcast-preview-col { position: static; }
  .streams-row { grid-template-columns: 1fr 1fr; }
  .streams-row.org-head { display: none; }
}
/* Phones: a destination's or recording's buttons go under its name. */
@media (max-width: 760px) {
  .destination-card, .recording-row { flex-wrap: wrap; }
  .destination-card .grow, .recording-row .grow { flex-basis: calc(100% - 4rem); }
}
