/* Hijaiyah: kartu huruf, tebak huruf, harakat, susun kata */
.hj { --hj: #0f766e; --hj-soft: #ccfbf1; }
.hj-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: clamp(8px, 1.6vw, 18px); overflow-y: auto; overflow-x: hidden; background: linear-gradient(180deg, #f0fdfa, #fff 60%); -webkit-overflow-scrolling: touch; }
.hj-view { display: flex; flex-direction: column; gap: clamp(8px, 1.6vh, 16px); flex: 1; min-height: 0; }
.hj-view[hidden] { display: none; }
.hj-hud { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.hj-hud:empty { display: none; }
.hj-chip { background: #fff; border: 3px solid var(--c); color: var(--ink); border-radius: 999px; padding: 2px 14px; font-weight: 800; font-size: clamp(13px, 1.6vw, 19px); display: inline-flex; gap: 8px; align-items: baseline; }
.hj-chip b { font-size: 1.2em; font-variant-numeric: tabular-nums; }
.hj-chip.on { background: var(--c); color: #fff; }
.hj-qn { font-weight: 800; color: var(--muted); font-size: clamp(13px, 1.5vw, 17px); margin-left: 6px; }
.hj-ask { text-align: center; font-weight: 800; color: var(--ink); font-size: clamp(15px, 2.2vw, 26px); }
.hj-ask small { color: var(--muted); font-weight: 700; }
.hj-tip { margin: 0; text-align: center; color: var(--muted); font-weight: 700; font-size: clamp(13px, 1.6vw, 18px); }

/* belajar */
.hj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(72px, 12vw, 120px), 1fr)); gap: clamp(6px, 1vw, 12px); align-content: start; flex: 1; }
.hj-card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: clamp(78px, 14vh, 130px); padding: 4px 4px 6px; background: #fff; border: 3px solid var(--hj-soft); border-radius: 18px; cursor: pointer; color: var(--ink); font: inherit; }
.hj-card:hover { border-color: var(--hj); }
.hj-card small { font-weight: 800; font-size: clamp(11px, 1.3vw, 15px); color: var(--muted); }
.hj-card.seen { background: var(--hj-soft); border-color: var(--hj); }
.hj-card.seen::after { content: "\2713"; position: absolute; top: 3px; left: 8px; color: var(--hj); font-weight: 900; font-size: 14px; }
.hj-cl { font-size: clamp(34px, 5.4vw, 58px); line-height: 1.5; margin-bottom: 8px; }
.hj-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 8px 0 2px; background: #fff; border-top: 2px solid var(--line); margin: 0 calc(-1 * clamp(8px, 1.6vw, 18px)); padding-left: 8px; padding-right: 8px; }
.hj-prog { font-weight: 800; color: var(--muted); font-size: clamp(13px, 1.5vw, 17px); }
.hj-done { margin-top: 0; min-height: 48px; padding: 0 26px; font-size: clamp(16px, 1.8vw, 20px); }

/* kuis pilihan */
.hj-prompt { display: flex; align-items: center; justify-content: center; min-height: clamp(110px, 24vh, 240px); background: #fff; border: 4px solid var(--hj); border-radius: 26px; padding: 6px 12px; }
.hj-ask { --c: var(--hj); }
.hj-pl { font-size: clamp(76px, 18vh, 190px); line-height: 1.5; color: var(--ink); }
.hj-pn { font-family: var(--font); font-weight: 800; font-size: clamp(34px, 7vh, 76px); color: var(--ink); text-align: center; line-height: 1.2; }
.hj-opts { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(8px, 1.4vw, 16px); }
@media (min-width: 900px) and (min-aspect-ratio: 5/3) { .hj-opts { grid-template-columns: repeat(4, 1fr); } }
.hj-opt { position: relative; min-height: clamp(62px, 11vh, 110px); padding: 6px 12px; border-radius: 20px; border: 4px solid var(--hj-soft); background: #fff; color: var(--ink); font: 800 clamp(20px, 3.2vw, 38px)/1.2 var(--font); cursor: pointer; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hj-opt:hover:not(:disabled) { border-color: var(--hj); }
.hj-opt kbd { position: absolute; top: 4px; left: 8px; font: 800 12px var(--font); color: var(--muted); opacity: .7; }
.hj-opt.isar { font-size: clamp(30px, 5vw, 56px); }
.hj-ol { font-size: clamp(44px, 8.5vh, 80px); line-height: 1.4; }
.hj-opt:disabled { cursor: default; }
.hj-opt.good, .hj-slot.good { background: #bbf7d0; border-color: var(--ok); }
.hj-opt.bad, .hj-slot.bad { background: #fecdd3; border-color: var(--bad); }
.hj-fb { min-height: 1.4em; text-align: center; font-weight: 800; color: var(--muted); font-size: clamp(14px, 1.8vw, 21px); line-height: 1.35; }
.hj-fb.ok { color: var(--ok); } .hj-fb.bad { color: var(--bad); }
.hj-next { align-self: center; margin-top: 0; min-height: 52px; padding: 0 34px; font-size: clamp(18px, 2vw, 24px); }
.hj-next[hidden], .hj-clear[hidden], .hj-joined[hidden] { display: none; }

/* susun kata */
.hj-slots, .hj-tiles { display: flex; flex-wrap: wrap; gap: clamp(6px, 1.2vw, 14px); justify-content: center; }
.hj-slot { width: clamp(58px, 11vw, 104px); height: clamp(72px, 15vh, 130px); border: 4px dashed #94a3b8; border-radius: 18px; background: #fff; display: grid; place-items: center; padding: 0; cursor: pointer; color: var(--ink); }
.hj-slot.on { border-style: solid; border-color: var(--hj); background: var(--hj-soft); }
.hj-tile { width: clamp(58px, 11vw, 104px); height: clamp(72px, 15vh, 130px); border: 4px solid var(--hj); border-radius: 18px; background: #fff; display: grid; place-items: center; padding: 0; cursor: pointer; color: var(--ink); box-shadow: 0 5px 0 rgba(15,118,110,.25); }
.hj-tile:disabled { opacity: .25; cursor: default; box-shadow: none; }
.hj-tl { font-size: clamp(40px, 8vh, 78px); line-height: 1.5; }
.hj-joined { text-align: center; background: #fff; border: 4px solid var(--ok); border-radius: 22px; padding: 4px 12px 8px; }
.hj-word { display: block; font-size: clamp(54px, 11vh, 110px); line-height: 1.5; color: var(--ink); }
.hj-mean { display: block; font-weight: 800; color: var(--muted); font-size: clamp(14px, 1.8vw, 20px); }
.hj-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hj-clear { margin-top: 0; min-height: 46px; font-size: 16px; }

/* kartu detail */
.hj-detail { text-align: center; }
.hj-dtop { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 3vw, 28px); flex-wrap: wrap; padding-right: 36px; padding-left: 36px; }
.hj-big { font-size: clamp(64px, 16vh, 130px); line-height: 1.4; color: var(--hj); background: var(--hj-soft); border-radius: 28px; padding: 0 clamp(18px, 4vw, 38px); }
.hj-dname h2 { margin: 0; font-size: clamp(28px, 5vw, 48px); }
.hj-dname p { margin: 2px 0 0; font-weight: 800; color: var(--hj); }
.hj-how { margin: 10px 0 0 !important; text-align: left; }
.hj-forms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hj-har { grid-template-columns: repeat(3, 1fr); }
.hj-f { background: var(--sky-50); border: 2px solid var(--line); border-radius: 16px; padding: 4px 4px 6px; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.hj-f span:first-child { font-weight: 800; font-size: clamp(11px, 1.4vw, 14px); color: var(--muted); }
.hj-f b { font-size: clamp(15px, 2vw, 20px); color: var(--ink); }
.hj-f.wide { grid-column: 1 / -1; }
.hj-fl { font-size: clamp(32px, 6vh, 52px); line-height: 1.5; color: var(--ink); }
.hj-note { margin: 8px 0 0 !important; font-size: clamp(12px, 1.5vw, 16px) !important; }
.hj-detail .actions { position: static; background: none; }
.hj-detail .actions .primary, .hj-detail .actions .secondary { min-height: 50px; font-size: 18px; padding: 0 24px; }
.hj-names { display: grid; gap: 6px; }
.hj-names input { font: 700 16px var(--font); padding: 8px 14px; border: 2px solid var(--line); border-radius: 999px; min-width: 0; width: 100%; box-sizing: border-box; text-align: center; }
.hj-names input[hidden] { display: none; }
.hj-recap { display: flex; flex-direction: column; gap: 4px; font-size: clamp(15px, 2vw, 22px); margin-bottom: 4px; }

@media (max-height: 520px) {
  .hj-wrap { gap: 4px; padding: 4px 8px; }
  .hj-prompt { min-height: 72px; border-width: 3px; }
  .hj-pl { font-size: clamp(48px, 16vh, 90px); }
  .hj-opt { min-height: 48px; border-width: 3px; }
  .hj-opts { grid-template-columns: repeat(4, 1fr); }
  .hj-slot, .hj-tile { height: 62px; }
  .hj-tl { font-size: 38px; }
  .hj-word { font-size: 56px; }
  .hj-card { min-height: 64px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
