/* The hub's friends page, friend profiles and invitations (friends.mjs). */
:root {
  --good: #22a861;
  --red: #d53056;
  --soft: #e5f1ed;
}
@media (prefers-color-scheme: dark) {
  :root {
    --soft: #1b3630;
  }
}
.accent-spellsquare {
  --accent: #3d8bff;
}
.accent-semfrantic {
  --accent: #ec4899;
}
.accent-sets-and-series {
  --accent: #7c3aed;
}

/* Quick or repeated presses mustn't select text, zoom, or flash. */
.tabs button,
.nav-row,
.person-main,
.pick button,
.dismiss,
.button {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* Header buttons: friends, and your own avatar. */
.icon-button {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 20px;
}
.icon-button .icon {
  display: inline-flex;
}
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font:
    800 11px Nunito,
    sans-serif;
}
.icon-button .badge {
  position: absolute;
  top: -6px;
  right: -6px;
}
.signin-button.avatar-button {
  min-width: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
  background: var(--fill);
  box-shadow: 0 5px 0 var(--shade);
}
.signin-button.avatar-button:hover {
  box-shadow: 0 7px 0 var(--shade);
}
.signin-button.avatar-button:active {
  box-shadow: 0 1px 0 var(--shade);
}
.avatar-button hfg-avatar {
  --avatar-size: 44px;
}

/* Account dialog rows. */
.account-links {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}
.nav-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  font-size: 14px;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}
.nav-row .grow {
  flex: 1;
}
.nav-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

/* Invitations on the home screen. */
.invitations {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}
.invitations h2 {
  margin: 0;
  font:
    600 20px Fredoka,
    sans-serif;
}
.invitation {
  --accent: var(--forest);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: 16px;
  background: var(--panel);
}
.invitation > div {
  flex: 1;
  min-width: 0;
}
.invitation strong {
  display: block;
  font-size: 14px;
}
.invitation small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.dismiss {
  padding: 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}

/* Small buttons. */
.button.small {
  gap: 8px;
  padding: 8px 14px;
  border-radius: 11px;
  font-size: 14px;
  box-shadow: 0 3px 0 var(--forest-deep);
}
.button.quiet {
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--shadow);
}
.button.quiet.small {
  box-shadow: 0 3px 0 var(--shadow);
}

/* The friends page. */
.friends-page {
  padding-bottom: 60px;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
}
.page-head h1 {
  margin: 0;
  font:
    600 38px Fredoka,
    sans-serif;
  letter-spacing: -0.5px;
}
.back {
  display: inline-block;
  margin-top: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--forest);
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}
.tabs {
  display: flex;
  gap: 22px;
  margin-top: 20px;
  border-bottom: 2px solid var(--line);
}
.tabs button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 11px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}
.tabs button[aria-selected='true'] {
  margin-bottom: -2px;
  border-bottom: 3px solid var(--forest);
  color: var(--forest);
}
.list-label {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.people {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.person.stacked {
  flex-wrap: wrap;
}
.person-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}
button.person-main {
  cursor: pointer;
}
.person-main > div {
  min-width: 0;
}
.person strong {
  display: block;
  font-size: 15px;
}
.person small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.person small.live {
  color: var(--good);
}
.person-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}
.person.stacked .person-actions {
  width: 100%;
}
.person.stacked .person-actions .button {
  flex: 1;
}
.empty {
  padding: 30px 10px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}
.friends-page .s-avatar {
  --size: 40px;
}
.friend-link-card {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--soft);
}
.friend-link-card h3 {
  margin: 0;
  font:
    600 18px Fredoka,
    sans-serif;
}
.friend-link-card p,
.friends-page .note,
.friends-dialog .note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.55;
}
.link-row {
  display: flex;
  gap: 8px;
}
.link-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font-size: 13px;
}

/* A friend's profile. */
.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}
.profile-head .s-avatar {
  --size: 84px;
}
.profile-head h1 {
  margin: 0;
  font:
    600 34px Fredoka,
    sans-serif;
  overflow-wrap: anywhere;
}
.profile-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.profile-head p.live {
  color: var(--good);
}
.profile-actions {
  position: relative;
  display: flex;
  gap: 8px;
  margin-top: 18px;
}
.profile-actions > .button:first-child {
  flex: 1;
}
.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  display: grid;
  min-width: 230px;
  padding: 6px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 12px 30px #1a0c3440;
}
.menu button {
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.menu button:hover {
  background: var(--soft);
}
.menu button.red {
  color: var(--red);
}
.menu small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.section-title {
  margin: 26px 0 10px;
  font:
    600 20px Fredoka,
    sans-serif;
}
.together {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.together div {
  padding: 10px;
  border: 2px solid var(--line);
  border-top: 5px solid var(--accent, var(--forest));
  border-radius: 14px;
  background: var(--panel);
  text-align: center;
}
.together b {
  display: block;
  font:
    600 24px Fredoka,
    sans-serif;
}
.together small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.stat-detail {
  margin-bottom: 10px;
  padding: 14px;
  border: 2px solid var(--line);
  border-left: 6px solid var(--accent, var(--forest));
  border-radius: 16px;
  background: var(--panel);
}
.stat-detail header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.stat-detail h3 {
  margin: 0;
  font:
    600 18px Fredoka,
    sans-serif;
}
.stat-detail header small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.stat-detail .today {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 13px;
  font-weight: 800;
}
.stat-detail p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 8px;
  margin: 12px 0 0;
}
.stat-grid div {
  min-width: 0;
}
.stat-grid dd {
  margin: 0;
  font:
    600 20px Fredoka,
    sans-serif;
  overflow-wrap: anywhere;
}
.stat-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.stat-grid .mine {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}
.private-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

/* Dialogs on the friends page. */
.friends-dialog {
  width: min(460px, calc(100% - 24px));
}
.pick {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.pick button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-left: 6px solid var(--accent, var(--forest));
  border-radius: 14px;
  background: var(--bg);
  text-align: left;
  cursor: pointer;
}
.pick button:hover,
.pick button[aria-pressed='true'] {
  border-color: var(--accent, var(--forest));
}
.pick button[aria-pressed='true'] {
  background: var(--soft);
}
.pick button > div {
  flex: 1;
}
.pick strong {
  display: block;
  font:
    600 16px Fredoka,
    sans-serif;
}
.pick small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.friends-dialog .result {
  min-height: 1em;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.friends-dialog .result.bad {
  color: var(--red);
}
.or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.or::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--line);
}

@media (max-width: 520px) {
  .page-head h1 {
    font-size: 32px;
  }
  .stat-grid dd {
    font-size: 18px;
  }
  .together b {
    font-size: 20px;
  }
}
