/* =========================================================
   Video call — Google Meet style
   ========================================================= */

/* Night mode (default) */
:root {
  /* Stage */
  --stage: #202124;
  --tile: #3c4043;
  --tile-raised: #4a4e51;
  --on-stage: #e8eaed;
  --on-stage-muted: #9aa0a6;
  --divider-dark: #5f6368;

  /* Bottom bar controls */
  --control: #3c4043;
  --control-hover: #4a4e51;
  --control-ink: #e8eaed;
  --active-bg: #8ab4f8;
  --active-ink: #202124;
  --active-hover: #aecbfa;
  --hover-overlay: rgba(232, 234, 237, 0.08);
  --side-active-ink: #8ab4f8;
  --side-active-bg: rgba(138, 180, 248, 0.12);

  /* Signals */
  --speak-ring: #8ab4f8;
  --speak-fill: #1a73e8;
  --danger: #ea4335;
  --danger-hover: #d93025;
  --danger-ink: #f28b82;
  --warn: #fdd663;
  --warn-ink: #fdd663;

  /* Side panel & menu */
  --panel: #292a2d;
  --panel-soft: #35363a;
  --panel-hover: #303134;
  --panel-line: #3c4043;
  --panel-shadow: none;
  --ink: #e8eaed;
  --ink-2: #bdc1c6;
  --ink-3: #9aa0a6;
  --primary: #8ab4f8;
  --primary-hover: #aecbfa;
  --on-primary: #202124;
  --primary-soft: rgba(138, 180, 248, 0.16);
  --hand-row-bg: rgba(253, 214, 99, 0.1);
  --hand-row-ink: #fdd663;
  --chat-me-bg: rgba(138, 180, 248, 0.16);
  --chat-me-ink: #d2e3fc;
  --menu-bg: #303134;
  --menu-hover: #3c4043;
  --menu-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);

  --radius-tile: 8px;
  --radius-panel: 8px;
  --bar-h: 80px;
  --gap: 16px;

  --font: "IBM Plex Sans Arabic", system-ui, "Segoe UI", Tahoma, sans-serif;
  color-scheme: dark;
}

/* Day mode: light frame, video tiles stay dark so faces and names read clearly */
:root[data-theme="light"] {
  --stage: #f1f3f4;
  --on-stage: #202124;
  --on-stage-muted: #5f6368;
  --divider-dark: #bdc1c6;

  --control: #e3e5e8;
  --control-hover: #d5d8dc;
  --control-ink: #202124;
  --active-bg: #d3e3fd;
  --active-ink: #041e49;
  --active-hover: #c2d7fb;
  --hover-overlay: rgba(32, 33, 36, 0.06);
  --side-active-ink: #1a73e8;
  --side-active-bg: rgba(26, 115, 232, 0.1);

  --danger-ink: #d93025;
  --warn-ink: #b06000;

  --panel: #ffffff;
  --panel-soft: #f1f3f4;
  --panel-hover: #f8f9fa;
  --panel-line: #dadce0;
  --panel-shadow: 0 1px 3px rgba(60, 64, 67, 0.15), 0 1px 2px rgba(60, 64, 67, 0.1);
  --ink: #202124;
  --ink-2: #3c4043;
  --ink-3: #5f6368;
  --primary: #1a73e8;
  --primary-hover: #1765cc;
  --on-primary: #ffffff;
  --primary-soft: #e8f0fe;
  --hand-row-bg: #fef7e0;
  --hand-row-ink: #b06000;
  --chat-me-bg: #e8f0fe;
  --chat-me-ink: #174ea6;
  --menu-bg: #ffffff;
  --menu-hover: #f1f3f4;
  --menu-shadow: 0 2px 6px rgba(60, 64, 67, 0.15), 0 1px 2px rgba(60, 64, 67, 0.3);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--stage);
  color: var(--on-stage);
  font-family: var(--font);
  transition: background-color 0.2s ease, color 0.2s ease;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--speak-ring);
  outline-offset: 2px;
}

/* ---------- Shell ---------- */

.meet-shell {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.meet-main {
  display: flex;
  gap: var(--gap);
  min-height: 0;
  padding: var(--gap) var(--gap) 0;
}

/* ---------- Stage & layouts ---------- */

.stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  gap: 8px;
}

#videosContainer {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

.tiles {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 8px;
}

/* solo: only you in the call */
.stage[data-layout="solo"] .tile {
  width: 100%;
  height: 100%;
}

/* duo: the other person fills the stage, you float in the corner */
.stage[data-layout="duo"] .tile:not(.is-local) {
  width: 100%;
  height: 100%;
}

.stage[data-layout="duo"] .tile:not(.is-local) video {
  object-fit: contain;
}

.stage[data-layout="duo"] .tile.is-local {
  position: absolute;
  inset-inline-end: 16px;
  bottom: 16px;
  z-index: 3;
  width: clamp(150px, 22%, 280px);
  aspect-ratio: 16 / 9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

/* grid: tiles sized by the layout script (--tile-w) */
.stage[data-layout="grid"] .tile {
  width: var(--tile-w, 320px);
  aspect-ratio: 16 / 9;
}

/* spotlight: pinned participant large, everyone else in a strip */
.stage[data-layout="spotlight"] #videosContainer {
  display: block;
}

.stage[data-layout="spotlight"] .tiles {
  flex: 0 0 232px;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-content: stretch;
  overflow-y: auto;
  scrollbar-width: none;
}

.stage[data-layout="spotlight"] .tiles::-webkit-scrollbar {
  display: none;
}

.stage[data-layout="spotlight"] .tile {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.stage[data-layout="spotlight"] .tile.is-featured {
  display: none;
}

/* ---------- Tile ---------- */

.tile,
.main-video-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-tile);
  background: var(--tile);
  container-type: size;
}

.tile {
  cursor: pointer;
}

.tile video,
.main-video-wrapper video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

.main-video-wrapper {
  width: 100%;
  height: 100%;
  background: #000;
}

.main-video-wrapper video {
  object-fit: contain;
}

/* Self view is mirrored, as in Meet */
#localVideo,
#mainVideo.is-mirrored {
  transform: scaleX(-1);
}

.tile.camera-off video {
  visibility: hidden;
}

/* Initial letter behind the video: visible when the camera is off or before it starts */
.tile-avatar {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.tile-avatar span {
  --size: min(36cqw, 52cqh, 132px);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: hsl(var(--avatar-hue, 210) 42% 40%);
  color: #fff;
  font-size: calc(var(--size) * 0.44);
  font-weight: 500;
  line-height: 1;
  user-select: none;
}

/* Name, bottom-start */
.tile-name {
  position: absolute;
  bottom: 8px;
  inset-inline-start: 12px;
  z-index: 2;
  max-width: calc(100% - 56px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.tile.has-hand .tile-name::before {
  content: "✋ ";
}

/* The speaking ring — the signature of the call screen */
.tile::after,
.main-video-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  border: 3px solid var(--speak-ring);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.tile.is-speaking:not(.is-muted)::after {
  opacity: 1;
}

/* Mic state / live audio level, top-end corner */
.tile-status {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
}

.tile.is-muted .tile-status {
  display: flex;
  background: rgba(32, 33, 36, 0.62);
}

.tile.is-speaking:not(.is-muted) .tile-status {
  display: flex;
  background: var(--speak-fill);
}

.tile-muted-icon {
  display: none;
}

.tile.is-muted .tile-muted-icon {
  display: block;
}

.tile-bars {
  display: none;
  align-items: center;
  gap: 2px;
  height: 14px;
}

.tile.is-speaking:not(.is-muted) .tile-bars {
  display: flex;
}

.tile-bars i {
  display: block;
  width: 3px;
  height: calc(4px + var(--level, 0) * 6px);
  border-radius: 2px;
  background: #fff;
  transition: height 0.12s ease;
}

.tile-bars i:nth-child(2) {
  height: calc(4px + var(--level, 0) * 10px);
}

/* Pin button, centred on hover */
.tile-pin-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(32, 33, 36, 0.62);
  color: #fff;
  font-size: 20px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tile:hover .tile-pin-btn,
.tile:focus-within .tile-pin-btn,
.main-video-wrapper:hover .tile-pin-btn,
.tile-pin-btn:focus-visible {
  opacity: 1;
}

.tile-pin-btn.is-pinned {
  color: var(--speak-ring);
}

/* ---------- Side panel ---------- */

.side-panel {
  display: none;
  flex: 0 0 360px;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  color: var(--ink);
  border-radius: var(--radius-panel);
  box-shadow: var(--panel-shadow);
  overflow: hidden;
}

.panel-open .side-panel {
  display: flex;
}

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 4px 24px;
  padding-inline: 24px 12px;
}

.side-panel-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  color: var(--ink);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink-3);
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.icon-btn:hover {
  background: var(--panel-soft);
}

/* Tabs */
.side-tabs {
  display: flex;
  gap: 4px;
  margin: 4px 16px 8px;
  padding: 0;
  border-bottom: 1px solid var(--panel-line);
}

.side-tabs .nav-item {
  flex: 1;
}

.side-tabs .nav-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 3px 3px 0 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 500;
}

.side-tabs .nav-link:hover {
  color: var(--ink);
  background: var(--panel-hover);
}

.side-tabs .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: transparent;
}

.count-pill {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

.side-tabs .nav-link.active .count-pill {
  background: var(--primary-soft);
  color: var(--primary);
}

.tab-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

#chat-pane.active {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.call-info {
  margin: 4px 16px 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink-2);
  font-size: 13px;
}

.call-info:empty {
  display: none;
}

/* Admin microphone controls */
.admin-speaking-panel {
  margin: 0 16px 12px;
  padding: 12px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
}

.admin-speaking-title {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.admin-speaking-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.pill-btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.pill-btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
}

.pill-btn-outline {
  background: transparent;
  border-color: var(--panel-line);
  color: var(--primary);
}

.pill-btn-outline:hover {
  background: var(--primary-soft);
}

/* People list */
.people-section-title {
  padding: 8px 24px 4px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
}

.people-list {
  list-style: none;
  margin: 0;
  padding: 0 0 12px;
}

.person {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 6px 24px;
  padding-inline-end: 12px;
}

.person:hover {
  background: var(--panel-hover);
}

.person.has-hand {
  background: var(--hand-row-bg);
}

.person-avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: hsl(var(--avatar-hue, 210) 42% 40%);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.person-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.person-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink);
  font-size: 14px;
}

.person-you {
  color: var(--ink-3);
}

.person-role {
  color: var(--ink-3);
  font-size: 12px;
}

.person.has-hand .person-role {
  color: var(--hand-row-ink);
}

.person-action,
.person-mic {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink-3);
  font-size: 17px;
}

.person-action {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.person-action:hover {
  background: var(--panel-soft);
}

.person-action.is-off,
.person-mic.is-off {
  color: var(--danger-ink);
}

.hand-accept-btn {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

/* Chat (local only) */
.chat-note {
  margin: 4px 16px 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink-3);
  font-size: 12px;
}

#chatMessages {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  overflow-y: auto;
}

.chat-message {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 14px;
  word-wrap: break-word;
  align-self: flex-end;
}

.chat-message.me {
  align-self: flex-start;
  background: var(--chat-me-bg);
  color: var(--chat-me-ink);
}

#chatForm {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 8px 16px 16px;
  padding-inline: 16px 4px;
  border-radius: 24px;
  background: var(--panel-soft);
}

#chatInput {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

#chatInput::placeholder {
  color: var(--ink-3);
}

#chatForm:focus-within {
  box-shadow: inset 0 0 0 2px var(--primary);
}

#sendChatBtn {
  color: var(--primary);
}

[dir="rtl"] #sendChatBtn i {
  transform: scaleX(-1); /* point the arrow along the RTL reading direction */
}

/* ---------- Bottom bar ---------- */

.meet-bar {
  min-height: var(--bar-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 24px env(safe-area-inset-bottom);
}

.bar-info {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--on-stage);
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bar-divider {
  width: 1px;
  height: 18px;
  background: var(--divider-dark);
}

.bar-timer {
  color: var(--on-stage);
}

.bar-timer.is-ending {
  color: var(--warn-ink);
}

.bar-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-item {
  display: flex;
}

.control-item-redundant {
  display: none !important;
}

.control-icon-btn {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--control);
  color: var(--control-ink);
  font-size: 20px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.control-icon-btn:hover:not(:disabled) {
  background: var(--control-hover);
}

/* "On" state for toggles such as raised hand or screen sharing */
.control-icon-btn.active {
  background: var(--active-bg);
  color: var(--active-ink);
}

.control-icon-btn.active:hover:not(:disabled) {
  background: var(--active-hover);
}

/* Mic / camera off, recording */
.control-icon-btn.danger,
.control-icon-btn.danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.control-icon-btn.danger:hover:not(:disabled) {
  background: var(--danger-hover);
}

.control-icon-btn.permission-locked {
  opacity: 0.7;
  cursor: not-allowed;
}

.control-icon-btn:disabled {
  cursor: not-allowed;
}

.control-icon-btn:disabled:not(.permission-locked) {
  opacity: 0.5;
}

.more-wrap {
  position: relative;
}

.more-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  inset-inline-start: 50%;
  translate: 50% 0;
  z-index: 60;
  min-width: 220px;
  padding: 8px 0;
  border-radius: 8px;
  background: var(--menu-bg);
  box-shadow: var(--menu-shadow);
}

[dir="ltr"] .more-menu {
  translate: -50% 0;
}

.more-menu[hidden] {
  display: none;
}

.more-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  text-align: start;
  cursor: pointer;
}

.more-item i {
  color: var(--ink-3);
  font-size: 18px;
}

.more-item:hover,
.more-item:focus-visible {
  background: var(--menu-hover);
}

.leave-btn {
  width: 72px;
  height: 48px;
  border: 0;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: var(--danger);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.leave-btn:hover {
  background: var(--danger-hover);
}

.bar-side {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 4px;
}

.side-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--on-stage);
  font-size: 21px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.side-btn:hover {
  background: var(--hover-overlay);
}

.side-btn.active {
  color: var(--side-active-ink);
  background: var(--side-active-bg);
}

.side-btn-count {
  position: absolute;
  top: 6px;
  inset-inline-end: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #5f6368;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 18px;
  text-align: center;
}

.side-btn.active .side-btn-count {
  background: var(--side-active-ink);
  color: var(--stage);
}

/* Raised hands waiting for the admin */
.hand-raised-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--warn);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

.side-btn .hand-raised-badge {
  position: absolute;
  top: 6px;
  inset-inline-start: 2px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .side-panel {
    flex-basis: 320px;
  }

  .stage[data-layout="spotlight"] .tiles {
    flex-basis: 180px;
  }
}

@media (max-width: 860px) {
  :root {
    --gap: 8px;
  }

  /* Panel becomes a full-screen sheet */
  .panel-open .side-panel {
    position: fixed;
    inset: 0;
    z-index: 50;
    border-radius: 0;
  }

  /* Spotlight strip moves under the pinned video */
  .stage[data-layout="spotlight"] {
    flex-direction: column;
  }

  .stage[data-layout="spotlight"] .tiles {
    flex: 0 0 96px;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .stage[data-layout="spotlight"] .tile {
    width: auto;
    height: 100%;
  }

  .stage[data-layout="duo"] .tile.is-local {
    inset-inline-end: 10px;
    bottom: 10px;
    width: 104px;
    aspect-ratio: 3 / 4;
  }

  /* Bar: clock and timer on top, controls below */
  .meet-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 8px;
    padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
  }

  .bar-info {
    width: 100%;
    justify-content: center;
    font-size: 13px;
  }

  .bar-center {
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .bar-center::-webkit-scrollbar {
    display: none;
  }

  .control-icon-btn,
  .side-btn {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .leave-btn {
    width: 60px;
    height: 44px;
    font-size: 20px;
  }

  .bar-side {
    gap: 0;
  }

  .tile-name {
    font-size: 12px;
  }

  /* The control row scrolls sideways on phones, which would clip the menu — pin it above the bar */
  .more-menu,
  [dir="ltr"] .more-menu {
    position: fixed;
    bottom: calc(112px + env(safe-area-inset-bottom));
    left: 50%;
    inset-inline-start: auto;
    translate: -50% 0;
  }
}

/* Phones can't share their screen from the browser — free the space */
@media (max-width: 860px) and (pointer: coarse) {
  #shareScreenBtn {
    display: none;
  }

  .control-item:has(#shareScreenBtn) {
    display: none;
  }
}

@media (max-width: 380px) {
  .control-icon-btn,
  .side-btn {
    width: 40px;
    height: 40px;
    font-size: 17px;
  }

  .leave-btn {
    width: 52px;
    height: 40px;
  }

  .bar-center {
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
