/* =====================================================================
   PETUALANGAN DUNIA GARIS DAN SUDUT — style.css
   ===================================================================== */
:root {
  --ink: #1d3557; --ink2: #3d5a80; --paper: #fffdf6; --sky1: #8fd3f4; --sky2: #d9f4ff;
  --blue: #3a86ff; --blue-d: #2563c9; --orange: #ff9f1c; --orange-d: #d97f00; --green: #2ec4b6; --green-d: #1c9488;
  --pink: #ff5d8f; --purple: #8338ec; --gold: #ffd166; --gold-d: #e0a800; --red: #e63946; --ok: #2fbf71; --bad: #ef476f;
  --f1: rgba(58, 134, 255, .30); --f2: rgba(255, 159, 28, .38); --f3: rgba(46, 196, 182, .35);
  --radius: 20px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", "Nunito", system-ui, -apple-system, sans-serif;
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 60%, #effbe9 100%) fixed;
  font-size: 17px; line-height: 1.5; overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 4px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Latar fantasi ---------- */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sun { position: absolute; top: 70px; right: 8%; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, #fff6b0 30%, #ffd166 70%); box-shadow: 0 0 60px 20px rgba(255, 209, 102, .55); }
.cloud { position: absolute; height: 46px; width: 130px; background: #fff; border-radius: 50px; opacity: .92; animation: drift 60s linear infinite; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 60px; height: 60px; top: -28px; left: 20px; }
.cloud::after { width: 46px; height: 46px; top: -20px; left: 68px; }
.c1 { top: 12%; left: -160px; }
.c2 { top: 30%; left: -160px; animation-duration: 90s; animation-delay: -35s; transform: scale(.7); }
.c3 { top: 52%; left: -160px; animation-duration: 75s; animation-delay: -60s; transform: scale(.55); }
@keyframes drift { to { left: 110%; } }
.hills { position: absolute; bottom: 0; left: 0; width: 100%; height: 160px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  background: rgba(255, 253, 246, .92); backdrop-filter: blur(6px); border-bottom: 4px solid var(--ink);
}
.brand { font-weight: 900; font-size: 1.1rem; margin-right: auto; white-space: nowrap; }
.ibtn {
  width: 44px; height: 44px; border-radius: 14px; border: 3px solid var(--ink); background: #fff; font-size: 1.25rem; line-height: 1;
  box-shadow: 0 4px 0 var(--ink); transition: transform .1s, box-shadow .1s;
}
.ibtn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.ibtn.off { opacity: .6; }
.chip { display: inline-block; padding: 4px 12px; border-radius: 999px; background: #fff; border: 3px solid var(--ink); font-weight: 700; font-size: .9rem; }
.chip.big { background: var(--gold); font-size: .95rem; }
.score { background: var(--gold); }

/* ---------- Tata letak ---------- */
#app { position: relative; z-index: 1; max-width: 980px; margin: 0 auto; padding: 18px 14px 120px; }
.screen { animation: pop .35s ease both; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.title { font-size: clamp(1.5rem, 4vw, 2.1rem); margin: .2em 0 .4em; text-align: center; text-shadow: 0 3px 0 #fff; }
.sub { text-align: center; margin: .8em 0 .4em; }
.lead { text-align: center; margin: 0 0 14px; font-weight: 600; }
.muted { color: var(--ink2); font-size: .9rem; }
.row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 18px 0; }
.panel { background: var(--paper); border: 4px solid var(--ink); border-radius: var(--radius); box-shadow: 0 8px 0 rgba(29, 53, 87, .25); padding: 16px 20px; }
.prose ol, .prose ul { padding-left: 1.3em; }
.prose li { margin: .4em 0; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px;
  border: 4px solid var(--ink); border-radius: 16px; background: #fff; font-weight: 800; font-size: 1rem;
  box-shadow: 0 6px 0 var(--ink); transition: transform .1s, box-shadow .1s, filter .15s; text-align: center;
}
.btn:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-2px); box-shadow: 0 8px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.btn:disabled { opacity: .5; box-shadow: 0 3px 0 var(--ink); transform: translateY(3px); }
.btn.primary { background: var(--blue); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.btn.gold { background: var(--gold); }
.btn.warn { background: #ffe0e6; }
.btn.big { min-height: 66px; font-size: 1.2rem; border-radius: 20px; }

/* ---------- Menu utama ---------- */
.hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px; margin: 6px 0 20px; }
.logo { display: flex; flex-direction: column; align-items: center; text-align: center; }
.logo-top { font-weight: 900; letter-spacing: .12em; color: var(--ink); font-size: clamp(1rem, 3vw, 1.5rem); }
.logo-big {
  font-weight: 900; font-size: clamp(2.6rem, 10vw, 5rem); line-height: 1; color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--ink), 0 10px 0 rgba(29, 53, 87, .25); transform: rotate(-2deg); margin: 6px 0;
}
.logo-sub { background: var(--paper); border: 3px solid var(--ink); border-radius: 999px; padding: 3px 16px; font-weight: 700; font-size: .95rem; }
.hero-char { display: flex; align-items: flex-end; gap: 6px; }
.avatar { width: 120px; height: 150px; animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.bubble { position: relative; max-width: 220px; background: #fff; border: 4px solid var(--ink); border-radius: 18px; padding: 10px 14px; font-weight: 700; font-size: .95rem; margin-bottom: 70px; }
.bubble::before { content: ""; position: absolute; left: -14px; bottom: 16px; border: 8px solid transparent; border-right: 12px solid var(--ink); }
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; max-width: 720px; margin: 0 auto; }
.menu-grid .btn:first-child { grid-column: 1 / -1; background: var(--orange); font-size: 1.5rem; min-height: 78px; }
.menu-stat { text-align: center; font-weight: 700; margin-top: 22px; }

/* ---------- Peta ---------- */
.map {
  position: relative; width: 100%; aspect-ratio: 16 / 9; border: 5px solid var(--ink); border-radius: 28px; overflow: hidden;
  background: linear-gradient(180deg, #bfeaff 0%, #d8f7d3 45%, #9be3a4 100%); box-shadow: 0 10px 0 rgba(29, 53, 87, .3);
}
.mpath { position: absolute; inset: 0; width: 100%; height: 100%; }
.mpath path { fill: none; stroke: #fff; stroke-width: 10; stroke-linecap: round; stroke-dasharray: 2 14; vector-effect: non-scaling-stroke; opacity: .95; }
.mpath.pm { display: none; }
.node {
  position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); transform: translate(-50%, -50%); border: 0; background: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0; width: 120px;
}
.orb {
  width: 76px; height: 76px; border-radius: 50%; background: var(--c); border: 5px solid var(--ink); display: grid; place-items: center; font-size: 2.1rem;
  box-shadow: 0 7px 0 var(--ink), inset 0 -8px 0 rgba(0, 0, 0, .15); transition: transform .15s;
}
.node:hover:not(.locked) .orb { transform: scale(1.1) rotate(-4deg); }
.node.locked .orb { background: #aeb8c4; filter: grayscale(.6); }
.node.done .orb::after { content: "✔"; position: absolute; top: -4px; right: 14px; background: var(--ok); color: #fff; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--ink); font-size: .9rem; display: grid; place-items: center; }
.orb { position: relative; }
.nlabel { background: var(--paper); border: 3px solid var(--ink); border-radius: 12px; padding: 1px 8px; font-size: .78rem; line-height: 1.25; font-weight: 700; margin-top: 6px; }
.stars { font-size: 1.1rem; letter-spacing: 1px; text-shadow: 0 2px 0 #fff; }
.st { color: #c7ced6; } .st.on { color: var(--gold-d); -webkit-text-stroke: .5px var(--ink); }
.walker { position: absolute; top: -78px; left: 50%; transform: translateX(-50%); animation: bob 1.6s ease-in-out infinite; pointer-events: none; }
.walker .avatar { width: 54px; height: 68px; animation: none; }

/* ---------- Materi ---------- */
.lv-head { display: flex; align-items: center; gap: 14px; background: var(--c); color: #fff; border: 4px solid var(--ink); border-radius: var(--radius); padding: 12px 18px; box-shadow: 0 6px 0 rgba(29, 53, 87, .35); margin-bottom: 16px; }
.lv-head h2 { margin: 0; font-size: clamp(1.2rem, 3.4vw, 1.7rem); text-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.lv-head small { font-weight: 700; opacity: .95; }
.lv-emoji { font-size: 2.6rem; }
.card { background: var(--paper); border: 4px solid var(--ink); border-radius: var(--radius); box-shadow: 0 8px 0 rgba(29, 53, 87, .25); padding: 14px 20px 18px; margin-bottom: 16px; animation: pop .3s ease both; }
.card h3 { margin: 4px 0 8px; font-size: 1.3rem; color: var(--blue-d); }
.card-body p { margin: .4em 0; }
.card-body ul, .card-body ol { margin: .4em 0; padding-left: 1.3em; }
.pager-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.pager-nav span { font-weight: 800; }
.mission-list { margin-top: 14px; text-align: center; }
.mission-list .chip { margin: 4px; background: #fff; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 8px; }
.tab { border: 3px solid var(--ink); border-radius: 14px; background: #fff; padding: 8px 14px; font-weight: 800; box-shadow: 0 4px 0 var(--ink); }
.tab.on { background: var(--gold); transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.mini { margin: 0; text-align: center; background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 6px; font-size: .88rem; }
.tbl { width: 100%; border-collapse: collapse; margin-top: 10px; }
.tbl td { border: 2px solid var(--ink); padding: 6px 10px; }
.tbl td:first-child { font-weight: 700; background: #fff6d6; }
.sl { display: flex; align-items: center; gap: 10px; font-weight: 800; margin: 8px 0; }
.sl input { flex: 1; height: 28px; accent-color: var(--orange); }
.readout { background: #fff6d6; border: 3px solid var(--ink); border-radius: 12px; padding: 8px 12px; font-weight: 600; }

/* ---------- Diagram matematika (SVG) ---------- */
.dgbox { background: #fff; border: 4px solid var(--ink); border-radius: 18px; padding: 6px; margin: 10px auto; max-width: 520px; }
.dgbox.sm { max-width: 340px; border-width: 3px; }
.dgbox.xs { max-width: 150px; border-width: 2px; margin: 0; padding: 0; border-radius: 10px; }
.dg { display: block; width: 100%; height: auto; }
.dg-line { stroke: var(--ink); stroke-width: 3.4; stroke-linecap: round; fill: none; }
.dg-line.thick { stroke-width: 5; }
.dg-line.ladder { stroke: #a0522d; stroke-width: 6; }
.dg-rung { stroke: #a0522d; stroke-width: 3; stroke-linecap: round; }
.dg-tie { stroke: #8d6e63; stroke-width: 8; stroke-linecap: round; }
.dg-arrow { fill: var(--ink); }
.dg-dot { fill: var(--ink); stroke: #fff; stroke-width: 2; }
.dg-arc { fill: none; stroke: #e63946; stroke-width: 3.4; stroke-linecap: round; }
.dg-right { fill: none; stroke: #e63946; stroke-width: 3; stroke-linejoin: miter; }
.dg-chev { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.dg-fill.f1 { fill: var(--f1); } .dg-fill.f2 { fill: var(--f2); } .dg-fill.f3 { fill: var(--f3); }
.dg-label { font: 800 15px "Trebuchet MS", system-ui, sans-serif; fill: #8f1d2c; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.dg-label.hi { fill: #0b3d91; }
.dg-label.unk { fill: #b45309; font-size: 16px; }
.dg-pt { font: 900 17px "Trebuchet MS", system-ui, sans-serif; fill: var(--ink); paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.dg-name { font: italic 800 17px Georgia, serif; fill: var(--purple); paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.dg-note { font: 700 13px system-ui, sans-serif; fill: var(--ink2); }
.pr-body { fill: rgba(190, 235, 255, .55); stroke: var(--ink); stroke-width: 3; }
.pr-inner { fill: none; stroke: rgba(29, 53, 87, .35); stroke-width: 1.5; }
.pr-tick { stroke: var(--ink); stroke-width: 1; } .pr-tick.maj { stroke-width: 1.8; }
.pr-num { font: 700 11px system-ui, sans-serif; fill: var(--ink); }
.ck-face { fill: #fff; stroke: var(--ink); stroke-width: 5; }
.ck-tick { stroke: var(--ink2); stroke-width: 1.5; } .ck-tick.maj { stroke: var(--ink); stroke-width: 3; }
.ck-num { font: 800 15px system-ui, sans-serif; fill: var(--ink); }
.ck-hour { stroke: var(--ink); stroke-width: 7; stroke-linecap: round; }
.ck-min { stroke: var(--red); stroke-width: 4; stroke-linecap: round; }
/* animasi pembentukan sudut */
.swing { animation: swing .9s cubic-bezier(.3, .7, .3, 1) both; }
@keyframes swing { from { transform: rotate(var(--from)); } to { transform: rotate(0); } }
.fade-late { animation: fadein .45s .8s both; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.anim-arc { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .6s .75s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Bermain ---------- */
.track { display: flex; align-items: flex-end; justify-content: center; gap: 0; margin: 4px 0 14px; padding-top: 56px; }
.tstep { position: relative; width: 52px; height: 52px; border-radius: 50%; background: #fff; border: 4px solid var(--ink); display: grid; place-items: center; font-size: 1.4rem; box-shadow: 0 4px 0 var(--ink); flex: none; }
.tstep.done { background: #c6f6d5; } .tstep.cur { background: var(--gold); transform: scale(1.12); } .tstep.boss { border-color: var(--red); }
.tline { flex: 1; min-width: 12px; max-width: 54px; height: 0; border-top: 5px dotted var(--ink); margin-bottom: 22px; }
.tav { position: absolute; bottom: 44px; left: 50%; transform: translateX(-50%); animation: bob 1.4s ease-in-out infinite; }
.tav .avatar { width: 42px; height: 54px; animation: none; }
.qhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.qcount { margin-left: auto; font-weight: 800; }
.qpts { font-weight: 900; background: var(--gold); border: 3px solid var(--ink); border-radius: 999px; padding: 0 12px; }
.progress { height: 16px; background: #fff; border: 3px solid var(--ink); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.progress i { display: block; height: 100%; background: repeating-linear-gradient(45deg, var(--green) 0 12px, #46d9cb 12px 24px); transition: width .4s; }
.qcard { background: var(--paper); border: 4px solid var(--ink); border-radius: var(--radius); box-shadow: 0 8px 0 rgba(29, 53, 87, .25); padding: 16px 18px 20px; }
.qprompt { margin: 0 0 6px; font-size: clamp(1.05rem, 2.8vw, 1.3rem); line-height: 1.4; }
.opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 12px; }
.opt { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 14px; text-align: left; font-weight: 700; background: #fff; border: 4px solid var(--ink); border-radius: 16px; box-shadow: 0 5px 0 var(--ink); transition: transform .1s, box-shadow .1s, background .15s; }
.opt:hover:not(:disabled) { background: #eaf3ff; transform: translateY(-2px); }
.opt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.ol { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--gold); border: 3px solid var(--ink); display: grid; place-items: center; font-weight: 900; font-size: .9rem; }
.opt.right { background: #c6f6d5; border-color: #14803c; animation: bounce .5s; }
.opt.wrong { background: #ffd6de; border-color: #b4163f; animation: shake .4s; }
.opt:disabled:not(.right):not(.wrong) { opacity: .6; }
.opt.chosen { background: #dbe9ff; border-color: var(--blue-d); }
.numrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.numrow input { flex: 1; min-width: 150px; max-width: 260px; height: 56px; font-size: 1.5rem; font-weight: 800; text-align: center; border: 4px solid var(--ink); border-radius: 16px; background: #fff; color: var(--ink); }
.numrow input.right { background: #c6f6d5; } .numrow input.wrong { background: #ffd6de; }
.unit { font-size: 1.5rem; font-weight: 900; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes bounce { 40% { transform: scale(1.04); } }
.hint { font-weight: 600; color: var(--ink2); margin: 8px 0; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.mcol { display: grid; gap: 10px; }
.mi { min-height: 54px; padding: 8px 12px; border: 4px solid var(--ink); border-radius: 14px; background: #fff; font-weight: 800; box-shadow: 0 4px 0 var(--ink); display: flex; align-items: center; justify-content: center; text-align: center; transition: background .15s; }
.mi:hover { background: #eaf3ff; }
.mi.sel { background: var(--gold); transform: scale(1.03); }
.mi.paired.pc0 { background: #ffd6a5; } .mi.paired.pc1 { background: #caffbf; } .mi.paired.pc2 { background: #bdb2ff; } .mi.paired.pc3 { background: #ffc6ff; } .mi.paired.pc4 { background: #9bf6ff; }
.mi.right { background: #c6f6d5 !important; border-color: #14803c; } .mi.wrong { background: #ffd6de !important; border-color: #b4163f; }
.feedback { margin-top: 16px; border: 4px solid var(--ink); border-radius: var(--radius); padding: 14px 18px; animation: pop .3s ease both; }
.feedback.ok { background: #d8f8e3; } .feedback.bad { background: #ffe6ea; }
.feedback h3 { margin: 0 0 6px; font-size: 1.25rem; }
.feedback .expl, .rv .expl { background: rgba(255, 255, 255, .75); border-radius: 12px; padding: 8px 12px; margin: 8px 0 12px; }
.ans { margin: 4px 0; }

/* ---------- Hasil ---------- */
.result { text-align: center; }
.starsbig { font-size: clamp(3rem, 12vw, 5rem); line-height: 1; letter-spacing: 6px; color: #cbd2da; -webkit-text-stroke: 3px var(--ink); margin: 6px 0 12px; }
.starsbig span { display: inline-block; }
.starsbig span.on { color: var(--gold); animation: starpop .6s both; }
@keyframes starpop { 0% { transform: scale(0) rotate(-90deg); } 70% { transform: scale(1.3) rotate(10deg); } 100% { transform: scale(1); } }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; max-width: 640px; margin: 0 auto; }
.stat { background: var(--paper); border: 4px solid var(--ink); border-radius: 18px; padding: 10px 6px; box-shadow: 0 5px 0 rgba(29, 53, 87, .25); }
.stat b { display: block; font-size: 2rem; line-height: 1.1; } .stat small { font-weight: 700; color: var(--ink2); }
.stat.good b { color: #14803c; } .stat.bad b { color: #b4163f; }
.msg { font-weight: 700; font-size: 1.1rem; margin: 16px auto 4px; max-width: 640px; } .msg.warn { color: #b4163f; }
.btns { margin-top: 10px; }
.review { text-align: left; margin-top: 18px; background: var(--paper); border: 4px solid var(--ink); border-radius: var(--radius); padding: 10px 16px; }
.review summary { cursor: pointer; font-weight: 800; }
.rv { border-top: 3px dashed var(--ink2); padding: 12px 0; text-align: left; }
.rv.okr { background: rgba(198, 246, 213, .35); } .rv.badr { background: rgba(255, 214, 222, .35); }
.rv-h { font-weight: 900; margin-bottom: 4px; }
.rv-p { font-weight: 600; }
.score-ring { --p: 0; width: 170px; height: 170px; border-radius: 50%; margin: 10px auto 18px; display: grid; place-items: center; background: conic-gradient(var(--green) calc(var(--p) * 1%), #dfe6ee 0); border: 4px solid var(--ink); }
.score-ring > div { width: 124px; height: 124px; border-radius: 50%; background: var(--paper); border: 4px solid var(--ink); display: grid; place-content: center; }
.score-ring b { font-size: 2.6rem; line-height: 1; } .score-ring small { font-weight: 700; }
.diff { display: inline-block; padding: 1px 10px; border-radius: 999px; border: 3px solid var(--ink); font-size: .8rem; font-weight: 800; background: #fff; }
.diff.d1 { background: #c6f6d5; } .diff.d2 { background: #ffe9a8; } .diff.d3 { background: #ffc2cd; }
.dots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 16px; }
.dot { width: 38px; height: 38px; border-radius: 10px; border: 3px solid var(--ink); background: #fff; font-weight: 800; }
.dot.ans { background: #c6f6d5; } .dot.cur { background: var(--gold); transform: scale(1.12); }
.best { font-weight: 800; background: #fff6d6; border: 3px solid var(--ink); border-radius: 12px; padding: 6px 12px; display: inline-block; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.topic { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 10px; background: var(--paper); border: 4px solid var(--ink); border-radius: var(--radius); box-shadow: 0 7px 0 var(--ink); transition: transform .12s; }
.topic:hover { transform: translateY(-4px) rotate(-1deg); background: #fff6d6; }
.topic .te { font-size: 2.4rem; } .topic small { color: var(--ink2); font-weight: 700; }

/* ---------- Modal, toast, confetti ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(29, 53, 87, .6); display: grid; place-items: center; padding: 16px; }
.mbox { width: min(440px, 100%); background: var(--paper); border: 5px solid var(--ink); border-radius: 24px; padding: 18px 20px; box-shadow: 0 10px 0 rgba(0, 0, 0, .3); animation: pop .25s both; }
.mbox h3 { margin: 0 0 8px; font-size: 1.4rem; }
.mact { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.sw { display: flex; align-items: center; gap: 12px; font-weight: 800; margin: 10px 0; }
.sw input { width: 26px; height: 26px; accent-color: var(--green); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); z-index: 60; max-width: 92vw; background: var(--ink); color: #fff; font-weight: 700; padding: 10px 18px; border-radius: 14px; border: 3px solid #fff; transition: transform .3s; }
.toast.show { transform: translate(-50%, 0); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 12px; height: 18px; border-radius: 3px; animation: fall 3s linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- Sertifikat ---------- */
.namebox { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; font-weight: 800; margin-bottom: 14px; }
.namebox input { height: 48px; min-width: 240px; padding: 0 14px; font-size: 1.1rem; font-weight: 700; border: 4px solid var(--ink); border-radius: 14px; }
.cert { background: linear-gradient(135deg, #fffbe6, #fff2c4); border: 8px double #b8860b; border-radius: 16px; padding: 10px; box-shadow: 0 10px 0 rgba(29, 53, 87, .3); }
.cert-in { border: 3px solid #b8860b; border-radius: 10px; padding: 22px 16px; text-align: center; position: relative; }
.cert-ribbon { font-size: 3.4rem; line-height: 1; }
.cert-top { font-weight: 900; letter-spacing: .25em; color: #8a6508; font-size: .95rem; }
.cert h1 { margin: 6px 0 10px; font-size: clamp(1.4rem, 4.8vw, 2.4rem); color: var(--ink); }
.cert-name { font: italic 900 clamp(1.8rem, 6vw, 3rem) Georgia, serif; color: var(--purple); border-bottom: 3px solid #b8860b; display: inline-block; padding: 2px 28px; margin: 6px 0 10px; min-width: 60%; }
.cert p { margin: .4em 0; }
.cert-stats { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 14px 0; }
.cert-stats div { background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 6px 16px; min-width: 100px; }
.cert-stats b { display: block; font-size: 1.4rem; } .cert-stats small { font-weight: 700; color: var(--ink2); }
.cert-title { display: inline-block; background: var(--gold); border: 3px solid var(--ink); border-radius: 999px; padding: 6px 22px; font-weight: 900; font-size: 1.2rem; margin: 6px 0; }
.cert-date { font-weight: 700; color: var(--ink2); }

/* ---------- Responsif ---------- */
@media (max-width: 700px) {
  body { font-size: 16px; }
  .brand span { display: none; }
  .map { aspect-ratio: 9 / 14; }
  .mpath.pd { display: none; } .mpath.pm { display: block; }
  .node { left: calc(var(--mx) * 1%); top: calc(var(--my) * 1%); width: 110px; }
  .orb { width: 66px; height: 66px; font-size: 1.8rem; }
  .menu-grid { grid-template-columns: 1fr; }
  .bubble { margin-bottom: 20px; max-width: 180px; }
  .hero-char { flex-direction: column; align-items: center; } .bubble::before { display: none; }
  .opts { grid-template-columns: 1fr; }
  .match { gap: 8px; }
  .tstep { width: 42px; height: 42px; font-size: 1.1rem; }
  .qcount { margin-left: 0; }
}
@media (max-width: 380px) { .dgbox.xs { max-width: 110px; } .mi { padding: 6px; font-size: .9rem; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .anim-arc { stroke-dashoffset: 0; }
}

/* ---------- Cetak sertifikat ---------- */
@page { size: A4 landscape; margin: 10mm; }
@media print {
  body { background: #fff !important; }
  .bg, .topbar, .noprint, .toast, .modal, .confetti { display: none !important; }
  #app { padding: 0; max-width: none; }
  .cert { box-shadow: none; break-inside: avoid; }
}
