/* Gaya khusus setiap skrin */

/* ---------- Latar langit (skrin utama) ---------- */
body.bg-sky {
  background: linear-gradient(180deg, var(--c-sky-top) 0%, var(--c-sky-bottom) 70%);
}
.hills {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 28vh;
  z-index: -1;
  pointer-events: none;
}
.hills svg { width: 100%; height: 100%; }

/* ---------- Splash ---------- */
.splash {
  gap: var(--sp-5);
  text-align: center;
}
.splash__lulu { width: min(52vw, 260px); }
.splash__logo { width: min(86vw, 520px); }
.splash__tag { font-size: var(--text-ar-label); color: var(--c-primary-dark); }
.splash__tag-bm { font-size: var(--text-base); color: var(--c-ink-soft); margin-top: -8px; }
.splash__start { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* Landskap pendek (telefon mendatar): susun sebelah-menyebelah */
@media (orientation: landscape) and (max-height: 500px) {
  .splash { flex-direction: row; gap: var(--sp-6); }
  .splash__lulu { width: min(30vh * 1.2, 200px); }
  .splash__logo { width: min(46vw, 420px); }
  .splash__col { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); }
}

/* ---------- Kepala skrin dengan Lulu ---------- */
.lulu-say {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-4);
  margin: 0 auto var(--sp-5);
  max-width: 720px;
}
.lulu-say__char { width: clamp(80px, 18vw, 120px); flex: 0 0 auto; }
.lulu-say .speech { flex: 1 1 auto; margin-bottom: var(--sp-3); }

/* ---------- Pilih profil ---------- */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
  max-width: 820px;
  margin: 0 auto;
}
@media (min-width: 720px) { .profile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.profile-card { min-height: 190px; }
.profile-card .avatar { width: clamp(76px, 20vw, 104px); height: clamp(76px, 20vw, 104px); }
.profile-card .pick__name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-card--add { border: 4px dashed var(--c-line); box-shadow: none; background: transparent; color: var(--c-primary-dark); }
.profile-card--add .avatar { background: var(--c-primary-soft); color: var(--c-primary); }

.avatar-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); }
.avatar-picker .pick { min-height: 0; padding: var(--sp-2); aspect-ratio: 1; }
.avatar-picker .avatar { width: 100%; height: 100%; background: transparent; }

/* ---------- Pilih jalur umur ---------- */
.band-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
  max-width: 900px;
  margin: 0 auto;
}
@media (min-width: 900px) { .band-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.band-card { min-height: 200px; gap: var(--sp-3); overflow: hidden; }
.band-card__badge {
  display: grid;
  place-items: center;
  width: 84px; height: 84px;
  border-radius: 24px;
  background: var(--band-color);
  color: var(--c-ink);
  font-size: 2.2rem;
  font-weight: 900;
  box-shadow: inset 0 -6px 0 rgba(0,0,0,0.1);
}
.band-card__badge svg { width: 60%; height: 60%; }
.band-card__age { font-size: var(--text-sm); font-weight: 900; color: var(--c-ink-soft); }
.band-card.is-selected { border-color: var(--band-color); }

/* ---------- Peta kampung ---------- */
.village-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto var(--sp-4);
}
.who {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 6px var(--sp-4) 6px 6px;
  background: var(--c-surface);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 0 var(--c-line);
  min-height: var(--tap-min);
}
.who__name { font-weight: 900; font-size: var(--text-lg); max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stars {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px var(--sp-4);
  background: #FFF1C7;
  border-radius: var(--radius-pill);
  font-weight: 900;
  font-size: var(--text-lg);
  min-height: var(--tap-min);
  box-shadow: 0 4px 0 #F0DC9E;
}
.stars svg { width: 30px; height: 30px; }

.village {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-5) var(--sp-4);
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-4) 0 var(--sp-6);
}
@media (min-width: 600px) { .village { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .village { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
/* Telefon mendatar: 5 lajur supaya satu skrin nampak lebih banyak */
@media (orientation: landscape) and (max-height: 500px) { .village { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-3); } }

.house {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--sp-2) var(--sp-2) var(--sp-3);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: transform var(--dur-fast) var(--ease-out);
}
.house:active { transform: scale(0.96); }
@media (hover: hover) { .house:not(.is-locked):hover { transform: translateY(-4px); } }
.house__art { width: 100%; max-width: 170px; filter: drop-shadow(0 6px 0 rgba(43,43,58,0.12)); }
.house__ar { font-size: var(--text-ar-label); color: var(--c-ink); line-height: 1.6; }
.house__bm { font-size: var(--text-sm); font-weight: 900; color: var(--c-ink-soft); }
.house__lock {
  position: absolute;
  top: 10%; right: 12%;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--c-ink);
  color: #fff;
  box-shadow: 0 3px 0 rgba(0,0,0,0.25);
}
.house__lock svg { width: 24px; height: 24px; }
.house.is-locked .house__art { filter: grayscale(0.7) opacity(0.7); }
.house__new {
  position: absolute;
  top: 6%; left: 8%;
  transform: rotate(-8deg);
}
.house:not(.is-locked) .house__art { animation: house-in var(--dur-slow) var(--ease-bounce) both; }
@keyframes house-in { from { transform: scale(0.8); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Dalam rumah: 4 bilik ---------- */
.rooms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
  max-width: 900px;
  margin: 0 auto;
}
@media (min-width: 900px) { .rooms { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (orientation: landscape) and (max-height: 500px) { .rooms { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.room { min-height: 180px; }
.room__icon {
  display: grid; place-items: center;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--room-color);
  color: #fff;
}
.room__icon svg { width: 44px; height: 44px; }
.room__step {
  position: absolute; top: 10px; left: 10px;
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--c-bg-deep);
  font-weight: 900;
  font-size: var(--text-sm);
}

/* ---------- Tetapan ---------- */
.settings-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.settings-section { font-size: var(--text-base); font-weight: 900; color: var(--c-ink-soft); margin: var(--sp-5) 0 var(--sp-1) var(--sp-2); text-transform: uppercase; letter-spacing: 0.04em; }
.settings-note { font-size: var(--text-sm); color: var(--c-ink-soft); text-align: center; margin-top: var(--sp-6); }

/* ---------- Ujian kawasan main ---------- */
.stage-test {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto 1fr;
  gap: calc(var(--su) * 2);
  padding: calc(var(--su) * 3);
  background:
    linear-gradient(var(--c-line) 1px, transparent 1px) 0 0 / calc(var(--su) * 5) calc(var(--su) * 5),
    linear-gradient(90deg, var(--c-line) 1px, transparent 1px) 0 0 / calc(var(--su) * 5) calc(var(--su) * 5),
    var(--c-surface);
}
.stage-test__title {
  grid-column: 1 / -1;
  text-align: center;
  font-size: calc(var(--su) * 3.2);
  font-weight: 900;
}
.stage-test__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--su) * 1);
  border-radius: calc(var(--su) * 2);
  background: var(--c-bg);
  box-shadow: 0 calc(var(--su) * 0.6) 0 var(--c-line);
  font-size: calc(var(--su) * 2.2);
  font-weight: 900;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast);
}
.stage-test__card .ar { font-size: calc(var(--su) * 6); line-height: 1.6; }
.stage-test__card.is-hit { background: #DDF3DE; transform: scale(0.96); }
.stage-test__size {
  position: absolute;
  right: calc(var(--su) * 1.5);
  bottom: calc(var(--su) * 1);
  font-size: calc(var(--su) * 1.6);
  color: var(--c-ink-soft);
  font-weight: 800;
}

/* ---------- Pembetulan responsif ---------- */
.avatar-picker .avatar { width: 100%; height: auto; aspect-ratio: 1; }
.avatar-picker .avatar svg { width: 88%; height: 88%; }

/* Tajuk bar atas boleh 2 baris pada telefon supaya tidak terpotong */
@media (max-width: 600px) {
  .topbar { padding-left: var(--sp-3); padding-right: var(--sp-3); gap: var(--sp-2); }
  .topbar__title {
    font-size: 1.05rem;
    white-space: normal;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  /* Skrin penuh dipindah ke Tetapan pada telefon untuk beri ruang tajuk */
  .topbar [data-role="full"] { display: none; }
}

/* Skrin pendek (telefon mendatar): modal lebih padat */
@media (max-height: 500px) {
  .modal { padding: var(--sp-4); }
  .modal__title { margin-bottom: var(--sp-2); font-size: var(--text-lg); }
  .field { margin-bottom: var(--sp-2); }
  .modal__actions { margin-top: var(--sp-3); }
  .avatar-picker { grid-template-columns: repeat(4, 64px); justify-content: center; }
  .lulu-say { margin-bottom: var(--sp-3); }
  .lulu-say__char { width: 72px; }
}

/* ---------- Ujian kandungan (Peringkat 2) ---------- */
.ct-h2 { font-size: var(--text-lg); font-weight: 900; }
.ct-voice { margin-bottom: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.ct-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-3); }
.ct-stat { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-3) var(--sp-4); background: var(--c-bg); border-radius: var(--radius-md); }
.ct-stat__label { font-size: var(--text-sm); color: var(--c-ink-soft); }
.ct-stat strong { font-size: var(--text-lg); overflow-wrap: anywhere; }
.ct-warn { color: var(--c-action-dark); font-size: var(--text-sm); font-weight: 800; }
.ct-select { width: 100%; font-size: var(--text-base); }

.ct-toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.ct-toolbar__right { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.ct-tabs { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.ct-tabs .btn { font-size: var(--text-base); }
.ct-tab-ar { font-size: 1.2em; line-height: 1.4; }
.ct-bands { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.ct-band { min-height: 44px; padding: 0 var(--sp-4); cursor: pointer; }
.ct-progress { color: var(--c-ink-soft); margin-bottom: var(--sp-3); }

.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-5); }
.ct-card {
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 4px solid transparent;
  transition: border-color var(--dur-fast);
}
.ct-card.is-playing { border-color: var(--c-accent); }
.ct-card__top { display: flex; gap: var(--sp-4); align-items: center; }
.ct-card__img { width: 96px; height: 96px; flex: 0 0 auto; background: var(--c-bg); border-radius: var(--radius-md); padding: 6px; }
.ct-card__letter { display: grid; place-items: center; width: 96px; height: 96px; flex: 0 0 auto; background: var(--c-primary-soft); border-radius: var(--radius-md); color: var(--c-primary-dark); }
.ct-card__letter .ar { font-size: 3.4rem; line-height: 1.5; }
.ct-card__words { display: flex; flex-direction: column; min-width: 0; flex: 1; align-items: flex-end; text-align: right; }
.ct-card__ar { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.8rem); line-height: 1.7; }
.ct-card__rumi { font-size: var(--text-sm); color: var(--c-ink-soft); font-style: normal; }
.ct-card__bm { font-size: var(--text-base); font-weight: 900; }
.ct-card__chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ct-chip-ar { font-size: 1.05em; line-height: 1.2; padding: 0; }
.ct-syl { display: flex; gap: 6px; flex-wrap: wrap; }
.ct-syl__tile { display: grid; place-items: center; min-width: 56px; padding: 2px 12px; background: #FFF1C7; border-radius: var(--radius-sm); box-shadow: 0 3px 0 #F0DC9E; }
.ct-syl__tile .ar { font-size: 1.6rem; line-height: 1.6; }
.ct-card__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.ct-play { font-size: var(--text-base); padding: 0 var(--sp-4); }
.ct-play__icon { display: inline-block; width: 24px; height: 24px; }
.ct-play--icon { padding: 0; width: var(--tap-min); flex: 0 0 auto; }
.ct-sent { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-3); background: var(--c-bg); border-radius: var(--radius-md); }
.ct-sent__label { flex: 0 0 auto; font-size: var(--text-sm); color: var(--c-primary-dark); font-family: var(--font-ar); background: var(--c-primary-soft); padding: 2px 10px; border-radius: var(--radius-pill); }
.ct-sent__text { display: flex; flex-direction: column; align-items: flex-end; flex: 1; min-width: 0; }
.ct-sent__ar { font-size: 1.5rem; line-height: 1.7; flex: 1; text-align: right; }
.ct-sent__bm { font-size: var(--text-sm); color: var(--c-ink-soft); }

.ct-issues { margin-bottom: var(--sp-4); }
.ct-issues summary { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; cursor: pointer; min-height: var(--tap-min); list-style: none; }
.ct-issues summary::-webkit-details-marker { display: none; }
.ct-issue-list { margin: var(--sp-3) 0 0; padding-left: var(--sp-5); font-size: var(--text-sm); font-weight: 700; }
.ct-ok { margin-top: var(--sp-3); color: var(--c-success-dark); }
.ct-hint { font-size: var(--text-sm); color: var(--c-ink-soft); margin: var(--sp-2) 0; }
.ct-manifest { width: 100%; min-height: 200px; padding: var(--sp-3); font-size: 0.95rem; font-family: var(--font-ar), monospace; line-height: 1.8; }

/* ---------- Peringkat 5: Misi Lulu, pintu salam ---------- */
.quest-banner {
  display: flex; align-items: center; gap: var(--sp-4); width: 100%; min-height: 96px;
  padding: var(--sp-3) var(--sp-5); margin-bottom: var(--sp-5);
  background: linear-gradient(100deg, #1E8C8A, #27A3A0); color: #fff; border-radius: var(--radius-lg);
  box-shadow: 0 6px 0 var(--c-primary-dark); text-align: left; transition: transform var(--dur-fast);
}
.quest-banner:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--c-primary-dark); }
.quest-banner__lulu { width: 76px; height: 76px; flex: none; }
.quest-banner__lulu svg { width: 100%; height: 100%; }
.quest-banner__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.quest-banner__title { font-size: var(--text-xl); font-weight: 900; }
.quest-banner__sub { font-size: var(--text-sm); opacity: 0.9; font-weight: 700; }
.quest-banner__go { width: 56px; height: 56px; flex: none; background: var(--c-accent); color: var(--c-ink); border-radius: 50%; padding: 14px; }
.quest-banner__go svg { width: 100%; height: 100%; }

.quests { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-4); }
.quest-card { flex-direction: column; gap: var(--sp-2); min-height: 190px; animation: pop-in var(--dur-base) var(--ease-bounce) both; }
.quest-card__pic { width: 96px; height: 96px; display: grid; place-items: center; }
.quest-card__pic img { width: 100%; height: 100%; object-fit: contain; }
.quest-card__pic .ar { font-size: 64px; color: var(--c-primary-dark); }
.quest-card__word { font-size: var(--text-ar-label); }
.quest-card.is-done { background: #F2FAF2; }
.chip--done { background: #E3F4E3; color: #2E7D32; }
@media (orientation: landscape) and (max-height: 500px) {
  .quest-banner { min-height: 72px; margin-bottom: var(--sp-3); }
  .quest-banner__lulu { width: 56px; height: 56px; }
  .quests { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .quest-card { min-height: 150px; }
  .quest-card__pic { width: 70px; height: 70px; }
}
.screen__inner.is-enter { animation: pop-in var(--dur-slow) var(--ease-bounce) both; }

.door { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-4); padding: var(--sp-5) var(--sp-4); text-align: center; }
.door__scene { position: relative; width: min(520px, 92vw); display: flex; align-items: flex-end; justify-content: center; gap: var(--sp-3); }
.door__house { width: min(260px, 48vw); transition: transform 0.6s var(--ease-out); }
.door__house .house__art { max-width: none; }
.door__lulu { width: min(140px, 26vw); flex: none; }
.door__lulu svg { width: 100%; height: auto; }
.door__reply { position: absolute; top: 0; left: 50%; transform: translateX(-50%); font-size: var(--text-ar-label); animation: pop-in var(--dur-base) var(--ease-bounce); }
.door__say { font-weight: 800; color: var(--c-ink); font-size: var(--text-lg); margin: 0; max-width: 36ch; }
.door__choices { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3); }
.door__choice { font-size: var(--text-ar-label); min-height: 64px; padding: 4px 28px; }
.door.is-open .door__house { transform: scale(1.35); }
.door.is-open { animation: fade-in 0.6s reverse both; }
@media (orientation: landscape) and (max-height: 500px) {
  .door { gap: var(--sp-2); padding: var(--sp-2); }
  .door__house { width: 150px; } .door__lulu { width: 90px; }
  .door__say { font-size: var(--text-base); }
}
/* Pilihan dialog di luar kawasan main (pintu) */
.door .dl__choice { background: var(--c-surface); border: 3px solid var(--c-line); border-radius: 20px; box-shadow: 0 4px 0 var(--c-line); color: var(--c-ink); }
.door .dl__bubble { padding: 8px 22px; border-radius: 22px; }

/* ---------- Peringkat 6: album, zon ibu bapa, pintu, laporan ---------- */
.btn--sm { min-height: var(--tap-min); padding: 0 var(--sp-4); font-size: var(--text-base); }
.village-head__right { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
.album-btn { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap-min); padding: 0 14px; border-radius: var(--radius-pill); background: var(--c-surface); box-shadow: var(--shadow-card); font-weight: 800; color: var(--c-ink); position: relative; }
.album-btn svg { width: 26px; height: 26px; color: var(--c-primary); }
.album-btn__n { background: var(--c-action); color: #fff; border-radius: 99px; font-size: 13px; min-width: 24px; height: 24px; display: inline-grid; place-items: center; padding: 0 6px; }

.album__sec { margin-bottom: var(--sp-5); }
.album__title { font-size: var(--text-lg); display: flex; align-items: baseline; gap: 8px; margin: 0 0 var(--sp-3); }
.album__title .ar { font-size: var(--text-ar-label); color: var(--c-primary-dark); }
.album__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--sp-3); }
.stk { aspect-ratio: 0.85; border-radius: 20px; background: rgba(255,255,255,.55); border: 3px dashed var(--c-line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px; }
.stk.is-got { background: #fff; border: 0; box-shadow: 0 0 0 5px #FFC845, 0 6px 0 rgba(0,0,0,.08); animation: pop-in var(--dur-base) var(--ease-bounce) both; }
.stk.is-got:nth-child(odd) { transform: rotate(-3deg); } .stk.is-got:nth-child(even) { transform: rotate(2deg); }
.stk img { width: 70%; aspect-ratio: 1; object-fit: contain; }
.stk__word { font-size: var(--text-ar-label); }
.stk__ar { font-size: 56px; color: var(--c-primary-dark); }
.stk__stars { color: #E0A800; letter-spacing: 2px; font-size: 14px; }
.stk__q { font-size: 44px; font-weight: 900; color: var(--c-line); }

.gate { text-align: center; }
.gate__hint { margin: 0; color: var(--c-ink-soft); font-weight: 700; }
.gate__q { font-size: var(--text-xl); font-weight: 900; margin: 8px 0; }
.gate__display { font-size: 34px; font-weight: 900; min-height: 56px; border-radius: 16px; background: var(--c-bg); display: grid; place-items: center; margin: 0 auto 6px; width: 140px; }
.gate__display.is-wrong { animation: gate-shake 0.45s; }
.gate__msg { min-height: 1.3em; margin: 0 0 6px; color: var(--c-action-dark); font-weight: 700; font-size: var(--text-sm); }
.gate__pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 8px; justify-content: center; }
.gate__key { height: 60px; border-radius: 16px; background: var(--c-surface); box-shadow: 0 4px 0 var(--c-line); font-size: 24px; font-weight: 900; color: var(--c-ink); border: 2px solid var(--c-line); }
.gate__key:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--c-line); }
.gate__key--soft { font-size: 15px; }
.gate__key--ok { background: var(--c-primary); color: #fff; border-color: var(--c-primary-dark); box-shadow: 0 4px 0 var(--c-primary-dark); }
@keyframes gate-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@media (orientation: landscape) and (max-height: 500px) {
  .gate { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; text-align: left; }
  .gate__pad { grid-column: 2; grid-row: 1 / span 4; grid-template-columns: repeat(3, 60px); }
  .gate__key { height: 40px; font-size: 20px; }
  .gate__pad { gap: 5px; }
  .gate__q { font-size: var(--text-lg); margin: 2px 0; }
  .gate__display { margin: 0; min-height: 44px; font-size: 26px; }
  .modal:has(.gate) { padding-block: 10px; }
  .modal:has(.gate) .modal__title { font-size: var(--text-base); margin-bottom: 4px; }
  .modal:has(.gate) .modal__actions { margin-top: 6px; }
}
.gate-wait { text-align: center; padding-top: 10vh; color: var(--c-ink-soft); font-weight: 700; }
.gate-wait__icon { width: 64px; height: 64px; margin: 0 auto; color: var(--c-primary); }

.pz-intro { color: var(--c-ink-soft); font-weight: 700; margin: 0 0 var(--sp-4); }
.pz-card { background: var(--c-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: var(--sp-4); margin-bottom: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.pz-card__head { display: flex; align-items: center; gap: var(--sp-3); }
.pz-card__who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pz-card__who span { color: var(--c-ink-soft); font-size: var(--text-sm); font-weight: 700; }
.pz-card__stats { margin: 0; font-weight: 700; color: var(--c-ink-soft); font-size: var(--text-sm); }
.pz-card__actions, .pz-dev { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.pz-danger { --btn-fg: var(--c-action-dark); }
.pz-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); justify-content: space-between; border-top: 2px solid var(--c-line); padding-top: var(--sp-3); }
.pz-row__label { display: flex; align-items: center; gap: var(--sp-2); font-weight: 800; flex: 1 1 240px; }
.pz-row__label > span:last-child { display: flex; flex-direction: column; }
.pz-row__icon { width: 28px; height: 28px; flex: none; color: var(--c-primary); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg__btn { min-height: 48px; padding: 0 14px; border-radius: 99px; background: var(--c-bg); border: 2px solid var(--c-line); font-weight: 800; color: var(--c-ink); }
.seg__btn.is-on { background: var(--c-primary); border-color: var(--c-primary-dark); color: #fff; }

.report { max-width: 980px; margin-inline: auto; }
.tp.tp--na { background: transparent; color: var(--c-line); text-align: center; }
.rp-head { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.rp-head__logo { width: 220px; } .rp-head__logo svg { width: 100%; height: auto; }
.rp-head__who h2 { margin: 0; font-size: var(--text-2xl); }
.rp-head__who p { margin: 2px 0 0; color: var(--c-ink-soft); font-weight: 700; }
.rp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); margin: var(--sp-4) 0; }
.rp-kpi { background: var(--c-surface); border-radius: var(--radius-md); padding: var(--sp-3); box-shadow: var(--shadow-card); display: flex; flex-direction: column; }
.rp-kpi strong { font-size: var(--text-xl); font-variant-numeric: tabular-nums; }
.rp-kpi span { font-size: var(--text-sm); color: var(--c-ink-soft); font-weight: 700; }
.rp-sub { margin: var(--sp-4) 0 var(--sp-2); font-size: var(--text-lg); }
.rp-table-wrap { overflow-x: auto; }
.rp-table { width: 100%; border-collapse: separate; border-spacing: 6px; min-width: 560px; table-layout: fixed; }
.rp-table thead th:first-child { width: 17%; }
.rp-table th { text-align: left; font-size: var(--text-sm); color: var(--c-ink-soft); padding: 4px 6px; }
.rp-table tbody th { color: var(--c-ink); font-size: var(--text-base); }
.tp { border-radius: 12px; padding: 8px 10px; vertical-align: top; background: #F1EEE8; }
.tp__label { display: block; font-weight: 800; font-size: var(--text-sm); line-height: 1.25; }
.tp__num { display: block; font-size: 12px; opacity: 0.75; font-weight: 700; margin-top: 2px; }
.tp--0 { color: var(--c-ink-soft); background: repeating-linear-gradient(45deg, #F4F1EB, #F4F1EB 6px, #EFEBE3 6px, #EFEBE3 12px); }
.tp--1 { background: #FFE2D8; color: #8A2E12; }
.tp--2 { background: #FFF1C7; color: #6E5200; }
.tp--3, .tp--4 { background: #DFF2DF; color: #1F5F22; }
.tp--5, .tp--6 { background: #CDEBEA; color: #0F5553; }
.rp-lists { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-top: var(--sp-4); }
.rp-list { background: var(--c-surface); border-radius: var(--radius-md); padding: var(--sp-3); box-shadow: var(--shadow-card); }
.rp-list h3 { margin: 0 0 var(--sp-2); font-size: var(--text-base); }
.rp-list--need h3 { color: #8A2E12; } .rp-list--ok h3 { color: #1F5F22; }
.rp-words { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-word { display: inline-flex; flex-direction: column; align-items: center; background: var(--c-bg); border-radius: 12px; padding: 4px 10px; }
.rp-word .ar { font-size: 24px; } .rp-word small { font-size: 11px; color: var(--c-ink-soft); font-weight: 700; }
.rp-empty { margin: 0; font-size: var(--text-sm); color: var(--c-ink-soft); }
.rp-note { font-size: 12.5px; color: var(--c-ink-soft); margin: var(--sp-4) 0; line-height: 1.5; }
.rp-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
@media (max-width: 640px) { .rp-kpis { grid-template-columns: 1fr 1fr; } .rp-lists { grid-template-columns: 1fr; } .rp-head__logo { width: 160px; } }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  #topbar, #hills, .no-print, .toast-host, .rotate-hint { display: none !important; }
  .screen, section { overflow: visible !important; position: static !important; height: auto !important; }
  .report { max-width: none; padding: 0 !important; }
  .rp-kpi, .rp-list { box-shadow: none; border: 1px solid #ddd; }
  .tp, .rp-kpi, .rp-list, .rp-word { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rp-table { min-width: 0; }
}

/* ---------- Peringkat 8: pengaktifan & halaman maklumat ---------- */
.act { text-align: center; max-width: 520px; }
.act__lulu { width: 120px; margin: 0 auto; }
.act__title { font-size: var(--text-xl); font-weight: 900; margin: var(--sp-2) 0; }
.act__lead { color: var(--c-ink-soft); font-weight: 700; margin: 0 0 var(--sp-5); }
.act__form { display: flex; flex-direction: column; gap: var(--sp-2); text-align: left; background: var(--c-surface); padding: var(--sp-5); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.act__input { text-align: center; letter-spacing: 0.04em; font-size: clamp(16px, 4.6vw, 22px); padding: 0 8px; font-family: ui-monospace, "Nunito", monospace; text-transform: uppercase; width: 100%; }
.act__input.is-bad { border-color: var(--c-action); animation: gate-shake 0.35s; }
.act__msg { min-height: 1.4em; margin: 0 0 var(--sp-2); color: #B8431F; font-weight: 800; font-size: var(--text-sm); text-align: center; }
.act__help { font-size: var(--text-sm); color: var(--c-ink-soft); margin: var(--sp-4) 0 var(--sp-3); }
.info { line-height: 1.6; }
.info__title { font-size: var(--text-xl); font-weight: 900; margin: 0 0 var(--sp-3); }
.info__h { font-size: var(--text-lg); font-weight: 900; margin: var(--sp-5) 0 var(--sp-2); color: var(--c-primary); }
.info__sec p { margin: 0 0 var(--sp-2); }
.info__sec ul { margin: 0 0 var(--sp-2); padding-left: 1.3em; }
.info__sec li { margin-bottom: 6px; }
.info__nav { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; margin-top: var(--sp-6); }
.info__hero { display: flex; gap: var(--sp-4); align-items: center; margin-bottom: var(--sp-4); }
.info__lulu { width: 96px; flex: none; }
.contact-card { background: var(--c-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-3); display: grid; gap: 4px; }
.contact-card__label { font-size: var(--text-sm); color: var(--c-ink-soft); font-weight: 800; }
.contact-card__value { font-size: var(--text-lg); word-break: break-all; }
.contact-card__actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-2); }
@media (max-height: 480px) and (orientation: landscape) {
  .act__lulu { display: none; }
  .act__lead { margin-bottom: var(--sp-3); }
  .act__form { padding: var(--sp-3) var(--sp-4); }
}
