/* ============================================================
 * EDUCHAMPS CHALLENGE — bersama.css
 * Brand: Fredoka (judul) + Nunito Sans (isi)
 * Warna: Primary #1464F4 · Navy #102A56 · Kuning #FFD43B
 *        Background #F7FAFF · Teks #334155 · Border #E2E8F0
 * ============================================================ */
:root {
  --navy: #102A56;
  --blue: #1464F4;
  --yellow: #FFD43B;
  --green: #16864A;
  --red: #C9344E;
  --ink: #334155;
  --muted: #64748B;
  --line: #E2E8F0;
  --paper: #FFFFFF;
  --background: #F7FAFF;
  --shadow: 0 10px 30px #102A5614;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; font-family: 'Nunito Sans', sans-serif;
  color: var(--ink); background: var(--background);
}
h1, h2, h3, .headline { font-family: 'Fredoka', sans-serif; color: var(--navy); }
h1 { font-size: 30px; margin: 10px 0; }
h2 { font-size: 22px; margin: 0 0 14px; }
h3 { font-size: 17px; margin: 0 0 8px; }
p { line-height: 1.6; }
.app { max-width: 960px; margin: auto; padding: 22px 16px 60px; }
.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px; margin: 0 0 16px;
}
.lead { color: var(--muted); max-width: 720px; margin: 8px auto 20px; }

button {
  font: inherit; font-weight: 800; border: 0; border-radius: 12px; padding: 12px 18px;
  cursor: pointer; transition: transform .12s, box-shadow .12s;
}
button:active { transform: scale(.98); }
button.primary { color: #fff; background: var(--blue); box-shadow: 0 8px 18px #1464F445; }
button.primary:hover { box-shadow: 0 10px 24px #1464F469; }
button.secondary { color: var(--navy); background: #EAF1FF; }
button.ghost { color: var(--muted); background: #F0F4FB; }
button.gold { color: var(--navy); background: var(--yellow); }
button.full { width: 100%; }
button:disabled { opacity: .45; cursor: not-allowed; }
.button-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  margin-right: 8px; border-radius: 50%; background: #ffffff2b; font-size: 13px;
}

.brand { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; }
.brand img { width: 52px; height: 52px; object-fit: contain; }
.brand b { color: var(--navy); display: block; font-family: 'Fredoka', sans-serif; }
.brand small { color: var(--muted); }

.pill-row { display: flex; justify-content: center; gap: 9px; flex-wrap: wrap; margin: 16px 0; }
.pill {
  border-radius: 999px; padding: 7px 13px; background: #EAF1FF; color: var(--blue);
  font-size: 13px; font-weight: 700;
}
.pill.gold { background: #FFF6C7; color: var(--navy); }
.pill.green { background: #E7F7EE; color: #0C7540; }
.pill.red { background: #FDE8EC; color: #A11D35; }

/* ---------- aturan pengerjaan (do's & don't) ---------- */
.rules-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 8px 0 18px;
}
.rules-col {
  border-radius: 14px; padding: 14px 16px; border: 1px solid var(--line); background: #fff;
}
.rules-col h3 { margin: 0 0 10px; font-size: 15px; }
.rules-col ul { margin: 0; padding-left: 18px; }
.rules-col li { margin: 7px 0; line-height: 1.55; font-size: 13.5px; }
.rules-do { background: #F0FBF4; border-color: #B9E3C9; }
.rules-do h3 { color: #0C7540; }
.rules-dont { background: #FDF1F3; border-color: #F4C2CB; }
.rules-dont h3 { color: #A11D35; }
@media (max-width: 640px) {
  .rules-grid { grid-template-columns: 1fr; }
}

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 14px 0; }

/* ---------- layar ---------- */
.screen-cover { background: linear-gradient(160deg, #eef4ff 0%, #ffffff 60%); }
.screen-center { display: flex; flex-direction: column; align-items: center; min-height: 70vh; }
.hero-logo { width: min(300px, 78%); height: auto; }

/* ---------- form ---------- */
.field { margin: 13px 0; text-align: left; }
.field label { display: block; color: var(--navy); font-size: 13px; font-weight: 800; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  font: inherit; background: #fff; color: var(--ink);
}
.field textarea { min-height: 90px; resize: vertical; }
.error { display: none; color: var(--red); font-size: 12px; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

/* ---------- grid kartu ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.choice-card {
  border: 2px solid var(--line); border-radius: 14px; padding: 18px 14px; cursor: pointer;
  text-align: center; transition: border-color .12s, box-shadow .12s; background: #fff;
}
.choice-card:hover { border-color: var(--blue); }
.choice-card.selected { border-color: var(--blue); box-shadow: 0 0 0 3px #2e6ff22e; }
.choice-card .icon { font-size: 30px; }
.choice-card b { display: block; color: var(--navy); margin: 8px 0; }
.choice-card small { color: var(--muted); }

/* ---------- quiz ---------- */
.quiz-head {
  position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line);
  padding: 10px 16px;
}
.quiz-bar { max-width: 960px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quiz-bar small { color: var(--muted); }
.timer {
  color: var(--navy); border: 2px solid var(--blue); background: #eef4ff; border-radius: 10px;
  padding: 7px 12px; font-weight: 900; font-variant-numeric: tabular-nums;
}
.timer.warn { color: var(--red); border-color: var(--red); background: #FDE8EC; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.04); } }

.progress-wrap { max-width: 960px; margin: 12px auto 0; padding: 0 16px; }
.progress-track { height: 8px; border-radius: 999px; background: #E8EEF9; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--blue), #3f8bff); border-radius: 999px; transition: width .25s; }

.qnav { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.qnav button {
  height: 34px; width: 36px; padding: 0; background: #fff; border: 1.5px solid var(--line);
  color: var(--muted); border-radius: 9px; font-weight: 800;
}
.qnav button.current { border-color: var(--blue); box-shadow: 0 0 0 3px #2e6ff22e; color: var(--navy); }
.qnav button.answered { color: #087840; background: #e8f8ef; border-color: #90d6ae; }
.qnav button.marked { background: #FFF6C7; border-color: #E8B80A; color: #8A6300; }

.tag {
  display: inline-block; background: #e9f0ff; color: var(--blue); padding: 4px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 800;
}
.reading {
  white-space: pre-line; line-height: 1.65; background: #f8f9fc; border-left: 4px solid var(--yellow);
  padding: 14px; margin: 14px 0; border-radius: 0 10px 10px 0;
}
.prompt { white-space: pre-line; font-size: 16px; line-height: 1.6; font-weight: 700; margin: 14px 0; }
.prompt img, .reading img { max-width: 100%; height: auto; display: block; margin: 12px auto; }
.prompt table, .reading table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.prompt table td, .prompt table th, .reading table td, .reading table th {
  border: 1px solid #cbd5e1; padding: 6px; vertical-align: top;
}
.options { display: grid; gap: 10px; }
.option {
  display: flex; gap: 11px; align-items: flex-start; border: 1.5px solid var(--line);
  border-radius: 12px; padding: 12px; cursor: pointer; transition: border-color .1s, background .1s;
}
.option:hover { border-color: #7eafff; }
.option.selected { border-color: var(--blue); background: #f0f5ff; }
.option.review-correct { border-color: #16864A; background: #E7F7EE; }
.option.review-wrong { border-color: var(--red); background: #FDE8EC; }
.marker {
  border: 2px solid #aeb9cf; border-radius: 50%; min-width: 25px; height: 25px; display: grid;
  place-items: center; font-size: 12px; font-weight: 900; color: var(--muted);
}
.selected .marker { border-color: var(--blue); background: var(--blue); color: #fff; }
.option.review-correct .marker { border-color: #16864A; background: #16864A; color: #fff; }
.option.review-wrong .marker { border-color: var(--red); background: var(--red); color: #fff; }
.option span:last-child { line-height: 1.5; }
.nav-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }

/* ---------- hasil ---------- */
.result-badge { font-size: 52px; line-height: 1; }
.result-name { font-size: 26px; font-weight: 900; color: var(--navy); margin: 4px 0 2px; }
.result-sub { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.score-xl { font-size: 58px; font-weight: 900; color: var(--navy); line-height: 1; }
.score-label { color: var(--muted); font-weight: 800; letter-spacing: 1px; font-size: 12px; text-transform: uppercase; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-box { border: 1.5px solid var(--line); border-radius: 14px; padding: 16px; text-align: left; background: #fff; }
.stat-box b { display: block; color: var(--navy); font-size: 14px; margin-bottom: 6px; }
.stat-box .value { font-size: 26px; font-weight: 900; color: var(--navy); }
.stat-box .sub { color: var(--muted); font-size: 12px; }
.mini-row { display: flex; justify-content: space-between; font-size: 13px; margin: 5px 0; color: var(--ink); }
.mini-row b { color: var(--navy); font-size: 13px; }

.bar-row { margin: 9px 0; }
.bar-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.bar-track { height: 9px; border-radius: 999px; background: #EEF2F9; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #1464F4, #3f8bff); }
.bar-fill.good { background: linear-gradient(90deg, #0C7540, #2aa86e); }
.bar-fill.warn { background: linear-gradient(90deg, #d4a017, #f0c14b); }
.bar-fill.bad { background: linear-gradient(90deg, #C9344E, #e06a80); }

.disclaimer {
  border: 1.5px solid #FFD43B; background: #FFF9E8; border-radius: 12px; padding: 14px 16px;
  color: #6B5600; font-size: 13px; line-height: 1.6; text-align: left;
}
.download-row { display: grid; gap: 10px; max-width: 420px; margin: 12px auto 0; }

.review-item { border: 1.5px solid var(--line); border-radius: 14px; padding: 16px; margin: 12px 0; text-align: left; }
.review-item .qnum { font-weight: 900; color: var(--navy); }
.review-item .verdict { font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: 999px; }
.verdict.correct { background: #E7F7EE; color: #0C7540; }
.verdict.wrong { background: #FDE8EC; color: #A11D35; }
.verdict.skip { background: #EEF2F9; color: var(--muted); }
.verdict.partial { background: #FFF6C7; color: #8A6300; }

.badge-pill {
  display: inline-flex; align-items: center; gap: 5px; background: #FFF6C7; color: #8A6300;
  border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 800; margin: 4px;
}
.xp-pill { background: #EAF1FF; color: var(--blue); }

/* ---------- tabel leaderboard ---------- */
.lb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lb-table th {
  background: #EAF1FF; color: var(--navy); text-align: left; padding: 10px 12px; border-radius: 8px;
}
.lb-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.lb-table tr.me td { background: #FFF6C7; font-weight: 800; }
.lb-rank { font-weight: 900; color: var(--navy); }

/* ---------- editor ---------- */
.editor-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.editor-log { max-height: 160px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 12px; background: #F8FAFE; text-align: left; }
.editor-log .ok { color: #0C7540; }
.editor-log .err { color: var(--red); }
.num-input { width: 90px; text-align: center; font-weight: 800; }

@media (max-width: 600px) {
  .app { padding: 14px 12px 44px; }
  .card { padding: 18px 14px; }
  .result-grid, .form-grid { grid-template-columns: 1fr; }
  h1 { font-size: 24px; }
  .quiz-bar small { display: none; }
  .score-xl { font-size: 46px; }
  .hero-logo { width: 70%; }
}