/* SPDX-License-Identifier: LicenseRef-AGPL-3.0-only-OpenSSL */
/*
 * ControlTogether in a web browser. The same look as the app (gui/src/qml/controls/Theme.qml):
 * calm dark cards, the gradient only for the name and the one step that starts something,
 * and a colour always means the same thing: purple goes on, green is on or lets in, amber
 * rests or waits, red leaves or removes, cyan is focus and how a room plays.
 */

:root {
  /* Grounds, back to front */
  --ground: #0c0a1d;
  --card: #15122b;
  --card-high: #1a1535;
  --door: #17132e;
  --field: #0f0c22;
  --popup: #1b1735;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);

  /* The brand: the one main action per screen, and the name */
  --brand-from: #8c52ff;
  --brand-to: #f0469b;
  /* The project's name next to its icon: from the purple player to the cyan one (Theme.qml nameFrom/nameTo) */
  --name-from: #a77bff;
  --name-to: #00f2ff;
  --button-from: #7a3cf5;
  --button-to: #c92d7b;
  --button: #7a3cf5;
  --heading-soft: #a9b0ff;
  --focus: #00f2ff;

  /* What things are */
  --good: #34d399;
  --wait: #f5b942;
  --bad: #f0466e;

  /* Text */
  --text: #f3f1ff;
  --text-soft: #b9b4d6;
  --text-dim: #8f8aad;
  --text-on-light: #2a1366;

  --radius-card: 20px;
  --radius-field: 12px;
  --touch: 44px;
  --gutter: 32px;

  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(140, 82, 255, 0.2), transparent 70%),
    radial-gradient(800px 400px at 100% 110%, rgba(240, 70, 155, 0.1), transparent 70%),
    var(--ground);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

a {
  color: var(--heading-soft);
  text-decoration: underline;
  text-decoration-color: rgba(169, 176, 255, 0.45);
  text-underline-offset: 2px;
}

a:hover {
  color: #ffffff;
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

code {
  padding: 1px 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: #d8c6ff;
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
}

/* For screen readers only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* The name, as in the app bar */
.grad {
  background: linear-gradient(90deg, #a77bff, var(--brand-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.grad.name {
  background: linear-gradient(90deg, var(--name-from), var(--name-to));
  -webkit-background-clip: text;
  background-clip: text;
}

.dim {
  color: var(--text-dim);
}

/* The small capital heading over a group: "FIND A ROOM", "YOU JOIN AS" */
.label {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.4px;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--heading-soft);
}

/* What went wrong (red), or what is not quite right (amber) */
.problem {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0 0;
  padding: 10px 14px;
  border: 1px solid rgba(240, 70, 110, 0.45);
  border-radius: 14px;
  background: rgba(240, 70, 110, 0.12);
  color: #ffc2d1;
  font-size: 14px;
  font-weight: 600;
}

.problem::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--bad);
}

.problem.warn {
  border-color: rgba(245, 185, 66, 0.35);
  background: rgba(245, 185, 66, 0.08);
  color: #fbd98c;
}

.problem.warn::before {
  background: var(--wait);
}

/* ---------------------------------------------------------------- before playing */

.front {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* The app bar: the icon, the name and what it is */
.appbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  /* Installed on a phone, the page reaches under the status bar and the notch */
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
}

.appbar-in {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px var(--gutter);
}

.appbar img {
  flex: none;
  width: 40px;
  height: 40px;
}

.appbar-name {
  min-width: 0;
}

.appbar h1 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.tagline {
  margin: 1px 0 0;
  font-size: 13px;
  color: var(--text-dim);
}

.page {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px var(--gutter) 24px;
}

/* A card of the new look: a calm ground for one group of things */
.card {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
}

.card h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

:where(.front, .dialog, .friends) p {
  margin: 0;
}

/* The join, waiting and message cards stand alone in the middle */
.solo {
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
}

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

.row.end {
  justify-content: flex-end;
  margin-top: 20px;
}

/* Pushes what follows it to the end of a row: Back on the left, the rest on the right */
.row .row-gap {
  flex: 1 1 0;
}

/* ---------------------------------------------------------------- buttons */

/* A pill at least 44 px high. Ghost unless it says otherwise: "primary" goes on, "brand" (the
   gradient) is the one step that starts something. The same in the windows of the page and in
   the friends panel (css/friends.css), which lie outside the start page */
:where(.front, .dialog, .friends) button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch);
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.12s, filter 0.12s;
}

:where(.front, .dialog, .friends) button:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.1);
}

:where(.front, .dialog, .friends) button:active:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.14);
}

:where(.front, .dialog, .friends) button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

:where(.front, .dialog, .friends) button:disabled {
  opacity: 0.45;
  cursor: default;
}

:where(.front, .dialog, .friends) button.primary {
  border-color: transparent;
  background: var(--button);
  color: #ffffff;
  font-weight: 800;
}

:where(.front, .dialog, .friends) button.brand {
  border-color: transparent;
  background: linear-gradient(90deg, var(--button-from), var(--button-to));
  color: #ffffff;
  font-weight: 800;
}

:where(.front, .dialog, .friends) button.primary:hover:not(:disabled),
:where(.front, .dialog, .friends) button.brand:hover:not(:disabled) {
  filter: brightness(1.1);
}

:where(.front, .dialog, .friends) button.primary:active:not(:disabled),
:where(.front, .dialog, .friends) button.brand:active:not(:disabled) {
  filter: brightness(0.9);
}

:where(.front, .dialog, .friends) button.small {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

:where(.front, .dialog, .friends) button.big {
  min-height: 48px;
  padding: 0 30px;
  font-size: 16px;
}

/* A square button with only an icon; says what it does to screen readers */
:where(.front, .dialog, .friends) button.icon-button {
  flex: none;
  width: var(--touch);
  min-height: var(--touch);
  height: var(--touch);
  padding: 0;
  border-color: rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #d9d5f2;
}

:where(.front, .dialog, .friends) button.icon-button.small {
  width: 34px;
  min-height: 34px;
  height: 34px;
  border-radius: 10px;
}

.icon-button svg {
  display: block;
}

/* ---------------------------------------------------------------- fields */

:where(.front, .dialog, .friends) :is(input[type="text"], input[type="search"], select) {
  width: 100%;
  min-width: 0;
  height: var(--touch);
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-field);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  outline: none;
}

:where(.front, .dialog, .friends) :is(input[type="text"], input[type="search"], select):focus,
:where(.front, .dialog, .friends) :is(input[type="text"], input[type="search"], select):focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 1px var(--focus);
}

:where(.front, .dialog, .friends) :is(input[type="text"], input[type="search"])::placeholder {
  color: var(--text-dim);
  opacity: 1;
}

:where(.front) input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

:where(.front, .friends) select:not([multiple]) {
  padding-right: 38px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b9b4d6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  cursor: pointer;
}

:where(.front, .friends) select option {
  background: var(--popup);
  color: var(--text);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field > span,
.field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
}

/* A filter that is on or off: a square box, as in the app's list of rooms */
.check {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 36px;
  font-size: 13.5px;
  font-weight: 600;
  color: #e7e4fa;
  cursor: pointer;
}

.check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--button);
  cursor: pointer;
}

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

/* An on/off switch with its words: purple when on. The whole row switches it */
.toggle {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 60px;
  padding: 10px 14px;
  cursor: pointer;
}

.toggle + .toggle {
  border-top: 1px solid var(--line);
}

.toggle.sub {
  min-height: 48px;
  padding-left: 30px;
}

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

.toggle-text b {
  font-size: 14px;
  font-weight: 800;
}

.toggle.sub .toggle-text b {
  font-weight: 700;
  color: #e7e4fa;
}

.toggle-text small {
  font-size: 12.5px;
  color: var(--text-dim);
}

.toggle input {
  flex: none;
  position: relative;
  width: 44px;
  height: 26px;
  margin: 0;
  border-radius: 13px;
  background: #3a3458;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background-color 0.12s;
}

.toggle input::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #cfcbe6;
  transition: transform 0.12s ease-out, background-color 0.12s;
}

.toggle input:checked {
  background: var(--button);
}

.toggle input:checked::before {
  transform: translateX(18px);
  background: #ffffff;
}

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

.toggle input:disabled {
  opacity: 0.45;
  cursor: default;
}

.toggle:has(input:disabled) {
  cursor: default;
}

.toggles {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--field);
}

/* ---------------------------------------------------------------- badges */

/* A small label for what something is; a colour always means the same */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 2px 9px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: #e7e4fa;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
}

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

/* How one gets in: purple, as the app's "door" badges */
.badge.door {
  background: rgba(140, 82, 255, 0.2);
  color: #d8c6ff;
}

/* A state with a dot in front: open now, being checked, not open (the app's "good", "wait", "neutral") */
.badge.dot::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}

.badge.good {
  background: rgba(52, 211, 153, 0.12);
  color: #9ff0cc;
}

.badge.good::before {
  background: #34d399;
}

.badge.wait {
  background: rgba(245, 185, 66, 0.12);
  color: #fbd98c;
}

.badge.wait::before {
  background: #f5b942;
}

.badge.web {
  background: rgba(52, 211, 153, 0.14);
  color: #9ff0cc;
}

.badge.system {
  background: rgba(79, 140, 255, 0.14);
  color: #c4d8ff;
}

.badge.twitch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #7c3aed;
  color: #ffffff;
  font-weight: 800;
}

.badge.twitch i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
}

/* A link that looks like the page's ghost pill, a little smaller */
.room-action .watch-twitch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(145, 70, 255, 0.55);
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.16);
  color: #e2d6ff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.room-action .watch-twitch:hover {
  background: rgba(124, 58, 237, 0.28);
  color: #ffffff;
}

.room-action .watch-twitch:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- bringing things over from the old address */

/*
 * The offer at the page's new address (js/carryoffer.js): the box of what this browser kept, the
 * way from the old address to the new one, one line, and the step. A card of its own over the door,
 * calm like the others; only the step is purple. Not on the card of a session that has ended.
 */
.carry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "tile title actions"
    "tile body actions";
  gap: 0 18px;
  align-items: start;
  border-color: rgba(140, 82, 255, 0.32);
  background:
    radial-gradient(420px 160px at 0% 0%, rgba(140, 82, 255, 0.14), transparent 70%),
    var(--card);
}

.view-message .carry {
  display: none;
}

.carry-tile {
  grid-area: tile;
  background: rgba(140, 82, 255, 0.18);
  color: #cdb8ff;
}

.carry h2 {
  grid-area: title;
  font-size: 19px;
}

.carry-body {
  grid-area: body;
  min-width: 0;
}

.carry-text {
  max-width: 720px;
  margin-top: 8px !important;
  color: var(--text-soft);
  font-size: 14px;
}

.carry .problem {
  max-width: 720px;
}

.carry-actions {
  grid-area: actions;
  display: flex;
  gap: 10px;
  align-items: center;
  align-self: center;
}

/* The way: the old address, dots on their way, the new address (also in carry.html) */
.carry-route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.carry-host {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.carry-host.new {
  border-color: rgba(140, 82, 255, 0.5);
  background: rgba(140, 82, 255, 0.16);
  color: #e2d6ff;
}

/* The way and the new address stay on one line when the line breaks */
.carry-to {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.carry-way {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(205, 184, 255, 0.75);
}

.carry-way svg {
  display: block;
  margin-left: -1px;
}

[data-state="done"] .carry-way {
  color: var(--good);
}

.carry-way i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(205, 184, 255, 0.55);
}

/* While it is under way the dots walk from the old address to the new one */
[data-state="waiting"] .carry-way i,
[data-state="reading"] .carry-way i,
[data-state="handing"] .carry-way i {
  animation: carry-walk 1.2s ease-in-out infinite;
}

.carry-way i:nth-child(2) {
  animation-delay: 0.2s !important;
}

.carry-way i:nth-child(3) {
  animation-delay: 0.4s !important;
}

[data-state="done"] .carry-way i {
  background: var(--good);
}

@keyframes carry-walk {
  0%, 100% {
    opacity: 0.3;
    transform: translateX(-2px);
  }
  50% {
    opacity: 1;
    transform: translateX(2px);
    background: #cdb8ff;
  }
}

/* A phone: the box beside the title, the rest under both across the card */
@media (max-width: 639px) {
  .carry {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "tile title"
      "body body"
      "actions actions";
    gap: 0 14px;
  }

  .carry h2 {
    align-self: center;
    font-size: 17px;
  }

  .carry-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .carry-way i {
    animation: none !important;
  }
}

/* ---------------------------------------------------------------- the landing: a link from a friend */

/* Like the app's Join door: dark, with a soft light in the corner */
.landing {
  position: relative;
  overflow: hidden;
  padding: 26px 28px 28px;
  border: 1px solid rgba(124, 134, 255, 0.3);
  border-radius: 24px;
  background: var(--door);
}

.landing::before {
  content: "";
  position: absolute;
  right: -90px;
  top: -90px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 134, 255, 0.22), transparent 70%);
  pointer-events: none;
}

.landing > * {
  position: relative;
}

.door-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.landing h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.door-text {
  max-width: 640px;
  margin: 14px 0 0;
  font-size: 15px;
  color: var(--text-soft);
}

/* The icon in a rounded square, as on the app's doors */
.tile {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(124, 134, 255, 0.16);
  color: var(--heading-soft);
}

/* Like an address bar: paste it and go on */
.address {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 860px;
  min-height: 54px;
  margin-top: 18px;
  padding: 5px 5px 5px 16px;
  border: 1px solid rgba(124, 134, 255, 0.4);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(124, 134, 255, 0.08);
}

.address:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 1px var(--focus), 0 0 0 5px rgba(124, 134, 255, 0.08);
}

.address > svg {
  flex: none;
  color: var(--heading-soft);
}

:where(.front) .address input[type="text"],
:where(.front) .address input[type="text"]:focus {
  flex: 1 1 auto;
  height: 42px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

:where(.front) .address button {
  flex: none;
}

.landing .problem {
  max-width: 860px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 20px;
  max-width: 1100px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--text-soft);
}

.steps b {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(140, 82, 255, 0.14);
  color: #cdb6ff;
  font-size: 12.5px;
  font-weight: 800;
}

/* ---------------------------------------------------------------- public rooms */

/* Sessions joined before, then the public rooms: under the invite, or under the field for a link */
.rooms {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  min-width: 0;
}

/* Under an invite, the rooms are a way on, not the page: a little narrower, as the app's Join page */
.front.view-invite .rooms,
.front.view-room .rooms {
  max-width: 1200px;
  margin: 0 auto;
}

.rooms-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rooms-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.rooms-head h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* "12 rooms", "3 of 12": a quiet pill beside the title */
.rooms-count:not(:empty) {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.rooms-fresh {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-dim);
}

.rooms-about {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
}

/* On a phone under an invite: the public rooms behind one button (js/app.js sets collapsible) */
:where(.front) button.rooms-browse {
  display: none;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 0 14px 0 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: transparent;
  color: var(--text-soft);
  font-size: 15px;
}

.rooms-browse-text {
  flex: 1 1 auto;
  text-align: left;
}

.rooms-browse-count:not(:empty) {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

/* Finding a room: search, language, console, order and Filters in one row, as the app's list */
.find-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.search {
  position: relative;
}

.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft);
  pointer-events: none;
}

:where(.front) .search input[type="search"] {
  height: 40px;
  padding-left: 40px;
  border-radius: 999px;
}

.find-row .search {
  flex: 1 1 260px;
  min-width: 200px;
  max-width: 440px;
}

.find-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.find-field {
  display: block;
  min-width: 0;
}

/* In the row the choices say what they are themselves ("All languages"): their labels are for screen readers */
.find-row .find-choices .field-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:where(.front) .find-row .find-choices select {
  width: auto;
  max-width: 220px;
  height: 40px;
  padding-left: 14px;
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.06);
  font-size: 14px;
  font-weight: 700;
}

:where(.front) .find-row button.find-more {
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
}

.find-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--button);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.find-caret {
  margin-left: -2px;
  color: var(--text-soft);
}

/* Filters: a small window under the button (a sheet from the foot of the screen on a phone) */
.dialog.find-sheet {
  width: 300px;
  max-width: calc(100vw - 32px);
  padding: 16px 16px 14px;
}

.dialog.find-sheet[open]:not(:modal) {
  position: absolute;
  inset: calc(100% + 8px) 0 auto auto;
  margin: 0;
  z-index: 20;
}

.find-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.dialog.find-sheet h2 {
  font-size: 18px;
}

.find-row .find-sheet .find-choices {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.find-row .find-sheet .find-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.find-row .find-sheet .find-choices .field-label {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
}

:where(.front) .find-row .find-sheet .find-choices select {
  width: 100%;
  max-width: none;
  height: var(--touch);
  border-radius: var(--radius-field);
  background-color: var(--field);
}

.find-sheet .filters {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.find-sheet .row.end {
  margin-top: 12px;
}

/* Sessions joined before, above the public rooms, as on the app's Join page */
.recent {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.recent-room .cover {
  width: 56px;
  height: 56px;
  font-size: 24px;
}

.recent-room .room-action {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

:where(.front) .recent-room .room-action button.icon-button {
  min-width: 0;
  min-height: 34px;
}

.rooms-body .problem {
  margin: 4px 0 0;
}

.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rooms-empty {
  margin-top: 4px;
  padding: 36px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  color: var(--text-soft);
  font-size: 15px;
  text-align: center;
}

:where(.front) button.rooms-show-all {
  align-self: center;
}

/* While the list is read the first time: the shape of a few rooms, so that nothing jumps */
.room.skeleton {
  pointer-events: none;
}

.skeleton .cover,
.skeleton-line {
  background: rgba(255, 255, 255, 0.06);
  animation: skeleton 1.4s ease-in-out infinite;
}

.skeleton-line {
  display: block;
  height: 12px;
  border-radius: 6px;
}

.skeleton-line.wide {
  width: 70%;
  height: 16px;
}

.skeleton-line.short {
  width: 45%;
}

@keyframes skeleton {
  50% {
    opacity: 0.45;
  }
}

/* One room: the game's picture, what it is, how many play, Join */
.room {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  transition: background-color 0.12s;
}

.room:hover {
  background: var(--card-high);
}

.room-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px 14px;
}

/* The game's cover where the host's app found one, otherwise its initial on the brand gradient */
.cover {
  position: relative;
  flex: none;
  width: 68px;
  height: 68px;
  overflow: hidden;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--brand-from), var(--brand-to));
  color: #ffffff;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

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

/* The game as it is now: a picture the host sent, wider than a cover */
.cover.live {
  width: 121px;
  background: #000000;
}

.cover img.cover-badge {
  inset: auto;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  box-sizing: border-box;
}

.live-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.62);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.live-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bad);
}

.room-body,
.head-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.room-title {
  overflow: hidden;
  font-size: 16px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A supporter's room: the title, then a heart that the ellipsis never takes */
.room-title.supporter {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.room-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-heart {
  flex: none;
  font-size: 15px;
  color: #ff8a87;
}

.room-sub,
.head-sub {
  margin: 0;
  overflow: hidden;
  font-size: 13px;
  color: var(--text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-body .badges,
.head-text .badges {
  margin-top: 3px;
}

/* How many play, of how many */
.room-players {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 104px;
  white-space: nowrap;
}

.room-players {
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.players-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* The players: their pictures, or their initials on a colour */
.faces {
  display: flex;
}

.face {
  position: relative;
  width: 24px;
  height: 24px;
  margin-left: -7px;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid var(--card);
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #120d26;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.face:first-child {
  margin-left: 0;
}

.face.more {
  background: #3a3458;
  color: var(--text);
  font-size: 9px;
}

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

.room-players b {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.room-players.full b {
  color: #ff9db5;
}

.room-players .players-word {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

.people {
  flex: none;
  width: 15px;
  height: 15px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238f8aad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20a6.5 6.5 0 0 1 13 0'/%3E%3Cpath d='M16 4.6a3.5 3.5 0 0 1 0 6.8M18 14.4a6.5 6.5 0 0 1 3.5 5.6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.room-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

:where(.front) .room-action button {
  min-width: 104px;
  min-height: 42px;
}

.room-note {
  max-width: 160px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: right;
}



/* The game's name over a room's picture: on the cards of a wider window and over a room's invite */
.cover .gname {
  display: none;
}

/* A wider window: the public rooms as cards in a grid, the game's picture across the top */
@media (min-width: 720px) {
  #rooms-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
  }

  #rooms-list .room {
    gap: 0;
    padding: 0;
    overflow: hidden;
  }

  #rooms-list .room-main {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "cover cover" "body body" "players action";
    flex: 1 1 auto;
    gap: 0;
    align-items: center;
  }

  #rooms-list .room .cover {
    grid-area: cover;
    width: 100%;
    height: 120px;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 52px;
  }

  #rooms-list .cover .gname {
    display: block;
  }

  /* "Live" in the corner above, the game's name below */
  #rooms-list .live-badge {
    top: 10px;
    bottom: auto;
    left: 10px;
  }

  #rooms-list .room-body {
    grid-area: body;
    align-self: start;
    padding: 12px 14px 4px;
  }

  #rooms-list .room-players {
    grid-area: players;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    padding: 8px 14px 14px;
  }

  #rooms-list .room-action {
    grid-area: action;
    padding: 8px 14px 14px;
  }

  #rooms-list .room .wait-strip {
    margin: 0 12px 12px;
  }

  #rooms-list .rooms-empty,
  #rooms-list .rooms-show-all {
    grid-column: 1 / -1;
  }

  #rooms-list .skeleton .room-body {
    gap: 10px;
    padding: 14px;
  }
}

.cover .gname {
  position: absolute;
  z-index: 2;
  left: 14px;
  right: 14px;
  bottom: 10px;
  overflow: hidden;
  color: #ffffff;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  text-overflow: ellipsis;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- an invite */

/*
 * One card in the middle: who invites (or the room), one line on what happens, who joins, and
 * Join right under it (js/app.js showJoin, fillInvite). On a phone Join stays at the foot of the
 * screen. The state of the front page is a class of #front: view-landing, view-invite (a
 * friend's invite), view-room (a room's), view-message.
 */
.invite,
.front.view-room .you-card {
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
}

.invite {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 26px 26px;
  overflow: hidden;
  border-color: rgba(177, 140, 255, 0.35);
  background: linear-gradient(180deg, rgba(140, 82, 255, 0.16), rgba(21, 18, 43, 0) 170px), var(--card);
}

/* A room: its game's picture across the top of the card */
.invite-cover {
  position: relative;
  height: 168px;
  margin: -24px -26px 0;
}

.invite-cover .cover {
  width: 100%;
  height: 100%;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 64px;
}

.invite-cover .cover.live {
  width: 100%;
}

.invite-cover .live-badge {
  top: 12px;
  bottom: auto;
  left: 14px;
  z-index: 2;
}

.invite-cover .cover .gname {
  display: block;
  left: 20px;
  bottom: 14px;
  font-size: 22px;
}

.invite-cover .cover::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(12, 10, 29, 0.7));
  pointer-events: none;
}

.invite-who {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding-right: 40px;
}

.front.view-room .invite-who {
  padding-right: 0;
}

/* The host's initial with a soft light, or the door while nothing is known of the host */
.invite-face {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  box-shadow: 0 0 0 3px rgba(140, 82, 255, 0.35), 0 0 26px rgba(140, 82, 255, 0.5);
  color: #ffffff;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.invite-face.door {
  border-radius: 16px;
  background: rgba(124, 134, 255, 0.16);
  box-shadow: none;
  color: var(--heading-soft);
}

.invite .head-text {
  flex: 1 1 auto;
  min-width: 0;
  gap: 4px;
}

.invite-kicker {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
}

.card.invite h2 {
  font-size: 30px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.front.view-room .card.invite h2 {
  font-size: 24px;
}

.invite .head-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: normal;
  font-size: 14px;
}

/* The host's initial, small, in front of a room's line */
.host-face {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.invite .badges {
  margin-top: 4px;
  gap: 6px;
}

.invite .badge {
  min-height: 26px;
  padding: 3px 11px;
  border-radius: 13px;
  font-size: 13px;
}

/* Who plays in a room, and the places that are free */
.invite-players {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

.invite-players .face {
  width: 28px;
  height: 28px;
  font-size: 12px;
  margin-left: -8px;
}

.invite-players .face:first-child {
  margin-left: 0;
}

.face.free {
  border: 2px dashed rgba(255, 255, 255, 0.25);
  background: transparent;
}

:where(.front) .invite button.invite-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.front.view-room .invite button.invite-close {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(12, 10, 29, 0.55);
}

.invite .intro {
  margin: 0;
  font-size: 15px;
  color: var(--text-soft);
}

.you-slot:empty {
  display: none;
}

.invite .you-slot {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- who joins */

.you-card .label {
  margin-bottom: 12px;
}

.front.view-room .you-card {
  margin-top: -14px;
}

.you {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.you-line {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.you-line .who {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin: 0;
}

.you-line .status-row {
  flex: 1.1 1 0;
}

/* The player's picture, or their initial on the brand gradient */
:where(.front) button.avatar {
  flex: none;
  min-height: 0;
  padding: 0;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--brand-from), var(--brand-to));
  background-size: cover;
  background-position: center;
  color: #ffffff;
  font-weight: 800;
}

:where(.front) button.avatar:hover:not(:disabled) {
  background-color: transparent;
  filter: brightness(1.08);
}

:where(.front) .you button.avatar {
  position: relative;
  width: 48px;
  height: 48px;
  overflow: visible;
  font-size: 20px;
}

/* The pen on the picture: it changes it */
.you button.avatar::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--popup) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23e7e4fa' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20l4-1 11-11-3-3L5 16z'/%3E%3C/svg%3E") center / 11px no-repeat;
}

:where(.front) .you input[type="text"] {
  height: 48px;
  font-size: 16px;
}

/* What the browser sees of the controller: amber until one is seen, then green with a tick */
.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-high);
}

.status-icon {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  color: var(--wait);
}

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

.status-text b {
  font-size: 15px;
  font-weight: 700;
}

.status-text small {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-dim);
}

.status-ok {
  display: none;
  color: var(--good);
  font-size: 15px;
  font-weight: 800;
}

.status-row.ok .status-icon {
  color: var(--good);
}

.status-row.ok .status-ok {
  display: block;
}

.you-noname {
  margin: -6px 0 0;
  font-size: 13px;
  color: var(--text-soft);
}

.you .problem {
  margin: 0;
}

/* Join: wide, the one thing that starts something here */
.join-dock {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

:where(.front) .join-dock button.join-big {
  width: 100%;
  min-height: 58px;
  padding: 0 22px;
  border-radius: 16px;
  font-size: 19px;
  box-shadow: 0 10px 30px rgba(201, 45, 123, 0.35);
}

#join-button-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.join-arrow {
  flex: none;
}

:where(.front) .join-dock button.join-big:disabled {
  opacity: 0.6;
  box-shadow: none;
}

.join-dock-sub {
  font-size: 12.5px;
  color: var(--text-dim);
  text-align: center;
}

/* While joining, what happens, right where Join is */
.join-dock .wait-strip {
  margin: 0;
  border: 1px solid rgba(245, 185, 66, 0.45);
  background: #221b16;
}

/* The options under Join: small, as words with an icon */
.you-opts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 20px;
}

:where(.front) .you-opts button.you-opt {
  min-height: 36px;
  padding: 0 4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  font-size: 14px;
  gap: 7px;
}

:where(.front) .you-opts button.you-opt:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

:where(.front) .you-opts button.you-opt.more {
  color: var(--focus);
}

:where(.front) .you-opts button.you-opt[aria-pressed="true"] {
  color: #9ff0cc;
}

/* Voice: the switch of the app's Voice & webcam, "take part in the voice chat" */
.you-voice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.you-voice .status-icon {
  width: auto;
  height: auto;
  background: none;
  color: inherit;
}

.you-voice .toggle-text b {
  font-size: 14px;
  font-weight: 700;
}

.you-voice .toggle-text small {
  display: none;
}

.you-voice input {
  flex: none;
  position: relative;
  width: 36px;
  height: 22px;
  margin: 0;
  border-radius: 11px;
  background: #3a3458;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background-color 0.12s;
}

.you-voice input::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #cfcbe6;
  transition: transform 0.12s ease-out, background-color 0.12s;
}

.you-voice input:checked {
  background: var(--button);
}

.you-voice input:checked::before {
  transform: translateX(14px);
  background: #ffffff;
}

.you-voice input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.you-voice input:disabled {
  opacity: 0.45;
  cursor: default;
}

/* More options: the rest of "You join as", and the app's settings pages a guest has */
.you-more {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--field);
}

.you-more .toggle {
  min-height: 52px;
  padding: 2px 0;
}

.you-more-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Keyboard & mouse among the settings (on a phone): a word like the others, without its icon */
.you-more-row #join-keys svg {
  display: none;
}

.you-more-label {
  flex: 0 0 100%;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--heading-soft);
}

/* The start page: who joins under the field for a link, its options from the left */
.front.view-landing .you-opts {
  justify-content: flex-start;
}

/* ---------------------------------------------------------------- joining */

/*
 * Joining: amber, as in the app, on the card of the room being joined, or under the invite (with
 * a line around it, as the app's)
 */
.room .wait-strip {
  margin-top: 0;
}

.wait-strip.invite-wait {
  margin-top: 14px;
  border: 1px solid rgba(245, 185, 66, 0.45);
}

.wait-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 10px 12px 14px;
  border-radius: 14px;
  background: rgba(245, 185, 66, 0.1);
}

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

.wait-text b {
  font-size: 14.5px;
  font-weight: 800;
  color: #fde4a8;
}

.wait-text span {
  font-size: 12.5px;
  color: #d8c9a3;
}

.spin {
  flex: none;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(245, 185, 66, 0.25);
  border-top-color: var(--wait);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.hint {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-dim);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.icon-button.loading svg {
  animation: spin 0.9s linear infinite;
}

.message-text {
  margin-top: 12px;
  color: var(--text-soft);
}

.message-text.problem {
  color: #ffc2d1;
}


/* ---------------------------------------------------------------- the footer */

.foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px var(--gutter) calc(18px + env(safe-area-inset-bottom, 0px));
  font-size: 13px;
  color: var(--text-dim);
}

.foot > :first-child {
  flex: 1 1 200px;
}

.foot > :last-child {
  flex: 1 1 260px;
  text-align: right;
}

/* A pill with a tint of its own, as "Support the project" in the app */
.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(167, 123, 255, 0.6);
  border-radius: 999px;
  background: rgba(140, 82, 255, 0.1);
  color: #d8c6ff;
  font-weight: 700;
  text-decoration: none;
}

.pill-link:hover {
  background: rgba(140, 82, 255, 0.18);
  color: #ffffff;
}

/* Ko-fi's own coral, as "Support the project" in the app's footer */
.pill-link.kofi {
  border-color: rgba(255, 94, 91, 0.6);
  background: rgba(255, 94, 91, 0.12);
  color: #ffb3b1;
}

.pill-link.kofi:hover {
  background: rgba(255, 94, 91, 0.22);
  color: #ffffff;
}

/* The same pill as a button: "Install this page" */
button.pill-link {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.foot-pills {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* How to install on an iPhone or iPad, where the page cannot offer it itself */
.foot-how {
  width: 100%;
  max-width: 1400px;
  margin: -6px auto 0;
  padding: 0 var(--gutter) 18px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}

/* ---------------------------------------------------------------- narrower windows */

@media (max-width: 899px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
}

/* A phone: 16 px at the sides, players and Join below a room, Join of an invite at the foot of the screen */
@media (max-width: 639px) {
  :root {
    --gutter: 16px;
  }

  .appbar-in {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  /* The tagline makes way for the name and the friends */
  .tagline {
    font-size: 12px;
  }

  .page {
    gap: 22px;
    padding-top: 16px;
  }

  .card {
    padding: 18px 16px;
  }

  .landing {
    padding: 18px 16px 20px;
  }

  .landing h2 {
    font-size: 22px;
  }

  .door-text {
    font-size: 14.5px;
  }

  .tile {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .address {
    gap: 8px;
    padding-left: 12px;
  }

  :where(.front) .address button {
    padding: 0 16px;
  }

  .room-main {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .room .cover {
    align-self: start;
  }

  .room-body {
    grid-column: 2 / -1;
  }

  .room-sub {
    white-space: normal;
  }

  .room-players {
    grid-row: 2;
    grid-column: 1 / 3;
    justify-content: flex-start;
    align-items: flex-start;
    min-width: 0;
  }

  .room-action {
    grid-row: 2;
    grid-column: 3;
  }

  .card h2 {
    font-size: 20px;
  }

  .wait-strip {
    flex-wrap: wrap;
  }

  .wait-text {
    flex-basis: calc(100% - 34px);
  }

  .wait-strip button {
    margin-left: auto;
  }

  .foot {
    flex-direction: column;
    text-align: center;
  }

  .foot > :first-child,
  .foot > :last-child {
    flex: none;
    text-align: center;
  }

  /* The invite: who, what, who joins, each on lines of their own */
  .invite {
    gap: 14px;
    padding: 18px 18px 20px;
  }

  .invite-cover {
    margin: -18px -18px 0;
  }

  .invite-who {
    gap: 14px;
  }

  .invite-face {
    width: 60px;
    height: 60px;
    font-size: 26px;
  }

  .card.invite h2 {
    font-size: 24px;
  }

  .front.view-room .card.invite h2 {
    font-size: 22px;
  }

  :where(.front) .invite button.invite-close {
    top: 12px;
    right: 12px;
  }

  .invite .intro {
    font-size: 14.5px;
  }

  .you-line {
    flex-direction: column;
  }

  .you-line .status-row {
    flex: none;
  }

  /* Voice as a row with its switch; Webcam and More options as two buttons side by side */
  .you-opts {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }

  .you-voice {
    grid-column: 1 / -1;
    gap: 12px;
    min-height: 48px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card-high);
    color: var(--text);
  }

  .you-voice .status-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-soft);
  }

  .you-voice .toggle-text {
    flex: 1 1 auto;
  }

  .you-voice .toggle-text b {
    font-size: 15px;
  }

  .you-voice .toggle-text small {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
  }

  .you-voice input {
    width: 44px;
    height: 26px;
    border-radius: 13px;
  }

  .you-voice input::before {
    width: 20px;
    height: 20px;
  }

  .you-voice input:checked::before {
    transform: translateX(18px);
  }

  :where(.front) .you-opts button.you-opt,
  :where(.front) .you-opts button.you-opt.more {
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
  }

  /* Join at the foot of the screen, over the page, clear of the home bar */
  .front.view-invite .join-dock,
  .front.view-room .join-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 18px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: linear-gradient(180deg, rgba(12, 10, 29, 0), rgba(12, 10, 29, 0.96) 22px);
  }

  /* So that the dock never covers the end of the page */
  .front.docked {
    padding-bottom: var(--dock-h, 120px);
  }

  /* The public rooms behind one button under an invite, until it is pressed */
  .rooms.collapsible button.rooms-browse {
    display: flex;
  }

  .rooms.collapsible .rooms-body {
    display: none;
  }

  /* Searching takes the row; language, console, order and the switches are in the sheet */
  .find-row .search {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
  }

  :where(.front) .find-row button.find-more {
    min-height: var(--touch);
  }

  .dialog.find-sheet:modal {
    inset: auto 0 0 0;
    width: 100%;
    max-width: 100%;
    max-height: 88vh;
    margin: 0;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
    overflow-y: auto;
  }

  :where(.front) .find-sheet .find-choices select {
    width: 100%;
  }

  .recent-room .cover {
    width: 44px;
    height: 44px;
    font-size: 19px;
  }
}

/* A small phone: the whole bar for the link */
@media (max-width: 420px) {
  .address > svg {
    display: none;
  }

  .tagline {
    display: none;
  }
}

/* A phone on its side: little height. Join stays at the foot of the screen there too, smaller */
@media (max-height: 500px) and (min-width: 640px) and (pointer: coarse) {
  .page {
    padding-top: 14px;
  }

  .invite-cover {
    height: 120px;
  }

  .front.view-invite .join-dock,
  .front.view-room .join-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    align-items: center;
    padding: 14px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: linear-gradient(180deg, rgba(12, 10, 29, 0), rgba(12, 10, 29, 0.96) 18px);
  }

  .front.view-invite .join-dock > *,
  .front.view-room .join-dock > * {
    width: 100%;
    max-width: 608px;
  }

  :where(.front) .join-dock button.join-big {
    min-height: 50px;
  }

  .join-dock-sub {
    display: none;
  }

  .front.docked {
    padding-bottom: var(--dock-h, 80px);
  }
}

/* Fingers: everything to press at least 44 px */
@media (pointer: coarse) {
  :where(.front, .dialog, .friends) button.small,
  .pill-link {
    min-height: var(--touch);
  }

  :where(.front, .dialog, .friends) button.icon-button.small {
    width: var(--touch);
    height: var(--touch);
    min-height: var(--touch);
  }

  .check {
    min-height: var(--touch);
  }

  :where(.front) .you-opts button.you-opt,
  .you-voice {
    min-height: var(--touch);
  }
}

/* No zooming in on a field on a phone */
@media (pointer: coarse), (max-width: 639px) {
  :where(.front, .dialog, .friends) :is(input[type="text"], input[type="search"], select) {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spin,
  .icon-button.loading svg {
    animation-duration: 2.4s;
  }

  .skeleton .cover,
  .skeleton-line {
    animation: none;
  }

  .toggle input,
  .toggle input::before,
  .you-voice input,
  .you-voice input::before,
  :where(.front, .dialog, .friends) button,
  .room {
    transition: none;
  }
}


/* ---------------------------------------------------------------- playing */

.stage {
  position: fixed;
  inset: 0;
  background: #000;
  overflow: hidden;
}

.stage.idle {
  cursor: none;
}

#screen,
#screen-sharp {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* HQ + spatial's picture (js/upscale.js): seen, but the clicks, the mouse and touches go to #screen */
#screen-sharp {
  pointer-events: none;
}

#screen-sharp[hidden] {
  display: none;
}

/* ---------------------------------------------------------------- a controller on the screen */

.touch {
  position: absolute;
  inset: 0;
  pointer-events: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  /* At least 117 units across: the sticks, the D-pad, PS, L3 and R3 side by side
     without touching, on a wide phone as on a tablet */
  --u: min(0.85vw, 1.9vh);
}

.touch > * {
  position: absolute;
  pointer-events: auto;
  touch-action: none;
}

.t-btn,
.t-dpad,
.t-stick {
  background: rgba(20, 18, 32, 0.42);
  border: 1.5px solid rgba(255, 255, 255, 0.34);
  color: rgba(255, 255, 255, 0.86);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: calc(var(--u) * 2.3);
  border-radius: calc(var(--u) * 1.6);
  -webkit-tap-highlight-color: transparent;
}

.t-btn.held,
.t-stick.held .t-knob {
  background: rgba(140, 82, 255, 0.75);
  border-color: #fff;
}

.t-stick {
  width: calc(var(--u) * 19);
  height: calc(var(--u) * 19);
  border-radius: 50%;
  bottom: calc(var(--u) * 5);
}

.t-stick-l {
  left: calc(var(--u) * 5);
}

.t-stick-r {
  right: calc(var(--u) * 24);
}

.t-knob {
  width: 46%;
  height: 46%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.t-dpad {
  width: calc(var(--u) * 16);
  height: calc(var(--u) * 16);
  left: calc(var(--u) * 26);
  bottom: calc(var(--u) * 4);
  border-radius: 50%;
  background: rgba(20, 18, 32, 0.3);
}

.t-dir {
  position: absolute;
  width: 30%;
  height: 30%;
  border-radius: 22%;
  background: rgba(255, 255, 255, 0.24);
  pointer-events: none;
}

.t-up {
  left: 35%;
  top: 4%;
}

.t-down {
  left: 35%;
  bottom: 4%;
}

.t-left {
  left: 4%;
  top: 35%;
}

.t-right {
  right: 4%;
  top: 35%;
}

.t-dpad.up .t-up,
.t-dpad.down .t-down,
.t-dpad.left .t-left,
.t-dpad.right .t-right {
  background: rgba(140, 82, 255, 0.9);
}

.t-face {
  width: calc(var(--u) * 20);
  height: calc(var(--u) * 20);
  right: calc(var(--u) * 3);
  bottom: calc(var(--u) * 9);
  background: none;
  border: none;
  pointer-events: none;
}

.t-face .t-btn {
  position: absolute;
  pointer-events: auto;
}

.t-round {
  width: 38%;
  height: 38%;
  border-radius: 50%;
  font-size: calc(var(--u) * 3);
}

.t-tri {
  left: 31%;
  top: 0;
}

.t-cro {
  left: 31%;
  bottom: 0;
}

.t-squ {
  left: 0;
  top: 31%;
}

.t-cir {
  right: 0;
  top: 31%;
}

.t-l1,
.t-l2,
.t-r1,
.t-r2 {
  width: calc(var(--u) * 11);
  height: calc(var(--u) * 6);
  top: calc(var(--u) * 13);
}

.t-l2 {
  left: calc(var(--u) * 3);
}

.t-l1 {
  left: calc(var(--u) * 15.5);
}

.t-r2 {
  right: calc(var(--u) * 3);
}

.t-r1 {
  right: calc(var(--u) * 15.5);
}

.t-l3,
.t-r3,
.t-ps {
  width: calc(var(--u) * 6.5);
  height: calc(var(--u) * 5);
  bottom: calc(var(--u) * 1.5);
  font-size: calc(var(--u) * 1.9);
}

.t-l3 {
  left: calc(50% - var(--u) * 11.5);
}

.t-r3 {
  right: calc(50% - var(--u) * 11.5);
}

.t-ps {
  left: calc(50% - var(--u) * 3.25);
  border-radius: 50%;
  height: calc(var(--u) * 6.5);
}

.t-create,
.t-options,
.t-pad {
  height: calc(var(--u) * 4.6);
  top: calc(var(--u) * 13.5);
  font-size: calc(var(--u) * 1.7);
  padding: 0 calc(var(--u) * 1.4);
}

.t-create {
  left: calc(50% - var(--u) * 19);
  width: calc(var(--u) * 9);
}

.t-pad {
  left: calc(50% - var(--u) * 7);
  width: calc(var(--u) * 14);
}

.t-options {
  left: calc(50% + var(--u) * 10);
  width: calc(var(--u) * 9);
}

/* Held upright, like a handheld: the picture and what is shown on it at the top, the
   controller below it, every part where a thumb reaches it and nothing on top of another */
@media (orientation: portrait) {
  .stage.touch-on {
    --pic-bottom: calc(env(safe-area-inset-top, 0px) + min(56.25vw, 42vh));
    /* The controller's unit, for the way into the menu too (which is not inside it) */
    --pu: min(1.6vw, 0.78vh);
  }

  .stage.touch-on #screen,
  .stage.touch-on #screen-sharp,
  .stage.touch-on .hud {
    top: env(safe-area-inset-top, 0px);
    bottom: auto;
    height: min(56.25vw, 42vh);
  }

  .stage.touch-on .touch {
    --u: var(--pu);
  }

  .stage.touch-on .t-l1,
  .stage.touch-on .t-l2,
  .stage.touch-on .t-r1,
  .stage.touch-on .t-r2 {
    top: calc(var(--pic-bottom) + var(--u) * 3);
  }

  .stage.touch-on .t-create,
  .stage.touch-on .t-pad,
  .stage.touch-on .t-options {
    top: calc(var(--pic-bottom) + var(--u) * 11.5);
  }

  /* In the gap between L1 and R1 */
  .stage.touch-on .t-ps {
    top: calc(var(--pic-bottom) + var(--u) * 3);
    bottom: auto;
  }

  .stage.touch-on .t-dpad {
    left: calc(var(--u) * 4);
    bottom: calc(var(--u) * 34);
    width: calc(var(--u) * 17);
    height: calc(var(--u) * 17);
  }

  .stage.touch-on .t-face {
    right: calc(var(--u) * 3);
    bottom: calc(var(--u) * 32);
    width: calc(var(--u) * 21);
    height: calc(var(--u) * 21);
  }

  .stage.touch-on .t-stick {
    bottom: calc(var(--u) * 5);
    width: calc(var(--u) * 21);
    height: calc(var(--u) * 21);
  }

  .stage.touch-on .t-stick-l {
    left: calc(var(--u) * 4);
  }

  .stage.touch-on .t-stick-r {
    right: calc(var(--u) * 4);
  }

  .stage.touch-on .t-l3 {
    left: calc(var(--u) * 21);
    bottom: calc(var(--u) * 26.5);
  }

  .stage.touch-on .t-r3 {
    right: calc(var(--u) * 21);
    bottom: calc(var(--u) * 26.5);
  }

  /* The way into the menu, in the free band between the buttons and the sticks */
  .stage.touch-on .menu-handle {
    top: calc(var(--pic-bottom) + var(--pu) * 21);
    bottom: auto;
  }
}

/* Sideways the display covers the whole screen: the shoulder buttons stay below the
   first players' names in the top left */
@media (orientation: landscape) {
  .stage.touch-on .t-l1,
  .stage.touch-on .t-l2,
  .stage.touch-on .t-r1,
  .stage.touch-on .t-r2 {
    top: max(calc(var(--u) * 16), 116px);
  }

  .stage.touch-on .t-create,
  .stage.touch-on .t-pad,
  .stage.touch-on .t-options {
    top: max(calc(var(--u) * 16.5), calc(116px + var(--u) * 0.5));
  }

  /* Above the way into the menu at the bottom */
  .stage.touch-on .t-l3,
  .stage.touch-on .t-r3,
  .stage.touch-on .t-ps {
    bottom: calc(var(--u) * 9);
  }
}

/* ---------------------------------------------------------------- dialogs */

.dialog {
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 22px 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: var(--popup);
  color: var(--text);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6);
}

.dialog::backdrop {
  background: rgba(4, 3, 10, 0.72);
}

.dialog h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.dialog > p {
  margin-top: 10px;
  font-size: 14px;
}

/* ---------------------------------------------------------------- the app's settings pages, as windows of this page */

/*
 * A window that is one of the app's settings pages (gui/src/qml/controls: SettingsPage,
 * SettingsGroup, SettingsRow, Toggle, Segmented, ValueSlider, PillButton): the same sizes and
 * colours, so that it reads like the app. What is in it scrolls; js/setparts.js builds it.
 */
.dialog.settings {
  width: min(880px, calc(100vw - 32px));
  padding: 24px 26px 20px;
  background: var(--ground);
}

.dialog.settings[open] {
  display: flex;
  flex-direction: column;
}

.dialog.settings > h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.dialog.settings > p {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.3;
  color: var(--text-soft);
}

.set-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 16px -12px 0;
  padding: 2px 12px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dialog.settings > .row.end {
  flex: none;
  margin-top: 14px;
}

.set-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--heading-soft);
}

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

.set-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.set-group.off,
.set-try.off,
.set-keys.off {
  opacity: 0.5;
}

/* One setting: what it is on the left, its control on the right, or under the text where it is narrow */
.set-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  padding: 12px 18px;
}

.set-row + .set-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.set-row.sub {
  padding-left: 34px;
}

.set-row.off {
  opacity: 0.5;
}

label.set-row {
  cursor: pointer;
}

.set-text {
  flex: 1 1 var(--text-min, 240px);
  min-width: min(var(--text-min, 240px), 100%);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.set-text b {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.set-text small {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-dim);
}

.set-controls {
  flex: none;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

/* An on/off switch: purple when on */
input.switch {
  flex: none;
  position: relative;
  width: 44px;
  height: 26px;
  margin: 0;
  border-radius: 13px;
  background: #3a3458;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background-color 0.12s;
}

input.switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #cfcbe6;
  transition: transform 0.12s ease-out, background-color 0.12s;
}

input.switch:checked {
  background: var(--button);
}

input.switch:checked::before {
  transform: translateX(18px);
  background: #ffffff;
}

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

input.switch:disabled {
  opacity: 0.45;
  cursor: default;
}

/* A few choices side by side */
.set-seg {
  display: inline-flex;
  gap: 2px;
  height: 40px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}

.set-seg button {
  min-height: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #d9d5f2;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.set-seg button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.set-seg button.chosen,
.set-seg button.chosen:hover:not(:disabled) {
  background: var(--button);
  color: #ffffff;
  font-weight: 800;
}

.set-seg button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

/* A value on a line: the part behind the handle in the brand's colours, the number beside it */
.set-slider {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 32px;
  max-width: 100%;
}

.set-slider.off {
  opacity: 0.5;
}

.set-slider input {
  flex: 1 1 auto;
  min-width: 0;
  height: 26px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.set-slider input::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand-from) 0, var(--brand-to) var(--at, 0%), rgba(255, 255, 255, 0.14) var(--at, 0%));
}

.set-slider input::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand-from) 0, var(--brand-to) var(--at, 0%), rgba(255, 255, 255, 0.14) var(--at, 0%));
}

.set-slider input::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border: 3px solid var(--brand-from);
  border-radius: 50%;
  background: #ffffff;
  -webkit-appearance: none;
  appearance: none;
}

.set-slider input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 3px solid var(--brand-from);
  border-radius: 50%;
  background: #ffffff;
}

.set-slider input:active::-webkit-slider-thumb {
  border-width: 5px;
}

.set-slider input:active::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border-width: 5px;
}

.set-slider input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.set-slider output {
  flex: none;
  text-align: right;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

/* A rounded button: "primary" starts something, "ghost" is everything else */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 22px;
  background: var(--button);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.pill.primary,
.pill.primary:hover:not(:disabled) {
  background: var(--button);
}

.pill.small {
  min-height: 0;
  height: 34px;
  padding: 0 13px;
  border-radius: 17px;
  font-size: 13px;
}

.pill.ghost,
.pill.ghost:hover:not(:disabled) {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 700;
}

.pill:hover {
  box-shadow: inset 0 0 0 100px rgba(255, 255, 255, 0.07);
}

.pill:active {
  box-shadow: inset 0 0 0 100px rgba(255, 255, 255, 0.14);
}

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

.pill:disabled {
  opacity: 0.45;
  box-shadow: none;
  cursor: default;
}

.set-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-dim);
}

/* Voice & webcam: the devices in use, the microphone's level, the tip, the webcam's picture */
.set-devices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 18px 12px;
}

.set-device {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 14px;
  color: #e7e4fa;
}

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

.set-device span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.set-devices + .set-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* The level, 0 to 100, and the mark from which the others hear you */
.set-meter {
  position: relative;
  flex: none;
  width: 132px;
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
}

.set-meter-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  max-width: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #8c52ff, #b48cff);
  transition: width 0.06s linear;
}

.set-meter-fill.heard {
  background: linear-gradient(90deg, #8c52ff, #4fe0b0);
}

.set-meter-mark {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  border-radius: 1px;
  background: #e7e4fa;
  opacity: 0.8;
}

/* A tip at the foot of the card: the card's colour with a bluish tint */
.set-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 16px 12px;
  border-radius: 0 0 17px 17px;
  background: #1d1b3c;
  font-size: 13px;
  line-height: 1.2;
  color: #c9c5e6;
}

.set-tip .micon {
  flex: none;
  margin-top: 1px;
  color: var(--heading-soft);
}

/* 16:9 like the picture that is sent, rounded like the webcam tiles in a session */
.set-preview {
  padding: 0 18px 18px;
}

.set-preview-frame {
  display: grid;
  place-items: center;
  width: min(100%, 320px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #0d0b1f;
  font-size: 13px;
  color: var(--text-dim);
}

.set-preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The bar at the top of Keyboard & mouse: the two switches and the layouts */
.set-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.set-bar-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  cursor: pointer;
}

.set-bar-switch b {
  font-size: 14px;
  font-weight: 800;
  color: #e7e4fa;
}

.set-bar-line {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
}

.set-bar-gap {
  flex: 1 1 auto;
}

.set-bar-layouts {
  position: relative;
}

.set-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-width: 250px;
  max-width: calc(100vw - 64px);
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--popup);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

.set-menu button {
  justify-content: flex-start;
  min-height: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.set-menu button:hover:not(:disabled),
.set-menu button:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
}

/* Acceleration, drawn */
.set-curve {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  max-width: 100%;
}

.curve {
  display: block;
  max-width: 100%;
  height: auto;
  overflow: visible;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.curve-plot {
  fill: var(--field);
  stroke: var(--line);
}

.curve-grid {
  stroke: rgba(255, 255, 255, 0.05);
}

.curve-even {
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1.5;
  stroke-dasharray: 4.5 6;
}

.curve-line {
  fill: none;
  stroke: #b08cff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.curve-word {
  fill: var(--text-dim);
  font-size: 11px;
}

.curve-point {
  outline: none;
  cursor: ns-resize;
}

.curve-dot {
  fill: #ffffff;
  stroke: var(--brand-from);
  stroke-width: 3;
}

.curve-point.held .curve-dot {
  r: 6.5px;
  stroke-width: 5;
}

.curve-ring {
  fill: none;
}

.curve-point:focus-visible .curve-ring {
  stroke: var(--focus);
  stroke-width: 2;
}

.curve-hit {
  fill: transparent;
}

/* Try it here: the controller as the keys and the mouse move it */
.set-try {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px 22px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.set-try.on {
  padding: 13px 17px;
  border: 2px solid var(--brand-from);
}

.set-try-pad {
  justify-self: center;
  opacity: 0.55;
}

.set-try.on .set-try-pad {
  opacity: 1;
}

.set-try-words {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.set-try-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  color: var(--text-soft);
}

.set-try.on .set-try-text {
  color: var(--text);
}

/* The inputs, one card per part of the controller */
.set-keys {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.set-keycard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.set-keyline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.set-keyname {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.set-caps {
  flex: none;
  display: flex;
  gap: 6px;
}

.cap-wrap {
  position: relative;
  display: inline-flex;
}

/* A key: a darker edge, thicker at the bottom */
.cap {
  min-width: 44px;
  min-height: 0;
  height: 30px;
  padding: 0 9px 2px;
  border: 1px solid #39325e;
  border-bottom-width: 3px;
  border-radius: 8px;
  background: #221d3e;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.set-caps .cap:hover:not(:disabled) {
  background: #2a2449;
}

.set-caps .cap:active:not(:disabled) {
  background: #1a1632;
}

/* The one that adds is only an outline */
.set-caps .cap.add {
  min-width: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 15px;
}

.set-caps .cap.add:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
}

/* Waiting for the new one */
.set-caps .cap.waiting,
.set-caps .cap.waiting:hover:not(:disabled) {
  padding: 0 9px;
  border: 1px solid var(--wait);
  background: rgba(245, 185, 66, 0.14);
  color: #fde4a8;
  animation: cap-wait 1.4s ease-in-out infinite;
}

@keyframes cap-wait {
  50% {
    opacity: 0.6;
  }
}

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

/* Takes the input away: a small cross on the key's corner, while the pointer is on the key */
.cap-x {
  position: absolute;
  top: -7px;
  right: -7px;
  display: none;
  width: 16px;
  min-height: 0;
  height: 16px;
  padding: 0;
  border: 1px solid var(--card);
  border-radius: 50%;
  background: #4a4370;
  cursor: pointer;
}

.cap-wrap:hover .cap-x {
  display: block;
}

.cap-wrap .cap-x:hover:not(:disabled) {
  background: var(--bad);
}

.cap-x::before,
.cap-x::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 1.6px;
  border-radius: 1px;
  background: #ffffff;
  transform: translate(-50%, -50%) rotate(45deg);
}

.cap-x::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* A question in front of everything, as the app asks it */
.dialog.ask-card {
  width: min(508px, calc(100vw - 32px));
  padding: 22px 24px;
  border-radius: 20px;
}

.dialog.ask-card::backdrop {
  background: rgba(5, 5, 20, 0.62);
}

.dialog.ask-card h2 {
  font-size: 18px;
  font-weight: 800;
}

.dialog.ask-card p {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text-soft);
  white-space: pre-line;
}

.ask-card-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* A question in front of everything, in the app's card (gui/src/qml/controls/ModalDialog.qml):
   a badge for its kind, the small line above the title, a ×, the answers named by what they do.
   Its height is what it holds; in a small window the text scrolls and the answers stay. */
.dialog.modal-card {
  position: relative;
  overflow: hidden;
  width: min(500px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 24px 24px 20px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 22px;
  background: linear-gradient(180deg, #231d45 0%, #1b1735 42%, #17132f 100%);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.04);
  --glow: rgba(140, 82, 255, 0.28);
  --kicker: var(--heading-soft);
}

.dialog.modal-card[open] {
  display: flex;
  flex-direction: column;
  animation: modal-in 180ms cubic-bezier(0.33, 1, 0.68, 1);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dialog.modal-card[open] {
    animation: none;
  }
}

.dialog.modal-card.s-small {
  width: min(420px, calc(100vw - 32px));
}

.dialog.modal-card.s-wide {
  width: min(600px, calc(100vw - 32px));
}

.dialog.modal-card::backdrop {
  background: rgba(5, 5, 20, 0.66);
}

/* The kind's light from behind the badge */
.dialog.modal-card::before {
  content: "";
  position: absolute;
  left: -60px;
  top: -90px;
  width: 300px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow), transparent);
  pointer-events: none;
}

.modal-card.k-info {
  --glow: rgba(124, 134, 255, 0.24);
}

.modal-card.k-warning {
  --glow: rgba(245, 185, 66, 0.2);
  --kicker: var(--wait);
}

.modal-card.k-danger {
  --glow: rgba(240, 70, 110, 0.26);
  --kicker: #ff8fa8;
}

.modal-card.k-done {
  --glow: rgba(52, 211, 153, 0.2);
  --kicker: var(--good);
}

.modal-head {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  flex: none;
}

.modal-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(90deg, var(--brand-from), var(--brand-to));
  color: #ffffff;
}

.modal-badge.info {
  background: rgba(124, 134, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(124, 134, 255, 0.35);
  color: var(--heading-soft);
}

.modal-badge.warning {
  background: rgba(245, 185, 66, 0.14);
  box-shadow: inset 0 0 0 1px rgba(245, 185, 66, 0.38);
  color: var(--wait);
}

.modal-badge.danger {
  background: rgba(240, 70, 110, 0.15);
  box-shadow: inset 0 0 0 1px rgba(240, 70, 110, 0.4);
  color: #ff7a98;
}

.modal-badge.done {
  background: rgba(52, 211, 153, 0.14);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.38);
  color: var(--good);
}

.modal-badge.neutral {
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  color: #e6e2ff;
}

.modal-titles {
  padding-top: 1px;
  min-width: 0;
}

.modal-kicker {
  margin-bottom: 3px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--kicker);
}

.dialog.modal-card h2 {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.012em;
  overflow-wrap: anywhere;
}

.modal-x {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -4px -6px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  cursor: pointer;
}

.modal-x:hover {
  background: rgba(255, 255, 255, 0.11);
}

.modal-x:active {
  background: rgba(255, 255, 255, 0.16);
}

.modal-body {
  position: relative;
  min-height: 0;
  margin-top: 14px;
  padding-left: 60px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.modal-body p {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.modal-body p + p {
  margin-top: 10px;
}

.modal-foot {
  position: relative;
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.modal-btn {
  min-width: 96px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.modal-btn.primary {
  border-color: transparent;
  background: linear-gradient(90deg, var(--button-from), var(--button-to));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.modal-btn.danger {
  border-color: transparent;
  background: linear-gradient(90deg, var(--bad), #c92d5b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.modal-btn:hover {
  box-shadow: inset 0 0 0 100px rgba(255, 255, 255, 0.07);
}

.modal-btn:active {
  box-shadow: inset 0 0 0 100px rgba(255, 255, 255, 0.14);
}

.modal-btn:focus-visible,
.modal-x:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

@media (max-width: 480px) {
  .dialog.modal-card {
    padding: 20px 18px 18px;
  }

  .modal-body {
    padding-left: 0;
  }

  .modal-foot .modal-btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 700px) {
  .set-keys {
    grid-template-columns: minmax(0, 1fr);
  }

  .set-try {
    grid-template-columns: minmax(0, 1fr);
  }

  .set-bar-line,
  .set-bar-gap {
    display: none;
  }

  .set-curve {
    align-items: flex-start;
  }

  .dialog.settings {
    padding: 18px 16px 16px;
  }
}

/* A key, as in the app's "While playing" row */
kbd {
  flex: none;
  min-width: 34px;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 7px;
  background: #221d3e;
  color: var(--text);
  font: 700 12px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-align: center;
}

@media (max-width: 639px) {
  .dialog {
    padding: 18px 16px;
  }
}

/* The intro film on YouTube, next to the tagline */
.tagline-video {
  margin-left: 8px;
  color: var(--heading-soft, #a9b0ff);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.tagline-video:hover {
  color: #ffffff;
}

/* ---------------------------------------------------------------- Controllers and General (js/controllersdialog.js, js/generaldialog.js) */

/*
 * The app's ControllersPage.qml and GeneralPage.qml as windows of this page, and the teaching
 * of a controller (ControllerMappingDialog.qml): the controllers connected now, key caps of a
 * combination, four choices of a button, the grid of buttons to teach and the card that waits
 * for a controller's button.
 */
.ctl-pads {
  display: flex;
  flex-direction: column;
}

.ctl-pad {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
}

.ctl-pad + .ctl-pad {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ctl-pads + .set-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ctl-pad-tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(140, 82, 255, 0.16);
  color: #cdb6ff;
}

.ctl-pad-tile.other {
  background: rgba(245, 185, 66, 0.12);
  color: #fbd98c;
}

.ctl-pad-tile.none {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}

.ctl-pad-texts {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.ctl-pad-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.ctl-pad-note {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-dim);
}

/* A link in a line of text, as the app's TextLink */
:where(.dialog) button.ctl-link {
  min-height: 0;
  height: auto;
  margin-top: 2px;
  padding: 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--heading-soft);
  font-size: 13px;
  font-weight: 700;
}

:where(.dialog) button.ctl-link:hover:not(:disabled) {
  background: transparent;
  color: #ffffff;
}

/* Its charge: a small battery and a word, or Ready when the browser does not say */
.ctl-charge {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

.ctl-cell {
  position: relative;
  width: 21px;
  height: 12px;
  margin-right: 3px;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-radius: 3px;
}

.ctl-cell::after {
  content: "";
  position: absolute;
  top: 2.5px;
  right: -5px;
  width: 2px;
  height: 4px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.45);
}

.ctl-cell-fill {
  position: absolute;
  top: 1.5px;
  bottom: 1.5px;
  left: 1.5px;
  border-radius: 1.5px;
}

/* Buttons and rumble on the left, the touchpad from the D-pad on the right, where there is room */
.ctl-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px 20px;
  align-items: start;
}

.ctl-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (min-width: 820px) {
  .ctl-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ctl-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.ctl-group-note {
  font-size: 12px;
  color: var(--text-dim);
}

/* A combination's buttons as key caps, "+" between them */
.ctl-caps-slot,
.ctl-caps {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.ctl-plus {
  font-size: 12px;
  color: var(--text-dim);
}

.ctl-none {
  font-size: 13px;
  color: var(--text-dim);
}

/* Up to four buttons, one choice each */
.ctl-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ctl-selects.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

:where(.dialog) select.ctl-select {
  width: auto;
  min-width: 120px;
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

/* Teaching a controller its buttons: the buttons in a grid, two of the controller's for each */
.ctl-grid-about {
  margin: 0 0 4px;
}

.ctl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px 10px;
}

.ctl-tile {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 50px;
  padding: 0 8px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.ctl-tile-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

:where(.dialog) button.ctl-slot {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 92px;
  min-height: 0;
  height: 34px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: var(--field);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
}

:where(.dialog) button.ctl-slot.empty {
  border-color: rgba(255, 255, 255, 0.09);
  background: transparent;
  color: var(--text-dim);
  font-weight: 700;
}

:where(.dialog) button.ctl-slot:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
}

/* Waiting for a controller's button, or what came of it */
.dialog.ask-card.ctl-wait {
  width: min(460px, calc(100vw - 32px));
  padding: 24px;
}

.ctl-wait-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.ctl-wait-tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(140, 82, 255, 0.16);
  color: #cdb6ff;
}

.ctl-wait[data-tone="done"] .ctl-wait-tile {
  background: rgba(52, 211, 153, 0.14);
  color: #9ff0cc;
}

.ctl-wait-words h2 {
  font-size: 18px;
}

.dialog.ask-card.ctl-wait .ctl-wait-words p {
  margin: 6px 0 0;
}

.ctl-wait-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.ctl-wait-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wait);
  animation: ctl-wait 1.3s ease-in-out infinite;
}

@keyframes ctl-wait {
  50% {
    opacity: 0.25;
  }
}

.ctl-wait-text {
  flex: 1 1 auto;
  font-size: 13px;
  font-weight: 700;
  color: #fbd98c;
}

.ctl-wait-gap {
  flex: 1 1 auto;
}

/* ---- The controller outside the game (js/padnav.js): the focus it moves shows its ring, as the keys' */
.pad-nav :where(.front, .dialog) :focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* The microphone and the camera to choose, under Voice & webcam */
:where(.dialog) select.set-device-select {
  max-width: 260px;
}

/* 404.html: an address without a file. A room link goes on to the page by itself (js/notfound.js) */
.notfound {
  max-width: 32rem;
  margin: 0 auto;
  padding: 4rem 16px;
  text-align: center;
  line-height: 1.5;
}

/* ---------------------------------------------------------------- controller skins (js/skinsdialog.js) */

.skins-dialog {
  width: min(960px, calc(100vw - 24px));
}

.skin-section {
  margin: 16px 14px 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--heading-soft, #a9b0ff);
}

.skin-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 14px 6px;
}

.skin-grid:last-child {
  padding-bottom: 14px;
}

/* A skin as the app's Look page shows a look (SkinsPage.qml): the picture, a dark bar at its foot with
   the name and one line saying what a click does, and the whole card is the button */
.skin-card {
  position: relative;
  width: 200px;
  height: 180px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--line-strong, rgba(255, 255, 255, 0.14));
  background: linear-gradient(180deg, #221a44, #0e0b20) padding-box, var(--card, #15122b);
  box-shadow: inset 0 0 0 3px var(--card, #15122b);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.skin-card:hover:not(:disabled),
.skin-card:focus-visible {
  border-color: var(--focus, #00f2ff);
  outline: none;
}

.skin-card:disabled {
  cursor: default;
  /* The card in use is not clickable, but never dimmed as other disabled buttons are */
  opacity: 1;
  color: inherit;
}

.skin-card.chosen {
  border: 2px solid var(--focus, #00f2ff);
}

.skin-card-picture {
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
}

.skin-card-any {
  position: relative;
  opacity: 1;
}

.skin-card-any .pad {
  opacity: 0.55;
}

.skin-card-question {
  position: absolute;
  top: 26px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 40px;
  font-weight: 800;
  color: #ffffff;
}

.skin-card-bar {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: 46px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.62);
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.skin-card-name {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skin-card-line {
  font-size: 11px;
  font-weight: 700;
  color: var(--focus, #00f2ff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

