/* EG Matches 4.26.0 (this file: 4.30.0): challenges on the Matches page. The box of a challenge stands above the game,
   the section "Challenges" under it; both take the site's colors (the theme's custom properties,
   with the game's own values where a page has none) and the look of the game's panels. */
.egm-ch {
  --egm-accent: var(--eg-moss, #446931);
  --egm-accent-strong: var(--eg-moss-dark, #355d20);
  --egm-accent-soft: var(--eg-moss-soft, #edf3e7);
  --egm-line: var(--eg-rule, #e5e2d9);
  --egm-line-strong: var(--eg-rule-strong, #cfcbbf);
  --egm-tint: var(--eg-tint, #f2f7ec);
  --egm-tint-deep: var(--eg-tint-deep, #e6efdc);
  --egm-paper: var(--eg-paper, #f6f3ea);
  --egm-ink: var(--eg-ink, #1f2c1e);
  --egm-muted: #555d52;
  --egm-wrong: #b42318;
  box-sizing: border-box;
  margin: 0 0 14px;
  padding: 16px 18px 18px;
  border: 1px solid var(--egm-line);
  border-radius: 16px;
  background: #ffffff;
  color: var(--egm-ink);
  font-size: 15px;
  line-height: 1.5;
}
.egm-ch *,
.egm-ch *::before,
.egm-ch *::after { box-sizing: border-box; }
.egm-ch [hidden] { display: none !important; }
.egm-ch.egm-chs { margin: 16px 0 0; }

.egm-ch .egm-ch__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  margin: 0 0 8px;
}
.egm-ch .egm-ch__title {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--egm-ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.egm-ch.egm-chs .egm-ch__title { margin: 0 0 8px; }
.egm-ch .egm-ch__count {
  color: var(--egm-muted);
  font-size: 14px;
  white-space: nowrap;
}
.egm-ch .egm-ch__hook {
  margin: 0 0 10px;
  color: var(--egm-ink);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.egm-ch .egm-ch__say,
.egm-ch .egm-ch__empty,
.egm-ch .egm-ch__more {
  margin: 0 0 12px;
  color: var(--egm-muted);
  font-size: 15px;
}
.egm-ch .egm-ch__more { margin: 8px 0 0; font-size: 14px; }
.egm-ch.egm-ch--gone .egm-ch__say { margin: 0; color: var(--egm-ink); }
.egm-ch .egm-ch__say a {
  color: var(--egm-accent-strong);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.egm-ch .egm-ch__said {
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid #c3d6ad;
  border-radius: 9px;
  background: var(--egm-tint);
  color: var(--egm-ink);
}
.egm-ch .egm-ch__said--error {
  border-color: #ecc3bd;
  background: #fdf1ef;
  color: #7a271a;
}

/* Buttons and fields. */
.egm-ch .egm-ch__form { margin: 0 0 14px; }
/* 4.30.0: "Play today's Daily" (the way down to the game's Start), and under the link what it has brought. */
.egm-ch .egm-ch__play { margin: 0 0 14px; }
.egm-ch .egm-ch__brought { margin: 10px 0 0; }
.egm-ch .egm-ch__go { margin: 0; }
.egm-ch .egm-ch__field {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}
.egm-ch .egm-ch__label {
  display: block;
  flex: 1 1 100%;
  margin: 0 0 6px;
  color: var(--egm-ink);
  font-size: 15px;
  font-weight: 600;
}
.egm-ch .egm-ch__field > .egm-ch__label { margin-bottom: -2px; }
.egm-ch .egm-ch__input {
  flex: 1 1 12rem;
  width: auto;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--egm-line-strong);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
  color: var(--egm-ink);
  font: inherit;
  font-size: 16px;
}
.egm-ch .egm-ch__input[readonly] { background: var(--egm-paper); color: #3d463a; }
.egm-ch .egm-ch__input[aria-invalid="true"] { border-color: var(--egm-wrong); }
.egm-ch .egm-ch__error {
  flex: 1 1 100%;
  order: 3;
  color: var(--egm-wrong);
  font-size: 14px;
}
.egm-ch .egm-ch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  min-height: 44px;
  margin: 0;
  padding: 8px 16px;
  border: 1px solid var(--egm-line-strong);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
  color: var(--egm-accent-strong);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.egm-ch .egm-ch__btn:hover { border-color: var(--egm-accent); background: var(--egm-accent-soft); color: var(--egm-accent-strong); }
.egm-ch .egm-ch__btn--main { border-color: var(--egm-accent); background: var(--egm-accent); color: #ffffff; }
.egm-ch .egm-ch__btn--main:hover { border-color: var(--egm-accent-strong); background: var(--egm-accent-strong); color: #ffffff; }
.egm-ch .egm-ch__btn--quiet { min-height: 40px; padding: 6px 12px; font-size: 14px; font-weight: 500; color: #4c5548; }
.egm-ch :is(a, button, input, summary):focus-visible {
  outline: 3px solid var(--eg-pine-deep, #355d20);
  outline-offset: 2px;
}

/* The two tables: under their headings; with the script one at a time, chosen by the two buttons. */
.egm-ch .egm-ch__tabs {
  display: inline-flex;
  gap: 2px;
  max-width: 100%;
  margin: 0 0 10px;
  padding: 3px;
  border: 1px solid var(--egm-line-strong);
  border-radius: 10px;
  background: var(--egm-paper);
}
.egm-ch .egm-ch__tab {
  appearance: none;
  min-height: 38px;
  margin: 0;
  padding: 6px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  color: #4c5548;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.egm-ch .egm-ch__tab:hover { background: var(--egm-accent-soft); color: var(--egm-accent-strong); }
.egm-ch .egm-ch__tab.is-active { background: var(--egm-accent); color: #ffffff; }
.egm-ch .egm-ch__period + .egm-ch__period { margin-top: 14px; }
.egm-ch .egm-ch__when {
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  color: var(--egm-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
}
.egm-ch.is-tabbed .egm-ch__period + .egm-ch__period { margin-top: 0; }
.egm-ch.is-tabbed .egm-ch__when,
.egm-ch .egm-ch__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.egm-ch .egm-ch__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.egm-ch .egm-ch__row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--egm-tint);
  color: var(--egm-ink);
  list-style: none;
}
.egm-ch .egm-ch__row::marker { content: none; }
.egm-ch .egm-ch__row.is-me { background: var(--egm-tint-deep); box-shadow: inset 0 0 0 1px #c3d6ad; }
.egm-ch .egm-ch__row--wait { background: var(--egm-paper); }
.egm-ch .egm-ch__row--wait.is-me { background: var(--egm-paper); box-shadow: inset 0 0 0 1px var(--egm-line-strong); }
.egm-ch .egm-ch__pos {
  flex: 0 0 auto;
  min-width: 2.2em;
  color: var(--egm-accent-strong);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.egm-ch .egm-ch__row--wait .egm-ch__pos { color: #7b8377; }
.egm-ch .egm-ch__name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.egm-ch .egm-ch__you {
  display: inline-block;
  margin-left: 4px;
  padding: 0 7px;
  border: 1px solid #b9cfa3;
  border-radius: 999px;
  background: #ffffff;
  color: var(--egm-accent-strong);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  vertical-align: 1px;
}
.egm-ch .egm-ch__figures {
  flex: 0 0 auto;
  color: var(--egm-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.egm-ch .egm-ch__points { color: var(--egm-ink); font-weight: 600; }
.egm-ch .egm-ch__wait { color: #666e62; }

/* A member's part: the link to send, and "Leave" or "Manage". */
.egm-ch .egm-ch__invite {
  margin: 14px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--egm-line);
}
.egm-ch .egm-ch__invite .egm-ch__label { margin: 0 0 6px; }
.egm-ch .egm-ch__manage { margin: 12px 0 0; }
.egm-ch .egm-ch__manage > summary {
  display: inline-block;
  min-height: 32px;
  padding: 4px 0;
  color: #4c5548;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  list-style: none;
}
.egm-ch .egm-ch__manage > summary::-webkit-details-marker { display: none; }
.egm-ch .egm-ch__manage[open] > summary { margin-bottom: 8px; color: var(--egm-ink); font-weight: 600; text-decoration: none; }
.egm-ch .egm-ch__manage .egm-ch__form { margin: 0; }
.egm-ch .egm-ch__manage .egm-ch__say { margin: 0 0 8px; font-size: 14px; }
.egm-ch .egm-ch__members {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}
.egm-ch .egm-ch__member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--egm-line);
  border-radius: 9px;
  list-style: none;
}
.egm-ch .egm-ch__member::marker { content: none; }

/* "Challenges", under the game: a member's challenges, and the way to start one. */
.egm-ch .egm-chs__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}
.egm-ch .egm-chs__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  margin: 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--egm-tint);
  list-style: none;
}
.egm-ch .egm-chs__item::marker { content: none; }
.egm-ch .egm-chs__name {
  color: var(--egm-accent-strong);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.egm-ch .egm-chs__with { flex: 1 1 auto; min-width: 0; color: var(--egm-muted); overflow-wrap: anywhere; }
.egm-ch .egm-chs__played { margin-left: auto; color: var(--egm-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.egm-ch.egm-chs .egm-ch__form { margin: 0; }

@media (max-width: 480px) {
  .egm-ch { padding: 14px 14px 16px; }
  .egm-ch .egm-ch__field > .egm-ch__input { flex-basis: 100%; }
  .egm-ch .egm-ch__field > .egm-ch__btn { flex: 1 1 auto; } /* the buttons fill the row under the field, each as wide as its words need and a share of the rest */
  .egm-ch .egm-ch__row { align-items: center; }
  .egm-ch .egm-ch__figures { display: grid; justify-items: end; line-height: 1.25; }
  .egm-ch .egm-ch__detail { font-size: 13.5px; }
  .egm-ch .egm-ch__sep { display: none; } /* the dot between the two, when they stand one over the other */
  .egm-ch .egm-chs__played { margin-left: 0; flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .egm-ch .egm-ch__btn { transition: none; }
}

/* In the game's result box: "Challenge friends", after a Daily only (not after a Practice round). */
.eg-matches.vg-game a.vg-btn.vg-challenge-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.eg-matches.vg-game:not(.vg-view-daily) a.vg-btn.vg-challenge-link { display: none; }
