/* ChallengeTube: the board under a video.
   Sits in the Activity area with the video replies, and takes its colours from
   the page's own --app-* variables rather than restating them. Nothing here
   styles anything outside .chtb-*. */

.chtb {
  margin: 18px 0;
  padding: 16px 18px 14px;
  border: 1px solid var(--app-line, rgba(0, 0, 0, .12));
  border-radius: 14px;
}
.chtb[hidden] { display: none; }

/* ---- chrome --------------------------------------------------------------- */
.chtb__head { display: flex; align-items: center; gap: 10px; }
.chtb__brand { display: flex; align-items: center; gap: 8px; }
.chtb__mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #1d4ed8;
  font-size: 14px;
}
.chtb__name { font-size: 14px; font-weight: 800; }
.chtb__all {
  margin-left: auto;
  font-size: 12.5px; font-weight: 600;
  color: #1d4ed8;
  text-decoration: none;
  white-space: nowrap;
}
.chtb__all:hover { text-decoration: underline; }

.chtb__title { margin: 12px 0 0; font-size: 16px; font-weight: 800; }
.chtb__blurb { margin: 3px 0 0; font-size: 13px; color: var(--app-dim, #606069); }

/* ---- the box -------------------------------------------------------------- */
.chtb__form { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.chtb__input {
  flex: 1 1 240px;
  min-width: 0;
  border: 1px solid var(--app-line, rgba(0, 0, 0, .16));
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit; font-size: 14px;
  background: var(--app-bg, #fff);
  color: inherit;
  box-sizing: border-box;
}
.chtb__input:focus { outline: 2px solid #1d4ed8; outline-offset: -1px; border-color: transparent; }
.chtb__input:disabled { opacity: .6; }

.chtb__submit {
  flex: 0 0 auto;
  border: 0; border-radius: 10px;
  padding: 10px 20px;
  background: #1d4ed8;
  color: #fff;
  font: inherit; font-size: 13.5px; font-weight: 700;
  cursor: pointer;
}
.chtb__submit:hover { background: #1a43ba; }
.chtb__submit:disabled { opacity: .6; cursor: default; }

.chtb__status { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: var(--app-dim, #606069); }
.chtb__status.is-error { color: #b91c1c; }
.chtb__status.is-ok { color: #15803d; }

/* ---- the board ------------------------------------------------------------ */
.chtb__list-title { margin: 16px 0 8px; font-size: 14px; font-weight: 800; }
.chtb__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.chtb__list[hidden] { display: none; }
.chtb__empty { margin: 0; font-size: 13.5px; color: var(--app-dim, #606069); }

.chtb__row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--app-line, rgba(0, 0, 0, .1));
  border-radius: 10px;
  padding: 10px 12px;
}

.chtb__votes {
  flex: 0 0 auto;
  min-width: 82px;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(29, 78, 216, .1);
  color: #1d4ed8;
  font-size: 12.5px; font-weight: 800;
  text-align: center;
}

/* Takes the free space so the chip and the button stay pinned right. */
.chtb__text { flex: 1 1 200px; min-width: 0; font-size: 13.5px; line-height: 1.45; }

.chtb__chip {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px; font-weight: 800;
}
/* Three states, three readings: not looked at, thinking about it, doing it.
   `declined` has no chip on purpose — it leaves the board entirely. */
.chtb__chip--open { background: rgba(127, 127, 127, .16); color: var(--app-dim, #606069); }
.chtb__chip--considering { background: rgba(234, 179, 8, .18); color: #a16207; }
.chtb__chip--accepted { background: rgba(34, 197, 94, .18); color: #15803d; }

.chtb__vote {
  flex: 0 0 auto;
  border: 1px solid var(--app-line, rgba(0, 0, 0, .14));
  border-radius: 999px;
  padding: 6px 16px;
  background: var(--app-bg, #fff);
  font: inherit; font-size: 12.5px; font-weight: 700;
  color: inherit;
  cursor: pointer;
}
.chtb__vote:hover:not(:disabled) { background: var(--app-hover, rgba(0, 0, 0, .06)); }
.chtb__vote:disabled { opacity: .6; cursor: default; }
/* Already backed: the quieter state, because it is a thing you have done
   rather than a thing being asked of you. */
.chtb__vote.is-on { background: #1d4ed8; border-color: transparent; color: #fff; }

/* ---- owner controls ------------------------------------------------------- */
/* A full-width row under the challenge rather than more buttons beside it: the
   row is already carrying a count, a sentence, a chip and a vote button. */
.chtb__owner {
  flex: 1 0 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding-top: 8px;
  margin-top: 2px;
  border-top: 1px solid var(--app-line, rgba(0, 0, 0, .08));
}
.chtb__link {
  border: 0; background: transparent; padding: 0;
  font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--app-dim, #606069);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.chtb__link:hover { color: var(--app-fg, #0f0f10); }
.chtb__link--danger { color: #b91c1c; }

.chtb__foot {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--app-dim, #606069);
}

@media (max-width: 640px) {
  .chtb { padding: 14px; }
  .chtb__submit { width: 100%; }
  .chtb__votes { min-width: 70px; }
  .chtb__all { font-size: 11.5px; }
}
