.group-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.group-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.group-toolbar__count {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
}

/* A grey label with its icon, then a button opening the list under it, for the filter and the sort. */
.group-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.group-menu__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 600;
}

.group-menu__button {
  gap: var(--space-2);
  height: 40px;
  padding: 0 var(--space-3) 0 var(--space-4);
}

.group-menu__button .icon {
  transition: rotate 0.15s var(--ease-standard);
}

.group-menu__button[aria-expanded="true"] .icon {
  rotate: 180deg;
}

.group-menu__list {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
  max-height: 360px;
  padding: var(--space-2);
  overflow-y: auto;
  border-radius: var(--radius-md);
  background: var(--surface-float);
  box-shadow: 0 16px 40px rgb(0 0 0 / calc(0.45 * var(--shade)));
}

.group-menu--end .group-menu__list {
  right: 0;
  left: auto;
  min-width: 160px;
}

.group-menu__list[hidden] {
  display: none;
}

.group-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.group-menu__item:hover {
  background: var(--surface-2);
}

.group-menu__item[aria-current="true"] {
  background: var(--selected);
}

.group-menu__count {
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.group-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  font-size: 16px;
}

.group-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.tile__badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 1;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.group-note {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.group-note > .icon {
  flex: none;
  color: var(--focus);
}

.group-note p {
  flex: 1;
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

.group-footnote {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
}

@media (max-width: 767px) {
  /* Just the two buttons, one at each end. */
  .group-menu__label {
    display: none;
  }

  .group-menu__button {
    font-size: 16px;
  }

  .group-note {
    flex-wrap: wrap;
  }

  .group-note .button {
    flex-basis: 100%;
  }
}

/* The heading over a studio's own games: 168px tall, the logo in a 136px tile, the title, the numbers
   in one line, a follow button, and art fading in on the right. */
.studio-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 168px;
  padding: var(--space-4);
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface-2);
}

.studio-head__logo {
  display: grid;
  flex: none;
  place-items: center;
  width: 136px;
  height: 136px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

/* A studio without a logo shows its initials, large, on its colour. */
.studio-head__logo[role="img"] {
  color: var(--on-tile-light);
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
}

.studio-head__logo img {
  width: 64px;
  height: auto;
}

.studio-head__text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
}

.studio-head__title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.studio-head__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  margin: 0;
}

.studio-head__stats div {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.studio-head__stats div + div::before {
  margin-right: var(--space-1);
  color: var(--line);
  content: "|";
}

.studio-head__stats dd {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--ink);
}

.studio-head__stats dt {
  color: var(--ink-muted);
}

.studio-head__art {
  position: absolute;
  top: 0;
  right: 0;
  width: 158px;
  height: 100%;
  object-fit: cover;
  mask-image: linear-gradient(90deg, transparent, #000 40%);
}

@media (max-width: 767px) {
  .studio-head__logo {
    width: 88px;
    height: 88px;
  }

  .studio-head__art {
    display: none;
  }
}
