/* SPDX-License-Identifier: LicenseRef-AGPL-3.0-only-OpenSSL */

/*
 * Everything that lies on top of the game picture while playing. It is made to
 * look and behave like the app: the display (StreamHud.qml), the stream menu
 * (StreamMenuContent.qml, PlayTogetherBar.qml), the chat (StreamChatPanel.qml)
 * and the options (StreamDisplayPanel.qml, DisplayOptions.qml). Sizes and
 * colours are the ones written there.
 */

.stage {
  --g-accent: #8c52ff;
  --g-pink: #f0469b;
  --g-cyan: #00f2ff;
  --g-green: #34d399;
  --g-amber: #fbbf24;
  --g-red: #f0466e;
  --g-sheet: rgba(13, 11, 31, 0.97);
  color: #fff;
  font-size: 14px;
  line-height: 1.25;
}

/* ================================================================ the display */

.hud {
  --hud-accent: #8c52ff;
  --hud-cyan: #00f2ff;
  --hud-green: #34d399;
  --hud-red: #f0466e;
  --hud-glass: rgba(12, 10, 26, 0.72);
  --hud-box: transparent;
  --hud-line: 0 0 0 0 transparent;
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  color: #fff;
}

.hud.glass {
  --hud-box: var(--hud-glass);
}

.hud.solid {
  --hud-box: #10101a;
}

/* Something else is in front: the stream menu */
.hud.away {
  visibility: hidden;
}

.hud-veil {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

.hud-layer {
  position: absolute;
  inset: 0;
}

.hud-el {
  position: absolute;
}

.hud-holder {
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
  transform-origin: 0 0;
}

/* Arrange mode: a frame to grab, and the element's own switches */
.hud-frame {
  display: none;
  position: absolute;
  inset: -6px;
  /* As in the app: a dashed cyan line, filled only while it is held */
  border: 2px dashed rgba(0, 242, 255, 0.85);
  border-radius: 14px;
  background: transparent;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
}

.hud.editing .hud-frame {
  display: block;
}

.hud-frame.grabbed {
  border-color: #ffffff;
  background: rgba(0, 242, 255, 0.1);
  cursor: grabbing;
}

.hud-tools {
  position: absolute;
  left: -2px;
  top: -30px;
  display: flex;
  gap: 4px;
  white-space: nowrap;
}

.hud-tools.below {
  top: calc(100% + 6px);
}

.hud-tools.from-right {
  left: auto;
  right: -2px;
}

.hud-tool-title {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  background: #7ff5ff;
  color: #04262a;
  font-size: 12px;
  font-weight: bold;
  line-height: 24px;
}

.stage .hud-tool {
  height: 24px;
  min-width: 24px;
  padding: 0 8px;
  border: 1px solid rgba(0, 242, 255, 0.5);
  border-radius: 12px;
  background: rgba(8, 6, 20, 0.88);
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
}

.stage .hud-tool:hover {
  background: var(--hud-accent);
}

/* ---------------------------------------------------------------- players */

.hud-players {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.hud-players.vertical {
  flex-direction: column;
}

.hud-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 14px 0 6px;
  border-radius: 23px;
  background: var(--hud-box);
  white-space: nowrap;
}

.hud.glass .hud-chip,
.hud.solid .hud-chip {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.hud.glass .hud-chip.control,
.hud.solid .hud-chip.control {
  box-shadow: inset 0 0 0 2px var(--hud-accent);
}

.hud-chip-end {
  width: 4px;
}

.hud-chip-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hud-chip-name {
  font-size: 14px;
  font-weight: bold;
  line-height: 17px;
}

/* Without a box behind it, an outline keeps it readable on any game picture */
.hud.plain .hud-chip-name {
  text-shadow: -1px 0 rgba(0, 0, 0, 0.85), 1px 0 rgba(0, 0, 0, 0.85), 0 -1px rgba(0, 0, 0, 0.85), 0 1px rgba(0, 0, 0, 0.85);
}

.hud-chip-name.control {
  color: var(--hud-cyan);
}

.hud-chip-name.talking {
  color: var(--hud-green);
}

.hud-chip-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: bold;
  line-height: 11px;
}

.hud-chip-tags:empty {
  display: none;
}

.hud-tag-host {
  color: var(--hud-cyan);
}

/* Each their own controller: the player the game sees */
.hud-tag-player {
  color: #7dd3fc;
}

.hud-tag-watching {
  opacity: 0.6;
}

/* Taking turns: the clock on whose turn it is, and who comes next */
.hud-tag-turn {
  color: var(--hud-cyan);
  font-variant-numeric: tabular-nums;
}

.hud-tag-turn.ending {
  color: var(--hud-red);
}

.hud-tag-turn.paused {
  color: #f5b942;
}

.hud-tag-next {
  opacity: 0.7;
}

.hud-tag-next.soon {
  opacity: 1;
  color: #f5b942;
}

.hud-tag-muted {
  color: var(--hud-red);
}

.hud-tag-live {
  padding: 0 4px;
  border-radius: 3px;
  background: #e91916;
  color: #fff;
}

.hud-battery {
  display: flex;
  align-items: center;
  gap: 3px;
}

.hud-battery span {
  opacity: 0.85;
  font-size: 10px;
  font-weight: bold;
  line-height: 12px;
}

.hud-battery-cell {
  position: relative;
  width: 20px;
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 2.5px;
}

.hud-battery-fill {
  position: absolute;
  left: 1px;
  top: 1px;
  height: 6px;
  border-radius: 1px;
}

.hud-battery-nub {
  position: absolute;
  left: 19px;
  top: 2px;
  width: 2px;
  height: 4px;
  background: rgba(255, 255, 255, 0.75);
}

.hud-battery-cell[hidden] {
  display: none;
}

/* On the cable: a plug in the display's cyan instead of the battery */
.hud-plug {
  width: 16px;
  height: 12px;
  fill: none;
  stroke: var(--hud-cyan);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* A player's picture as a circle, or their initial; the ring lights up while talking */
.hud-avatar {
  position: relative;
  flex: none;
  border: 0 solid transparent;
  border-radius: 50%;
}

.hud-avatar-face {
  position: absolute;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #8c52ff, #f0469b);
  background-size: cover;
  background-position: center;
  color: #fff;
  font-weight: bold;
  line-height: 1;
}

.hud-avatar-face.picture {
  background-color: #12121c;
}

/* ---------------------------------------------------------------- webcams */

.hud-cams {
  display: flex;
  gap: 8px;
}

.hud-cam {
  position: relative;
  width: 176px;
  height: 99px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: #12121c;
  overflow: hidden;
}

.hud-cam.talking {
  border-color: var(--hud-green);
}

.hud-cam img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hud-cam img:not([src]) {
  visibility: hidden;
}

/* One's own webcam is shown the way a mirror would */
.hud-cam.mirrored img {
  transform: scaleX(-1);
}

.hud-cam-name {
  position: absolute;
  left: 4px;
  bottom: 4px;
  max-width: 164px;
  height: 18px;
  padding: 0 6px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.6);
  font-size: 11px;
  font-weight: bold;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------------------------------------------------------- controllers */

.hud-pads {
  display: flex;
  gap: 10px;
}

.hud-pad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hud-pad-name {
  height: 18px;
  padding: 0 7px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.6);
  font-size: 11px;
  font-weight: bold;
  line-height: 18px;
  white-space: nowrap;
}

.hud-pad-name.control {
  background: var(--hud-accent);
}

.hud-pad-name.console {
  background: rgba(0, 102, 115, 0.85);
}

/* A controller skin (skinpad.js): its pictures stacked, each the whole controller's size */
.pad.skin-pad {
  position: relative;
}
.pad.skin-pad img.sprite {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pad {
  position: relative;
  flex: none;
  overflow: hidden;
}

.pad-inner {
  position: absolute;
  left: 0;
  top: 0;
  width: 807px;
  height: 651px;
  transform-origin: 0 0;
}

.pad-group {
  position: absolute;
}

.pad-sprite {
  position: absolute;
  background-repeat: no-repeat;
}

/* ---------------------------------------------------------------- notes */

.hud-toasts {
  position: absolute;
  left: 0;
  right: 0;
  top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.hud-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 17px;
  background: var(--hud-glass);
  font-size: 14px;
  font-weight: bold;
  white-space: nowrap;
  animation: hud-toast 4.4s linear forwards;
}

.hud-toast.joined {
  border-color: var(--hud-green);
}

.hud-toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hud-red);
}

.hud-toast.joined .hud-toast-dot {
  background: var(--hud-green);
}

/* In over 200 ms, there for 3800, out over 400 */
@keyframes hud-toast {
  0% {
    opacity: 0;
  }
  4.5%,
  91% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.hud-notes {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: min(460px, 45%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.hud-note {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 14px 7px 10px;
  border-radius: 14px;
  background: var(--hud-box);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  font-size: 14px;
  line-height: 17px;
  animation: hud-note 7.7s linear forwards;
}

.hud.plain .hud-note {
  background: rgba(0, 0, 0, 0.45);
  box-shadow: none;
}

.hud-note-text {
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.hud.plain .hud-note-text {
  text-shadow: -1px 0 rgba(0, 0, 0, 0.6), 1px 0 rgba(0, 0, 0, 0.6), 0 -1px rgba(0, 0, 0, 0.6), 0 1px rgba(0, 0, 0, 0.6);
}

/* In over 200 ms, there for 7000, out over 500 */
@keyframes hud-note {
  0% {
    opacity: 0;
  }
  2.6%,
  93.5% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* ---------------------------------------------------------------- arranging */

/* The app's bar while arranging: one line with Reset and Done, at four fifths of the height */
.hud-card {
  position: absolute;
  left: 50%;
  top: 80%;
  transform: translate(-50%, -50%);
  max-width: calc(100% - 40px);
  height: 42px;
  padding: 0 6px 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(0, 242, 255, 0.5);
  border-radius: 21px;
  background: rgba(8, 6, 20, 0.88);
  pointer-events: auto;
  white-space: nowrap;
}

.hud-card[hidden] {
  display: none;
}

.hud-card-title {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  font-weight: bold;
}

.stage .hud-card-reset,
.stage .hud-card-done {
  flex: none;
  height: 30px;
  padding: 0 14px;
  border-radius: 15px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

.stage .hud-card-reset {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
}

.stage .hud-card-reset:hover {
  background: rgba(255, 255, 255, 0.16);
}

.stage .hud-card-done {
  background: var(--hud-cyan);
  color: #04262a;
  font-size: 15px;
}

.stage .hud-card-done:hover {
  background: #7ff5ff;
}

/* ================================================================ controls */

/* The browser's own looks off; each control below says what it looks like */
:where(.stage) button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

:where(.stage) button:disabled {
  cursor: default;
}

:where(.stage) select,
:where(.stage) input {
  margin: 0;
  color: inherit;
  font: inherit;
}

/* A button of the app's forms: a pill, flat or filled with the accent colour */
.gbtn {
  flex: none;
  height: 40px;
  padding: 0 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.gbtn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.gbtn.flat {
  padding: 0 12px;
  background: none;
}

.gbtn.flat:hover {
  background: rgba(255, 255, 255, 0.08);
}

.gbtn.highlighted {
  background: var(--g-accent);
}

.gbtn.highlighted:hover {
  background: #9a66ff;
}

.gbtn:focus-visible {
  outline: 2px solid var(--g-cyan);
  outline-offset: 2px;
}

.gbtn:disabled {
  opacity: 0.38;
}


/* A choice of several, with the app's outline and arrow */
.gcombo {
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  height: 56px;
  padding: 0 40px 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 4px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='5' viewBox='0 0 10 5'%3E%3Cpath d='M0 0h10L5 5z' fill='%23fff'/%3E%3C/svg%3E") no-repeat right 15px center;
  font-size: 15px;
  text-overflow: ellipsis;
  cursor: pointer;
}

.gcombo:hover {
  border-color: rgba(255, 255, 255, 0.85);
}

.gcombo:focus-visible {
  outline: none;
  border-color: var(--g-cyan);
  box-shadow: inset 0 0 0 1px var(--g-cyan);
}

.gcombo option {
  background: #1b1733;
  color: #fff;
}

/* A line of text to fill in */
.gfield {
  min-width: 0;
  height: 56px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 4px;
  background: transparent;
  font-size: 15px;
  outline: none;
}

.gfield:hover {
  border-color: rgba(255, 255, 255, 0.85);
}

.gfield:focus {
  border-color: var(--g-accent);
  box-shadow: inset 0 0 0 1px var(--g-accent);
}

.gfield::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* On or off */
.gswitch {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  font-size: 15px;
  cursor: pointer;
}

.gswitch.disabled {
  opacity: 0.38;
  cursor: default;
}

.gswitch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gswitch-track {
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  margin-left: 8px;
  border: 2px solid #938f99;
  border-radius: 16px;
  background: #1d1b26;
  transition: background 0.12s, border-color 0.12s;
}

.gswitch-knob {
  position: absolute;
  left: 6px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #b6b3bd;
  transition: left 0.12s, top 0.12s, width 0.12s, height 0.12s, background 0.12s;
}

.gswitch input:checked + .gswitch-track {
  border-color: #b79df7;
  background: #b79df7;
}

.gswitch input:checked + .gswitch-track .gswitch-knob {
  left: 22px;
  top: 2px;
  width: 24px;
  height: 24px;
  background: #2b1a66;
}

.gswitch input:focus-visible + .gswitch-track {
  outline: 2px solid var(--g-cyan);
  outline-offset: 2px;
}

/* A value on a line, with the app's forms */
.gslider {
  appearance: none;
  -webkit-appearance: none;
  min-width: 60px;
  height: 20px;
  background: transparent;
  cursor: pointer;
  --fill: 100%;
}

.gslider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(var(--g-accent), var(--g-accent)) 0 0 / var(--fill) 100% no-repeat, rgba(140, 82, 255, 0.3);
}

.gslider::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(var(--g-accent), var(--g-accent)) 0 0 / var(--fill) 100% no-repeat, rgba(140, 82, 255, 0.3);
}

.gslider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: var(--g-accent);
}

.gslider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--g-accent);
}

.gslider:focus-visible {
  outline: 2px solid var(--g-cyan);
  outline-offset: 4px;
}

/* ================================================================ the stream menu */

/*
 * StreamMenuContent.qml: over the dimmed game, the connection and the two ways
 * out along the top, Play Together in a panel at the side (PlayTogetherBar.qml),
 * and sound, picture, the controller and the overlays in a dock along the
 * bottom. Everything fades in and slides into place in 220 ms. At 800 px and
 * wider the panel stands at the right and the top bar and the dock take the
 * width left of it; narrower (.narrow), the panel takes the whole width between
 * them (js/menu.js places it). The colours are those of css/style.css.
 */
.menu {
  --m-panel: clamp(368px, 28.75%, 420px);
  --m-ease: cubic-bezier(0.33, 1, 0.68, 1);
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  user-select: none;
  -webkit-user-select: none;
}

.menu :focus {
  outline: none;
}

/* The game, dimmed: darker towards the panel */
.menu-dim {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(6, 4, 16, 0.3), rgba(6, 4, 16, 0.45) 55%, rgba(6, 4, 16, 0.78));
}

.menu.narrow .menu-dim {
  background: linear-gradient(90deg, rgba(6, 4, 16, 0.3), rgba(6, 4, 16, 0.45) 55%, rgba(6, 4, 16, 0.45));
}

.menu-dim,
.menu-top,
.mpanel,
.mdock {
  opacity: 0;
  transition: opacity 220ms var(--m-ease), transform 220ms var(--m-ease);
}

.menu.open .menu-dim,
.menu.open .menu-top,
.menu.open .mpanel,
.menu.open .mdock {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------------------- top: the connection, and the ways out */

.menu-top {
  position: absolute;
  left: 16px;
  top: 16px;
  right: calc(32px + var(--m-panel));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  transform: translateY(-16px);
  pointer-events: none;
}

.menu.narrow .menu-top {
  right: 16px;
}

.menu-top > * {
  pointer-events: auto;
}

.mconn {
  flex: 0 1 auto;
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: rgba(14, 11, 30, 0.88);
}

/* Green: playing. Amber and pulsing: on the way, or getting back */
.mconn-dot {
  position: relative;
  flex: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.18);
}

.mconn-dot::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--good);
}

.mconn-dot.waiting {
  background: rgba(245, 185, 66, 0.18);
}

.mconn-dot.waiting::after {
  background: var(--wait);
  animation: mconn-pulse 1.2s ease-in-out infinite;
}

@keyframes mconn-pulse {
  50% {
    opacity: 0.3;
  }
}

.mconn-where {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The app's badges: cyan for the bitrate, red for what went wrong */
.mbadge {
  flex: none;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #e7e4fa;
  font-size: 12px;
  font-weight: 700;
  line-height: 24px;
  white-space: nowrap;
}

.mbadge.play {
  background: rgba(0, 242, 255, 0.11);
  color: #9ef7ff;
}

.mbadge.bad {
  background: rgba(240, 70, 110, 0.14);
  color: #ffc2d1;
}

/* The smaller picture from the host: amber, as the app's "wait" */
.mbadge.wait {
  background: rgba(245, 185, 66, 0.12);
  color: #fbd98c;
}

.mbadge.squeezed {
  display: none;
}

/* On the right, or on a row of their own where they do not fit beside the connection */
.mexits {
  flex: none;
  margin-left: auto;
  display: flex;
  gap: 10px;
}

.mresume,
.mleave {
  position: relative;
  flex: none;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.mresume {
  padding: 0 8px 0 18px;
  background: var(--text);
  color: var(--text-on-light);
}

.mresume:hover {
  background-image: linear-gradient(rgba(0, 0, 0, 0.07), rgba(0, 0, 0, 0.07));
}

.mresume:active {
  background-image: linear-gradient(rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.14));
}

/* What also goes back: Escape, or Circle on the controller */
.mresume-key {
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(42, 19, 102, 0.12);
  font-size: 11px;
  font-weight: 800;
}

.mresume-key.glyph {
  padding: 0;
}

.mleave {
  padding: 0 20px;
  border: 1px solid rgba(240, 70, 110, 0.55);
  background: rgba(240, 70, 110, 0.16);
  color: #ffc2d1;
}

.mleave:hover {
  background-image: linear-gradient(rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.07));
}

.mleave:active {
  background-image: linear-gradient(rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.14));
}

/* The focus ring: for the keys and the controller (js/menu.js sets .keys), never for the mouse */
.menu.keys :is(.mresume, .mleave, .mpill, .mdbtn, .mown-btn, .msend):focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- the side: Play Together */

.mpanel {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: var(--m-panel);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: rgba(16, 13, 34, 0.96);
  overflow: hidden;
  transform: translateX(40px);
}

.menu.narrow .mpanel {
  left: 16px;
  bottom: auto;
  width: auto;
}

.menu.narrow:not(.open) .mpanel {
  transform: translateY(16px);
}

/* Scrolls where the window is too small for all of it, with a thin bar in the margin */
.mpanel-scroll {
  flex: 1;
  min-height: 0;
  margin: 7px 0;
  padding: 8px 5px 8px 15px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.mpanel-scroll::-webkit-scrollbar {
  width: 10px;
}

.mpanel-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.mpanel-scroll::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.18) padding-box;
}

.mpanel-scroll::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

@supports not selector(::-webkit-scrollbar) {
  .mpanel-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  }
}

/* The chat takes what is left */
.mpanel-col {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Who plays when one plays at a time (the app's WhoPlays.qml, a guest's part) */
.mwho {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mwho[hidden],
.mwho [hidden] {
  display: none;
}

.mwho-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.mwho-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 19px;
}

.mwho-title.yours {
  color: var(--focus, #00f2ff);
}

.mwho-clock {
  font-family: Menlo, ui-monospace, monospace;
  font-size: 18px;
  font-weight: 800;
  color: #00f2ff;
  font-variant-numeric: tabular-nums;
}

.mwho-clock.ending {
  color: #f0466e;
}

.mwho-clock.paused {
  color: #f5b942;
}

.mwho-hint {
  color: var(--text-dim, #8f8aad);
  font-size: 12px;
  line-height: 15px;
}

.mwho .mpill {
  align-self: flex-start;
}

.mwho-pass {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mwho-chip {
  height: 36px;
  padding: 0 12px 0 7px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft, #b9b4d6);
  font-size: 13px;
  font-weight: 700;
}

.mwho-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.mwho-face {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #8c52ff, #f0469b) center / cover;
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.mwho-face.picture {
  background-size: cover;
}

/* The small capital heading over a part of the panel */
.mlabel {
  color: var(--heading-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.3px;
  line-height: 13px;
  text-transform: uppercase;
  white-space: nowrap;
}

.mroom {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mroom-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mroom-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mroom-line {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 15px;
}

.mroom-line:empty {
  display: none;
}

/* The app's switch rows (C.ToggleRow): what it is, a line under it, the switch on the right */
.mtoggle {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  cursor: pointer;
}

.mtoggle[hidden] {
  display: none;
}

.mtoggle-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mtoggle-text b {
  font-size: 13px;
  font-weight: 800;
}

.mtoggle-text small {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 15px;
}

/* The console sleeps: the moon, what it means, and who may wake it */
.masleep {
  display: flex;
  align-items: center;
  gap: 10px;
}

.masleep[hidden] {
  display: none;
}

.masleep-icon {
  flex: none;
  color: #c4b5fd;
}

.masleep-text {
  flex: 1;
  min-width: 0;
  color: var(--text-soft);
  font-size: 13px;
}

.menu button.mwake {
  flex: none;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--button, #7a3cf5);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.menu button.mwake[hidden] {
  display: none;
}

/* ---------------------------------------------------------------- everybody */

.mplayers {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Two side by side, more where the panel has the room (168 px a tile) */
.mtiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(160px, calc(50% - 4px)), 1fr));
  gap: 8px;
}

.ptile {
  position: relative;
  min-width: 0;
  height: 84px;
  border-radius: 10px;
  background: #141126;
  text-align: left;
}

.ptile:not(:disabled):hover {
  background: #1a1630;
}

.ptile:disabled {
  cursor: default;
}

/* The ring: talking, its menu open, in control, or a thin line */
.ptile::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  pointer-events: none;
}

.ptile.control::after {
  border: 2px solid var(--brand-from);
}

.ptile.menu-open::after {
  border: 2px solid var(--heading-soft);
}

.ptile.talking::after {
  border: 2px solid var(--good);
}

.ptile.talking {
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.22);
}

.menu.keys .ptile:focus {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.ptile-face {
  position: absolute;
  left: 50%;
  top: 11px;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--brand-from), var(--brand-to));
  background-size: cover;
  background-position: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.ptile-face.picture,
.mmenu-face.picture {
  background-color: #12121c;
}

/* The webcam covers the picture while it runs, a little inside the rounded frame */
.ptile-cam {
  position: absolute;
  left: 3px;
  top: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  border-radius: 7px;
  object-fit: cover;
}

.ptile-cam:not([src]) {
  visibility: hidden;
}

/* Host, from a browser, only watching */
.ptile-tags {
  position: absolute;
  left: 6px;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  overflow: hidden;
}

.ptag {
  flex: none;
  height: 17px;
  padding: 0 7px;
  border-radius: 8.5px;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  line-height: 17px;
  white-space: nowrap;
}

.ptag.live {
  background: #e91916;
}

.ptag.host {
  background: rgba(122, 60, 245, 0.92);
}

.ptag.player {
  background: rgba(14, 165, 233, 0.92);
}

.ptag.keymouse {
  background: rgba(99, 102, 241, 0.92);
}

/* Supports the project (the host checked the key) */
.ptag.supporter {
  background: rgba(255, 94, 91, 0.92);
}

.hud-tag-supporter {
  color: #ff8a87;
}

.ptag.web {
  background: rgba(16, 140, 98, 0.92);
}

.ptag.watching {
  background: rgba(0, 0, 0, 0.65);
}

/* Name and state along the bottom, rounded with the frame */
.ptile-foot {
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 1px;
  height: 24px;
  padding: 0 7px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 0 0 9px 9px;
  background: rgba(0, 0, 0, 0.62);
}

.ptile-name {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ptile-foot .micon {
  flex: none;
}

.ptile-foot .plays {
  color: #cdb6ff;
}

/* May play, but no controller is connected */
.ptile-foot .plays.nopad {
  opacity: 0.35;
}

.ptile-foot .watches {
  color: var(--text-soft);
}

.ptile-muted {
  flex: none;
  height: 15px;
  padding: 0 6px;
  border-radius: 7.5px;
  background: #d93a61;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 15px;
  white-space: nowrap;
}

/* In voice chat: three bars that move while talking, a dot while quiet */
.ptile-quiet {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}

.ptile-bars {
  flex: none;
  width: 13px;
  height: 11px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.ptile-bars i {
  width: 3px;
  height: 100%;
  border-radius: 1.5px;
  background: var(--good);
  transform-origin: bottom;
  animation: ptile-talk 0.7s linear infinite;
}

.ptile-bars i:nth-child(2) {
  animation-delay: -0.2s;
}

.ptile-bars i:nth-child(3) {
  animation-delay: -0.4s;
}

@keyframes ptile-talk {
  0%,
  100% {
    transform: scaleY(0.45);
  }
  50% {
    transform: scaleY(1);
  }
}

/* ---------------------------------------------------------------- one's own microphone, voices and webcam */

.mown {
  display: flex;
  gap: 6px;
}

.mown-btn {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 50px;
  padding: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.mown-btn span {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mown-btn:hover {
  background-image: linear-gradient(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06));
}

.mown-btn:active {
  background-image: linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.12));
}

/* Switched off (red), running (green), the way out of the voice chat (dim) */
.mown-btn[data-tone="bad"] {
  border-color: rgba(240, 70, 110, 0.5);
  background-color: rgba(240, 70, 110, 0.16);
  color: #ffc2d1;
}

.mown-btn[data-tone="good"] {
  border-color: rgba(52, 211, 153, 0.5);
  background-color: rgba(52, 211, 153, 0.16);
  color: #c9f7e3;
}

.mown-btn[data-tone="dim"] {
  border-color: rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.04);
  color: #d9d5f2;
}

.mcamsize {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mcamsize[hidden] {
  display: none;
}

/* ---------------------------------------------------------------- the chat */

.mchat {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mchat-rule {
  flex: none;
  height: 1px;
  margin-bottom: 2px;
  background: var(--line);
}

.mchat-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.munread {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: #d92f7f;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

.mspace {
  flex: 1;
}

/* A small pill: "Open big" */
.mpill {
  position: relative;
  flex: none;
  height: 30px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.mpill:hover {
  background-image: linear-gradient(rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.07));
}

.mpill:active {
  background-image: linear-gradient(rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.14));
}

/* The last messages, newest at the bottom; older ones go out at the top */
.mchat-list {
  flex: 1 1 76px;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.mchat-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mchat-line {
  color: #e7e4fa;
  font-size: 13px;
  line-height: 17px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  user-select: text;
  -webkit-user-select: text;
}

.mchat-line b {
  font-weight: 700;
}

.mchat-line a {
  color: var(--focus);
  text-decoration: underline;
}

.menu.keys .mchat-line a:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.mchat-empty {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 16px;
}

.mchat-form {
  flex: none;
  height: 40px;
  padding: 0 3px 0 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: var(--field);
}

.mchat-form:has(.mchat-input:focus) {
  border-color: var(--focus);
  box-shadow: inset 0 0 0 1px var(--focus);
}

.mchat-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  user-select: text;
  -webkit-user-select: text;
}

.mchat-input::placeholder {
  color: var(--text-dim);
  opacity: 1;
}

.msend {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--button);
  color: #fff;
}

.msend:hover:not(:disabled) {
  background: #8a52f7;
}

.msend:active:not(:disabled) {
  background: #6e36dc;
}

.msend:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}

/* ---------------------------------------------------------------- bottom: the dock */

.mdock {
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: max-content;
  max-width: calc(100% - 48px - var(--m-panel));
  padding: 7px 9px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(14, 11, 30, 0.92);
  transform: translateY(24px);
}

/* Who makes this, quietly above the dock (the app's line in StreamMenuContent.qml) */
.mmadeby {
  position: absolute;
  left: 22px;
  bottom: calc(16px + var(--m-dock-height, 52px) + 8px);
  max-width: calc(100% - 60px - var(--m-panel));
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-dim, #8f8aad);
  font-size: 12px;
  /* Readable on a bright game picture too */
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity 220ms var(--m-ease);
}

.menu.open .mmadeby {
  opacity: 0.85;
}

.mmadeby a {
  color: var(--heading-soft);
  text-decoration: none;
}

.mmadeby a:hover {
  color: #ffffff;
}

.mmadeby .mmadeby-support {
  color: #ff8a87;
}

.menu.narrow .mmadeby {
  display: none;
}

/* Which picture from the host, and why: above the line about who makes this (the app's line in StreamMenuContent.qml) */
.mpicture {
  position: absolute;
  left: 22px;
  bottom: calc(16px + var(--m-dock-height, 52px) + 8px + 22px);
  max-width: calc(100% - 60px - var(--m-panel));
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #e7e4fa;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity 220ms var(--m-ease);
}

.menu.open .mpicture {
  opacity: 0.9;
}

/* Narrow: no line about who makes this, the panel ends above this one */
.menu.narrow .mpicture {
  bottom: calc(16px + var(--m-dock-height, 52px) + 8px);
  max-width: calc(100% - 44px);
}

.menu.stacked .mpicture {
  position: static;
  margin: 8px 22px 0;
  white-space: normal;
}

.menu.narrow .mdock {
  max-width: calc(100% - 32px);
}

.mgroup {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mgroup.tight {
  gap: 4px;
}

.mgroup-icon {
  color: #d9d5f2;
  margin: 0 2px;
}

/* A thin upright line between the parts, while the dock is on one line */
.mline {
  position: relative;
  flex: none;
  width: 3px;
  height: 36px;
}

.mline::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 5px;
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.12);
}

/* A button of the dock: an icon, or a word with an icon */
.mdbtn {
  position: relative;
  flex: none;
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: #d9d5f2;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.mdbtn:hover {
  background: rgba(255, 255, 255, 0.11);
}

.mdbtn:active {
  background: rgba(255, 255, 255, 0.14);
}

.mdbtn.text {
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.mdbtn.text:hover {
  background: rgba(255, 255, 255, 0.11);
}

.mdbtn.text > .micon:first-child {
  color: #cdb6ff;
}

.mdbtn .chev {
  color: var(--text-soft);
}

/* A switch of the dock that is on: full screen, the numbers */
.mdbtn.checked {
  border: 1px solid rgba(140, 82, 255, 0.7);
  background: rgba(122, 60, 245, 0.35);
  color: #fff;
}

.mdbtn.checked:hover {
  background: rgba(122, 60, 245, 0.45);
}

.mvalue {
  flex: none;
  width: 42px;
  padding-right: 2px;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.mzoom {
  flex: none;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

/* Fit, Zoom, Stretch: all three on screen at once */
.mseg {
  flex: none;
  height: 36px;
  padding: 2px;
  display: flex;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}

.mseg button {
  padding: 0 12px;
  border-radius: 9px;
  color: #d9d5f2;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.mseg button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.mseg button.chosen {
  background: var(--button);
  color: #fff;
  font-weight: 800;
}

.menu.keys .mseg button:focus {
  box-shadow: inset 0 0 0 2px var(--focus);
}

/* A bar to drag: a thin track that fills with the gradient */
.mbar {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 88px;
  height: 36px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --fill: 0%;
}

.mbar::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand-from), var(--brand-to)) 0 0 / var(--fill) 100% no-repeat, rgba(255, 255, 255, 0.14);
}

.mbar::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand-from), var(--brand-to)) 0 0 / var(--fill) 100% no-repeat, rgba(255, 255, 255, 0.14);
}

.mbar::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  margin-top: -4px;
  border: 2px solid var(--brand-from);
  border-radius: 50%;
  background: #fff;
}

.mbar::-moz-range-thumb {
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  border: 2px solid var(--brand-from);
  border-radius: 50%;
  background: #fff;
}

.mbar:active::-webkit-slider-thumb {
  border-width: 4px;
}

.mbar:active::-moz-range-thumb {
  border-width: 4px;
}

/* ---------------------------------------------------------------- a low window */

/* A phone on its side: top bar, panel and dock below each other, and the menu scrolls */
.menu.stacked {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.menu.stacked .menu-dim {
  position: fixed;
}

.menu.stacked .menu-top,
.menu.stacked .mpanel,
.menu.stacked .mdock {
  position: relative;
  inset: auto;
  flex: none;
}

.menu.stacked .mpanel {
  width: auto;
  height: auto;
}

.menu.stacked .mpanel-scroll {
  overflow: visible;
}

.menu.stacked .mpanel-col {
  min-height: 0;
}

.menu.stacked .mdock {
  align-self: flex-start;
  max-width: 100%;
}

/* ---------------------------------------------------------------- lists */

/* As wide as its longest line, always inside the window (js/menu.js places it) */
.mmenu {
  position: absolute;
  z-index: 3;
  width: max-content;
  min-width: 200px;
  max-width: calc(100% - 16px);
  max-height: calc(100% - 16px);
  padding: 6px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--popup);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.mentry {
  flex: none;
  height: 38px;
  padding: 0 16px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.mentry .micon {
  flex: none;
  color: var(--text-soft);
}

.mentry.chosen {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 700;
}

.mentry.chosen .micon {
  color: #cdb6ff;
}

.mentry.danger {
  color: #ffb3c4;
  font-weight: 700;
}

.mentry.danger .micon {
  color: #ff8fa8;
}

.mentry:hover,
.menu.keys .mentry:focus {
  background: rgba(140, 82, 255, 0.2);
}

.mmenu-line {
  flex: none;
  height: 1px;
  margin: 4px 6px;
  background: var(--line);
}

/* A player's menu: who it is, and how they are here */
.mmenu-head {
  position: relative;
  flex: none;
  height: 50px;
  padding: 0 12px 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mmenu-head::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 0;
  height: 1px;
  background: var(--line);
}

.mmenu-face {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--brand-from), var(--brand-to));
  background-size: cover;
  background-position: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.mmenu-who {
  min-width: 0;
}

.mmenu-name {
  font-size: 13px;
  font-weight: 800;
  line-height: 18px;
}

.mmenu-state {
  color: var(--text-dim);
  font-size: 11px;
  line-height: 14px;
}

/* What the page sees of the controller, over the controller's list */
.mmenu-note {
  flex: none;
  width: 0;
  min-width: 100%;
  padding: 6px 10px 6px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 16px;
  white-space: normal;
}

/* ---------------------------------------------------------------- fingers */

/* A phone or a tablet: everything at least 44 px to touch */
@media (pointer: coarse) {
  .mdbtn {
    min-width: 44px;
    height: 44px;
  }

  .mseg {
    height: 44px;
  }

  .mbar,
  .mline {
    height: 44px;
  }

  .mline::after {
    top: 9px;
  }

  .mentry {
    height: 44px;
  }

  .mpill {
    height: 36px;
    border-radius: 18px;
  }

  .mchat-form {
    height: 48px;
  }

  .mchat-input {
    height: 44px;
    font-size: 16px;
  }

  .msend {
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }
}

/* The way into the menu for a mouse or a finger; the app has only keys for it */
.menu-handle {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  height: 40px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: rgba(14, 11, 30, 0.88);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  transition: opacity 0.25s;
}

.menu-handle:hover {
  border-color: rgba(140, 82, 255, 0.7);
}

.menu-handle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.menu-handle small {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

@media (pointer: coarse) {
  .menu-handle {
    height: 44px;
    border-radius: 22px;
  }
}

.stage.idle .menu-handle {
  opacity: 0;
  pointer-events: none;
}

/* ================================================================ panels in front of the picture */

.gpanel {
  position: absolute;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: var(--g-sheet);
  overflow: hidden;
}

.gpanel-close {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 24px;
  font-size: 26px;
  line-height: 1;
}

.gpanel-close:hover,
.gpanel-close:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.1);
}

/* ---------------------------------------------------------------- the options */

.options {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: max(360px, min(100% - 60px, 1000px));
  height: max(300px, min(100% - 60px, 780px));
  max-width: 100%;
  max-height: 100%;
  border: 1px solid var(--g-accent);
}

.gpanel-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  margin: 10px 12px 0 22px;
}

.gpanel-title {
  flex: 1;
  font-size: 22px;
  font-weight: bold;
}

.gpanel-note {
  opacity: 0.6;
  font-size: 13px;
}

.gpanel-body {
  flex: 1;
  min-height: 0;
  margin: 8px 18px 18px;
  padding-right: 14px;
  overflow-y: auto;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.ocard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(16, 16, 24, 0.72);
}

.ocard-title {
  align-self: flex-start;
  background: linear-gradient(90deg, #c084fc, #7c86ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 21px;
  font-weight: bold;
}

.ocard-sub {
  opacity: 0.68;
  font-size: 14px;
}

.ocaption {
  margin-top: 8px;
  opacity: 0.55;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.orow {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
}

.orow.buttons {
  margin-top: 10px;
  flex-wrap: wrap;
}

.orow .grow {
  flex: 1;
}

.orow .gbtn {
  font-size: 14px;
}

.orow.buttons .gbtn {
  font-size: 15px;
}

.olabel {
  flex: none;
  font-size: 15px;
}

.ovalue {
  flex: none;
  width: 46px;
  font-size: 15px;
  text-align: right;
}

.ogrid {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 10px;
}

@container options (min-width: 660px) {
  .ogrid {
    grid-template-columns: 1fr 1fr;
  }
}

.gpanel-body {
  container: options / inline-size;
}

/* ---------------------------------------------------------------- the chat */

.chat {
  right: 20px;
  top: 40px;
  width: min(400px, max(300px, 100% - 40px));
  height: max(320px, 100% - 80px);
  max-width: calc(100% - 8px);
  max-height: calc(100% - 44px);
  border: 1px solid rgba(140, 82, 255, 0.7);
  background: rgba(13, 11, 31, 0.96);
}

.chat-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  margin: 8px 8px 0 18px;
}

.chat-head-text {
  flex: 1;
  min-width: 0;
}

.chat-title {
  font-size: 20px;
  font-weight: bold;
  line-height: 24px;
}

.chat-sub {
  opacity: 0.55;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-rule {
  flex: none;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.chat-list {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 6px;
  overflow-y: auto;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.chat-empty {
  position: absolute;
  left: 30px;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.chat-empty-icon {
  font-size: 40px;
  line-height: 1.2;
}

.chat-empty b {
  font-size: 15px;
}

.chat-empty span {
  opacity: 0.6;
  font-size: 13px;
}

/* The messages, the emoji and the row to write in: css/chat.css, as in the friends' chats */

/* ================================================================ the rest on the picture */

/* The connection was lost and the page is getting it back by itself */
.banner {
  position: absolute;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  height: 44px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 24px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  background: rgba(10, 10, 20, 0.88);
  font-size: 14px;
  white-space: nowrap;
}

.banner-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-leave {
  flex: none;
  height: 28px;
  margin-left: 6px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: bold;
}

.banner-leave:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* The console sleeps and the room stays */
.asleep {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 24px;
  text-align: center;
  background: #07060f;
}

.asleep[hidden] {
  display: none;
}

.asleep-moon {
  font-size: 56px;
  color: #c4b5fd;
  line-height: 1;
}

.asleep-title {
  font-size: 26px;
  font-weight: 800;
}

.asleep-text {
  max-width: 560px;
  font-size: 18px;
  color: #d4d4e8;
}

.asleep button {
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--button, #7a3cf5);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.asleep button:hover {
  filter: brightness(1.1);
}

.asleep button:focus-visible {
  outline: 2px solid var(--focus, #9ef7ff);
  outline-offset: 2px;
}

/* Something the player has to know: the microphone could not be opened, the webcam went away */
/* The mouse was just caught for aiming: for a moment, how to get it back (the app's note, at its place) */
.caught-note {
  position: absolute;
  top: 64px;
  left: 50%;
  z-index: 3;
  max-width: calc(100% - 24px);
  height: 40px;
  padding: 0 20px;
  border: 1px solid rgba(140, 82, 255, 0.6);
  border-radius: 20px;
  background: rgba(14, 11, 30, 0.88);
  color: #e7dcff;
  font-size: 14px;
  font-weight: bold;
  line-height: 38px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 0.2s;
  pointer-events: none;
}

.caught-note.shown {
  opacity: 1;
}

.notices {
  position: absolute;
  left: 0;
  right: 0;
  top: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.notice {
  max-width: min(640px, 100% - 24px);
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 17px;
  background: rgba(12, 10, 26, 0.9);
  font-size: 14px;
  text-align: center;
  animation: hud-note 7.7s linear forwards;
}

/* The numbers of the connection, as the app shows them: along the right edge */
.stats {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  pointer-events: none;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.9), 0 0 2px rgba(0, 0, 0, 0.9);
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 15px;
}

.stat[hidden] {
  display: none;
}

.stat b {
  font-size: 18px;
}

.stat.rate {
  font-size: 18px;
}

.stat.rate b {
  color: var(--g-accent);
  font-size: 28px;
}

.stat.blue b {
  color: #90caf9;
}

.stat.red b {
  color: #ef9a9a;
}

@media (prefers-reduced-motion: reduce) {
  .menu-dim,
  .menu-top,
  .mpanel,
  .mdock {
    transition: none;
  }

  .mconn-dot.waiting::after,
  .ptile-bars i {
    animation: none;
  }
}

/* One's own chat message on its way, and one the host never answered, as in the app */
.mchat-line.pending {
  opacity: 0.55;
}

.mchat-failed {
  color: #f0466e;
}

.mchat-key {
  color: var(--text-dim);
  font-size: 11px;
}


/* ================================================================ the lobby (Just talk) */
/* As the app's lobby (qml/scenes/SceneLobby.qml): the same canvas, sizes and roles, in the app's
   own look (the page has no looks). js/lobby.js scales the canvas and places the people. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/PlusJakartaSans.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

.plobby {
  --ground: #0c0a1d;
  --panel-rgb: 21, 18, 43;
  --shade-rgb: 8, 6, 20;
  --ink: #f3f1ff;
  --ink-soft: #e7e4fa;
  --soft: #b9b4d6;
  --dim: #8f8aad;
  --accent: #8c52ff;
  --accent-rgb: 140, 82, 255;
  --accent-deep-rgb: 122, 60, 245;
  --accent2-rgb: 240, 70, 155;
  --highlight: #00f2ff;
  --good: #34d399;
  --bad: #f0466e;
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-color: var(--ground);
  background-image: radial-gradient(70% 70% at 0% 0%, rgba(var(--accent-rgb), 0.26), rgba(var(--accent-rgb), 0) 70%),
    radial-gradient(60% 70% at 100% 100%, rgba(var(--accent2-rgb), 0.16), rgba(var(--accent2-rgb), 0) 70%);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
}

.plobby[hidden] {
  display: none;
}

.plobby-canvas {
  position: absolute;
  left: 0;
  top: 0;
  box-sizing: border-box;
  transform-origin: 0 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 36px 56px;
}

.plobby-canvas.compact {
  gap: 18px;
  padding: 24px 32px;
}

.plobby-head {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px 18px 14px 24px;
  border-radius: 24px;
  background: rgba(var(--panel-rgb), 0.9);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.compact .plobby-head {
  gap: 16px;
  padding: 12px 14px 12px 18px;
  border-radius: 20px;
}

.plobby-logo {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.compact .plobby-logo {
  width: 40px;
  height: 40px;
}

.plobby-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
  flex: 1 1 auto;
  overflow: hidden;
}

.plobby-t,
.plobby-s {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plobby-t {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.2;
}

.plobby-s {
  font-size: 20px;
  font-weight: 600;
  color: var(--soft);
}

.compact .plobby-t {
  font-size: 30px;
}

.compact .plobby-s {
  font-size: 17px;
}

.plobby-grow {
  flex: 0 1 0;
}

/* Who is in the voice chat: green keeps its meaning */
.plobby-voice {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  height: 46px;
  padding: 0 19px;
  border-radius: 23px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #d7fbe9;
  font-size: 20px;
  font-weight: 700;
}

.plobby-voice[hidden] {
  display: none;
}

.compact .plobby-voice {
  height: 40px;
  padding: 0 15px;
  font-size: 17px;
}

.plobby-dot {
  width: 12px;
  height: 12px;
  border-radius: 6px;
  background: var(--good);
}

.plobby-choose {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.plobby-switch {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 24px;
  background: rgba(var(--shade-rgb), 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.plobby-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: transparent;
  color: var(--soft);
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.compact .plobby-choice {
  height: 36px;
  padding: 0 14px;
  font-size: 17px;
}

.plobby-choice:hover {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--ink-soft);
}

.plobby-choice:active {
  background: rgba(var(--accent-rgb), 0.22);
}

.plobby-choice.chosen {
  background: rgba(var(--accent-deep-rgb), 0.95);
  border-color: rgba(var(--accent-rgb), 0.7);
  color: var(--ink);
}

.plobby-choice:focus-visible,
html.pad-nav .plobby-choice:focus {
  outline: 3px solid var(--highlight);
  outline-offset: 3px;
}

.plobby-glyph {
  flex-shrink: 0;
}

.plobby-glyph.boxes {
  position: relative;
  width: 22px;
  height: 16px;
}

.plobby-glyph.boxes i {
  position: absolute;
  border-radius: 2px;
  background: currentColor;
}

.plobby-hint {
  font-size: 16px;
  font-weight: 600;
  color: var(--dim);
  text-align: right;
  white-space: nowrap;
}

.compact .plobby-hint {
  font-size: 15px;
}

/* A narrow window: the layout switch on a line of its own */
.narrow .plobby-head {
  flex-wrap: wrap;
  row-gap: 14px;
}

.narrow .plobby-choose {
  flex-basis: 100%;
  align-items: flex-start;
}

.narrow .plobby-hint {
  text-align: left;
  white-space: normal;
}

.plobby-tiles {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.plobby-tile {
  --plate: 52px;
  --r: 28px;
  --av: 200px;
  position: absolute;
  box-sizing: border-box;
  padding: 0;
  border: 0;
  border-radius: var(--r);
  background: rgba(var(--panel-rgb), 0.96);
  color: inherit;
  font: inherit;
  cursor: pointer;
  /* A dark edge first, so that the ring and the outline stand out on any picture */
  box-shadow: 0 0 0 3px rgba(var(--shade-rgb), 0.55);
  transition: opacity 0.26s, transform 0.2s;
}

.plobby-tiles.moving .plobby-tile {
  transition: left 0.3s cubic-bezier(0.33, 1, 0.68, 1), top 0.3s cubic-bezier(0.33, 1, 0.68, 1),
    width 0.3s cubic-bezier(0.33, 1, 0.68, 1), height 0.3s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.26s, transform 0.2s;
}

.plobby-tile.big {
  z-index: 1;
}

.plobby-tile.new,
.plobby-tile.gone {
  opacity: 0;
  transform: scale(0.94);
}

.plobby-tile:active {
  transform: scale(0.985);
}

/* The tile's edge: green while they talk, the accent under the pointer */
.plobby-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.plobby-tile:hover::after {
  border: 3px solid rgba(var(--accent-rgb), 0.9);
}

.plobby-tile.talking {
  box-shadow: 0 0 0 3px rgba(var(--shade-rgb), 0.55), 0 0 0 9px rgba(52, 211, 153, 0.28);
}

.plobby-tile.talking::after {
  border: 5px solid var(--good);
}

.plobby-tile:focus-visible,
html.pad-nav .plobby-tile:focus {
  outline: 4px solid var(--highlight);
  outline-offset: 7px;
}

.plobby-face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plobby-cam {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.plobby-cam[hidden],
.plobby-avatar[hidden] {
  display: none;
}

/* Without a webcam: the picture, or the initial in the look's colours */
.plobby-avatar {
  width: var(--av);
  height: var(--av);
  margin-top: calc(var(--plate) * -0.6);
  box-sizing: border-box;
  border-radius: 50%;
  border: max(2px, calc(var(--av) * 0.025)) solid rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 0 max(2px, calc(var(--av) * 0.012)) transparent;
  background-color: rgb(var(--accent-deep-rgb));
  background-image: linear-gradient(180deg, rgb(var(--accent-deep-rgb)), rgba(var(--accent-deep-rgb), 0.74));
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--av) * 0.44);
  font-weight: 800;
  color: var(--ink);
}

.plobby-avatar.picture {
  background-color: transparent;
}

.plobby-tile.talking .plobby-avatar {
  border-color: var(--good);
}

/* The name plate: on a shade, so that it reads on any webcam */
.plobby-plate {
  position: absolute;
  left: calc(var(--plate) * 0.42);
  bottom: calc(var(--plate) * 0.38);
  max-width: calc(100% - var(--plate) * 0.84);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: calc(var(--plate) * 0.22);
  height: var(--plate);
  padding: 0 calc(var(--plate) * 0.33) 0 calc(var(--plate) * 0.3);
  border-radius: calc(var(--plate) / 2);
  background: rgba(var(--shade-rgb), 0.78);
}

.plobby-tile.small .plobby-plate {
  left: 6px;
  bottom: 6px;
  max-width: calc(100% - 12px);
}

.plobby-mic {
  display: flex;
  flex-shrink: 0;
  color: var(--ink-soft);
}

.plobby-mic svg {
  width: calc(var(--plate) * 0.42);
  height: calc(var(--plate) * 0.42);
}

.plobby-tile.talking .plobby-mic {
  color: var(--good);
}

.plobby-tile.muted .plobby-mic {
  color: var(--bad);
}

.plobby-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: calc(var(--plate) * 0.48);
  font-weight: 700;
}

/* The host's mark in the look's colours; LIVE keeps its red */
.plobby-tag {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: calc(var(--plate) * 0.56);
  padding: 0 calc(var(--plate) * 0.2);
  border-radius: calc(var(--plate) * 0.2);
  background: rgba(var(--accent-deep-rgb), 0.95);
  border: 1px solid rgba(var(--accent-rgb), 0.7);
  font-size: max(10px, calc(var(--plate) * 0.3));
  font-weight: 800;
  letter-spacing: 0.1em;
}

.plobby-tag.live {
  background: #e91916;
  border-color: #e91916;
  color: #fff;
}

.plobby-tag[hidden],
.plobby-tile.small .plobby-tag {
  display: none;
}

/* For a moment when it comes up: what this screen is and how to get to the menu. A row of its
   own; once it has faded, the people move into the room it leaves (js/lobby.js). */
.plobby-note {
  align-self: center;
  flex-shrink: 0;
  max-width: calc(100% - 40px);
  box-sizing: border-box;
  height: 58px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  border-radius: 29px;
  background: rgba(var(--shade-rgb), 0.9);
  border: 1px solid rgba(var(--accent-rgb), 0.6);
  color: var(--ink-soft);
  font-size: 21px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.38s;
}

.compact .plobby-note {
  height: 50px;
  font-size: 18px;
}

.plobby-note[hidden] {
  display: none;
}

.plobby-note.gone {
  opacity: 0;
}

/* Under the lobby: the display's players and webcams are in the lobby itself, as in the app */
.hud.under-lobby .hud-layer {
  display: none;
}


/* ================================================================ the connecting screen */
/* As the app's (qml/connect/ConnectScene.qml), laid out in the same units: --u is one step of a
   960 x 540 stage, --tu the same for words, never smaller than readable (js/connectscreen.js). */

.connect {
  --u: 1px;
  --tu: 1px;
  --h: 100vh;
  --pw: 200px;
  --ph: 60px;
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--ground, #0c0a1d);
  color: var(--text, #f3f1ff);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  transform-origin: 50% 50%;
}

.connect[hidden] {
  display: none;
}

/* Into the game, with a slight zoom, once the first picture is on the screen */
.connect.leaving {
  opacity: 0;
  transform: scale(1.035);
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.33, 1, 0.68, 1), transform 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}

/* When it did not work, in front of everything on the stage */
.connect[data-mode="failed"] {
  z-index: 20;
}

/* While it connects: no players' tiles yet, and the stream menu's keys are at the foot */
.stage.connect-loading .hud,
.stage.connect-up .menu-handle {
  visibility: hidden;
}

.cn-back,
.cn-back > * {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* A friend's game, far behind: blurred once, then it only drifts */
.cn-cover {
  opacity: 0;
  transition: opacity 0.8s;
}

.cn-cover.ready {
  opacity: 0.34;
}

.cn-cover img {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  object-fit: cover;
  filter: blur(calc(40 * var(--u))) saturate(0.8);
  transform: scale(1.08);
  will-change: transform;
  animation: cn-cover 21s ease-in-out infinite alternate;
}

@keyframes cn-cover {
  to {
    transform: scale(1.1);
  }
}

/* Two glows of the app's colours, slowly going round, and the light the console stands in */
.cn-glow {
  inset: auto;
  border-radius: 50%;
  will-change: transform;
}

.cn-glow.a {
  left: -25%;
  top: calc(36% - 55vw);
  width: 110vw;
  height: 110vw;
  background: radial-gradient(closest-side, rgba(140, 82, 255, 0.34), rgba(140, 82, 255, 0.12) 55%, rgba(140, 82, 255, 0) 100%);
  animation: cn-drift-a 34s ease-in-out infinite;
}

.cn-glow.b {
  left: 26%;
  top: calc(62% - 48vw);
  width: 96vw;
  height: 96vw;
  background: radial-gradient(closest-side, rgba(240, 70, 155, 0.2), rgba(240, 70, 155, 0.07) 55%, rgba(240, 70, 155, 0) 100%);
  animation: cn-drift-b 38s ease-in-out infinite;
}

.cn-glow.c {
  left: calc(50% + 236 * var(--u) - 240 * var(--u));
  top: calc(36% - 240 * var(--u));
  width: calc(480 * var(--u));
  height: calc(480 * var(--u));
  background: radial-gradient(closest-side, rgba(0, 242, 255, 0.06), rgba(0, 242, 255, 0.02) 55%, rgba(0, 242, 255, 0) 100%);
}

@keyframes cn-drift-a {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(5vw, 4vh); }
  50% { transform: translate(0, 6vh); }
  75% { transform: translate(-5vw, 2vh); }
}

@keyframes cn-drift-b {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-4vw, -4vh); }
  50% { transform: translate(-6vw, 2vh); }
  75% { transform: translate(-1vw, 5vh); }
}

/* Dust in the light, rising slowly */
.cn-dust i {
  position: absolute;
  left: var(--x);
  top: 100%;
  width: calc(var(--s) * var(--u));
  height: calc(var(--s) * var(--u));
  border-radius: 50%;
  background: #fff;
  will-change: transform, opacity;
  animation: cn-rise var(--rise) linear var(--at) infinite, cn-twinkle var(--twinkle) ease-in-out var(--at) infinite alternate;
}

.cn-dust i.lilac {
  background: #ddd0ff;
}

@keyframes cn-rise {
  to {
    transform: translateY(calc(-1 * var(--h) - 20px));
  }
}

@keyframes cn-twinkle {
  from { opacity: 0.1; }
  to { opacity: 0.42; }
}

.cn-vignette {
  background: radial-gradient(72vw 72vw at 50% 46%, rgba(12, 10, 29, 0) 45%, rgba(12, 10, 29, 0.85) 100%);
}

/* This app: its icon in a card with a ring of its two colours */
/* The app icon is its own tile: it fills the ring, whose corner follows the icon's (204 of 896) */
.cn-app {
  position: absolute;
  width: calc(118 * var(--u));
  height: calc(118 * var(--u));
  margin: calc(-3 * var(--u));
  border: calc(3 * var(--u)) solid transparent;
  border-radius: calc(28.5 * var(--u));
  background: linear-gradient(var(--card, #15122b), var(--card, #15122b)) padding-box,
    linear-gradient(90deg, rgba(140, 82, 255, 0.9), rgba(240, 70, 155, 0.9)) border-box;
  animation: cn-float-a 4.2s ease-in-out infinite alternate;
}

.cn-icon {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border-radius: calc(25.5 * var(--u));
}

.connect[data-mode="controller"] .cn-icon {
  left: 50%;
  top: 50%;
  width: calc(56 * var(--u));
  height: calc(56 * var(--u));
  border-radius: 0;
  transform: translate(-50%, -50%);
}

@keyframes cn-float-a {
  from { transform: translateY(calc(-3 * var(--u))); }
  to { transform: translateY(calc(3 * var(--u))); }
}

/* What it connects to, in its light, with an edge in the light so that a black console stands out */
.cn-device {
  position: absolute;
  width: calc(250 * var(--u));
  height: calc(150 * var(--u));
}

.cn-disc,
.cn-floor,
.cn-lit,
.cn-picture,
.cn-badge {
  position: absolute;
}

.cn-disc {
  left: 50%;
  top: 50%;
  width: calc(295 * var(--u));
  height: calc(295 * var(--u));
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(109, 75, 209, 0.26), rgba(109, 75, 209, 0.1) 60%, rgba(109, 75, 209, 0));
  animation: cn-breathe 2.4s ease-in-out infinite alternate;
}

.cn-floor {
  left: 50%;
  top: calc(50% + var(--ph) / 2 + 4 * var(--u));
  width: calc(var(--pw) * 0.92);
  height: calc(14 * var(--u));
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(140, 107, 255, 0.5), rgba(140, 107, 255, 0));
}

.cn-lit {
  inset: 0;
  will-change: transform;
  animation: cn-float-b 4.2s ease-in-out -1.3s infinite alternate;
}

.cn-picture {
  left: 50%;
  top: 50%;
  width: var(--pw);
  height: var(--ph);
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 calc(2.5 * var(--u)) rgba(185, 156, 255, 0.95)) drop-shadow(0 0 calc(7 * var(--u)) rgba(185, 156, 255, 0.55));
}

@keyframes cn-float-b {
  from { transform: translateY(calc(4 * var(--u))); }
  to { transform: translateY(calc(-4 * var(--u))); }
}

@keyframes cn-breathe {
  from { opacity: 0.8; }
  to { opacity: 1; }
}

/* Asleep or waking: a moon on it, the console dimmed; joining: whose it is */
.cn-badge {
  right: calc(8 * var(--u));
  top: 0;
  display: none;
  width: calc(40 * var(--u));
  height: calc(40 * var(--u));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: calc(19 * var(--u));
  font-weight: 800;
}

.cn-badge.host {
  display: flex;
  background: linear-gradient(180deg, #22d3ee, #6366f1);
}

.cn-badge.moon {
  display: flex;
  background: var(--card, #15122b) url("../img/moon.svg") center / 50% no-repeat;
}

.connect[data-mode="asleep"] .cn-lit,
.connect[data-mode="waking"] .cn-lit {
  opacity: 0.6;
}

.connect[data-mode="waking"] .cn-lit {
  animation: cn-float-b 4.2s ease-in-out -1.3s infinite alternate, cn-wake 2.8s ease-in-out infinite alternate;
}

@keyframes cn-wake {
  from { opacity: 0.5; }
  to { opacity: 0.75; }
}

.connect[data-mode="asleep"] .cn-disc,
.connect[data-mode="waking"] .cn-disc {
  animation: none;
  opacity: 0.6;
}

.connect[data-mode="failed"] .cn-lit {
  opacity: 0.45;
  animation: none;
}

.connect[data-mode="failed"] .cn-picture {
  filter: drop-shadow(0 0 calc(2.5 * var(--u)) rgba(74, 67, 96, 0.6));
}

.connect[data-mode="failed"] .cn-disc,
.connect[data-mode="failed"] .cn-floor {
  animation: none;
  opacity: 0.35;
  filter: grayscale(1);
}

.connect[data-mode="failed"] .cn-app {
  background: linear-gradient(var(--card, #15122b), var(--card, #15122b)) padding-box,
    linear-gradient(90deg, rgba(140, 82, 255, 0.35), rgba(240, 70, 155, 0.35)) border-box;
}

.connect[data-mode="failed"] .cn-glow.a {
  filter: hue-rotate(-20deg) saturate(0.5);
  opacity: 0.7;
}

.connect[data-mode="failed"] .cn-glow.c,
.connect[data-mode="failed"] .cn-dust {
  opacity: 0.5;
}

/* The line of light */
.cn-line {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
}

.cn-ring {
  stroke: #c4b5fd;
}

.cn-broken {
  display: none;
}

.connect[data-mode="failed"] .cn-broken {
  display: inline;
}

.connect[data-mode="failed"] .cn-dots circle:first-child {
  fill: #5b5677;
}

.cn-broken-disc {
  fill: rgba(240, 70, 110, 0.16);
  stroke: rgba(240, 70, 110, 0.6);
  stroke-width: 1.2;
}

.cn-broken-x {
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* What happens now */
.cn-words {
  position: absolute;
  left: 50%;
  width: min(calc(100% - 32px), calc(720 * var(--tu)));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(8 * var(--tu));
  text-align: center;
}

.cn-title {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  font-size: calc(30 * var(--tu));
  font-weight: 800;
  letter-spacing: calc(-0.3 * var(--tu));
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cn-sub {
  margin: 0;
  color: var(--text-soft, #b9b4d6);
  font-size: calc(15 * var(--tu));
  font-weight: 600;
  line-height: 1.3;
  white-space: pre-line;
}

/* The steps: done ones green, this one breathing, the next ones quiet */
.cn-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(8 * var(--tu)) calc(14 * var(--tu));
  margin: calc(8 * var(--tu)) 0 0;
  padding: 0;
  list-style: none;
}

.cn-steps li {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--tu));
  color: var(--text-dim, #8f8aad);
  font-size: calc(13 * var(--tu));
  font-weight: 600;
}

.cn-steps li + li::before {
  content: "";
  width: calc(26 * var(--tu));
  height: max(1px, calc(1.2 * var(--tu)));
  background: rgba(255, 255, 255, 0.12);
}

.cn-steps li.done + li::before,
.cn-steps li.now::before {
  background: rgba(255, 255, 255, 0.3);
}

.cn-step-dot {
  position: relative;
  flex: none;
  width: calc(16 * var(--tu));
  height: calc(16 * var(--tu));
  border: calc(1.4 * var(--tu)) solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
}

.cn-steps li.done {
  color: var(--text-soft, #b9b4d6);
}

.cn-steps li.done .cn-step-dot {
  border: 0;
  background: var(--good, #34d399) url("../img/check.svg") center / 62% no-repeat;
}

.cn-steps li.now {
  color: var(--text, #f3f1ff);
  font-weight: 700;
}

.cn-steps li.now .cn-step-dot {
  border: 0;
  background: #8c52ff;
  animation: cn-step 1.2s ease-in-out infinite alternate;
}

.cn-steps li.now .cn-step-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border: calc(1.2 * var(--tu)) solid rgba(140, 82, 255, 0.6);
  border-radius: 50%;
  animation: cn-step-ring 1.2s ease-out infinite;
}

@keyframes cn-step {
  from { transform: scale(0.9); }
  to { transform: scale(1.12); }
}

@keyframes cn-step-ring {
  from { transform: scale(1.6); opacity: 1; }
  to { transform: scale(2.1); opacity: 0; }
}

/* When it did not work: the way back */
.cn-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(12 * var(--tu));
  margin-top: calc(10 * var(--tu));
}

.cn-action {
  display: inline-flex;
  align-items: center;
  gap: calc(10 * var(--tu));
  height: calc(44 * var(--tu));
  padding: 0 calc(18 * var(--tu));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font: inherit;
  font-size: calc(15 * var(--tu));
  font-weight: 800;
  cursor: pointer;
}

.cn-action.primary {
  border-color: transparent;
  background: linear-gradient(90deg, var(--button-from, #7a3cf5), var(--button-to, #c92d7b));
}

.cn-action:hover {
  filter: brightness(1.1);
}

.cn-action:focus-visible {
  outline: 2px solid var(--focus, #00f2ff);
  outline-offset: 3px;
}

/* At the foot: the keys */
.cn-foot {
  position: absolute;
  left: 50%;
  bottom: max(16px, calc(30 * var(--u)));
  width: max-content;
  max-width: calc(100% - 32px);
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(10 * var(--tu)) calc(26 * var(--tu));
}

.cn-hint {
  display: flex;
  align-items: center;
  gap: calc(5 * var(--tu));
  color: var(--text-soft, #b9b4d6);
  font-size: calc(13 * var(--tu));
  font-weight: 600;
}

.cn-hint-text {
  padding-left: calc(4 * var(--tu));
}

.cn-key {
  position: relative;
  min-width: calc(24 * var(--tu));
  height: calc(24 * var(--tu));
  padding: 0 calc(7 * var(--tu)) calc(2 * var(--tu));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: calc(7 * var(--tu));
  background: #1d1938;
  box-shadow: inset 0 calc(-3 * var(--tu)) 0 rgba(0, 0, 0, 0.3);
  color: #fff;
  font-family: inherit;
  font-size: calc(12 * var(--tu));
  font-weight: 700;
  line-height: 1;
}

.cn-key.light {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 calc(-3 * var(--tu)) 0 rgba(0, 0, 0, 0.12);
}

/* Less motion: nothing travels or drifts, the line breathes, a plain fade into the game */
.connect.calm .cn-dots {
  animation: cn-breathe 3.2s ease-in-out infinite alternate;
}

@media (prefers-reduced-motion: reduce) {
  .cn-cover img,
  .cn-glow,
  .cn-dust i,
  .cn-app,
  .cn-lit,
  .cn-disc,
  .connect[data-mode="waking"] .cn-lit,
  .cn-steps li.now .cn-step-dot,
  .cn-steps li.now .cn-step-dot::after {
    animation: none;
  }

  .cn-dust i {
    top: var(--y);
    opacity: 0.25;
  }

  .connect.leaving {
    transform: none;
    transition: opacity 0.6s ease;
  }
}

/* Something is under way, small: five dots from purple to cyan with a light going across */
.dot-pulse {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 12px;
}

.dot-pulse i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8c52ff;
  opacity: 0.3;
  animation: dot-pulse 1.3s ease-in-out infinite;
}

.dot-pulse i:nth-child(2) { background: #697aff; animation-delay: 0.13s; }
.dot-pulse i:nth-child(3) { background: #46a2ff; animation-delay: 0.26s; }
.dot-pulse i:nth-child(4) { background: #23caff; animation-delay: 0.39s; }
.dot-pulse i:nth-child(5) { background: #00f2ff; animation-delay: 0.52s; }

@keyframes dot-pulse {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  25% {
    opacity: 1;
    transform: scale(1.3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dot-pulse i {
    animation-duration: 3s;
  }
}
