:root {
  --primary:   #FF6B35;
  --secondary: #4ECDC4;
  --accent:    #FFE66D;
  --purple:    #9B5DE5;
  --green:     #06D6A0;
  --pink:      #FF85A1;
  --bg:        #FFF9F0;
  --card:      #FFFFFF;
  --text:      #2D2D2D;
  --muted:     #888;
  --radius:    18px;
  --shadow:    0 4px 20px rgba(0,0,0,.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
}

/* ── PAGES ── */
.page { display: none; min-height: 100vh; }
.page.active { display: block; }

/* ── COVER ── */
#page-cover {
  background: linear-gradient(145deg, #FF6B35 0%, #FF85A1 40%, #9B5DE5 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 40px 28px;
  position: relative; overflow: hidden;
}
#page-cover.active { display: flex; }

.cover-bubble {
  position: absolute; border-radius: 50%;
  opacity: .18;
  background: white;
}
.cover-bubble:nth-child(1){ width:180px;height:180px; top:-60px;left:-50px; }
.cover-bubble:nth-child(2){ width:120px;height:120px; bottom:60px;right:-30px; }
.cover-bubble:nth-child(3){ width:80px;height:80px; top:180px;right:20px; }
.cover-bubble:nth-child(4){ width:60px;height:60px; bottom:200px;left:10px; }

.cover-badge {
  background: var(--accent);
  color: #8B4513;
  font-weight: 800;
  font-size: .78rem;
  padding: 6px 16px;
  border-radius: 50px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 20px;
  box-shadow: 0 3px 10px rgba(0,0,0,.2);
}

.cover-icon {
  font-size: 70px;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.3));
}
@keyframes float {
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-12px); }
}

.cover-title {
  font-family: 'Fredoka One', cursive;
  font-size: 2.2rem;
  color: white;
  line-height: 1.15;
  text-shadow: 0 3px 10px rgba(0,0,0,.25);
  margin-bottom: 8px;
}
.cover-subtitle {
  font-size: .95rem;
  color: rgba(255,255,255,.9);
  font-weight: 600;
  margin-bottom: 6px;
}
.cover-class {
  font-size: .85rem;
  color: rgba(255,255,255,.75);
  margin-bottom: 36px;
}

.btn-start {
  background: var(--accent);
  color: #8B4513;
  border: none; cursor: pointer;
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem;
  padding: 14px 40px;
  border-radius: 50px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25), 0 -3px 0 rgba(0,0,0,.15) inset;
  transition: transform .15s, box-shadow .15s;
  position: relative; z-index: 2;
}
.btn-start:active { transform: translateY(2px); box-shadow: 0 3px 10px rgba(0,0,0,.2); }

.cover-footer {
  position: absolute; bottom: 20px;
  font-size: .72rem; color: rgba(255,255,255,.6);
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  background: white;
  border-top: 2px solid #F0E8FF;
  display: flex; z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 10px 4px 12px;
  cursor: pointer; transition: all .2s;
  position: relative;
  border: none; background: none;
}
.nav-item .nav-icon { font-size: 1.4rem; margin-bottom: 2px; }
.nav-item .nav-label { font-size: .6rem; font-weight: 700; color: #bbb; }
.nav-item.active .nav-label { color: var(--purple); }
.nav-item.active::before {
  content: '';
  position: absolute; top: 0; left: 20%; right: 20%; height: 3px;
  background: var(--purple); border-radius: 0 0 4px 4px;
}
.nav-item:not(.active) .nav-icon { filter: grayscale(1) opacity(.4); }

/* ── INNER PAGES wrapper ── */
.inner-page {
  padding-bottom: 80px;
}

/* ── HEADER BANNER ── */
.page-header {
  padding: 28px 24px 22px;
  position: relative; overflow: hidden;
}
.page-header::after {
  content: '';
  position: absolute; bottom: -20px; right: -20px;
  width: 120px; height: 120px; border-radius: 50%;
  opacity: .12; background: white;
}
.page-header .back-btn {
  background: rgba(255,255,255,.25);
  border: none; color: white; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; transition: background .2s;
}
.page-header .back-btn:hover { background: rgba(255,255,255,.4); }
.page-header h1 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.6rem; color: white; line-height: 1.2;
}
.page-header p { font-size: .82rem; color: rgba(255,255,255,.85); margin-top: 4px; }

/* ── CARD ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 0 16px 16px;
}

.card-icon { font-size: 2rem; margin-bottom: 10px; }
.card h3 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem; margin-bottom: 6px;
}
.card p, .card li { font-size: .88rem; line-height: 1.65; color: #555; }
.card ul, .card ol { padding-left: 18px; }
.card li { margin-bottom: 4px; }

/* ── SECTION TITLE ── */
.section-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.05rem;
  padding: 4px 16px 8px;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: '';
  width: 4px; height: 22px;
  background: var(--primary);
  border-radius: 4px;
}

/* ── HOME MENU GRID ── */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 16px 16px;
}
.menu-card {
  border-radius: var(--radius);
  padding: 22px 16px;
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  cursor: pointer; transition: transform .2s, box-shadow .2s;
  box-shadow: var(--shadow);
  border: none; background: white;
  position: relative; overflow: hidden;
}
.menu-card::before {
  content: ''; position: absolute;
  top: -20px; right: -20px;
  width: 70px; height: 70px; border-radius: 50%;
  opacity: .12;
}
.menu-card:active { transform: scale(.96); }
.menu-card .m-icon { font-size: 2.2rem; margin-bottom: 10px; }
.menu-card .m-title {
  font-family: 'Fredoka One', cursive;
  font-size: .95rem; line-height: 1.3;
}
.menu-card .m-sub { font-size: .72rem; color: var(--muted); margin-top: 4px; }

/* ── STORY TEXT ── */
.story-box {
  background: linear-gradient(135deg, #FFF9E6 0%, #FFFDF6 100%);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 16px 16px;
}
.story-box h4 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem; color: var(--primary);
  margin-bottom: 6px; text-align: center;
}
.story-box .story-meta {
  text-align: center; font-size: .75rem;
  color: var(--muted); margin-bottom: 14px;
  font-style: italic;
}
.story-box p {
  font-size: .88rem; line-height: 1.8; color: #444;
  text-indent: 1.5em; margin-bottom: 8px;
}
.story-label {
  display: inline-block;
  background: var(--purple); color: white;
  font-size: .68rem; font-weight: 700;
  padding: 3px 10px; border-radius: 50px;
  margin-bottom: 6px; letter-spacing: .5px;
}

/* ── KEGIATAN / ACTIVITIES ── */
.activity-step {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 16px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 16px 12px;
}
.step-num {
  min-width: 36px; height: 36px;
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  font-family: 'Fredoka One', cursive; font-size: 1rem; color: white;
}
.activity-step .step-text { font-size: .85rem; line-height: 1.6; color: #555; }
.activity-step .step-text strong { color: var(--text); }

/* ── QUESTIONS ── */
.question-item {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin: 0 16px 14px;
}
.question-num {
  font-family: 'Fredoka One', cursive;
  font-size: .82rem; color: var(--purple);
  margin-bottom: 6px;
}
.question-text {
  font-size: .9rem; font-weight: 700;
  margin-bottom: 14px; line-height: 1.5;
}

/* Radio options */
.options { display: flex; flex-direction: column; gap: 10px; }
.option-label {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border: 2px solid #EAEAEA;
  border-radius: 12px; cursor: pointer;
  transition: all .2s; font-size: .85rem;
}
.option-label input[type=radio] { display: none; }
.option-dot {
  width: 22px; height: 22px; min-width: 22px;
  border-radius: 50%; border: 2px solid #CCC;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.option-label:has(input:checked) {
  border-color: var(--purple);
  background: #F3EEFF;
}
.option-label:has(input:checked) .option-dot {
  border-color: var(--purple);
  background: var(--purple);
}
.option-label:has(input:checked) .option-dot::after {
  content: ''; width: 8px; height: 8px;
  border-radius: 50%; background: white;
}

/* Essay textarea */
.essay-textarea {
  width: 100%; min-height: 90px;
  border: 2px solid #EAEAEA; border-radius: 12px;
  padding: 12px; font-family: 'Nunito', sans-serif;
  font-size: .85rem; resize: vertical;
  outline: none; transition: border-color .2s;
  background: #FAFAFA;
}
.essay-textarea:focus { border-color: var(--secondary); background: white; }

/* ── TABLE ── */
.struktur-table {
  width: 100%; border-collapse: collapse;
  font-size: .82rem;
}
.struktur-table th {
  background: var(--purple); color: white;
  padding: 10px 12px; text-align: left;
  font-family: 'Fredoka One', cursive; font-size: .9rem;
}
.struktur-table th:first-child { border-radius: 10px 0 0 0; }
.struktur-table th:last-child { border-radius: 0 10px 0 0; }
.struktur-table td {
  padding: 10px 12px; border-bottom: 1px solid #F0E8FF;
  vertical-align: top; line-height: 1.5;
}
.struktur-table tr:nth-child(even) td { background: #FAF5FF; }
.struktur-table input[type=text] {
  width: 100%; border: 1.5px solid #D5C8F0;
  border-radius: 8px; padding: 6px 10px;
  font-family: 'Nunito', sans-serif; font-size: .82rem;
  outline: none; background: white;
}
.struktur-table input[type=text]:focus { border-color: var(--purple); }

/* ── EVALUASI / QUIZ ── */
.quiz-progress-bar {
  height: 8px; background: #EEE;
  border-radius: 50px; margin: 0 16px 20px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--secondary), var(--purple));
  border-radius: 50px; transition: width .4s ease;
}

.quiz-card {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px; margin: 0 16px 20px;
}
.quiz-counter { font-size: .78rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.quiz-question { font-size: .95rem; font-weight: 700; line-height: 1.5; margin-bottom: 18px; }
.quiz-options { display: flex; flex-direction: column; gap: 12px; }
.quiz-option {
  padding: 13px 16px; border-radius: 12px;
  border: 2px solid #EEE; cursor: pointer;
  font-size: .88rem; font-weight: 600;
  transition: all .2s; text-align: left;
  background: white;
}
.quiz-option:hover { border-color: #CCC; background: #F9F9F9; }
.quiz-option.correct { border-color: var(--green); background: #E6FBF6; color: #065f46; }
.quiz-option.wrong   { border-color: var(--pink);  background: #FFF0F3; color: #9f1239; }
.quiz-option.disabled { pointer-events: none; }

.quiz-feedback {
  display: none; padding: 14px 16px;
  border-radius: 12px; margin-top: 14px;
  font-size: .85rem; font-weight: 600; line-height: 1.5;
}
.quiz-feedback.show { display: block; }
.quiz-feedback.correct { background: #E6FBF6; color: #065f46; border: 1.5px solid var(--green); }
.quiz-feedback.wrong   { background: #FFF0F3; color: #9f1239; border: 1.5px solid var(--pink); }

.btn-next-quiz {
  display: none; width: calc(100% - 32px);
  margin: 0 16px 16px;
  background: var(--purple); color: white;
  border: none; cursor: pointer;
  font-family: 'Fredoka One', cursive;
  font-size: 1.05rem; padding: 14px;
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(155,93,229,.4);
  transition: transform .15s;
}
.btn-next-quiz:active { transform: scale(.98); }
.btn-next-quiz.show { display: block; }

/* RESULT screen */
.result-screen {
  text-align: center; padding: 40px 28px;
  display: none;
}
.result-screen.show { display: block; }
.result-emoji { font-size: 5rem; margin-bottom: 16px; animation: float 2s ease-in-out infinite; }
.result-title { font-family: 'Fredoka One', cursive; font-size: 1.8rem; margin-bottom: 8px; }
.result-score {
  font-size: 3rem; font-family: 'Fredoka One', cursive;
  color: var(--purple); margin: 14px 0;
}
.result-desc { font-size: .9rem; color: var(--muted); line-height: 1.7; margin-bottom: 30px; }
.btn-retry {
  background: var(--primary); color: white;
  border: none; cursor: pointer;
  font-family: 'Fredoka One', cursive; font-size: 1.1rem;
  padding: 14px 36px; border-radius: 50px;
  box-shadow: 0 4px 14px rgba(255,107,53,.35);
  margin-right: 10px;
}
.btn-home {
  background: white; color: var(--purple);
  border: 2px solid var(--purple); cursor: pointer;
  font-family: 'Fredoka One', cursive; font-size: 1.1rem;
  padding: 12px 30px; border-radius: 50px;
}

/* ── PROFIL ── */
.profil-avatar {
  width: 100px; height: 100px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.8rem; margin: 0 auto 16px;
  box-shadow: 0 6px 20px rgba(155,93,229,.35);
}
.profil-name {
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem; text-align: center; margin-bottom: 4px;
}
.profil-role { text-align: center; font-size: .82rem; color: var(--muted); margin-bottom: 24px; }
.info-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid #F0E8FF;
  font-size: .85rem;
}
.info-row:last-child { border-bottom: none; }
.info-row .info-icon { font-size: 1.3rem; min-width: 28px; }
.info-row .info-label { color: var(--muted); font-size: .75rem; }
.info-row .info-value { font-weight: 700; margin-top: 1px; }

/* ── COLORS per section ── */
.hdr-orange { background: linear-gradient(135deg, #FF6B35, #FFB347); }
.hdr-teal   { background: linear-gradient(135deg, #4ECDC4, #06D6A0); }
.hdr-purple { background: linear-gradient(135deg, #9B5DE5, #C77DFF); }
.hdr-pink   { background: linear-gradient(135deg, #FF85A1, #FF6B9D); }
.hdr-blue   { background: linear-gradient(135deg, #4CC9F0, #4895EF); }

.step-orange { background: var(--primary); }
.step-teal   { background: var(--secondary); }
.step-purple { background: var(--purple); }
.step-pink   { background: var(--pink); }
.step-green  { background: var(--green); }

/* ── CHIP ── */
.chip {
  display: inline-block;
  padding: 4px 12px; border-radius: 50px;
  font-size: .72rem; font-weight: 700;
  margin: 3px 3px 0;
}

/* ── BTN PRIMARY ── */
.btn-primary {
  width: calc(100% - 32px); margin: 0 16px 20px;
  background: linear-gradient(135deg, var(--primary), #FF8C42);
  color: white; border: none; cursor: pointer;
  font-family: 'Fredoka One', cursive; font-size: 1.1rem;
  padding: 14px; border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(255,107,53,.35);
  transition: transform .15s;
}
.btn-primary:active { transform: scale(.98); }

/* ── SUCCESS TOAST ── */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--green); color: white;
  font-weight: 700; font-size: .9rem;
  padding: 12px 28px; border-radius: 50px;
  box-shadow: 0 4px 20px rgba(6,214,160,.4);
  z-index: 200; transition: transform .3s ease;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── MATERI BADGE ── */
.materi-badge {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #FFF9E6, #FFF3CC);
  border: 2px dashed var(--accent);
  border-radius: var(--radius); padding: 14px 16px;
  margin: 0 16px 14px;
}
.materi-badge .mb-icon { font-size: 1.6rem; }
.materi-badge .mb-text { font-size: .82rem; color: #7A5C00; font-weight: 600; line-height: 1.5; }

/* ── SCROLL FADE-IN ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .4s ease both; }
.fade-up:nth-child(2) { animation-delay: .08s; }
.fade-up:nth-child(3) { animation-delay: .16s; }
.fade-up:nth-child(4) { animation-delay: .24s; }

/* ── PETUNJUK ── */
.petunjuk-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 20px;
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); margin: 0 16px 12px;
}
.petunjuk-num {
  min-width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #8B4513;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fredoka One', cursive; font-size: 1.1rem;
}
.petunjuk-item p { font-size: .86rem; line-height: 1.65; color: #555; padding-top: 6px; }

/* HOME hero */
.home-hero {
  background: linear-gradient(135deg, #9B5DE5 0%, #C77DFF 60%, #FF85A1 100%);
  padding: 30px 24px 28px;
  position: relative; overflow: hidden;
}
.home-hero::after {
  content: '📚';
  position: absolute; right: 20px; top: 18px;
  font-size: 4rem; opacity: .25;
}
.home-hero h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.45rem; color: white; line-height: 1.25;
}
.home-hero p { font-size: .82rem; color: rgba(255,255,255,.85); margin-top: 6px; }
.home-hero .hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.2);
  color: white; font-size: .72rem; font-weight: 700;
  padding: 4px 12px; border-radius: 50px;
  margin-bottom: 10px;
}

/* progress tracker */
.progress-track {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 20px;
  margin: 12px 16px 16px;
}
.progress-track h4 { font-family: 'Fredoka One', cursive; font-size: .95rem; margin-bottom: 12px; }
.track-items { display: flex; gap: 8px; }
.track-dot {
  flex: 1; height: 8px; border-radius: 50px;
  background: #EEE; transition: background .3s;
}
.track-dot.done { background: var(--green); }
.track-dot.active { background: var(--purple); }
.track-label { display: flex; justify-content: space-between; margin-top: 8px; }
.track-label span { font-size: .68rem; color: var(--muted); }

/* ── RESPONSIVE adjustments ── */
@media (max-width: 360px) {
  .cover-title { font-size: 1.8rem; }
  .menu-grid { grid-template-columns: 1fr; }
}
