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

:root {
  --green: #059669;
  --green-light: #10B981;
  --green-bg: #ECFDF5;
  --orange: #F97316;
  --orange-dark: #EA580C;
  --gray-dark: #1F2937;
  --gray-mid: #6B7280;
  --gray-light: #F9FAFB;
  --white: #FFFFFF;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--gray-light);
  color: var(--gray-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

#app { min-height: 100vh; display: flex; flex-direction: column; }

/* NAV */
nav {
  background: var(--green);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(5,150,105,0.3);
}
nav .logo-icon { font-size: 24px; }
nav .logo-text { color: var(--white); font-weight: 800; font-size: 18px; letter-spacing: -0.3px; }
nav .logo-text span { color: #A7F3D0; }

/* SCREENS */
.screen { display: none; flex-direction: column; flex: 1; padding: 24px 20px; max-width: 480px; margin: 0 auto; width: 100%; }
.screen.active { display: flex; }

/* HERO */
.hero { text-align: center; padding: 32px 0 8px; }
.hero h1 { font-size: 28px; font-weight: 800; color: var(--green); line-height: 1.25; margin-bottom: 12px; }
.hero p { font-size: 15px; color: var(--gray-mid); line-height: 1.6; margin-bottom: 32px; }

/* BUTTONS */
.btn-primary {
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: 50px;
  padding: 16px 32px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s, transform 0.1s;
  font-family: 'Inter', sans-serif;
}
.btn-primary:hover { background: var(--orange-dark); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: transparent;
  color: var(--green);
  border: 2px solid var(--green);
  border-radius: 50px;
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
  font-family: 'Inter', sans-serif;
  margin-top: 10px;
}
.btn-secondary:hover { background: var(--green-bg); }

.btn-icon {
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 60px; height: 60px;
  font-size: 26px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--orange-dark); }
.btn-icon:active { transform: scale(0.93); }

/* SCREEN 2 - KONSEP */
.konsep-box {
  background: var(--white);
  border: 2px solid var(--green-light);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin: 20px 0;
  box-shadow: var(--shadow);
}
.konsep-box .arab { font-size: 52px; line-height: 1.4; cursor: pointer; transition: color 0.2s; user-select: none; }
.konsep-box .arab:hover { color: var(--green); }
.konsep-box .arab.playing { color: var(--orange); }
.konsep-box .hint { font-size: 13px; color: var(--gray-mid); margin-top: 8px; }
.info-card { background: var(--green-bg); border-radius: 12px; padding: 16px; font-size: 14px; color: var(--green); line-height: 1.6; margin-bottom: 20px; }
.info-card strong { display: block; margin-bottom: 4px; font-size: 15px; }

/* SCREEN 3 - GRID HURUF */
.progress-bar-wrap { background: #E5E7EB; border-radius: 50px; height: 10px; margin: 8px 0 4px; overflow: hidden; }
.progress-bar { background: var(--green); height: 100%; border-radius: 50px; transition: width 0.4s ease; }
.progress-label { font-size: 13px; color: var(--gray-mid); text-align: right; margin-bottom: 20px; }

.huruf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.huruf-kad {
  background: var(--white);
  border: 2px solid #E5E7EB;
  border-radius: var(--radius);
  padding: 18px 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}
.huruf-kad:hover { border-color: var(--green-light); transform: translateY(-2px); }
.huruf-kad.selesai { border-color: var(--green); background: var(--green-bg); }
.huruf-kad.kunci { cursor: default; opacity: 0.45; }
.huruf-kad .arab-kecil { font-size: 38px; line-height: 1.3; }
.huruf-kad .nama { font-size: 12px; font-weight: 600; color: var(--gray-mid); margin-top: 4px; }
.huruf-kad .tick { font-size: 16px; color: var(--green); }
.huruf-kad .lock { font-size: 14px; color: var(--gray-mid); }

/* SCREEN 4 - FLASHCARD */
.flashcard-wrap { perspective: 800px; margin: 16px 0; }
.flashcard {
  width: 100%; background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 20px;
  text-align: center;
  position: relative;
  transition: transform 0.5s;
  transform-style: preserve-3d;
  min-height: 240px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.flashcard.flipped { transform: rotateY(180deg); }
.card-front, .card-back {
  backface-visibility: hidden;
  width: 100%;
}
.card-back { transform: rotateY(180deg); position: absolute; top: 50%; left: 50%; transform: rotateY(180deg) translate(50%, -50%); }
.huruf-besar { font-size: 96px; line-height: 1; color: var(--gray-dark); }
.card-back .analogi-img { font-size: 72px; }
.card-back .analogi-teks { font-size: 20px; font-weight: 700; color: var(--green); margin-top: 8px; }

.controls-row { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 16px 0; }

.latihan-label { font-size: 14px; color: var(--gray-mid); margin-bottom: 10px; }
.latihan-grid { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; }
.latihan-kotak {
  width: 80px; height: 80px;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  background: var(--white);
  font-size: 32px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, background 0.2s;
  box-shadow: var(--shadow);
}
.latihan-kotak:hover { border-color: var(--orange); }
.latihan-kotak.active { border-color: var(--orange); background: #FFF7ED; }
.latihan-kotak.done { border-color: var(--green); background: var(--green-bg); }

/* SCREEN 5 - QUIZ */
.quiz-soalan { font-size: 17px; font-weight: 600; text-align: center; margin: 20px 0 8px; }
.quiz-audio-btn {
  background: var(--green-bg);
  border: 2px solid var(--green);
  border-radius: 50%;
  width: 80px; height: 80px;
  font-size: 36px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  transition: background 0.2s;
}
.quiz-audio-btn:hover { background: #D1FAE5; }
.quiz-pilihan { display: flex; gap: 12px; justify-content: center; margin-bottom: 20px; }
.quiz-kad {
  width: 90px; height: 90px;
  border: 2px solid #E5E7EB;
  border-radius: 14px;
  background: var(--white);
  font-size: 44px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.1s;
}
.quiz-kad:hover { border-color: var(--green-light); transform: scale(1.04); }
.quiz-kad.betul { border-color: var(--green); background: var(--green-bg); animation: pop 0.3s ease; }
.quiz-kad.salah { border-color: #EF4444; background: #FEF2F2; animation: shake 0.3s ease; }

@keyframes pop { 0%,100%{transform:scale(1)} 50%{transform:scale(1.12)} }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

/* KONFETI */
.konfeti-wrap { position: fixed; inset: 0; pointer-events: none; z-index: 999; overflow: hidden; }
.konfeti-item {
  position: absolute;
  top: -20px;
  width: 10px; height: 10px;
  border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }

/* SCREEN 6 - CTA */
.tahniah-icon { font-size: 64px; text-align: center; margin: 12px 0; }
.cta-title { font-size: 24px; font-weight: 800; color: var(--green); text-align: center; margin-bottom: 8px; }
.cta-sub { font-size: 14px; color: var(--gray-mid); text-align: center; line-height: 1.6; margin-bottom: 20px; }
.kelebihan-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.kelebihan-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.kelebihan-list li span.icon { font-size: 20px; }

.btn-whatsapp {
  background: #25D366;
  color: var(--white);
  border: none;
  border-radius: 50px;
  padding: 16px 28px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background 0.2s;
  font-family: 'Inter', sans-serif;
  animation: pulse 2s infinite;
}
.btn-whatsapp:hover { background: #1ebe5b; animation: none; }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(37,211,102,0.4)} 50%{box-shadow:0 0 0 10px rgba(37,211,102,0)} }

/* TOAST */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--gray-dark); color: var(--white);
  padding: 12px 24px; border-radius: 50px;
  font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
  z-index: 999; white-space: nowrap;
}
.toast.show { opacity: 1; }

/* SCREEN TITLE */
.screen-title { font-size: 20px; font-weight: 800; color: var(--gray-dark); margin-bottom: 4px; }
.screen-sub { font-size: 13px; color: var(--gray-mid); margin-bottom: 20px; }

/* BACK BUTTON */
.back-btn { background: none; border: none; color: var(--green); font-size: 14px; font-weight: 600; cursor: pointer; padding: 0 0 16px; display: flex; align-items: center; gap: 4px; font-family: 'Inter', sans-serif; }
.back-btn:hover { color: var(--green-light); }
