@font-face { font-family: 'Nunito'; src: url(fonts/nunito-latin.woff2) format('woff2'); font-weight: 500 800; font-display: swap; }

/* Colours: orange is the app's colour ("temanya harus FUN", docs/produk.md → Identitas). Orange is only for identity
   (buttons, headers, icon) and never inside the Peta Kemampuan grid. Because orange is close to Kaliku's "salah"
   orange and salmon, salah and Belum bisa are a true red here. Mode accents: Pilih Jawaban orange, Ketik Jam violet,
   Atur Jarum blue (none of them red, yellow or green: those mean Tingkat). */
:root {
  --bg: #FFF7F0; --card: #FFFFFF; --ink: #2B1A10; --muted: #6E5A4C; --line: #F0DFD2; --line-soft: #F8EDE4;
  --brand: #EA580C; --brand-dark: #C2410C; --brand-soft: #FFEDD5; --brand-ink: #9A3412; --on-brand: #FFFFFF;
  --violet: #7C3AED; --violet-dark: #5B21B6; --violet-soft: #EDE9FE; --violet-ink: #5B21B6; --on-violet: #FFFFFF;
  --sky: #2563EB; --sky-dark: #1D4ED8; --sky-soft: #E3ECFD; --sky-ink: #1D4ED8; --on-sky: #FFFFFF;
  --m1: var(--brand); --m2: var(--violet); --m3: var(--sky);
  --ok: #15803D; --ok-ink: #166534; --ok-soft: #DCFCE7;
  --bad: #DC2626; --bad-ink: #B91C1C; --bad-soft: #FEF2F2;
  --gold: #FFD23F; --key-shadow: #E9D5C4;
  --l0: #ECE7E2; --l1: #EF4444; --l2: #FACC15; --l3: #1F9254; --on-l1: #FFFFFF; --on-l2: #422006; --on-l3: #FFFFFF;
  --face: #FFFFFF; --hand: #2B1A10; --hand-h: #EA580C; --hand-m: #2563EB; --wedge: rgba(234, 88, 12, .14);
  --shadow: 0 1px 3px rgba(67, 20, 7, .10);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17110D; --card: #2A201A; --ink: #F6ECE4; --muted: #BBA797; --line: #44352B; --line-soft: #33271F;
    --brand: #FB923C; --brand-dark: #F97316; --brand-soft: #4A2412; --brand-ink: #FFD3B0; --on-brand: #2B1206;
    --violet: #A78BFA; --violet-dark: #8B5CF6; --violet-soft: #2E1F5E; --violet-ink: #DDD3FF; --on-violet: #150B33;
    --sky: #60A5FA; --sky-dark: #3B82F6; --sky-soft: #1E3A8A; --sky-ink: #DBE7FF; --on-sky: #0B1530;
    --ok: #34B86E; --ok-ink: #86EFAC; --ok-soft: #12351F;
    --bad: #F87171; --bad-ink: #FCA5A5; --bad-soft: #3B1414;
    --key-shadow: #0E0906;
    --l0: #44352B; --l1: #E5534B; --l2: #E8C24E; --l3: #34B86E; --on-l1: #FFFFFF; --on-l2: #2A1D02; --on-l3: #06210F;
    --face: #F8F1EA; --hand: #2B1A10; --hand-h: #EA580C; --hand-m: #2563EB; --wedge: rgba(234, 88, 12, .2);
    --shadow: 0 1px 3px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17110D; --card: #2A201A; --ink: #F6ECE4; --muted: #BBA797; --line: #44352B; --line-soft: #33271F;
  --brand: #FB923C; --brand-dark: #F97316; --brand-soft: #4A2412; --brand-ink: #FFD3B0; --on-brand: #2B1206;
  --violet: #A78BFA; --violet-dark: #8B5CF6; --violet-soft: #2E1F5E; --violet-ink: #DDD3FF; --on-violet: #150B33;
  --sky: #60A5FA; --sky-dark: #3B82F6; --sky-soft: #1E3A8A; --sky-ink: #DBE7FF; --on-sky: #0B1530;
  --ok: #34B86E; --ok-ink: #86EFAC; --ok-soft: #12351F;
  --bad: #F87171; --bad-ink: #FCA5A5; --bad-soft: #3B1414;
  --key-shadow: #0E0906;
  --l0: #44352B; --l1: #E5534B; --l2: #E8C24E; --l3: #34B86E; --on-l1: #FFFFFF; --on-l2: #2A1D02; --on-l3: #06210F;
  --face: #F8F1EA; --hand: #2B1A10; --hand-h: #EA580C; --hand-m: #2563EB; --wedge: rgba(234, 88, 12, .2);
  --shadow: 0 1px 3px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: Nunito, system-ui, sans-serif; font-size: 16px; line-height: 1.4;
  -webkit-text-size-adjust: 100%; overscroll-behavior-y: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
a { color: var(--brand-ink); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.ic { display: inline-flex; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.center { text-align: center; }
.grow { flex: 1 1 auto; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Mode accent: orange by default (also for popups, which sit outside the screen), or set on a screen with
   .m-pilih / .m-ketik / .m-atur. */
:root, .m-pilih { --acc: var(--brand); --acc-dark: var(--brand-dark); --acc-soft: var(--brand-soft); --acc-ink: var(--brand-ink); --on-acc: var(--on-brand); }
.m-ketik { --acc: var(--violet); --acc-dark: var(--violet-dark); --acc-soft: var(--violet-soft); --acc-ink: var(--violet-ink); --on-acc: var(--on-violet); }
.m-atur { --acc: var(--sky); --acc-dark: var(--sky-dark); --acc-soft: var(--sky-soft); --acc-ink: var(--sky-ink); --on-acc: var(--on-sky); }

/* ---------- screen frame ---------- */
.screen {
  max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; gap: 16px;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
}
.topbar { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.topbar .title { font-size: 22px; font-weight: 800; flex: 1; min-width: 0; }
.round-btn {
  flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--card); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.brand .logo { width: 36px; height: 36px; border-radius: 11px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; }

.card { background: var(--card); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); }
.section-label { font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; padding: 4px 4px 0; }
.h1 { font-size: 28px; font-weight: 800; margin: 0; }
.h2 { font-size: 18px; font-weight: 800; margin: 0; }

.btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%;
  min-height: 60px; border-radius: 18px; padding: 12px 16px; font-size: 20px; font-weight: 800; text-decoration: none;
}
.btn .row { display: flex; align-items: center; gap: 10px; }
.btn small { font-size: 13px; font-weight: 700; opacity: .9; }
.btn.primary { background: var(--acc); color: var(--on-acc); box-shadow: 0 3px 0 var(--acc-dark); }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--acc-dark); }
.btn.primary:disabled { opacity: .45; box-shadow: none; }
.btn.secondary { background: var(--acc-soft); color: var(--acc-ink); font-size: 18px; min-height: 56px; }
.btn.secondary.danger { background: var(--card); border: 2px solid var(--line); color: var(--bad); }
.link-btn { color: var(--brand-ink); font-weight: 800; font-size: 15px; padding: 10px 6px; }
.link-btn.danger { color: var(--bad); }
:root[data-theme="dark"] .link-btn:not(.danger) { color: var(--brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .link-btn:not(.danger) { color: var(--brand); } }

/* ---------- avatars / players ---------- */
.av { flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.av.lg { width: 80px; height: 80px; font-size: 44px; }
.av.md { width: 38px; height: 38px; font-size: 21px; }
.players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.player-card {
  width: 100%; background: var(--card); border-radius: 22px; padding: 22px 12px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 20px; font-weight: 800;
  overflow-wrap: anywhere; text-align: center;
}
.player-wrap { position: relative; display: grid; }
.player-wrap .player-edit { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; background: var(--line-soft); box-shadow: none; color: var(--muted); }
.player-card.add { background: transparent; border: 2px dashed var(--line); box-shadow: none; color: var(--brand-ink); }
.player-card.add .av { background: var(--brand-soft); color: var(--brand-ink); }
.who-pill {
  display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px 0 5px; background: var(--card);
  border-radius: 999px; box-shadow: var(--shadow); font-weight: 800; font-size: 17px; min-width: 0;
}
.who-pill .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; gap: 10px; flex: none; margin-left: auto; }
.topbar-actions .on { color: var(--gold); }
:root:not([data-theme="dark"]) .topbar-actions .on { color: #E0A800; }
.avatar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.avatar-opt { aspect-ratio: 1.4; border-radius: 20px; font-size: 36px; border: 3px solid transparent; display: flex; align-items: center; justify-content: center; }
.avatar-opt[aria-pressed="true"] { border-color: var(--brand); }
.text-input {
  width: 100%; height: 56px; border-radius: 16px; border: 2px solid var(--line); background: var(--card);
  padding: 0 16px; font-size: 20px; font-weight: 700;
}
.text-input:focus { border-color: var(--brand); outline: none; }

/* ---------- Beranda ---------- */
.hello p { margin: 2px 0 0; font-size: 16px; font-weight: 600; }
.peta-card {
  display: flex; flex-direction: column; gap: 12px; width: 100%; text-align: left; background: var(--brand); color: var(--on-brand);
  border-radius: 20px; padding: 16px;
}
.peta-card .head { display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 800; }
.peta-card .head .grow { flex: 1; }
.peta-card .head small { font-size: 15px; font-weight: 700; }
.peta-card .big { display: flex; align-items: baseline; gap: 6px; font-weight: 700; }
.peta-card .big b { font-size: 34px; line-height: 1; font-weight: 800; }
.peta-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: rgba(255, 255, 255, .25); }
.peta-bar .h { background: #FFFFFF; } .peta-bar .k { background: var(--l2); }
:root[data-theme="dark"] .peta-bar { background: rgba(11, 21, 48, .25); } :root[data-theme="dark"] .peta-bar .h { background: var(--on-brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .peta-bar { background: rgba(11, 21, 48, .25); } :root:not([data-theme="light"]) .peta-bar .h { background: var(--on-brand); } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.peta-card .chip { background: rgba(255, 255, 255, .2); border-radius: 12px; padding: 4px 10px; font-size: 14px; font-weight: 700; }
.mode-card {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; background: var(--card);
  border-radius: 20px; padding: 14px; box-shadow: var(--shadow); min-height: 92px;
}
.mode-card .tag { flex: none; width: 96px; height: 64px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 19px; background: var(--acc-soft); color: var(--acc-ink); }
.mode-card .txt { flex: 1; min-width: 0; }
.mode-card b { display: block; font-size: 19px; }
.mode-card small { display: block; font-size: 14px; color: var(--muted); font-weight: 600; }

/* ---------- pilih tabel ---------- */
.tbl {
  position: relative; height: 60px; border-radius: 16px; border: 2px solid var(--line); background: var(--card);
  font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.tbl[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); color: var(--on-acc); }
.tbl.campur { height: 56px; font-size: 18px; width: 100%; }
.stepper { display: flex; align-items: center; justify-content: space-between; }
.stepper button { width: 56px; height: 56px; border-radius: 50%; background: var(--acc-soft); color: var(--acc-ink); font-size: 28px; font-weight: 800; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.stepper button:disabled { opacity: .4; }
.stepper .num { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.seg.theme { gap: 4px; background: var(--line-soft); border-radius: 14px; padding: 4px; }
.seg.theme button { border-radius: 10px; min-height: 44px; font-size: 15px; font-weight: 800; color: var(--muted); }
.seg.theme button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- soal ---------- */
.progress { flex: 1; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; background: var(--acc); transition: width .3s; }
.count { font-size: 16px; font-weight: 800; color: var(--muted); min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.q-area { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; min-height: 220px; }
.mode-pill { font-size: 15px; font-weight: 800; color: var(--acc-ink); background: var(--acc-soft); border-radius: 12px; padding: 4px 12px; }
.right-msg { font-size: 26px; font-weight: 800; color: var(--ok-ink); }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.key {
  height: 64px; border-radius: 16px; background: var(--card); color: var(--ink); font-size: 30px; font-weight: 800;
  box-shadow: 0 3px 0 var(--key-shadow); display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.key:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--key-shadow); }
.key.erase { background: var(--acc-soft); color: var(--acc-ink); }
.key.ok { background: var(--acc); color: var(--on-acc); box-shadow: 0 3px 0 var(--acc-dark); font-size: 22px; }
.key:disabled { opacity: .45; }
.hl { background: var(--ok-soft); color: var(--ok-ink); border-radius: 14px; padding: 2px 14px; }

/* ---------- hasil ---------- */
.result-top { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding-top: 12px; }
.result-top .party { font-size: 48px; line-height: 1; }
.result-top .score { display: flex; align-items: baseline; gap: 6px; font-size: 18px; font-weight: 800; color: var(--muted); }
.result-top .score b { font-size: 44px; color: var(--acc-ink); }
.win-card { display: flex; align-items: center; gap: 14px; background: var(--acc); color: var(--on-acc); border-radius: 20px; padding: 16px; }
.win-card .em { font-size: 40px; line-height: 1; }
.win-card b { display: block; font-size: 20px; }
.win-card small { display: block; font-size: 14px; font-weight: 700; opacity: .92; }
.again-row { display: flex; justify-content: space-between; font-size: 17px; font-weight: 800; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.again-row:first-of-type { border-top: 0; }
.again-row .a { color: var(--ok-ink); }

/* ---------- Peta Kemampuan ---------- */
.lv0 { background: var(--l0); } .lv1 { background: var(--l1); color: var(--on-l1); } .lv2 { background: var(--l2); color: var(--on-l2); } .lv3 { background: var(--l3); color: var(--on-l3); }
.legend { display: flex; flex-direction: column; gap: 12px; }
.legend-row { display: flex; align-items: flex-start; gap: 10px; }
.legend-row b { display: block; font-size: 16px; font-weight: 800; }
.legend-row small { display: block; font-size: 14px; font-weight: 600; color: var(--muted); line-height: 1.35; }
.legend i { width: 24px; height: 24px; border-radius: 6px; flex: none; margin-top: 1px; display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 800; font-size: 14px; }
.legend .lv0 { box-shadow: inset 0 0 0 1px var(--line); }
.badge-chip { background: var(--brand-soft); color: var(--brand-ink); border-radius: 12px; padding: 6px 10px; font-size: 14px; font-weight: 800; }
.all-row { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: var(--muted); }
.all-row .bar { flex: 1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.all-row .bar i { display: block; height: 100%; background: var(--l3); }

/* ---------- settings / lists ---------- */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; font-weight: 700; }
.switch-row input { width: 26px; height: 26px; accent-color: var(--brand); flex: none; margin: 0; }
.list-card { background: var(--card); border-radius: 18px; padding: 4px 16px; box-shadow: var(--shadow); }
.list-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 0; text-align: left; color: var(--ink); text-decoration: none; font-weight: 700; }
.list-item .txt { flex: 1; min-width: 0; }
.hist-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.hist-row:last-child { border-bottom: 0; }
.hist-row .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.hist-row .txt { flex: 1; min-width: 0; }
.hist-row b { display: block; font-size: 16px; }
.hist-row small { display: block; color: var(--muted); font-size: 13px; font-weight: 600; }
.hist-row .score { text-align: right; font-size: 17px; font-weight: 800; }
.changelog h3 { font-size: 17px; margin: 14px 0 4px; }
.changelog ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 15px; }
.changelog li { margin: 3px 0; }

.info-pop { position: fixed; inset: 0; z-index: 30; background: rgba(8, 14, 30, .5); display: flex; align-items: center; justify-content: center; padding: 24px; }
.info-pop .card { max-width: 380px; width: 100%; gap: 10px; padding: 20px; }
.info-pop .info-title { font-size: 19px; }
.info-pop p { margin: 0; color: var(--muted); line-height: 1.5; }
.info-pop .btn { margin-top: 8px; }

.splash { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); text-align: center; padding: 24px; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 700;
  max-width: calc(100% - 32px); z-index: 10; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.install-hint {
  position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top)); transform: translate(-50%, -16px);
  width: min(440px, calc(100% - 24px)); z-index: 11; display: flex; align-items: center; gap: 10px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 10px 8px 10px 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .14); opacity: 0; transition: opacity .25s, transform .25s;
}
.install-hint.show { opacity: 1; transform: translate(-50%, 0); }
.install-hint img { border-radius: 9px; flex: none; }
.install-text { flex: 1; font-size: 14px; line-height: 1.35; font-weight: 600; }
.install-go { flex: none; border: 0; border-radius: 10px; padding: 9px 14px; background: var(--brand-dark); color: #fff; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.install-x { flex: none; border: 0; background: none; color: var(--muted); padding: 6px; display: grid; place-items: center; cursor: pointer; }
.update-hint { top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); }
.update-hint.show { transform: translate(-50%, 0); }
body.has-update { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

/* Touch targets: at least 48 × 48 px to tap, without changing how controls look (invisible ::after area). */
.link-btn, .player-edit { position: relative; }
.link-btn::after, .player-edit::after { content: ''; position: absolute; }
.link-btn::after { inset: -12px -4px; }
.player-edit::after { inset: -4px; }

/* ================================================================ Jago Jam components */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- the clock ---------- */
.clock { width: 100%; height: auto; display: block; touch-action: none; user-select: none; -webkit-user-select: none; overflow: visible; }
.clock .rim { fill: var(--brand); }
.clock .face { fill: var(--face); }
.clock .tick { stroke: #B9A595; stroke-width: 1.4; }
.clock .tick.big { stroke: #2B1A10; stroke-width: 3; }
.clock .nums text { font: 800 19px Nunito, system-ui, sans-serif; fill: #2B1A10; }
.clock .mins { display: none; }
.clock .mins text { font: 800 10.5px Nunito, system-ui, sans-serif; fill: var(--sky-ink); }
.clock .wedge { fill: transparent; }
.clock .hand line { stroke: var(--hand); stroke-linecap: round; }
.clock .hand.hour line { stroke-width: 9; }
.clock .hand.minute line { stroke-width: 5.5; }
.clock .hand { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.clock.dragging .hand { transition: none; }
.clock .pin { fill: var(--hand); }
/* Bantuan: minute numbers outside the face, coloured hands (pendek orange, panjang blue), the slice the hour hand is in. */
.clock.bantuan .mins { display: block; }
.clock.bantuan .hand.hour line { stroke: var(--hand-h); }
.clock.bantuan .hand.minute line { stroke: var(--hand-m); }
.clock.bantuan .wedge { fill: var(--wedge); }
.clock.interactive { cursor: grab; }
.clock.interactive .hand line { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.clock.grab-hour .hand.hour line, .clock.grab-minute .hand.minute line { stroke-width: 11; }
.clock.grab-minute .hand.minute line { stroke-width: 8; }
.clock.ok .rim { fill: var(--ok); }
.clock.wiggle { animation: wiggle .5s ease; }
@keyframes wiggle { 20% { transform: rotate(-6deg) scale(1.03); } 50% { transform: rotate(5deg) scale(1.04); } 80% { transform: rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { .clock .hand { transition: none; } .clock.wiggle { animation: none; } }
.clock-box { position: relative; width: min(270px, 72vw, 38vh); margin: 0 auto; padding: 14px; }
.clock-box.big { width: min(300px, 82vw, 44vh); }
.clock-box .bulb { position: absolute; right: -14px; top: 0; }
.bulb[aria-pressed="true"] { background: var(--gold); color: #422006; }
.mini-clock { display: inline-block; width: 52px; }
.mini-clock .clock .nums, .mini-clock .clock .ticks .tick:not(.big) { display: none; }

/* ---------- game ---------- */
.game-body { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.q-area { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.ask { font-size: 22px; font-weight: 800; margin: 0; }
.controls { display: flex; flex-direction: column; gap: 12px; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  min-height: 60px; border-radius: 18px; background: var(--card); border: 3px solid var(--line); font-size: 20px; font-weight: 800;
  padding: 8px 14px; box-shadow: 0 3px 0 var(--key-shadow); text-align: center;
}
.choice.digital { font-size: 28px; font-variant-numeric: tabular-nums; }
.choice:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--key-shadow); }
.choice:disabled { opacity: .6; }
.choice.ok { opacity: 1; border-color: var(--ok); background: var(--ok-soft); color: var(--ok-ink); }
.choice.bad { opacity: 1; border-color: var(--bad); background: var(--bad-soft); color: var(--bad-ink); }
.typed { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tbox { min-width: 76px; height: 70px; border-radius: 18px; border: 3px solid var(--line); background: var(--card); display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; }
.tbox.m { min-width: 96px; letter-spacing: 2px; }
.tbox.active { border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft); }
.typed .colon { color: var(--muted); }
.typed.ok .tbox { border-color: var(--ok); background: var(--ok-soft); color: var(--ok-ink); }
.typed.bad .tbox { border-color: var(--bad); background: var(--bad-soft); color: var(--bad-ink); }
/* Ketik Jam: the jam pad (4 × 3) and the menit pad (3 × 4) share one fixed box, so nothing above them moves. */
.pad-label { font-size: 15px; font-weight: 800; color: var(--muted); text-align: center; height: 30px; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ketik-pad .keypad { height: 286px; grid-auto-rows: 1fr; }
.ketik-pad .key { height: auto; }
.keypad.hours { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.keypad.hours .key { font-size: 28px; }
.right-box { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; }
.time-line { font-size: 20px; font-weight: 700; }
.time-line b { font-size: 24px; }
.atur-ask { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--acc-soft); color: var(--acc-ink); border-radius: 18px; padding: 10px 18px; font-weight: 800; }
.atur-ask span { font-size: 15px; }
.atur-ask b { font-size: 24px; text-align: center; }
.atur-ask b.digital { font-size: 32px; font-variant-numeric: tabular-nums; }
.hand-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hb-group { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; color: var(--muted); }
.hb-row { display: flex; gap: 8px; }
.hand-btn { width: 56px; height: 48px; border-radius: 14px; background: var(--card); box-shadow: 0 2px 0 var(--key-shadow); font-size: 26px; font-weight: 800; touch-action: manipulation; }
.penjelasan { background: var(--card); border-radius: 22px; padding: 16px 18px; box-shadow: 0 2px 8px rgba(67, 20, 7, .10); display: flex; flex-direction: column; gap: 6px; }
.penjelasan .lbl { font-size: 17px; font-weight: 800; color: var(--bad-ink); }
.penjelasan .big { font-size: 22px; font-weight: 700; }
.penjelasan .big b { color: var(--ok-ink); }
.penjelasan .hint { margin: 4px 0 0; font-size: 17px; font-weight: 700; background: var(--brand-soft); color: var(--brand-ink); border-radius: 14px; padding: 10px 12px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 6px; }
.compare > div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.compare .clock { max-width: 150px; }
.cap { font-size: 14px; font-weight: 800; }
.cap.ok { color: var(--ok-ink); } .cap.bad { color: var(--bad-ink); }

/* ---------- Beranda ---------- */
.peta-sum { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mini-peta { display: grid; grid-template-columns: repeat(3, 14px); gap: 3px; padding: 4px; background: rgba(255, 255, 255, .9); border-radius: 8px; flex: none; }
.mini-peta i { width: 14px; height: 10px; border-radius: 3px; }
.learn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.learn-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; background: var(--card); border-radius: 20px; padding: 14px; box-shadow: var(--shadow); text-align: left; min-height: 120px; }
.learn-card .em { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-soft); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; }
.learn-card .em.mini-clock { background: none; }
.learn-card b { font-size: 18px; }
.learn-card small { font-size: 14px; color: var(--muted); font-weight: 600; }
.first-hello { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.jago-wrap { display: inline-flex; flex: none; }
.si-jago .sj-rim { fill: var(--brand); }
.si-jago .sj-face { fill: #FFFDF9; }
.si-jago .sj-bell { fill: var(--gold); stroke: #B45309; stroke-width: 3; }
.si-jago .sj-leg, .si-jago .sj-line { stroke: #2B1A10; stroke-width: 6; stroke-linecap: round; fill: none; }
.si-jago .sj-eye { fill: #2B1A10; }
.si-jago .sj-mouth { fill: #7C2D12; }
.si-jago .sj-cheek { fill: #FDA4AF; opacity: .8; }
.si-jago { animation: bob 2.4s ease-in-out infinite; }
.sj-hore { animation: hop .7s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px) rotate(-2deg); } }
@keyframes hop { 50% { transform: translateY(-8px) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .si-jago, .sj-hore { animation: none; } }

/* ---------- Pilih tahap ---------- */
.btn.quick { background: var(--brand); color: var(--on-brand); box-shadow: 0 3px 0 var(--brand-dark); }
.btn.quick:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--brand-dark); }
.tahap-row { display: flex; align-items: center; gap: 10px; }
.tahap-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 12px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); text-align: left; }
.tahap-btn .chk { width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: transparent; flex: none; }
.tahap-btn[aria-pressed="true"] { border-color: var(--acc); background: var(--acc-soft); }
.tahap-btn[aria-pressed="true"] .chk { background: var(--acc); border-color: var(--acc); color: var(--on-acc); }
.tahap-btn .txt { flex: 1; min-width: 0; }
.tahap-btn b { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 17px; }
.tahap-btn small { display: block; font-size: 14px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.saran { font-size: 12px; font-weight: 800; background: var(--brand); color: var(--on-brand); border-radius: 8px; padding: 1px 7px; }
.lv-dot { width: 28px; height: 28px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; }
.lv-dot.lv0 { background: none; box-shadow: inset 0 0 0 2px var(--line); }
.book-btn { color: var(--brand-ink); }
.tbl { position: relative; height: 56px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); font-size: 18px; font-weight: 800; width: 100%; }
.tbl[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); color: var(--on-acc); }

/* ---------- Hasil ---------- */
.change-row { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.again-row { align-items: center; gap: 10px; }
.again-row .mini-clock { width: 40px; flex: none; }
.again-row b { font-variant-numeric: tabular-nums; }
.again-row .a { flex: 1; text-align: right; }

/* ---------- Peta Kemampuan ---------- */
.peta-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 6px; background: var(--card); border-radius: 18px; padding: 10px; box-shadow: var(--shadow); align-items: center; }
.peta-grid .ph { font-size: 12px; font-weight: 800; color: var(--muted); text-align: center; line-height: 1.15; }
.peta-grid .rh b { display: block; font-size: 14px; line-height: 1.2; }
.peta-grid .rh small { font-size: 12px; color: var(--muted); font-weight: 700; }
.peta-grid .cell { height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; }
.peta-grid .cell.lv0 { box-shadow: inset 0 0 0 1px var(--line); }
.badge-chip { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- Belajar / Pelajaran / Jam Mainan ---------- */
.jago-say { display: flex; align-items: center; gap: 12px; }
.jago-say p { margin: 0; font-size: 17px; font-weight: 700; }
.say { flex: 1; background: var(--card); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); min-height: 84px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.say p { font-size: 18px; line-height: 1.35; }
.say b { color: var(--brand-ink); }
.mode-card.lesson .tag { width: 56px; font-size: 24px; }
.dots { display: flex; justify-content: center; gap: 8px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--brand); width: 26px; border-radius: 5px; }
.nav-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.try { display: flex; flex-direction: column; gap: 10px; }
.try:empty { display: none; }
.try-msg { margin: 0; font-weight: 800; font-size: 17px; text-align: center; min-height: 1.4em; }
.try-msg.ok { color: var(--ok-ink); } .try-msg.bad { color: var(--bad-ink); }
.readout { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.readout .digital.big { font-size: 44px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--brand-ink); }
.readout .utama { font-size: 22px; font-weight: 800; }
.mainan .clock-box .bulb, .game .clock-box .bulb { right: -10px; }

/* ---------- confetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall 1.8s ease-in forwards; }
@keyframes fall { to { top: 105%; transform: rotate(540deg) translateX(30px); } }
