/* steamcommunity.report — Weekly Challenges for XP tab styles
   Matches the 2002-Steam flat/square/olive theme.
   Reuses :root tokens from site.css (--frame, --gold, --gold-dim, --muted,
   --fg, --white, --mono, --font); tier hexes are hardcoded per spec. */

.chal {
  display: block;
}

/* ------------------------------------------------------------------ */
/* Header row                                                          */
/* ------------------------------------------------------------------ */
.chal__head {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--frame);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.chal__title {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--gold);
  font-weight: 700;
  font-size: 14px;
}

.chal__meta {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

.chal__rerolls { color: var(--muted); }
.chal__resets  { color: var(--muted); }

/* ------------------------------------------------------------------ */
/* Empty state (not synced)                                            */
/* ------------------------------------------------------------------ */
.chal__empty {
  border: 1px dashed var(--frame);
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
  border-radius: 0;
}

/* ------------------------------------------------------------------ */
/* Grid                                                                 */
/* ------------------------------------------------------------------ */
.chal__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 560px) {
  .chal__grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------ */
/* Card                                                                 */
/* ------------------------------------------------------------------ */
.chal-card {
  border: 1px solid var(--frame);
  background: rgba(0,0,0,.18);
  padding: 13px 14px;
  border-left: 3px solid var(--tier, var(--frame));
  border-radius: 0;
}

.chal-card--easy   { --tier: #6EC1E4; }
.chal-card--medium { --tier: #4B69CD; }
.chal-card--hard   { --tier: #8847FF; }
.chal-card--expert { --tier: #FFD700; }

.chal-card__top {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.chal-card__diff {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--tier, var(--muted));
  border: 1px solid var(--tier, var(--frame));
  padding: 2px 6px;
  border-radius: 0;
  background: rgba(0,0,0,.25);
}

.chal-card__xp {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold);
  white-space: nowrap;
}

.chal-card__label {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.25;
}

.chal-card__desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  margin-bottom: 10px;
  line-height: 1.35;
}

/* ------------------------------------------------------------------ */
/* Progress bar                                                         */
/* ------------------------------------------------------------------ */
.chal-bar {
  display: block;
  height: 10px;
  background: #0b0c06;
  border: 1px solid var(--frame);
  overflow: hidden;
  border-radius: 0;
}

.chal-bar__fill {
  display: block;
  height: 100%;
  background: var(--tier, var(--gold));
  transition: width .5s ease;
}

.chal-bar__txt {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Done state                                                           */
/* ------------------------------------------------------------------ */
.chal-card.is-done {
  opacity: .82;
}

.chal-card__done {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  color: #5fd463;
  text-transform: uppercase;
}

.chal-card__donetime {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 6px;
}

/* ------------------------------------------------------------------ */
/* Reroll button (mirrors .id__refresh)                                 */
/* ------------------------------------------------------------------ */
.chal-reroll {
  margin-top: 10px;
  display: inline-block;
  font: 700 10px/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold-dim);
  background: #14160d;
  border: 1px solid var(--frame);
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 0;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.chal-reroll:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
  background: #1b1d12;
}
.chal-reroll[disabled] {
  opacity: .5;
  cursor: default;
}

/* ------------------------------------------------------------------ */
/* Inline reroll error                                                  */
/* ------------------------------------------------------------------ */
.chal-card__err {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: #e0685c;
}

.chal-reroll:focus-visible { outline: 1px dashed var(--gold); outline-offset: 2px; }
