.challenges-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.challenges-kicker {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary, #9090a0);
  margin-bottom: 6px;
}

.challenges-header h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.challenges-header p {
  margin: 0 0 24px;
  max-width: 640px;
  color: var(--text-secondary, #9090a0);
  line-height: 1.5;
}

/* ── Rules-to-win summary ─────────────────────────────────────── */
.challenge-rules-summary {
  background: var(--bg-surface, #141419);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
}

.challenge-rules-summary h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.challenge-rules-intro {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-secondary, #9090a0);
}

.challenge-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.challenge-rule-card {
  border-radius: 12px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.challenge-rule-card--community {
  border-color: rgba(59, 130, 246, 0.3);
}

.challenge-rule-card--judges {
  border-color: rgba(139, 92, 246, 0.3);
}

.challenge-rule-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.challenge-rule-card--community .challenge-rule-badge {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

.challenge-rule-card--judges .challenge-rule-badge {
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
}

.challenge-rule-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.challenge-rule-card p {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-secondary, #9090a0);
  line-height: 1.55;
}

.challenge-rule-criteria {
  margin: 0 0 10px;
  padding: 0 0 0 18px;
  font-size: 12.5px;
  color: #d8d8e0;
  line-height: 1.7;
}

/* ── Challenge cards ──────────────────────────────────────────── */
.challenges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.challenge-card {
  background: var(--bg-surface, #141419);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.challenge-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.challenge-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.challenge-countdown {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-secondary, #9090a0);
  white-space: nowrap;
  padding-top: 2px;
}

.challenge-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.challenge-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.challenge-badge--duration {
  background: rgba(255, 255, 255, 0.05);
  color: #d8d8e0;
}

.challenge-badge--prize {
  background: rgba(234, 179, 8, 0.15);
  border-color: rgba(234, 179, 8, 0.3);
  color: #fde68a;
}

.challenge-description-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.challenge-description {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary, #9090a0);
  line-height: 1.55;
}

.challenge-description.is-clamped:not(.is-expanded) {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.challenge-description-toggle {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  color: #a78bfa;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.challenge-description-toggle:hover {
  text-decoration: underline;
}

.challenge-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.challenge-tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.challenge-tag--theme {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
}

.challenge-tag--language {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.challenge-submit-btn {
  display: block;
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.85);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.challenge-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.challenges-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary, #9090a0);
}

/* ── Submit modal (mirrors send-challenge modal styling) ────────── */
.submit-challenge-modal[hidden] { display: none; }

.submit-challenge-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 20px;
}

.submit-challenge-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(5px);
}

.submit-challenge-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-surface, #141419);
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 16px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.submit-challenge-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 15, 22, 0.9);
  color: #ccc;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.submit-challenge-close:hover {
  background: rgba(139, 92, 246, 0.2);
  color: #fff;
}

.submit-challenge-dialog h3 {
  margin: 0 20px 0 0;
  font-size: 18px;
  font-weight: 700;
}

.submit-challenge-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.submit-challenge-field > span {
  font-weight: 600;
  color: #e8e8f0;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.submit-challenge-hint {
  margin: -4px 0 0;
  font-size: 12px;
  color: var(--text-secondary, #9090a0);
}

.submit-challenge-field select {
  padding: 10px 12px;
  border-radius: 9px;
  background: #0c0c10;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e8e8f0;
  font-size: 13px;
  transition: border-color 0.15s ease;
}

.submit-challenge-field select:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.6);
}

.submit-challenge-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.submit-challenge-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #0c0c10;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d8d8e0;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.submit-challenge-checkbox:hover {
  border-color: rgba(139, 92, 246, 0.4);
}

.submit-challenge-checkbox input[type="checkbox"] {
  accent-color: #8b5cf6;
  width: 14px;
  height: 14px;
  margin: 0;
}

.submit-challenge-checkbox:has(input:checked) {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.55);
  color: #fff;
}

.submit-challenge-empty-note {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary, #9090a0);
  font-style: italic;
}

.submit-challenge-error {
  color: #fca5a5;
  font-size: 12px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.submit-challenge-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.submit-challenge-cancel,
.submit-challenge-submit {
  padding: 10px 18px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.15s ease, transform 0.1s ease;
}

.submit-challenge-cancel {
  background: rgba(255, 255, 255, 0.05);
  color: #ccc;
}

.submit-challenge-cancel:hover {
  background: rgba(255, 255, 255, 0.09);
}

.submit-challenge-submit {
  background: rgba(139, 92, 246, 0.85);
  border-color: rgba(139, 92, 246, 0.5);
  color: #fff;
}

.submit-challenge-submit:hover {
  background: rgba(139, 92, 246, 1);
}

.submit-challenge-submit:active {
  transform: scale(0.98);
}
