Skip to content

A platform for community discussion. Free, open, simple.

27.0 KB
Raw Blame
@use "lib/viewport";

// One step above the fixed site header so a widget dragged to the top edge
// stays visible and grabbable, while everything that already outranked the
// header (mobile composer, fullscreen layers, modals) keeps outranking the
// widget. Menus opened from the widget sit one step higher still.
$live-widget-z: z("header") + 1;

.live-call-widget {
  position: fixed;
  inset-inline-end: max(1rem, env(safe-area-inset-right));
  inset-block-end: max(1rem, env(safe-area-inset-bottom));
  z-index: $live-widget-z;

  // border-box so the inline width/height set during resize match the
  // border-box geometry the resize math measures (getBoundingClientRect);
  // otherwise padding + border push the rendered box past the viewport.
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: min(24rem, calc(100vw - 2rem));

  // Definite (not content-driven) height: the tile grid solves against the
  // measured tile area, so the area must be settled before the tiles size —
  // a content-driven box would chase its own layout.
  height: min(21rem, 60vh);
  padding: var(--space-3);
  border-radius: 0.75rem;
  background: var(--secondary);
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 20%);

  &__header {
    min-width: 0;
  }

  &__room {
    width: 100%;
    min-width: 0;
    cursor: grab;
    touch-action: none;
    user-select: none;
  }

  &__room-name {
    display: block;
    min-width: 0;
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  // Tiles are uniform, sized by computeWidgetGrid from this box's measured
  // size; flex wrapping breaks lines exactly at the solved column count and
  // centers partial rows. `contain: size` keeps a transiently oversized tile
  // from feeding back into the measurement (see video-grid-layout.js).
  &__tiles {
    flex: 1;
    min-height: 0;
    contain: size;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    overflow: hidden;
  }

  .live-video-tile {
    flex: 0 0 auto;
    width: var(--live-tile-width, 45%);
    height: var(--live-tile-height, 5rem);
    min-height: 0;
    transition:
      width 0.2s ease-out,
      height 0.2s ease-out;

    @media (prefers-reduced-motion: reduce) {
      transition: none;
    }
  }

  &__overflow-tile {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: var(--live-tile-width, 45%);
    height: var(--live-tile-height, 5rem);
    overflow: hidden;
    padding: 0;
    border: none;
    border-radius: 0.5em;
    background: var(--primary-very-low);
    color: var(--primary-high);
    cursor: pointer;
    transition:
      width 0.2s ease-out,
      height 0.2s ease-out,
      background 0.15s ease;

    @media (prefers-reduced-motion: reduce) {
      transition: none;
    }

    &:hover,
    &:focus-visible {
      background: var(--primary-low);
      color: var(--primary);
    }
  }

  &__overflow-avatars {
    display: flex;

    img {
      width: 1.75rem;
      height: 1.75rem;
      border: 2px solid var(--secondary);
      border-radius: 50%;

      &:not(:first-child) {
        margin-inline-start: -0.6rem;
      }
    }
  }

  &__overflow-count {
    font-weight: 700;
    font-size: var(--font-down-1);
  }

  .live-video-tile__fullscreen {
    display: none;
  }

  .live-video-tile__avatar img {
    width: 2.75rem;
    height: 2.75rem;
  }

  .live-video-tile__info {
    font-size: var(--font-down-2);
  }

  &__controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    // Stretch (not center) so every control shares the tallest button's height;
    // icon-only DMenu triggers render a few px shorter otherwise. See the
    // matching note on .live-room-page__controls.
    align-items: stretch;
    gap: 0.35rem;

    .--off,
    .--active {
      color: var(--tertiary);
    }
  }

  &.--resizing {
    user-select: none;
  }

  &.--extra-minimized {
    width: auto;
    min-width: 0;
    height: auto;
    padding: var(--space-2);

    .live-call-widget__controls {
      flex-wrap: nowrap;
    }
  }

  &.--dragging {
    user-select: none;

    .live-call-widget__room {
      cursor: grabbing;
    }
  }

  // Corner hit targets for resizing. Dragging a corner moves that corner while
  // the diagonal corner stays anchored in place. Corner-specific cursors, not
  // the double-headed nwse/nesw pair: Firefox on macOS has no glyphs for those
  // and falls back to the default arrow, hiding the resize affordance.
  &__resize {
    position: absolute;
    z-index: 2;
    width: 16px;
    height: 16px;
    touch-action: none;

    &.--nw {
      inset-block-start: -5px;
      inset-inline-start: -5px;
      cursor: nw-resize;
    }

    &.--ne {
      inset-block-start: -5px;
      inset-inline-end: -5px;
      cursor: ne-resize;
    }

    &.--sw {
      inset-block-end: -5px;
      inset-inline-start: -5px;
      cursor: sw-resize;
    }

    &.--se {
      inset-block-end: -5px;
      inset-inline-end: -5px;
      cursor: se-resize;
    }
  }
}

// On touch devices the widget is a full-width bottom dock: corner resize is
// hidden (component-side) and the header only drags it vertically, since
// free positioning and tiny corner handles are awkward with a finger.
html.discourse-touch .live-call-widget {
  inset-inline: 0.5rem;
  width: auto;
  height: min(19rem, 45vh);

  &.--extra-minimized {
    height: auto;
  }
}

.live-room-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  height: calc(100dvh - var(--main-outlet-offset, 4em));
  min-height: 0;
  border-right: 1px solid var(--content-border-color);

  &__main {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .chat-side-panel {
    width: 22rem;
    min-width: 0;
    min-height: 0;
    display: flex;
    overflow: hidden;
    border-inline-start: 1px solid var(--content-border-color);

    // Animating the width (not just fading in place) makes the whole layout
    // ease — the video column and controls resize smoothly instead of
    // jumping the moment the panel claims its space.
    animation: live-sidebar-in 0.25s ease-out;

    &.--closing {
      animation: live-sidebar-out 0.2s ease-in forwards;
    }

    // The panel keeps its full-width layout and gets revealed/clipped by the
    // animating box, rather than squishing and rewrapping every frame.
    .live-chat {
      min-width: 22rem;
    }

    // A (near) zero duration rather than none: leaving the closing state
    // waits on animationend, which `animation: none` would never fire.
    @media (prefers-reduced-motion: reduce) {
      animation-duration: 0.01s;
    }
  }

  // Meet-style column: the video grid fills the space with tiles centered,
  // and the control bar sits on the bottom row, level with the chat panel's
  // composer next door.
  &__stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    row-gap: var(--space-3);
    margin: var(--space-2);
    margin-block-end: var(--space-4);
  }

  &__presentation {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(9rem, 13rem);
    gap: var(--space-2);
  }

  &__presentation-main {
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--primary-low);
    border-radius: var(--d-border-radius);
    background: var(--secondary);

    .live-video-tile {
      width: 100%;
      height: 100%;
      border-radius: calc(var(--d-border-radius) - 1px);
    }

    .live-video-tile.--screen .live-video-tile__video,
    .live-video-tile.--avatar .live-video-tile__video {
      object-fit: contain;
    }
  }

  &__presentation-rail {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-auto-rows: minmax(5rem, 8rem);
    gap: var(--space-2);
    align-content: start;
    overflow: auto;
    padding-inline-end: 1px;

    .live-video-tile {
      width: 100%;
      height: 100%;
    }
  }

  &__grid {
    position: relative;
    flex: 1;
    min-height: 0;

    // The tile size is computed from this element's measured size, so its
    // own size must never derive from the tiles: after exiting fullscreen the
    // still-huge tiles would inflate the grid (the page only has a
    // min-height), the remeasure would see that inflated box, and the layout
    // would lock there instead of shrinking back.
    contain: size;
    display: flex;
    align-items: center;
    justify-content: center;

    // Read by the layout as the spacing between tiles.
    gap: 0.5em;

    // While the sidebar animates, tiles rewrap faster than their height
    // recomputes — clip the transient overflow so it can't spill over the
    // control bar below.
    overflow: hidden;

    &:fullscreen {
      background: #000;
      padding: 0.5em;

      .live-video-tile__menu {
        display: none;
      }
    }
  }

  // Uniform tiles sized by computeRoomGrid; the line width cap makes flex
  // wrapping break at the solved column count and centers a partial last row.
  &__tiles {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    gap: inherit;
    width: var(--live-grid-line-width, 100%);
    max-width: 100%;
    max-height: 100%;

    .live-video-tile {
      width: var(--live-tile-width, auto);
      transition:
        width 0.2s ease-out,
        height 0.2s ease-out;

      @media (prefers-reduced-motion: reduce) {
        transition: none;
      }
    }

    // Cropping would cut a portrait feed down to a face-height strip.
    .live-video-tile.--portrait .live-video-tile__video {
      object-fit: contain;
      background: var(--primary-very-high);
    }
  }

  // Self view in a one-to-one call. Sized by its own feed's aspect (set
  // inline by the tile), not by the grid's tile size. Scoped to the grid to
  // outrank the base tile rules.
  &__grid &__pip {
    position: absolute;
    inset-block-end: var(--space-3);
    inset-inline-end: var(--space-3);
    z-index: 1;
    width: clamp(10rem, 18%, 17.5rem);
    height: auto;
    max-height: 40%;
    box-shadow: 0 0.35rem 1.25rem rgb(0 0 0 / 35%);
    transition: none;

    // A portrait feed sized by width would blow past the height cap, so size
    // it by height and let the inline aspect-ratio set the width.
    &.--portrait {
      width: auto;
      height: min(40%, 20rem);
    }

    // Any remaining mismatch between the capped box and the feed letterboxes
    // rather than cropping your own camera.
    .live-video-tile__video {
      object-fit: contain;
      background: var(--primary-very-high);
    }
  }

  // Top-left so it never collides with the per-tile fullscreen buttons
  // (top-right).
  &__fullscreen {
    position: absolute;
    inset-block-start: 0.35em;
    inset-inline-start: 0.35em;
    z-index: 1;
    color: #fff;
    background: rgb(0 0 0 / 45%);

    .d-icon {
      color: #fff;
    }

    html.discourse-no-touch & {
      opacity: 0;
      transition: opacity 0.15s ease;
    }
  }

  html.discourse-no-touch &__grid:hover &__fullscreen,
  &__fullscreen:focus-visible {
    opacity: 1;
  }

  &__empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-medium);
  }

  &__controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    // Stretch (not center) so every control shares the tallest button's height.
    // Icon-only DMenu triggers (e.g. the overflow menu) render a few px shorter
    // than their DButton/plain-<button> siblings; stretching equalizes them the
    // same way the combo wrapper stretches its caret.
    align-items: stretch;
    gap: 0.5em;

    .--off,
    .--active {
      color: var(--tertiary);
    }
  }
}

.live-room-header {
  &__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    height: var(--chat-header-offset, 45px);
    white-space: nowrap;
  }

  &__name {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    margin: 0;
    font-size: var(--font-0);
    font-weight: 700;
  }

  &__info-trigger {
    gap: var(--space-2);
    min-width: 0;
    padding: 0;
    font: inherit;
    color: var(--primary);

    &:hover,
    &:focus-visible {
      background: none;
      color: var(--primary);

      .discourse-no-touch & {
        background: none;
        color: var(--primary);
      }
    }

    .d-button-label {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  &__participants {
    color: var(--primary-medium);
    font-size: var(--font-down-1);
    white-space: nowrap;
  }

  &__icon {
    position: relative;
    font-size: var(--font-up-1);
    color: var(--primary-medium);
    line-height: 1;
  }

  &__restricted-icon {
    position: absolute;
    top: -20%;
    right: -30%;
    width: 40%;
    height: 40%;
    padding: 2px 2px 3px;
    border-radius: 50%;
    background-color: var(--secondary);
    color: var(--primary-high);
  }

  &__fallback {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 0.67em;
    border-block-end: 1px solid var(--content-border-color);
    background: var(--secondary);
  }

  &__actions {
    display: flex;
    align-items: center;
    height: var(--chat-header-offset, 45px);
    margin-inline-start: auto;
  }
}

body.has-sidebar-page #main-outlet-wrapper:has(.live-room-header) {
  gap: 0;
}

#main-outlet:has(.live-room-header) {
  padding-top: 0;
}

// Split "combo" button (mic/camera) shared by LiveCallControls in both the
// room page and the widget: the main toggle and its caret read as one button.
// The main button drops its trailing border so the caret's leading border is
// the only divider between them.
.live-call-controls__combo {
  display: inline-flex;
  align-items: stretch;

  .live-call-controls__combo-main {
    position: relative;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-inline-end: none !important; // ensure core hover/active/focus rules don't restore the border
  }

  // Same look as the sidebar room lock: a tiny unobtrusive glyph tucked
  // into the button's top-right corner, no backdrop.
  .live-call-controls__ns-badge {
    position: absolute;
    top: 0.15em;
    right: 0.2em;
    display: flex;

    .d-icon {
      width: 0.5rem;
      height: 0.5rem;
    }

    &.--starting {
      animation: live-ns-badge-pulse 1s ease-in-out infinite;
    }
  }

  .live-call-controls__combo-caret {
    margin-inline-start: 0;
    padding-inline: 0.4em;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-inline-start: 1px solid var(--primary-low-mid);
  }
}

// Live subtitles. A zero-height flow child between the video area and the
// control bar: lines are packed toward the bottom so they overflow upward,
// floating over the tiles without shifting the layout when they appear.
.live-captions {
  align-self: center;
  width: min(100%, 46rem);
  height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  row-gap: 0.25em;
  z-index: 1;
  pointer-events: none;

  &__line {
    margin: 0;
    padding: 0.25em 0.75em;
    max-width: 100%;
    border-radius: var(--d-border-radius);
    background: rgb(0 0 0 / 65%);
    color: #fff;
    text-align: center;
    text-wrap: balance;

    &.--loading {
      color: rgb(255 255 255 / 75%);
      font-style: italic;
    }

    // Provisional text that will be replaced when the speaker pauses.
    &.--interim {
      color: rgb(255 255 255 / 85%);
    }
  }

  &__speaker {
    font-weight: bold;

    &::after {
      content: ":";
    }
  }

  // Portaled into the fullscreen grid or tile, clear of the tile name bar.
  &.--fullscreen {
    position: absolute;
    inset-block-end: 3em;
    inset-inline: 0;
    margin-inline: auto;
    height: auto;
    font-size: var(--font-up-2);
  }
}

// Each item spans the overlay's full height with its content pinned to the
// bottom, so a percentage translate rises relative to the overlay — keeping
// the animation on the compositor regardless of how tall the stage is.
.live-reactions {
  position: absolute;
  inset: 0 0 var(--live-reactions-bottom, 4rem);
  z-index: 2;
  overflow: hidden;
  pointer-events: none;

  .live-call-widget & {
    --live-reactions-bottom: 3.5rem;
  }

  &__item {
    position: absolute;
    inset-block: 0;
    inset-inline-start: var(--live-reaction-offset, 50%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    row-gap: 0.15rem;
    animation: live-reaction-float 4s ease-out forwards;

    @media (prefers-reduced-motion: reduce) {
      animation-name: live-reaction-fade;
    }
  }

  // Outranks the core img.emoji sizing.
  &__emoji.emoji {
    width: 2.25rem;
    height: 2.25rem;

    .live-call-widget & {
      width: 1.5rem;
      height: 1.5rem;
    }
  }

  &__username {
    max-width: 8rem;
    padding: 0 0.4em;
    overflow: hidden;
    border-radius: var(--d-border-radius);
    background: rgb(0 0 0 / 55%);
    color: #fff;
    font-size: var(--font-down-2);
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@keyframes live-reaction-float {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.6);
  }

  10% {
    opacity: 1;
    transform: translate(-50%, -8%) scale(1);
  }

  75% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -80%) scale(1);
  }
}

@keyframes live-reaction-fade {
  0%,
  100% {
    opacity: 0;
    transform: translateX(-50%);
  }

  15%,
  75% {
    opacity: 1;
    transform: translateX(-50%);
  }
}

// Same proportions as the post reactions picker (1.2em emoji, 0.25em
// spacing, 1.5x hover), scaled up to our larger emoji.
.live-reaction-picker {
  --live-reaction-size: 1.75rem;
  --live-reaction-spacing: calc(var(--live-reaction-size) * 0.25 / 1.2);

  // So a full seven-column row still fits a phone.
  @include viewport.until(sm) {
    --live-reaction-size: 1.5rem;
  }
  display: grid;
  grid-template-columns: repeat(var(--live-reaction-columns, 7), 1fr);
  gap: var(--live-reaction-spacing);
  padding: var(--live-reaction-spacing);

  &__emoji,
  &__more {
    padding: var(--live-reaction-spacing);
    margin: var(--live-reaction-spacing);
    border-radius: var(--d-border-radius);

    .emoji,
    .d-icon {
      width: var(--live-reaction-size);
      height: var(--live-reaction-size);
    }
  }

  // Scales the button, not the image: hovering swaps in the animated image,
  // which would otherwise skip the transition.
  &__emoji {
    transition: transform 0.1s ease-out;

    .discourse-no-touch &:hover,
    &:focus-visible {
      transform: scale(1.5);
    }
  }
}

@keyframes live-ns-badge-pulse {
  50% {
    opacity: 0.4;
  }
}

.live-speak-queue-trigger {
  position: relative;

  .live-speak-queue-trigger__count {
    position: absolute;
    top: -0.4em;
    right: -0.4em;
    min-width: 1.6em;
    padding: 0 0.3em;
    border-radius: 1em;
    background: var(--tertiary);
    color: var(--secondary);
    font-size: var(--font-down-2);
    line-height: 1.6em;
    text-align: center;
  }
}

.live-speak-queue {
  min-width: 16em;
  padding: 0.5em;

  &__title {
    margin: 0 0 0.5em;
    font-size: var(--font-0);
  }

  &__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25em;
  }

  &__item {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.25em;
    border-radius: var(--d-border-radius);

    &.--self {
      background: var(--tertiary-very-low);
    }
  }

  &__position {
    min-width: 1.5em;
    text-align: center;
    color: var(--primary-medium);
    font-size: var(--font-down-1);
  }

  &__name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__actions {
    display: inline-flex;
    gap: 0.25em;
  }

  &__empty {
    color: var(--primary-medium);
    padding: 0.5em;
  }
}

// Float-kit menus portal to a body-level layer at z("dropdown") (300), but the
// persistent call widget sits above the site header and would otherwise cover
// any menu opened from it. Lift the call menus above the widget. Harmless on
// the room page, which has no competing high-z layer.
.fk-d-menu[data-identifier^="live-"] {
  z-index: $live-widget-z + 1;
}

// Below this the 22rem sidebar would squash the video column into a sliver,
// so instead of sitting beside it the panel becomes a full-height drawer over
// the page (above the docked call widget). Keep in sync with the close-button
// breakpoint in live-chat.scss.
@media (width <= 1000px) {
  .live-room-page__presentation {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .live-room-page__presentation-rail {
    grid-auto-flow: column;
    grid-auto-columns: minmax(8rem, 11rem);
    grid-auto-rows: 6rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-block-end: 1px;
  }

  .live-room-page .chat-side-panel {
    position: fixed;
    inset-block: var(--main-outlet-offset, 4em) 0;
    inset-inline: 0;
    z-index: 1050;
    width: auto;
    background: var(--secondary);
    animation-name: live-drawer-in;

    &.--closing {
      animation-name: live-drawer-out;
    }

    .live-chat {
      min-width: 0;
    }
  }
}

.live-video-tile {
  position: relative;
  flex: 0 0 auto;

  // Grids publish a uniform --live-tile-height (and width). Each tile also
  // sets its own aspect-ratio inline from its measured video, which sizes it
  // wherever only one dimension is given. The fallback height covers first
  // paint before measurement.
  height: var(--live-tile-height, 12em);

  // The computed height always lags the layout by a beat (resize observer →
  // re-render); the hard cap keeps a stale value from ever growing the tile
  // past the grid box, and the transition hides the catch-up step.
  max-height: 100%;
  transition: height 0.2s ease-out;

  @media (prefers-reduced-motion: reduce) {
    transition: none;
  }
  width: auto;
  max-width: 100%;
  border-radius: 0.5em;
  overflow: hidden;
  background: var(--primary-very-low);

  // An overlay rather than an inset outline: the video fills the tile and
  // paints over the tile's own outline, so the ring only ever showed on
  // avatar tiles.
  &.--speaking::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 3px solid var(--success);
    border-radius: inherit;
    pointer-events: none;
  }

  // When the tile itself is fullscreen it fills the screen at the screen's
  // aspect, so show the whole frame rather than cropping it to fill.
  &:fullscreen {
    border-radius: 0;
    background: #000;
  }

  &:fullscreen &__menu {
    display: none;
  }

  &:fullscreen &__video {
    object-fit: contain;
  }

  &__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  &__fullscreen,
  &__menu {
    position: absolute;
    inset-inline-end: 0.35em;
    color: #fff;
    background: rgb(0 0 0 / 45%);

    .d-icon {
      color: #fff;
    }

    // Discoverable on touch (no hover); revealed on hover/focus on pointer
    // devices to keep the tile clean.
    html.discourse-no-touch & {
      opacity: 0;
      transition: opacity 0.15s ease;
    }
  }

  &__fullscreen {
    inset-block-start: 0.35em;
  }

  &__menu {
    inset-block-end: 0.35em;
  }

  html.discourse-no-touch &:hover &__fullscreen,
  html.discourse-no-touch &:hover &__menu,
  &__fullscreen:focus-visible,
  &__menu:focus-visible {
    opacity: 1;
  }

  &.--self:not(.--screen) &__video {
    transform: scaleX(-1);
  }

  &.--screen &__video {
    object-fit: contain;
    background: var(--primary-very-high);
  }

  &__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;

    img {
      width: 4em;
      height: 4em;
      border-radius: 50%;
    }
  }

  &__info {
    position: absolute;
    inset-block-end: 0;
    inset-inline: 0;
    display: flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.25em 0.5em;

    // Keep the name and status icons clear of the corner menu trigger.
    padding-inline-end: 2.75em;
    font-size: var(--font-down-1);

    // Subtitle-style fixed colors, deliberately not palette vars: this text
    // sits on arbitrary video frames, which don't change with the color
    // scheme, so inverting with the theme is exactly what breaks it.
    color: #fff;
    text-shadow:
      0 1px 2px rgb(0 0 0 / 80%),
      0 0 4px rgb(0 0 0 / 50%);

    .d-icon {
      color: #fff;
      filter: drop-shadow(0 1px 1px rgb(0 0 0 / 80%));
    }
  }

  &__name {
    overflow-wrap: anywhere;
  }
}

@keyframes live-sidebar-in {
  from {
    width: 0;
    opacity: 0;
  }

  to {
    width: 22rem;
    opacity: 1;
  }
}

@keyframes live-sidebar-out {
  from {
    width: 22rem;
    opacity: 1;
  }

  to {
    width: 0;
    opacity: 0;
  }
}

// The narrow-viewport drawer overlays the page instead of participating in
// its layout, so it slides over from the edge rather than animating width.
@keyframes live-drawer-in {
  from {
    transform: translateX(100%);
  }

  to {
    transform: none;
  }
}

@keyframes live-drawer-out {
  from {
    transform: none;
  }

  to {
    transform: translateX(100%);
  }
}

.live-ringing-tile {
  // No measured video to derive a shape from — assume the default tile
  // aspect so it packs into the grid like everyone else.
  aspect-ratio: 16 / 9;
  border: 1px dashed var(--primary-low-mid);
  background: var(--primary-very-low);

  &__animation {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;

    // Placeholder styling until the bespoke ringing SVG animation replaces
    // the icon.
    .d-icon {
      font-size: var(--font-up-4);
      color: var(--primary-medium);
      animation: live-ringing-pulse 1.4s ease-in-out infinite;

      @media (prefers-reduced-motion: reduce) {
        animation: none;
      }
    }
  }

  .live-video-tile__name {
    font-style: italic;
  }
}

@keyframes live-ringing-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.6;
  }

  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

// Tiles carry per-participant view-transition names (see followLayout in
// LiveRoomPage); these classes time every tile's move together.
.live-room-page .live-video-tile {
  view-transition-class: live-tile;
}

.live-room-page__presentation-main .live-video-tile {
  view-transition-class: live-tile live-stage-tile;
}

::view-transition-group(*.live-tile) {
  z-index: 2;
  animation-duration: 0.4s;
  animation-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

// The stage tile travels the furthest; keep the other tiles moving over it
// rather than disappearing underneath.
::view-transition-group(*.live-stage-tile) {
  z-index: 1;
}

// Fill the moving box so the old and new snapshots stay aligned while they
// crossfade, instead of each keeping its own aspect and ghosting.
::view-transition-old(*.live-tile),
::view-transition-new(*.live-tile) {
  height: 100%;
  object-fit: cover;
}