/* Halaman publik challenge */
.ch-page { padding-top: 28px; padding-bottom: 8px; }
.ch-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.ch-back:hover { color: var(--text); }
.ch-notice { padding: 12px 16px; border-radius: 12px; background: var(--doing-bg); color: var(--doing); font-size: 14px; font-weight: 600; margin-bottom: 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ch-notice a { text-decoration: underline; }

.ch-head { padding: 28px; overflow: hidden; }
.ch-head::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--brand), #ff4d4d);
}
.ch-kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-ink); }
.ch-title { font-size: clamp(26px, 5vw, 38px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin-top: 8px; overflow-wrap: anywhere; }
.ch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; color: var(--muted); font-size: 14px; }
.ch-meta .m { display: inline-flex; align-items: center; gap: 6px; }
.ch-meta svg { width: 16px; height: 16px; }
.ch-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

.ch-progress { margin-top: 24px; }
.ch-progress-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ch-big { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.ch-big small { font-size: 16px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.ch-pct { font-size: 14px; font-weight: 700; color: var(--muted); }
.ch-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.ch-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ch-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.ch-stakes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 640px) { .ch-stakes { grid-template-columns: 1fr; } }
.stake { padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; }
.stake .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.stake .ic svg { width: 20px; height: 20px; }
.stake.reward .ic { background: var(--success-bg); color: var(--success); }
.stake.penalty .ic { background: var(--danger-bg); color: var(--danger); }
.stake h3 { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.stake p { margin-top: 4px; white-space: pre-line; overflow-wrap: anywhere; }

.ch-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.ch-block { padding: 24px 28px; }
.ch-block > h2 { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
@media (max-width: 600px) { .ch-head, .ch-block { padding: 20px; } }

/* Deskripsi (rich text) */
.prose { font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.prose > * + * { margin-top: .8em; }
.prose h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin-top: 1.4em; }
.prose h4 { font-size: 16px; font-weight: 700; margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .3em; }
.prose a { color: var(--brand-ink); text-decoration: underline; }
.prose blockquote { border-left: 3px solid var(--brand); padding: 4px 0 4px 14px; color: var(--muted); }
.prose .empty { color: var(--muted); font-style: italic; }

/* Checklist */
.checklist { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.ci {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start;
  padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2);
  transition: background .3s, border-color .3s;
}
.ci-box {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--muted); display: grid; place-items: center;
  flex-shrink: 0; margin-top: 1px; transition: background .3s, border-color .3s, transform .3s;
}
.ci-box svg { width: 16px; height: 16px; }
.ci-text { font-weight: 600; overflow-wrap: anywhere; }
.ci-note { font-size: 13px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.ci-side { text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }
.ci-label { font-weight: 700; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.ci-side time { display: block; margin-top: 2px; }
@media (max-width: 520px) {
  .ci { grid-template-columns: auto 1fr; }
  .ci-side { grid-column: 2; text-align: left; display: flex; gap: 8px; align-items: center; }
  .ci-side time { margin: 0; }
}

.ci-doing { border-color: var(--doing); background: var(--doing-bg); }
.ci-doing .ci-box { border-color: var(--doing); color: var(--doing); animation: boxPulse 1.6s ease-in-out infinite; }
.ci-doing .ci-label { color: var(--doing); }
.ci-done .ci-box { background: var(--success); border-color: var(--success); }
.ci-done .ci-label { color: var(--success); }
.ci-failed .ci-box { background: var(--danger); border-color: var(--danger); }
.ci-failed .ci-label { color: var(--danger); }
.ci-failed .ci-text { text-decoration: line-through; text-decoration-color: var(--danger); color: var(--muted); }
.ci-done .ci-box, .ci-failed .ci-box { color: var(--surface); }
.ci-box .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

@keyframes boxPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(95,221,230,.55); } 50% { box-shadow: 0 0 0 7px rgba(95,221,230,0); } }
.just-done .ci-box { animation: popIn .6s cubic-bezier(.2,1.6,.4,1); }
.just-done { animation: flashOk 1.4s ease; }
.just-failed { animation: shake .5s ease, flashBad 1.4s ease; }
@keyframes popIn { 0% { transform: scale(.4); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes flashOk { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); } 100% { box-shadow: 0 0 0 14px rgba(34,197,94,0); } }
@keyframes flashBad { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); } 100% { box-shadow: 0 0 0 14px rgba(239,68,68,0); } }

.ch-empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.ch-empty h1 { font-size: 22px; color: var(--text); margin-bottom: 6px; }

/* Arsip */
.arch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .arch-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .arch-grid { grid-template-columns: 1fr; } }
.arch { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.arch-title { font-weight: 700; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.arch-date { font-size: 13px; color: var(--muted); }
.arch-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.arch-foot .row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
