/* Challenge widget styles */
.challenge-widget {
  background: linear-gradient(135deg, #0f1a60 0%, #1a2680 55%, #2d3a9e 100%);
  border-radius: 22px;
  padding: 24px 26px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 12px 40px rgba(26, 38, 128, 0.25);
}

.challenge-widget__eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
}

.challenge-widget__title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
}

.challenge-widget__meta {
  font-size: 0.9rem;
  opacity: 0.88;
  line-height: 1.5;
}

.challenge-widget__timer {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.challenge-widget__progress-track {
  height: 12px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 99px;
  overflow: hidden;
}

.challenge-widget__progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.challenge-widget__progress-fill--good { background: linear-gradient(90deg, #34d399, #10b981); }
.challenge-widget__progress-fill--warn { background: linear-gradient(90deg, #fbbf24, #f59e0b); }

.challenge-widget__stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.challenge-widget__top {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.challenge-widget__top-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  font-size: 0.85rem;
}

.challenge-widget__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.challenge-widget__avatar--lg { width: 36px; height: 36px; }

.challenge-widget__avatar--initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #3b2f00;
  font-size: 0.68rem;
  font-weight: 800;
}

.challenge-widget__top-name { font-weight: 700; }
.challenge-widget__top-pct { font-weight: 800; opacity: 0.85; }

.challenge-widget__top-rank {
  font-weight: 800;
  opacity: 0.7;
  min-width: 28px;
}

.challenge-widget__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.challenge-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.challenge-btn:hover { transform: translateY(-1px); }
.challenge-btn--gold { background: #f1b94c; color: #0d1230; }
.challenge-btn--ghost { background: rgba(255, 255, 255, 0.12); color: #fff; }
.challenge-btn--outline { background: transparent; border: 1.5px solid rgba(255, 255, 255, 0.35); color: #fff; }

.challenge-page__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 24px;
  margin-top: 8px;
}

.challenge-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.challenge-card__badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.challenge-card__badge--upcoming { background: #eef2ff; color: #3730a3; }
.challenge-card__badge--active { background: #ecfdf5; color: #047857; }
.challenge-card__badge--completed { background: #f3f4f6; color: #4b5563; }

.challenge-form {
  display: grid;
  gap: 14px;
}

.challenge-form label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.challenge-form input,
.challenge-form select,
.challenge-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  font: inherit;
  font-size: 0.92rem;
  color: var(--text-main);
}

.challenge-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.challenge-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.challenge-modal.is-open { display: flex; }

.challenge-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 18, 48, 0.55);
}

.challenge-modal__box {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  display: grid;
  gap: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.challenge-modal__box h3 {
  margin: 0;
  font-size: 1.2rem;
}

.challenge-notify {
  display: grid;
  gap: 10px;
}

.challenge-notify__item {
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.challenge-notify__item--unread {
  border-color: #c7d2fe;
  background: #eef2ff;
}
