/* uifix-20261122c: G Meetings client UI fix (Ivan, Nov 22 2026 5:17pm ET), on uifix-20261118b.
   1) Schedule button is the first round button in the TOP row of Controls, same round style (label "Schedule").
   2) Guest Seating is the next round button, immediately left of Mic (title / aria-label "Guest Seating").
      The lobby #gmeet-seating-btn is hidden; the Controls button opens the same seating panel.
      The arrival popup (#gmeet-arrival-pop) is not styled or changed here.
   3) "Mirror my camera" switch in the Camera / Settings menu; default ON = current mirrored self-view.
   Additive only. Does not change Schedule Meetings logic, auth, seats, rooms, the arrival prompt, or the server.
   Fix 3 (lobby art behind Min mode) was dropped per Ivan and is not in this file. */

/* ---- 1) Schedule: first in the top button row, same shape as .rc-btn-wrap / .rc-btn / .rc-cap ---- */
#room-controls #gmsch-btnwrap {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  z-index: 1;
  pointer-events: auto;
  min-width: 44px;
  max-width: none;
  flex: 0 0 auto;
  box-sizing: border-box;
  margin: 0;
}
#room-controls #gmsch-btnwrap[hidden] { display: none !important; }
#room-controls #gmsch-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  box-sizing: border-box;
  border-radius: 50%;
}
#room-controls #gmsch-btn svg { width: 18px; height: 18px; }
#room-controls #gmsch-btn:hover { transform: translateY(-1px); }
#room-controls #gmsch-btnlbl {
  font: 700 10px system-ui, sans-serif;
  letter-spacing: 0.01em;
  color: var(--rc-text, #c4c7cc);
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  box-shadow: none;
  white-space: nowrap;
  text-align: center;
  line-height: 1.1;
  max-width: none;
  cursor: pointer;
}
@media (max-width: 640px) {
  #room-controls #gmsch-btnlbl { display: block; }
}
@media (max-width: 720px) {
  #room-controls #gmsch-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }
}

/* ---- 1b) Guest Seating: same round style, immediately after Schedule ---- */
#room-controls #gmgs-btnwrap {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  z-index: 1;
  pointer-events: auto;
  min-width: 44px;
  max-width: none;
  flex: 0 0 auto;
  box-sizing: border-box;
  margin: 0;
}
#room-controls #gmgs-btnwrap[hidden] { display: none !important; }
#room-controls #gmgs-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  box-sizing: border-box;
  border-radius: 50%;
}
#room-controls #gmgs-btn svg { width: 18px; height: 18px; fill: currentColor; }
#room-controls #gmgs-btn:hover { transform: translateY(-1px); }
#room-controls #gmgs-btnlbl {
  font: 700 10px system-ui, sans-serif;
  letter-spacing: 0.01em;
  color: var(--rc-text, #c4c7cc);
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  box-shadow: none;
  white-space: nowrap;
  text-align: center;
  line-height: 1.1;
  max-width: none;
  cursor: pointer;
}
@media (max-width: 640px) {
  #room-controls #gmgs-btnlbl { display: block; }
}
@media (max-width: 720px) {
  #room-controls #gmgs-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }
}

/* Hide the lobby Guest Seating button (and f68 placeholder). Keep the node so a Controls click can reuse it.
   If the seating bar only held that button, don't leave a gap under the lobby row. Rejoin chips stay. */
#gmeet-seating-btn,
#gmf68-seat-ph { display: none !important; }
#gmeet-seating-bar:not(:has(#gmeet-rejoin-wrap > *)) { display: none !important; }

/* ---- 2) Mirror my camera (local self-view only; remotes unchanged) ---- */
.rc-mirror-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 2px;
  color: #e8eaed;
  font: 600 13px system-ui, sans-serif;
  cursor: pointer;
}
.rc-mirror-sw { position: relative; width: 40px; height: 22px; flex: 0 0 40px; }
.rc-mirror-sw input {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 22px;
  margin: 0;
  border-radius: 11px;
  background: #5f6368;
  border: 1px solid #3c4043;
  cursor: pointer;
  display: block;
  position: relative;
}
.rc-mirror-sw input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}
.rc-mirror-sw input:checked { background: #1a73e8; border-color: #8ab4f8; }
.rc-mirror-sw input:checked::after { transform: translateX(18px); }
.rc-mirror-sw input:focus-visible { outline: 2px solid #8ab4f8; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .rc-mirror-sw input::after { transition: none; }
  #room-controls #gmsch-btn,
  #room-controls #gmgs-btn { transition: none; }
}

/* OFF: un-mirror the local preview only. Default (no class) keeps today's scaleX(-1).
   Meetings Room / Interview / M Studio keep their own in-room mirror controls and are not overridden. */
body.gm-cam-unmirrored .seat.hero .seat-cam-video { transform: none !important; }
body.gm-cam-unmirrored .chess-seat-cam.local .seat-cam-video {
  transform: scale(1.42) !important;
  transform-origin: center 28%;
}
body.gm-cam-unmirrored .domino-seat.bottom .domino-seat-cam .seat-cam-video { transform: none !important; }
body.gm-cam-unmirrored .domino-stage.dm4 > .dm4-cam.dm4-local .seat-cam-video { transform: none !important; }
body.gm-cam-unmirrored .gmtv-tv.gmtv-self .gmtv-video { transform: none !important; }

/* ---- 3) uifix-20261122c5 (Ivan, Nov 22 2026 8:54pm ET): keep the c2 / current
   Chessmaster Controls layout exactly (left CONTROLS/1002/timer block, compact
   centered panel, Release/Leave at the top right, game pills wrapping in rows
   under the buttons). The ONLY change: Invite and Acc Profiles, which wrap to
   a second line in the current look, must sit on the TOP line with the other
   round buttons. Smallest CSS tweak: hide gm-btns' forced .gmb-break, keep
   Acc Profiles in the button group, tighten the button-row gap, and stop
   long labels / people-ui min-width from inflating a wrap. Do not move the
   meta block, do not change the panel width, do not restyle pills or Leave. */

/* Drop the forced flex line-break after Invite (that is what starts the wrap). */
#room-controls .rc-center > .gmb-break {
  display: none !important;
  flex-basis: 0 !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* Acc Profiles stays with the round buttons even if people-ui appends it
   after the games wrap. Pills stay on a following line. */
#room-controls .rc-center > #gmpp-wrap { order: 1 !important; }
#room-controls .rc-center > #host-games-wrap,
#room-controls .rc-center > .rc-games { order: 20 !important; }

/* Hidden games wrap must not display (a 100% basis would stretch the row). */
#room-controls .rc-center > #host-games-wrap[hidden],
#room-controls .rc-center > .rc-games[hidden] {
  display: none !important;
}

/* Visible pills wrap under the buttons, inside the existing panel width.
   width:0 + flex-basis:100% so their one-line min-content cannot overflow. */
#room-controls .rc-center > #host-games-wrap:not([hidden]),
#room-controls .rc-center > .rc-games:not([hidden]),
#room-controls #host-games-wrap.rc-games:not([hidden]) {
  display: flex !important;
  flex-wrap: wrap !important;
  flex: 1 1 100% !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
  justify-content: center;
  align-content: center;
  gap: 6px 5px;
}

/* Slightly tighter button-row gap so Invite + Acc Profiles fit on the top
   line inside the existing compact panel. Beat gm-btns' 40px min-width and
   cap labels to the button width so a caption cannot force a wrap.
   Buttons stay 38px (the current size) unless a later pass has to shrink. */
#room-controls .rc-center,
#room-controls .rc-center.gmb-row {
  gap: 2px 2px;
  min-width: 0;
}
#room-controls .rc-center > .rc-btn-wrap,
#room-controls .rc-center.gmb-row > .rc-btn-wrap,
#room-controls .rc-center .gmb-wrap,
#room-controls .rc-center.gmb-row .gmb-wrap,
#room-controls .rc-center #gmsch-btnwrap,
#room-controls .rc-center #gmgs-btnwrap,
#room-controls .rc-center > #gmpp-wrap {
  min-width: 0 !important;
  max-width: 38px;
  flex: 0 0 auto;
  gap: 1px;
}
#room-controls .rc-center .rc-cap,
#room-controls #gmsch-btnlbl,
#room-controls #gmgs-btnlbl,
#room-controls #gmpp-wrap .rc-cap {
  font-size: 9px;
  letter-spacing: 0;
  line-height: 1.1;
  max-width: 38px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* At ~1024 the compact panel cannot fit 20×38px buttons beside the left meta
   and Release/Leave. Shrink this row only, never below 34px, and only under
   1200px so the wide-window c2 size is unchanged. */
@media (max-width: 1199px) {
  #room-controls .rc-center > .rc-btn-wrap,
  #room-controls .rc-center.gmb-row > .rc-btn-wrap,
  #room-controls .rc-center .gmb-wrap,
  #room-controls .rc-center.gmb-row .gmb-wrap,
  #room-controls .rc-center #gmsch-btnwrap,
  #room-controls .rc-center #gmgs-btnwrap,
  #room-controls .rc-center > #gmpp-wrap {
    max-width: 34px;
  }
  #room-controls .rc-center .rc-btn,
  #room-controls .rc-center #gmsch-btn,
  #room-controls .rc-center #gmgs-btn,
  #room-controls .rc-center #gmpp-btn,
  #host-bar-actions.gmb-on button.rc-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
  }
  #room-controls .rc-center .rc-btn svg,
  #room-controls .rc-center #gmsch-btn svg,
  #room-controls .rc-center #gmgs-btn svg,
  #room-controls .rc-center #gmpp-btn svg,
  #host-bar-actions.gmb-on button.rc-btn svg {
    width: 16px;
    height: 16px;
  }
  #room-controls .rc-center .rc-cap,
  #room-controls #gmsch-btnlbl,
  #room-controls #gmgs-btnlbl,
  #room-controls #gmpp-wrap .rc-cap {
    max-width: 34px;
    font-size: 8px;
  }
}

/* Losing the wrapped Invite/Acc line shortens the panel, so Versions would sit
   under the fixed "Invite people" chip at ~1024. A little extra bar padding
   lifts the same layout just enough to keep Versions visible. */
body.in-room #room-controls {
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)) !important;
}
