:root {
  --ungu: #864879;
  --ungu-appbar: #916bbf;
  --salmon: #e9a6a6;
  --hijau: #d8e9a8;
  --lavender: #c996cc;
  --note: #980f5a;
  --ink: #333;
  --border: #e5e7eb;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Alegreya", Georgia, serif;
  background: var(--salmon);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1,
h2,
h3,
.brand,
.appbar-title,
.card-title,
.menu-title {
  font-family: "Patua One", "Alegreya", sans-serif;
}

/* AppBar */
.appbar {
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  font-family: "Patua One", sans-serif;
  font-style: italic;
  font-weight: bold;
  font-size: 1.25rem;
  text-align: center;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.appbar a {
  color: inherit;
  text-decoration: none;
}

.appbar-back {
  font-size: 1.6rem;
  line-height: 1;
  font-style: normal;
  font-weight: normal;
}

.appbar-green {
  background: #d8e9a8;
  color: #79658a;
}

.appbar-purple {
  background: #916bbf;
  color: #fff;
}

.appbar-grey {
  background: #787a91;
  color: #fff;
}

.appbar-dark {
  background: #59405c;
  color: #fff;
}

.appbar-note {
  background: #750550;
  color: #fff;
}

.appbar-pink {
  background: #f10086;
  color: #fff;
}

/* Page body wrapper */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  min-height: calc(100vh - 56px);
}

/* Home Lottie bg + hero */
.home-page {
  position: relative;
  background: var(--salmon);
  min-height: calc(100vh - 56px);
  overflow: hidden;
}

.lottie-position {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
  pointer-events: none;
}

.lottie-position .lottie-el {
  width: 100%;
  height: 100%;
}

.lottie-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
  pointer-events: none;
}

.home-menu {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 20px;
  min-height: calc(100vh - 56px);
}

/* Card menu (TextButton > Card ungu) */
.menu-card {
  width: 100%;
  max-width: 320px;
  background: var(--ungu);
  color: #fff;
  text-align: center;
  border-radius: 12px;
  padding: 12px 20px;
  font-family: "Patua One", sans-serif;
  font-size: 1.15rem;
  text-decoration: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.menu-card:hover {
  filter: brightness(1.1);
}

/* List pages (Materi/Latihan) with pohon bg */
.list-page {
  position: relative;
  background: var(--salmon);
  min-height: calc(100vh - 56px);
  overflow: hidden;
}

.lottie-list-bg {
  position: absolute;
  top: 8%;
  left: 30%;
  width: 60%;
  height: 80vh;
  opacity: 0.5;
  pointer-events: none;
}

.list-content {
  position: relative;
  z-index: 2;
  padding: 16px 16px 40px;
  max-width: 720px;
  margin: 0 auto;
}

.list-item {
  display: block;
  text-decoration: none;
  background: var(--ungu);
  color: #fff;
  text-align: center;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  font-family: "Patua One", sans-serif;
  font-size: 1.3rem;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.list-item:hover {
  filter: brightness(1.1);
}

.list-section-title {
  text-align: center;
  margin: 8px 0 18px;
  font-family: "Patua One", sans-serif;
  font-size: 1.4rem;
  color: #79658a;
  font-style: italic;
}

/* Quiz: lavender bg + appbar ungu */
.quiz-page {
  background: var(--lavender);
  min-height: 100vh;
}

.quiz-appbar {
  background: var(--ungu-appbar);
  color: #fff;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  text-align: center;
  font-family: "Patua One", sans-serif;
  font-style: italic;
  font-size: 1.4rem;
}

.quiz-body {
  padding: 15px;
  max-width: 720px;
  margin: 0 auto;
}

.question {
  margin-bottom: 18px;
}

.question-text {
  color: #fff;
  font-weight: bold;
  font-size: 1.05rem;
  margin: 0 0 2px;
}

.answer {
  display: block;
  background: transparent;
  border: none;
  color: #fff;
  font-family: "Alegreya", serif;
  font-weight: bold;
  font-size: 1rem;
  padding: 2px 0;
  cursor: pointer;
  text-align: left;
  line-height: 1.4;
}

.answer.selected {
  color: #d32f2f;
}

.answer:hover {
  filter: brightness(0.85);
}

.lihat-nilai {
  display: block;
  margin: 8px auto 24px;
  background: transparent;
  border: none;
  color: #7b2d8b;
  font-family: "Alegreya", serif;
  font-weight: bold;
  font-size: 1.2rem;
  cursor: pointer;
  text-align: center;
}

/* Instruction box (like hafalan abjad note) */
.instr-box {
  background: var(--ungu-appbar);
  color: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 16px 0 24px;
  font-size: 1rem;
  font-weight: bold;
}

/* Section/page header on detail pages */
.page-title {
  margin: 12px 0 6px;
  font-family: "Patua One", sans-serif;
  font-size: 1.6rem;
  color: #fff;
}

.page-desc {
  color: #fff;
  margin: 0 0 16px;
}

/* Breadcrumb */
.breadcrumb {
  font-family: "Alegreya", serif;
  color: rgba(255, 255, 255, 0.9);
  margin: 12px 0;
  font-size: 0.95rem;
}

.breadcrumb a {
  color: #fff;
  text-decoration: underline;
}

/* Detail page background variants */
.bg-note {
  background: var(--note);
}
.bg-lavender {
  background: var(--lavender);
}
.bg-green {
  background: var(--hijau);
}
.bg-pink {
  background: #f582a7;
}
.bg-grey {
  background: #eeeeee;
}
.bg-blue {
  background: #6e85b2;
}
.bg-note-page {
  background: #87556f;
}

.note-text-page p {
  color: #fff;
  font-weight: bold;
  font-size: 1.05rem;
  line-height: 1.5;
}

.saweria-page {
  background: #eeeeee;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  min-height: calc(100vh - 56px);
}

.saweria-img {
  width: 200px;
  height: 200px;
  object-fit: contain;
}

.saweria-title {
  margin: 0;
  font-family: "Patua One", sans-serif;
  font-style: italic;
  font-size: 1rem;
  color: #000;
}

.saweria-link {
  font-family: "Patua One", sans-serif;
  font-style: italic;
  font-size: 0.9rem;
  color: #79658a;
  text-decoration: underline;
}

/* Key list */
.key-page {
  padding: 16px;
  max-width: 720px;
  margin: 0 auto;
  min-height: calc(100vh - 56px);
}

.key-title {
  margin: 0 0 4px;
  font-family: "Patua One", sans-serif;
  font-size: 1.5rem;
  color: #fff;
}

.key-sub {
  color: #fff;
  margin: 0 0 16px;
}

.key-list {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 12px;
}

.key-item {
  margin-bottom: 14px;
}

.key-item:last-child {
  margin-bottom: 0;
}

.key-q {
  font-weight: bold;
  color: #fff;
  margin: 0 0 2px;
}

.key-a {
  color: #fff;
  line-height: 1.45;
}

.key-a.correct {
  color: #d32f2f;
  font-weight: bold;
}

.key-missing {
  color: #ddd;
  font-style: italic;
}

/* materi-kunci list (halaman [slug]) */
.note {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  color: #fff;
  padding: 10px 14px;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.textlist {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  overflow: hidden;
}

.textlist-item {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
}

.textlist-item:last-child {
  border-bottom: none;
}

.textlist-no {
  font-weight: bold;
  color: #fff;
}

.textlist-q {
  color: #fff;
  margin: 0;
  font-weight: bold;
}

/* Material image page */
.material-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #fff;
  display: block;
  margin-bottom: 16px;
}

.img-note {
  color: #666;
  font-size: 0.9rem;
  text-align: center;
  margin: 0;
}

.img-grey .img-note {
  color: #444;
}

/* Button */
.btn {
  display: inline-block;
  background: var(--ungu);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-family: "Patua One", sans-serif;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.btn:hover {
  filter: brightness(1.1);
}

/* Dialog */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}

.dialog-overlay.open {
  display: flex;
}

.dialog {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 340px;
  text-align: center;
}

.dialog-score {
  font-family: "Alegreya", serif;
  font-weight: bold;
  font-size: 1.2rem;
  color: #7b2d8b;
  margin: 0 0 12px;
}

.dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.dialog-actions .btn {
  width: 100%;
}

.dialog-actions a.btn.ghost {
  background: #eee;
  color: #333;
}
